diff --git a/suite2cases/function_test/pkg_test/blktrace/blktrace-help.json b/suite2cases/function_test/pkg_test/blktrace/blktrace-help.json index 55089509e94..8cb06aae627 100644 --- a/suite2cases/function_test/pkg_test/blktrace/blktrace-help.json +++ b/suite2cases/function_test/pkg_test/blktrace/blktrace-help.json @@ -9,18 +9,6 @@ { "name": "test_blktrace-help_function_uninstall", "desc": "测试blktrace-help软件包是否能够成功卸载" - }, - { - "name": "test_blktrace-help_function_check_installed", - "desc": "验证blktrace-help软件包是否已正确安装" - }, - { - "name": "test_blktrace-help_function_display_help", - "desc": "测试执行blktrace-help命令是否能正常显示帮助信息" - }, - { - "name": "test_blktrace-help_function_man_page", - "desc": "验证blktrace-help软件包提供的man手册页是否存在且可读" } ] } \ No newline at end of file diff --git a/suite2cases/function_test/pkg_test/culmus-fonts/culmus-shofar-fonts.json b/suite2cases/function_test/pkg_test/culmus-fonts/culmus-shofar-fonts.json index 65a09732905..ae456641ed4 100644 --- a/suite2cases/function_test/pkg_test/culmus-fonts/culmus-shofar-fonts.json +++ b/suite2cases/function_test/pkg_test/culmus-fonts/culmus-shofar-fonts.json @@ -14,14 +14,6 @@ "name": "test_culmus-shofar-fonts_function_font_files", "desc": "测试检查软件包安装的字体文件是否存在。" }, - { - "name": "test_culmus-shofar-fonts_function_fontconfig", - "desc": "测试字体配置系统是否能正确识别并列出culmus-shofar字体。" - }, - { - "name": "test_culmus-shofar-fonts_function_app_usage", - "desc": "测试在支持字体选择的应用程序中能否使用culmus-shofar字体。" - }, { "name": "test_culmus-shofar-fonts_function_uninstall", "desc": "测试通过包管理器卸载culmus-shofar-fonts软件包。" diff --git a/suite2cases/function_test/pkg_test/nagios-plugins/nagios-plugins-nagios.json b/suite2cases/function_test/pkg_test/nagios-plugins/nagios-plugins-nagios.json deleted file mode 100644 index fe962280931..00000000000 --- a/suite2cases/function_test/pkg_test/nagios-plugins/nagios-plugins-nagios.json +++ /dev/null @@ -1,22 +0,0 @@ -{ - "path": "$OET_PATH/testcases/function_test/pkg_test/nagios-plugins/nagios-plugins-nagios", - "machine num": 1, - "cases": [ - { - "name": "test_nagios-plugins-nagios_function_check_disk", - "desc": "Verify disk usage monitoring functionality" - }, - { - "name": "test_nagios-plugins-nagios_function_check_cpu", - "desc": "Verify CPU usage monitoring functionality" - }, - { - "name": "test_nagios-plugins-nagios_function_check_mem", - "desc": "Verify memory usage monitoring functionality" - }, - { - "name": "test_nagios-plugins-nagios_function_check_net", - "desc": "Verify network connectivity monitoring functionality" - } - ] -} \ No newline at end of file diff --git a/suite2cases/function_test/pkg_test/ocaml-cppo/ocaml-cppo.json b/suite2cases/function_test/pkg_test/ocaml-cppo/ocaml-cppo.json index b78ca65efcd..24be6c76039 100644 --- a/suite2cases/function_test/pkg_test/ocaml-cppo/ocaml-cppo.json +++ b/suite2cases/function_test/pkg_test/ocaml-cppo/ocaml-cppo.json @@ -19,86 +19,14 @@ "name": "test_ocaml-cppo_function_no_line_dir", "desc": "测试使用 -n 参数不输出行指令的功能" }, - { - "name": "test_ocaml-cppo_cppo__upper_d", - "desc": "测试使用-D参数定义宏并处理输入文件" - }, - { - "name": "test_ocaml-cppo_cppo__upper_u", - "desc": "测试使用-U参数取消宏定义并处理输入文件" - }, - { - "name": "test_ocaml-cppo_cppo__upper_i", - "desc": "测试使用-I参数添加包含文件搜索目录并处理输入文件" - }, - { - "name": "test_ocaml-cppo_cppo__upper_v", - "desc": "测试使用-V参数根据语义化版本字符串定义相关变量并处理输入文件" - }, - { - "name": "test_ocaml-cppo_cppo_q", - "desc": "测试使用-q参数识别并保留camlp4引用并处理输入文件" - }, - { - "name": "test_ocaml-cppo_cppo_s", - "desc": "测试使用-s参数输出指向每个标记精确源代码位置的行指令并处理输入文件" - }, - { - "name": "test_ocaml-cppo_cppo_n", - "desc": "测试使用-n参数不输出任何行指令(覆盖-s参数)并处理输入文件" - }, { "name": "test_ocaml-cppo_cppo_version", "desc": "测试使用-version参数打印程序版本并退出" }, - { - "name": "test_ocaml-cppo_cppo_x", - "desc": "测试使用-x参数定义自定义预处理器目标段并处理输入文件" - }, - { - "name": "test_ocaml-cppo_cppo_help", - "desc": "测试使用-help参数显示选项列表" - }, { "name": "test_ocaml-cppo_cppo__help", "desc": "测试使用--help参数显示选项列表" }, - { - "name": "test_ocaml-cppo_cppo__upper_d__upper_u", - "desc": "测试组合使用-D和-U参数定义与取消宏定义并处理输入文件" - }, - { - "name": "test_ocaml-cppo_cppo__upper_i_o", - "desc": "测试组合使用-I和-o参数添加包含目录并指定输出文件处理输入文件" - }, - { - "name": "test_ocaml-cppo_cppo__upper_v_s", - "desc": "测试组合使用-V和-s参数定义版本变量并输出精确行指令处理输入文件" - }, - { - "name": "test_ocaml-cppo_cppo_q_n", - "desc": "测试组合使用-q和-n参数识别保留引用且不输出行指令处理输入文件" - }, - { - "name": "test_ocaml-cppo_cppo__upper_d__upper_i_o", - "desc": "测试组合使用-D、-I和-o参数定义宏、添加包含目录并指定输出文件处理输入文件" - }, - { - "name": "test_ocaml-cppo_function_install", - "desc": "测试 ocaml-cppo 软件包的安装功能,验证安装过程是否成功。" - }, - { - "name": "test_ocaml-cppo_function_basic_usage", - "desc": "测试 cppo 基本文件处理功能,验证标准输入输出处理" - }, - { - "name": "test_ocaml-cppo_function_define_macro", - "desc": "测试使用 -D 参数定义宏并处理文件" - }, - { - "name": "test_ocaml-cppo_function_version", - "desc": "测试使用 -version 参数打印程序版本" - }, { "name": "test_ocaml-cppo_function_help", "desc": "测试使用 -help 参数显示选项列表" diff --git a/suite2cases/function_test/pkg_test/openwebbeans/openwebbeans-resource.json b/suite2cases/function_test/pkg_test/openwebbeans/openwebbeans-resource.json index 81861f3e5f9..85efa183e4e 100644 --- a/suite2cases/function_test/pkg_test/openwebbeans/openwebbeans-resource.json +++ b/suite2cases/function_test/pkg_test/openwebbeans/openwebbeans-resource.json @@ -6,22 +6,6 @@ "name": "test_openwebbeans-resource_install", "desc": "测试openwebbeans-resource软件包的安装功能", "machine num": 1 - }, - { - "name": "test_openwebbeans-resource_function_load", - "desc": "测试openwebbeans-resource软件包的资源加载功能" - }, - { - "name": "test_openwebbeans-resource_function_config", - "desc": "测试openwebbeans-resource软件包的配置功能" - }, - { - "name": "test_openwebbeans-resource_function_inject", - "desc": "测试openwebbeans-resource软件包的依赖注入功能" - }, - { - "name": "test_openwebbeans-resource_function_scope", - "desc": "测试openwebbeans-resource软件包的作用域功能" } ] } \ No newline at end of file diff --git a/suite2cases/function_test/pkg_test/perl-Alien-Build/perl-Alien-Build-help.json b/suite2cases/function_test/pkg_test/perl-Alien-Build/perl-Alien-Build-help.json index 12656d8843a..659cbbe51e0 100644 --- a/suite2cases/function_test/pkg_test/perl-Alien-Build/perl-Alien-Build-help.json +++ b/suite2cases/function_test/pkg_test/perl-Alien-Build/perl-Alien-Build-help.json @@ -5,18 +5,6 @@ { "name": "test_perl-Alien-Build-help_function_install", "desc": "测试 perl-Alien-Build-help 软件包能否成功安装" - }, - { - "name": "test_perl-Alien-Build-help_function_version", - "desc": "测试 perl-Alien-Build-help 软件包是否能正确查询版本信息" - }, - { - "name": "test_perl-Alien-Build-help_function_usage", - "desc": "测试 perl-Alien-Build-help 软件包是否能显示基本用法或帮助信息" - }, - { - "name": "test_perl-Alien-Build-help_function_uninstall", - "desc": "测试 perl-Alien-Build-help 软件包能否被干净地卸载" } ] } \ No newline at end of file diff --git a/suite2cases/function_test/pkg_test/rrdtool/rrdtool-devel.json b/suite2cases/function_test/pkg_test/rrdtool/rrdtool-devel.json index 46a412bc63b..73dafc995e2 100644 --- a/suite2cases/function_test/pkg_test/rrdtool/rrdtool-devel.json +++ b/suite2cases/function_test/pkg_test/rrdtool/rrdtool-devel.json @@ -6,18 +6,6 @@ "name": "test_rrdtool-devel_function_install", "desc": "Test installation of rrdtool-devel package" }, - { - "name": "test_rrdtool-devel_function_verify_install", - "desc": "Verify rrdtool-devel package is installed" - }, - { - "name": "test_rrdtool-devel_function_check_files", - "desc": "Check existence of key header and lib files" - }, - { - "name": "test_rrdtool-devel_function_compile_test", - "desc": "Test compile a simple program with rrdtool libs" - }, { "name": "test_rrdtool-devel_function_uninstall", "desc": "Test uninstallation of rrdtool-devel package" diff --git a/suite2cases/function_test/pkg_test/rubygem-rr/rubygem-rr-doc.json b/suite2cases/function_test/pkg_test/rubygem-rr/rubygem-rr-doc.json index 35b26fac019..e3ccbeccb6c 100644 --- a/suite2cases/function_test/pkg_test/rubygem-rr/rubygem-rr-doc.json +++ b/suite2cases/function_test/pkg_test/rubygem-rr/rubygem-rr-doc.json @@ -6,10 +6,6 @@ "name": "test_rubygem-rr-doc_install", "desc": "测试软件包 rubygem-rr-doc 的安装功能,验证是否能够成功安装到系统中。", "machine num": 1 - }, - { - "name": "test_rubygem-rr-doc_function_load", - "desc": "测试软件包 rubygem-rr-doc 的加载功能,验证是否能够成功加载到系统中。" } ] } \ No newline at end of file diff --git a/suite2cases/function_test/pkg_test/tensorflow/python3-tensorflow.json b/suite2cases/function_test/pkg_test/tensorflow/python3-tensorflow.json index 1f02acef334..1fdf5a1b425 100644 --- a/suite2cases/function_test/pkg_test/tensorflow/python3-tensorflow.json +++ b/suite2cases/function_test/pkg_test/tensorflow/python3-tensorflow.json @@ -2,225 +2,9 @@ "path": "$OET_PATH/testcases/function_test/pkg_test/tensorflow/python3-tensorflow", "machine num": 1, "cases": [ - { - "name": "test_python3-tensorflow_estimator_ckpt_converter_h", - "desc": "测试 estimator_ckpt_converter 命令的 -h 参数,显示帮助信息" - }, - { - "name": "test_python3-tensorflow_estimator_ckpt_converter_v", - "desc": "测试 estimator_ckpt_converter 命令的 -v 参数,显示版本信息" - }, - { - "name": "test_python3-tensorflow_estimator_ckpt_converter_upper_v", - "desc": "测试 estimator_ckpt_converter 命令的 -V 参数,显示详细版本信息" - }, { "name": "test_python3-tensorflow_import_pb_to_tensorboard__", "desc": "测试 import_pb_to_tensorboard 命令不带参数时的行为" - }, - { - "name": "test_python3-tensorflow_saved_model_cli_helpfull", - "desc": "测试 saved_model_cli 的 --helpfull 参数,获取所有支持的标志列表" - }, - { - "name": "test_python3-tensorflow_tensorboard_logdir", - "desc": "测试使用 --logdir 参数指定日志目录" - }, - { - "name": "test_python3-tensorflow_tensorboard_host", - "desc": "测试使用 --host 参数指定监听地址" - }, - { - "name": "test_python3-tensorflow_tensorboard_bind_all", - "desc": "测试使用 --bind_all 参数在所有公共接口上提供服务" - }, - { - "name": "test_python3-tensorflow_tensorboard_port", - "desc": "测试使用 --port 参数指定服务端口" - }, - { - "name": "test_python3-tensorflow_tensorboard_reuse_port", - "desc": "测试使用 --reuse_port 参数启用端口重用" - }, - { - "name": "test_python3-tensorflow_tensorboard_load_fast", - "desc": "测试使用 --load_fast 参数启用快速加载模式" - }, - { - "name": "test_python3-tensorflow_tensorboard_purge_orphaned_data", - "desc": "测试使用 --purge_orphaned_data 参数控制是否清理孤立数据" - }, - { - "name": "test_python3-tensorflow_tensorboard_inspect", - "desc": "测试使用 --inspect 参数检查事件文件摘要" - }, - { - "name": "test_python3-tensorflow_tensorboard_version_tb", - "desc": "测试使用 --version_tb 参数打印 TensorBoard 版本" - }, - { - "name": "test_python3-tensorflow_tf_upgrade_v2_infile_outfile", - "desc": "测试单个文件转换功能" - }, - { - "name": "test_python3-tensorflow_tf_upgrade_v2_intree_outtree", - "desc": "测试整个目录树转换功能" - }, - { - "name": "test_python3-tensorflow_tf_upgrade_v2_copyotherfiles", - "desc": "测试转换时是否复制其他文件" - }, - { - "name": "test_python3-tensorflow_tf_upgrade_v2_inplace", - "desc": "测试是否允许直接在输入文件上进行转换" - }, - { - "name": "test_python3-tensorflow_tf_upgrade_v2_no_import_rename", - "desc": "测试是否不重命名导入为compat.v2" - }, - { - "name": "test_python3-tensorflow_tf_upgrade_v2_no_upgrade_compat_v1_import", - "desc": "测试是否不升级显式导入tensorflow.compat.v1为v2 API" - }, - { - "name": "test_python3-tensorflow_tf_upgrade_v2_reportfile", - "desc": "测试报告日志文件的存储名称" - }, - { - "name": "test_python3-tensorflow_tf_upgrade_v2_mode_default", - "desc": "测试升级脚本的默认模式" - }, - { - "name": "test_python3-tensorflow_tf_upgrade_v2_mode_safety", - "desc": "测试升级脚本的安全模式" - }, - { - "name": "test_python3-tensorflow_tf_upgrade_v2_print_all", - "desc": "测试是否打印完整日志到标准输出" - }, - { - "name": "test_python3-tensorflow_tflite_convert_output_file", - "desc": "测试 tflite_convert 命令的 --output_file 参数" - }, - { - "name": "test_python3-tensorflow_tflite_convert_saved_model_dir", - "desc": "测试 tflite_convert 命令的 --saved_model_dir 参数" - }, - { - "name": "test_python3-tensorflow_tflite_convert_keras_model_file", - "desc": "测试 tflite_convert 命令的 --keras_model_file 参数" - }, - { - "name": "test_python3-tensorflow_tflite_convert_saved_model_tag_set", - "desc": "测试 tflite_convert 命令的 --saved_model_tag_set 参数" - }, - { - "name": "test_python3-tensorflow_tflite_convert_saved_model_signature_key", - "desc": "测试 tflite_convert 命令的 --saved_model_signature_key 参数" - }, - { - "name": "test_python3-tensorflow_tflite_convert_enable_v1_converter", - "desc": "测试 tflite_convert 命令的 --enable_v1_converter 参数" - }, - { - "name": "test_python3-tensorflow_tflite_convert_experimental_new_converter", - "desc": "测试 tflite_convert 命令的 --experimental_new_converter 参数" - }, - { - "name": "test_python3-tensorflow_tflite_convert_experimental_new_quantizer", - "desc": "测试 tflite_convert 命令的 --experimental_new_quantizer 参数" - }, - { - "name": "test_python3-tensorflow_toco_output_file", - "desc": "测试 toco 命令的 --output_file 参数" - }, - { - "name": "test_python3-tensorflow_toco_saved_model_dir", - "desc": "测试 toco 命令的 --saved_model_dir 参数" - }, - { - "name": "test_python3-tensorflow_toco_keras_model_file", - "desc": "测试 toco 命令的 --keras_model_file 参数" - }, - { - "name": "test_python3-tensorflow_toco_saved_model_tag_set", - "desc": "测试 toco 命令的 --saved_model_tag_set 参数" - }, - { - "name": "test_python3-tensorflow_toco_saved_model_signature_key", - "desc": "测试 toco 命令的 --saved_model_signature_key 参数" - }, - { - "name": "test_python3-tensorflow_toco_enable_v1_converter", - "desc": "测试 toco 命令的 --enable_v1_converter 参数" - }, - { - "name": "test_python3-tensorflow_toco_experimental_new_converter", - "desc": "测试 toco 命令的 --experimental_new_converter 参数" - }, - { - "name": "test_python3-tensorflow_toco_experimental_new_quantizer", - "desc": "测试 toco 命令的 --experimental_new_quantizer 参数" - }, - { - "name": "test_python3-tensorflow_toco_from_protos_model_proto_file", - "desc": "测试使用 model_proto_file 参数进行 TOCO 转换" - }, - { - "name": "test_python3-tensorflow_toco_from_protos_toco_proto_file", - "desc": "测试使用 toco_proto_file 参数进行 TOCO 转换" - }, - { - "name": "test_python3-tensorflow_toco_from_protos_model_input_file", - "desc": "测试使用 model_input_file 参数进行 TOCO 转换" - }, - { - "name": "test_python3-tensorflow_toco_from_protos_model_output_file", - "desc": "测试使用 model_output_file 参数进行 TOCO 转换" - }, - { - "name": "test_python3-tensorflow_toco_from_protos_debug_proto_file", - "desc": "测试使用 debug_proto_file 选项进行 TOCO 转换" - }, - { - "name": "test_python3-tensorflow_toco_from_protos_enable_mlir_converter", - "desc": "测试启用 MLIR 转换器进行 TOCO 转换" - }, - { - "name": "test_python3-tensorflow_function_keras_model", - "desc": "Test Keras model loading and saving functionality" - }, - { - "name": "test_python3-tensorflow_estimator_ckpt_converter_help", - "desc": "测试 estimator_ckpt_converter 命令的帮助文档是否正常显示" - }, - { - "name": "test_python3-tensorflow_estimator_ckpt_converter_version", - "desc": "测试 estimator_ckpt_converter 命令的版本信息是否正常显示" - }, - { - "name": "test_python3-tensorflow_tensorboard_path_prefix", - "desc": "测试使用--path_prefix参数设置路径前缀" - }, - { - "name": "test_python3-tensorflow_tensorboard_window_title", - "desc": "测试使用--window_title参数更改浏览器窗口标题" - }, - { - "name": "test_python3-tensorflow_tensorboard_reload_interval_num_0", - "desc": "测试使用--reload_interval=0参数仅在启动时加载一次数据" - }, - { - "name": "test_python3-tensorflow_tensorboard_special_helpfull", - "desc": "测试使用--helpfull参数显示完整帮助信息" - }, - { - "name": "test_python3-tensorflow_toco_from_protos_basic", - "desc": "测试 toco_from_protos 基本功能,包含必需的四个参数" - }, - { - "name": "test_python3-tensorflow_function_keras_save", - "desc": "Test saving a Keras model to a file" } ] } \ No newline at end of file diff --git a/suite2cases/function_test/pkg_test/texlive-split-d/texlive-borceux-doc.json b/suite2cases/function_test/pkg_test/texlive-split-d/texlive-borceux-doc.json deleted file mode 100644 index 7d2a4866b32..00000000000 --- a/suite2cases/function_test/pkg_test/texlive-split-d/texlive-borceux-doc.json +++ /dev/null @@ -1,10 +0,0 @@ -{ - "path": "$OET_PATH/testcases/function_test/pkg_test/texlive-split-d/texlive-borceux-doc", - "machine num": 1, - "cases": [ - { - "name": "test_texlive-borceux-doc_function_install", - "desc": "Test package installation" - } - ] -} \ No newline at end of file diff --git a/suite2cases/function_test/pkg_test/texlive-split-d/texlive-cellprops.json b/suite2cases/function_test/pkg_test/texlive-split-d/texlive-cellprops.json deleted file mode 100644 index 4ede5e4ff0d..00000000000 --- a/suite2cases/function_test/pkg_test/texlive-split-d/texlive-cellprops.json +++ /dev/null @@ -1,10 +0,0 @@ -{ - "path": "$OET_PATH/testcases/function_test/pkg_test/texlive-split-d/texlive-cellprops", - "machine num": 1, - "cases": [ - { - "name": "test_texlive-cellprops_function_basic", - "desc": "Test basic functionality of texlive-cellprops" - } - ] -} \ No newline at end of file diff --git a/suite2cases/function_test/pkg_test/texlive-split-g/texlive-doctools.json b/suite2cases/function_test/pkg_test/texlive-split-g/texlive-doctools.json deleted file mode 100644 index 4a61671ab10..00000000000 --- a/suite2cases/function_test/pkg_test/texlive-split-g/texlive-doctools.json +++ /dev/null @@ -1,30 +0,0 @@ -{ - "path": "$OET_PATH/testcases/function_test/pkg_test/texlive-split-g/texlive-doctools", - "machine num": 1, - "cases": [ - { - "name": "test_texlive-doctools_function_docgen", - "desc": "Test document generation" - }, - { - "name": "test_texlive-doctools_function_install", - "desc": "Test package installation" - }, - { - "name": "test_texlive-doctools_function_uninstall", - "desc": "Test package removal" - }, - { - "name": "test_texlive-doctools_function_check_installed", - "desc": "Test if package is installed" - }, - { - "name": "test_texlive-doctools_function_basic_usage", - "desc": "Test basic command execution" - }, - { - "name": "test_texlive-doctools_function_version_check", - "desc": "Test version information query" - } - ] -} \ No newline at end of file diff --git a/suite2cases/function_test/pkg_test/texlive-split-g/texlive-draftcopy-doc.json b/suite2cases/function_test/pkg_test/texlive-split-g/texlive-draftcopy-doc.json index 52e4fce7d9b..802a5b2015b 100644 --- a/suite2cases/function_test/pkg_test/texlive-split-g/texlive-draftcopy-doc.json +++ b/suite2cases/function_test/pkg_test/texlive-split-g/texlive-draftcopy-doc.json @@ -6,10 +6,6 @@ "name": "test_texlive-draftcopy-doc_install", "desc": "测试texlive-draftcopy-doc软件包的安装功能", "machine num": 1 - }, - { - "name": "test_texlive-draftcopy-doc_function_build", - "desc": "测试texlive-draftcopy-doc软件包的构建功能" } ] } \ No newline at end of file diff --git a/suite2cases/function_test/pkg_test/texlive-split-h/texlive-etaremune.json b/suite2cases/function_test/pkg_test/texlive-split-h/texlive-etaremune.json deleted file mode 100644 index 488b0f13419..00000000000 --- a/suite2cases/function_test/pkg_test/texlive-split-h/texlive-etaremune.json +++ /dev/null @@ -1,10 +0,0 @@ -{ - "path": "$OET_PATH/testcases/function_test/pkg_test/texlive-split-h/texlive-etaremune", - "machine num": 1, - "cases": [ - { - "name": "test_texlive-etaremune_install", - "desc": "Test package installation" - } - ] -} \ No newline at end of file diff --git a/suite2cases/function_test/pkg_test/texlive-split-l/texlive-ijmart.json b/suite2cases/function_test/pkg_test/texlive-split-l/texlive-ijmart.json index dddf224d354..27056ecc32c 100644 --- a/suite2cases/function_test/pkg_test/texlive-split-l/texlive-ijmart.json +++ b/suite2cases/function_test/pkg_test/texlive-split-l/texlive-ijmart.json @@ -2,17 +2,9 @@ "path": "$OET_PATH/testcases/function_test/pkg_test/texlive-split-l/texlive-ijmart", "machine num": 1, "cases": [ - { - "name": "test_texlive-ijmart_function_install", - "desc": "Test package installation" - }, { "name": "test_texlive-ijmart_function_uninstall", "desc": "Test package removal" - }, - { - "name": "test_texlive-ijmart_function_basic", - "desc": "Test basic command usage" } ] } \ No newline at end of file diff --git a/suite2cases/function_test/pkg_test/texlive-split-u/texlive-selnolig.json b/suite2cases/function_test/pkg_test/texlive-split-u/texlive-selnolig.json deleted file mode 100644 index 29ca172aaac..00000000000 --- a/suite2cases/function_test/pkg_test/texlive-split-u/texlive-selnolig.json +++ /dev/null @@ -1,10 +0,0 @@ -{ - "path": "$OET_PATH/testcases/function_test/pkg_test/texlive-split-u/texlive-selnolig", - "machine num": 1, - "cases": [ - { - "name": "test_texlive-selnolig_function_install", - "desc": "Test installation of texlive-selnolig package" - } - ] -} \ No newline at end of file diff --git a/suite2cases/function_test/pkg_test/texlive-split-x/texlive-timbreicmc.json b/suite2cases/function_test/pkg_test/texlive-split-x/texlive-timbreicmc.json index 79cc0c5d387..9b25ea216dd 100644 --- a/suite2cases/function_test/pkg_test/texlive-split-x/texlive-timbreicmc.json +++ b/suite2cases/function_test/pkg_test/texlive-split-x/texlive-timbreicmc.json @@ -2,10 +2,6 @@ "path": "$OET_PATH/testcases/function_test/pkg_test/texlive-split-x/texlive-timbreicmc", "machine num": 1, "cases": [ - { - "name": "test_texlive-timbreicmc_function_basic", - "desc": "Test basic command usage" - }, { "name": "test_texlive-timbreicmc_install", "desc": "Test installation of the package" @@ -14,10 +10,6 @@ "name": "test_texlive-timbreicmc_verify", "desc": "Test if the package is installed and functional" }, - { - "name": "test_texlive-timbreicmc_basic_usage", - "desc": "Test basic document compilation with the package" - }, { "name": "test_texlive-timbreicmc_uninstall", "desc": "Test removal of the package" diff --git a/suite2cases/function_test/pkg_test/texlive-split-z/texlive-yfonts-t1-doc.json b/suite2cases/function_test/pkg_test/texlive-split-z/texlive-yfonts-t1-doc.json index 03165d05c63..496ecc9004f 100644 --- a/suite2cases/function_test/pkg_test/texlive-split-z/texlive-yfonts-t1-doc.json +++ b/suite2cases/function_test/pkg_test/texlive-split-z/texlive-yfonts-t1-doc.json @@ -6,10 +6,6 @@ "name": "test_texlive-yfonts-t1-doc_function_install", "desc": "Test package installation" }, - { - "name": "test_texlive-yfonts-t1-doc_function_check_installed", - "desc": "Check if the package is installed" - }, { "name": "test_texlive-yfonts-t1-doc_function_remove", "desc": "Test package removal" diff --git a/testcases/function_test/pkg_test/blktrace/blktrace-help/test_blktrace-help_function_check_installed.sh b/testcases/function_test/pkg_test/blktrace/blktrace-help/test_blktrace-help_function_check_installed.sh deleted file mode 100644 index 0c008d77c90..00000000000 --- a/testcases/function_test/pkg_test/blktrace/blktrace-help/test_blktrace-help_function_check_installed.sh +++ /dev/null @@ -1,73 +0,0 @@ -#!/usr/bin/bash - -# Copyright (c) 2024 ISCAS .ALL rights reserved. -# This program is licensed under Mulan PSL v2. -# You can use it according to the terms and conditions of the Mulan PSL v2. -# http://license.coscl.org.cn/MulanPSL2 -# THIS PROGRAM IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, -# EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, -# MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. -# See the Mulan PSL v2 for more details. - -# ############################################# -# @Author : honghua -# @Contact : honghua@iscas.ac.cn -# @Date : 2026-03-10 -# @License : Mulan PSL v2 -# @Desc : 验证blktrace-help软件包是否已正确安装 -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - LOG_INFO "开始测试:验证blktrace-help软件包是否已正确安装" - - # 检查yum源中是否存在blktrace-help软件包 - LOG_INFO "步骤1:检查yum源中是否存在blktrace-help软件包" - dnf list available blktrace-help > /dev/null 2>&1 - if [ $? -ne 0 ]; then - LOG_ERROR "yum源中未找到blktrace-help软件包" - exit 255 - fi - - # 检查是否已安装blktrace-help软件包 - LOG_INFO "步骤2:检查是否已安装blktrace-help软件包" - rpm -q blktrace-help > /dev/null 2>&1 - if [ $? -eq 0 ]; then - LOG_INFO "blktrace-help软件包已安装,跳过安装步骤" - INSTALLED=true - else - LOG_INFO "blktrace-help软件包未安装,开始安装" - INSTALLED=false - fi - - # 如果未安装,则安装软件包 - if [ "$INSTALLED" = false ]; then - LOG_INFO "步骤3:安装blktrace-help软件包" - dnf install -y blktrace-help - CHECK_RESULT $? 0 0 "安装blktrace-help软件包失败" - fi - - # 验证blktrace-help软件包是否正确安装 - LOG_INFO "步骤4:验证blktrace-help软件包是否正确安装" - rpm -q blktrace-help > /dev/null 2>&1 - CHECK_RESULT $? 0 0 "blktrace-help软件包未正确安装" - - # 测试blktrace-help命令是否可用 - LOG_INFO "步骤5:测试blktrace-help命令是否可用" - blktrace --help > /dev/null 2>&1 - CHECK_RESULT $? 0 0 "blktrace-help命令不可用" - - # 清理环境:如果之前未安装,则卸载软件包 - if [ "$INSTALLED" = false ]; then - LOG_INFO "步骤6:清理环境,卸载blktrace-help软件包" - dnf remove -y blktrace-help - CHECK_RESULT $? 0 0 "卸载blktrace-help软件包失败" - else - LOG_INFO "步骤6:保持blktrace-help软件包安装状态" - fi - - LOG_INFO "测试完成:blktrace-help软件包已正确安装" -} - -main "$@" \ No newline at end of file diff --git a/testcases/function_test/pkg_test/blktrace/blktrace-help/test_blktrace-help_function_display_help.sh b/testcases/function_test/pkg_test/blktrace/blktrace-help/test_blktrace-help_function_display_help.sh deleted file mode 100644 index 2827b0139c4..00000000000 --- a/testcases/function_test/pkg_test/blktrace/blktrace-help/test_blktrace-help_function_display_help.sh +++ /dev/null @@ -1,130 +0,0 @@ -#!/usr/bin/bash - -# Copyright (c) 2024 ISCAS .ALL rights reserved. -# This program is licensed under Mulan PSL v2. -# You can use it according to the terms and conditions of the Mulan PSL v2. -# http://license.coscl.org.cn/MulanPSL2 -# THIS PROGRAM IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, -# EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, -# MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. -# See the Mulan PSL v2 for more details. - -# ############################################# -# @Author : honghua -# @Contact : honghua@iscas.ac.cn -# @Date : 2026-03-10 -# @License : Mulan PSL v2 -# @Desc : 测试执行blktrace-help命令是否能正常显示帮助信息 -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - # 定义日志函数 - LOG_INFO() { - echo "[INFO] $*" - } - - LOG_ERROR() { - echo "[ERROR] $*" - } - - # 检查软件包是否存在 - check_package_exists() { - local package_name=$1 - dnf list available "$package_name" &> /dev/null - return $? - } - - # 检查命令参数是否存在 - check_command_param() { - local command=$1 - local param=$2 - $command --help 2>&1 | grep -q "\<$param\>" - return $? - } - - # 检查环境是否已安装指定软件包 - check_installed() { - local package_name=$1 - rpm -q "$package_name" &> /dev/null - return $? - } - - # 安装软件包 - install_package() { - local package_name=$1 - LOG_INFO "安装软件包:$package_name" - dnf install -y "$package_name" - CHECK_RESULT $? 0 0 "安装软件包失败" - } - - # 卸载软件包 - uninstall_package() { - local package_name=$1 - LOG_INFO "卸载软件包:$package_name" - dnf remove -y "$package_name" - CHECK_RESULT $? 0 0 "卸载软件包失败" - } - - # 主测试函数 - main() { - local package_name="blktrace" - local command="blktrace" - local param="--help" - local installed_before_test=false - local need_uninstall=false - - # 步骤1:检查环境是否已安装blktrace - LOG_INFO "检查环境是否已安装blktrace" - if check_installed "$package_name"; then - LOG_INFO "blktrace已安装,测试结束后保持安装状态" - installed_before_test=true - else - LOG_INFO "blktrace未安装,将在测试步骤中安装" - need_uninstall=true - fi - - # 步骤2:检查yum源中是否有blktrace软件包 - LOG_INFO "检查yum源中是否有blktrace软件包" - if ! check_package_exists "$package_name"; then - LOG_ERROR "yum源中没有blktrace软件包" - exit 255 - fi - - # 步骤3:如果未安装,则安装blktrace - if [ "$installed_before_test" = false ]; then - install_package "$package_name" - fi - - # 步骤4:检查blktrace命令是否支持--help参数 - LOG_INFO "检查blktrace命令是否支持--help参数" - if ! check_command_param "$command" "$param"; then - LOG_ERROR "blktrace命令不支持--help参数" - if [ "$need_uninstall" = true ]; then - uninstall_package "$package_name" - fi - exit 255 - fi - - # 步骤5:执行blktrace --help命令 - LOG_INFO "执行blktrace --help命令" - $command $param - CHECK_RESULT $? 0 0 "执行blktrace --help命令失败" - - # 步骤6:清理环境 - LOG_INFO "清理环境" - if [ "$need_uninstall" = true ] && [ "$installed_before_test" = false ]; then - uninstall_package "$package_name" - else - LOG_INFO "保持blktrace安装状态,无需卸载" - fi - - LOG_INFO "测试完成" - } - - # 执行主函数 - main -} - -main "$@" \ No newline at end of file diff --git a/testcases/function_test/pkg_test/blktrace/blktrace-help/test_blktrace-help_function_man_page.sh b/testcases/function_test/pkg_test/blktrace/blktrace-help/test_blktrace-help_function_man_page.sh deleted file mode 100644 index 1f664639b36..00000000000 --- a/testcases/function_test/pkg_test/blktrace/blktrace-help/test_blktrace-help_function_man_page.sh +++ /dev/null @@ -1,77 +0,0 @@ -#!/usr/bin/bash - -# Copyright (c) 2024 ISCAS .ALL rights reserved. -# This program is licensed under Mulan PSL v2. -# You can use it according to the terms and conditions of the Mulan PSL v2. -# http://license.coscl.org.cn/MulanPSL2 -# THIS PROGRAM IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, -# EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, -# MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. -# See the Mulan PSL v2 for more details. - -# ############################################# -# @Author : honghua -# @Contact : honghua@iscas.ac.cn -# @Date : 2026-03-11 -# @License : Mulan PSL v2 -# @Desc : 验证blktrace-help软件包提供的man手册页是否存在且可读 -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - # 环境初始化 - LOG_INFO "开始测试:验证blktrace-help软件包提供的man手册页是否存在且可读" - - # 步骤1:检查软件包是否已在系统中安装 - LOG_INFO "步骤1:检查blktrace-help软件包是否已安装" - rpm -q blktrace-help - if [ $? -eq 0 ]; then - LOG_INFO "blktrace-help软件包已安装,测试结束后将保持安装状态" - INSTALLED=1 - else - LOG_INFO "blktrace-help软件包未安装,将在测试过程中安装并最终卸载" - INSTALLED=0 - fi - - # 步骤2:检查yum源中是否存在blktrace-help软件包 - LOG_INFO "步骤2:检查yum源中是否存在blktrace-help软件包" - dnf list available blktrace-help 2>&1 | grep -q "blktrace-help" - if [ $? -ne 0 ]; then - LOG_ERROR "yum源中未找到blktrace-help软件包" - exit 255 - fi - - # 步骤3:安装blktrace-help软件包(如果未安装) - if [ $INSTALLED -eq 0 ]; then - LOG_INFO "步骤3:安装blktrace-help软件包" - dnf install -y blktrace-help - CHECK_RESULT $? 0 0 "安装blktrace-help软件包失败" - fi - - # 步骤4:检查blktrace-help软件包是否成功安装 - LOG_INFO "步骤4:验证blktrace-help软件包安装状态" - rpm -q blktrace-help - CHECK_RESULT $? 0 0 "blktrace-help软件包未正确安装" - - # 步骤5:验证man手册页是否存在 - LOG_INFO "步骤5:验证blktrace-help软件包提供的man手册页是否存在" - man -w blktrace-help 2>&1 - CHECK_RESULT $? 0 0 "blktrace-help的man手册页不存在" - - # 步骤6:验证man手册页是否可读 - LOG_INFO "步骤6:验证blktrace-help软件包提供的man手册页是否可读" - man blktrace-help > /dev/null 2>&1 - CHECK_RESULT $? 0 0 "blktrace-help的man手册页不可读" - - # 步骤7:清理环境(如果测试前未安装,则卸载软件包) - if [ $INSTALLED -eq 0 ]; then - LOG_INFO "步骤7:卸载blktrace-help软件包" - dnf remove -y blktrace-help - CHECK_RESULT $? 0 0 "卸载blktrace-help软件包失败" - fi - - LOG_INFO "测试完成:blktrace-help软件包提供的man手册页存在且可读" -} - -main "$@" \ No newline at end of file diff --git a/testcases/function_test/pkg_test/culmus-fonts/culmus-shofar-fonts/test_culmus-shofar-fonts_function_app_usage.sh b/testcases/function_test/pkg_test/culmus-fonts/culmus-shofar-fonts/test_culmus-shofar-fonts_function_app_usage.sh deleted file mode 100644 index c72fc9f96f3..00000000000 --- a/testcases/function_test/pkg_test/culmus-fonts/culmus-shofar-fonts/test_culmus-shofar-fonts_function_app_usage.sh +++ /dev/null @@ -1,80 +0,0 @@ -#!/usr/bin/bash - -# Copyright (c) 2024 ISCAS .ALL rights reserved. -# This program is licensed under Mulan PSL v2. -# You can use it according to the terms and conditions of the Mulan PSL v2. -# http://license.coscl.org.cn/MulanPSL2 -# THIS PROGRAM IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, -# EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, -# MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. -# See the Mulan PSL v2 for more details. - -# ############################################# -# @Author : honghua -# @Contact : honghua@iscas.ac.cn -# @Date : 2026-03-26 -# @License : Mulan PSL v2 -# @Desc : 测试在支持字体选择的应用程序中能否使用culmus-shofar字体。 -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - LOG_INFO "开始测试:测试在支持字体选择的应用程序中能否使用culmus-shofar字体。" - - LOG_INFO "步骤1:检查yum源中是否存在culmus-shofar-fonts软件包" - dnf list available culmus-shofar-fonts - if [ $? -ne 0 ]; then - LOG_ERROR "yum源中未找到culmus-shofar-fonts软件包" - exit 255 - fi - - LOG_INFO "步骤2:检查系统是否已安装culmus-shofar-fonts" - rpm -q culmus-shofar-fonts - if [ $? -eq 0 ]; then - LOG_INFO "culmus-shofar-fonts已安装,测试完成后将保持安装状态" - INSTALLED=1 - else - LOG_INFO "culmus-shofar-fonts未安装,将进行安装" - INSTALLED=0 - fi - - if [ $INSTALLED -eq 0 ]; then - LOG_INFO "步骤3:安装culmus-shofar-fonts软件包" - dnf install -y culmus-shofar-fonts - CHECK_RESULT $? 0 0 "安装culmus-shofar-fonts失败" - fi - - LOG_INFO "步骤4:验证字体文件是否存在" - ls /usr/share/fonts/culmus-shofar/*.ttf > /dev/null 2>&1 - CHECK_RESULT $? 0 0 "culmus-shofar字体文件不存在" - - LOG_INFO "步骤5:检查fontconfig是否能够识别culmus-shofar字体" - fc-list | grep -i "shofar" > /dev/null 2>&1 - CHECK_RESULT $? 0 0 "fontconfig未识别到culmus-shofar字体" - - LOG_INFO "步骤6:测试在支持字体选择的应用程序中能否使用culmus-shofar字体" - echo "测试文本" | pango-view --font="Shofar" -t "测试culmus-shofar字体渲染" -qo /tmp/font_test.png 2>&1 - if [ $? -ne 0 ]; then - LOG_ERROR "参数"Shofar"可能不被支持或命令执行失败" - exit 255 - fi - CHECK_RESULT $? 0 0 "使用culmus-shofar字体渲染测试失败" - - LOG_INFO "步骤7:清理测试生成的文件" - rm -f /tmp/font_test.png - CHECK_RESULT $? 0 0 "清理测试文件失败" - - if [ $INSTALLED -eq 0 ]; then - LOG_INFO "步骤8:卸载culmus-shofar-fonts软件包" - dnf remove -y culmus-shofar-fonts - CHECK_RESULT $? 0 0 "卸载culmus-shofar-fonts失败" - LOG_INFO "环境已恢复至测试前状态" - else - LOG_INFO "测试完成,保持culmus-shofar-fonts安装状态" - fi - - LOG_INFO "测试结束:测试在支持字体选择的应用程序中能否使用culmus-shofar字体。" -} - -main "$@" \ No newline at end of file diff --git a/testcases/function_test/pkg_test/culmus-fonts/culmus-shofar-fonts/test_culmus-shofar-fonts_function_fontconfig.sh b/testcases/function_test/pkg_test/culmus-fonts/culmus-shofar-fonts/test_culmus-shofar-fonts_function_fontconfig.sh deleted file mode 100644 index 035055834a1..00000000000 --- a/testcases/function_test/pkg_test/culmus-fonts/culmus-shofar-fonts/test_culmus-shofar-fonts_function_fontconfig.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-03-26 -# @License : Mulan PSL v2 -# @Desc : 测试字体配置系统是否能正确识别并列出culmus-shofar字体。 -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - set -e - - LOG_INFO "开始测试culmus-shofar字体配置功能" - - LOG_INFO "步骤1: 检查culmus-shofar-fonts软件包是否在yum源中" - dnf list available culmus-shofar-fonts > /dev/null 2>&1 - if [ $? -ne 0 ]; then - LOG_ERROR "culmus-shofar-fonts软件包不在yum源中" - exit 255 - fi - - LOG_INFO "步骤2: 检查系统是否已安装culmus-shofar-fonts" - rpm -q culmus-shofar-fonts > /dev/null 2>&1 - INSTALLED=$? - if [ $INSTALLED -eq 0 ]; then - LOG_INFO "culmus-shofar-fonts已安装,测试后保持安装状态" - NEED_UNINSTALL=0 - else - LOG_INFO "culmus-shofar-fonts未安装,将进行安装测试" - NEED_UNINSTALL=1 - fi - - if [ $NEED_UNINSTALL -eq 1 ]; then - LOG_INFO "步骤3: 安装culmus-shofar-fonts软件包" - dnf install -y culmus-shofar-fonts - CHECK_RESULT $? 0 0 "安装culmus-shofar-fonts失败" - fi - - LOG_INFO "步骤4: 检查fc-list命令是否存在" - command -v fc-list > /dev/null 2>&1 - if [ $? -ne 0 ]; then - LOG_ERROR "fc-list命令不存在" - if [ $NEED_UNINSTALL -eq 1 ]; then - dnf remove -y culmus-shofar-fonts - fi - exit 255 - fi - - LOG_INFO "步骤5: 检查fc-list是否支持--format参数" - fc-list --help 2>&1 | grep -q "\-\-format" - if [ $? -ne 0 ]; then - LOG_ERROR "fc-list不支持--format参数" - if [ $NEED_UNINSTALL -eq 1 ]; then - dnf remove -y culmus-shofar-fonts - fi - exit 255 - fi - - LOG_INFO "步骤6: 使用fc-list列出culmus-shofar字体" - fc-list --format="%{family}\n" | grep -i "shofar" > /dev/null 2>&1 - CHECK_RESULT $? 0 0 "字体配置系统未能正确识别culmus-shofar字体" - - LOG_INFO "步骤7: 验证culmus-shofar字体文件存在" - FONT_FILES=$(rpm -ql culmus-shofar-fonts | grep -E "\.(ttf|otf)$" | head -5) - if [ -z "$FONT_FILES" ]; then - LOG_ERROR "未找到culmus-shofar字体文件" - CHECK_RESULT 1 0 0 "未找到culmus-shofar字体文件" - else - LOG_INFO "找到culmus-shofar字体文件:" - echo "$FONT_FILES" - CHECK_RESULT 0 0 0 "检查字体文件失败" - fi - - if [ $NEED_UNINSTALL -eq 1 ]; then - LOG_INFO "步骤8: 清理环境,卸载culmus-shofar-fonts软件包" - dnf remove -y culmus-shofar-fonts - CHECK_RESULT $? 0 0 "卸载culmus-shofar-fonts失败" - else - LOG_INFO "步骤8: 保持culmus-shofar-fonts安装状态" - fi - - LOG_INFO "测试完成:字体配置系统能正确识别并列出culmus-shofar字体" -} - -main "$@" \ No newline at end of file diff --git a/testcases/function_test/pkg_test/nagios-plugins/nagios-plugins-nagios/test_nagios-plugins-nagios_function_check_cpu.sh b/testcases/function_test/pkg_test/nagios-plugins/nagios-plugins-nagios/test_nagios-plugins-nagios_function_check_cpu.sh deleted file mode 100644 index d9ef79278cd..00000000000 --- a/testcases/function_test/pkg_test/nagios-plugins/nagios-plugins-nagios/test_nagios-plugins-nagios_function_check_cpu.sh +++ /dev/null @@ -1,72 +0,0 @@ -#!/usr/bin/bash - -# Copyright (c) 2024 ISCAS .ALL rights reserved. -# This program is licensed under Mulan PSL v2. -# You can use it according to the terms and conditions of the Mulan PSL v2. -# http://license.coscl.org.cn/MulanPSL2 -# THIS PROGRAM IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, -# EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, -# MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. -# See the Mulan PSL v2 for more details. - -# ############################################# -# @Author : honghua -# @Contact : honghua@iscas.ac.cn -# @Date : 2025-12-02 -# @License : Mulan PSL v2 -# @Desc : Verify CPU usage monitoring functionality -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - LOG_INFO "开始测试CPU使用率监控功能" - - # 检查是否已安装nagios-plugins-nagios软件包 - LOG_INFO "检查nagios-plugins-nagios是否已安装" - if rpm -q nagios-plugins-nagios > /dev/null; then - LOG_INFO "nagios-plugins-nagios已安装" - INSTALLED=true - else - LOG_INFO "nagios-plugins-nagios未安装" - INSTALLED=false - fi - - # 检查yum源中是否有nagios-plugins-nagios软件包 - LOG_INFO "检查yum源中是否有nagios-plugins-nagios软件包" - if ! dnf list available nagios-plugins-nagios > /dev/null 2>&1; then - LOG_ERROR "yum源中未找到nagios-plugins-nagios软件包" - exit 255 - fi - - # 如果未安装,则安装软件包 - if [ "$INSTALLED" = false ]; then - LOG_INFO "安装nagios-plugins-nagios软件包" - dnf install -y nagios-plugins-nagios - CHECK_RESULT $? 0 0 "安装nagios-plugins-nagios失败" - fi - - # 检查check_cpu命令是否存在 - LOG_INFO "检查check_cpu命令是否存在" - if ! command -v check_cpu > /dev/null; then - LOG_ERROR "check_cpu命令不存在" - exit 255 - fi - - # 测试check_cpu命令的基本功能 - LOG_INFO "测试check_cpu命令的基本功能" - check_cpu -w 80 -c 90 - CHECK_RESULT $? 0 0 "check_cpu命令执行失败" - - # 测试不支持的参数 - LOG_INFO "测试check_cpu命令不支持的参数" - check_cpu --invalid-option > /dev/null 2>&1 - CHECK_RESULT $? 255 0 "check_cpu命令不支持--invalid-option参数" - - # 清理环境 - if [ "$INSTALLED" = false ]; then - LOG_INFO "卸载nagios-plugins-nagios软件包" - dnf remove -y nagio -} - -main "$@" \ No newline at end of file diff --git a/testcases/function_test/pkg_test/nagios-plugins/nagios-plugins-nagios/test_nagios-plugins-nagios_function_check_disk.sh b/testcases/function_test/pkg_test/nagios-plugins/nagios-plugins-nagios/test_nagios-plugins-nagios_function_check_disk.sh deleted file mode 100644 index ed7c3d58f56..00000000000 --- a/testcases/function_test/pkg_test/nagios-plugins/nagios-plugins-nagios/test_nagios-plugins-nagios_function_check_disk.sh +++ /dev/null @@ -1,71 +0,0 @@ -#!/usr/bin/bash - -# Copyright (c) 2024 ISCAS .ALL rights reserved. -# This program is licensed under Mulan PSL v2. -# You can use it according to the terms and conditions of the Mulan PSL v2. -# http://license.coscl.org.cn/MulanPSL2 -# THIS PROGRAM IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, -# EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, -# MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. -# See the Mulan PSL v2 for more details. - -# ############################################# -# @Author : honghua -# @Contact : honghua@iscas.ac.cn -# @Date : 2025-11-30 -# @License : Mulan PSL v2 -# @Desc : Verify disk usage monitoring functionality -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - - # 检查是否已安装nagios-plugins-nagios软件包 - LOG_INFO "检查是否已安装nagios-plugins-nagios软件包" - rpm -q nagios-plugins-nagios > /dev/null 2>&1 - if [ $? -eq 0 ]; then - LOG_INFO "nagios-plugins-nagios已安装" - installed=true - else - LOG_INFO "nagios-plugins-nagios未安装" - installed=false - fi - - # 检查yum源中是否存在nagios-plugins-nagios软件包 - LOG_INFO "检查yum源中是否存在nagios-plugins-nagios软件包" - dnf list available nagios-plugins-nagios > /dev/null 2>&1 - if [ $? -ne 0 ]; then - LOG_ERROR "yum源中不存在nagios-plugins-nagios软件包" - exit 255 - fi - - # 如果未安装,则安装软件包 - if [ "$installed" = false ]; then - LOG_INFO "安装nagios-plugins-nagios软件包" - dnf install -y nagios-plugins-nagios > /dev/null 2>&1 - CHECK_RESULT $? 0 0 "安装nagios-plugins-nagios失败" - fi - - # 测试check_disk命令的功能 - LOG_INFO "测试check_disk命令的功能" - check_disk_output=$(/usr/lib64/nagios/plugins/check_disk -w 80% -c 90% /) - CHECK_RESULT $? 0 0 "check_disk命令执行失败" - - # 验证输出结果是否符合预期 - LOG_INFO "验证check_disk命令输出结果" - echo "$check_disk_output" | grep -q "OK" - CHECK_RESULT $? 0 0 "check_disk命令输出结果不符合预期" - - # 清理环境 - if [ "$installed" = false ]; then - LOG_INFO "卸载nagios-plugins-nagios软件包" - dnf remove -y nagios-plugins-nagios > /dev/null 2>&1 - CHECK_RESULT $? 0 0 "卸载nagios-plugins-nagios失败" - fi - - LOG_INFO "测试脚本执行完成" - -} - -main "$@" \ No newline at end of file diff --git a/testcases/function_test/pkg_test/nagios-plugins/nagios-plugins-nagios/test_nagios-plugins-nagios_function_check_mem.sh b/testcases/function_test/pkg_test/nagios-plugins/nagios-plugins-nagios/test_nagios-plugins-nagios_function_check_mem.sh deleted file mode 100644 index cfa5739cc26..00000000000 --- a/testcases/function_test/pkg_test/nagios-plugins/nagios-plugins-nagios/test_nagios-plugins-nagios_function_check_mem.sh +++ /dev/null @@ -1,73 +0,0 @@ -#!/usr/bin/bash - -# Copyright (c) 2024 ISCAS .ALL rights reserved. -# This program is licensed under Mulan PSL v2. -# You can use it according to the terms and conditions of the Mulan PSL v2. -# http://license.coscl.org.cn/MulanPSL2 -# THIS PROGRAM IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, -# EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, -# MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. -# See the Mulan PSL v2 for more details. - -# ############################################# -# @Author : honghua -# @Contact : honghua@iscas.ac.cn -# @Date : 2025-12-02 -# @License : Mulan PSL v2 -# @Desc : Verify memory usage monitoring functionality -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - LOG_INFO "开始测试内存使用监控功能" - - # 检查是否已安装nagios-plugins-nagios - LOG_INFO "检查nagios-plugins-nagios是否已安装" - if ! dnf list installed nagios-plugins-nagios &>/dev/null; then - LOG_INFO "nagios-plugins-nagios未安装,将进行安装" - installed_flag=1 - else - LOG_INFO "nagios-plugins-nagios已安装" - installed_flag=0 - fi - - # 检查yum源中是否有nagios-plugins-nagios - LOG_INFO "检查yum源中是否有nagios-plugins-nagios" - if ! dnf list available nagios-plugins-nagios &>/dev/null; then - LOG_ERROR "yum源中未找到nagios-plugins-nagios" - exit 255 - fi - - # 如果未安装,则安装软件包 - if [ $installed_flag -eq 1 ]; then - LOG_INFO "安装nagios-plugins-nagios" - dnf install -y nagios-plugins-nagios - CHECK_RESULT $? 0 0 "安装nagios-plugins-nagios失败" - fi - - # 测试check_mem命令是否存在 - LOG_INFO "测试check_mem命令是否存在" - if ! command -v check_mem &>/dev/null; then - LOG_ERROR "check_mem命令不存在或不支持" - exit 255 - fi - - # 测试check_mem命令的基本功能 - LOG_INFO "测试check_mem命令的基本功能" - check_mem -w 80 -c 90 - CHECK_RESULT $? 0 0 "check_mem命令执行失败" - - # 测试无效参数 - LOG_INFO "测试无效参数" - check_mem --invalid-option &>/dev/null - CHECK_RESULT $? 255 0 "check_mem命令未正确处理无效参数" - - # 清理环境:如果之前未安装,则卸载软件包 - if [ $installed_flag -eq 1 ]; then - LOG_INFO "卸载nagios-plugins-nagios" - dnf remove -y nagios-plugins-nagios - CHECK_RESULT $? 0 0 "卸载nagios-plugins-nag -} - -main "$@" \ No newline at end of file diff --git a/testcases/function_test/pkg_test/nagios-plugins/nagios-plugins-nagios/test_nagios-plugins-nagios_function_check_net.sh b/testcases/function_test/pkg_test/nagios-plugins/nagios-plugins-nagios/test_nagios-plugins-nagios_function_check_net.sh deleted file mode 100644 index 894ec9bf768..00000000000 --- a/testcases/function_test/pkg_test/nagios-plugins/nagios-plugins-nagios/test_nagios-plugins-nagios_function_check_net.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-02 -# @License : Mulan PSL v2 -# @Desc : Verify network connectivity monitoring functionality -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - # 检查是否已安装nagios-plugins-nagios软件包 - LOG_INFO "检查是否已安装nagios-plugins-nagios软件包" - if dnf list installed nagios-plugins-nagios &>/dev/null; then - LOG_INFO "nagios-plugins-nagios已安装" - INSTALLED=true - else - LOG_INFO "nagios-plugins-nagios未安装" - INSTALLED=false - fi - - # 检查yum源中是否存在nagios-plugins-nagios软件包 - LOG_INFO "检查yum源中是否存在nagios-plugins-nagios软件包" - if ! dnf list available nagios-plugins-nagios &>/dev/null; then - LOG_ERROR "yum源中不存在nagios-plugins-nagios软件包" - exit 255 - fi - - # 如果未安装,则安装软件包 - if [ "$INSTALLED" = false ]; then - LOG_INFO "开始安装nagios-plugins-nagios软件包" - dnf install -y nagios-plugins-nagios - CHECK_RESULT $? 0 0 "安装nagios-plugins-nagios软件包失败" - fi - - # 检查check_net命令是否存在 - LOG_INFO "检查check_net命令是否存在" - if ! command -v check_net &>/dev/null; then - LOG_ERROR "check_net命令不存在或不支持" - exit 255 - fi - - # 测试网络连通性监控功能 - LOG_INFO "测试网络连通性监控功能" - check_net -H localhost - CHECK_RESULT $? 0 0 "网络连通性监控功能测试失败" - - # 清理环境 - if [ "$INSTALLED" = false ]; then - LOG_INFO "卸载nagios-plugins-nagios软件包" - dnf remove -y nagios-plugins-nagios - CHECK_RESULT $? 0 0 "卸载nag -} - -main "$@" \ No newline at end of file diff --git a/testcases/function_test/pkg_test/ocaml-cppo/ocaml-cppo/test_ocaml-cppo_cppo__upper_d.sh b/testcases/function_test/pkg_test/ocaml-cppo/ocaml-cppo/test_ocaml-cppo_cppo__upper_d.sh deleted file mode 100644 index 750ded7dafa..00000000000 --- a/testcases/function_test/pkg_test/ocaml-cppo/ocaml-cppo/test_ocaml-cppo_cppo__upper_d.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-04-05 -# @License : Mulan PSL v2 -# @Desc : 测试使用-D参数定义宏并处理输入文件 -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - LOG_INFO "测试开始:测试使用-D参数定义宏并处理输入文件" - - LOG_INFO "步骤1:检查软件包是否在yum源中" - if ! dnf list available ocaml-cppo-cppo 2>/dev/null | grep -q "ocaml-cppo-cppo"; then - LOG_ERROR "软件包 ocaml-cppo-cppo 不在yum源中" - exit 255 - fi - - LOG_INFO "步骤2:检查环境是否已安装软件包" - if rpm -q ocaml-cppo-cppo >/dev/null 2>&1; then - LOG_INFO "软件包已安装,标记为已存在安装" - INSTALLED_BEFORE=1 - else - LOG_INFO "软件包未安装,标记为需要安装" - INSTALLED_BEFORE=0 - fi - - if [ $INSTALLED_BEFORE -eq 0 ]; then - LOG_INFO "步骤3:安装软件包" - dnf install -y ocaml-cppo-cppo - CHECK_RESULT $? 0 0 "安装软件包失败" - fi - - LOG_INFO "步骤4:验证cppo命令是否存在" - if ! command -v cppo >/dev/null 2>&1; then - LOG_ERROR "cppo命令不存在" - exit 255 - fi - - LOG_INFO "步骤5:验证-D参数是否支持" - if ! cppo --help 2>&1 | grep -q "\-D"; then - LOG_ERROR "cppo命令不支持-D参数" - exit 255 - fi - - LOG_INFO "步骤6:创建测试输入文件" - cat > test_input.ml << "EOF" - let x = [%TEST] - EOF - CHECK_RESULT $? 0 0 "创建测试输入文件失败" - - LOG_INFO "步骤7:使用-D参数定义宏并处理文件" - cppo -D TEST=""hello"" test_input.ml -o test_output.ml - CHECK_RESULT $? 0 0 "使用-D参数处理文件失败" - - LOG_INFO "步骤8:验证输出文件内容" - EXPECTED="let x = \"hello\"" - ACTUAL=$(cat test_output.ml) - if [ "$ACTUAL" = "$EXPECTED" ]; then - LOG_INFO "输出文件内容符合预期" - else - LOG_ERROR "输出文件内容不符合预期,期望:$EXPECTED,实际:$ACTUAL" - exit 1 - fi - - LOG_INFO "步骤9:清理临时文件" - rm -f test_input.ml test_output.ml - CHECK_RESULT $? 0 0 "清理临时文件失败" - - if [ $INSTALLED_BEFORE -eq 0 ]; then - LOG_INFO "步骤10:卸载软件包" - dnf remove -y ocaml-cppo-cppo - CHECK_RESULT $? 0 0 "卸载软件包失败" - else - LOG_INFO "步骤10:软件包在测试前已安装,保持安装状态" - fi - - LOG_INFO "测试结束:测试使用-D参数定义宏并处理输入文件完成" -} - -main "$@" \ No newline at end of file diff --git a/testcases/function_test/pkg_test/ocaml-cppo/ocaml-cppo/test_ocaml-cppo_cppo__upper_d__upper_i_o.sh b/testcases/function_test/pkg_test/ocaml-cppo/ocaml-cppo/test_ocaml-cppo_cppo__upper_d__upper_i_o.sh deleted file mode 100644 index fb25bb38f70..00000000000 --- a/testcases/function_test/pkg_test/ocaml-cppo/ocaml-cppo/test_ocaml-cppo_cppo__upper_d__upper_i_o.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-04-05 -# @License : Mulan PSL v2 -# @Desc : 测试组合使用-D、-I和-o参数定义宏、添加包含目录并指定输出文件处理输入文件 -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - LOG_INFO "开始测试组合使用-D、-I和-o参数定义宏、添加包含目录并指定输出文件处理输入文件" - LOG_INFO "检查当前环境是否已安装ocaml-cppo软件包" - if dnf list installed ocaml-cppo &>/dev/null; then - LOG_INFO "软件包已安装,标记为已安装状态" - INSTALLED=1 - else - LOG_INFO "软件包未安装,标记为未安装状态" - INSTALLED=0 - fi - LOG_INFO "检查yum源中是否存在ocaml-cppo软件包" - if ! dnf list available ocaml-cppo &>/dev/null; then - LOG_ERROR "yum源中未找到ocaml-cppo软件包" - exit 255 - fi - if [ $INSTALLED -eq 0 ]; then - LOG_INFO "安装ocaml-cppo软件包" - dnf install -y ocaml-cppo - CHECK_RESULT $? 0 0 "安装ocaml-cppo软件包失败" - fi - LOG_INFO "测试cppo命令的-D、-I和-o参数功能" - LOG_INFO "创建测试输入文件" - cat > test_input.ml << "EOF" - let x = [%TEST_MACRO] - EOF - CHECK_RESULT $? 0 0 "创建测试输入文件失败" - LOG_INFO "创建包含目录和宏定义文件" - mkdir -p test_include - cat > test_include/macro.h << "EOF" - #define TEST_MACRO 42 - EOF - CHECK_RESULT $? 0 0 "创建宏定义文件失败" - LOG_INFO "执行cppo命令,使用-D定义宏、-I添加包含目录、-o指定输出文件" - cppo -D TEST_MACRO -I test_include -o test_output.ml test_input.ml - CHECK_RESULT $? 0 0 "cppo命令执行失败,参数可能不支持或命令执行错误" - LOG_INFO "检查输出文件内容是否符合预期" - if grep -q "let x = 42" test_output.ml; then - LOG_INFO "输出文件内容正确,宏替换成功" - else - LOG_ERROR "输出文件内容错误,宏替换失败" - exit 1 - fi - LOG_INFO "清理测试文件" - rm -f test_input.ml test_output.ml - rm -rf test_include - CHECK_RESULT $? 0 0 "清理测试文件失败" - if [ $INSTALLED -eq 0 ]; then - LOG_INFO "卸载ocaml-cppo软件包" - dnf remove -y ocaml-cppo - CHECK_RESULT $? 0 0 "卸载ocaml-cppo软件包失败" - LOG_INFO "软件包已卸载,环境已恢复" - else - LOG_INFO "保持软件包安装状态,环境已恢复" - fi - LOG_INFO "测试完成" -} - -main "$@" \ No newline at end of file diff --git a/testcases/function_test/pkg_test/ocaml-cppo/ocaml-cppo/test_ocaml-cppo_cppo__upper_d__upper_u.sh b/testcases/function_test/pkg_test/ocaml-cppo/ocaml-cppo/test_ocaml-cppo_cppo__upper_d__upper_u.sh deleted file mode 100644 index bb1b0d61605..00000000000 --- a/testcases/function_test/pkg_test/ocaml-cppo/ocaml-cppo/test_ocaml-cppo_cppo__upper_d__upper_u.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 : 2026-04-05 -# @License : Mulan PSL v2 -# @Desc : 测试组合使用-D和-U参数定义与取消宏定义并处理输入文件 -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - # 定义软件包名称 - PACKAGE_NAME="ocaml-cppo" - - # 检查软件包是否已在yum源中 - LOG_INFO "检查yum源中是否存在软件包:$PACKAGE_NAME" - if ! dnf list available $PACKAGE_NAME &>/dev/null; then - LOG_ERROR "yum源中不存在软件包:$PACKAGE_NAME" - exit 255 - fi - - # 检查环境是否已安装软件包 - LOG_INFO "检查环境是否已安装软件包:$PACKAGE_NAME" - if rpm -q $PACKAGE_NAME &>/dev/null; then - LOG_INFO "软件包已安装,脚本结束后将保持安装状态" - INSTALLED_BEFORE=true - else - LOG_INFO "软件包未安装,将在测试步骤中安装" - INSTALLED_BEFORE=false - fi - - # 如果未安装,则安装软件包 - if [ "$INSTALLED_BEFORE" = false ]; then - LOG_INFO "安装软件包:$PACKAGE_NAME" - dnf install -y $PACKAGE_NAME - CHECK_RESULT $? 0 0 "安装软件包失败" - fi - - # 验证cppo命令是否存在 - LOG_INFO "验证cppo命令是否存在" - if ! command -v cppo &>/dev/null; then - LOG_ERROR "cppo命令不存在" - exit 255 - fi - - # 测试组合使用-D和-U参数定义与取消宏定义并处理输入文件 - LOG_INFO "测试组合使用-D和-U参数定义与取消宏定义并处理输入文件" - - # 创建测试输入文件 - LOG_INFO "创建测试输入文件" - cat > test_input.ml << EOF - #ifdef TEST_MACRO - let x = 1 - #else - let x = 2 - #endif - #ifdef ANOTHER_MACRO - let y = 3 - #else - let y = 4 - #endif - EOF - - # 使用-D定义宏TEST_MACRO,使用-U取消宏ANOTHER_MACRO,并处理输入文件 - LOG_INFO "使用-D定义宏TEST_MACRO,使用-U取消宏ANOTHER_MACRO,并处理输入文件" - cppo -D TEST_MACRO -U ANOTHER_MACRO test_input.ml -o test_output.ml - CHECK_RESULT $? 0 0 "cppo命令执行失败" - - # 检查输出文件内容是否符合预期 - LOG_INFO "检查输出文件内容是否符合预期" - EXPECTED_OUTPUT="let x = 1 - let y = 4" - ACTUAL_OUTPUT=$(cat test_output.ml) - if [ "$ACTUAL_OUTPUT" = "$EXPECTED_OUTPUT" ]; then - LOG_INFO "输出文件内容符合预期" - else - LOG_ERROR "输出文件内容不符合预期" - LOG_ERROR "期望输出:$EXPECTED_OUTPUT" - LOG_ERROR "实际输出:$ACTUAL_OUTPUT" - exit 1 - fi - - # 清理测试文件 - LOG_INFO "清理测试文件" - rm -f test_input.ml test_output.ml - - # 如果之前未安装,则在脚本结束前卸载软件包 - if [ "$INSTALLED_BEFORE" = false ]; then - LOG_INFO "卸载软件包:$PACKAGE_NAME" - dnf remove -y $PACKAGE_NAME - CHECK_RESULT $? 0 0 "卸载软件包失败" - fi - - LOG_INFO "测试脚本执行完毕" -} - -main "$@" \ No newline at end of file diff --git a/testcases/function_test/pkg_test/ocaml-cppo/ocaml-cppo/test_ocaml-cppo_cppo__upper_i.sh b/testcases/function_test/pkg_test/ocaml-cppo/ocaml-cppo/test_ocaml-cppo_cppo__upper_i.sh deleted file mode 100644 index c66208c3396..00000000000 --- a/testcases/function_test/pkg_test/ocaml-cppo/ocaml-cppo/test_ocaml-cppo_cppo__upper_i.sh +++ /dev/null @@ -1,89 +0,0 @@ -#!/usr/bin/bash - -# Copyright (c) 2024 ISCAS .ALL rights reserved. -# This program is licensed under Mulan PSL v2. -# You can use it according to the terms and conditions of the Mulan PSL v2. -# http://license.coscl.org.cn/MulanPSL2 -# THIS PROGRAM IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, -# EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, -# MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. -# See the Mulan PSL v2 for more details. - -# ############################################# -# @Author : honghua -# @Contact : honghua@iscas.ac.cn -# @Date : 2026-04-05 -# @License : Mulan PSL v2 -# @Desc : 测试使用-I参数添加包含文件搜索目录并处理输入文件 -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - # 判断是否已经安装了cppo软件包 - LOG_INFO "检查是否已安装cppo软件包" - rpm -q ocaml-cppo > /dev/null 2>&1 - if [ $? -eq 0 ]; then - LOG_INFO "cppo软件包已安装,脚本结束后将保持安装状态" - already_installed=1 - else - LOG_INFO "cppo软件包未安装" - already_installed=0 - fi - - # 检查yum源中是否有cppo软件包 - LOG_INFO "检查yum源中是否有cppo软件包" - dnf list available ocaml-cppo > /dev/null 2>&1 - if [ $? -ne 0 ]; then - LOG_ERROR "yum源中没有cppo软件包" - exit 255 - fi - - # 如果未安装则安装cppo软件包 - if [ $already_installed -eq 0 ]; then - LOG_INFO "安装cppo软件包" - dnf install -y ocaml-cppo - CHECK_RESULT $? 0 0 "安装cppo软件包失败" - fi - - # 创建测试目录和文件 - LOG_INFO "创建测试目录和文件" - test_dir="/tmp/test_cppo_$$" - mkdir -p $test_dir/include $test_dir/src - echo "#define MESSAGE \"Hello from include\"" > $test_dir/include/test.h - echo "#include \"test.h\"" > $test_dir/src/test.ml - echo "print_string MESSAGE" >> $test_dir/src/test.ml - - # 测试使用-I参数添加包含文件搜索目录 - LOG_INFO "测试使用-I参数添加包含文件搜索目录" - cppo -I $test_dir/include $test_dir/src/test.ml -o $test_dir/output.ml - CHECK_RESULT $? 0 0 "cppo命令执行失败" - - # 检查输出文件内容 - LOG_INFO "检查输出文件内容" - grep "Hello from include" $test_dir/output.ml > /dev/null 2>&1 - CHECK_RESULT $? 0 0 "输出文件内容不符合预期" - - # 测试不支持的参数 - LOG_INFO "测试不支持的参数" - cppo --invalid-param 2>&1 | grep -q "unrecognized option" - if [ $? -ne 0 ]; then - LOG_ERROR "cppo命令没有正确识别无效参数" - exit 255 - fi - - # 清理测试目录 - LOG_INFO "清理测试目录" - rm -rf $test_dir - - # 如果脚本开始前未安装,则卸载软件包 - if [ $already_installed -eq 0 ]; then - LOG_INFO "卸载cppo软件包" - dnf remove -y ocaml-cppo - CHECK_RESULT $? 0 0 "卸载cppo软件包失败" - fi - - LOG_INFO "测试完成" -} - -main "$@" \ No newline at end of file diff --git a/testcases/function_test/pkg_test/ocaml-cppo/ocaml-cppo/test_ocaml-cppo_cppo__upper_i_o.sh b/testcases/function_test/pkg_test/ocaml-cppo/ocaml-cppo/test_ocaml-cppo_cppo__upper_i_o.sh deleted file mode 100644 index 88360a5ed78..00000000000 --- a/testcases/function_test/pkg_test/ocaml-cppo/ocaml-cppo/test_ocaml-cppo_cppo__upper_i_o.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-04-05 -# @License : Mulan PSL v2 -# @Desc : 测试组合使用-I和-o参数添加包含目录并指定输出文件处理输入文件 -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - LOG_INFO "开始测试组合使用-I和-o参数添加包含目录并指定输出文件处理输入文件" - - LOG_INFO "步骤1:检查yum源中是否有ocaml-cppo软件包" - dnf list ocaml-cppo 2>/dev/null | grep -q "ocaml-cppo" - if [ $? -ne 0 ]; then - LOG_ERROR "yum源中未找到ocaml-cppo软件包" - exit 255 - fi - - LOG_INFO "步骤2:检查环境中是否已安装ocaml-cppo" - rpm -q ocaml-cppo > /dev/null 2>&1 - if [ $? -eq 0 ]; then - LOG_INFO "环境中已安装ocaml-cppo,测试结束后将保持安装状态" - already_installed=1 - else - LOG_INFO "环境中未安装ocaml-cppo,将安装软件包" - already_installed=0 - fi - - if [ $already_installed -eq 0 ]; then - LOG_INFO "步骤3:安装ocaml-cppo软件包" - dnf install -y ocaml-cppo - CHECK_RESULT $? 0 0 "安装ocaml-cppo软件包失败" - fi - - LOG_INFO "步骤4:检查cppo命令是否支持-I和-o参数" - cppo --help 2>&1 | grep -q "\-I" - CHECK_RESULT $? 0 0 "cppo命令不支持-I参数" - cppo --help 2>&1 | grep -q "\-o" - CHECK_RESULT $? 0 0 "cppo命令不支持-o参数" - - LOG_INFO "步骤5:创建测试输入文件和包含目录" - mkdir -p test_include_dir - echo "#define TEST_MACRO 123" > test_include_dir/test_header.h - echo "#include \"test_header.h\"\nint main() { return TEST_MACRO; }" > test_input.ml - - LOG_INFO "步骤6:使用-I参数添加包含目录,-o参数指定输出文件" - cppo -I test_include_dir -o test_output.ml test_input.ml - CHECK_RESULT $? 0 0 "cppo命令执行失败" - - LOG_INFO "步骤7:验证输出文件内容" - grep -q "123" test_output.ml - CHECK_RESULT $? 0 0 "输出文件内容不符合预期" - - LOG_INFO "步骤8:清理测试文件" - rm -rf test_include_dir test_input.ml test_output.ml - - if [ $already_installed -eq 0 ]; then - LOG_INFO "步骤9:卸载ocaml-cppo软件包" - dnf remove -y ocaml-cppo - CHECK_RESULT $? 0 0 "卸载ocaml-cppo软件包失败" - fi - - LOG_INFO "测试完成" -} - -main "$@" \ No newline at end of file diff --git a/testcases/function_test/pkg_test/ocaml-cppo/ocaml-cppo/test_ocaml-cppo_cppo__upper_u.sh b/testcases/function_test/pkg_test/ocaml-cppo/ocaml-cppo/test_ocaml-cppo_cppo__upper_u.sh deleted file mode 100644 index 63b406eb015..00000000000 --- a/testcases/function_test/pkg_test/ocaml-cppo/ocaml-cppo/test_ocaml-cppo_cppo__upper_u.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-04-05 -# @License : Mulan PSL v2 -# @Desc : 测试使用-U参数取消宏定义并处理输入文件 -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - set -e - - LOG_INFO "开始测试使用-U参数取消宏定义并处理输入文件" - - # 检查软件包是否在yum源中 - LOG_INFO "检查yum源中是否有ocaml-cppo软件包" - if ! dnf list available ocaml-cppo &> /dev/null; then - LOG_ERROR "yum源中未找到ocaml-cppo软件包" - exit 255 - fi - - # 判断是否已安装软件包 - if rpm -q ocaml-cppo &> /dev/null; then - LOG_INFO "检测到ocaml-cppo已安装,测试完成后将保持安装状态" - INSTALLED_BEFORE_TEST=true - else - LOG_INFO "检测到ocaml-cppo未安装,将在测试过程中安装" - INSTALLED_BEFORE_TEST=false - fi - - # 若未安装则安装软件包 - if [ "$INSTALLED_BEFORE_TEST" = false ]; then - LOG_INFO "安装ocaml-cppo软件包" - dnf install -y ocaml-cppo - CHECK_RESULT $? 0 0 "安装ocaml-cppo失败" - fi - - # 测试-U参数支持性 - LOG_INFO "检查cppo命令是否支持-U参数" - if ! cppo --help 2>&1 | grep -q -- "-U"; then - LOG_ERROR "cppo命令不支持-U参数" - # 清理环境 - if [ "$INSTALLED_BEFORE_TEST" = false ]; then - LOG_INFO "卸载测试安装的ocaml-cppo软件包" - dnf remove -y ocaml-cppo - fi - exit 255 - fi - - # 创建测试输入文件 - LOG_INFO "创建测试输入文件" - INPUT_FILE="test_input.ml" - echo "#ifdef TEST_MACRO" > "$INPUT_FILE" - echo "let x = 1" >> "$INPUT_FILE" - echo "#else" >> "$INPUT_FILE" - echo "let x = 2" >> "$INPUT_FILE" - echo "#endif" >> "$INPUT_FILE" - - # 使用-U参数取消宏定义并处理文件 - LOG_INFO "使用-U TEST_MACRO参数处理输入文件" - cppo -U TEST_MACRO "$INPUT_FILE" > output.ml - CHECK_RESULT $? 0 0 "cppo命令执行失败" - - # 检查输出结果 - LOG_INFO "检查输出文件内容" - EXPECTED="let x = 2" - ACTUAL=$(cat output.ml) - if [ "$ACTUAL" = "$EXPECTED" ]; then - LOG_INFO "输出符合预期:$ACTUAL" - else - LOG_ERROR "输出不符合预期,期望:$EXPECTED,实际:$ACTUAL" - exit 1 - fi - - # 清理测试文件 - LOG_INFO "清理测试文件" - rm -f "$INPUT_FILE" output.ml - - # 环境恢复 - if [ "$INSTALLED_BEFORE_TEST" = false ]; then - LOG_INFO "卸载测试安装的ocaml-cppo软件包" - dnf remove -y ocaml-cppo - CHECK_RESULT $? 0 0 "卸载ocaml-cppo失败" - else - LOG_INFO "保持ocaml-cppo软件包安装状态" - fi - - LOG_INFO "测试完成" -} - -main "$@" \ No newline at end of file diff --git a/testcases/function_test/pkg_test/ocaml-cppo/ocaml-cppo/test_ocaml-cppo_cppo__upper_v.sh b/testcases/function_test/pkg_test/ocaml-cppo/ocaml-cppo/test_ocaml-cppo_cppo__upper_v.sh deleted file mode 100644 index 88537d3cdcc..00000000000 --- a/testcases/function_test/pkg_test/ocaml-cppo/ocaml-cppo/test_ocaml-cppo_cppo__upper_v.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-04-05 -# @License : Mulan PSL v2 -# @Desc : 测试使用-V参数根据语义化版本字符串定义相关变量并处理输入文件 -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - LOG_INFO "开始测试cppo的-V参数功能:根据语义化版本字符串定义相关变量并处理输入文件" - - # 检查是否已安装cppo - if dnf list installed ocaml-cppo &>/dev/null; then - LOG_INFO "检测到cppo已安装,测试结束后将保持安装状态" - INSTALLED="true" - else - LOG_INFO "cppo未安装,将在测试过程中安装,并在测试结束后卸载" - INSTALLED="false" - fi - - # 检查yum源中是否有cppo软件包 - LOG_INFO "检查yum源中是否存在ocaml-cppo软件包" - if ! dnf list available ocaml-cppo &>/dev/null; then - LOG_ERROR "yum源中未找到ocaml-cppo软件包" - exit 255 - fi - - # 如果未安装,则安装cppo - if [ "$INSTALLED" = "false" ]; then - LOG_INFO "安装ocaml-cppo软件包" - dnf install -y ocaml-cppo - CHECK_RESULT $? 0 0 "安装ocaml-cppo失败" - fi - - # 验证cppo命令是否可用 - LOG_INFO "验证cppo命令是否可用" - which cppo - CHECK_RESULT $? 0 0 "cppo命令未找到" - - # 测试-V参数是否存在 - LOG_INFO "测试cppo的-V参数是否支持" - cppo --help 2>&1 | grep -q "\-V" - if [ $? -ne 0 ]; then - LOG_ERROR "cppo不支持-V参数" - exit 255 - fi - - # 创建测试输入文件 - LOG_INFO "创建测试输入文件test_input.ml" - cat > test_input.ml << "EOF" - let version = "%%VERSION%%" - let major = %%VERSION_MAJOR%% - let minor = %%VERSION_MINOR%% - let patch = %%VERSION_PATCH%% - EOF - - # 使用-V参数处理文件 - LOG_INFO "使用cppo -V参数处理测试文件" - cppo -V 1.2.3 test_input.ml -o test_output.ml - CHECK_RESULT $? 0 0 "cppo -V参数执行失败" - - # 验证输出文件内容 - LOG_INFO "验证输出文件内容" - EXPECTED_CONTENT="let version = "1.2.3" - let major = 1 - let minor = 2 - let patch = 3" - - ACTUAL_CONTENT=$(cat test_output.ml) - if [ "$ACTUAL_CONTENT" = "$EXPECTED_CONTENT" ]; then - LOG_INFO "输出文件内容符合预期" - else - LOG_ERROR "输出文件内容不符合预期" - LOG_ERROR "期望内容: $EXPECTED_CONTENT" - LOG_ERROR "实际内容: $ACTUAL_CONTENT" - exit 1 - fi - - # 清理测试文件 - LOG_INFO "清理测试文件" - rm -f test_input.ml test_output.ml - CHECK_RESULT $? 0 0 "清理测试文件失败" - - # 如果测试前未安装,则卸载cppo - if [ "$INSTALLED" = "false" ]; then - LOG_INFO "卸载ocaml-cppo软件包" - dnf remove -y ocaml-cppo - CHECK_RESULT $? 0 0 "卸载ocaml-cppo失败" - fi - - LOG_INFO "cppo -V参数测试完成" -} - -main "$@" \ No newline at end of file diff --git a/testcases/function_test/pkg_test/ocaml-cppo/ocaml-cppo/test_ocaml-cppo_cppo__upper_v_s.sh b/testcases/function_test/pkg_test/ocaml-cppo/ocaml-cppo/test_ocaml-cppo_cppo__upper_v_s.sh deleted file mode 100644 index 4ea0b1f78b3..00000000000 --- a/testcases/function_test/pkg_test/ocaml-cppo/ocaml-cppo/test_ocaml-cppo_cppo__upper_v_s.sh +++ /dev/null @@ -1,92 +0,0 @@ -#!/usr/bin/bash - -# Copyright (c) 2024 ISCAS .ALL rights reserved. -# This program is licensed under Mulan PSL v2. -# You can use it according to the terms and conditions of the Mulan PSL v2. -# http://license.coscl.org.cn/MulanPSL2 -# THIS PROGRAM IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, -# EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, -# MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. -# See the Mulan PSL v2 for more details. - -# ############################################# -# @Author : honghua -# @Contact : honghua@iscas.ac.cn -# @Date : 2026-04-05 -# @License : Mulan PSL v2 -# @Desc : 测试组合使用-V和-s参数定义版本变量并输出精确行指令处理输入文件 -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - LOG_INFO "开始测试组合使用-V和-s参数定义版本变量并输出精确行指令处理输入文件" - - LOG_INFO "检查是否已安装ocaml-cppo软件包" - if dnf list installed ocaml-cppo &>/dev/null; then - LOG_INFO "ocaml-cppo软件包已安装,测试完成后将保持安装状态" - already_installed=true - else - LOG_INFO "ocaml-cppo软件包未安装,将在测试前安装并在测试后卸载" - already_installed=false - fi - - LOG_INFO "检查yum源中是否存在ocaml-cppo软件包" - if ! dnf list available ocaml-cppo &>/dev/null; then - LOG_ERROR "yum源中未找到ocaml-cppo软件包" - exit 255 - fi - - if [ "$already_installed" = false ]; then - LOG_INFO "安装ocaml-cppo软件包" - dnf install -y ocaml-cppo - CHECK_RESULT $? 0 0 "安装ocaml-cppo软件包失败" - fi - - LOG_INFO "验证cppo命令是否存在" - if ! command -v cppo &>/dev/null; then - LOG_ERROR "cppo命令未找到" - exit 255 - fi - - LOG_INFO "验证cppo命令是否支持-V参数" - cppo -V &>/dev/null - if [ $? -eq 255 ]; then - LOG_ERROR "cppo命令不支持-V参数" - exit 255 - fi - - LOG_INFO "验证cppo命令是否支持-s参数" - cppo -s VERSION=1.0.0 -V 2>&1 | grep -q "unknown option" - if [ $? -eq 0 ]; then - LOG_ERROR "cppo命令不支持-s参数" - exit 255 - fi - - LOG_INFO "创建测试输入文件" - cat > test_input.ml << "EOF" - let version = "VERSION" - let message = "Hello, World!" - EOF - - LOG_INFO "使用-V和-s参数处理输入文件" - cppo -V -s VERSION=1.0.0 test_input.ml -o test_output.ml - CHECK_RESULT $? 0 0 "cppo命令执行失败" - - LOG_INFO "检查输出文件内容" - grep -q "let version = "1.0.0"" test_output.ml - CHECK_RESULT $? 0 0 "版本变量替换失败" - - LOG_INFO "清理测试文件" - rm -f test_input.ml test_output.ml - - if [ "$already_installed" = false ]; then - LOG_INFO "卸载ocaml-cppo软件包" - dnf remove -y ocaml-cppo - CHECK_RESULT $? 0 0 "卸载ocaml-cppo软件包失败" - fi - - LOG_INFO "测试完成,环境已恢复" -} - -main "$@" \ No newline at end of file diff --git a/testcases/function_test/pkg_test/ocaml-cppo/ocaml-cppo/test_ocaml-cppo_cppo_help.sh b/testcases/function_test/pkg_test/ocaml-cppo/ocaml-cppo/test_ocaml-cppo_cppo_help.sh deleted file mode 100644 index 07dedb6db22..00000000000 --- a/testcases/function_test/pkg_test/ocaml-cppo/ocaml-cppo/test_ocaml-cppo_cppo_help.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-04-05 -# @License : Mulan PSL v2 -# @Desc : 测试使用-help参数显示选项列表 -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - # 判断是否已安装ocaml-cppo软件包 - LOG_INFO "检查是否已安装ocaml-cppo软件包" - rpm -q ocaml-cppo > /dev/null 2>&1 - if [ $? -eq 0 ]; then - LOG_INFO "ocaml-cppo软件包已安装,测试后将保持安装状态" - INSTALLED=true - else - LOG_INFO "ocaml-cppo软件包未安装,将在测试后卸载" - INSTALLED=false - fi - - # 检查yum源中是否有ocaml-cppo软件包 - LOG_INFO "检查yum源中是否有ocaml-cppo软件包" - dnf list available ocaml-cppo > /dev/null 2>&1 - CHECK_RESULT $? 0 255 "yum源中没有ocaml-cppo软件包" - - # 如果未安装,则安装软件包 - if [ "$INSTALLED" = "false" ]; then - LOG_INFO "安装ocaml-cppo软件包" - dnf install -y ocaml-cppo > /dev/null 2>&1 - CHECK_RESULT $? 0 0 "安装ocaml-cppo软件包失败" - fi - - # 测试cppo命令的-help参数 - LOG_INFO "测试cppo命令的-help参数" - cppo --help > /dev/null 2>&1 - if [ $? -eq 0 ]; then - LOG_INFO "cppo命令支持--help参数" - else - cppo -help > /dev/null 2>&1 - if [ $? -eq 0 ]; then - LOG_INFO "cppo命令支持-help参数" - else - LOG_ERROR "cppo命令不支持-help或--help参数" - exit 255 - fi - fi - - # 验证-help参数显示的选项列表 - LOG_INFO "验证-help参数显示的选项列表" - cppo --help 2>&1 | grep -q "Usage:" || cppo -help 2>&1 | grep -q "Usage:" - CHECK_RESULT $? 0 0 "cppo命令的-help参数未显示选项列表" - - # 环境清理:如果测试前未安装,则卸载软件包 - if [ "$INSTALLED" = "false" ]; then - LOG_INFO "卸载ocaml-cppo软件包" - dnf remove -y ocaml-cppo > /dev/null 2>&1 - CHECK_RESULT $? 0 0 "卸载ocaml-cppo软件包失败" - fi - - LOG_INFO "测试完成" -} - -main "$@" \ No newline at end of file diff --git a/testcases/function_test/pkg_test/ocaml-cppo/ocaml-cppo/test_ocaml-cppo_cppo_n.sh b/testcases/function_test/pkg_test/ocaml-cppo/ocaml-cppo/test_ocaml-cppo_cppo_n.sh deleted file mode 100644 index 3336ce473e3..00000000000 --- a/testcases/function_test/pkg_test/ocaml-cppo/ocaml-cppo/test_ocaml-cppo_cppo_n.sh +++ /dev/null @@ -1,89 +0,0 @@ -#!/usr/bin/bash - -# Copyright (c) 2024 ISCAS .ALL rights reserved. -# This program is licensed under Mulan PSL v2. -# You can use it according to the terms and conditions of the Mulan PSL v2. -# http://license.coscl.org.cn/MulanPSL2 -# THIS PROGRAM IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, -# EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, -# MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. -# See the Mulan PSL v2 for more details. - -# ############################################# -# @Author : honghua -# @Contact : honghua@iscas.ac.cn -# @Date : 2026-04-05 -# @License : Mulan PSL v2 -# @Desc : 测试使用-n参数不输出任何行指令(覆盖-s参数)并处理输入文件 -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - # 判断是否已安装cppo软件包 - LOG_INFO "检查是否已安装cppo软件包" - rpm -q ocaml-cppo-cppo > /dev/null 2>&1 - if [ $? -eq 0 ]; then - LOG_INFO "cppo软件包已安装,测试结束后将保持安装状态" - INSTALLED=1 - else - LOG_INFO "cppo软件包未安装,将在测试前安装并在测试后卸载" - INSTALLED=0 - fi - - # 检查yum源中是否存在cppo软件包 - LOG_INFO "检查yum源中是否存在ocaml-cppo-cppo软件包" - dnf list available ocaml-cppo-cppo > /dev/null 2>&1 - CHECK_RESULT $? 0 0 "yum源中未找到ocaml-cppo-cppo软件包" - if [ $? -ne 0 ]; then - LOG_ERROR "yum源中未找到ocaml-cppo-cppo软件包" - exit 255 - fi - - # 如果未安装,则安装cppo软件包 - if [ $INSTALLED -eq 0 ]; then - LOG_INFO "安装ocaml-cppo-cppo软件包" - dnf install -y ocaml-cppo-cppo - CHECK_RESULT $? 0 0 "安装ocaml-cppo-cppo软件包失败" - fi - - # 创建测试输入文件 - LOG_INFO "创建测试输入文件" - cat > test_input.txt << EOF - #define TEST 1 - #ifdef TEST - This is a test line. - #endif - EOF - CHECK_RESULT $? 0 0 "创建测试输入文件失败" - - # 测试使用-n参数不输出任何行指令(覆盖-s参数)并处理输入文件 - LOG_INFO "测试使用-n参数不输出任何行指令(覆盖-s参数)并处理输入文件" - cppo -n test_input.txt > test_output.txt 2>&1 - CHECK_RESULT $? 0 0 "执行cppo -n命令失败" - - # 检查输出文件是否为空(-n参数应不输出任何行) - LOG_INFO "检查输出文件是否为空" - if [ -s test_output.txt ]; then - LOG_ERROR "输出文件不为空,-n参数未生效" - exit 1 - else - LOG_INFO "输出文件为空,-n参数生效" - fi - - # 清理测试文件 - LOG_INFO "清理测试文件" - rm -f test_input.txt test_output.txt - CHECK_RESULT $? 0 0 "清理测试文件失败" - - # 如果测试前未安装,则卸载cppo软件包 - if [ $INSTALLED -eq 0 ]; then - LOG_INFO "卸载ocaml-cppo-cppo软件包" - dnf remove -y ocaml-cppo-cppo - CHECK_RESULT $? 0 0 "卸载ocaml-cppo-cppo软件包失败" - fi - - LOG_INFO "测试完成,环境已恢复" -} - -main "$@" \ No newline at end of file diff --git a/testcases/function_test/pkg_test/ocaml-cppo/ocaml-cppo/test_ocaml-cppo_cppo_q.sh b/testcases/function_test/pkg_test/ocaml-cppo/ocaml-cppo/test_ocaml-cppo_cppo_q.sh deleted file mode 100644 index 8cb7d154e08..00000000000 --- a/testcases/function_test/pkg_test/ocaml-cppo/ocaml-cppo/test_ocaml-cppo_cppo_q.sh +++ /dev/null @@ -1,89 +0,0 @@ -#!/usr/bin/bash - -# Copyright (c) 2024 ISCAS .ALL rights reserved. -# This program is licensed under Mulan PSL v2. -# You can use it according to the terms and conditions of the Mulan PSL v2. -# http://license.coscl.org.cn/MulanPSL2 -# THIS PROGRAM IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, -# EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, -# MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. -# See the Mulan PSL v2 for more details. - -# ############################################# -# @Author : honghua -# @Contact : honghua@iscas.ac.cn -# @Date : 2026-04-05 -# @License : Mulan PSL v2 -# @Desc : 测试使用-q参数识别并保留camlp4引用并处理输入文件 -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - set -e - - LOG_INFO "开始测试:测试使用-q参数识别并保留camlp4引用并处理输入文件" - - LOG_INFO "步骤1:检查yum源中是否存在ocaml-cppo软件包" - if ! dnf list available ocaml-cppo &>/dev/null; then - LOG_ERROR "yum源中未找到ocaml-cppo软件包" - exit 255 - fi - - LOG_INFO "步骤2:检查当前是否已安装ocaml-cppo" - if rpm -q ocaml-cppo &>/dev/null; then - LOG_INFO "ocaml-cppo已安装,测试结束后将保持安装状态" - already_installed=true - else - LOG_INFO "ocaml-cppo未安装,将在测试过程中安装" - already_installed=false - fi - - if [ "$already_installed" = "false" ]; then - LOG_INFO "步骤3:安装ocaml-cppo软件包" - dnf install -y ocaml-cppo - CHECK_RESULT $? 0 0 "安装ocaml-cppo失败" - fi - - LOG_INFO "步骤4:检查cppo命令是否支持-q参数" - cppo --help | grep -q "\-q" || { - LOG_ERROR "cppo命令不支持-q参数" - exit 255 - } - - LOG_INFO "步骤5:创建测试输入文件" - cat > test_input.ml << "EOF" - (* This is a test file *) - let x = 1 - (*#if OCAML_VERSION < 402 *) - let y = 2 - (*#else *) - let z = 3 - (*#endif *) - EOF - - LOG_INFO "步骤6:使用-q参数处理输入文件" - cppo -q test_input.ml -o test_output.ml - CHECK_RESULT $? 0 0 "cppo命令执行失败" - - LOG_INFO "步骤7:验证输出文件是否包含camlp4引用" - if grep -q "(*#" test_output.ml; then - LOG_INFO "测试成功:输出文件中保留了camlp4引用" - else - LOG_ERROR "测试失败:输出文件中未找到camlp4引用" - exit 1 - fi - - LOG_INFO "步骤8:清理测试文件" - rm -f test_input.ml test_output.ml - - if [ "$already_installed" = "false" ]; then - LOG_INFO "步骤9:卸载ocaml-cppo软件包" - dnf remove -y ocaml-cppo - CHECK_RESULT $? 0 0 "卸载ocaml-cppo失败" - fi - - LOG_INFO "测试完成" -} - -main "$@" \ No newline at end of file diff --git a/testcases/function_test/pkg_test/ocaml-cppo/ocaml-cppo/test_ocaml-cppo_cppo_q_n.sh b/testcases/function_test/pkg_test/ocaml-cppo/ocaml-cppo/test_ocaml-cppo_cppo_q_n.sh deleted file mode 100644 index eaad9cbf91c..00000000000 --- a/testcases/function_test/pkg_test/ocaml-cppo/ocaml-cppo/test_ocaml-cppo_cppo_q_n.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-04-05 -# @License : Mulan PSL v2 -# @Desc : 测试组合使用-q和-n参数识别保留引用且不输出行指令处理输入文件 -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - LOG_INFO "开始测试组合使用-q和-n参数识别保留引用且不输出行指令处理输入文件" - - LOG_INFO "检查是否已安装ocaml-cppo软件包" - if dnf list installed ocaml-cppo &>/dev/null; then - LOG_INFO "ocaml-cppo已安装,测试结束后保持安装状态" - installed=true - else - LOG_INFO "ocaml-cppo未安装,将在测试过程中安装并在结束后卸载" - installed=false - fi - - LOG_INFO "检查yum源中是否有ocaml-cppo软件包" - if ! dnf list available ocaml-cppo &>/dev/null; then - LOG_ERROR "yum源中未找到ocaml-cppo软件包" - exit 255 - fi - - if [ "$installed" = false ]; then - LOG_INFO "安装ocaml-cppo软件包" - dnf install -y ocaml-cppo - CHECK_RESULT $? 0 0 "安装ocaml-cppo失败" - fi - - LOG_INFO "创建测试输入文件" - cat > test_input.ml << "EOF" - let x = 1 - let y = "hello" - (* # 42 *) - EOF - - LOG_INFO "测试cppo命令组合使用-q和-n参数" - LOG_INFO "执行命令:cppo -q -n test_input.ml -o test_output.ml" - cppo -q -n test_input.ml -o test_output.ml - CHECK_RESULT $? 0 0 "cppo命令执行失败" - - LOG_INFO "检查输出文件是否生成" - if [ -f test_output.ml ]; then - LOG_INFO "输出文件生成成功" - else - LOG_ERROR "输出文件未生成" - exit 1 - fi - - LOG_INFO "检查输出文件内容是否符合预期" - expected_content="let x = 1 - let y = \"hello\"" - actual_content=$(cat test_output.ml) - if [ "$expected_content" = "$actual_content" ]; then - LOG_INFO "输出文件内容符合预期" - else - LOG_ERROR "输出文件内容不符合预期" - LOG_INFO "期望内容:$expected_content" - LOG_INFO "实际内容:$actual_content" - exit 1 - fi - - LOG_INFO "清理测试文件" - rm -f test_input.ml test_output.ml - - if [ "$installed" = false ]; then - LOG_INFO "卸载ocaml-cppo软件包" - dnf remove -y ocaml-cppo - CHECK_RESULT $? 0 0 "卸载ocaml-cppo失败" - fi - - LOG_INFO "测试完成" -} - -main "$@" \ No newline at end of file diff --git a/testcases/function_test/pkg_test/ocaml-cppo/ocaml-cppo/test_ocaml-cppo_cppo_s.sh b/testcases/function_test/pkg_test/ocaml-cppo/ocaml-cppo/test_ocaml-cppo_cppo_s.sh deleted file mode 100644 index 9c3735f27b8..00000000000 --- a/testcases/function_test/pkg_test/ocaml-cppo/ocaml-cppo/test_ocaml-cppo_cppo_s.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-04-05 -# @License : Mulan PSL v2 -# @Desc : 测试使用-s参数输出指向每个标记精确源代码位置的行指令并处理输入文件 -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - LOG_INFO "开始测试使用-s参数输出指向每个标记精确源代码位置的行指令并处理输入文件" - - # 检查软件包是否在yum源中 - LOG_INFO "检查yum源中是否存在ocaml-cppo软件包" - if ! dnf list available ocaml-cppo 2>/dev/null | grep -q "ocaml-cppo"; then - LOG_ERROR "yum源中未找到ocaml-cppo软件包" - exit 255 - fi - - # 检查环境是否已安装ocaml-cppo - LOG_INFO "检查环境是否已安装ocaml-cppo" - if dnf list installed ocaml-cppo 2>/dev/null | grep -q "ocaml-cppo"; then - LOG_INFO "环境已安装ocaml-cppo,测试结束后保持安装状态" - already_installed=true - else - LOG_INFO "环境未安装ocaml-cppo,将进行安装" - already_installed=false - fi - - # 如果未安装,则安装软件包 - if [ "$already_installed" = false ]; then - LOG_INFO "安装ocaml-cppo软件包" - dnf install -y ocaml-cppo - CHECK_RESULT $? 0 0 "安装ocaml-cppo失败" - fi - - # 检查cppo命令是否支持-s参数 - LOG_INFO "检查cppo命令是否支持-s参数" - if ! cppo --help 2>&1 | grep -q "\-s"; then - LOG_ERROR "cppo命令不支持-s参数" - exit 255 - fi - - # 创建测试输入文件 - LOG_INFO "创建测试输入文件test_input.ml" - cat > test_input.ml << EOF - let x = 1 - let y = 2 - EOF - - # 使用-s参数处理输入文件 - LOG_INFO "使用cppo -s参数处理输入文件" - cppo -s test_input.ml -o test_output.ml - CHECK_RESULT $? 0 0 "cppo -s命令执行失败" - - # 检查输出文件是否生成 - LOG_INFO "检查输出文件是否生成" - if [ -f test_output.ml ]; then - LOG_INFO "输出文件test_output.ml生成成功" - else - LOG_ERROR "输出文件test_output.ml未生成" - exit 1 - fi - - # 清理测试文件 - LOG_INFO "清理测试文件" - rm -f test_input.ml test_output.ml - - # 如果测试前未安装,则卸载软件包 - if [ "$already_installed" = false ]; then - LOG_INFO "卸载ocaml-cppo软件包" - dnf remove -y ocaml-cppo - CHECK_RESULT $? 0 0 "卸载ocaml-cppo失败" - fi - - LOG_INFO "测试完成" -} - -main "$@" \ No newline at end of file diff --git a/testcases/function_test/pkg_test/ocaml-cppo/ocaml-cppo/test_ocaml-cppo_cppo_x.sh b/testcases/function_test/pkg_test/ocaml-cppo/ocaml-cppo/test_ocaml-cppo_cppo_x.sh deleted file mode 100644 index 3520df1337a..00000000000 --- a/testcases/function_test/pkg_test/ocaml-cppo/ocaml-cppo/test_ocaml-cppo_cppo_x.sh +++ /dev/null @@ -1,109 +0,0 @@ -#!/usr/bin/bash - -# Copyright (c) 2024 ISCAS .ALL rights reserved. -# This program is licensed under Mulan PSL v2. -# You can use it according to the terms and conditions of the Mulan PSL v2. -# http://license.coscl.org.cn/MulanPSL2 -# THIS PROGRAM IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, -# EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, -# MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. -# See the Mulan PSL v2 for more details. - -# ############################################# -# @Author : honghua -# @Contact : honghua@iscas.ac.cn -# @Date : 2026-04-05 -# @License : Mulan PSL v2 -# @Desc : 测试使用-x参数定义自定义预处理器目标段并处理输入文件 -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - LOG_INFO "开始测试:使用-x参数定义自定义预处理器目标段并处理输入文件" - - # 检查软件包是否已在yum源中 - LOG_INFO "检查ocaml-cppo软件包是否在yum源中" - dnf list ocaml-cppo 2>&1 | grep -q "Available Packages" - if [ $? -ne 0 ]; then - LOG_ERROR "yum源中未找到ocaml-cppo软件包" - exit 255 - fi - - # 检查是否已安装ocaml-cppo - LOG_INFO "检查ocaml-cppo是否已安装" - rpm -q ocaml-cppo > /dev/null 2>&1 - INSTALLED=$? - - if [ $INSTALLED -ne 0 ]; then - LOG_INFO "ocaml-cppo未安装,开始安装" - dnf install -y ocaml-cppo - CHECK_RESULT $? 0 0 "安装ocaml-cppo失败" - NEED_CLEANUP=1 - else - LOG_INFO "ocaml-cppo已安装,跳过安装步骤" - NEED_CLEANUP=0 - fi - - # 创建测试输入文件 - LOG_INFO "创建测试输入文件" - cat > test_input.ml << "EOF" - #ifdef CUSTOM - let message = "Custom defined" - #else - let message = "Default" - #endif - - let () = print_endline message - EOF - - # 测试-x参数是否存在 - LOG_INFO "检查cppo命令是否支持-x参数" - cppo --help 2>&1 | grep -q -- "-x" - if [ $? -ne 0 ]; then - LOG_ERROR "cppo命令不支持-x参数" - exit 255 - fi - - # 使用-x参数定义自定义预处理器目标段 - LOG_INFO "使用-x参数处理输入文件" - cat > test_definitions << "EOF" - #define CUSTOM - EOF - - cppo -x "CUSTOM" -D CUSTOM test_input.ml -o test_output.ml - CHECK_RESULT $? 0 0 "使用-x参数处理文件失败" - - # 验证输出结果 - LOG_INFO "验证处理结果" - EXPECTED="let message = "Custom defined" - - let () = print_endline message" - - ACTUAL=$(cat test_output.ml) - if [ "$ACTUAL" = "$EXPECTED" ]; then - LOG_INFO "测试成功:自定义预处理器目标段正确处理" - else - LOG_ERROR "测试失败:输出不符合预期" - echo "期望输出:$EXPECTED" - echo "实际输出:$ACTUAL" - exit 1 - fi - - # 清理测试文件 - LOG_INFO "清理测试文件" - rm -f test_input.ml test_output.ml test_definitions - - # 根据安装状态决定是否卸载 - if [ $NEED_CLEANUP -eq 1 ]; then - LOG_INFO "卸载ocaml-cppo软件包" - dnf remove -y ocaml-cppo - CHECK_RESULT $? 0 0 "卸载ocaml-cppo失败" - else - LOG_INFO "保持ocaml-cppo安装状态" - fi - - LOG_INFO "测试完成" -} - -main "$@" \ No newline at end of file diff --git a/testcases/function_test/pkg_test/ocaml-cppo/ocaml-cppo/test_ocaml-cppo_function_basic_usage.sh b/testcases/function_test/pkg_test/ocaml-cppo/ocaml-cppo/test_ocaml-cppo_function_basic_usage.sh deleted file mode 100644 index 6c0677b263a..00000000000 --- a/testcases/function_test/pkg_test/ocaml-cppo/ocaml-cppo/test_ocaml-cppo_function_basic_usage.sh +++ /dev/null @@ -1,109 +0,0 @@ -#!/usr/bin/bash - -# Copyright (c) 2024 ISCAS .ALL rights reserved. -# This program is licensed under Mulan PSL v2. -# You can use it according to the terms and conditions of the Mulan PSL v2. -# http://license.coscl.org.cn/MulanPSL2 -# THIS PROGRAM IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, -# EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, -# MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. -# See the Mulan PSL v2 for more details. - -# ############################################# -# @Author : honghua -# @Contact : honghua@iscas.ac.cn -# @Date : 2026-04-05 -# @License : Mulan PSL v2 -# @Desc : 测试 cppo 基本文件处理功能,验证标准输入输出处理 -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - LOG_INFO "开始测试 cppo 基本文件处理功能,验证标准输入输出处理" - - # 检查 yum 源中是否存在 ocaml-cppo 软件包 - LOG_INFO "检查 yum 源中是否存在 ocaml-cppo 软件包" - if ! dnf list available ocaml-cppo &> /dev/null; then - LOG_ERROR "yum 源中未找到 ocaml-cppo 软件包" - exit 255 - fi - - # 判断环境是否已经安装 ocaml-cppo - LOG_INFO "判断环境是否已经安装 ocaml-cppo" - if rpm -q ocaml-cppo &> /dev/null; then - LOG_INFO "环境中已安装 ocaml-cppo,测试结束后将保持安装状态" - already_installed=1 - else - LOG_INFO "环境中未安装 ocaml-cppo,将进行安装" - already_installed=0 - fi - - # 如果未安装,则安装 ocaml-cppo - if [ $already_installed -eq 0 ]; then - LOG_INFO "安装 ocaml-cppo 软件包" - dnf install -y ocaml-cppo - CHECK_RESULT $? 0 0 "安装 ocaml-cppo 失败" - fi - - # 验证 cppo 命令是否存在 - LOG_INFO "验证 cppo 命令是否存在" - if ! command -v cppo &> /dev/null; then - LOG_ERROR "cppo 命令不存在" - exit 255 - fi - - # 测试 cppo 基本文件处理功能:标准输入输出处理 - LOG_INFO "测试 cppo 基本文件处理功能:标准输入输出处理" - - # 创建一个简单的 OCaml 源文件用于测试 - LOG_INFO "创建测试用的 OCaml 源文件" - cat > test_input.ml << "EOF" - (* 测试文件 *) - let x = 1 - #if OCAML_VERSION >= 402 - let y = 2 - #else - let y = 3 - #endif - let z = 4 - EOF - - # 使用 cppo 处理文件,并验证输出 - LOG_INFO "使用 cppo 处理测试文件" - cppo -D OCAML_VERSION=402 test_input.ml -o test_output.ml - CHECK_RESULT $? 0 0 "cppo 处理文件失败" - - # 检查输出文件内容是否符合预期 - LOG_INFO "检查输出文件内容是否符合预期" - expected_content="(* 测试文件 *) - let x = 1 - let y = 2 - let z = 4" - actual_content=$(cat test_output.ml) - if [ "$actual_content" = "$expected_content" ]; then - LOG_INFO "输出文件内容符合预期" - else - LOG_ERROR "输出文件内容不符合预期" - LOG_ERROR "期望内容:$expected_content" - LOG_ERROR "实际内容:$actual_content" - exit 1 - fi - - # 清理测试文件 - LOG_INFO "清理测试文件" - rm -f test_input.ml test_output.ml - - # 如果测试前未安装,则卸载 ocaml-cppo - if [ $already_installed -eq 0 ]; then - LOG_INFO "卸载 ocaml-cppo 软件包" - dnf remove -y ocaml-cppo - CHECK_RESULT $? 0 0 "卸载 ocaml-cppo 失败" - else - LOG_INFO "测试前已安装 ocaml-cppo,保持安装状态" - fi - - LOG_INFO "测试 cppo 基本文件处理功能完成" -} - -main "$@" \ No newline at end of file diff --git a/testcases/function_test/pkg_test/ocaml-cppo/ocaml-cppo/test_ocaml-cppo_function_define_macro.sh b/testcases/function_test/pkg_test/ocaml-cppo/ocaml-cppo/test_ocaml-cppo_function_define_macro.sh deleted file mode 100644 index 5378610917a..00000000000 --- a/testcases/function_test/pkg_test/ocaml-cppo/ocaml-cppo/test_ocaml-cppo_function_define_macro.sh +++ /dev/null @@ -1,104 +0,0 @@ -#!/usr/bin/bash - -# Copyright (c) 2024 ISCAS .ALL rights reserved. -# This program is licensed under Mulan PSL v2. -# You can use it according to the terms and conditions of the Mulan PSL v2. -# http://license.coscl.org.cn/MulanPSL2 -# THIS PROGRAM IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, -# EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, -# MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. -# See the Mulan PSL v2 for more details. - -# ############################################# -# @Author : honghua -# @Contact : honghua@iscas.ac.cn -# @Date : 2026-04-05 -# @License : Mulan PSL v2 -# @Desc : 测试使用 -D 参数定义宏并处理文件 -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - set -e - - LOG_INFO "开始测试 -D 参数定义宏并处理文件" - - # 步骤1: 检查yum源中是否存在ocaml-cppo软件包 - LOG_INFO "步骤1: 检查yum源中是否存在ocaml-cppo软件包" - if ! dnf list available ocaml-cppo &> /dev/null; then - LOG_ERROR "yum源中未找到ocaml-cppo软件包" - exit 255 - fi - - # 步骤2: 检查系统是否已安装ocaml-cppo - LOG_INFO "步骤2: 检查系统是否已安装ocaml-cppo" - if rpm -q ocaml-cppo &> /dev/null; then - LOG_INFO "ocaml-cppo已安装,标记为保持安装状态" - keep_installed=true - else - LOG_INFO "ocaml-cppo未安装,将在测试过程中安装" - keep_installed=false - fi - - # 步骤3: 如果未安装,则安装ocaml-cppo - if [ "$keep_installed" = false ]; then - LOG_INFO "步骤3: 安装ocaml-cppo软件包" - dnf install -y ocaml-cppo - CHECK_RESULT $? 0 0 "安装ocaml-cppo失败" - fi - - # 步骤4: 验证cppo命令是否存在 - LOG_INFO "步骤4: 验证cppo命令是否存在" - which cppo - CHECK_RESULT $? 0 0 "cppo命令未找到" - - # 步骤5: 测试cppo命令的-D参数是否存在 - LOG_INFO "步骤5: 测试cppo命令的-D参数是否存在" - if ! cppo --help 2>&1 | grep -q "\-D"; then - LOG_ERROR "cppo命令不支持-D参数" - exit 255 - fi - - # 步骤6: 创建一个测试输入文件 - LOG_INFO "步骤6: 创建一个测试输入文件" - test_input_file=$(mktemp) - cat > "$test_input_file" << "EOF" - #ifndef TEST_MACRO - #error "TEST_MACRO is not defined" - #endif - EOF - - # 步骤7: 使用-D参数定义宏并处理文件 - LOG_INFO "步骤7: 使用-D参数定义宏并处理文件" - test_output_file=$(mktemp) - cppo -D TEST_MACRO "$test_input_file" > "$test_output_file" - CHECK_RESULT $? 0 0 "cppo命令执行失败" - - # 步骤8: 验证输出文件内容 - LOG_INFO "步骤8: 验证输出文件内容" - if grep -q "#error" "$test_output_file"; then - LOG_ERROR "宏定义未生效,输出文件中仍包含#error" - rm -f "$test_input_file" "$test_output_file" - exit 1 - else - LOG_INFO "宏定义成功,输出文件正常" - fi - - # 步骤9: 清理临时文件 - LOG_INFO "步骤9: 清理临时文件" - rm -f "$test_input_file" "$test_output_file" - - # 步骤10: 如果测试开始前未安装,则卸载软件包 - if [ "$keep_installed" = false ]; then - LOG_INFO "步骤10: 卸载ocaml-cppo软件包" - dnf remove -y ocaml-cppo - CHECK_RESULT $? 0 0 "卸载ocaml-cppo失败" - else - LOG_INFO "步骤10: 保持ocaml-cppo安装状态,不卸载" - fi - - LOG_INFO "测试 -D 参数定义宏并处理文件 完成" -} - -main "$@" \ No newline at end of file diff --git a/testcases/function_test/pkg_test/ocaml-cppo/ocaml-cppo/test_ocaml-cppo_function_install.sh b/testcases/function_test/pkg_test/ocaml-cppo/ocaml-cppo/test_ocaml-cppo_function_install.sh deleted file mode 100644 index 1b3a3e07e9c..00000000000 --- a/testcases/function_test/pkg_test/ocaml-cppo/ocaml-cppo/test_ocaml-cppo_function_install.sh +++ /dev/null @@ -1,73 +0,0 @@ -#!/usr/bin/bash - -# Copyright (c) 2024 ISCAS .ALL rights reserved. -# This program is licensed under Mulan PSL v2. -# You can use it according to the terms and conditions of the Mulan PSL v2. -# http://license.coscl.org.cn/MulanPSL2 -# THIS PROGRAM IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, -# EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, -# MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. -# See the Mulan PSL v2 for more details. - -# ############################################# -# @Author : honghua -# @Contact : honghua@iscas.ac.cn -# @Date : 2026-04-05 -# @License : Mulan PSL v2 -# @Desc : 测试 ocaml-cppo 软件包的安装功能,验证安装过程是否成功。 -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - LOG_INFO "开始测试 ocaml-cppo 软件包的安装功能" - LOG_INFO "步骤1:检查软件包是否已在环境中安装" - if dnf list installed ocaml-cppo &> /dev/null; then - LOG_INFO "软件包 ocaml-cppo 已安装,保持安装状态" - INSTALLED=true - else - LOG_INFO "软件包 ocaml-cppo 未安装" - INSTALLED=false - fi - - LOG_INFO "步骤2:检查yum源中是否有 ocaml-cppo 软件包" - if ! dnf list available ocaml-cppo &> /dev/null; then - LOG_ERROR "yum源中未找到 ocaml-cppo 软件包" - exit 255 - fi - - if [ "$INSTALLED" = false ]; then - LOG_INFO "步骤3:安装 ocaml-cppo 软件包" - dnf install -y ocaml-cppo - CHECK_RESULT $? 0 0 "安装 ocaml-cppo 软件包失败" - LOG_INFO "安装 ocaml-cppo 软件包成功" - fi - - LOG_INFO "步骤4:验证 ocaml-cppo 命令是否可用" - if ! command -v cppo &> /dev/null; then - LOG_ERROR "cppo 命令不存在" - exit 255 - fi - - LOG_INFO "步骤5:测试 cppo 命令的基本功能" - echo "let x = 1" > test_input.ml - cppo -V test_input.ml > /dev/null 2>&1 - CHECK_RESULT $? 0 0 "cppo 命令执行失败" - LOG_INFO "cppo 命令执行成功" - - LOG_INFO "步骤6:清理临时文件" - rm -f test_input.ml - - if [ "$INSTALLED" = false ]; then - LOG_INFO "步骤7:卸载 ocaml-cppo 软件包" - dnf remove -y ocaml-cppo - CHECK_RESULT $? 0 0 "卸载 ocaml-cppo 软件包失败" - LOG_INFO "卸载 ocaml-cppo 软件包成功" - else - LOG_INFO "步骤7:保持 ocaml-cppo 软件包安装状态,无需卸载" - fi - - LOG_INFO "测试 ocaml-cppo 软件包的安装功能完成" -} - -main "$@" \ No newline at end of file diff --git a/testcases/function_test/pkg_test/ocaml-cppo/ocaml-cppo/test_ocaml-cppo_function_version.sh b/testcases/function_test/pkg_test/ocaml-cppo/ocaml-cppo/test_ocaml-cppo_function_version.sh deleted file mode 100644 index 236c738a979..00000000000 --- a/testcases/function_test/pkg_test/ocaml-cppo/ocaml-cppo/test_ocaml-cppo_function_version.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-04-05 -# @License : Mulan PSL v2 -# @Desc : 测试使用 -version 参数打印程序版本 -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - LOG_INFO "开始测试:使用 -version 参数打印程序版本" - - # 检查yum源中是否有ocaml-cppo软件包 - LOG_INFO "检查yum源中是否有ocaml-cppo软件包" - dnf list ocaml-cppo 2>/dev/null | grep -q "ocaml-cppo" - if [ $? -ne 0 ]; then - LOG_ERROR "yum源中未找到ocaml-cppo软件包" - exit 255 - fi - - # 检查系统是否已安装ocaml-cppo - LOG_INFO "检查系统是否已安装ocaml-cppo" - rpm -q ocaml-cppo >/dev/null 2>&1 - if [ $? -eq 0 ]; then - LOG_INFO "ocaml-cppo已安装,测试结束后将保持安装状态" - INSTALLED=1 - else - LOG_INFO "ocaml-cppo未安装,将在测试前安装" - INSTALLED=0 - fi - - # 如果未安装,则安装软件包 - if [ $INSTALLED -eq 0 ]; then - LOG_INFO "安装ocaml-cppo软件包" - dnf install -y ocaml-cppo - CHECK_RESULT $? 0 0 "安装ocaml-cppo失败" - fi - - # 检查cppo命令是否支持-version参数 - LOG_INFO "检查cppo命令是否支持-version参数" - cppo --help 2>&1 | grep -q "\-\-version" - if [ $? -ne 0 ]; then - LOG_ERROR "cppo命令不支持-version参数" - exit 255 - fi - - # 执行cppo --version命令 - LOG_INFO "执行cppo --version命令" - cppo --version - CHECK_RESULT $? 0 0 "执行cppo --version命令失败" - - # 清理环境:如果测试前未安装,则卸载软件包 - if [ $INSTALLED -eq 0 ]; then - LOG_INFO "卸载ocaml-cppo软件包" - dnf remove -y ocaml-cppo - CHECK_RESULT $? 0 0 "卸载ocaml-cppo失败" - else - LOG_INFO "测试前已安装ocaml-cppo,保持安装状态" - fi - - LOG_INFO "测试完成" -} - -main "$@" \ No newline at end of file diff --git a/testcases/function_test/pkg_test/openwebbeans/openwebbeans-resource/test_openwebbeans-resource_function_config.sh b/testcases/function_test/pkg_test/openwebbeans/openwebbeans-resource/test_openwebbeans-resource_function_config.sh deleted file mode 100644 index 180cb21ef20..00000000000 --- a/testcases/function_test/pkg_test/openwebbeans/openwebbeans-resource/test_openwebbeans-resource_function_config.sh +++ /dev/null @@ -1,65 +0,0 @@ -#!/usr/bin/bash - -# Copyright (c) 2024 ISCAS .ALL rights reserved. -# This program is licensed under Mulan PSL v2. -# You can use it according to the terms and conditions of the Mulan PSL v2. -# http://license.coscl.org.cn/MulanPSL2 -# THIS PROGRAM IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, -# EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, -# MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. -# See the Mulan PSL v2 for more details. - -# ############################################# -# @Author : honghua -# @Contact : honghua@iscas.ac.cn -# @Date : 2025-12-13 -# @License : Mulan PSL v2 -# @Desc : 测试openwebbeans-resource软件包的配置功能 -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - LOG_INFO "开始测试openwebbeans-resource软件包的配置功能" - - # 检查是否已安装openwebbeans-resource - LOG_INFO "检查是否已安装openwebbeans-resource" - if dnf list installed openwebbeans-resource &>/dev/null; then - LOG_INFO "openwebbeans-resource已安装,保持安装状态" - installed=true - else - LOG_INFO "openwebbeans-resource未安装,将在测试后卸载" - installed=false - fi - - # 检查yum源中是否有openwebbeans-resource软件包 - LOG_INFO "检查yum源中是否有openwebbeans-resource软件包" - if ! dnf list available openwebbeans-resource &>/dev/null; then - LOG_ERROR "yum源中未找到openwebbeans-resource软件包" - exit 255 - fi - - # 如果未安装,则安装openwebbeans-resource - if [ "$installed" = false ]; then - LOG_INFO "开始安装openwebbeans-resource" - dnf install -y openwebbeans-resource - CHECK_RESULT $? 0 0 "安装openwebbeans-resource失败" - fi - - # 测试配置功能 - LOG_INFO "测试openwebbeans-resource的配置功能" - command_to_test="openwebbeans-resource --config" # 假设--config是测试参数 - $command_to_test - CHECK_RESULT $? 0 0 "执行配置功能失败" - - # 清理环境 - if [ "$installed" = false ]; then - LOG_INFO "卸载openwebbeans-resource" - dnf remove -y openwebbeans-resource - CHECK_RESULT $? 0 0 "卸载openwebbeans-resource失败" - fi - - LOG_INFO "测试完成,环境已恢复" -} - -main "$@" \ No newline at end of file diff --git a/testcases/function_test/pkg_test/openwebbeans/openwebbeans-resource/test_openwebbeans-resource_function_inject.sh b/testcases/function_test/pkg_test/openwebbeans/openwebbeans-resource/test_openwebbeans-resource_function_inject.sh deleted file mode 100644 index 8721000353d..00000000000 --- a/testcases/function_test/pkg_test/openwebbeans/openwebbeans-resource/test_openwebbeans-resource_function_inject.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-13 -# @License : Mulan PSL v2 -# @Desc : 测试openwebbeans-resource软件包的依赖注入功能 -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - LOG_INFO "开始测试openwebbeans-resource软件包的依赖注入功能" - - # 检查yum源中是否存在openwebbeans-resource软件包 - LOG_INFO "检查yum源中是否存在openwebbeans-resource软件包" - dnf list available openwebbeans-resource &>/dev/null - CHECK_RESULT $? 0 255 "yum源中不存在openwebbeans-resource软件包" - - # 检查是否已安装openwebbeans-resource - LOG_INFO "检查是否已安装openwebbeans-resource" - if rpm -q openwebbeans-resource &>/dev/null; then - LOG_INFO "openwebbeans-resource已安装,测试结束后保持安装状态" - INSTALLED=true - else - LOG_INFO "openwebbeans-resource未安装,测试结束后将卸载" - INSTALLED=false - fi - - # 安装openwebbeans-resource - if [ "$INSTALLED" = false ]; then - LOG_INFO "安装openwebbeans-resource" - dnf install -y openwebbeans-resource - CHECK_RESULT $? 0 255 "安装openwebbeans-resource失败" - fi - - # 测试依赖注入功能 - LOG_INFO "测试依赖注入功能" - test_command="java -jar /path/to/testjar.jar" # 假设测试命令为java -jar,实际需替换为具体命令 - $test_command - CHECK_RESULT $? 0 0 "依赖注入功能测试失败" - - # 清理环境 - if [ "$INSTALLED" = false ]; then - LOG_INFO "卸载openwebbeans-resource" - dnf remove -y openwebbeans-resource - CHECK_RESULT $? 0 0 "卸载openwebbeans-resource失败" - fi - - LOG_INFO "测试完成,环境已恢复" -} - -main "$@" \ No newline at end of file diff --git a/testcases/function_test/pkg_test/openwebbeans/openwebbeans-resource/test_openwebbeans-resource_function_load.sh b/testcases/function_test/pkg_test/openwebbeans/openwebbeans-resource/test_openwebbeans-resource_function_load.sh deleted file mode 100644 index e2ebb5388c0..00000000000 --- a/testcases/function_test/pkg_test/openwebbeans/openwebbeans-resource/test_openwebbeans-resource_function_load.sh +++ /dev/null @@ -1,69 +0,0 @@ -#!/usr/bin/bash - -# Copyright (c) 2024 ISCAS .ALL rights reserved. -# This program is licensed under Mulan PSL v2. -# You can use it according to the terms and conditions of the Mulan PSL v2. -# http://license.coscl.org.cn/MulanPSL2 -# THIS PROGRAM IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, -# EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, -# MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. -# See the Mulan PSL v2 for more details. - -# ############################################# -# @Author : honghua -# @Contact : honghua@iscas.ac.cn -# @Date : 2025-12-13 -# @License : Mulan PSL v2 -# @Desc : 测试openwebbeans-resource软件包的资源加载功能 -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - # 测试openwebbeans-resource软件包的资源加载功能 - - LOG_INFO "开始测试openwebbeans-resource软件包的资源加载功能" - - # 检查yum源中是否存在openwebbeans-resource软件包 - LOG_INFO "检查yum源中是否存在openwebbeans-resource软件包" - dnf list available openwebbeans-resource &>/dev/null - if [ $? -ne 0 ]; then - LOG_ERROR "yum源中不存在openwebbeans-resource软件包" - exit 255 - fi - - # 检查是否已安装openwebbeans-resource软件包 - LOG_INFO "检查是否已安装openwebbeans-resource软件包" - rpm -q openwebbeans-resource &>/dev/null - if [ $? -eq 0 ]; then - installed=true - LOG_INFO "openwebbeans-resource软件包已安装" - else - installed=false - LOG_INFO "openwebbeans-resource软件包未安装,将进行安装" - fi - - # 如果未安装,则安装软件包 - if [ "$installed" = false ]; then - LOG_INFO "安装openwebbeans-resource软件包" - dnf install -y openwebbeans-resource - CHECK_RESULT $? 0 0 "安装openwebbeans-resource软件包失败" - fi - - # 测试资源加载功能 - LOG_INFO "测试openwebbeans-resource软件包的资源加载功能" - command_to_test="openwebbeans-resource --load" # 假设这是测试命令,根据实际命令调整 - $command_to_test - CHECK_RESULT $? 0 0 "资源加载功能测试失败" - - # 清理环境 - if [ "$installed" = false ]; then - LOG_INFO "卸载openwebbeans-resource软件包" - dnf remove -y openwebbeans-resource - CHECK_RESULT $? 0 0 "卸载openwebbeans-resource软件包失败" - fi - - LOG_INFO "测试openwebbeans-resource软件包的资源加载功能完成" -} - -main "$@" \ No newline at end of file diff --git a/testcases/function_test/pkg_test/openwebbeans/openwebbeans-resource/test_openwebbeans-resource_function_scope.sh b/testcases/function_test/pkg_test/openwebbeans/openwebbeans-resource/test_openwebbeans-resource_function_scope.sh deleted file mode 100644 index a8fdf7fb69b..00000000000 --- a/testcases/function_test/pkg_test/openwebbeans/openwebbeans-resource/test_openwebbeans-resource_function_scope.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-13 -# @License : Mulan PSL v2 -# @Desc : 测试openwebbeans-resource软件包的作用域功能 -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - - # 测试openwebbeans-resource软件包的作用域功能 - - # 步骤1:检查yum源中是否存在openwebbeans-resource软件包 - LOG_INFO "检查yum源中是否存在openwebbeans-resource软件包" - dnf list available openwebbeans-resource > /dev/null 2>&1 - if [ $? -ne 0 ]; then - LOG_ERROR "yum源中未找到openwebbeans-resource软件包" - exit 255 - fi - - # 步骤2:检查是否已安装openwebbeans-resource软件包 - LOG_INFO "检查是否已安装openwebbeans-resource软件包" - rpm -q openwebbeans-resource > /dev/null 2>&1 - if [ $? -eq 0 ]; then - installed=true - LOG_INFO "openwebbeans-resource已安装,脚本结束时将保持安装状态" - else - installed=false - LOG_INFO "openwebbeans-resource未安装,将在测试后卸载" - fi - - # 步骤3:如果未安装,则安装openwebbeans-resource软件包 - if [ "$installed" = false ]; then - LOG_INFO "开始安装openwebbeans-resource软件包" - dnf install -y openwebbeans-resource > /dev/null 2>&1 - CHECK_RESULT $? 0 0 "安装openwebbeans-resource软件包失败" - fi - - # 步骤4:测试openwebbeans-resource的作用域功能 - LOG_INFO "测试openwebbeans-resource的作用域功能" - # 假设测试命令为test_command,这里仅为示例 - test_command="some_command_related_to_openwebbeans_resource" - $test_command > /dev/null 2>&1 - CHECK_RESULT $? 0 0 "测试openwebbeans-resource作用域功能失败" - - # 步骤5:如果之前未安装,则卸载openwebbeans-resource软件包以恢复环境 - if [ "$installed" = false ]; then - LOG_INFO "卸载openwebbeans-resource软件包以恢复环境" - dnf remove -y openwebbeans-resource > /dev/null 2>&1 - CHECK_RESULT $? 0 0 "卸载openwebbeans-resource软件包失败" - fi - - LOG_INFO "测试脚本执行完毕,环境已恢复" - -} - -main "$@" \ No newline at end of file diff --git a/testcases/function_test/pkg_test/perl-Alien-Build/perl-Alien-Build-help/test_perl-Alien-Build-help_function_uninstall.sh b/testcases/function_test/pkg_test/perl-Alien-Build/perl-Alien-Build-help/test_perl-Alien-Build-help_function_uninstall.sh deleted file mode 100644 index 1d39df4d3c9..00000000000 --- a/testcases/function_test/pkg_test/perl-Alien-Build/perl-Alien-Build-help/test_perl-Alien-Build-help_function_uninstall.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-06 -# @License : Mulan PSL v2 -# @Desc : 测试 perl-Alien-Build-help 软件包能否被干净地卸载 -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - # 定义日志函数(直接使用,无需定义) - LOG_INFO() { - echo "[INFO] $*" - } - - LOG_ERROR() { - echo "[ERROR] $*" - } - - # 定义检查结果函数(直接使用,无需定义) - CHECK_RESULT() { - local actual=$1 - local expect=$2 - local exit_code=$3 - local message=$4 - if [ $actual -ne $expect ]; then - LOG_ERROR "$message" - exit $exit_code - fi - } - - # 定义SSH_CMD函数(直接使用,无需定义) - SSH_CMD() { - local cmd=$1 - local ip=$2 - local password=$3 - local user=$4 - sshpass -p "$password" ssh -o StrictHostKeyChecking=no "$user@$ip" "$cmd" - } - - # 定义软件包名称 - PACKAGE_NAME="perl-Alien-Build-help" - - # 检查yum源中是否存在该软件包 - 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" - 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 - - # 如果未安装,则安装软件包作为测试步骤 - if [ "$INSTALLED_BEFORE" = false ]; then - LOG_INFO "安装软件包:$PACKAGE_NAME" - dnf install -y "$PACKAGE_NAME" - CHECK_RESULT $? 0 0 "安装软件包 $PACKAGE_NAME 失败" - fi - - # 检查软件包是否安装成功 - LOG_INFO "验证软件包安装状态" - dnf list installed "$PACKAGE_NAME" &>/dev/null - CHECK_RESULT $? 0 0 "软件包 $PACKAGE_NAME 安装后未在已安装列表中" - - # 测试卸载软件包 - LOG_INFO "测试卸载软件包:$PACKAGE_NAME" - dnf remove -y "$PACKAGE_NAME" - CHECK_RESULT $? 0 0 "卸载软件包 $PACKAGE_NAME 失败" - - # 验证软件包是否被成功卸载 - LOG_INFO "验证软件包卸载状态" - dnf list installed "$PACKAGE_NAME" &>/dev/null - if [ $? -eq 0 ]; then - LOG_ERROR "软件包 $PACKAGE_NAME 卸载后仍存在于已安装列表中" - exit 1 - else - LOG_INFO "软件包 $PACKAGE_NAME 已成功卸载" - fi - - # 如果脚本开始前软件包已安装,则重新安装以恢复环境 - 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 "环境已清理,软件包 $PACKAGE_NAME 已卸载" - fi - - # 脚本结束 - LOG_INFO "测试脚本执行完毕" -} - -main "$@" \ No newline at end of file diff --git a/testcases/function_test/pkg_test/perl-Alien-Build/perl-Alien-Build-help/test_perl-Alien-Build-help_function_usage.sh b/testcases/function_test/pkg_test/perl-Alien-Build/perl-Alien-Build-help/test_perl-Alien-Build-help_function_usage.sh deleted file mode 100644 index 2205152388e..00000000000 --- a/testcases/function_test/pkg_test/perl-Alien-Build/perl-Alien-Build-help/test_perl-Alien-Build-help_function_usage.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-06 -# @License : Mulan PSL v2 -# @Desc : 测试 perl-Alien-Build-help 软件包是否能显示基本用法或帮助信息 -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - # 测试 perl-Alien-Build-help 软件包是否能显示基本用法或帮助信息 - - LOG_INFO "开始测试 perl-Alien-Build-help 软件包是否能显示基本用法或帮助信息" - - # 定义软件包名称 - PACKAGE_NAME="perl-Alien-Build-help" - - # 步骤1:检查软件包是否已在yum源中 - LOG_INFO "步骤1:检查软件包是否已在yum源中" - dnf list available $PACKAGE_NAME &>/dev/null - if [ $? -ne 0 ]; then - LOG_ERROR "软件包 $PACKAGE_NAME 在yum源中不存在" - exit 255 - fi - LOG_INFO "软件包 $PACKAGE_NAME 在yum源中存在" - - # 步骤2:检查软件包是否已经安装 - LOG_INFO "步骤2:检查软件包是否已经安装" - rpm -q $PACKAGE_NAME &>/dev/null - if [ $? -eq 0 ]; then - LOG_INFO "软件包 $PACKAGE_NAME 已经安装" - ALREADY_INSTALLED=true - else - LOG_INFO "软件包 $PACKAGE_NAME 未安装" - ALREADY_INSTALLED=false - fi - - # 步骤3:如果未安装,则安装软件包 - if [ "$ALREADY_INSTALLED" = "false" ]; then - LOG_INFO "步骤3:安装软件包 $PACKAGE_NAME" - dnf install -y $PACKAGE_NAME - CHECK_RESULT $? 0 0 "安装软件包 $PACKAGE_NAME 失败" - LOG_INFO "软件包 $PACKAGE_NAME 安装成功" - fi - - # 步骤4:检查软件包是否提供了帮助命令 - LOG_INFO "步骤4:检查软件包是否提供了帮助命令" - rpm -ql $PACKAGE_NAME | grep -E "\.pod$|\.pm$|/bin/" | head -5 > /tmp/package_files.txt - if [ ! -s /tmp/package_files.txt ]; then - LOG_ERROR "软件包 $PACKAGE_NAME 未找到帮助文件或可执行文件" - exit 255 - fi - LOG_INFO "软件包 $PACKAGE_NAME 包含以下主要文件:" - cat /tmp/package_files.txt - - # 步骤5:尝试获取帮助信息 - LOG_INFO "步骤5:尝试获取帮助信息" - HELP_FOUND=false - - # 检查是否有可执行文件 - for file in $(rpm -ql $PACKAGE_NAME | grep -E "/bin/"); do - if [ -x "$file" ]; then - LOG_INFO "尝试执行 $file --help" - $file --help 2>&1 | head -20 - if [ ${PIPESTATUS[0]} -eq 0 ]; then - HELP_FOUND=true - break - fi - - LOG_INFO "尝试执行 $file -h" - $file -h 2>&1 | head -20 - if [ ${PIPESTATUS[0]} -eq 0 ]; then - HELP_FOUND=true - break - fi - fi - done - - # 检查是否有POD文档 - if [ "$HELP_FOUND" = "false" ]; then - LOG_INFO "检查POD文档" - for pod_file in $(rpm -ql $PACKAGE_NAME | grep "\.pod$"); do - LOG_INFO "查看POD文档: $pod_file" - pod2text "$pod_file" 2>/dev/null | head -30 - if [ ${PIPESTATUS[0]} -eq 0 ]; then - HELP_FOUND=true - break - fi - done - fi - - # 步骤6:验证帮助信息显示 - LOG_INFO "步骤6:验证帮助信息显示" - if [ "$HELP_FOUND" = "true" ]; then - LOG_INFO "软件包 $PACKAGE_NAME 能够显示基本用法或帮助信息" - CHECK_RESULT 0 0 0 "帮助信息显示验证失败" - else - LOG_ERROR "软件包 $PACKAGE_NAME 未能显示基本用法或帮助信息" - CHECK_RESULT 1 0 0 "帮助信息显示验证失败" - fi - - # 步骤7:清理环境 - LOG_INFO "步骤7:清理环境" - rm -f /tmp/package_files.txt - - # 步骤8:如果测试前未安装,则卸载软件包 - if [ "$ALREADY_INSTALLED" = "false" ]; then - LOG_INFO "步骤8:卸载软件包 $PACKAGE_NAME" - dnf remove -y $PACKAGE_NAME - CHECK_RESULT $? 0 0 "卸载软件包 $PACKAGE_NAME 失败" - LOG_INFO "软件包 $PACKAGE_NAME 卸载成功" - else - LOG_INFO "步骤8:保持软件包 $PACKAGE_NAME 的安装状态" - fi - - LOG_INFO "测试 perl-Alien-Build-help 软件包是否能显示基本用法或帮助信息完成" -} - -main "$@" \ No newline at end of file diff --git a/testcases/function_test/pkg_test/perl-Alien-Build/perl-Alien-Build-help/test_perl-Alien-Build-help_function_version.sh b/testcases/function_test/pkg_test/perl-Alien-Build/perl-Alien-Build-help/test_perl-Alien-Build-help_function_version.sh deleted file mode 100644 index 526adff40e1..00000000000 --- a/testcases/function_test/pkg_test/perl-Alien-Build/perl-Alien-Build-help/test_perl-Alien-Build-help_function_version.sh +++ /dev/null @@ -1,76 +0,0 @@ -#!/usr/bin/bash - -# Copyright (c) 2024 ISCAS .ALL rights reserved. -# This program is licensed under Mulan PSL v2. -# You can use it according to the terms and conditions of the Mulan PSL v2. -# http://license.coscl.org.cn/MulanPSL2 -# THIS PROGRAM IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, -# EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, -# MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. -# See the Mulan PSL v2 for more details. - -# ############################################# -# @Author : honghua -# @Contact : honghua@iscas.ac.cn -# @Date : 2026-03-06 -# @License : Mulan PSL v2 -# @Desc : 测试 perl-Alien-Build-help 软件包是否能正确查询版本信息 -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - LOG_INFO "开始测试 perl-Alien-Build-help 软件包是否能正确查询版本信息" - - # 检查软件包是否已在yum源中 - LOG_INFO "检查yum源中是否存在 perl-Alien-Build-help 软件包" - dnf list available perl-Alien-Build-help > /dev/null 2>&1 - if [ $? -ne 0 ]; then - LOG_ERROR "yum源中未找到 perl-Alien-Build-help 软件包" - exit 255 - fi - - # 判断软件包是否已安装 - LOG_INFO "检查 perl-Alien-Build-help 软件包是否已安装" - rpm -q perl-Alien-Build-help > /dev/null 2>&1 - if [ $? -eq 0 ]; then - LOG_INFO "perl-Alien-Build-help 软件包已安装,测试结束后将保持安装状态" - ALREADY_INSTALLED=1 - else - LOG_INFO "perl-Alien-Build-help 软件包未安装,将在测试过程中安装" - ALREADY_INSTALLED=0 - fi - - # 如果未安装,则安装软件包 - if [ ${ALREADY_INSTALLED} -eq 0 ]; then - LOG_INFO "安装 perl-Alien-Build-help 软件包" - dnf install -y perl-Alien-Build-help - CHECK_RESULT $? 0 0 "安装 perl-Alien-Build-help 软件包失败" - fi - - # 测试查询版本信息 - LOG_INFO "测试 perl-Alien-Build-help 软件包查询版本信息功能" - perl-Alien-Build-help --version > /dev/null 2>&1 - CHECK_RESULT $? 0 0 "perl-Alien-Build-help 软件包查询版本信息失败" - - # 测试不支持的参数 - LOG_INFO "测试 perl-Alien-Build-help 软件包不支持参数的情况" - perl-Alien-Build-help --invalid-param > /dev/null 2>&1 - if [ $? -ne 255 ]; then - LOG_ERROR "perl-Alien-Build-help 软件包对不支持参数的处理不符合预期" - exit 255 - fi - - # 清理环境:如果之前未安装,则卸载软件包 - if [ ${ALREADY_INSTALLED} -eq 0 ]; then - LOG_INFO "卸载在测试过程中安装的 perl-Alien-Build-help 软件包" - dnf remove -y perl-Alien-Build-help - CHECK_RESULT $? 0 0 "卸载 perl-Alien-Build-help 软件包失败" - else - LOG_INFO "perl-Alien-Build-help 软件包在测试前已安装,保持安装状态" - fi - - LOG_INFO "测试完成,环境已恢复" -} - -main "$@" \ No newline at end of file diff --git a/testcases/function_test/pkg_test/rrdtool/rrdtool-devel/test_rrdtool-devel_function_check_files.sh b/testcases/function_test/pkg_test/rrdtool/rrdtool-devel/test_rrdtool-devel_function_check_files.sh deleted file mode 100644 index 1149970b30c..00000000000 --- a/testcases/function_test/pkg_test/rrdtool/rrdtool-devel/test_rrdtool-devel_function_check_files.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-27 -# @License : Mulan PSL v2 -# @Desc : Check existence of key header and lib files -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - LOG_INFO "开始测试:检查关键头文件和库文件的存在性" - LOG_INFO "步骤1:检查rrdtool-devel软件包是否在yum源中" - dnf list available rrdtool-devel 2>&1 | grep -q "rrdtool-devel" - if [ $? -ne 0 ]; then - LOG_ERROR "yum源中未找到rrdtool-devel软件包" - exit 255 - fi - - LOG_INFO "步骤2:检查当前是否已安装rrdtool-devel" - rpm -q rrdtool-devel > /dev/null 2>&1 - if [ $? -eq 0 ]; then - LOG_INFO "rrdtool-devel已安装,测试后保持安装状态" - INSTALLED=1 - else - LOG_INFO "rrdtool-devel未安装,开始安装" - dnf install -y rrdtool-devel - CHECK_RESULT $? 0 0 "安装rrdtool-devel失败" - INSTALLED=0 - fi - - LOG_INFO "步骤3:检查关键头文件是否存在" - HEADER_FILES="/usr/include/rrd.h /usr/include/rrd_client.h" - for file in $HEADER_FILES; do - if [ ! -f "$file" ]; then - LOG_ERROR "头文件 $file 不存在" - if [ $INSTALLED -eq 0 ]; then - LOG_INFO "清理环境:卸载rrdtool-devel" - dnf remove -y rrdtool-devel - fi - exit 255 - else - LOG_INFO "头文件 $file 存在" - fi - done - - LOG_INFO "步骤4:检查关键库文件是否存在" - LIB_FILES="/usr/lib64/librrd.so /usr/lib64/librrd_th.so" - for file in $LIB_FILES; do - if [ ! -f "$file" ]; then - LOG_ERROR "库文件 $file 不存在" - if [ $INSTALLED -eq 0 ]; then - LOG_INFO "清理环境:卸载rrdtool-devel" - dnf remove -y rrdtool-devel - fi - exit 255 - else - LOG_INFO "库文件 $file 存在" - fi - done - - LOG_INFO "步骤5:清理环境" - if [ $INSTALLED -eq 0 ]; then - LOG_INFO "卸载rrdtool-devel" - dnf remove -y rrdtool-devel - CHECK_RESULT $? 0 0 "卸载rrdtool-devel失败" - else - LOG_INFO "保持rrdtool-devel安装状态" - fi - - LOG_INFO "测试完成:所有关键头文件和库文件均存在" -} - -main "$@" \ No newline at end of file diff --git a/testcases/function_test/pkg_test/rrdtool/rrdtool-devel/test_rrdtool-devel_function_compile_test.sh b/testcases/function_test/pkg_test/rrdtool/rrdtool-devel/test_rrdtool-devel_function_compile_test.sh deleted file mode 100644 index a8d29bd456a..00000000000 --- a/testcases/function_test/pkg_test/rrdtool/rrdtool-devel/test_rrdtool-devel_function_compile_test.sh +++ /dev/null @@ -1,89 +0,0 @@ -#!/usr/bin/bash - -# Copyright (c) 2024 ISCAS .ALL rights reserved. -# This program is licensed under Mulan PSL v2. -# You can use it according to the terms and conditions of the Mulan PSL v2. -# http://license.coscl.org.cn/MulanPSL2 -# THIS PROGRAM IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, -# EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, -# MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. -# See the Mulan PSL v2 for more details. - -# ############################################# -# @Author : honghua -# @Contact : honghua@iscas.ac.cn -# @Date : 2026-03-27 -# @License : Mulan PSL v2 -# @Desc : Test compile a simple program with rrdtool libs -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - LOG_INFO "开始测试:使用rrdtool库编译简单程序" - - # 检查rrdtool-devel包是否在yum源中 - LOG_INFO "检查rrdtool-devel包是否在yum源中" - dnf list available rrdtool-devel &>/dev/null - if [ $? -ne 0 ]; then - LOG_ERROR "yum源中未找到rrdtool-devel包" - exit 255 - fi - - # 检查系统是否已安装rrdtool-devel - LOG_INFO "检查系统是否已安装rrdtool-devel" - rpm -q rrdtool-devel &>/dev/null - if [ $? -eq 0 ]; then - LOG_INFO "rrdtool-devel已安装,测试结束后将保持安装状态" - already_installed=1 - else - LOG_INFO "rrdtool-devel未安装,将在测试过程中安装" - already_installed=0 - fi - - # 如果未安装,则安装rrdtool-devel - if [ $already_installed -eq 0 ]; then - LOG_INFO "安装rrdtool-devel包" - dnf install -y rrdtool-devel - CHECK_RESULT $? 0 0 "安装rrdtool-devel失败" - fi - - # 创建测试C程序 - LOG_INFO "创建测试C程序" - cat > test_rrdtool.c << "EOF" - #include - #include - - int main() { - printf("RRDtool version: %s\n", rrd_strversion()); - return 0; - } - EOF - - # 编译测试程序 - LOG_INFO "编译测试程序" - gcc -o test_rrdtool test_rrdtool.c $(pkg-config --cflags --libs rrd) 2>&1 - CHECK_RESULT $? 0 0 "编译测试程序失败" - - # 运行测试程序 - LOG_INFO "运行测试程序" - ./test_rrdtool - CHECK_RESULT $? 0 0 "运行测试程序失败" - - # 清理测试文件 - LOG_INFO "清理测试文件" - rm -f test_rrdtool test_rrdtool.c - - # 如果测试前未安装,则卸载rrdtool-devel - if [ $already_installed -eq 0 ]; then - LOG_INFO "卸载rrdtool-devel包" - dnf remove -y rrdtool-devel - CHECK_RESULT $? 0 0 "卸载rrdtool-devel失败" - else - LOG_INFO "保持rrdtool-devel安装状态" - fi - - LOG_INFO "测试完成:使用rrdtool库编译简单程序" -} - -main "$@" \ No newline at end of file diff --git a/testcases/function_test/pkg_test/rrdtool/rrdtool-devel/test_rrdtool-devel_function_verify_install.sh b/testcases/function_test/pkg_test/rrdtool/rrdtool-devel/test_rrdtool-devel_function_verify_install.sh deleted file mode 100644 index 40eb1ec728f..00000000000 --- a/testcases/function_test/pkg_test/rrdtool/rrdtool-devel/test_rrdtool-devel_function_verify_install.sh +++ /dev/null @@ -1,92 +0,0 @@ -#!/usr/bin/bash - -# Copyright (c) 2024 ISCAS .ALL rights reserved. -# This program is licensed under Mulan PSL v2. -# You can use it according to the terms and conditions of the Mulan PSL v2. -# http://license.coscl.org.cn/MulanPSL2 -# THIS PROGRAM IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, -# EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, -# MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. -# See the Mulan PSL v2 for more details. - -# ############################################# -# @Author : honghua -# @Contact : honghua@iscas.ac.cn -# @Date : 2026-03-27 -# @License : Mulan PSL v2 -# @Desc : Verify rrdtool-devel package is installed -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - # 检查是否已安装rrdtool-devel包 - LOG_INFO "检查rrdtool-devel包是否已安装" - rpm -q rrdtool-devel > /dev/null 2>&1 - if [ $? -eq 0 ]; then - LOG_INFO "rrdtool-devel包已安装,将保持安装状态" - ALREADY_INSTALLED=1 - else - LOG_INFO "rrdtool-devel包未安装" - ALREADY_INSTALLED=0 - fi - - # 检查yum源中是否有rrdtool-devel包 - LOG_INFO "检查yum源中是否有rrdtool-devel包" - dnf list available rrdtool-devel > /dev/null 2>&1 - CHECK_RESULT $? 0 255 "yum源中没有rrdtool-devel包" - - # 如果未安装,则安装rrdtool-devel包 - if [ $ALREADY_INSTALLED -eq 0 ]; then - LOG_INFO "安装rrdtool-devel包" - dnf install -y rrdtool-devel - CHECK_RESULT $? 0 0 "安装rrdtool-devel包失败" - LOG_INFO "rrdtool-devel包安装成功" - fi - - # 验证rrdtool-devel包的功能 - LOG_INFO "验证rrdtool-devel包的功能" - - # 检查rrdtool命令是否存在 - LOG_INFO "检查rrdtool命令是否存在" - which rrdtool > /dev/null 2>&1 - CHECK_RESULT $? 0 0 "rrdtool命令不存在" - - # 检查rrdtool命令是否支持--version参数 - LOG_INFO "检查rrdtool命令是否支持--version参数" - rrdtool --version > /dev/null 2>&1 - CHECK_RESULT $? 0 255 "rrdtool命令不支持--version参数" - - # 获取rrdtool版本信息 - LOG_INFO "获取rrdtool版本信息" - rrdtool --version | grep -q "RRDtool" - CHECK_RESULT $? 0 0 "获取rrdtool版本信息失败" - - # 检查rrdtool-devel头文件是否存在 - LOG_INFO "检查rrdtool-devel头文件是否存在" - ls /usr/include/rrd.h > /dev/null 2>&1 - CHECK_RESULT $? 0 0 "rrd.h头文件不存在" - - # 检查rrdtool库文件是否存在 - LOG_INFO "检查rrdtool库文件是否存在" - ls /usr/lib*/librrd.so > /dev/null 2>&1 - if [ $? -ne 0 ]; then - ls /usr/lib64/librrd.so > /dev/null 2>&1 - CHECK_RESULT $? 0 0 "librrd.so库文件不存在" - fi - - # 清理环境 - LOG_INFO "清理环境" - if [ $ALREADY_INSTALLED -eq 0 ]; then - LOG_INFO "卸载rrdtool-devel包" - dnf remove -y rrdtool-devel - CHECK_RESULT $? 0 0 "卸载rrdtool-devel包失败" - LOG_INFO "rrdtool-devel包卸载成功" - else - LOG_INFO "保持rrdtool-devel包安装状态" - fi - - LOG_INFO "测试完成" -} - -main "$@" \ No newline at end of file diff --git a/testcases/function_test/pkg_test/rubygem-rr/rubygem-rr-doc/test_rubygem-rr-doc_function_load.sh b/testcases/function_test/pkg_test/rubygem-rr/rubygem-rr-doc/test_rubygem-rr-doc_function_load.sh deleted file mode 100644 index 202e22b4535..00000000000 --- a/testcases/function_test/pkg_test/rubygem-rr/rubygem-rr-doc/test_rubygem-rr-doc_function_load.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-02 -# @License : Mulan PSL v2 -# @Desc : 测试软件包 rubygem-rr-doc 的加载功能,验证是否能够成功加载到系统中。 -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - - # 检查yum源中是否存在rubygem-rr-doc软件包 - LOG_INFO "检查yum源中是否存在rubygem-rr-doc软件包" - dnf list available rubygem-rr-doc &> /dev/null - if [ $? -ne 0 ]; then - LOG_ERROR "yum源中不存在rubygem-rr-doc软件包" - exit 255 - fi - - # 检查系统是否已安装rubygem-rr-doc软件包 - LOG_INFO "检查系统是否已安装rubygem-rr-doc软件包" - rpm -q rubygem-rr-doc &> /dev/null - if [ $? -eq 0 ]; then - LOG_INFO "系统已安装rubygem-rr-doc软件包,测试结束后保持安装状态" - installed=true - else - LOG_INFO "系统未安装rubygem-rr-doc软件包,测试结束后将卸载" - installed=false - fi - - # 安装rubygem-rr-doc软件包 - if [ "$installed" = false ]; then - LOG_INFO "安装rubygem-rr-doc软件包" - dnf install -y rubygem-rr-doc - CHECK_RESULT $? 0 0 "安装rubygem-rr-doc软件包失败" - fi - - # 验证rubygem-rr-doc的加载功能 - LOG_INFO "验证rubygem-rr-doc的加载功能" - echo "require "rr"" | ruby &> /dev/null - CHECK_RESULT $? 0 0 "加载rubygem-rr-doc失败" - - # 清理环境,恢复到之前的状态 - if [ "$installed" = false ]; then - LOG_INFO "卸载rubygem-rr-doc软件包" - dnf remove -y rubygem-rr-doc - CHECK_RESULT $? 0 0 "卸载rubygem-rr-doc软件包失败" - fi - - LOG_INFO "测试完成" - -} - -main "$@" \ No newline at end of file diff --git a/testcases/function_test/pkg_test/tensorflow/python3-tensorflow/test_python3-tensorflow_estimator_ckpt_converter_h.sh b/testcases/function_test/pkg_test/tensorflow/python3-tensorflow/test_python3-tensorflow_estimator_ckpt_converter_h.sh deleted file mode 100644 index e3b079715db..00000000000 --- a/testcases/function_test/pkg_test/tensorflow/python3-tensorflow/test_python3-tensorflow_estimator_ckpt_converter_h.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-01 -# @License : Mulan PSL v2 -# @Desc : 测试 estimator_ckpt_converter 命令的 -h 参数,显示帮助信息 -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - - # 检查是否已安装python3-tensorflow-estimator-ckpt-converter - LOG_INFO "检查是否已安装python3-tensorflow-estimator-ckpt-converter" - if dnf list installed python3-tensorflow-estimator-ckpt-converter &>/dev/null; then - LOG_INFO "python3-tensorflow-estimator-ckpt-converter已安装" - INSTALLED=true - else - LOG_INFO "python3-tensorflow-estimator-ckpt-converter未安装" - INSTALLED=false - fi - - # 检查yum源中是否有python3-tensorflow-estimator-ckpt-converter软件包 - LOG_INFO "检查yum源中是否有python3-tensorflow-estimator-ckpt-converter软件包" - if ! dnf list available python3-tensorflow-estimator-ckpt-converter &>/dev/null; then - LOG_ERROR "yum源中未找到python3-tensorflow-estimator-ckpt-converter软件包" - exit 255 - fi - - # 如果未安装,则安装软件包 - if [ "$INSTALLED" = false ]; then - LOG_INFO "开始安装python3-tensorflow-estimator-ckpt-converter" - dnf install -y python3-tensorflow-estimator-ckpt-converter - CHECK_RESULT $? 0 0 "安装python3-tensorflow-estimator-ckpt-converter失败" - fi - - # 测试estimator_ckpt_converter命令的-h参数 - LOG_INFO "测试estimator_ckpt_converter命令的-h参数" - estimator_ckpt_converter -h - CHECK_RESULT $? 0 0 "执行estimator_ckpt_converter -h失败" - - # 如果之前未安装,则卸载软件包 - if [ "$INSTALLED" = false ]; then - LOG_INFO "卸载python3-tensorflow-estimator-ckpt-converter" - dnf remove -y python3-tensorflow-estimator-ckpt-converter - CHECK_RESULT $? 0 0 "卸载python3-tensorflow-estimator-ckpt-converter失败" - fi - - LOG_INFO "测试脚本执行完成" - -} - -main "$@" \ No newline at end of file diff --git a/testcases/function_test/pkg_test/tensorflow/python3-tensorflow/test_python3-tensorflow_estimator_ckpt_converter_v.sh b/testcases/function_test/pkg_test/tensorflow/python3-tensorflow/test_python3-tensorflow_estimator_ckpt_converter_v.sh deleted file mode 100644 index c979e1eb883..00000000000 --- a/testcases/function_test/pkg_test/tensorflow/python3-tensorflow/test_python3-tensorflow_estimator_ckpt_converter_v.sh +++ /dev/null @@ -1,66 +0,0 @@ -#!/usr/bin/bash - -# Copyright (c) 2024 ISCAS .ALL rights reserved. -# This program is licensed under Mulan PSL v2. -# You can use it according to the terms and conditions of the Mulan PSL v2. -# http://license.coscl.org.cn/MulanPSL2 -# THIS PROGRAM IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, -# EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, -# MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. -# See the Mulan PSL v2 for more details. - -# ############################################# -# @Author : honghua -# @Contact : honghua@iscas.ac.cn -# @Date : 2025-12-01 -# @License : Mulan PSL v2 -# @Desc : 测试 estimator_ckpt_converter 命令的 -v 参数,显示版本信息 -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - - # 检查是否已安装python3-tensorflow-estimator-ckpt-converter - LOG_INFO "检查是否已安装python3-tensorflow-estimator-ckpt-converter" - rpm -q python3-tensorflow-estimator-ckpt-converter > /dev/null 2>&1 - if [ $? -eq 0 ]; then - LOG_INFO "python3-tensorflow-estimator-ckpt-converter已安装" - installed=true - else - LOG_INFO "python3-tensorflow-estimator-ckpt-converter未安装" - installed=false - fi - - # 检查yum源中是否有该软件包 - LOG_INFO "检查yum源中是否有python3-tensorflow-estimator-ckpt-converter" - dnf list available python3-tensorflow-estimator-ckpt-converter > /dev/null 2>&1 - if [ $? -ne 0 ]; then - LOG_ERROR "yum源中未找到python3-tensorflow-estimator-ckpt-converter" - exit 255 - fi - - # 如果未安装,则安装软件包 - if [ "$installed" = false ]; then - LOG_INFO "安装python3-tensorflow-estimator-ckpt-converter" - dnf install -y python3-tensorflow-estimator-ckpt-converter > /dev/null 2>&1 - CHECK_RESULT $? 0 0 "安装python3-tensorflow-estimator-ckpt-converter失败" - fi - - # 测试estimator_ckpt_converter命令的-v参数 - LOG_INFO "测试estimator_ckpt_converter命令的-v参数" - estimator_ckpt_converter -v > /dev/null 2>&1 - CHECK_RESULT $? 0 0 "estimator_ckpt_converter命令的-v参数测试失败" - - # 如果脚本开始时未安装,则卸载软件包以恢复环境 - if [ "$installed" = false ]; then - LOG_INFO "卸载python3-tensorflow-estimator-ckpt-converter以恢复环境" - dnf remove -y python3-tensorflow-estimator-ckpt-converter > /dev/null 2>&1 - CHECK_RESULT $? 0 0 "卸载python3-tensorflow-estimator-ckpt-converter失败" - fi - - LOG_INFO "测试脚本执行完成" - -} - -main "$@" \ No newline at end of file diff --git a/testcases/function_test/pkg_test/tensorflow/python3-tensorflow/test_python3-tensorflow_function_keras_model.sh b/testcases/function_test/pkg_test/tensorflow/python3-tensorflow/test_python3-tensorflow_function_keras_model.sh deleted file mode 100644 index a28e8957691..00000000000 --- a/testcases/function_test/pkg_test/tensorflow/python3-tensorflow/test_python3-tensorflow_function_keras_model.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 : 2025-12-01 -# @License : Mulan PSL v2 -# @Desc : Test Keras model loading and saving functionality -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - # 检查是否已安装python3-tensorflow-function-keras - LOG_INFO "检查是否已安装python3-tensorflow-function-keras" - dnf list installed python3-tensorflow-function-keras > /dev/null 2>&1 - if [ $? -eq 0 ]; then - LOG_INFO "python3-tensorflow-function-keras已安装,脚本结束时将保持安装状态" - INSTALLED=true - else - LOG_INFO "python3-tensorflow-function-keras未安装,将在测试后卸载" - INSTALLED=false - fi - - # 检查yum源中是否有python3-tensorflow-function-keras - LOG_INFO "检查yum源中是否有python3-tensorflow-function-keras" - dnf list available python3-tensorflow-function-keras > /dev/null 2>&1 - CHECK_RESULT $? 0 0 "yum源中未找到python3-tensorflow-function-keras" - if [ $? -ne 0 ]; then - LOG_ERROR "yum源中未找到python3-tensorflow-function-keras,退出码255" - exit 255 - fi - - # 若未安装则安装软件包 - if [ "$INSTALLED" = false ]; then - LOG_INFO "开始安装python3-tensorflow-function-keras" - dnf install -y python3-tensorflow-function-keras - CHECK_RESULT $? 0 0 "安装python3-tensorflow-function-keras失败" - fi - - # 测试Keras模型加载和保存功能 - LOG_INFO "测试Keras模型加载和保存功能" - - # 创建临时目录用于测试 - TEMP_DIR=$(mktemp -d) - LOG_INFO "创建临时目录: $TEMP_DIR" - - # 生成测试模型 - LOG_INFO "生成测试模型" - python3 -c " - import tensorflow as tf - from tensorflow import keras - model = keras.Sequential([keras.layers.Dense(units=1, input_shape=[1])]) - model.compile(optimizer="sgd", loss="mean_squared_error") - model.save("$TEMP_DIR/test_model.h5") - " - CHECK_RESULT $? 0 0 "生成测试模型失败" - - # 加载测试模型 - LOG_INFO "加载测试模型" - python3 -c " - import tensorflow as tf - from tensorflow import keras - model = keras.models.load_model("$TEMP_DIR/test_model.h5") - print(model.summary()) - " - CHECK_RESULT $? 0 0 "加载测试模型失败" - - # 清理临时目录 - LOG_INFO "清理临时目录" - rm -rf "$TEMP_DIR" - CHECK_RESULT $? 0 0 "清理临时目录失败" - - # 若脚本开始时未安装则卸载软件包 - if [ "$INSTALLED" = false ]; then - LOG_INFO "卸载python3-tensorflow-function-keras" - dnf remove -y python3-tensorflow-function-keras - CHECK_RESULT $? 00"卸载python32tensorlowfunctionkeras失败" - fi - - LOG_INFO"测试完成" -} - -main "$@" \ No newline at end of file diff --git a/testcases/function_test/pkg_test/tensorflow/python3-tensorflow/test_python3-tensorflow_function_keras_save.sh b/testcases/function_test/pkg_test/tensorflow/python3-tensorflow/test_python3-tensorflow_function_keras_save.sh deleted file mode 100644 index 0c839801256..00000000000 --- a/testcases/function_test/pkg_test/tensorflow/python3-tensorflow/test_python3-tensorflow_function_keras_save.sh +++ /dev/null @@ -1,75 +0,0 @@ -#!/usr/bin/bash - -# Copyright (c) 2024 ISCAS .ALL rights reserved. -# This program is licensed under Mulan PSL v2. -# You can use it according to the terms and conditions of the Mulan PSL v2. -# http://license.coscl.org.cn/MulanPSL2 -# THIS PROGRAM IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, -# EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, -# MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. -# See the Mulan PSL v2 for more details. - -# ############################################# -# @Author : honghua -# @Contact : honghua@iscas.ac.cn -# @Date : 2025-12-13 -# @License : Mulan PSL v2 -# @Desc : Test saving a Keras model to a file -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - - # 检查是否已安装python3-tensorflow-function-keras - LOG_INFO "检查是否已安装python3-tensorflow-function-keras" - if dnf list installed python3-tensorflow-function-keras &>/dev/null; then - LOG_INFO "python3-tensorflow-function-keras已安装,脚本结束时将保持安装状态" - INSTALLED=true - else - LOG_INFO "python3-tensorflow-function-keras未安装,将在测试结束后卸载" - INSTALLED=false - fi - - # 检查yum源中是否有python3-tensorflow-function-keras - LOG_INFO "检查yum源中是否有python3-tensorflow-function-keras" - if ! dnf list available python3-tensorflow-function-keras &>/dev/null; then - LOG_ERROR "yum源中未找到python3-tensorflow-function-keras" - exit 255 - fi - - # 安装python3-tensorflow-function-keras(如果未安装) - if [ "$INSTALLED" = false ]; then - LOG_INFO "正在安装python3-tensorflow-function-keras" - dnf install -y python3-tensorflow-function-keras - CHECK_RESULT $? 0 0 "安装python3-tensorflow-function-keras失败" - fi - - # 测试保存Keras模型到文件的功能 - LOG_INFO "测试保存Keras模型到文件的功能" - python3 -c " - import tensorflow as tf - from tensorflow import keras - model = keras.Sequential([keras.layers.Dense(units=1, input_shape=[1])]) - model.compile(optimizer="sgd", loss="mean_squared_error") - model.save("keras_model.h5") - " - CHECK_RESULT $? 0 0 "保存Keras模型到文件失败" - - # 清理测试生成的文件 - LOG_INFO "清理测试生成的文件" - rm -f keras_model.h5 - CHECK_RESULT $? 0 0 "清理测试文件失败" - - # 卸载python3-tensorflow-function-keras(如果之前未安装) - if [ "$INSTALLED" = false ]; then - LOG_INFO "正在卸载python3-tensorflow-function-keras" - dnf remove -y python3-tensorflow-function-keras - CHECK_RESULT $? 0 0 "卸载python3-tensorflow-function-keras失败" - fi - - LOG_INFO "测试脚本执行完毕,环境已恢复" - -} - -main "$@" \ No newline at end of file diff --git a/testcases/function_test/pkg_test/tensorflow/python3-tensorflow/test_python3-tensorflow_saved_model_cli_helpfull.sh b/testcases/function_test/pkg_test/tensorflow/python3-tensorflow/test_python3-tensorflow_saved_model_cli_helpfull.sh deleted file mode 100644 index e5016a1e786..00000000000 --- a/testcases/function_test/pkg_test/tensorflow/python3-tensorflow/test_python3-tensorflow_saved_model_cli_helpfull.sh +++ /dev/null @@ -1,58 +0,0 @@ -#!/usr/bin/bash - -# Copyright (c) 2024 ISCAS .ALL rights reserved. -# This program is licensed under Mulan PSL v2. -# You can use it according to the terms and conditions of the Mulan PSL v2. -# http://license.coscl.org.cn/MulanPSL2 -# THIS PROGRAM IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, -# EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, -# MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. -# See the Mulan PSL v2 for more details. - -# ############################################# -# @Author : honghua -# @Contact : honghua@iscas.ac.cn -# @Date : 2025-12-01 -# @License : Mulan PSL v2 -# @Desc : 测试 saved_model_cli 的 --helpfull 参数,获取所有支持的标志列表 -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - - # 检查是否已安装python3-tensorflow - LOG_INFO "检查是否已安装python3-tensorflow..." - if ! dnf list installed python3-tensorflow &>/dev/null; then - LOG_INFO "python3-tensorflow未安装,将进行安装..." - # 检查yum源中是否有python3-tensorflow - if ! dnf list available python3-tensorflow &>/dev/null; then - LOG_ERROR "yum源中未找到python3-tensorflow软件包" - exit 255 - fi - # 安装python3-tensorflow - dnf install -y python3-tensorflow - CHECK_RESULT $? 0 0 "安装python3-tensorflow失败" - INSTALLED=true - else - LOG_INFO "python3-tensorflow已安装,跳过安装步骤..." - INSTALLED=false - fi - - # 测试saved_model_cli的--helpfull参数 - LOG_INFO "测试saved_model_cli的--helpfull参数..." - saved_model_cli --helpfull &>/dev/null - CHECK_RESULT $? 0 0 "saved_model_cli --helpfull执行失败" - - # 清理环境:如果脚本开始时未安装,则卸载python3-tensorflow - if [ "$INSTALLED" = true ]; then - LOG_INFO "清理环境,卸载python3-tensorflow..." - dnf remove -y python3-tensorflow - CHECK_RESULT $? 0 0 "卸载python3-tensorflow失败" - fi - - LOG_INFO "测试脚本执行完毕" - -} - -main "$@" \ No newline at end of file diff --git a/testcases/function_test/pkg_test/tensorflow/python3-tensorflow/test_python3-tensorflow_tensorboard_bind_all.sh b/testcases/function_test/pkg_test/tensorflow/python3-tensorflow/test_python3-tensorflow_tensorboard_bind_all.sh deleted file mode 100644 index 6f74ff88db0..00000000000 --- a/testcases/function_test/pkg_test/tensorflow/python3-tensorflow/test_python3-tensorflow_tensorboard_bind_all.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-01 -# @License : Mulan PSL v2 -# @Desc : 测试使用 --bind_all 参数在所有公共接口上提供服务 -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - - # 检查是否已安装python3-tensorflow-tensorboard - LOG_INFO "检查是否已安装python3-tensorflow-tensorboard" - if dnf list installed python3-tensorflow-tensorboard &>/dev/null; then - LOG_INFO "python3-tensorflow-tensorboard已安装,脚本结束时将保持安装状态" - INSTALLED=true - else - LOG_INFO "python3-tensorflow-tensorboard未安装,将在测试结束后卸载" - INSTALLED=false - fi - - # 检查yum源中是否有python3-tensorflow-tensorboard - LOG_INFO "检查yum源中是否有python3-tensorflow-tensorboard" - if ! dnf list available python3-tensorflow-tensorboard &>/dev/null; then - LOG_ERROR "yum源中未找到python3-tensorflow-tensorboard软件包" - exit 255 - fi - - # 安装python3-tensorflow-tensorboard(如果未安装) - if [ "$INSTALLED" = false ]; then - LOG_INFO "开始安装python3-tensorflow-tensorboard" - dnf install -y python3-tensorflow-tensorboard - CHECK_RESULT $? 0 0 "安装python3-tensorflow-tensorboard失败" - fi - - # 测试--bind_all参数在所有公共接口上提供服务 - LOG_INFO "测试--bind_all参数在所有公共接口上提供服务" - tensorbard_cmd="tensorboard --bind_all --logdir=/tmp/logs" - $tensorbard_cmd & - PID=$! - sleep 5 - - # 检查tensorbard是否成功启动并监听端口 - LOG_INFO "检查tensorbard是否成功启动并监听端口" - netstat -tulnp | grep tensorboard - CHECK_RESULT $? 0 0 "tensorboard未成功启动或未监听端口" - - # 清理临时进程和日志目录(如果存在) - LOG_INFO "清理临时进程和日志目录" - kill $PID - rm -rf /tmp/logs - - # 卸载python3-tenso rflow-ten so rboard(如果之前未安装) - if [ "$INSTALLED" = false ]; then - LOG_INFO "卸载python3-tenso rflow-ten so rboard" - dnf remove -y python3-tenso r flow-ten so r board - CHECK_RESULT $? 0 0 "卸载python3-tenso r flow-ten so r board失败" - fi - - LOG_INFO "测试脚本执行完毕" - -} - -main "$@" \ No newline at end of file diff --git a/testcases/function_test/pkg_test/tensorflow/python3-tensorflow/test_python3-tensorflow_tensorboard_host.sh b/testcases/function_test/pkg_test/tensorflow/python3-tensorflow/test_python3-tensorflow_tensorboard_host.sh deleted file mode 100644 index 607851d8bb4..00000000000 --- a/testcases/function_test/pkg_test/tensorflow/python3-tensorflow/test_python3-tensorflow_tensorboard_host.sh +++ /dev/null @@ -1,81 +0,0 @@ -#!/usr/bin/bash - -# Copyright (c) 2024 ISCAS .ALL rights reserved. -# This program is licensed under Mulan PSL v2. -# You can use it according to the terms and conditions of the Mulan PSL v2. -# http://license.coscl.org.cn/MulanPSL2 -# THIS PROGRAM IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, -# EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, -# MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. -# See the Mulan PSL v2 for more details. - -# ############################################# -# @Author : honghua -# @Contact : honghua@iscas.ac.cn -# @Date : 2025-12-01 -# @License : Mulan PSL v2 -# @Desc : 测试使用 --host 参数指定监听地址 -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - LOG_INFO "开始测试使用 --host 参数指定监听地址" - - # 检查是否已安装 python3-tensorflow-tensorboard - LOG_INFO "检查是否已安装 python3-tensorflow-tensorboard" - if dnf list installed python3-tensorflow-tensorboard &>/dev/null; then - LOG_INFO "python3-tensorflow-tensorboard 已安装" - installed=true - else - LOG_INFO "python3-tensorflow-tensorboard 未安装" - installed=false - fi - - # 检查 yum 源中是否有该软件包 - LOG_INFO "检查 yum 源中是否有 python3-tensorflow-tensorboard" - if ! dnf list available python3-tensorflow-tensorboard &>/dev/null; then - LOG_ERROR "yum 源中未找到 python3-tensorflow-tensorboard" - exit 255 - fi - - # 如果未安装,则安装软件包 - if [ "$installed" = false ]; then - LOG_INFO "安装 python3-tensorflow-tensorboard" - dnf install -y python3-tensorflow-tensorboard - CHECK_RESULT $? 0 0 "安装失败" - fi - - # 测试 --host 参数 - LOG_INFO "测试 --host 参数" - tensorboard --host 127.0.0.1 --logdir=/tmp &>/dev/null & - pid=$! - sleep 2 - - # 检查进程是否在运行 - if ps -p $pid &>/dev/null; then - LOG_INFO "--host 参数测试成功" - else - LOG_ERROR "--host 参数测试失败" - kill -9 $pid &>/dev/null - if [ "$installed" = false ]; then - dnf remove -y python3-tensorflow-tensorboard &>/dev/null - CHECK_RESULT $? 0 0 "卸载失败" - fi - exit 1 - fi - - # 清理环境,恢复到之前的状态 - LOG_INFO "清理环境" - kill -9 $pid &>/dev/null - - if [ "$installed" = false ]; then - LOG_INFO "卸载 python3-tensorflow-tensorboard" - dnf remove -y python3-tensorflow-tensorboard - CHECK_RESULT $? 0 0 "卸载失败" - fi - - LOG_INFO "测试完成" -} - -main "$@" \ No newline at end of file diff --git a/testcases/function_test/pkg_test/tensorflow/python3-tensorflow/test_python3-tensorflow_tensorboard_inspect.sh b/testcases/function_test/pkg_test/tensorflow/python3-tensorflow/test_python3-tensorflow_tensorboard_inspect.sh deleted file mode 100644 index b8aad905fea..00000000000 --- a/testcases/function_test/pkg_test/tensorflow/python3-tensorflow/test_python3-tensorflow_tensorboard_inspect.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-01 -# @License : Mulan PSL v2 -# @Desc : 测试使用 --inspect 参数检查事件文件摘要 -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - LOG_INFO "开始测试使用 --inspect 参数检查事件文件摘要" - - # 检查yum源中是否存在python3-tensorflow-tensorboard包 - LOG_INFO "检查yum源中是否存在python3-tensorflow-tensorboard包" - dnf list available python3-tensorflow-tensorboard &>/dev/null - if [ $? -ne 0 ]; then - LOG_ERROR "yum源中不存在python3-tensorflow-tensorboard包" - exit 255 - fi - - # 检查是否已安装python3-tensorflow-tensorboard - LOG_INFO "检查是否已安装python3-tensorflow-tensorboard" - rpm -q python3-tensorflow-tensorboard &>/dev/null - if [ $? -eq 0 ]; then - installed=true - LOG_INFO "python3-tensorflow-tensorboard已安装" - else - installed=false - LOG_INFO "python3-tensorflow-tensorboard未安装,将进行安装" - fi - - # 若未安装,则安装软件包 - if [ "$installed" = false ]; then - LOG_INFO "安装python3-tensorflow-tensorboard" - dnf install -y python3-tensorflow-tensorboard - CHECK_RESULT $? 0 0 "安装python3-tensorflow-tensorboard失败" - fi - - # 测试--inspect参数 - LOG_INFO "测试--inspect参数检查事件文件摘要" - tensorboard --inspect /tmp/eventfile &>/dev/null - CHECK_RESULT $? 0 0 "--inspect参数检查事件文件摘要失败" - - # 若未安装,则卸载软件包以恢复环境 - if [ "$installed" = false ]; then - LOG_INFO "卸载python3-tensorflow-tensorboard以恢复环境" - dnf remove -y python3-tensorflow-tensorboard - CHECK_RESULT $? 0 0 "卸载python3-tensorflow-t -} - -main "$@" \ No newline at end of file diff --git a/testcases/function_test/pkg_test/tensorflow/python3-tensorflow/test_python3-tensorflow_tensorboard_load_fast.sh b/testcases/function_test/pkg_test/tensorflow/python3-tensorflow/test_python3-tensorflow_tensorboard_load_fast.sh deleted file mode 100644 index ddf657f5ed6..00000000000 --- a/testcases/function_test/pkg_test/tensorflow/python3-tensorflow/test_python3-tensorflow_tensorboard_load_fast.sh +++ /dev/null @@ -1,77 +0,0 @@ -#!/usr/bin/bash - -# Copyright (c) 2024 ISCAS .ALL rights reserved. -# This program is licensed under Mulan PSL v2. -# You can use it according to the terms and conditions of the Mulan PSL v2. -# http://license.coscl.org.cn/MulanPSL2 -# THIS PROGRAM IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, -# EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, -# MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. -# See the Mulan PSL v2 for more details. - -# ############################################# -# @Author : honghua -# @Contact : honghua@iscas.ac.cn -# @Date : 2025-12-01 -# @License : Mulan PSL v2 -# @Desc : 测试使用 --load_fast 参数启用快速加载模式 -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - # 检查是否已安装python3-tensorflow-tensorboard - LOG_INFO "检查是否已安装python3-tensorflow-tensorboard" - dnf list installed python3-tensorflow-tensorboard &> /dev/null - if [ $? -eq 0 ]; then - LOG_INFO "python3-tensorflow-tensorboard已安装,脚本结束时将保持安装状态" - installed=true - else - LOG_INFO "python3-tensorflow-tensorboard未安装,将在测试后卸载" - installed=false - fi - - # 检查yum源中是否有python3-tensorflow-tensorboard - LOG_INFO "检查yum源中是否有python3-tensorflow-tensorboard" - dnf list available python3-tensorflow-tensorboard &> /dev/null - if [ $? -ne 0 ]; then - LOG_ERROR "yum源中未找到python3-tensorflow-tensorboard" - exit 255 - fi - - # 安装python3-tensorflow-tensorboard(如果未安装) - if [ "$installed" = false ]; then - LOG_INFO "安装python3-tensorflow-tensorboard" - dnf install -y python3-tensorflow-tensorboard - CHECK_RESULT $? 0 0 "安装python3-tensorflow-tensorboard失败" - fi - - # 测试--load_fast参数是否支持 - LOG_INFO "测试--load_fast参数是否支持" - tensorboard --help | grep -- "--load_fast" &> /dev/null - CHECK_RESULT $? 0 0 "--load_fast参数不支持" - - # 执行带--load_fast参数的tensorboad命令 - LOG_INFO "执行带--load_fast参数的tensorboard命令" - tensorboad --logdir=/tmp --load_fast &> /dev/null & - pid=$! - sleep 2 - - # 检查tensorboad进程是否运行 - ps -p $pid &> /dev/null - CHECK_RESULT $? 0 0 "tensorboad进程未运行" - - # 清理环境 - kill -9 $pid &> /dev/null - - # 如果之前未安装,则卸载python3-tesorflwo_tesorbaord - if [ "$installed" = false ]; then - LOG_INFO “卸载python_tesnorflwo_tesnorbaord” - dnf remove -y python_tesnorflwo_tesnorbaord - CHECK_RESULT $? 0 0 “卸载失败” - fi - - LOG_INFO “测试完成” -} - -main "$@" \ No newline at end of file diff --git a/testcases/function_test/pkg_test/tensorflow/python3-tensorflow/test_python3-tensorflow_tensorboard_logdir.sh b/testcases/function_test/pkg_test/tensorflow/python3-tensorflow/test_python3-tensorflow_tensorboard_logdir.sh deleted file mode 100644 index 2839f816435..00000000000 --- a/testcases/function_test/pkg_test/tensorflow/python3-tensorflow/test_python3-tensorflow_tensorboard_logdir.sh +++ /dev/null @@ -1,87 +0,0 @@ -#!/usr/bin/bash - -# Copyright (c) 2024 ISCAS .ALL rights reserved. -# This program is licensed under Mulan PSL v2. -# You can use it according to the terms and conditions of the Mulan PSL v2. -# http://license.coscl.org.cn/MulanPSL2 -# THIS PROGRAM IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, -# EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, -# MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. -# See the Mulan PSL v2 for more details. - -# ############################################# -# @Author : honghua -# @Contact : honghua@iscas.ac.cn -# @Date : 2025-12-01 -# @License : Mulan PSL v2 -# @Desc : 测试使用 --logdir 参数指定日志目录 -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - - # 检查是否已安装python3-tensorflow-tensorboard - LOG_INFO "检查是否已安装python3-tensorflow-tensorboard" - if dnf list installed python3-tensorflow-tensorboard &>/dev/null; then - LOG_INFO "python3-tensorflow-tensorboard已安装" - INSTALLED=true - else - LOG_INFO "python3-tensorflow-tensorboard未安装" - INSTALLED=false - fi - - # 检查yum源中是否有该软件包 - LOG_INFO "检查yum源中是否有python3-tensorflow-tensorboard" - if ! dnf list available python3-tensorflow-tensorboard &>/dev/null; then - LOG_ERROR "yum源中未找到python3-tensorflow-tensorboard" - exit 255 - fi - - # 若未安装则安装软件包 - if [ "$INSTALLED" = false ]; then - LOG_INFO "开始安装python3-tensorflow-tensorboard" - dnf install -y python3-tensorflow-tensorboard || { - LOG_ERROR "安装python3-tensorflow-tensorboard失败" - exit 1 - } - fi - - # 测试--logdir参数指定日志目录功能 - LOG_INFO "测试--logdir参数指定日志目录功能" - TEST_DIR="/tmp/tb_logdir_test" - mkdir -p "$TEST_DIR" || { - LOG_ERROR "创建测试目录失败: $TEST_DIR" - exit 1 - } - - tensorboard --logdir="$TEST_DIR" --port=6006 &>/dev/null & - TB_PID=$! - sleep 2 - - # 检查tensorboard是否成功启动 - if ! ps -p $TB_PID &>/dev/null; then - LOG_ERROR "tensorboard启动失败" - rm -rf "$TEST_DIR" - exit 1 - fi - - # 清理测试环境 - kill $TB_PID - rm -rf "$TEST_DIR" - - # 若脚本开始时未安装则卸载软件包以恢复环境 - if [ "$INSTALLED" = false ]; then - LOG_INFO "卸载python3-tensorflow-tensorboard以恢复环境" - dnf remove -y python3-tensorflow-tensoboard || { - LOG_ERROR "卸载python3-tensorflow-tensoboard失败" - exit 1 - } - fi - - LOG_INFO "测试完成,环境已恢复" - exit 0 - -} - -main "$@" \ No newline at end of file diff --git a/testcases/function_test/pkg_test/tensorflow/python3-tensorflow/test_python3-tensorflow_tensorboard_path_prefix.sh b/testcases/function_test/pkg_test/tensorflow/python3-tensorflow/test_python3-tensorflow_tensorboard_path_prefix.sh deleted file mode 100644 index 6346a7d1e9b..00000000000 --- a/testcases/function_test/pkg_test/tensorflow/python3-tensorflow/test_python3-tensorflow_tensorboard_path_prefix.sh +++ /dev/null @@ -1,77 +0,0 @@ -#!/usr/bin/bash - -# Copyright (c) 2024 ISCAS .ALL rights reserved. -# This program is licensed under Mulan PSL v2. -# You can use it according to the terms and conditions of the Mulan PSL v2. -# http://license.coscl.org.cn/MulanPSL2 -# THIS PROGRAM IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, -# EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, -# MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. -# See the Mulan PSL v2 for more details. - -# ############################################# -# @Author : honghua -# @Contact : honghua@iscas.ac.cn -# @Date : 2025-12-13 -# @License : Mulan PSL v2 -# @Desc : 测试使用--path_prefix参数设置路径前缀 -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - - LOG_INFO "开始测试:测试使用--path_prefix参数设置路径前缀" - - # 检查是否已安装python3-tensorflow-tensorboard - if dnf list installed python3-tensorflow-tensorboard &>/dev/null; then - LOG_INFO "检测到python3-tensorflow-tensorboard已安装,脚本结束后将保持安装状态" - INSTALLED=true - else - LOG_INFO "未检测到python3-tensorflow-tensorboard安装,将在测试结束后卸载" - INSTALLED=false - fi - - # 检查yum源中是否有python3-tensorflow-tensorboard软件包 - LOG_INFO "检查yum源中是否存在python3-tensorflow-tensorboard软件包" - if ! dnf list available python3-tensorflow-tensorboard &>/dev/null; then - LOG_ERROR "yum源中未找到python3-tensorflow-tensorboard软件包" - exit 255 - fi - - # 安装python3-tensorflow-tensorboard - if [ "$INSTALLED" = false ]; then - LOG_INFO "安装python3-tensorflow-tensorboard" - dnf install -y python3-tensorflow-tensorboard - CHECK_RESULT $? 0 0 "安装python3-tensorflow-tensorboard失败" - fi - - # 检查--path_prefix参数是否支持 - LOG_INFO "检查tensorboard是否支持--path_prefix参数" - tensorbard --help | grep -q -- --path_prefix - CHECK_RESULT $? 0 255 "tensorboard不支持--path_prefix参数" - - # 测试--path_prefix参数功能 - LOG_INFO "测试--path_prefix参数功能" - tensorbard --logdir=/tmp --port=6006 --path_prefix=/test &>/dev/null & - PID=$! - sleep 2 - - # 检查服务是否启动成功 - ps -p $PID &>/dev/null - CHECK_RESULT $? 0 0 "tensorboard服务启动失败" - - # 清理测试环境 - kill -9 $PID &>/dev/null - - if [ "$INSTALLED" = false ]; then - LOG_INFO "卸载python3-tensorflow-tensoboard" - dnf remove -y python3-rensorflow-tensoboadl - CHECK_RESULT $? 0 0 "卸载python-rensoflow-tensoboarl失败" - fi - - LOG_INFO "测试完成" - -} - -main "$@" \ No newline at end of file diff --git a/testcases/function_test/pkg_test/tensorflow/python3-tensorflow/test_python3-tensorflow_tensorboard_port.sh b/testcases/function_test/pkg_test/tensorflow/python3-tensorflow/test_python3-tensorflow_tensorboard_port.sh deleted file mode 100644 index 6ba9acbcbd5..00000000000 --- a/testcases/function_test/pkg_test/tensorflow/python3-tensorflow/test_python3-tensorflow_tensorboard_port.sh +++ /dev/null @@ -1,82 +0,0 @@ -#!/usr/bin/bash - -# Copyright (c) 2024 ISCAS .ALL rights reserved. -# This program is licensed under Mulan PSL v2. -# You can use it according to the terms and conditions of the Mulan PSL v2. -# http://license.coscl.org.cn/MulanPSL2 -# THIS PROGRAM IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, -# EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, -# MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. -# See the Mulan PSL v2 for more details. - -# ############################################# -# @Author : honghua -# @Contact : honghua@iscas.ac.cn -# @Date : 2025-12-01 -# @License : Mulan PSL v2 -# @Desc : 测试使用 --port 参数指定服务端口 -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - - LOG_INFO "开始测试使用 --port 参数指定服务端口" - - # 检查是否已安装python3-tensorflow-tensorboard - LOG_INFO "检查是否已安装python3-tensorflow-tensorboard" - dnf list installed python3-tensorflow-tensorboard > /dev/null 2>&1 - if [ $? -eq 0 ]; then - LOG_INFO "python3-tensorflow-tensorboard 已安装,脚本结束时将保持安装状态" - INSTALLED=1 - else - LOG_INFO "python3-tensorflow-tensorboard 未安装,将在测试结束后卸载" - INSTALLED=0 - fi - - # 检查yum源中是否有该软件包 - LOG_INFO "检查yum源中是否有python3-tensorflow-tensorboard" - dnf list available python3-tensorflow-tensorboard > /dev/null 2>&1 - if [ $? -ne 0 ]; then - LOG_ERROR "yum源中未找到python3-tensorflow-tensorboard软件包" - exit 255 - fi - - # 安装软件包 - if [ $INSTALLED -eq 0 ]; then - LOG_INFO "安装python3-tensorflow-tensorboard" - dnf install -y python3-tensorflow-tensorboard - CHECK_RESULT $? 0 0 "安装python3-tensorflow-tensorboard失败" - fi - - # 测试--port参数是否支持 - LOG_INFO "测试--port参数是否支持" - tensorboard --help | grep -- "--port" > /dev/null 2>&1 - CHECK_RESULT $? 0 255 "--port参数不支持" - - # 启动tensorboard服务并指定端口为6006 - LOG_INFO "启动tensorboard服务并指定端口为6006" - tensorbord_pid=$(tensorboard --port 6006 --logdir /tmp &> /dev/null & echo $!) - CHECK_RESULT $? 0 0 "启动tensorboard服务失败" - - # 检查端口是否监听成功 - LOG_INFO "检查6006端口是否监听成功" - sleep 5 # 等待服务启动 - netstat -tuln | grep ":6006" > /dev/null 2>&1 - CHECK_RESULT $? 0 0 "6006端口未监听" - - # 停止tensorbord服务 - LOG_INFO "停止tensorboard服务" - kill -9 $tensorbord_pid - - # 清理环境(如果最初未安装) - if [ $INSTALLED -eq 0 ]; then - LOG_INFO "卸载python3-tesorflow-tesorboarad软件包" - dnf remove -y python3-tesorflow-tesorboarad - fi - - LOG_INFO "测试完成,环境已恢复" - -} - -main "$@" \ No newline at end of file diff --git a/testcases/function_test/pkg_test/tensorflow/python3-tensorflow/test_python3-tensorflow_tensorboard_reuse_port.sh b/testcases/function_test/pkg_test/tensorflow/python3-tensorflow/test_python3-tensorflow_tensorboard_reuse_port.sh deleted file mode 100644 index 896ac583b87..00000000000 --- a/testcases/function_test/pkg_test/tensorflow/python3-tensorflow/test_python3-tensorflow_tensorboard_reuse_port.sh +++ /dev/null @@ -1,88 +0,0 @@ -#!/usr/bin/bash - -# Copyright (c) 2024 ISCAS .ALL rights reserved. -# This program is licensed under Mulan PSL v2. -# You can use it according to the terms and conditions of the Mulan PSL v2. -# http://license.coscl.org.cn/MulanPSL2 -# THIS PROGRAM IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, -# EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, -# MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. -# See the Mulan PSL v2 for more details. - -# ############################################# -# @Author : honghua -# @Contact : honghua@iscas.ac.cn -# @Date : 2025-12-01 -# @License : Mulan PSL v2 -# @Desc : 测试使用 --reuse_port 参数启用端口重用 -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - LOG_INFO "开始测试 --reuse_port 参数启用端口重用功能" - - # 检查是否已安装 python3-tensorflow-tensorboard - LOG_INFO "检查是否已安装 python3-tensorflow-tensorboard" - if dnf list installed python3-tensorflow-tensorboard &>/dev/null; then - LOG_INFO "python3-tensorflow-tensorboard 已安装" - installed=true - else - LOG_INFO "python3-tensorflow-tensorboard 未安装" - installed=false - fi - - # 检查 yum 源中是否有 python3-tensorflow-tensorboard - LOG_INFO "检查 yum 源中是否有 python3-tensorflow-tensorboard" - if ! dnf list available python3-tensorflow-tensorboard &>/dev/null; then - LOG_ERROR "yum 源中未找到 python3-tensorflow-tensorboard,退出测试" - exit 255 - fi - - # 如果未安装,则安装软件包 - if [ "$installed" = false ]; then - LOG_INFO "开始安装 python3-tensorflow-tensorboard" - dnf install -y python3-tensorflow-tensorboard || { - LOG_ERROR "安装 python3-tensorflow-tensorboard 失败" - exit 255 - } - fi - - # 检查 --reuse_port 参数是否支持 - LOG_INFO "检查 tensorboard --help 是否包含 --reuse_port 参数" - if ! tensorboard --help | grep -q -- "--reuse_port"; then - LOG_ERROR "tensorboard 不支持 --reuse_port 参数,退出测试" - exit 255 - fi - - # 启动 tensorboard 并启用端口重用 - LOG_INFO "启动 tensorboard,启用 --reuse_port" - tensorboard --logdir=/tmp --port=6006 --reuse_port & - pid=$! - sleep 2 - - # 检查 tensorboard 是否成功启动 - CHECK_RESULT $? 0 0 "tensorboard 启动失败" - - # 检查端口是否被监听 - LOG_INFO "检查端口 6006 是否被监听" - netstat -tuln | grep -q ":6006 " - CHECK_RESULT $? 0 0 "端口 6006未被监听" - - # 停止 tensorboard - kill $pid - wait $pid 2>/dev/null - - #如果之前未安装,则卸载软件包 - if [ "$installed" = false ]; then - LOG_INFO "卸载 python3-rensorflow-rensorboard" - dnf remove -y python3-rensorflow-rensorboarrd || { - LOG_ERROR"卸载 python-rensorflow-rensorboard失败" - exit 1 - } - fi - - LOG_INF0“测试完成” -} - -main "$@" \ No newline at end of file diff --git a/testcases/function_test/pkg_test/tensorflow/python3-tensorflow/test_python3-tensorflow_tensorboard_version_tb.sh b/testcases/function_test/pkg_test/tensorflow/python3-tensorflow/test_python3-tensorflow_tensorboard_version_tb.sh deleted file mode 100644 index b3422d6ca3e..00000000000 --- a/testcases/function_test/pkg_test/tensorflow/python3-tensorflow/test_python3-tensorflow_tensorboard_version_tb.sh +++ /dev/null @@ -1,59 +0,0 @@ -#!/usr/bin/bash - -# Copyright (c) 2024 ISCAS .ALL rights reserved. -# This program is licensed under Mulan PSL v2. -# You can use it according to the terms and conditions of the Mulan PSL v2. -# http://license.coscl.org.cn/MulanPSL2 -# THIS PROGRAM IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, -# EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, -# MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. -# See the Mulan PSL v2 for more details. - -# ############################################# -# @Author : honghua -# @Contact : honghua@iscas.ac.cn -# @Date : 2025-12-01 -# @License : Mulan PSL v2 -# @Desc : 测试使用 --version_tb 参数打印 TensorBoard 版本 -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - - # 检查是否已安装python3-tensorflow-tensorboard - LOG_INFO "检查是否已安装python3-tensorflow-tensorboard" - if dnf list installed python3-tensorflow-tensorboard &>/dev/null; then - LOG_INFO "python3-tensorflow-tensorboard已安装,脚本结束后将保持安装状态" - installed=true - else - LOG_INFO "python3-tensorflow-tensorboard未安装,将在测试后卸载" - installed=false - fi - - # 检查yum源中是否有python3-tensorflow-tensorboard - LOG_INFO "检查yum源中是否有python3-tensorflow-tensorboard" - if ! dnf list available python3-tensorflow-tensorboard &>/dev/null; then - LOG_ERROR "yum源中未找到python3-tensorflow-tensorboard" - exit 255 - fi - - # 安装python3-tensorflow-tensorboard(如果未安装) - if [ "$installed" = false ]; then - LOG_INFO "安装python3-tensorflow-tensorboard" - dnf install -y python3-tensorflow-tensorboard - CHECK_RESULT $? 0 0 "安装python3-tensorflow-tensorboard失败" - fi - - # 测试--version_tb参数打印TensorBoard版本 - LOG_INFO "测试--version_tb参数打印TensorBoard版本" - tensorboard --version_tb - CHECK_RESULT $? 0 0 "执行tensorboard --version_tb失败" - - # 清理环境(如果脚本开始时未安装) - if [ "$installed" = false ]; then - LOG_INFO "卸载python3-tensorflow-tensorboard" - dnf remove -y python3-tensorflow-t -} - -main "$@" \ No newline at end of file diff --git a/testcases/function_test/pkg_test/tensorflow/python3-tensorflow/test_python3-tensorflow_tensorboard_window_title.sh b/testcases/function_test/pkg_test/tensorflow/python3-tensorflow/test_python3-tensorflow_tensorboard_window_title.sh deleted file mode 100644 index 66f52f4d95a..00000000000 --- a/testcases/function_test/pkg_test/tensorflow/python3-tensorflow/test_python3-tensorflow_tensorboard_window_title.sh +++ /dev/null @@ -1,90 +0,0 @@ -#!/usr/bin/bash - -# Copyright (c) 2024 ISCAS .ALL rights reserved. -# This program is licensed under Mulan PSL v2. -# You can use it according to the terms and conditions of the Mulan PSL v2. -# http://license.coscl.org.cn/MulanPSL2 -# THIS PROGRAM IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, -# EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, -# MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. -# See the Mulan PSL v2 for more details. - -# ############################################# -# @Author : honghua -# @Contact : honghua@iscas.ac.cn -# @Date : 2025-12-13 -# @License : Mulan PSL v2 -# @Desc : 测试使用--window_title参数更改浏览器窗口标题 -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - LOG_INFO "开始测试:测试使用--window_title参数更改浏览器窗口标题" - - # 检查是否已安装python3-tensorflow-tensorboard - LOG_INFO "检查是否已安装python3-tensorflow-tensorboard" - if dnf list installed python3-tensorflow-tensorboard &>/dev/null; then - LOG_INFO "python3-tensorflow-tensorboard已安装,测试结束后保持安装状态" - INSTALLED=true - else - LOG_INFO "python3-tensorflow-tensorboard未安装,将在测试结束后卸载" - INSTALLED=false - fi - - # 检查yum源中是否有python3-tensorflow-tensorboard - LOG_INFO "检查yum源中是否有python3-tensorflow-tensorboard" - if ! dnf list available python3-tensorflow-tensorboard &>/dev/null; then - LOG_ERROR "yum源中没有找到python3-tensorflow-tensorboard软件包" - exit 255 - fi - - # 如果未安装,则安装软件包 - if [ "$INSTALLED" = false ]; then - LOG_INFO "开始安装python3-tensorflow-tensorboard" - dnf install -y python3-tensorflow-tensorboard || { - LOG_ERROR "安装python3-tensorflow-tensorboard失败" - exit 1 - } - fi - - # 检查--window_title参数是否支持 - LOG_INFO "检查tensorboard是否支持--window_title参数" - tensorbard --help | grep -- --window_title &>/dev/null || { - LOG_ERROR "--window_title参数不支持" - exit 255 - } - - # 启动tensorboard并指定窗口标题 - LOG_INFO "启动tensorboard并指定窗口标题为"TestTitle"" - tensorboard --logdir=/tmp --window_title="TestTitle" &>/dev/null & - TB_PID=$! - - # 检查tensorbard进程是否启动成功 - CHECK_RESULT $? 0 0 "启动tensorbard失败" - - # 获取窗口标题并验证 - LOG_INFO "验证浏览器窗口标题是否为"TestTitle"" - WINDOW_TITLE=$(curl -s http://localhost:6006 | grep -oP "\K.*?(?=)") - CHECK_RESULT "$?" 0 0 "获取窗口标题失败" - - [ "$WINDOW_TITLE" = "TestTitle" ] || { - LOG_ERROR "窗口标题不符合预期,实际为:$WINDOW_TITLE" - exit 1 - } - - # 清理环境 - kill $TB_PID &>/dev/null - - if [ "$INSTALLED" = false ]; then - LOG_INFO "卸载python3-tensortlow-tensortboard" - dnf remove -y python3-tenstorlow-tensortoard || { - LOG_ERROR "卸载python3-tensortlow-tensortoard失败" - exit 1 - } - fi - - LOG_INFO "测试完成:成功验证--window_title参数功能" -} - -main "$@" \ No newline at end of file diff --git a/testcases/function_test/pkg_test/tensorflow/python3-tensorflow/test_python3-tensorflow_tf_upgrade_v2_inplace.sh b/testcases/function_test/pkg_test/tensorflow/python3-tensorflow/test_python3-tensorflow_tf_upgrade_v2_inplace.sh deleted file mode 100644 index a22f5e018ab..00000000000 --- a/testcases/function_test/pkg_test/tensorflow/python3-tensorflow/test_python3-tensorflow_tf_upgrade_v2_inplace.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-01 -# @License : Mulan PSL v2 -# @Desc : 测试是否允许直接在输入文件上进行转换 -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - - # 检查是否已安装python3-tensorflow_tf_upgrade_v2_inplace - LOG_INFO "检查是否已安装python3-tensorflow_tf_upgrade_v2_inplace" - if dnf list installed python3-tensorflow_tf_upgrade_v2_inplace &>/dev/null; then - LOG_INFO "python3-tensorflow_tf_upgrade_v2_inplace已安装,脚本结束时将保持安装状态" - INSTALLED=true - else - LOG_INFO "python3-tensorflow_tf_upgrade_v2_inplace未安装,将在测试结束后卸载" - INSTALLED=false - fi - - # 检查yum源中是否有python3-tensorflow_tf_upgrade_v2_inplace软件包 - LOG_INFO "检查yum源中是否有python3-tensorflow_tf_upgrade_v2_inplace软件包" - if ! dnf list available python3-tensorflow_tf_upgrade_v2_inplace &>/dev/null; then - LOG_ERROR "yum源中未找到python3-tensorflow_tf_upgrade_v2_inplace软件包" - exit 255 - fi - - # 如果未安装,则安装软件包 - if [ "$INSTALLED" = false ]; then - LOG_INFO "开始安装python3-tensorflow_tf_upgrade_v2_inplace" - dnf install -y python3-tensorflow_tf_upgrade_v2_inplace - CHECK_RESULT $? 0 0 "安装python3-tensorflow_tf_upgrade_v2_inplace失败" - fi - - # 测试是否允许直接在输入文件上进行转换 - LOG_INFO "测试是否允许直接在输入文件上进行转换" - if ! tf_upgrade_v2 --inplace --intree /path/to/input/file &>/dev/null; then - LOG_ERROR "参数--inplace或--intree不支持或不存在" - exit 255 - fi - CHECK_RESULT $? 0 0 "直接在输入文件上进行转换失败" - - # 清理环境 - if [ "$INSTALLED" = false ]; then - LOG_INFO "卸载python3-tensorflow_tf_upgrade_v2_inplace" - dnf remove -y python3-tensorflow_tf_upgrade_v2_inplace - CHECK_RESULT $? 0 0 "卸载python3-tensorflow_tf_upgrade_v2_inplace失败" - fi - - LOG_INFO "测试脚本执行完毕,环境已恢复" - -} - -main "$@" \ No newline at end of file diff --git a/testcases/function_test/pkg_test/tensorflow/python3-tensorflow/test_python3-tensorflow_tf_upgrade_v2_mode_default.sh b/testcases/function_test/pkg_test/tensorflow/python3-tensorflow/test_python3-tensorflow_tf_upgrade_v2_mode_default.sh deleted file mode 100644 index d867263ef75..00000000000 --- a/testcases/function_test/pkg_test/tensorflow/python3-tensorflow/test_python3-tensorflow_tf_upgrade_v2_mode_default.sh +++ /dev/null @@ -1,62 +0,0 @@ -#!/usr/bin/bash - -# Copyright (c) 2024 ISCAS .ALL rights reserved. -# This program is licensed under Mulan PSL v2. -# You can use it according to the terms and conditions of the Mulan PSL v2. -# http://license.coscl.org.cn/MulanPSL2 -# THIS PROGRAM IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, -# EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, -# MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. -# See the Mulan PSL v2 for more details. - -# ############################################# -# @Author : honghua -# @Contact : honghua@iscas.ac.cn -# @Date : 2025-12-01 -# @License : Mulan PSL v2 -# @Desc : 测试升级脚本的默认模式 -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - # 检查是否已安装python3-tensorflow_tf_upgrade_v2_mode_default - LOG_INFO "检查是否已安装python3-tensorflow_tf_upgrade_v2_mode_default" - if dnf list installed python3-tensorflow_tf_upgrade_v2_mode_default &>/dev/null; then - LOG_INFO "python3-tensorflow_tf_upgrade_v2_mode_default已安装" - installed=true - else - LOG_INFO "python3-tensorflow_tf_upgrade_v2_mode_default未安装" - installed=false - fi - - # 检查yum源中是否有该软件包 - LOG_INFO "检查yum源中是否有python3-tensorflow_tf_upgrade_v2_mode_default" - if ! dnf list available python3-tensorflow_tf_upgrade_v2_mode_default &>/dev/null; then - LOG_ERROR "yum源中未找到python3-tensorflow_tf_upgrade_v2_mode_default" - exit 255 - fi - - # 如果未安装,则安装软件包 - if [ "$installed" = false ]; then - LOG_INFO "安装python3-tensorflow_tf_upgrade_v2_mode_default" - dnf install -y python3-tensorflow_tf_upgrade_v2_mode_default - CHECK_RESULT $? 0 0 "安装python3-tensorflow_tf_upgrade_v2_mode_default失败" - fi - - # 测试升级脚本的默认模式 - LOG_INFO "测试升级脚本的默认模式" - tf_upgrade_v2 --mode default - CHECK_RESULT $? 0 0 "升级脚本的默认模式执行失败" - - # 如果脚本开始时未安装,则在结束时卸载软件包 - if [ "$installed" = false ]; then - LOG_INFO "卸载python3-tensorflow_tf_upgrade_v2_mode_default" - dnf remove -y python3-tensorflow_tf_upgrade_v2_mode_default - CHECK_RESULT $? 0 0 "卸载python3-tensorflow_tf_upgrade_v2_mode_default失败" - fi - - LOG_INFO "测试脚本执行完成" -} - -main "$@" \ No newline at end of file diff --git a/testcases/function_test/pkg_test/tensorflow/python3-tensorflow/test_python3-tensorflow_tf_upgrade_v2_mode_safety.sh b/testcases/function_test/pkg_test/tensorflow/python3-tensorflow/test_python3-tensorflow_tf_upgrade_v2_mode_safety.sh deleted file mode 100644 index 25bb27a917c..00000000000 --- a/testcases/function_test/pkg_test/tensorflow/python3-tensorflow/test_python3-tensorflow_tf_upgrade_v2_mode_safety.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-01 -# @License : Mulan PSL v2 -# @Desc : 测试升级脚本的安全模式 -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - - # 检查是否已安装python3-tensorflow-tf-upgrade-v2-mode-safety - LOG_INFO "检查是否已安装python3-tensorflow-tf-upgrade-v2-mode-safety" - if dnf list installed python3-tensorflow-tf-upgrade-v2-mode-safety &> /dev/null; then - LOG_INFO "python3-tensorflow-tf-upgrade-v2-mode-safety已安装" - installed=true - else - LOG_INFO "python3-tensorflow-tf-upgrade-v2-mode-safety未安装" - installed=false - fi - - # 检查yum源中是否有该软件包 - LOG_INFO "检查yum源中是否有python3-tensorflow-tf-upgrade-v2-mode-safety" - if ! dnf list available python3-tensorflow-tf-upgrade-v2-mode-safety &> /dev/null; then - LOG_ERROR "yum源中未找到python3-tensorflow-tf-upgrade-v2-mode-safety" - exit 255 - fi - - # 如果未安装,则安装软件包 - if [ "$installed" = false ]; then - LOG_INFO "开始安装python3-tensorflow-tf-upgrade-v2-mode-safety" - dnf install -y python3-tensorflow-tf-upgrade-v2-mode-safety - CHECK_RESULT $? 0 0 "安装python3-tensorflow-tf-upgrade-v2-mode-safety失败" - fi - - # 测试升级脚本的安全模式 - LOG_INFO "测试升级脚本的安全模式" - tf_upgrade_v2 --safety_mode - CHECK_RESULT $? 0 0 "升级脚本的安全模式测试失败" - - # 如果之前未安装,则卸载软件包 - if [ "$installed" = false ]; then - LOG_INFO "卸载python3-tensorflow-tf-upgrade-v2-mode-safety" - dnf remove -y python3-tensorflow-tf-upgrade-v2-mode-safety - CHECK_RESULT $? 0 0 "卸载python3-tensorflow-tf-upgrade-v2-mode-safety失败" - fi - - LOG_INFO "测试完成,环境已恢复" - -} - -main "$@" \ No newline at end of file diff --git a/testcases/function_test/pkg_test/tensorflow/python3-tensorflow/test_python3-tensorflow_tf_upgrade_v2_print_all.sh b/testcases/function_test/pkg_test/tensorflow/python3-tensorflow/test_python3-tensorflow_tf_upgrade_v2_print_all.sh deleted file mode 100644 index 50a56a34082..00000000000 --- a/testcases/function_test/pkg_test/tensorflow/python3-tensorflow/test_python3-tensorflow_tf_upgrade_v2_print_all.sh +++ /dev/null @@ -1,74 +0,0 @@ -#!/usr/bin/bash - -# Copyright (c) 2024 ISCAS .ALL rights reserved. -# This program is licensed under Mulan PSL v2. -# You can use it according to the terms and conditions of the Mulan PSL v2. -# http://license.coscl.org.cn/MulanPSL2 -# THIS PROGRAM IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, -# EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, -# MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. -# See the Mulan PSL v2 for more details. - -# ############################################# -# @Author : honghua -# @Contact : honghua@iscas.ac.cn -# @Date : 2025-12-01 -# @License : Mulan PSL v2 -# @Desc : 测试是否打印完整日志到标准输出 -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - - # 检查是否已安装python3-tensorflow软件包 - LOG_INFO "检查是否已安装python3-tensorflow软件包" - dnf list installed python3-tensorflow &>/dev/null - if [ $? -eq 0 ]; then - LOG_INFO "python3-tensorflow已安装,脚本结束时将保持安装状态" - INSTALLED=true - else - LOG_INFO "python3-tensorflow未安装,将在测试后卸载" - INSTALLED=false - fi - - # 检查yum源中是否有python3-tensorflow软件包 - LOG_INFO "检查yum源中是否有python3-tensorflow软件包" - dnf list available python3-tensorflow &>/dev/null - if [ $? -ne 0 ]; then - LOG_ERROR "yum源中未找到python3-tensorflow软件包" - exit 255 - fi - - # 如果未安装,则安装python3-tensorflow - if ! $INSTALLED; then - LOG_INFO "安装python3-tensorflow软件包" - dnf install -y python3-tensorflow - CHECK_RESULT $? 0 0 "安装python3-tensorflow失败" - fi - - # 执行tf_upgrade_v2命令并检查是否打印完整日志到标准输出 - LOG_INFO "执行tf_upgrade_v2命令并检查日志输出" - tf_upgrade_v2 --print_all &> output.log - CHECK_RESULT $? 0 0 "执行tf_upgrade_v2命令失败" - - # 检查日志文件是否包含预期内容 - LOG_INFO "检查日志文件内容" - grep "完整日志" output.log - CHECK_RESULT $? 0 0 "未找到完整日志输出" - - # 清理环境 - if ! $INSTALLED; then - LOG_INFO "卸载python3-tensorflow软件包" - dnf remove -y python3-tensorflow - CHECK_RESULT $? 0 0 "卸载python3-tensorflow失败" - fi - - # 删除临时文件 - rm -f output.log - - LOG_INFO "测试完成,环境已恢复" - -} - -main "$@" \ No newline at end of file diff --git a/testcases/function_test/pkg_test/tensorflow/python3-tensorflow/test_python3-tensorflow_tf_upgrade_v2_reportfile.sh b/testcases/function_test/pkg_test/tensorflow/python3-tensorflow/test_python3-tensorflow_tf_upgrade_v2_reportfile.sh deleted file mode 100644 index bcfebdd69ef..00000000000 --- a/testcases/function_test/pkg_test/tensorflow/python3-tensorflow/test_python3-tensorflow_tf_upgrade_v2_reportfile.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-01 -# @License : Mulan PSL v2 -# @Desc : 测试报告日志文件的存储名称 -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - - # 检查yum源中是否存在python3-tensorflow-tf-upgrade-v2-reportfile包 - LOG_INFO "检查yum源中是否存在python3-tensorflow-tf-upgrade-v2-reportfile包" - dnf list available python3-tensorflow-tf-upgrade-v2-reportfile > /dev/null 2>&1 - CHECK_RESULT $? 0 255 "yum源中不存在python3-tensorflow-tf-upgrade-v2-reportfile包" - - # 检查是否已安装python3-tensorflow-tf-upgrade-v2-reportfile包 - LOG_INFO "检查是否已安装python3-tensorflow-tf-upgrade-v2-reportfile包" - if rpm -q python3-tensorflow-tf-upgrade-v2-reportfile > /dev/null 2>&1; then - LOG_INFO "python3-tensorflow-tf-upgrade-v2-reportfile包已安装" - installed=true - else - LOG_INFO "python3-tensorflow-tf-upgrade-v2-reportfile包未安装" - installed=false - fi - - # 如果未安装,则安装软件包 - if [ "$installed" = false ]; then - LOG_INFO "安装python3-tensorflow-tf-upgrade-v2-reportfile包" - dnf install -y python3-tensorflow-tf-upgrade-v2-reportfile > /dev/null 2>&1 - CHECK_RESULT $? 0 255 "安装python3-tensorflow-tf-upgrade-v2-reportfile包失败" - fi - - # 测试报告日志文件的存储名称 - LOG_INFO "测试报告日志文件的存储名称" - tf_upgrade_v2 --reportfile test_report.log > /dev/null 2>&1 - CHECK_RESULT $? 0 255 "执行tf_upgrade_v2命令失败" - - # 检查报告文件是否存在 - LOG_INFO "检查报告文件test_report.log是否存在" - if [ -f "test_report.log" ]; then - LOG_INFO "报告文件test_report.log存在" - else - LOG_ERROR "报告文件test_report.log不存在" - exit 255 - fi - - # 清理环境:如果之前未安装,则卸载软件包 - if [ "$installed" = false ]; then - LOG_INFO "卸载python3-tensorflow-tf-upgrade-v2-reportfile包" - dnf remove -y python3-tensorflow-f-upgrade-v2-reportfile > /dev/null 2>&1 - CHECK_RESULT $? 0 255 "卸载python3-fupgradetensorlowv eportfile失败" - fi - - LOG_INFO "测试脚本执行完毕,环境已恢复" - -} - -main "$@" \ No newline at end of file diff --git a/testcases/function_test/pkg_test/tensorflow/python3-tensorflow/test_python3-tensorflow_tflite_convert_output_file.sh b/testcases/function_test/pkg_test/tensorflow/python3-tensorflow/test_python3-tensorflow_tflite_convert_output_file.sh deleted file mode 100644 index 70110f94931..00000000000 --- a/testcases/function_test/pkg_test/tensorflow/python3-tensorflow/test_python3-tensorflow_tflite_convert_output_file.sh +++ /dev/null @@ -1,85 +0,0 @@ -#!/usr/bin/bash - -# Copyright (c) 2024 ISCAS .ALL rights reserved. -# This program is licensed under Mulan PSL v2. -# You can use it according to the terms and conditions of the Mulan PSL v2. -# http://license.coscl.org.cn/MulanPSL2 -# THIS PROGRAM IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, -# EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, -# MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. -# See the Mulan PSL v2 for more details. - -# ############################################# -# @Author : honghua -# @Contact : honghua@iscas.ac.cn -# @Date : 2025-12-01 -# @License : Mulan PSL v2 -# @Desc : 测试 tflite_convert 命令的 --output_file 参数 -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - - # 检查是否已安装python3-tensorflow - LOG_INFO "检查是否已安装python3-tensorflow" - rpm -q python3-tensorflow > /dev/null 2>&1 - if [ $? -eq 0 ]; then - LOG_INFO "python3-tensorflow已安装,脚本结束后将保持安装状态" - installed=true - else - LOG_INFO "python3-tensorflow未安装,将在测试结束后卸载" - installed=false - fi - - # 检查yum源中是否有python3-tensorflow包 - LOG_INFO "检查yum源中是否有python3-tensorflow包" - dnf list available python3-tensorflow > /dev/null 2>&1 - if [ $? -ne 0 ]; then - LOG_ERROR "yum源中未找到python3-tensorflow包" - exit 255 - fi - - # 安装python3-tensorflow - if [ "$installed" = false ]; then - LOG_INFO "安装python3-tensorflow" - dnf install -y python3-tensorflow - CHECK_RESULT $? 0 0 "安装python3-tensorflow失败" - fi - - # 检查tflite_convert命令是否存在 - LOG_INFO "检查tflite_convert命令是否存在" - which tflite_convert > /dev/null 2>&1 - CHECK_RESULT $? 0 0 "tflite_convert命令不存在" - - # 测试--output_file参数 - LOG_INFO "测试tflite_convert命令的--output_file参数" - - # 创建一个临时模型文件用于测试(假设为test_model.h5) - echo "dummy model content" > test_model.h5 - - # 执行tflite_convert命令并指定--output_file参数 - tflite_convert --keras_model_file=test_model.h5 --output_file=output.tflite - CHECK_RESULT $? 0 0 "tflite_convert命令执行失败" - - # 检查输出文件是否存在 - LOG_INFO "检查输出文件output.tflite是否存在" - [ -f output.tflite ] - CHECK_RESULT $? 0 0 "输出文件未生成" - - # 清理临时文件 - LOG_INFO "清理临时文件" - rm -f test_model.h5 output.tflite - - # 如果脚本开始时未安装python3-tensorflow,则卸载 - if [ "$installed" = false ]; then - LOG_INFO "卸载python3-tensorflow" - dnf remove -y python3-tensorflow - CHECK_RESULT $? 0 0 "卸载python3-tensorflow失败" - fi - - LOG_INFO "测试脚本执行完毕,环境已恢复" - -} - -main "$@" \ No newline at end of file diff --git a/testcases/function_test/pkg_test/tensorflow/python3-tensorflow/test_python3-tensorflow_toco_enable_v1_converter.sh b/testcases/function_test/pkg_test/tensorflow/python3-tensorflow/test_python3-tensorflow_toco_enable_v1_converter.sh deleted file mode 100644 index 0b50a68eb9f..00000000000 --- a/testcases/function_test/pkg_test/tensorflow/python3-tensorflow/test_python3-tensorflow_toco_enable_v1_converter.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-01 -# @License : Mulan PSL v2 -# @Desc : 测试 toco 命令的 --enable_v1_converter 参数 -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - LOG_INFO "开始测试 toco 命令的 --enable_v1_converter 参数" - - # 检查环境是否已安装 python3-tensorflow-toco - LOG_INFO "检查 python3-tensorflow-toco 是否已安装" - if dnf list installed python3-tensorflow-toco &>/dev/null; then - LOG_INFO "python3-tensorflow-toco 已安装,测试完成后将保持安装状态" - INSTALLED=true - else - LOG_INFO "python3-tensorflow-toco 未安装,将在测试完成后卸载" - INSTALLED=false - fi - - # 检查 yum 源中是否有 python3-tensorflow-toco - LOG_INFO "检查 yum 源中是否存在 python3-tensorflow-toco" - if ! dnf list available python3-tensorflow-toco &>/dev/null; then - LOG_ERROR "yum 源中未找到 python3-tensorflow-toco" - exit 255 - fi - - # 如果未安装,则安装 python3-tensorflow-toco - if [ "$INSTALLED" = false ]; then - LOG_INFO "安装 python3-tensorflow-toco" - dnf install -y python3-tensorflow-toco - CHECK_RESULT $? 0 0 "安装 python3-tensorflow-toco 失败" - fi - - # 测试 toco 命令的 --enable_v1_converter 参数 - LOG_INFO "测试 toco 命令的 --enable_v1_converter 参数" - toco --enable_v1_converter - CHECK_RESULT $? 0 0 "--enable_v1_converter 参数不支持或执行失败" - - # 清理环境:如果测试前未安装,则卸载软件包 - if [ "$INSTALLED" = false ]; then - LOG_INFO "卸载 python3-tensorflow-toco" - dnf remove -y python3-tensorflow-toco - CHECK_RESULT $? 0 0 "卸载 python3-tensorflow-toco 失败" - fi - - LOG_INFO "测试完成" -} - -main "$@" \ No newline at end of file diff --git a/testcases/function_test/pkg_test/tensorflow/python3-tensorflow/test_python3-tensorflow_toco_from_protos_basic.sh b/testcases/function_test/pkg_test/tensorflow/python3-tensorflow/test_python3-tensorflow_toco_from_protos_basic.sh deleted file mode 100644 index 9206279b985..00000000000 --- a/testcases/function_test/pkg_test/tensorflow/python3-tensorflow/test_python3-tensorflow_toco_from_protos_basic.sh +++ /dev/null @@ -1,64 +0,0 @@ -#!/usr/bin/bash - -# Copyright (c) 2024 ISCAS .ALL rights reserved. -# This program is licensed under Mulan PSL v2. -# You can use it according to the terms and conditions of the Mulan PSL v2. -# http://license.coscl.org.cn/MulanPSL2 -# THIS PROGRAM IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, -# EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, -# MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. -# See the Mulan PSL v2 for more details. - -# ############################################# -# @Author : honghua -# @Contact : honghua@iscas.ac.cn -# @Date : 2025-12-13 -# @License : Mulan PSL v2 -# @Desc : 测试 toco_from_protos 基本功能,包含必需的四个参数 -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - - # 检查是否已安装python3-tensorflow-toco - LOG_INFO "检查是否已安装python3-tensorflow-toco" - if dnf list installed python3-tensorflow-toco &>/dev/null; then - LOG_INFO "python3-tensorflow-toco已安装,脚本结束后将保持安装状态" - INSTALLED=true - else - LOG_INFO "python3-tensorflow-toco未安装,将在测试后卸载" - INSTALLED=false - fi - - # 检查yum源中是否有python3-tensorflow-toco软件包 - LOG_INFO "检查yum源中是否有python3-tensorflow-toco软件包" - if ! dnf list available python3-tensorflow-toco &>/dev/null; then - LOG_ERROR "yum源中未找到python3-tensorflow-toco软件包" - exit 255 - fi - - # 若未安装则安装软件包 - if [ "$INSTALLED" = false ]; then - LOG_INFO "开始安装python3-tensorflow-toco" - dnf install -y python3-tensorflow-toco - CHECK_RESULT $? 0 0 "安装python3-tensorflow-toco失败" - fi - - # 测试toco_from_protos基本功能 - LOG_INFO "测试toco_from_protos基本功能" - toco_from_protos --input_file=test.pb --output_file=test.tflite --input_format=TENSORFLOW_GRAPHDEF --output_format=TFLITE - CHECK_RESULT $? 0 0 "toco_from_protos执行失败" - - # 清理环境:若脚本开始时未安装则卸载软件包 - if [ "$INSTALLED" = false ]; then - LOG_INFO "卸载python3-tensorflow-toco" - dnf remove -y python3-tensorflow-toco - CHECK_RESULT $? 0 0 "卸载python3-tensorflow-toco失败" - fi - - LOG_INFO "测试脚本执行完成" - -} - -main "$@" \ No newline at end of file diff --git a/testcases/function_test/pkg_test/tensorflow/python3-tensorflow/test_python3-tensorflow_toco_keras_model_file.sh b/testcases/function_test/pkg_test/tensorflow/python3-tensorflow/test_python3-tensorflow_toco_keras_model_file.sh deleted file mode 100644 index 384cef0aed0..00000000000 --- a/testcases/function_test/pkg_test/tensorflow/python3-tensorflow/test_python3-tensorflow_toco_keras_model_file.sh +++ /dev/null @@ -1,68 +0,0 @@ -#!/usr/bin/bash - -# Copyright (c) 2024 ISCAS .ALL rights reserved. -# This program is licensed under Mulan PSL v2. -# You can use it according to the terms and conditions of the Mulan PSL v2. -# http://license.coscl.org.cn/MulanPSL2 -# THIS PROGRAM IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, -# EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, -# MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. -# See the Mulan PSL v2 for more details. - -# ############################################# -# @Author : honghua -# @Contact : honghua@iscas.ac.cn -# @Date : 2025-12-01 -# @License : Mulan PSL v2 -# @Desc : 测试 toco 命令的 --keras_model_file 参数 -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - - # 检查是否已安装python3-tensorflow-toco - LOG_INFO "检查是否已安装python3-tensorflow-toco" - if dnf list installed python3-tensorflow-toco &>/dev/null; then - LOG_INFO "python3-tensorflow-toco已安装,脚本结束后将保持安装状态" - INSTALLED=true - else - LOG_INFO "python3-tensorflow-toco未安装,将在测试后卸载" - INSTALLED=false - fi - - # 检查yum源中是否有python3-tensorflow-toco - LOG_INFO "检查yum源中是否有python3-tensorflow-toco" - if ! dnf list available python3-tensorflow-toco &>/dev/null; then - LOG_ERROR "yum源中未找到python3-tensorflow-toco软件包" - exit 255 - fi - - # 如果未安装,则安装软件包 - if [ "$INSTALLED" = false ]; then - LOG_INFO "开始安装python3-tensorflow-toco" - dnf install -y python3-tensorflow-toco || { - LOG_ERROR "安装python3-tensorflow-toco失败" - exit 1 - } - fi - - # 测试toco命令的--keras_model_file参数 - LOG_INFO "测试toco命令的--keras_model_file参数" - toco --keras_model_file test_model.h5 &>/dev/null - CHECK_RESULT $? 0 0 "--keras_model_file参数不支持或命令执行失败" - - # 清理环境 - if [ "$INSTALLED" = false ]; then - LOG_INFO "卸载python3-tensorflow-toco" - dnf remove -y python3-tensorflow-toco || { - LOG_ERROR "卸载python3-tensorflow-toco失败" - exit 1 - } - fi - - LOG_INFO "测试脚本执行完成" - -} - -main "$@" \ No newline at end of file diff --git a/testcases/function_test/pkg_test/tensorflow/python3-tensorflow/test_python3-tensorflow_toco_output_file.sh b/testcases/function_test/pkg_test/tensorflow/python3-tensorflow/test_python3-tensorflow_toco_output_file.sh deleted file mode 100644 index bcedcc1bf4e..00000000000 --- a/testcases/function_test/pkg_test/tensorflow/python3-tensorflow/test_python3-tensorflow_toco_output_file.sh +++ /dev/null @@ -1,85 +0,0 @@ -#!/usr/bin/bash - -# Copyright (c) 2024 ISCAS .ALL rights reserved. -# This program is licensed under Mulan PSL v2. -# You can use it according to the terms and conditions of the Mulan PSL v2. -# http://license.coscl.org.cn/MulanPSL2 -# THIS PROGRAM IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, -# EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, -# MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. -# See the Mulan PSL v2 for more details. - -# ############################################# -# @Author : honghua -# @Contact : honghua@iscas.ac.cn -# @Date : 2025-12-01 -# @License : Mulan PSL v2 -# @Desc : 测试 toco 命令的 --output_file 参数 -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - - # 检查环境是否已安装python3-tensorflow-toco - LOG_INFO "检查是否已安装python3-tensorflow-toco" - if dnf list installed python3-tensorflow-toco &>/dev/null; then - LOG_INFO "python3-tensorflow-toco已安装,脚本结束后将保持安装状态" - INSTALLED=true - else - LOG_INFO "python3-tensorflow-toco未安装,将在测试后卸载" - INSTALLED=false - fi - - # 检查yum源中是否有python3-tensorflow-toco包 - LOG_INFO "检查yum源中是否有python3-tensorflow-toco包" - if ! dnf list available python3-tensorflow-toco &>/dev/null; then - LOG_ERROR "yum源中未找到python3-tensorflow-toco包" - exit 255 - fi - - # 安装python3-tensorflow-toco包(如果未安装) - if [ "$INSTALLED" = false ]; then - LOG_INFO "正在安装python3-tensorflow-toco包" - dnf install -y python3-tensorflow-toco - CHECK_RESULT $? 0 0 "安装python3-tensorflow-toco失败" - fi - - # 测试toco命令的--output_file参数功能 - LOG_INFO "测试toco命令的--output_file参数功能" - - # 创建临时测试文件 - TEMP_INPUT_FILE=$(mktemp) - TEMP_OUTPUT_FILE=$(mktemp) - echo "dummy data for test" > "$TEMP_INPUT_FILE" - - # 执行toco命令 - LOG_INFO "执行toco命令并指定--output_file参数" - toco --input_file="$TEMP_INPUT_FILE" --output_file="$TEMP_OUTPUT_FILE" &>/dev/null - CHECK_RESULT $? 0 0 "toco命令执行失败" - - # 验证输出文件是否存在 - LOG_INFO "验证输出文件是否生成" - if [ -f "$TEMP_OUTPUT_FILE" ]; then - LOG_INFO "输出文件成功生成" - else - LOG_ERROR "输出文件未生成" - exit 1 - fi - - # 清理临时文件 - LOG_INFO "清理临时文件" - rm -f "$TEMP_INPUT_FILE" "$TEMP_OUTPUT_FILE" - - # 卸载python3-tensorflow-toco包(如果之前未安装) - if [ "$INSTALLED" = false ]; then - LOG_INFO "正在卸载python3-tensorflow-toco包" - dnf remove -y python3-tensorflow-toco - CHECK_RESULT $? 0 0 "卸载python3- tensorflow- toco失败" - fi - - LOG_INFO "测试脚本执行完毕,环境已恢复" - -} - -main "$@" \ No newline at end of file diff --git a/testcases/function_test/pkg_test/tensorflow/python3-tensorflow/test_python3-tensorflow_toco_saved_model_dir.sh b/testcases/function_test/pkg_test/tensorflow/python3-tensorflow/test_python3-tensorflow_toco_saved_model_dir.sh deleted file mode 100644 index da85d84246b..00000000000 --- a/testcases/function_test/pkg_test/tensorflow/python3-tensorflow/test_python3-tensorflow_toco_saved_model_dir.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-01 -# @License : Mulan PSL v2 -# @Desc : 测试 toco 命令的 --saved_model_dir 参数 -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - LOG_INFO "开始测试 toco 命令的 --saved_model_dir 参数" - - # 检查是否已安装 python3-tensorflow-toco - LOG_INFO "检查是否已安装 python3-tensorflow-toco" - if dnf list installed python3-tensorflow-toco &>/dev/null; then - LOG_INFO "python3-tensorflow-toco 已安装" - INSTALLED=true - else - LOG_INFO "python3-tensorflow-toco 未安装" - INSTALLED=false - fi - - # 检查 yum 源中是否有 python3-tensorflow-toco - LOG_INFO "检查 yum 源中是否有 python3-tensorflow-toco" - if ! dnf list available python3-tensorflow-toco &>/dev/null; then - LOG_ERROR "yum 源中未找到 python3-tensorflow-toco" - exit 255 - fi - - # 如果未安装,则安装 python3-tensorflow-toco - if [ "$INSTALLED" = false ]; then - LOG_INFO "安装 python3-tensorflow-toco" - dnf install -y python3-tensorflow-toco - CHECK_RESULT $? 0 0 "安装 python3-tensorflow-toco 失败" - fi - - # 测试 toco 命令的 --saved_model_dir 参数 - LOG_INFO "测试 toco --saved_model_dir 参数" - toco --saved_model_dir=/tmp/test_saved_model &>/dev/null - CHECK_RESULT $? 0 255 "toco --saved_model_dir 参数不支持或无效" - - # 清理环境 - if [ "$INSTALLED" = false ]; then - LOG_INFO "卸载 python3-tensorflow-toco" - dnf remove -y python3-tensorflow-toco - CHECK_RESULT $? 0 0 "卸载 python3-tensorflow-toco失败" - fi - - LOG_INFO "测试完成" -} - -main "$@" \ No newline at end of file diff --git a/testcases/function_test/pkg_test/tensorflow/python3-tensorflow/test_python3-tensorflow_toco_saved_model_tag_set.sh b/testcases/function_test/pkg_test/tensorflow/python3-tensorflow/test_python3-tensorflow_toco_saved_model_tag_set.sh deleted file mode 100644 index 3c32e5ce45e..00000000000 --- a/testcases/function_test/pkg_test/tensorflow/python3-tensorflow/test_python3-tensorflow_toco_saved_model_tag_set.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-01 -# @License : Mulan PSL v2 -# @Desc : 测试 toco 命令的 --saved_model_tag_set 参数 -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - - LOG_INFO "开始测试 toco 命令的 --saved_model_tag_set 参数" - - # 检查是否已安装 python3-tensorflow-toco - LOG_INFO "检查是否已安装 python3-tensorflow-toco" - dnf list installed python3-tensorflow-toco > /dev/null 2>&1 - if [ $? -eq 0 ]; then - LOG_INFO "python3-tensorflow-toco 已安装,脚本结束后将保持安装状态" - INSTALLED=true - else - LOG_INFO "python3-tensorflow-toco 未安装,将在测试完成后卸载" - INSTALLED=false - fi - - # 检查 yum 源中是否有 python3-tensorflow-toco - LOG_INFO "检查 yum 源中是否有 python3-tensorflow-toco" - dnf list available python3-tensorflow-toco > /dev/null 2>&1 - if [ $? -ne 0 ]; then - LOG_ERROR "yum 源中未找到 python3-tensorflow-toco" - exit 255 - fi - - # 安装 python3-tensorflow-toco - if [ "$INSTALLED" = false ]; then - LOG_INFO "正在安装 python3-tensorflow-toco" - dnf install -y python3-tensorflow-toco > /dev/null 2>&1 - CHECK_RESULT $? 0 0 "安装 python3-tensorflow-toco 失败" - fi - - # 测试 toco 命令的 --saved_model_tag_set 参数 - LOG_INFO "测试 toco 命令的 --saved_model_tag_set 参数" - toco --help | grep -- "--saved_model_tag_set" > /dev/null 2>&1 - if [ $? -ne 0 ]; then - LOG_ERROR "toco 命令不支持 --saved_model_tag_set 参数" - exit 255 - fi - - # TODO: 替换为实际的测试命令和预期结果检查逻辑示例: - LOG_INFO "执行 toco --saved_model_tag_set=serve ...(示例)" - toco --saved_model_tag_set=serve > /dev/null 2>&1 - CHECK_RESULT $? 0 0 "toco --saved_model_tag_set=serve 执行失败" - - # TODO: 根据实际需求补充其他测试步骤 - - #清理环境 - if [ "$INSTALLED" = false ]; then - LOG_INFO "正在卸载 python3-tensorflow-toco" - dnf remove -y python3-tensorflow-toco > /dev/null 2>&1 - CHECK_RESULT $? 0 0 “卸载 python3-tensorflow—to co失败” - fi - - LOG _INFO “测试完成” - -} - -main "$@" \ No newline at end of file diff --git a/testcases/function_test/pkg_test/texlive-split-d/texlive-borceux-doc/test_texlive-borceux-doc_function_install.sh b/testcases/function_test/pkg_test/texlive-split-d/texlive-borceux-doc/test_texlive-borceux-doc_function_install.sh deleted file mode 100644 index 40bc3758a80..00000000000 --- a/testcases/function_test/pkg_test/texlive-split-d/texlive-borceux-doc/test_texlive-borceux-doc_function_install.sh +++ /dev/null @@ -1,59 +0,0 @@ -#!/usr/bin/bash - -# Copyright (c) 2024 ISCAS .ALL rights reserved. -# This program is licensed under Mulan PSL v2. -# You can use it according to the terms and conditions of the Mulan PSL v2. -# http://license.coscl.org.cn/MulanPSL2 -# THIS PROGRAM IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, -# EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, -# MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. -# See the Mulan PSL v2 for more details. - -# ############################################# -# @Author : honghua -# @Contact : honghua@iscas.ac.cn -# @Date : 2025-09-17 -# @License : Mulan PSL v2 -# @Desc : Test package installation -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - # 检查是否已安装texlive-borceux-doc软件包 - LOG_INFO "检查是否已安装texlive-borceux-doc软件包" - rpm -q texlive-borceux-doc > /dev/null 2>&1 - if [ $? -eq 0 ]; then - LOG_INFO "texlive-borceux-doc已安装,脚本结束时将保持安装状态" - INSTALLED=true - else - LOG_INFO "texlive-borceux-doc未安装,脚本结束时将卸载" - INSTALLED=false - fi - - # 检查yum源中是否存在texlive-borceux-doc软件包 - LOG_INFO "检查yum源中是否存在texlive-borceux-doc软件包" - dnf list available texlive-borceux-doc > /dev/null 2>&1 - CHECK_RESULT $? 0 255 "yum源中不存在texlive-borceux-doc软件包" - - # 安装texlive-borceux-doc软件包 - LOG_INFO "安装texlive-borceux-doc软件包" - dnf install -y texlive-borceux-doc - CHECK_RESULT $? 0 0 "安装texlive-borceux-doc失败" - - # 验证安装是否成功 - LOG_INFO "验证texlive-borceux-doc是否安装成功" - rpm -q texlive-borceux-doc > /dev/null 2>&1 - CHECK_RESULT $? 0 0 "验证texlive-borceux-doc安装失败" - - # 测试完成后清理环境 - if [ "$INSTALLED" = false ]; then - LOG_INFO "卸载texlive-borceux-doc软件包" - dnf remove -y texlive-borceux-doc - CHECK_RESULT $? 0 0 "卸载texlive-borceux-doc失败" - fi - - LOG_INFO "测试完成,环境已恢复" -} - -main "$@" \ No newline at end of file diff --git a/testcases/function_test/pkg_test/texlive-split-d/texlive-cellprops/test_texlive-cellprops_function_basic.sh b/testcases/function_test/pkg_test/texlive-split-d/texlive-cellprops/test_texlive-cellprops_function_basic.sh deleted file mode 100644 index 4c1c2b9ca9a..00000000000 --- a/testcases/function_test/pkg_test/texlive-split-d/texlive-cellprops/test_texlive-cellprops_function_basic.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-11-26 -# @License : Mulan PSL v2 -# @Desc : Test basic functionality of texlive-cellprops -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - - # 检查texlive-cellprops是否已安装 - LOG_INFO "检查texlive-cellprops是否已安装" - dnf list installed texlive-cellprops > /dev/null 2>&1 - if [ $? -eq 0 ]; then - LOG_INFO "texlive-cellprops已安装,脚本结束后保持安装状态" - INSTALLED=1 - else - LOG_INFO "texlive-cellprops未安装,将在测试后卸载" - INSTALLED=0 - fi - - # 检查yum源中是否有texlive-cellprops软件包 - LOG_INFO "检查yum源中是否有texlive-cellprops软件包" - dnf list available texlive-cellprops > /dev/null 2>&1 - if [ $? -ne 0 ]; then - LOG_ERROR "yum源中未找到texlive-cellprops软件包" - exit 255 - fi - - # 安装texlive-cellprops软件包(如果未安装) - if [ $INSTALLED -eq 0 ]; then - LOG_INFO "开始安装texlive-cellprops软件包" - dnf install -y texlive-cellprops > /dev/null 2>&1 - CHECK_RESULT $? 0 0 "安装texlive-cellprops失败" - fi - - # 测试基本功能 - LOG_INFO "测试texlive-cellprops基本功能" - command_to_test="some_texlive_cellprops_command --basic-option" # 替换为实际命令和参数 - $command_to_test > /dev/null 2>&1 - CHECK_RESULT $? 0 0 "执行基本功能测试失败" - - # 检查不支持参数的情况 - LOG_INFO "检查不支持参数的情况" - command_to_test="some_texlive_cellprops_command --invalid-option" # 替换为实际命令和无效参数 - $command_to_test > /dev/null 2>&1 - if [ $? -ne 255 ]; then - LOG_ERROR "不支持参数时未返回正确退出码" - exit 255 - fi - - # 清理环境(如果之前未安装) - if [ $INSTALLED -eq 0 ]; then - LOG_INFO "卸载texlive-cellprops软件包" - dnf remove -y texlive-cellprops > /dev/null 2>&1 - CHECK_RESULT $? 0 0 "卸载texlive-cellprops失败" - fi - - LOG_INFO "测试脚本执行完毕,环境已恢复" - -} - -main "$@" \ No newline at end of file diff --git a/testcases/function_test/pkg_test/texlive-split-g/texlive-doctools/test_texlive-doctools_function_basic_usage.sh b/testcases/function_test/pkg_test/texlive-split-g/texlive-doctools/test_texlive-doctools_function_basic_usage.sh deleted file mode 100644 index cfa52d3c2d0..00000000000 --- a/testcases/function_test/pkg_test/texlive-split-g/texlive-doctools/test_texlive-doctools_function_basic_usage.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-04-06 -# @License : Mulan PSL v2 -# @Desc : Test basic command execution -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - LOG_INFO "开始测试:Test basic command execution" - - # 检查是否已安装texlive-doctools - LOG_INFO "步骤1:检查texlive-doctools是否已安装" - if dnf list installed texlive-doctools &>/dev/null; then - LOG_INFO "texlive-doctools已安装,测试后将保持安装状态" - already_installed=1 - else - LOG_INFO "texlive-doctools未安装,将进行安装测试" - already_installed=0 - fi - - # 检查yum源中是否有texlive-doctools软件包 - LOG_INFO "步骤2:检查yum源中是否存在texlive-doctools软件包" - if ! dnf list available texlive-doctools &>/dev/null; then - LOG_ERROR "yum源中未找到texlive-doctools软件包" - exit 255 - fi - - # 如果未安装,则安装软件包 - if [ $already_installed -eq 0 ]; then - LOG_INFO "步骤3:安装texlive-doctools软件包" - dnf install -y texlive-doctools - CHECK_RESULT $? 0 0 "安装texlive-doctools失败" - fi - - # 测试基本命令执行 - LOG_INFO "步骤4:测试texlive-doctools基本命令执行" - # 这里以假设texlive-doctools包含一个名为"texdoctools"的命令为例 - # 实际命令可能不同,需要根据实际情况调整 - command_to_test="texdoctools" - if ! command -v $command_to_test &>/dev/null; then - LOG_ERROR "命令 $command_to_test 不存在" - # 清理环境 - if [ $already_installed -eq 0 ]; then - LOG_INFO "清理环境:卸载texlive-doctools" - dnf remove -y texlive-doctools - fi - exit 255 - fi - - # 测试命令的基本用法,这里以"--help"参数为例 - LOG_INFO "步骤5:测试命令 $command_to_test --help" - $command_to_test --help - CHECK_RESULT $? 0 0 "命令 $command_to_test --help 执行失败" - - # 测试不支持的参数 - LOG_INFO "步骤6:测试不支持的参数(例如:--nonexistent)" - $command_to_test --nonexistent 2>/dev/null - if [ $? -ne 255 ] && [ $? -ne 1 ]; then - LOG_ERROR "命令 $command_to_test 不支持参数 --nonexistent 但未正确退出" - # 清理环境 - if [ $already_installed -eq 0 ]; then - LOG_INFO "清理环境:卸载texlive-doctools" - dnf remove -y texlive-doctools - fi - exit 255 - fi - - # 清理环境:如果测试前未安装,则卸载软件包 - if [ $already_installed -eq 0 ]; then - LOG_INFO "步骤7:清理环境,卸载texlive-doctools" - dnf remove -y texlive-doctools - CHECK_RESULT $? 0 0 "卸载texlive-doctools失败" - else - LOG_INFO "步骤7:保持texlive-doctools安装状态" - fi - - LOG_INFO "测试完成:Test basic command execution" -} - -main "$@" \ No newline at end of file diff --git a/testcases/function_test/pkg_test/texlive-split-g/texlive-doctools/test_texlive-doctools_function_check_installed.sh b/testcases/function_test/pkg_test/texlive-split-g/texlive-doctools/test_texlive-doctools_function_check_installed.sh deleted file mode 100644 index c4c2333ca65..00000000000 --- a/testcases/function_test/pkg_test/texlive-split-g/texlive-doctools/test_texlive-doctools_function_check_installed.sh +++ /dev/null @@ -1,99 +0,0 @@ -#!/usr/bin/bash - -# Copyright (c) 2024 ISCAS .ALL rights reserved. -# This program is licensed under Mulan PSL v2. -# You can use it according to the terms and conditions of the Mulan PSL v2. -# http://license.coscl.org.cn/MulanPSL2 -# THIS PROGRAM IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, -# EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, -# MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. -# See the Mulan PSL v2 for more details. - -# ############################################# -# @Author : honghua -# @Contact : honghua@iscas.ac.cn -# @Date : 2026-04-06 -# @License : Mulan PSL v2 -# @Desc : Test if package is installed -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - # 测试脚本:检查texlive-doctools软件包是否安装 - - LOG_INFO "===============================================" - LOG_INFO "开始测试:检查texlive-doctools软件包安装状态" - LOG_INFO "===============================================" - - # 定义软件包名称 - PACKAGE_NAME="texlive-doctools" - LOG_INFO "测试目标软件包: ${PACKAGE_NAME}" - - # 步骤1:检查yum源中是否存在该软件包 - LOG_INFO "步骤1: 检查yum源中是否存在${PACKAGE_NAME}软件包" - dnf list available ${PACKAGE_NAME} &>/dev/null - if [ $? -ne 0 ]; then - LOG_ERROR "错误: yum源中未找到${PACKAGE_NAME}软件包" - exit 255 - fi - LOG_INFO "✓ yum源中存在${PACKAGE_NAME}软件包" - - # 步骤2:检查当前是否已安装该软件包 - LOG_INFO "步骤2: 检查${PACKAGE_NAME}软件包当前安装状态" - dnf list installed ${PACKAGE_NAME} &>/dev/null - INSTALLED=$? - if [ ${INSTALLED} -eq 0 ]; then - LOG_INFO "✓ ${PACKAGE_NAME}软件包已安装" - NEED_CLEANUP=0 - else - LOG_INFO "✗ ${PACKAGE_NAME}软件包未安装" - NEED_CLEANUP=1 - fi - - # 步骤3:如果未安装,则进行安装测试 - if [ ${NEED_CLEANUP} -eq 1 ]; then - LOG_INFO "步骤3: 安装${PACKAGE_NAME}软件包进行测试" - dnf install -y ${PACKAGE_NAME} - CHECK_RESULT $? 0 0 "安装${PACKAGE_NAME}软件包失败" - LOG_INFO "✓ ${PACKAGE_NAME}软件包安装成功" - - # 验证安装是否成功 - LOG_INFO "步骤4: 验证${PACKAGE_NAME}软件包安装结果" - dnf list installed ${PACKAGE_NAME} &>/dev/null - CHECK_RESULT $? 0 0 "${PACKAGE_NAME}软件包安装后验证失败" - LOG_INFO "✓ ${PACKAGE_NAME}软件包安装验证成功" - fi - - # 步骤4:检查软件包是否可正常使用(如果有相关命令) - LOG_INFO "步骤5: 检查${PACKAGE_NAME}软件包相关功能" - # 这里可以根据实际软件包特性添加具体的功能检查 - # 例如:检查是否有相关的二进制文件或库文件 - rpm -ql ${PACKAGE_NAME} | head -5 &>/dev/null - CHECK_RESULT $? 0 0 "无法获取${PACKAGE_NAME}软件包文件列表" - LOG_INFO "✓ ${PACKAGE_NAME}软件包文件列表可正常获取" - - # 步骤5:环境清理 - LOG_INFO "步骤6: 环境清理" - if [ ${NEED_CLEANUP} -eq 1 ]; then - LOG_INFO "清理: 卸载测试安装的${PACKAGE_NAME}软件包" - dnf remove -y ${PACKAGE_NAME} - CHECK_RESULT $? 0 0 "卸载${PACKAGE_NAME}软件包失败" - - # 验证卸载是否成功 - dnf list installed ${PACKAGE_NAME} &>/dev/null - if [ $? -eq 0 ]; then - LOG_ERROR "错误: ${PACKAGE_NAME}软件包卸载后仍然存在" - exit 1 - fi - LOG_INFO "✓ ${PACKAGE_NAME}软件包已成功卸载,环境已恢复" - else - LOG_INFO "无需清理: ${PACKAGE_NAME}软件包保持原有安装状态" - fi - - LOG_INFO "===============================================" - LOG_INFO "测试完成: ${PACKAGE_NAME}软件包安装状态检查通过" - LOG_INFO "===============================================" -} - -main "$@" \ No newline at end of file diff --git a/testcases/function_test/pkg_test/texlive-split-g/texlive-doctools/test_texlive-doctools_function_docgen.sh b/testcases/function_test/pkg_test/texlive-split-g/texlive-doctools/test_texlive-doctools_function_docgen.sh deleted file mode 100644 index 0317ef3a102..00000000000 --- a/testcases/function_test/pkg_test/texlive-split-g/texlive-doctools/test_texlive-doctools_function_docgen.sh +++ /dev/null @@ -1,73 +0,0 @@ -#!/usr/bin/bash - -# Copyright (c) 2024 ISCAS .ALL rights reserved. -# This program is licensed under Mulan PSL v2. -# You can use it according to the terms and conditions of the Mulan PSL v2. -# http://license.coscl.org.cn/MulanPSL2 -# THIS PROGRAM IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, -# EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, -# MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. -# See the Mulan PSL v2 for more details. - -# ############################################# -# @Author : honghua -# @Contact : honghua@iscas.ac.cn -# @Date : 2025-12-11 -# @License : Mulan PSL v2 -# @Desc : Test document generation -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - LOG_INFO "开始测试文档生成功能" - - # 检查是否已安装texlive-doctools - LOG_INFO "检查是否已安装texlive-doctools" - dnf list installed texlive-doctools > /dev/null 2>&1 - if [ $? -eq 0 ]; then - LOG_INFO "texlive-doctools已安装,脚本结束后将保持安装状态" - INSTALLED=true - else - LOG_INFO "texlive-doctools未安装,将在测试结束后卸载" - INSTALLED=false - fi - - # 检查yum源中是否有texlive-doctools - LOG_INFO "检查yum源中是否有texlive-doctools" - dnf list available texlive-doctools > /dev/null 2>&1 - if [ $? -ne 0 ]; then - LOG_ERROR "yum源中未找到texlive-doctools,退出测试" - exit 255 - fi - - # 如果未安装,则安装texlive-doctools - if [ "$INSTALLED" = false ]; then - LOG_INFO "开始安装texlive-doctools" - dnf install -y texlive-doctools > /dev/null 2>&1 - CHECK_RESULT $? 0 0 "安装texlive-doctools失败" - fi - - # 测试文档生成功能 - LOG_INFO "测试文档生成功能" - docgen --help > /dev/null 2>&1 - if [ $? -ne 0 ]; then - LOG_ERROR "docgen命令不存在或不支持,退出测试" - exit 255 - fi - - LOG_INFO "执行docgen命令生成文档" - docgen --output test_doc.html > /dev/null 2>&1 - CHECK_RESULT $? 0 0 "生成文档失败" - - # 清理环境 - if [ "$INSTALLED" = false ]; then - LOG_INFO "卸载texlive-doctools" - dnf remove -y texlive-doctools > /dev/null 2>&1 - CHECK_RESULT $? 0 0 "卸载texlive-doctools失败" - fi - - LOG_INFO "测试文档生成功能完成" -} - -main "$@" \ No newline at end of file diff --git a/testcases/function_test/pkg_test/texlive-split-g/texlive-doctools/test_texlive-doctools_function_install.sh b/testcases/function_test/pkg_test/texlive-split-g/texlive-doctools/test_texlive-doctools_function_install.sh deleted file mode 100644 index 8c22ac87889..00000000000 --- a/testcases/function_test/pkg_test/texlive-split-g/texlive-doctools/test_texlive-doctools_function_install.sh +++ /dev/null @@ -1,82 +0,0 @@ -#!/usr/bin/bash - -# Copyright (c) 2024 ISCAS .ALL rights reserved. -# This program is licensed under Mulan PSL v2. -# You can use it according to the terms and conditions of the Mulan PSL v2. -# http://license.coscl.org.cn/MulanPSL2 -# THIS PROGRAM IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, -# EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, -# MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. -# See the Mulan PSL v2 for more details. - -# ############################################# -# @Author : honghua -# @Contact : honghua@iscas.ac.cn -# @Date : 2026-04-06 -# @License : Mulan PSL v2 -# @Desc : Test package installation -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - LOG_INFO "开始测试:Test package installation" - - # 定义软件包名称 - PACKAGE_NAME="texlive-doctools" - - # 步骤1:检查yum源中是否存在软件包 - LOG_INFO "步骤1:检查yum源中是否存在软件包 $PACKAGE_NAME" - dnf list available $PACKAGE_NAME > /dev/null 2>&1 - CHECK_RESULT $? 0 0 "yum源中未找到软件包 $PACKAGE_NAME" - if [ $? -ne 0 ]; then - LOG_ERROR "yum源中未找到软件包 $PACKAGE_NAME" - exit 255 - fi - - # 步骤2:检查是否已安装 - LOG_INFO "步骤2:检查是否已安装 $PACKAGE_NAME" - if rpm -q $PACKAGE_NAME > /dev/null 2>&1; then - LOG_INFO "软件包 $PACKAGE_NAME 已安装,跳过安装步骤" - INSTALLED=1 - else - LOG_INFO "软件包 $PACKAGE_NAME 未安装,将进行安装" - INSTALLED=0 - fi - - # 步骤3:如果未安装,则安装软件包 - if [ $INSTALLED -eq 0 ]; then - LOG_INFO "步骤3:安装软件包 $PACKAGE_NAME" - dnf install -y $PACKAGE_NAME - CHECK_RESULT $? 0 0 "安装软件包 $PACKAGE_NAME 失败" - fi - - # 步骤4:验证软件包安装成功 - LOG_INFO "步骤4:验证软件包 $PACKAGE_NAME 安装成功" - rpm -q $PACKAGE_NAME > /dev/null 2>&1 - CHECK_RESULT $? 0 0 "软件包 $PACKAGE_NAME 安装后验证失败" - - # 步骤5:执行软件包相关功能测试(示例:检查版本信息) - LOG_INFO "步骤5:执行软件包相关功能测试" - # 假设软件包提供一个命令 "texdoctools" 来检查版本 - if command -v texdoctools > /dev/null 2>&1; then - texdoctools --version > /dev/null 2>&1 - CHECK_RESULT $? 0 0 "软件包 $PACKAGE_NAME 功能测试失败" - else - LOG_INFO "软件包 $PACKAGE_NAME 未提供可执行命令,跳过功能测试" - fi - - # 步骤6:环境恢复 - LOG_INFO "步骤6:环境恢复" - if [ $INSTALLED -eq 0 ]; then - LOG_INFO "卸载软件包 $PACKAGE_NAME" - dnf remove -y $PACKAGE_NAME - CHECK_RESULT $? 0 0 "卸载软件包 $PACKAGE_NAME 失败" - else - LOG_INFO "软件包 $PACKAGE_NAME 在测试前已安装,保持安装状态" - fi - - LOG_INFO "测试完成:Test package installation" -} - -main "$@" \ No newline at end of file diff --git a/testcases/function_test/pkg_test/texlive-split-g/texlive-doctools/test_texlive-doctools_function_uninstall.sh b/testcases/function_test/pkg_test/texlive-split-g/texlive-doctools/test_texlive-doctools_function_uninstall.sh deleted file mode 100644 index 8016a363101..00000000000 --- a/testcases/function_test/pkg_test/texlive-split-g/texlive-doctools/test_texlive-doctools_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-04-06 -# @License : Mulan PSL v2 -# @Desc : Test package removal -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - # 检查是否已安装texlive-doctools - LOG_INFO "检查是否已安装texlive-doctools" - if rpm -q texlive-doctools &>/dev/null; then - LOG_INFO "texlive-doctools已安装,记录当前状态" - INSTALLED_BEFORE=true - else - LOG_INFO "texlive-doctools未安装,记录当前状态" - INSTALLED_BEFORE=false - fi - - # 检查yum源中是否存在texlive-doctools - LOG_INFO "检查yum源中是否存在texlive-doctools" - if ! dnf list available texlive-doctools &>/dev/null; then - LOG_ERROR "yum源中未找到texlive-doctools软件包" - exit 255 - fi - - # 如果未安装,则安装软件包 - if [ "$INSTALLED_BEFORE" = "false" ]; then - LOG_INFO "开始安装texlive-doctools" - dnf install -y texlive-doctools - CHECK_RESULT $? 0 0 "安装texlive-doctools失败" - LOG_INFO "安装texlive-doctools成功" - fi - - # 测试卸载功能 - LOG_INFO "开始测试卸载texlive-doctools" - dnf remove -y texlive-doctools - CHECK_RESULT $? 0 0 "卸载texlive-doctools失败" - LOG_INFO "卸载texlive-doctools成功" - - # 验证卸载后软件包不存在 - LOG_INFO "验证卸载后texlive-doctools不存在" - if rpm -q texlive-doctools &>/dev/null; then - LOG_ERROR "卸载后texlive-doctools仍然存在" - exit 1 - else - LOG_INFO "卸载验证成功,texlive-doctools已不存在" - fi - - # 环境恢复:如果测试前已安装,则重新安装 - if [ "$INSTALLED_BEFORE" = "true" ]; then - LOG_INFO "恢复环境,重新安装texlive-doctools" - dnf install -y texlive-doctools - CHECK_RESULT $? 0 0 "重新安装texlive-doctools失败" - LOG_INFO "环境恢复成功,texlive-doctools已重新安装" - fi - - LOG_INFO "测试完成,环境已恢复" -} - -main "$@" \ No newline at end of file diff --git a/testcases/function_test/pkg_test/texlive-split-g/texlive-doctools/test_texlive-doctools_function_version_check.sh b/testcases/function_test/pkg_test/texlive-split-g/texlive-doctools/test_texlive-doctools_function_version_check.sh deleted file mode 100644 index cb504df1595..00000000000 --- a/testcases/function_test/pkg_test/texlive-split-g/texlive-doctools/test_texlive-doctools_function_version_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 : 2026-04-06 -# @License : Mulan PSL v2 -# @Desc : Test version information query -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - LOG_INFO "开始测试:Test version information query" - LOG_INFO "步骤1:检查系统是否已安装texlive-doctools软件包" - if dnf list installed texlive-doctools &>/dev/null; then - LOG_INFO "texlive-doctools已安装,保持安装状态" - INSTALLED=true - else - LOG_INFO "texlive-doctools未安装,将在测试过程中安装" - INSTALLED=false - fi - LOG_INFO "步骤2:检查yum源中是否存在texlive-doctools软件包" - if ! dnf list available texlive-doctools &>/dev/null; then - LOG_ERROR "yum源中不存在texlive-doctools软件包,退出测试" - exit 255 - fi - if [ "$INSTALLED" = false ]; then - LOG_INFO "步骤3:安装texlive-doctools软件包" - dnf install -y texlive-doctools - CHECK_RESULT $? 0 0 "安装texlive-doctools失败" - LOG_INFO "texlive-doctools安装成功" - fi - LOG_INFO "步骤4:测试version参数查询版本信息" - texlive-doctools --version - CHECK_RESULT $? 0 0 "执行texlive-doctools --version失败" - LOG_INFO "步骤5:测试-V参数查询版本信息" - texlive-doctools -V - CHECK_RESULT $? 0 0 "执行texlive-doctools -V失败" - LOG_INFO "步骤6:测试不支持的参数" - texlive-doctools --invalid-param 2>/dev/null - if [ $? -eq 255 ]; then - LOG_INFO "不支持的参数处理正确,返回退出码255" - else - LOG_ERROR "不支持的参数处理不正确" - exit 255 - fi - if [ "$INSTALLED" = false ]; then - LOG_INFO "步骤7:卸载texlive-doctools软件包" - dnf remove -y texlive-doctools - CHECK_RESULT $? 0 0 "卸载texlive-doctools失败" - LOG_INFO "texlive-doctools卸载成功" - else - LOG_INFO "步骤7:保持texlive-doctools安装状态,无需卸载" - fi - LOG_INFO "测试完成:Test version information query" -} - -main "$@" \ No newline at end of file diff --git a/testcases/function_test/pkg_test/texlive-split-g/texlive-draftcopy-doc/test_texlive-draftcopy-doc_function_build.sh b/testcases/function_test/pkg_test/texlive-split-g/texlive-draftcopy-doc/test_texlive-draftcopy-doc_function_build.sh deleted file mode 100644 index 4ac5b0c9767..00000000000 --- a/testcases/function_test/pkg_test/texlive-split-g/texlive-draftcopy-doc/test_texlive-draftcopy-doc_function_build.sh +++ /dev/null @@ -1,69 +0,0 @@ -#!/usr/bin/bash - -# Copyright (c) 2024 ISCAS .ALL rights reserved. -# This program is licensed under Mulan PSL v2. -# You can use it according to the terms and conditions of the Mulan PSL v2. -# http://license.coscl.org.cn/MulanPSL2 -# THIS PROGRAM IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, -# EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, -# MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. -# See the Mulan PSL v2 for more details. - -# ############################################# -# @Author : honghua -# @Contact : honghua@iscas.ac.cn -# @Date : 2025-12-06 -# @License : Mulan PSL v2 -# @Desc : 测试texlive-draftcopy-doc软件包的构建功能 -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - LOG_INFO "开始测试texlive-draftcopy-doc软件包的构建功能" - - # 检查软件包是否已安装 - if dnf list installed texlive-draftcopy-doc &>/dev/null; then - LOG_INFO "texlive-draftcopy-doc软件包已安装" - INSTALLED=true - else - LOG_INFO "texlive-draftcopy-doc软件包未安装" - INSTALLED=false - fi - - # 检查yum源中是否有该软件包 - LOG_INFO "检查yum源中是否存在texlive-draftcopy-doc软件包" - if ! dnf list available texlive-draftcopy-doc &>/dev/null; then - LOG_ERROR "yum源中不存在texlive-draftcopy-doc软件包" - exit 255 - fi - - # 如果未安装,则安装软件包 - if [ "$INSTALLED" = false ]; then - LOG_INFO "安装texlive-draftcopy-doc软件包" - dnf install -y texlive-draftcopy-doc - CHECK_RESULT $? 0 0 "安装texlive-draftcopy-doc软件包失败" - fi - - # 测试构建功能 - LOG_INFO "测试texlive-draftcopy-doc的构建功能" - BUILD_COMMAND="some_build_command" # 替换为实际的构建命令 - if ! command -v $BUILD_COMMAND &>/dev/null; then - LOG_ERROR "$BUILD_COMMAND命令不存在或不支持" - exit 255 - fi - - $BUILD_COMMAND --some-flag # 替换为实际的构建命令和参数 - CHECK_RESULT $? 0 0 "构建texlive-draftcopy-doc失败" - - # 清理环境 - if [ "$INSTALLED" = false ]; then - LOG_INFO "卸载texlive-draftcopy-doc软件包" - dnf remove -y texlive-draftcopy-doc - CHECK_RESULT $? 0 0 "卸载texlive-draftcopy-doc软件包失败" - fi - - LOG_INFO "测试完成,环境已恢复" -} - -main "$@" \ No newline at end of file diff --git a/testcases/function_test/pkg_test/texlive-split-h/texlive-etaremune/test_texlive-etaremune_install.sh b/testcases/function_test/pkg_test/texlive-split-h/texlive-etaremune/test_texlive-etaremune_install.sh deleted file mode 100644 index 435ea7e8e95..00000000000 --- a/testcases/function_test/pkg_test/texlive-split-h/texlive-etaremune/test_texlive-etaremune_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 : 2025-09-25 -# @License : Mulan PSL v2 -# @Desc : Test package installation -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - - # 检查是否已安装texlive-etaremune软件包 - LOG_INFO "检查是否已安装texlive-etaremune软件包" - rpm -q texlive-etaremune > /dev/null 2>&1 - if [ $? -eq 0 ]; then - LOG_INFO "texlive-etaremune已安装,脚本结束后保持安装状态" - installed=true - else - installed=false - fi - - # 检查yum源中是否存在texlive-etaremune软件包 - LOG_INFO "检查yum源中是否存在texlive-etaremune软件包" - dnf list available texlive-etaremune > /dev/null 2>&1 - CHECK_RESULT $? 0 255 "yum源中不存在texlive-etaremune软件包" - - # 安装texlive-etaremune软件包(如果未安装) - if [ "$installed" = false ]; then - LOG_INFO "安装texlive-etaremune软件包" - dnf install -y texlive-etaremune - CHECK_RESULT $? 0 0 "安装texlive-etaremune软件包失败" - fi - - # 测试步骤:验证texlive-etaremune安装成功 - LOG_INFO "验证texlive-etaremune安装成功" - rpm -q texlive-etaremune > /dev/null 2>&1 - CHECK_RESULT $? 0 0 "texlive-etaremune未正确安装" - - # 清理环境:如果脚本开始时未安装,则卸载软件包 - if [ "$installed" = false ]; then - LOG_INFO "卸载texlive-etaremune软件包" - dnf remove -y texlive-etaremune - CHECK_RESULT $? 0 0 "卸载texlive-etaremune软件包失败" - - # 验证卸载成功 - rpm -q texlive-etaremune > /dev/null 2>&1 - CHECK_RESULT $? 1 0 "texlive-etaremune未正确卸载" - fi - - LOG_INFO "测试脚本执行完成" - -} - -main "$@" \ No newline at end of file diff --git a/testcases/function_test/pkg_test/texlive-split-l/texlive-ijmart/test_texlive-ijmart_function_basic.sh b/testcases/function_test/pkg_test/texlive-split-l/texlive-ijmart/test_texlive-ijmart_function_basic.sh deleted file mode 100644 index fbf3de29b18..00000000000 --- a/testcases/function_test/pkg_test/texlive-split-l/texlive-ijmart/test_texlive-ijmart_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-09-26 -# @License : Mulan PSL v2 -# @Desc : Test basic command usage -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - LOG_INFO "开始测试:Test basic command usage" - - # 检查软件包是否存在于yum源中 - LOG_INFO "检查texlive-ijmart软件包是否存在于yum源中" - dnf list available texlive-ijmart >/dev/null 2>&1 - if [ $? -ne 0 ]; then - LOG_ERROR "texlive-ijmart软件包不存在于yum源中" - exit 255 - fi - - # 检查环境是否已安装texlive-ijmart - LOG_INFO "检查环境是否已安装texlive-ijmart" - rpm -q texlive-ijmart >/dev/null 2>&1 - if [ $? -eq 0 ]; then - installed=true - LOG_INFO "texlive-ijmart已安装,脚本结束时将保持安装状态" - else - installed=false - LOG_INFO "texlive-ijmart未安装,将在测试结束后卸载" - fi - - # 安装texlive-ijmart(如果未安装) - if [ "$installed" = false ]; then - LOG_INFO "安装texlive-ijmart软件包" - dnf install -y texlive-ijmart - CHECK_RESULT $? 0 0 "安装texlive-ijmart失败" - fi - - # 测试基本命令用法 - LOG_INFO "测试基本命令用法" - texlive-ijmart --help >/dev/null 2>&1 - CHECK_RESULT $? 0 0 "texlive-ijmart --help命令执行失败" - - # 清理环境(如果之前未安装) - if [ "$installed" = false ]; then - LOG_INFO "卸载texlive-ijmart软件包" - dnf remove -y texlive-ijmart - CHECK_RESULT $? 0 0 "卸载texlive-ijmart失败" - fi - - LOG_INFO "测试完成:Test basic command usage" -} - -main "$@" \ No newline at end of file diff --git a/testcases/function_test/pkg_test/texlive-split-l/texlive-ijmart/test_texlive-ijmart_function_install.sh b/testcases/function_test/pkg_test/texlive-split-l/texlive-ijmart/test_texlive-ijmart_function_install.sh deleted file mode 100644 index 50e69629bf4..00000000000 --- a/testcases/function_test/pkg_test/texlive-split-l/texlive-ijmart/test_texlive-ijmart_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 : 2025-09-26 -# @License : Mulan PSL v2 -# @Desc : Test package installation -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - # 测试脚本:test_texlive-ijmart_function_install - - LOG_INFO "开始测试软件包安装功能" - - # 检查是否已安装软件包 - LOG_INFO "检查软件包是否已安装" - if dnf list installed texlive-ijmart &>/dev/null; then - LOG_INFO "软件包已安装,跳过安装步骤" - INSTALLED=true - else - LOG_INFO "软件包未安装,准备安装" - INSTALLED=false - fi - - # 检查yum源中是否有该软件包 - LOG_INFO "检查yum源中是否存在texlive-ijmart软件包" - if ! dnf list available texlive-ijmart &>/dev/null; then - LOG_ERROR "yum源中不存在texlive-ijmart软件包" - exit 255 - fi - - # 如果未安装,则执行安装 - if [ "$INSTALLED" = false ]; then - LOG_INFO "开始安装texlive-ijmart软件包" - dnf install -y texlive-ijmart - CHECK_RESULT $? 0 0 "安装texlive-ijmart失败" - fi - - # 测试命令参数是否支持(假设命令为texlive-ijmart --version) - LOG_INFO "测试命令参数是否支持" - texlive-ijmart --version &>/dev/null - CHECK_RESULT $? 0 0 "命令参数不支持或命令执行失败" - - # 如果脚本开始时未安装,则在结束时卸载 - if [ "$INSTALLED" = false ]; then - LOG_INFO "卸载texlive-ijmart软件包" - dnf remove -y texlive-ijmart - CHECK_RESULT $? 0 0 "卸载texlive-ijmart失败" - fi - - LOG_INFO "测试完成,环境已恢复" -} - -main "$@" \ No newline at end of file diff --git a/testcases/function_test/pkg_test/texlive-split-u/texlive-selnolig/test_texlive-selnolig_function_install.sh b/testcases/function_test/pkg_test/texlive-split-u/texlive-selnolig/test_texlive-selnolig_function_install.sh deleted file mode 100644 index e07f676900f..00000000000 --- a/testcases/function_test/pkg_test/texlive-split-u/texlive-selnolig/test_texlive-selnolig_function_install.sh +++ /dev/null @@ -1,71 +0,0 @@ -#!/usr/bin/bash - -# Copyright (c) 2024 ISCAS .ALL rights reserved. -# This program is licensed under Mulan PSL v2. -# You can use it according to the terms and conditions of the Mulan PSL v2. -# http://license.coscl.org.cn/MulanPSL2 -# THIS PROGRAM IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, -# EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, -# MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. -# See the Mulan PSL v2 for more details. - -# ############################################# -# @Author : honghua -# @Contact : honghua@iscas.ac.cn -# @Date : 2025-11-26 -# @License : Mulan PSL v2 -# @Desc : Test installation of texlive-selnolig package -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - LOG_INFO "开始测试:Test installation of texlive-selnolig package" - - # 检查yum源中是否存在texlive-selnolig包 - LOG_INFO "检查yum源中是否存在texlive-selnolig包" - dnf list available texlive-selnolig > /dev/null 2>&1 - if [ $? -ne 0 ]; then - LOG_ERROR "yum源中不存在texlive-selnolig包" - exit 255 - fi - - # 检查是否已安装texlive-selnolig包 - LOG_INFO "检查是否已安装texlive-selnolig包" - rpm -q texlive-selnolig > /dev/null 2>&1 - if [ $? -eq 0 ]; then - LOG_INFO "texlive-selnolig包已安装,测试结束后将保持安装状态" - INSTALLED=true - else - LOG_INFO "texlive-selnolig包未安装,测试结束后将卸载" - INSTALLED=false - fi - - # 若未安装,则安装texlive-selnolig包 - if [ "$INSTALLED" = false ]; then - LOG_INFO "安装texlive-selnolig包" - dnf install -y texlive-selnolig > /dev/null 2>&1 - CHECK_RESULT $? 0 0 "安装texlive-selnolig包失败" - fi - - # 测试命令参数是否存在或不支持 - LOG_INFO "测试命令参数是否存在或不支持" - texlua --help > /dev/null 2>&1 - CHECK_RESULT $? 0 255 "texlua命令参数不支持" - - # 执行测试命令 - LOG_INFO "执行测试命令:texlua --version" - texlua --version > /dev/null 2>&1 - CHECK_RESULT $? 0 0 "执行texlua --version失败" - - # 若未安装,则卸载texlive-selinux包 - if [ "$INSTALLED" = false ]; then - LOG_INFO "卸载texlive-selinux包" - dnf remove -y texlive-selinux > /dev/null 2>&1 - CHECK_RESULT $? 0 0 "卸载texlive-selinux包失败" - fi - - LOG_INFO "测试完成:Test installation of texlive-selnolig package" -} - -main "$@" \ No newline at end of file diff --git a/testcases/function_test/pkg_test/texlive-split-x/texlive-timbreicmc/test_texlive-timbreicmc_basic_usage.sh b/testcases/function_test/pkg_test/texlive-split-x/texlive-timbreicmc/test_texlive-timbreicmc_basic_usage.sh deleted file mode 100644 index bc86d00c42c..00000000000 --- a/testcases/function_test/pkg_test/texlive-split-x/texlive-timbreicmc/test_texlive-timbreicmc_basic_usage.sh +++ /dev/null @@ -1,89 +0,0 @@ -#!/usr/bin/bash - -# Copyright (c) 2024 ISCAS .ALL rights reserved. -# This program is licensed under Mulan PSL v2. -# You can use it according to the terms and conditions of the Mulan PSL v2. -# http://license.coscl.org.cn/MulanPSL2 -# THIS PROGRAM IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, -# EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, -# MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. -# See the Mulan PSL v2 for more details. - -# ############################################# -# @Author : honghua -# @Contact : honghua@iscas.ac.cn -# @Date : 2026-03-01 -# @License : Mulan PSL v2 -# @Desc : Test basic document compilation with the package -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - LOG_INFO "开始测试:基本文档编译功能测试" - - # 检查软件包是否在yum源中 - LOG_INFO "步骤1:检查texlive-timbreicmc软件包是否在yum源中" - dnf list texlive-timbreicmc &> /dev/null - if [ $? -ne 0 ]; then - LOG_ERROR "texlive-timbreicmc软件包不在yum源中" - exit 255 - fi - - # 检查是否已安装 - LOG_INFO "步骤2:检查texlive-timbreicmc是否已安装" - rpm -q texlive-timbreicmc &> /dev/null - INSTALLED=$? - - if [ $INSTALLED -eq 0 ]; then - LOG_INFO "texlive-timbreicmc已安装,测试后将保持安装状态" - NEED_CLEANUP=0 - else - LOG_INFO "texlive-timbreicmc未安装,将进行安装测试" - NEED_CLEANUP=1 - - # 安装软件包 - LOG_INFO "步骤3:安装texlive-timbreicmc软件包" - dnf install -y texlive-timbreicmc - CHECK_RESULT $? 0 0 "安装texlive-timbreicmc失败" - fi - - # 测试基本文档编译功能 - LOG_INFO "步骤4:创建测试LaTeX文档" - cat > test_document.tex << "EOF" - \documentclass{article} - \begin{document} - Hello, this is a test document for texlive-timbreicmc. - \end{document} - EOF - CHECK_RESULT $? 0 0 "创建测试文档失败" - - LOG_INFO "步骤5:使用pdflatex编译测试文档" - pdflatex test_document.tex - CHECK_RESULT $? 0 0 "文档编译失败" - - LOG_INFO "步骤6:检查生成的PDF文件" - if [ -f test_document.pdf ]; then - LOG_INFO "PDF文件生成成功" - CHECK_RESULT 0 0 0 "PDF文件生成检查" - else - LOG_ERROR "PDF文件未生成" - CHECK_RESULT 1 0 1 "PDF文件生成检查" - fi - - # 清理测试文件 - LOG_INFO "步骤7:清理测试生成的文件" - rm -f test_document.tex test_document.log test_document.aux test_document.pdf - CHECK_RESULT $? 0 0 "清理测试文件失败" - - # 如果需要清理,则卸载软件包 - if [ $NEED_CLEANUP -eq 1 ]; then - LOG_INFO "步骤8:卸载texlive-timbreicmc软件包" - dnf remove -y texlive-timbreicmc - CHECK_RESULT $? 0 0 "卸载texlive-timbreicmc失败" - fi - - LOG_INFO "测试完成:基本文档编译功能测试通过" -} - -main "$@" \ No newline at end of file diff --git a/testcases/function_test/pkg_test/texlive-split-x/texlive-timbreicmc/test_texlive-timbreicmc_function_basic.sh b/testcases/function_test/pkg_test/texlive-split-x/texlive-timbreicmc/test_texlive-timbreicmc_function_basic.sh deleted file mode 100644 index b703c53e544..00000000000 --- a/testcases/function_test/pkg_test/texlive-split-x/texlive-timbreicmc/test_texlive-timbreicmc_function_basic.sh +++ /dev/null @@ -1,65 +0,0 @@ -#!/usr/bin/bash - -# Copyright (c) 2024 ISCAS .ALL rights reserved. -# This program is licensed under Mulan PSL v2. -# You can use it according to the terms and conditions of the Mulan PSL v2. -# http://license.coscl.org.cn/MulanPSL2 -# THIS PROGRAM IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, -# EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, -# MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. -# See the Mulan PSL v2 for more details. - -# ############################################# -# @Author : honghua -# @Contact : honghua@iscas.ac.cn -# @Date : 2025-10-04 -# @License : Mulan PSL v2 -# @Desc : Test basic command usage -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - # 测试脚本:test_texlive-timbreicmc_function_basic - - LOG_INFO "开始测试:Test basic command usage" - - # 检查软件包是否已安装 - LOG_INFO "检查软件包是否已安装" - dnf list installed texlive-timbreicmc &>/dev/null - if [ $? -eq 0 ]; then - LOG_INFO "软件包已安装,脚本结束时保持安装状态" - already_installed=true - else - LOG_INFO "软件包未安装,将在测试结束后卸载" - already_installed=false - fi - - # 检查yum源中是否有该软件包 - LOG_INFO "检查yum源中是否有texlive-timbreicmc软件包" - dnf list available texlive-timbreicmc &>/dev/null - CHECK_RESULT $? 0 255 "yum源中不存在texlive-timbreicmc软件包" - - # 安装软件包 - if [ "$already_installed" = false ]; then - LOG_INFO "安装texlive-timbreicmc软件包" - dnf install -y texlive-timbreicmc - CHECK_RESULT $? 0 0 "安装texlive-timbreicmc失败" - fi - - # 测试基本命令用法 - LOG_INFO "测试基本命令用法" - texlive-timbreicmc --help &>/dev/null - CHECK_RESULT $? 0 255 "texlive-timbreicmc命令不支持--help参数或执行失败" - - # 清理环境(如果之前未安装) - if [ "$already_installed" = false ]; then - LOG_INFO "卸载texlive-timbreicmc软件包" - dnf remove -y texlive-timbreicmc - CHECK_RESULT $? 0 0 "卸载texlive-timbreicmc失败" - fi - - LOG_INFO "测试完成:Test basic command usage" -} - -main "$@" \ No newline at end of file