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/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/swt-chart/swt-chart-javadoc.json b/suite2cases/function_test/pkg_test/swt-chart/swt-chart-javadoc.json deleted file mode 100644 index 97b67ed10da..00000000000 --- a/suite2cases/function_test/pkg_test/swt-chart/swt-chart-javadoc.json +++ /dev/null @@ -1,46 +0,0 @@ -{ - "path": "$OET_PATH/testcases/function_test/pkg_test/swt-chart/swt-chart-javadoc", - "machine num": 1, - "cases": [ - { - "name": "test_swt-chart-javadoc_function_render", - "desc": "Test chart rendering functionality" - }, - { - "name": "test_swt-chart-javadoc_function_data", - "desc": "Test data input and processing" - }, - { - "name": "test_swt-chart-javadoc_function_export", - "desc": "Test chart export feature" - }, - { - "name": "test_swt-chart-javadoc_function_style", - "desc": "Test chart styling options" - }, - { - "name": "test_swt-chart-javadoc_function_interact", - "desc": "Test chart interaction" - }, - { - "name": "test_swt-chart-javadoc_function_load", - "desc": "Test chart data loading" - }, - { - "name": "test_swt-chart-javadoc_function_update", - "desc": "Test chart data update" - }, - { - "name": "test_swt-chart-javadoc_function_resize", - "desc": "Test chart resizing" - }, - { - "name": "test_swt-chart-javadoc_function_legend", - "desc": "Test chart legend display" - }, - { - "name": "test_swt-chart-javadoc_function_tooltip", - "desc": "Test chart tooltip functionality" - } - ] -} \ 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-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/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/swt-chart/swt-chart-javadoc/test_swt-chart-javadoc_function_data.sh b/testcases/function_test/pkg_test/swt-chart/swt-chart-javadoc/test_swt-chart-javadoc_function_data.sh deleted file mode 100644 index 6953bdc16d3..00000000000 --- a/testcases/function_test/pkg_test/swt-chart/swt-chart-javadoc/test_swt-chart-javadoc_function_data.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-11-29 -# @License : Mulan PSL v2 -# @Desc : Test data input and processing -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - # 检查软件包是否已安装 - if dnf list installed swt-chart-javadoc &>/dev/null; then - LOG_INFO "swt-chart-javadoc 已安装,脚本结束后将保持安装状态" - INSTALLED=true - else - LOG_INFO "swt-chart-javadoc 未安装,脚本结束后将卸载" - INSTALLED=false - fi - - # 检查yum源中是否存在软件包 - LOG_INFO "检查yum源中是否存在 swt-chart-javadoc" - if ! dnf list available swt-chart-javadoc &>/dev/null; then - LOG_ERROR "yum源中未找到 swt-chart-javadoc 软件包" - exit 255 - fi - - # 安装软件包 - if [ "$INSTALLED" = false ]; then - LOG_INFO "安装 swt-chart-javadoc" - dnf install -y swt-chart-javadoc - CHECK_RESULT $? 0 0 "安装 swt-chart-javadoc 失败" - fi - - # 测试数据输入和处理功能 - LOG_INFO "测试数据输入和处理功能" - java -jar /usr/share/java/swt-chart-javadoc.jar --test-data - CHECK_RESULT $? 0 0 "测试数据输入和处理功能失败" - - # 清理环境 - if [ "$INSTALLED" = false ]; then - LOG_INFO "卸载 swt-chart-javadoc" - dnf remove -y swt-chart-javadoc - CHECK_RESULT $? 0 0 "卸载 swt-chart-javadoc 失败" - fi -} - -main "$@" \ No newline at end of file diff --git a/testcases/function_test/pkg_test/swt-chart/swt-chart-javadoc/test_swt-chart-javadoc_function_export.sh b/testcases/function_test/pkg_test/swt-chart/swt-chart-javadoc/test_swt-chart-javadoc_function_export.sh deleted file mode 100644 index 1b0363ef1ce..00000000000 --- a/testcases/function_test/pkg_test/swt-chart/swt-chart-javadoc/test_swt-chart-javadoc_function_export.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-11-29 -# @License : Mulan PSL v2 -# @Desc : Test chart export feature -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - - # 检查软件包是否已安装 - if dnf list installed swt-chart-javadoc &>/dev/null; then - LOG_INFO "swt-chart-javadoc 已安装,测试结束后将保持安装状态" - INSTALLED=true - else - LOG_INFO "swt-chart-javadoc 未安装,测试结束后将卸载" - INSTALLED=false - fi - - # 检查yum源中是否有swt-chart-javadoc软件包 - LOG_INFO "检查yum源中是否存在swt-chart-javadoc软件包" - if ! dnf list available swt-chart-javadoc &>/dev/null; then - LOG_ERROR "yum源中未找到swt-chart-javadoc软件包" - exit 255 - fi - - # 安装swt-chart-javadoc软件包 - if [ "$INSTALLED" = false ]; then - LOG_INFO "开始安装swt-chart-javadoc软件包" - dnf install -y swt-chart-javadoc - CHECK_RESULT $? 0 0 "安装swt-chart-javadoc失败" - fi - - # 测试chart export功能 - LOG_INFO "测试chart export功能" - java -jar /usr/share/java/swt-chart-javadoc.jar --export-chart test_chart.png - CHECK_RESULT $? 0 0 "chart export功能测试失败" - - # 清理环境 - if [ "$INSTALLED" = false ]; then - LOG_INFO "卸载swt-chart-javadoc软件包" - dnf remove -y swt-chart-javadoc - CHECK_RESULT $? 0 0 "卸载swt-chart-javadoc失败" - fi - - LOG_INFO "测试完成,环境已恢复" - -} - -main "$@" \ No newline at end of file diff --git a/testcases/function_test/pkg_test/swt-chart/swt-chart-javadoc/test_swt-chart-javadoc_function_interact.sh b/testcases/function_test/pkg_test/swt-chart/swt-chart-javadoc/test_swt-chart-javadoc_function_interact.sh deleted file mode 100644 index e39ce30abe9..00000000000 --- a/testcases/function_test/pkg_test/swt-chart/swt-chart-javadoc/test_swt-chart-javadoc_function_interact.sh +++ /dev/null @@ -1,64 +0,0 @@ -#!/usr/bin/bash - -# Copyright (c) 2024 ISCAS .ALL rights reserved. -# This program is licensed under Mulan PSL v2. -# You can use it according to the terms and conditions of the Mulan PSL v2. -# http://license.coscl.org.cn/MulanPSL2 -# THIS PROGRAM IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, -# EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, -# MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. -# See the Mulan PSL v2 for more details. - -# ############################################# -# @Author : honghua -# @Contact : honghua@iscas.ac.cn -# @Date : 2025-11-29 -# @License : Mulan PSL v2 -# @Desc : Test chart interaction -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - LOG_INFO "开始测试:Test chart interaction" - - # 检查软件包是否已安装 - LOG_INFO "检查软件包 swt-chart-javadoc 是否已安装" - if dnf list installed swt-chart-javadoc &>/dev/null; then - LOG_INFO "软件包 swt-chart-javadoc 已安装" - INSTALLED=true - else - LOG_INFO "软件包 swt-chart-javadoc 未安装" - INSTALLED=false - fi - - # 检查yum源中是否有该软件包 - LOG_INFO "检查yum源中是否有 swt-chart-javadoc 软件包" - if ! dnf list available swt-chart-javadoc &>/dev/null; then - LOG_ERROR "yum源中未找到 swt-chart-javadoc 软件包" - exit 255 - fi - - # 如果未安装,则安装软件包 - if [ "$INSTALLED" = false ]; then - LOG_INFO "安装 swt-chart-javadoc 软件包" - dnf install -y swt-chart-javadoc - CHECK_RESULT $? 0 0 "安装 swt-chart-javadoc 失败" - fi - - # 测试命令交互功能 - LOG_INFO "测试 swt-chart-javadoc 命令交互功能" - swt-chart-javadoc --help &>/dev/null - CHECK_RESULT $? 0 0 "swt-chart-javadoc 命令不支持 --help 参数" - - # 清理环境 - if [ "$INSTALLED" = false ]; then - LOG_INFO "卸载 swt-chart-javadoc 软件包" - dnf remove -y swt-chart-javadoc - CHECK_RESULT $? 0 0 "卸载 swt-chart-javadoc 失败" - fi - - LOG_INFO "测试完成:Test chart interaction" -} - -main "$@" \ No newline at end of file diff --git a/testcases/function_test/pkg_test/swt-chart/swt-chart-javadoc/test_swt-chart-javadoc_function_legend.sh b/testcases/function_test/pkg_test/swt-chart/swt-chart-javadoc/test_swt-chart-javadoc_function_legend.sh deleted file mode 100644 index 7fd57f9bf6c..00000000000 --- a/testcases/function_test/pkg_test/swt-chart/swt-chart-javadoc/test_swt-chart-javadoc_function_legend.sh +++ /dev/null @@ -1,71 +0,0 @@ -#!/usr/bin/bash - -# Copyright (c) 2024 ISCAS .ALL rights reserved. -# This program is licensed under Mulan PSL v2. -# You can use it according to the terms and conditions of the Mulan PSL v2. -# http://license.coscl.org.cn/MulanPSL2 -# THIS PROGRAM IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, -# EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, -# MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. -# See the Mulan PSL v2 for more details. - -# ############################################# -# @Author : honghua -# @Contact : honghua@iscas.ac.cn -# @Date : 2025-12-08 -# @License : Mulan PSL v2 -# @Desc : Test chart legend display -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - LOG_INFO "开始测试图表图例显示功能" - - # 检查软件包是否已安装 - LOG_INFO "检查软件包是否已安装" - if dnf list installed swt-chart-javadoc &>/dev/null; then - LOG_INFO "软件包已安装,测试结束后将保持安装状态" - installed=true - else - LOG_INFO "软件包未安装,将在测试结束后卸载" - installed=false - fi - - # 检查yum源中是否有该软件包 - LOG_INFO "检查yum源中是否有swt-chart-javadoc软件包" - if ! dnf list available swt-chart-javadoc &>/dev/null; then - LOG_ERROR "yum源中未找到swt-chart-javadoc软件包" - exit 255 - fi - - # 安装软件包(如果未安装) - if [ "$installed" = false ]; then - LOG_INFO "正在安装swt-chart-javadoc软件包" - dnf install -y swt-chart-javadoc - CHECK_RESULT $? 0 0 "安装swt-chart-javadoc失败" - fi - - # 测试图表图例显示功能 - LOG_INFO "测试图表图例显示功能" - command_output=$(swt-chart-javadoc --legend) - CHECK_RESULT $? 0 0 "图表图例显示功能测试失败" - - # 检查参数是否支持 - LOG_INFO "检查--legend参数是否支持" - if ! swt-chart-javadoc --help | grep -q -- "--legend"; then - LOG_ERROR "--legend参数不支持" - exit 255 - fi - - # 清理环境(如果之前未安装) - if [ "$installed" = false ]; then - LOG_INFO "卸载swt-chart-javadoc软件包" - dnf remove -y swt-chart-javadoc - CHECK_RESULT $? 0 0 "卸载swt-chart-javadoc失败" - fi - - LOG_INFO "测试完成,环境已恢复" -} - -main "$@" \ No newline at end of file diff --git a/testcases/function_test/pkg_test/swt-chart/swt-chart-javadoc/test_swt-chart-javadoc_function_load.sh b/testcases/function_test/pkg_test/swt-chart/swt-chart-javadoc/test_swt-chart-javadoc_function_load.sh deleted file mode 100644 index 19ff764fb5a..00000000000 --- a/testcases/function_test/pkg_test/swt-chart/swt-chart-javadoc/test_swt-chart-javadoc_function_load.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-08 -# @License : Mulan PSL v2 -# @Desc : Test chart data loading -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - - LOG_INFO "开始测试: Test chart data loading" - - # 检查软件包是否已安装 - LOG_INFO "检查软件包 swt-chart-javadoc 是否已安装" - if dnf list installed swt-chart-javadoc &>/dev/null; then - LOG_INFO "软件包 swt-chart-javadoc 已安装" - installed=true - else - LOG_INFO "软件包 swt-chart-javadoc 未安装" - installed=false - fi - - # 检查yum源中是否有该软件包 - LOG_INFO "检查yum源中是否有 swt-chart-javadoc 软件包" - if ! dnf list available swt-chart-javadoc &>/dev/null; then - LOG_ERROR "yum源中未找到 swt-chart-javadoc 软件包" - exit 255 - fi - - # 如果未安装,则安装软件包 - if [ "$installed" = false ]; then - LOG_INFO "安装软件包 swt-chart-javadoc" - dnf install -y swt-chart-javadoc - CHECK_RESULT $? 0 0 "安装软件包失败" - fi - - # 测试功能加载 - LOG_INFO "测试功能加载" - command_to_test="swt-chart-javadoc --load-data" - $command_to_test - CHECK_RESULT $? 0 0 "功能加载失败" - - # 清理环境:如果之前未安装,则卸载软件包 - if [ "$installed" = false ]; then - LOG_INFO "卸载软件包 swt-chart-javadoc" - dnf remove -y swt-chart-javadoc - CHECK_RESULT $? 0 0 "卸载软件包失败" - fi - - LOG_INFO "测试完成: Test chart data loading" - -} - -main "$@" \ No newline at end of file diff --git a/testcases/function_test/pkg_test/swt-chart/swt-chart-javadoc/test_swt-chart-javadoc_function_render.sh b/testcases/function_test/pkg_test/swt-chart/swt-chart-javadoc/test_swt-chart-javadoc_function_render.sh deleted file mode 100644 index c24e2738c71..00000000000 --- a/testcases/function_test/pkg_test/swt-chart/swt-chart-javadoc/test_swt-chart-javadoc_function_render.sh +++ /dev/null @@ -1,64 +0,0 @@ -#!/usr/bin/bash - -# Copyright (c) 2024 ISCAS .ALL rights reserved. -# This program is licensed under Mulan PSL v2. -# You can use it according to the terms and conditions of the Mulan PSL v2. -# http://license.coscl.org.cn/MulanPSL2 -# THIS PROGRAM IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, -# EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, -# MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. -# See the Mulan PSL v2 for more details. - -# ############################################# -# @Author : honghua -# @Contact : honghua@iscas.ac.cn -# @Date : 2025-11-29 -# @License : Mulan PSL v2 -# @Desc : Test chart rendering functionality -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - LOG_INFO "开始测试chart渲染功能" - - # 检查是否已安装swt-chart-javadoc软件包 - LOG_INFO "检查swt-chart-javadoc是否已安装" - if dnf list installed swt-chart-javadoc &>/dev/null; then - LOG_INFO "swt-chart-javadoc已安装,测试结束后保持安装状态" - installed=true - else - LOG_INFO "swt-chart-javadoc未安装,测试结束后将卸载" - installed=false - fi - - # 检查yum源中是否有swt-chart-javadoc软件包 - LOG_INFO "检查yum源中是否存在swt-chart-javadoc软件包" - if ! dnf list available swt-chart-javadoc &>/dev/null; then - LOG_ERROR "yum源中未找到swt-chart-javadoc软件包" - exit 255 - fi - - # 如果未安装,则安装软件包 - if [ "$installed" = false ]; then - LOG_INFO "安装swt-chart-javadoc软件包" - dnf install -y swt-chart-javadoc - CHECK_RESULT $? 0 0 "安装swt-chart-javadoc失败" - fi - - # 测试chart渲染功能 - LOG_INFO "测试chart渲染功能" - java -jar /path/to/swt-chart-javadoc.jar --render-chart - CHECK_RESULT $? 0 0 "chart渲染功能测试失败" - - # 清理环境 - if [ "$installed" = false ]; then - LOG_INFO "卸载swt-chart-javadoc软件包" - dnf remove -y swt-chart-javadoc - CHECK_RESULT $? 0 0 "卸载swt-chart-javadoc失败" - fi - - LOG_INFO "测试完成,环境已恢复" -} - -main "$@" \ No newline at end of file diff --git a/testcases/function_test/pkg_test/swt-chart/swt-chart-javadoc/test_swt-chart-javadoc_function_resize.sh b/testcases/function_test/pkg_test/swt-chart/swt-chart-javadoc/test_swt-chart-javadoc_function_resize.sh deleted file mode 100644 index d9f514ccbdb..00000000000 --- a/testcases/function_test/pkg_test/swt-chart/swt-chart-javadoc/test_swt-chart-javadoc_function_resize.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-08 -# @License : Mulan PSL v2 -# @Desc : Test chart resizing -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - LOG_INFO "开始测试图表调整功能" - - # 检查软件包是否已安装 - LOG_INFO "检查软件包是否已安装" - if dnf list installed swt-chart-javadoc &>/dev/null; then - LOG_INFO "软件包已安装,测试结束后保持安装状态" - INSTALLED=true - else - LOG_INFO "软件包未安装,测试结束后将卸载" - INSTALLED=false - fi - - # 检查yum源中是否有该软件包 - LOG_INFO "检查yum源中是否有swt-chart-javadoc软件包" - if ! dnf list available swt-chart-javadoc &>/dev/null; then - LOG_ERROR "yum源中未找到swt-chart-javadoc软件包" - exit 255 - fi - - # 安装软件包(如果未安装) - if [ "$INSTALLED" = false ]; then - LOG_INFO "开始安装swt-chart-javadoc软件包" - dnf install -y swt-chart-javadoc - CHECK_RESULT $? 0 0 "安装swt-chart-javadoc失败" - fi - - # 测试图表调整功能 - LOG_INFO "测试图表调整功能" - java -jar /path/to/swt-chart-javadoc.jar resize --width 800 --height 600 - CHECK_RESULT $? 0 0 "图表调整功能测试失败" - - # 清理环境(如果最初未安装) - if [ "$INSTALLED" = false ]; then - LOG_INFO "卸载swt-chart-javadoc软件包" - dnf remove -y swt-chart-javadoc - CHECK_RESULT $? 0 0 "卸载swt-chart-javadoc失败" - fi - - LOG_INFO "测试图表调整功能完成" -} - -main "$@" \ No newline at end of file diff --git a/testcases/function_test/pkg_test/swt-chart/swt-chart-javadoc/test_swt-chart-javadoc_function_style.sh b/testcases/function_test/pkg_test/swt-chart/swt-chart-javadoc/test_swt-chart-javadoc_function_style.sh deleted file mode 100644 index 86175a0dbb1..00000000000 --- a/testcases/function_test/pkg_test/swt-chart/swt-chart-javadoc/test_swt-chart-javadoc_function_style.sh +++ /dev/null @@ -1,72 +0,0 @@ -#!/usr/bin/bash - -# Copyright (c) 2024 ISCAS .ALL rights reserved. -# This program is licensed under Mulan PSL v2. -# You can use it according to the terms and conditions of the Mulan PSL v2. -# http://license.coscl.org.cn/MulanPSL2 -# THIS PROGRAM IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, -# EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, -# MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. -# See the Mulan PSL v2 for more details. - -# ############################################# -# @Author : honghua -# @Contact : honghua@iscas.ac.cn -# @Date : 2025-11-29 -# @License : Mulan PSL v2 -# @Desc : Test chart styling options -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - LOG_INFO "开始测试:Test chart styling options" - - # 检查软件包是否已安装 - LOG_INFO "检查软件包是否已安装" - if dnf list installed swt-chart-javadoc &>/dev/null; then - LOG_INFO "软件包已安装,测试结束后将保持安装状态" - installed=true - else - LOG_INFO "软件包未安装,将在测试结束后卸载" - installed=false - fi - - # 检查yum源中是否有该软件包 - LOG_INFO "检查yum源中是否有swt-chart-javadoc软件包" - if ! dnf list available swt-chart-javadoc &>/dev/null; then - LOG_ERROR "yum源中未找到swt-chart-javadoc软件包" - exit 255 - fi - - # 安装软件包 - if [ "$installed" = false ]; then - LOG_INFO "开始安装swt-chart-javadoc软件包" - dnf install -y swt-chart-javadoc - CHECK_RESULT $? 0 0 "安装swt-chart-javadoc失败" - fi - - # 测试命令参数 - LOG_INFO "测试命令参数" - command_output=$(swt-chart-javadoc --invalid-param 2>&1) - if [[ $command_output == *"unsupported option"* ]]; then - LOG_ERROR "命令参数不支持" - exit 255 - fi - - # 测试命令执行是否成功 - LOG_INFO "测试命令执行是否成功" - swt-chart-javadoc --help &>/dev/null - CHECK_RESULT $? 0 0 "执行swt-chart-javadoc --help失败" - - # 清理环境(如果之前未安装) - if [ "$installed" = false ]; then - LOG_INFO "卸载swt-chart-javadoc软件包" - dnf remove -y swt-chart-javadoc - CHECK_RESULT $? 0 0 "卸载swt-chart-javadoc失败" - fi - - LOG_INFO "测试完成:Test chart styling options" -} - -main "$@" \ No newline at end of file diff --git a/testcases/function_test/pkg_test/swt-chart/swt-chart-javadoc/test_swt-chart-javadoc_function_tooltip.sh b/testcases/function_test/pkg_test/swt-chart/swt-chart-javadoc/test_swt-chart-javadoc_function_tooltip.sh deleted file mode 100644 index e079be5c171..00000000000 --- a/testcases/function_test/pkg_test/swt-chart/swt-chart-javadoc/test_swt-chart-javadoc_function_tooltip.sh +++ /dev/null @@ -1,73 +0,0 @@ -#!/usr/bin/bash - -# Copyright (c) 2024 ISCAS .ALL rights reserved. -# This program is licensed under Mulan PSL v2. -# You can use it according to the terms and conditions of the Mulan PSL v2. -# http://license.coscl.org.cn/MulanPSL2 -# THIS PROGRAM IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, -# EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, -# MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. -# See the Mulan PSL v2 for more details. - -# ############################################# -# @Author : honghua -# @Contact : honghua@iscas.ac.cn -# @Date : 2025-12-08 -# @License : Mulan PSL v2 -# @Desc : Test chart tooltip functionality -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - # 测试脚本开始 - LOG_INFO "开始测试:Test chart tooltip functionality" - - # 检查软件包是否已安装 - LOG_INFO "检查软件包是否已安装" - if dnf list installed swt-chart-javadoc &>/dev/null; then - LOG_INFO "软件包已安装,脚本结束后保持安装状态" - already_installed=true - else - LOG_INFO "软件包未安装,将在测试完成后卸载" - already_installed=false - fi - - # 检查yum源中是否有该软件包 - LOG_INFO "检查yum源中是否有swt-chart-javadoc软件包" - if ! dnf list available swt-chart-javadoc &>/dev/null; then - LOG_ERROR "yum源中未找到swt-chart-javadoc软件包" - exit 255 - fi - - # 安装软件包(如果未安装) - if [ "$already_installed" = false ]; then - LOG_INFO "正在安装swt-chart-javadoc软件包" - dnf install -y swt-chart-javadoc - CHECK_RESULT $? 0 0 "安装swt-chart-javadoc失败" - fi - - # 测试工具提示功能 - LOG_INFO "测试工具提示功能" - command_output=$(swt-chart-javadoc --tooltip) - CHECK_RESULT $? 0 0 "工具提示功能测试失败" - - # 检查命令参数支持情况(示例) - LOG_INFO "检查不支持的参数" - swt-chart-javadoc --invalid-arg &>/dev/null - if [ $? -ne 255 ]; then - LOG_ERROR "不支持的参数未正确退出" - exit 255 - fi - - # 清理环境(如果脚本开始时未安装) - if [ "$already_installed" = false ]; then - LOG_INFO "卸载swt-chart-javadoc软件包" - dnf remove -y swt-chart-javadoc - CHECK_RESULT $? 0 0 "卸载swt-chart-javadoc失败" - fi - - LOG_INFO "测试完成:Test chart tooltip functionality" -} - -main "$@" \ No newline at end of file diff --git a/testcases/function_test/pkg_test/swt-chart/swt-chart-javadoc/test_swt-chart-javadoc_function_update.sh b/testcases/function_test/pkg_test/swt-chart/swt-chart-javadoc/test_swt-chart-javadoc_function_update.sh deleted file mode 100644 index 3c6d900ef71..00000000000 --- a/testcases/function_test/pkg_test/swt-chart/swt-chart-javadoc/test_swt-chart-javadoc_function_update.sh +++ /dev/null @@ -1,83 +0,0 @@ -#!/usr/bin/bash - -# Copyright (c) 2024 ISCAS .ALL rights reserved. -# This program is licensed under Mulan PSL v2. -# You can use it according to the terms and conditions of the Mulan PSL v2. -# http://license.coscl.org.cn/MulanPSL2 -# THIS PROGRAM IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, -# EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, -# MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. -# See the Mulan PSL v2 for more details. - -# ############################################# -# @Author : honghua -# @Contact : honghua@iscas.ac.cn -# @Date : 2025-12-08 -# @License : Mulan PSL v2 -# @Desc : Test chart data update -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - # 测试脚本:test_swt-chart-javadoc_function_update - # 测试用例描述:Test chart data update - - LOG_INFO "开始测试:Test chart data update" - - # 检查软件包是否已安装 - LOG_INFO "检查软件包是否已安装" - dnf list installed swt-chart-javadoc &>/dev/null - if [ $? -eq 0 ]; then - LOG_INFO "软件包已安装,测试结束后保持安装状态" - INSTALLED=true - else - LOG_INFO "软件包未安装,将在测试结束后卸载" - INSTALLED=false - fi - - # 检查yum源中是否有该软件包 - LOG_INFO "检查yum源中是否有swt-chart-javadoc软件包" - dnf list available swt-chart-javadoc &>/dev/null - if [ $? -ne 0 ]; then - LOG_ERROR "yum源中没有swt-chart-javadoc软件包" - exit 255 - fi - - # 安装软件包(如果未安装) - if [ "$INSTALLED" = false ]; then - LOG_INFO "正在安装swt-chart-javadoc软件包" - dnf install -y swt-chart-javadoc &>/dev/null - CHECK_RESULT $? 0 0 "安装swt-chart-javadoc软件包失败" - fi - - # 测试指定命令的参数是否存在或不支持 - LOG_INFO "测试指定命令的参数是否存在或不支持" - command_to_test="swt-chart-javadoc --invalid-arg" # 假设--invalid-arg是无效参数 - $command_to_test &>/dev/null - if [ $? -ne 255 ]; then # 假设无效参数返回255 - LOG_ERROR "命令参数不支持或不存在" - exit 255 - fi - - # 执行命令并检查是否成功执行(假设有效命令为swt-chart-javadoc --update) - LOG_INFO "执行有效命令:swt-chart-javadoc --update" - swt-chart-javadoc --update &>/dev/null - CHECK_RESULT $? 0 0 "执行swt-chart-javadoc --update失败" - - # SSH到第二个服务器执行命令(假设需要) - LOG_INFO "在第二个服务器上执行命令" - SSH_CMD "ls" "$NODE2_IPV4" "$NODE2_PASSWORD" "$NODE2_USER" &>/dev/null - CHECK_RESULT $? 0 0 "在第二个服务器上执行命令失败" - - # 清理环境(如果之前未安装) - if [ "$INSTALLED" = false ]; then - LOG_INFO "正在卸载swt-chart-javadoc软件包" - dnf remove -y swt-chart-javadoc &>/dev/null - CHECK_RESULT $? 0 0 \"卸载swt-chart-javadoc软件包失败\" - fi - - LOG_INFO "测试完成:Test chart data update" -} - -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 "