diff --git a/suite2cases/function_test/pkg_test/auto/auto-common.json b/suite2cases/function_test/pkg_test/auto/auto-common.json index 53aaca3d815..72b242ed668 100644 --- a/suite2cases/function_test/pkg_test/auto/auto-common.json +++ b/suite2cases/function_test/pkg_test/auto/auto-common.json @@ -9,30 +9,6 @@ { "name": "test_auto-common_function_install", "desc": "Test installation of auto-common package" - }, - { - "name": "test_auto-common_function_uninstall", - "desc": "Test uninstallation of auto-common package" - }, - { - "name": "test_auto-common_function_version", - "desc": "Test checking version of auto-common" - }, - { - "name": "test_auto-common_function_config_load", - "desc": "Test loading config file" - }, - { - "name": "test_auto-common_function_logging", - "desc": "Test logging functionality" - }, - { - "name": "test_auto-common_function_util_parse", - "desc": "Test common utility parsing" - }, - { - "name": "test_auto-common_function_cli_basic", - "desc": "Test basic CLI command" } ] } \ No newline at end of file diff --git a/suite2cases/function_test/pkg_test/genwqe-tools/genwqe-zlib.json b/suite2cases/function_test/pkg_test/genwqe-tools/genwqe-zlib.json index 0e0d181846b..85709d97f5d 100644 --- a/suite2cases/function_test/pkg_test/genwqe-tools/genwqe-zlib.json +++ b/suite2cases/function_test/pkg_test/genwqe-tools/genwqe-zlib.json @@ -6,30 +6,6 @@ "name": "test_genwqe-zlib_install", "desc": "测试genwqe-zlib软件包的安装功能", "machine num": 1 - }, - { - "name": "test_genwqe-zlib_function_compress", - "desc": "测试genwqe-zlib的压缩功能" - }, - { - "name": "test_genwqe-zlib_function_install", - "desc": "测试genwqe-zlib软件包的安装功能,确保其能正确安装到系统中" - }, - { - "name": "test_genwqe-zlib_function_decompress", - "desc": "测试genwqe-zlib的解压缩功能,验证其是否能正确还原压缩数据" - }, - { - "name": "test_genwqe-zlib_function_uninstall", - "desc": "测试genwqe-zlib软件包的卸载功能,确保其能被干净地移除" - }, - { - "name": "test_genwqe-zlib_function_version", - "desc": "测试genwqe-zlib版本查询功能,验证其能正确返回版本信息" - }, - { - "name": "test_genwqe-zlib_function_integration", - "desc": "测试genwqe-zlib与系统库的集成,确保其作为加速库能被正常调用" } ] } \ No newline at end of file diff --git a/suite2cases/function_test/pkg_test/kunpengsecl/kunpengsecl-devel.json b/suite2cases/function_test/pkg_test/kunpengsecl/kunpengsecl-devel.json index 00d75959eb3..92c67d6e7fc 100644 --- a/suite2cases/function_test/pkg_test/kunpengsecl/kunpengsecl-devel.json +++ b/suite2cases/function_test/pkg_test/kunpengsecl/kunpengsecl-devel.json @@ -6,10 +6,6 @@ "name": "test_kunpengsecl-devel_install", "desc": "测试软件包 kunpengsecl-devel 的安装功能,验证安装过程是否成功。", "machine num": 1 - }, - { - "name": "test_kunpengsecl-devel_function_config", - "desc": "测试软件包 kunpengsecl-devel 的配置功能,验证配置是否正确加载。" } ] } \ No newline at end of file diff --git a/suite2cases/function_test/pkg_test/lucene/lucene-demo.json b/suite2cases/function_test/pkg_test/lucene/lucene-demo.json index 7703aabe70b..773859e4bf2 100644 --- a/suite2cases/function_test/pkg_test/lucene/lucene-demo.json +++ b/suite2cases/function_test/pkg_test/lucene/lucene-demo.json @@ -5,58 +5,6 @@ { "name": "test_lucene-demo_function_install", "desc": "Test the installation of lucene-demo package" - }, - { - "name": "test_lucene-demo_function_search", - "desc": "Test the search functionality of lucene-demo" - }, - { - "name": "test_lucene-demo_function_index", - "desc": "Test the indexing functionality of lucene-demo" - }, - { - "name": "test_lucene-demo_function_query", - "desc": "Test the query parsing of lucene-demo" - }, - { - "name": "test_lucene-demo_function_score", - "desc": "Test the scoring mechanism of lucene-demo" - }, - { - "name": "test_lucene-demo_function_uninstall", - "desc": "Test uninstallation of lucene-demo package" - }, - { - "name": "test_lucene-demo_function_version", - "desc": "Test checking package version" - }, - { - "name": "test_lucene-demo_function_basic_index", - "desc": "Test creating a basic index" - }, - { - "name": "test_lucene-demo_function_basic_search", - "desc": "Test performing a basic search" - }, - { - "name": "test_lucene-demo_function_update_index", - "desc": "Test updating an existing index" - }, - { - "name": "test_lucene-demo_function_delete_doc", - "desc": "Test deleting a document from index" - }, - { - "name": "test_lucene-demo_function_analyzer", - "desc": "Test text analyzer functionality" - }, - { - "name": "test_lucene-demo_function_query_types", - "desc": "Test different query types" - }, - { - "name": "test_lucene-demo_function_sort_results", - "desc": "Test sorting search results" } ] } \ No newline at end of file diff --git a/suite2cases/function_test/pkg_test/perl-Date-Calc/perl-Date-Calc-help.json b/suite2cases/function_test/pkg_test/perl-Date-Calc/perl-Date-Calc-help.json index 2916451e38e..d50531b6c5f 100644 --- a/suite2cases/function_test/pkg_test/perl-Date-Calc/perl-Date-Calc-help.json +++ b/suite2cases/function_test/pkg_test/perl-Date-Calc/perl-Date-Calc-help.json @@ -9,18 +9,6 @@ { "name": "test_perl-Date-Calc-help_function_check", "desc": "测试验证 perl-Date-Calc-help 软件包是否已正确安装" - }, - { - "name": "test_perl-Date-Calc-help_function_man", - "desc": "测试查看 perl-Date-Calc-help 提供的 man 帮助文档" - }, - { - "name": "test_perl-Date-Calc-help_function_info", - "desc": "测试查询 perl-Date-Calc-help 软件包的基本信息" - }, - { - "name": "test_perl-Date-Calc-help_function_remove", - "desc": "测试卸载 perl-Date-Calc-help 软件包" } ] } \ No newline at end of file diff --git a/suite2cases/function_test/pkg_test/python-httmock/python3-httmock.json b/suite2cases/function_test/pkg_test/python-httmock/python3-httmock.json deleted file mode 100644 index ba1ef3adf14..00000000000 --- a/suite2cases/function_test/pkg_test/python-httmock/python3-httmock.json +++ /dev/null @@ -1,10 +0,0 @@ -{ - "path": "$OET_PATH/testcases/function_test/pkg_test/python-httmock/python3-httmock", - "machine num": 1, - "cases": [ - { - "name": "test_python3-httmock_function_mock", - "desc": "Test basic HTTP mock functionality" - } - ] -} \ No newline at end of file diff --git a/suite2cases/function_test/pkg_test/python-olefile/python3-olefile.json b/suite2cases/function_test/pkg_test/python-olefile/python3-olefile.json index b701ddf7620..173fcf7657b 100644 --- a/suite2cases/function_test/pkg_test/python-olefile/python3-olefile.json +++ b/suite2cases/function_test/pkg_test/python-olefile/python3-olefile.json @@ -2,38 +2,10 @@ "path": "$OET_PATH/testcases/function_test/pkg_test/python-olefile/python3-olefile", "machine num": 1, "cases": [ - { - "name": "test_python3-olefile_function_install", - "desc": "测试python3-olefile软件包能否正常安装" - }, - { - "name": "test_python3-olefile_function_import", - "desc": "测试安装后能否成功导入olefile模块" - }, { "name": "test_python3-olefile_function_olefile_exists", "desc": "测试olefile模块的OleFileIO类是否存在" }, - { - "name": "test_python3-olefile_function_open_ole", - "desc": "测试能否使用OleFileIO打开一个有效的OLE文件" - }, - { - "name": "test_python3-olefile_function_list_streams", - "desc": "测试能否列出OLE文件中的流和存储" - }, - { - "name": "test_python3-olefile_function_read_stream", - "desc": "测试能否从OLE文件的指定流中读取数据" - }, - { - "name": "test_python3-olefile_function_get_metadata", - "desc": "测试能否获取OLE文件的元数据信息" - }, - { - "name": "test_python3-olefile_function_is_olefile", - "desc": "测试isOleFile函数能否正确识别OLE文件" - }, { "name": "test_python3-olefile_function_uninstall", "desc": "测试python3-olefile软件包能否正常卸载" diff --git a/suite2cases/function_test/pkg_test/python-prometheus-client/python-prometheus-client-help.json b/suite2cases/function_test/pkg_test/python-prometheus-client/python-prometheus-client-help.json index aa2e6e16d45..b9e0622343f 100644 --- a/suite2cases/function_test/pkg_test/python-prometheus-client/python-prometheus-client-help.json +++ b/suite2cases/function_test/pkg_test/python-prometheus-client/python-prometheus-client-help.json @@ -2,11 +2,6 @@ "path": "$OET_PATH/testcases/function_test/pkg_test/python-prometheus-client/python-prometheus-client-help", "machine num": 1, "cases": [ - { - "name": "test_python-prometheus-client-help_command_001", - "desc": "测试python-prometheus-client-help包的安装功能,验证软件包能否正常安装。", - "machine num": 1 - }, { "name": "test_python-prometheus-client-help_command_002", "desc": "测试python-prometheus-client-help包的卸载功能,验证软件包能否正常卸载。", @@ -16,26 +11,6 @@ "name": "test_python-prometheus-client-help_command_003", "desc": "测试python-prometheus-client-help包的升级功能,验证软件包能否正常升级。", "machine num": 1 - }, - { - "name": "test_python-prometheus-client-help_command_004", - "desc": "测试python-prometheus-client-help包的降级功能,验证软件包能否正常降级。", - "machine num": 1 - }, - { - "name": "test_python-prometheus-client-help_command_005", - "desc": "测试python-prometheus-client-help包的回退功能,验证软件包能否正常回退到上一个版本。", - "machine num": 1 - }, - { - "name": "test_python-prometheus-client-help_command_006", - "desc": "测试python-prometheus-client-help包的回滚功能,验证软件包能否正常回滚到指定版本。", - "machine num": 1 - }, - { - "name": "test_python-prometheus-client-help_command_007", - "desc": "测试python-prometheus-client-help包的升级回滚功能,验证软件包能否在升级后回滚到升级前的版本。", - "machine num": 1 } ] } \ No newline at end of file diff --git a/suite2cases/function_test/pkg_test/qt5-qtvirtualkeyboard/qt5-qtvirtualkeyboard-examples.json b/suite2cases/function_test/pkg_test/qt5-qtvirtualkeyboard/qt5-qtvirtualkeyboard-examples.json index f373b44cdb4..71672126b60 100644 --- a/suite2cases/function_test/pkg_test/qt5-qtvirtualkeyboard/qt5-qtvirtualkeyboard-examples.json +++ b/suite2cases/function_test/pkg_test/qt5-qtvirtualkeyboard/qt5-qtvirtualkeyboard-examples.json @@ -11,85 +11,6 @@ "name": "test_qt5-qtvirtualkeyboard-examples_uninstall", "desc": "测试qt5-qtvirtualkeyboard-examples包的卸载功能,验证软件包是否能够正常卸载。", "machine num": 1 - }, - { - "name": "test_qt5-qtvirtualkeyboard-examples_upgrade", - "desc": "测试qt5-qtvirtualkeyboard-examples包的升级功能,验证软件包是否能够正常升级。", - "machine num": 1 - }, - { - "name": "test_qt5-qtvirtualkeyboard-examples_downgrade", - "desc": "测试qt5-qtvirtualkeyboard-examples包的降级功能,验证软件包是否能够正常降级。", - "machine num": 1 - }, - { - "name": "test_qt5-qtvirtualkeyboard-examples_rollback", - "desc": "测试qt5-qtvirtualkeyboard-examples包的回滚功能,验证软件包是否能够正常回滚到之前的版本。", - "machine num": 1 - }, - { - "name": "test_qt5-qtvirtualkeyboard-examples_reinstall", - "desc": "测试qt5-qtvirtualkeyboard-examples包的重新安装功能,验证软件包是否能够正常重新安装。", - "machine num": 1 - }, - { - "name": "test_qt5-qtvirtualkeyboard-examples_service_start", - "desc": "测试qt5-qtvirtualkeyboard-examples包的服务启动功能,验证服务是否能够正常启动。", - "machine num": 1 - }, - { - "name": "test_qt5-qtvirtualkeyboard-examples_service_stop", - "desc": "测试qt5-qtvirtualkeyboard-examples包的服务停止功能,验证服务是否能够正常停止。", - "machine num": 1 - }, - { - "name": "test_qt5-qtvirtualkeyboard-examples_service_status", - "desc": "测试qt5-qtvirtualkeyboard-examples包的服务状态查询功能,验证服务是否能够正常查询状态。", - "machine num": 1 - }, - { - "name": "test_qt5-qtvirtualkeyboard-examples_service_log", - "desc": "测试qt5-qtvirtualkeyboard-examples包的服务日志查看功能,验证服务是否能够正常查看日志。", - "machine num": 1 - }, - { - "name": "test_qt5-qtvirtualkeyboard-examples_service_config", - "desc": "测试qt5-qtvirtualkeyboard-examples包的服务配置功能,验证服务是否能够正常配置。", - "machine num": 1 - }, - { - "name": "test_qt5-qtvirtualkeyboard-examples_dependency", - "desc": "测试qt5-qtvirtualkeyboard-examples包的依赖关系,验证软件包是否能够正确识别和满足所有依赖项。", - "machine num": 1 - }, - { - "name": "test_qt5-qtvirtualkeyboard-examples_service_reload", - "desc": "测试qt5-qtvirtualkeyboard-examples包的服务重载功能,验证服务是否能够正常重载配置。", - "machine num": 1 - }, - { - "name": "test_qt5-qtvirtualkeyboard-examples_function_keyboard", - "desc": "Test the keyboard functionality of qt5-qtvirtualkeyboard-examples, verifying if the virtual keyboard works correctly." - }, - { - "name": "test_qt5-qtvirtualkeyboard-examples_function_basic_usage", - "desc": "测试qt5-qtvirtualkeyboard-examples基本示例的启动和显示,验证虚拟键盘示例能否正常启动并显示界面。" - }, - { - "name": "test_qt5-qtvirtualkeyboard-examples_function_input_methods", - "desc": "测试qt5-qtvirtualkeyboard-examples的输入法切换功能,验证虚拟键盘支持不同输入法(如英文、中文)并能正常切换和输入。" - }, - { - "name": "test_qt5-qtvirtualkeyboard-examples_function_layouts", - "desc": "测试qt5-qtvirtualkeyboard-examples的键盘布局切换功能,验证虚拟键盘支持不同布局(如QWERTY、数字键盘)并能正常切换。" - }, - { - "name": "test_qt5-qtvirtualkeyboard-examples_function_theme", - "desc": "测试qt5-qtvirtualkeyboard-examples的主题或样式切换功能,验证虚拟键盘的界面主题可以正常更改。" - }, - { - "name": "test_qt5-qtvirtualkeyboard-examples_function_event_handling", - "desc": "测试qt5-qtvirtualkeyboard-examples的事件处理功能,验证虚拟键盘能正确响应按键点击并生成相应输入事件。" } ] } \ No newline at end of file diff --git a/suite2cases/function_test/pkg_test/rpm/rpm-devel.json b/suite2cases/function_test/pkg_test/rpm/rpm-devel.json index 6c0f27d4490..7e7ed35cf0d 100644 --- a/suite2cases/function_test/pkg_test/rpm/rpm-devel.json +++ b/suite2cases/function_test/pkg_test/rpm/rpm-devel.json @@ -26,14 +26,6 @@ "name": "test_rpm-devel_rpmgraph_nolegacy", "desc": "测试 rpmgraph 命令的 --nolegacy 参数,验证不验证头部和有效载荷签名的功能" }, - { - "name": "test_rpm-devel_rpmgraph_--nolegacy", - "desc": "测试使用 --nolegacy 参数,不验证头部和负载签名" - }, - { - "name": "test_rpm-devel_rpmgraph_--help", - "desc": "测试使用 --help 参数,显示帮助信息" - }, { "name": "test_rpm-devel_rpmgraph_--usage", "desc": "测试使用 --usage 参数,显示简要用法信息" @@ -42,117 +34,17 @@ "name": "test_rpm-devel_rpmgraph_--version", "desc": "测试使用 --version 参数,打印rpm版本" }, - { - "name": "test_rpm-devel_rpmgraph_--querytags", - "desc": "测试使用 --querytags 参数,显示已知的查询标签" - }, - { - "name": "test_rpm-devel_rpmgraph_--showrc", - "desc": "测试使用 --showrc 参数,显示最终的rpmrc和宏配置" - }, - { - "name": "test_rpm-devel_rpmgraph_--quiet", - "desc": "测试使用 --quiet 参数,提供更少的详细信息输出" - }, - { - "name": "test_rpm-devel_rpmgraph__upper_v", - "desc": "测试使用 -v 参数,提供更多的详细信息输出" - }, - { - "name": "test_rpm-devel_rpmgraph__upper_v_--quiet", - "desc": "测试同时使用 -v 和 --quiet 参数,验证参数冲突或优先级" - }, - { - "name": "test_rpm-devel_rpmgraph_--nodigest", - "desc": "测试使用 --nodigest 参数,不验证软件包摘要" - }, - { - "name": "test_rpm-devel_rpmgraph_--nosignature", - "desc": "测试使用 --nosignature 参数,不验证软件包签名" - }, - { - "name": "test_rpm-devel_rpmgraph_--nolegacy_--nodigest", - "desc": "测试同时使用 --nolegacy 和 --nodigest 参数,不验证签名和摘要" - }, - { - "name": "test_rpm-devel_rpmgraph__upper_e", - "desc": "测试使用 -E 参数打印宏扩展" - }, - { - "name": "test_rpm-devel_rpmgraph__upper_d", - "desc": "测试使用 -D 参数定义宏" - }, - { - "name": "test_rpm-devel_rpmgraph_--undefine", - "desc": "测试使用 --undefine 参数取消宏定义" - }, { "name": "test_rpm-devel_rpmgraph_--target", "desc": "测试使用 --target 参数指定目标平台" }, - { - "name": "test_rpm-devel_rpmgraph_--macros", - "desc": "测试使用 --macros 参数指定宏文件" - }, - { - "name": "test_rpm-devel_rpmgraph_--load", - "desc": "测试使用 --load 参数加载单个宏文件" - }, { "name": "test_rpm-devel_rpmgraph_--noplugins", "desc": "测试使用 --noplugins 参数,不启用任何插件" }, - { - "name": "test_rpm-devel_rpmgraph_--rcfile", - "desc": "测试使用 --rcfile 参数指定配置文件" - }, - { - "name": "test_rpm-devel_rpmgraph__r", - "desc": "测试使用 -r 参数指定根目录" - }, - { - "name": "test_rpm-devel_rpmgraph_--dbpath", - "desc": "测试使用 --dbpath 参数指定数据库目录" - }, - { - "name": "test_rpm-devel_function_install", - "desc": "测试安装rpm-devel软件包" - }, { "name": "test_rpm-devel_function_remove", "desc": "测试卸载rpm-devel软件包" - }, - { - "name": "test_rpm-devel_function_query_all", - "desc": "测试查询所有已安装的rpm包" - }, - { - "name": "test_rpm-devel_function_query_file", - "desc": "测试查询文件所属的rpm包" - }, - { - "name": "test_rpm-devel_function_verify", - "desc": "测试验证已安装rpm包完整性" - }, - { - "name": "test_rpm-devel_function_check_install", - "desc": "测试检查rpm-devel是否已安装" - }, - { - "name": "test_rpm-devel_function_list_files", - "desc": "测试列出rpm-devel包内文件" - }, - { - "name": "test_rpm-devel_function_list_info", - "desc": "测试显示rpm-devel包详细信息" - }, - { - "name": "test_rpm-devel_function_check_deps", - "desc": "测试检查rpm-devel包依赖关系" - }, - { - "name": "test_rpm-devel_function_whatprovides", - "desc": "测试查询提供特定功能的包" } ] } \ No newline at end of file diff --git a/suite2cases/function_test/pkg_test/texinfo/texinfo-tex.json b/suite2cases/function_test/pkg_test/texinfo/texinfo-tex.json index 53bd030ffa2..892f9c18f6f 100644 --- a/suite2cases/function_test/pkg_test/texinfo/texinfo-tex.json +++ b/suite2cases/function_test/pkg_test/texinfo/texinfo-tex.json @@ -13,546 +13,6 @@ { "name": "test_texinfo-tex_function_basic", "desc": "Test basic command functionality" - }, - { - "name": "test_texinfo-tex_pdftexi2dvi_h", - "desc": "测试 pdftexi2dvi 的 --help 选项,用于显示帮助信息" - }, - { - "name": "test_texinfo-tex_pdftexi2dvi_v", - "desc": "测试 pdftexi2dvi 的 --version 选项,用于显示版本信息" - }, - { - "name": "test_texinfo-tex_pdftexi2dvi_default", - "desc": "测试 pdftexi2dvi 无额外参数运行一个文件,期望生成 PDF" - }, - { - "name": "test_texinfo-tex_pdftexi2dvi_output", - "desc": "测试 pdftexi2dvi 的 --output 选项,用于指定输出文件名" - }, - { - "name": "test_texinfo-tex_pdftexi2dvi_q", - "desc": "测试 pdftexi2dvi 的 --quiet 选项,用于抑制正常输出" - }, - { - "name": "test_texinfo-tex_pdftexi2dvi_upper_v", - "desc": "测试 pdftexi2dvi 的 --verbose 选项,用于显示详细过程" - }, - { - "name": "test_texinfo-tex_pdftexi2dvi_max_iterations", - "desc": "测试 pdftexi2dvi 的 --max-iterations 选项,用于限制文件处理的最大迭代次数" - }, - { - "name": "test_texinfo-tex_pdftexi2dvi_mostly_clean", - "desc": "测试 pdftexi2dvi 的 --mostly-clean 选项,用于清理以前运行的辅助文件" - }, - { - "name": "test_texinfo-tex_pdftexi2dvi_p", - "desc": "测试 pdftexi2dvi 的 --pdf 选项,用于明确指定生成 PDF 输出" - }, - { - "name": "test_texinfo-tex_pdftexi2dvi_language", - "desc": "测试 pdftexi2dvi 的 --language 选项,用于指定输入文件的处理语言" - }, - { - "name": "test_texinfo-tex_pdftexi2dvi_expand", - "desc": "测试 pdftexi2dvi 的 --expand 选项,用于启用宏扩展" - }, - { - "name": "test_texinfo-tex_pdftexi2dvi_command", - "desc": "测试 pdftexi2dvi 的 --command 选项,用于在输入文件中插入额外命令" - }, - { - "name": "test_texinfo-tex_pdftexi2dvi_tidy", - "desc": "测试 pdftexi2dvi 的 --tidy 选项,用于在独立目录中进行编译并保留辅助文件" - }, - { - "name": "test_texinfo-tex_pdftexi2dvi_c", - "desc": "测试 pdftexi2dvi 的 --clean 选项,用于在独立目录中进行编译并清理辅助文件" - }, - { - "name": "test_texinfo-tex_pdftexi2dvi_build_dir", - "desc": "测试 pdftexi2dvi 的 --build-dir 选项,用于指定编译目录(隐含 --tidy)" - }, - { - "name": "test_texinfo-tex_pdftexi2dvi_expand_quiet", - "desc": "测试 pdftexi2dvi 同时使用 --expand 和 --quiet 选项,确保宏扩展功能与安静模式不冲突" - }, - { - "name": "test_texinfo-tex_pdftexi2dvi_verbose_tidy", - "desc": "测试 pdftexi2dvi 同时使用 --verbose 和 --tidy 选项,用于在整理模式下查看详细过程" - }, - { - "name": "test_texinfo-tex_texi2dvi__h", - "desc": "测试 texi2dvi 命令的 -h 参数,显示帮助信息" - }, - { - "name": "test_texinfo-tex_texi2dvi__v", - "desc": "测试 texi2dvi 命令的 -v 参数,显示版本信息" - }, - { - "name": "test_texinfo-tex_texi2dvi__upper_v", - "desc": "测试 texi2dvi 命令的 -V 参数,详细报告执行过程" - }, - { - "name": "test_texinfo-tex_texi2dvi__q", - "desc": "测试 texi2dvi 命令的 -q 参数,安静模式,仅当错误时输出" - }, - { - "name": "test_texinfo-tex_texi2dvi__upper_d", - "desc": "测试 texi2dvi 命令的 -D 参数,开启 shell 调试模式" - }, - { - "name": "test_texinfo-tex_texi2dvi__o", - "desc": "测试 texi2dvi 命令的 -o 参数,指定输出文件名" - }, - { - "name": "test_texinfo-tex_texi2dvi__p", - "desc": "测试 texi2dvi 命令的 -p 参数,使用 pdftex/pdflatex 处理并生成 PDF 输出" - }, - { - "name": "test_texinfo-tex_texi2dvi__pdf", - "desc": "测试 texi2dvi 命令的 --pdf 参数,使用 pdftex/pdflatex 处理并生成 PDF 输出" - }, - { - "name": "test_texinfo-tex_texi2dvi__dvi", - "desc": "测试 texi2dvi 命令的 --dvi 参数,输出 DVI 文件" - }, - { - "name": "test_texinfo-tex_texi2dvi__dvipdf", - "desc": "测试 texi2dvi 命令的 --dvipdf 参数,通过 DVI 输出 PDF 文件" - }, - { - "name": "test_texinfo-tex_texi2dvi__ps", - "desc": "测试 texi2dvi 命令的 --ps 参数,通过 DVI 输出 PostScript 文件" - }, - { - "name": "test_texinfo-tex_texi2dvi__html", - "desc": "测试 texi2dvi 命令的 --html 参数,使用 HeVeA 从 LaTeX 输出 HTML 文件" - }, - { - "name": "test_texinfo-tex_texi2dvi__info", - "desc": "测试 texi2dvi 命令的 --info 参数,使用 HeVeA 从 LaTeX 输出 Info 文件" - }, - { - "name": "test_texinfo-tex_texi2dvi__text", - "desc": "测试 texi2dvi 命令的 --text 参数,使用 HeVeA 从 LaTeX 输出纯文本文件" - }, - { - "name": "test_texinfo-tex_texi2dvi__upper_e", - "desc": "测试 texi2dvi 命令的 -E 参数,使用 makeinfo 进行宏扩展" - }, - { - "name": "test_texinfo-tex_texi2dvi__l", - "desc": "测试 texi2dvi 命令的 -l 参数,指定输入文件的语言" - }, - { - "name": "test_texinfo-tex_texi2dvi__t", - "desc": "测试 texi2dvi 命令的 -t 参数,在输入文件副本中插入命令" - }, - { - "name": "test_texinfo-tex_texi2dvi__upper_i", - "desc": "测试 texi2dvi 命令的 -I 参数,指定 Texinfo 文件的搜索目录" - }, - { - "name": "test_texinfo-tex_texi2dvi__no_line_error", - "desc": "测试 texi2dvi 命令的 --no-line-error 参数,不传递 --file-line-error 给 TeX" - }, - { - "name": "test_texinfo-tex_texi2dvi__shell_escape", - "desc": "测试 texi2dvi 命令的 --shell-escape 参数,传递 --shell-escape 给 TeX" - }, - { - "name": "test_texinfo-tex_texi2dvi__src_specials", - "desc": "测试 texi2dvi 命令的 --src-specials 参数,传递 --src-specials 给 TeX" - }, - { - "name": "test_texinfo-tex_texi2dvi__translate_file", - "desc": "测试 texi2dvi 命令的 --translate-file 参数,为 TeX 使用指定的字符集翻译文件" - }, - { - "name": "test_texinfo-tex_texi2dvi__mostly_clean", - "desc": "测试 texi2dvi 命令的 --mostly-clean 参数,移除之前运行的辅助文件或目录" - }, - { - "name": "test_texinfo-tex_texi2dvi__c", - "desc": "测试 texi2dvi 命令的 -c 参数,等同于 --build=clean,编译后清理辅助文件" - }, - { - "name": "test_texinfo-tex_texi2dvi__tidy", - "desc": "测试 texi2dvi 命令的 --tidy 参数,等同于 --build=tidy,在本地 *.t2d 目录中编译" - }, - { - "name": "test_texinfo-tex_texi2dvi__build", - "desc": "测试 texi2dvi 命令的 --build 参数,指定辅助文件的处理模式" - }, - { - "name": "test_texinfo-tex_texi2dvi__build_dir", - "desc": "测试 texi2dvi 命令的 --build-dir 参数,指定 tidy 编译的执行目录,并隐含 --tidy" - }, - { - "name": "test_texinfo-tex_texi2dvi__max_iterations", - "desc": "测试 texi2dvi 命令的 --max-iterations 参数,限制文件处理的最大迭代次数" - }, - { - "name": "test_texinfo-tex_texi2pdf_p", - "desc": "测试使用--pdf选项生成PDF输出" - }, - { - "name": "test_texinfo-tex_texi2pdf_q", - "desc": "测试使用--quiet选项在无错误时静默输出" - }, - { - "name": "test_texinfo-tex_texi2pdf_upper_v", - "desc": "测试使用--verbose选项报告详细处理过程" - }, - { - "name": "test_texinfo-tex_texi2pdf_max_iterations", - "desc": "测试使用--max-iterations选项限制最大处理迭代次数" - }, - { - "name": "test_texinfo-tex_texi2pdf_mostly_clean", - "desc": "测试使用--mostly-clean选项清除之前的辅助文件" - }, - { - "name": "test_texinfo-tex_texi2pdf_dvi", - "desc": "测试使用--dvi选项指定输出DVI格式" - }, - { - "name": "test_texinfo-tex_texi2pdf_dvipdf", - "desc": "测试使用--dvipdf选项通过DVI生成PDF" - }, - { - "name": "test_texinfo-tex_texi2pdf_html", - "desc": "测试使用--html选项通过HeVeA生成HTML" - }, - { - "name": "test_texinfo-tex_texi2pdf_info", - "desc": "测试使用--info选项通过HeVeA生成Info" - }, - { - "name": "test_texinfo-tex_texi2pdf_ps", - "desc": "测试使用--ps选项通过DVI生成PostScript" - }, - { - "name": "test_texinfo-tex_texi2pdf_text", - "desc": "测试使用--text选项通过HeVeA生成纯文本" - }, - { - "name": "test_texinfo-tex_texi2pdf_upper_e", - "desc": "测试使用--expand选项通过makeinfo进行宏扩展" - }, - { - "name": "test_texinfo-tex_texi2pdf_upper_i", - "desc": "测试使用-I选项指定Texinfo文件的搜索目录" - }, - { - "name": "test_texinfo-tex_texi2pdf_l", - "desc": "测试使用--language选项指定输入文件的语言" - }, - { - "name": "test_texinfo-tex_texi2pdf_no_line_error", - "desc": "测试使用--no-line-error选项禁止传递--file-line-error给TeX" - }, - { - "name": "test_texinfo-tex_texi2pdf_shell_escape", - "desc": "测试使用--shell-escape选项传递--shell-escape给TeX" - }, - { - "name": "test_texinfo-tex_texi2pdf_src_specials", - "desc": "测试使用--src-specials选项传递--src-specials给TeX" - }, - { - "name": "test_texinfo-tex_texi2pdf_translate_file", - "desc": "测试使用--translate-file选项指定字符集转换文件" - }, - { - "name": "test_texinfo-tex_texi2pdf_t", - "desc": "测试使用--command选项在输入文件副本中插入命令" - }, - { - "name": "test_texinfo-tex_texi2pdf_build", - "desc": "测试使用--build选项指定辅助文件的处理模式" - }, - { - "name": "test_texinfo-tex_texi2pdf_tidy", - "desc": "测试使用--tidy选项以整洁模式编译" - }, - { - "name": "test_texinfo-tex_texi2pdf_c", - "desc": "测试使用--clean选项以清理模式编译" - }, - { - "name": "test_texinfo-tex_texi2pdf_build_dir", - "desc": "测试使用--build-dir选项指定整洁编译的目录" - }, - { - "name": "test_texinfo-tex_texindex_no_arg", - "desc": "测试不带任何参数直接调用texindex命令" - }, - { - "name": "test_texinfo-tex_texindex_help", - "desc": "测试使用--help参数显示帮助信息" - }, - { - "name": "test_texinfo-tex_texindex_version", - "desc": "测试使用--version参数显示版本信息" - }, - { - "name": "test_texinfo-tex_texindex_dash_dash", - "desc": "测试使用--作为参数,表示选项解析结束" - }, - { - "name": "test_texinfo-tex_function_pdf_generate", - "desc": "Test PDF generation from TeX" - }, - { - "name": "test_texinfo-tex_function_dvi_generate", - "desc": "Test DVI generation from TeX" - }, - { - "name": "test_texinfo-tex_function_macro_expand", - "desc": "Test macro expansion with makeinfo" - }, - { - "name": "test_texinfo-tex_function_index_sort", - "desc": "Test sorting index files with texindex" - }, - { - "name": "test_texinfo-tex_function_help", - "desc": "Test help option for main commands" - }, - { - "name": "test_texinfo-tex_function_version", - "desc": "Test version option for main commands" - }, - { - "name": "test_texinfo-tex_function_output_redirect", - "desc": "Test output file redirection" - }, - { - "name": "test_texinfo-tex_function_build_clean", - "desc": "Test clean build mode" - }, - { - "name": "test_texinfo-tex_function_build_tidy", - "desc": "Test tidy build mode" - }, - { - "name": "test_texinfo-tex_pdftexi2dvi_upper_d", - "desc": "测试pdftexi2dvi命令的-D参数,用于开启shell调试模式" - }, - { - "name": "test_texinfo-tex_pdftexi2dvi_o", - "desc": "测试pdftexi2dvi命令的-o参数,用于指定输出文件" - }, - { - "name": "test_texinfo-tex_pdftexi2dvi_upper_e", - "desc": "测试pdftexi2dvi命令的-E参数,用于使用makeinfo进行宏展开" - }, - { - "name": "test_texinfo-tex_pdftexi2dvi_l", - "desc": "测试pdftexi2dvi命令的-l参数,用于指定输入文件的语言" - }, - { - "name": "test_texinfo-tex_pdftexi2dvi_t", - "desc": "测试pdftexi2dvi命令的-t参数,用于在输入文件副本中插入指定命令" - }, - { - "name": "test_texinfo-tex_pdftexi2dvi_upper_i", - "desc": "测试pdftexi2dvi命令的-I参数,用于指定Texinfo文件的搜索目录" - }, - { - "name": "test_texinfo-tex_pdftexi2dvi_dvi", - "desc": "测试pdftexi2dvi命令的--dvi参数,用于生成DVI文件" - }, - { - "name": "test_texinfo-tex_pdftexi2dvi_dvipdf", - "desc": "测试pdftexi2dvi命令的--dvipdf参数,用于通过DVI生成PDF文件" - }, - { - "name": "test_texinfo-tex_pdftexi2dvi_ps", - "desc": "测试pdftexi2dvi命令的--ps参数,用于通过DVI生成PostScript文件" - }, - { - "name": "test_texinfo-tex_pdftexi2dvi_shell_escape", - "desc": "测试pdftexi2dvi命令的--shell-escape参数,用于向TeX传递--shell-escape选项" - }, - { - "name": "test_texinfo-tex_pdftexi2dvi_src_specials", - "desc": "测试pdftexi2dvi命令的--src-specials参数,用于向TeX传递--src-specials选项" - }, - { - "name": "test_texinfo-tex_pdftexi2dvi_no_line_error", - "desc": "测试pdftexi2dvi命令的--no-line-error参数,用于不向TeX传递--file-line-error选项" - }, - { - "name": "test_texinfo-tex_pdftexi2dvi_translate_file", - "desc": "测试pdftexi2dvi命令的--translate-file参数,用于为TeX指定字符集转换文件" - }, - { - "name": "test_texinfo-tex_texi2dvi_h", - "desc": "测试显示帮助信息" - }, - { - "name": "test_texinfo-tex_texi2dvi_v", - "desc": "测试显示版本信息" - }, - { - "name": "test_texinfo-tex_texi2dvi_q", - "desc": "测试静默模式,除非出错否则不输出" - }, - { - "name": "test_texinfo-tex_texi2dvi_upper_v", - "desc": "测试详细模式,报告正在执行的操作" - }, - { - "name": "test_texinfo-tex_texi2dvi_d", - "desc": "测试开启shell调试模式" - }, - { - "name": "test_texinfo-tex_texi2dvi_o", - "desc": "测试指定输出文件名" - }, - { - "name": "test_texinfo-tex_texi2dvi_p", - "desc": "测试使用pdftex或pdflatex处理以生成PDF输出" - }, - { - "name": "test_texinfo-tex_texi2dvi_e", - "desc": "测试使用makeinfo进行宏展开" - }, - { - "name": "test_texinfo-tex_texi2dvi_l", - "desc": "测试指定输入文件的语言" - }, - { - "name": "test_texinfo-tex_texi2dvi_t", - "desc": "测试在输入文件副本中插入指定命令" - }, - { - "name": "test_texinfo-tex_texi2dvi_c", - "desc": "测试清理模式,编译后移除辅助目录" - }, - { - "name": "test_texinfo-tex_texi2dvi_dvi", - "desc": "测试指定输出DVI格式" - }, - { - "name": "test_texinfo-tex_texi2dvi_dvipdf", - "desc": "测试通过DVI生成PDF输出" - }, - { - "name": "test_texinfo-tex_texi2dvi_ps", - "desc": "测试通过DVI生成PostScript输出" - }, - { - "name": "test_texinfo-tex_texi2dvi_html", - "desc": "测试使用HeVeA从LaTeX生成HTML输出" - }, - { - "name": "test_texinfo-tex_texi2dvi_info", - "desc": "测试使用HeVeA从LaTeX生成Info输出" - }, - { - "name": "test_texinfo-tex_texi2dvi_text", - "desc": "测试使用HeVeA从LaTeX生成纯文本输出" - }, - { - "name": "test_texinfo-tex_texi2dvi_no_line_error", - "desc": "测试不向TeX传递--file-line-error选项" - }, - { - "name": "test_texinfo-tex_texi2dvi_shell_escape", - "desc": "测试向TeX传递--shell-escape选项" - }, - { - "name": "test_texinfo-tex_texi2dvi_src_specials", - "desc": "测试向TeX传递--src-specials选项" - }, - { - "name": "test_texinfo-tex_texi2dvi_translate_file", - "desc": "测试为TeX指定字符集翻译文件" - }, - { - "name": "test_texinfo-tex_texi2dvi_build", - "desc": "测试指定构建模式" - }, - { - "name": "test_texinfo-tex_texi2dvi_tidy", - "desc": "测试整洁构建模式" - }, - { - "name": "test_texinfo-tex_texi2dvi_build_dir", - "desc": "测试指定整洁编译的目录" - }, - { - "name": "test_texinfo-tex_texi2dvi_max_iterations", - "desc": "测试设置最大处理迭代次数" - }, - { - "name": "test_texinfo-tex_texi2dvi_mostly_clean", - "desc": "测试移除之前运行的辅助文件或目录" - }, - { - "name": "test_texinfo-tex_texi2dvi_i", - "desc": "测试添加Texinfo文件的搜索目录" - }, - { - "name": "test_texinfo-tex_texi2pdf_help", - "desc": "测试texi2pdf命令的--help选项,查看帮助信息" - }, - { - "name": "test_texinfo-tex_texi2pdf_version", - "desc": "测试texi2pdf命令的--version选项,查看版本信息" - }, - { - "name": "test_texinfo-tex_texi2pdf_quiet", - "desc": "测试texi2pdf命令的--quiet选项,在无错误时抑制输出" - }, - { - "name": "test_texinfo-tex_texi2pdf_verbose", - "desc": "测试texi2pdf命令的--verbose选项,报告详细处理过程" - }, - { - "name": "test_texinfo-tex_texi2pdf_output", - "desc": "测试texi2pdf命令的--output选项,指定输出文件" - }, - { - "name": "test_texinfo-tex_texi2pdf_pdf", - "desc": "测试texi2pdf命令的--pdf选项,生成PDF输出" - }, - { - "name": "test_texinfo-tex_texi2pdf_language", - "desc": "测试texi2pdf命令的--language选项,指定输入文件语言" - }, - { - "name": "test_texinfo-tex_texi2pdf_command", - "desc": "测试texi2pdf命令的--command选项,在输入文件副本中插入命令" - }, - { - "name": "test_texinfo-tex_texi2pdf_expand", - "desc": "测试texi2pdf命令的--expand选项,使用makeinfo进行宏展开" - }, - { - "name": "test_texinfo-tex_texi2pdf_clean", - "desc": "测试texi2pdf命令的--clean选项,等同于--build=clean" - }, - { - "name": "test_texinfo-tex_texindex_h", - "desc": "使用-h参数显示帮助信息" - }, - { - "name": "test_texinfo-tex_texindex_end_option", - "desc": "使用--参数结束选项处理" - }, - { - "name": "test_texinfo-tex_texindex_no_option", - "desc": "不带任何选项处理一个文件" - }, - { - "name": "test_texinfo-tex_texindex_wildcard", - "desc": "使用通配符处理多个文件" } ] } \ No newline at end of file diff --git a/suite2cases/function_test/pkg_test/texlive-base/texlive-pst-pdf.json b/suite2cases/function_test/pkg_test/texlive-base/texlive-pst-pdf.json deleted file mode 100644 index 3e98f33eeec..00000000000 --- a/suite2cases/function_test/pkg_test/texlive-base/texlive-pst-pdf.json +++ /dev/null @@ -1,54 +0,0 @@ -{ - "path": "$OET_PATH/testcases/function_test/pkg_test/texlive-base/texlive-pst-pdf", - "machine num": 1, - "cases": [ - { - "name": "test_texlive-pst-pdf_ps4pdf__v", - "desc": "测试 ps4pdf 命令的 -v 参数" - }, - { - "name": "test_texlive-pst-pdf_ps4pdf__q", - "desc": "测试 ps4pdf 命令的 -q 参数" - }, - { - "name": "test_texlive-pst-pdf_ps4pdf__crop", - "desc": "测试 ps4pdf 命令的 --crop 参数" - }, - { - "name": "test_texlive-pst-pdf_ps4pdf__version", - "desc": "测试 ps4pdf 命令的 --version 参数" - }, - { - "name": "test_texlive-pst-pdf_ps4pdf__Xps2pdf", - "desc": "测试 ps4pdf 命令的 --Xps2pdf OPT 参数" - }, - { - "name": "test_texlive-pst-pdf_ps4pdf__lualatex", - "desc": "测试 ps4pdf 命令的 --lualatex 参数" - }, - { - "name": "test_texlive-pst-pdf_ps4pdf__xelatex", - "desc": "测试 ps4pdf 命令的 --xelatex 参数" - }, - { - "name": "test_texlive-pst-pdf_function_basic", - "desc": "测试基本功能是否正常" - }, - { - "name": "test_texlive-pst-pdf_function_install", - "desc": "测试软件包是否已正确安装" - }, - { - "name": "test_texlive-pst-pdf_function_usage", - "desc": "测试使用pst-pdf宏包生成PDF" - }, - { - "name": "test_texlive-pst-pdf_function_compile", - "desc": "测试带pst-pdf的LaTeX编译流程" - }, - { - "name": "test_texlive-pst-pdf_function_uninstall", - "desc": "测试软件包卸载功能" - } - ] -} \ No newline at end of file diff --git a/suite2cases/function_test/pkg_test/texlive-split-a/texlive-apptools.json b/suite2cases/function_test/pkg_test/texlive-split-a/texlive-apptools.json deleted file mode 100644 index 2da5157bb3d..00000000000 --- a/suite2cases/function_test/pkg_test/texlive-split-a/texlive-apptools.json +++ /dev/null @@ -1,30 +0,0 @@ -{ - "path": "$OET_PATH/testcases/function_test/pkg_test/texlive-split-a/texlive-apptools", - "machine num": 1, - "cases": [ - { - "name": "test_texlive-apptools_function_basic", - "desc": "Test basic functionality of texlive-apptools" - }, - { - "name": "test_texlive-apptools_function_install", - "desc": "Test installation of texlive-apptools package" - }, - { - "name": "test_texlive-apptools_function_uninstall", - "desc": "Test uninstallation of texlive-apptools package" - }, - { - "name": "test_texlive-apptools_function_version", - "desc": "Test checking version of texlive-apptools" - }, - { - "name": "test_texlive-apptools_function_help", - "desc": "Test displaying help or usage information" - }, - { - "name": "test_texlive-apptools_function_basic_cmd", - "desc": "Test execution of basic provided commands" - } - ] -} \ No newline at end of file diff --git a/suite2cases/function_test/pkg_test/texlive-split-d/texlive-canoniclayout.json b/suite2cases/function_test/pkg_test/texlive-split-d/texlive-canoniclayout.json index 6c869cdb20b..aa7d44fa23b 100644 --- a/suite2cases/function_test/pkg_test/texlive-split-d/texlive-canoniclayout.json +++ b/suite2cases/function_test/pkg_test/texlive-split-d/texlive-canoniclayout.json @@ -17,10 +17,6 @@ { "name": "test_texlive-canoniclayout_function_listfiles", "desc": "Test listing package files" - }, - { - "name": "test_texlive-canoniclayout_function_usage", - "desc": "Test basic package usage in TeX" } ] } \ No newline at end of file diff --git a/suite2cases/function_test/pkg_test/texlive-split-h/texlive-ecclesiastic.json b/suite2cases/function_test/pkg_test/texlive-split-h/texlive-ecclesiastic.json deleted file mode 100644 index 1e3e570dfa1..00000000000 --- a/suite2cases/function_test/pkg_test/texlive-split-h/texlive-ecclesiastic.json +++ /dev/null @@ -1,10 +0,0 @@ -{ - "path": "$OET_PATH/testcases/function_test/pkg_test/texlive-split-h/texlive-ecclesiastic", - "machine num": 1, - "cases": [ - { - "name": "test_texlive-ecclesiastic_function_install", - "desc": "Test package installation" - } - ] -} \ No newline at end of file diff --git a/suite2cases/function_test/pkg_test/texlive-split-n/texlive-ladder.json b/suite2cases/function_test/pkg_test/texlive-split-n/texlive-ladder.json deleted file mode 100644 index 7f79bea2e23..00000000000 --- a/suite2cases/function_test/pkg_test/texlive-split-n/texlive-ladder.json +++ /dev/null @@ -1,14 +0,0 @@ -{ - "path": "$OET_PATH/testcases/function_test/pkg_test/texlive-split-n/texlive-ladder", - "machine num": 1, - "cases": [ - { - "name": "test_texlive-ladder_function_install", - "desc": "Test package installation" - }, - { - "name": "test_texlive-ladder_function_basic", - "desc": "Test basic command usage" - } - ] -} \ No newline at end of file diff --git a/suite2cases/function_test/pkg_test/texlive-split-o/texlive-mceinleger.json b/suite2cases/function_test/pkg_test/texlive-split-o/texlive-mceinleger.json index 7e89963892f..a0f6cdfccef 100644 --- a/suite2cases/function_test/pkg_test/texlive-split-o/texlive-mceinleger.json +++ b/suite2cases/function_test/pkg_test/texlive-split-o/texlive-mceinleger.json @@ -2,25 +2,9 @@ "path": "$OET_PATH/testcases/function_test/pkg_test/texlive-split-o/texlive-mceinleger", "machine num": 1, "cases": [ - { - "name": "test_texlive-mceinleger_function_install", - "desc": "Test installation of texlive-mceinleger" - }, { "name": "test_texlive-mceinleger_function_check_installed", "desc": "Check if texlive-mceinleger is installed in the system" - }, - { - "name": "test_texlive-mceinleger_function_verify_content", - "desc": "Verify the package provides expected LaTeX files" - }, - { - "name": "test_texlive-mceinleger_function_basic_usage", - "desc": "Test basic LaTeX document compilation using the package" - }, - { - "name": "test_texlive-mceinleger_function_package_removal", - "desc": "Test removal/uninstallation of texlive-mceinleger" } ] } \ No newline at end of file diff --git a/suite2cases/function_test/pkg_test/texlive-split-v/texlive-steinmetz-doc.json b/suite2cases/function_test/pkg_test/texlive-split-v/texlive-steinmetz-doc.json index 8a001f24243..99c6e3238d1 100644 --- a/suite2cases/function_test/pkg_test/texlive-split-v/texlive-steinmetz-doc.json +++ b/suite2cases/function_test/pkg_test/texlive-split-v/texlive-steinmetz-doc.json @@ -6,21 +6,9 @@ "name": "test_texlive-steinmetz-doc_function_install", "desc": "Test package installation" }, - { - "name": "test_texlive-steinmetz-doc_function_verify_installed", - "desc": "Verify package is correctly installed" - }, { "name": "test_texlive-steinmetz-doc_function_list_files", "desc": "List installed documentation files" - }, - { - "name": "test_texlive-steinmetz-doc_function_view_doc", - "desc": "Check documentation content accessibility" - }, - { - "name": "test_texlive-steinmetz-doc_function_uninstall", - "desc": "Test package removal" } ] } \ No newline at end of file diff --git a/suite2cases/function_test/pkg_test/texlive-split-y/texlive-tetragonos.json b/suite2cases/function_test/pkg_test/texlive-split-y/texlive-tetragonos.json deleted file mode 100644 index 6ff961e3814..00000000000 --- a/suite2cases/function_test/pkg_test/texlive-split-y/texlive-tetragonos.json +++ /dev/null @@ -1,10 +0,0 @@ -{ - "path": "$OET_PATH/testcases/function_test/pkg_test/texlive-split-y/texlive-tetragonos", - "machine num": 1, - "cases": [ - { - "name": "test_texlive-tetragonos_function_basic", - "desc": "Test basic functionality of texlive-tetragonos" - } - ] -} \ No newline at end of file diff --git a/suite2cases/function_test/pkg_test/texlive-split-z/texlive-nanicolle.json b/suite2cases/function_test/pkg_test/texlive-split-z/texlive-nanicolle.json index 6ba4c652c21..be9c9d3437c 100644 --- a/suite2cases/function_test/pkg_test/texlive-split-z/texlive-nanicolle.json +++ b/suite2cases/function_test/pkg_test/texlive-split-z/texlive-nanicolle.json @@ -5,18 +5,6 @@ { "name": "test_texlive-nanicolle_function_uninstall", "desc": "Test package removal" - }, - { - "name": "test_texlive-nanicolle_function_install", - "desc": "Test package installation" - }, - { - "name": "test_texlive-nanicolle_function_verify", - "desc": "Test package presence and integrity" - }, - { - "name": "test_texlive-nanicolle_function_usage", - "desc": "Test basic package usage in LaTeX" } ] } \ No newline at end of file diff --git a/suite2cases/function_test/pkg_test/xxhash-devel/xxhash-devel.json b/suite2cases/function_test/pkg_test/xxhash-devel/xxhash-devel.json deleted file mode 100644 index 49c60e45dbf..00000000000 --- a/suite2cases/function_test/pkg_test/xxhash-devel/xxhash-devel.json +++ /dev/null @@ -1,18 +0,0 @@ -{ - "path": "$OET_PATH/testcases/function_test/pkg_test/xxhash-devel/xxhash-devel", - "machine num": 1, - "cases": [ - { - "name": "test_xxhash-devel_function_install", - "desc": "测试xxhash-devel软件包的安装功能是否正常。" - }, - { - "name": "test_xxhash-devel_function_header_exist", - "desc": "测试安装后,开发头文件(如xxhash.h)是否已正确安装到系统目录。" - }, - { - "name": "test_xxhash-devel_function_uninstall", - "desc": "测试xxhash-devel软件包的卸载功能是否正常,确认相关文件被移除。" - } - ] -} \ No newline at end of file diff --git a/testcases/function_test/pkg_test/auto/auto-common/test_auto-common_function_cli_basic.sh b/testcases/function_test/pkg_test/auto/auto-common/test_auto-common_function_cli_basic.sh deleted file mode 100644 index 98d393de14b..00000000000 --- a/testcases/function_test/pkg_test/auto/auto-common/test_auto-common_function_cli_basic.sh +++ /dev/null @@ -1,87 +0,0 @@ -#!/usr/bin/bash - -# Copyright (c) 2024 ISCAS .ALL rights reserved. -# This program is licensed under Mulan PSL v2. -# You can use it according to the terms and conditions of the Mulan PSL v2. -# http://license.coscl.org.cn/MulanPSL2 -# THIS PROGRAM IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, -# EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, -# MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. -# See the Mulan PSL v2 for more details. - -# ############################################# -# @Author : honghua -# @Contact : honghua@iscas.ac.cn -# @Date : 2026-03-15 -# @License : Mulan PSL v2 -# @Desc : Test basic CLI command -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - LOG_INFO "开始测试: Test basic CLI command" - - # 检查是否已安装软件包 - LOG_INFO "检查是否已安装测试软件包" - if dnf list installed test-package &>/dev/null; then - LOG_INFO "测试软件包已安装,脚本结束后将保持安装状态" - INSTALLED_BEFORE=true - else - LOG_INFO "测试软件包未安装,将在测试步骤中安装" - INSTALLED_BEFORE=false - fi - - # 检查yum源中是否有该软件包 - LOG_INFO "检查yum源中是否有test-package软件包" - if ! dnf list available test-package &>/dev/null; then - LOG_ERROR "yum源中未找到test-package软件包" - exit 255 - fi - - # 如果未安装则安装软件包 - if [ "$INSTALLED_BEFORE" = false ]; then - LOG_INFO "安装test-package软件包" - dnf install -y test-package - CHECK_RESULT $? 0 0 "安装test-package失败" - fi - - # 测试基本CLI命令 - LOG_INFO "测试基本CLI命令" - test-command --help - CHECK_RESULT $? 0 0 "test-command --help命令执行失败" - - # 测试带参数的命令 - LOG_INFO "测试带有效参数的CLI命令" - test-command --version - CHECK_RESULT $? 0 0 "test-command --version命令执行失败" - - # 测试不支持的参数 - LOG_INFO "测试不支持的参数" - test-command --invalid-param 2>/dev/null - if [ $? -eq 255 ]; then - LOG_ERROR "不支持的参数导致命令退出码为255" - exit 255 - fi - - # 测试多服务器场景(如果需要) - if [ -n "$NODE2_IPV4" ] && [ -n "$NODE2_PASSWORD" ] && [ -n "$NODE2_USER" ]; then - LOG_INFO "在第二个服务器上执行命令" - SSH_CMD "ls /tmp" "$NODE2_IPV4" "$NODE2_PASSWORD" "$NODE2_USER" - CHECK_RESULT $? 0 0 "在第二个服务器上执行命令失败" - fi - - # 环境清理 - LOG_INFO "清理测试环境" - if [ "$INSTALLED_BEFORE" = false ]; then - LOG_INFO "卸载测试期间安装的软件包" - dnf remove -y test-package - CHECK_RESULT $? 0 0 "卸载test-package失败" - else - LOG_INFO "保持软件包安装状态" - fi - - LOG_INFO "测试完成: Test basic CLI command" -} - -main "$@" \ No newline at end of file diff --git a/testcases/function_test/pkg_test/auto/auto-common/test_auto-common_function_config_load.sh b/testcases/function_test/pkg_test/auto/auto-common/test_auto-common_function_config_load.sh deleted file mode 100644 index 23a0543e476..00000000000 --- a/testcases/function_test/pkg_test/auto/auto-common/test_auto-common_function_config_load.sh +++ /dev/null @@ -1,150 +0,0 @@ -#!/usr/bin/bash - -# Copyright (c) 2024 ISCAS .ALL rights reserved. -# This program is licensed under Mulan PSL v2. -# You can use it according to the terms and conditions of the Mulan PSL v2. -# http://license.coscl.org.cn/MulanPSL2 -# THIS PROGRAM IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, -# EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, -# MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. -# See the Mulan PSL v2 for more details. - -# ############################################# -# @Author : honghua -# @Contact : honghua@iscas.ac.cn -# @Date : 2026-03-15 -# @License : Mulan PSL v2 -# @Desc : Test loading config file -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - # 定义变量 - TEST_PACKAGE="auto-common-function-config-load" - CONFIG_FILE="/etc/auto-common-function/config.conf" - LOG_FILE="/var/log/test_auto-common-function-config-load.log" - - # 日志函数 - LOG_INFO() { - echo "[INFO] $1" | tee -a $LOG_FILE - } - - LOG_ERROR() { - echo "[ERROR] $1" | tee -a $LOG_FILE - } - - # 检查软件包是否在yum源中存在 - check_package_in_repo() { - LOG_INFO "检查yum源中是否存在软件包 $TEST_PACKAGE" - dnf list available $TEST_PACKAGE 2>/dev/null | grep -q $TEST_PACKAGE - if [ $? -ne 0 ]; then - LOG_ERROR "yum源中不存在软件包 $TEST_PACKAGE" - exit 255 - fi - LOG_INFO "软件包 $TEST_PACKAGE 存在于yum源中" - } - - # 检查命令参数 - check_command_param() { - local cmd=$1 - local param=$2 - LOG_INFO "检查命令 $cmd 是否支持参数 $param" - $cmd --help 2>&1 | grep -q -- "$param" - if [ $? -ne 0 ]; then - LOG_ERROR "命令 $cmd 不支持参数 $param" - exit 255 - fi - LOG_INFO "命令 $cmd 支持参数 $param" - } - - # 安装软件包 - install_package() { - LOG_INFO "安装软件包 $TEST_PACKAGE" - dnf install -y $TEST_PACKAGE - CHECK_RESULT $? 0 0 "安装软件包 $TEST_PACKAGE 失败" - LOG_INFO "软件包 $TEST_PACKAGE 安装成功" - } - - # 卸载软件包 - uninstall_package() { - LOG_INFO "卸载软件包 $TEST_PACKAGE" - dnf remove -y $TEST_PACKAGE - CHECK_RESULT $? 0 0 "卸载软件包 $TEST_PACKAGE 失败" - LOG_INFO "软件包 $TEST_PACKAGE 卸载成功" - } - - # 检查配置文件加载 - test_config_load() { - LOG_INFO "测试配置文件加载功能" - if [ -f $CONFIG_FILE ]; then - LOG_INFO "配置文件 $CONFIG_FILE 存在,尝试加载" - auto-common-function-config-load --config $CONFIG_FILE - CHECK_RESULT $? 0 0 "加载配置文件 $CONFIG_FILE 失败" - LOG_INFO "配置文件 $CONFIG_FILE 加载成功" - else - LOG_INFO "配置文件 $CONFIG_FILE 不存在,创建测试配置文件" - mkdir -p /etc/auto-common-function - echo "test_key=test_value" > $CONFIG_FILE - auto-common-function-config-load --config $CONFIG_FILE - CHECK_RESULT $? 0 0 "加载新创建的配置文件 $CONFIG_FILE 失败" - LOG_INFO "新创建的配置文件 $CONFIG_FILE 加载成功" - fi - } - - # 主函数 - main() { - LOG_INFO "开始测试: Test loading config file" - - # 检查yum源中是否存在软件包 - check_package_in_repo - - # 检查命令参数 - check_command_param "auto-common-function-config-load" "--config" - - # 检查是否已安装软件包 - LOG_INFO "检查软件包 $TEST_PACKAGE 是否已安装" - rpm -q $TEST_PACKAGE > /dev/null 2>&1 - local installed=$? - - if [ $installed -ne 0 ]; then - LOG_INFO "软件包 $TEST_PACKAGE 未安装,将进行安装" - install_package - local need_uninstall=1 - else - LOG_INFO "软件包 $TEST_PACKAGE 已安装" - local need_uninstall=0 - fi - - # 执行测试 - test_config_load - - # 清理环境 - LOG_INFO "清理测试环境" - if [ -f $CONFIG_FILE ] && [ $installed -eq 0 ]; then - # 如果之前已安装,保留配置文件 - LOG_INFO "保留配置文件 $CONFIG_FILE" - else - # 如果之前未安装,删除测试创建的配置文件 - if [ -f $CONFIG_FILE ]; then - rm -f $CONFIG_FILE - LOG_INFO "删除测试配置文件 $CONFIG_FILE" - fi - if [ -d /etc/auto-common-function ]; then - rmdir /etc/auto-common-function 2>/dev/null - fi - fi - - # 如果测试前未安装,测试后卸载软件包 - if [ $need_uninstall -eq 1 ]; then - uninstall_package - fi - - LOG_INFO "测试完成: Test loading config file" - } - - # 执行主函数 - main -} - -main "$@" \ No newline at end of file diff --git a/testcases/function_test/pkg_test/auto/auto-common/test_auto-common_function_logging.sh b/testcases/function_test/pkg_test/auto/auto-common/test_auto-common_function_logging.sh deleted file mode 100644 index edf38f94b65..00000000000 --- a/testcases/function_test/pkg_test/auto/auto-common/test_auto-common_function_logging.sh +++ /dev/null @@ -1,186 +0,0 @@ -#!/usr/bin/bash - -# Copyright (c) 2024 ISCAS .ALL rights reserved. -# This program is licensed under Mulan PSL v2. -# You can use it according to the terms and conditions of the Mulan PSL v2. -# http://license.coscl.org.cn/MulanPSL2 -# THIS PROGRAM IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, -# EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, -# MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. -# See the Mulan PSL v2 for more details. - -# ############################################# -# @Author : honghua -# @Contact : honghua@iscas.ac.cn -# @Date : 2026-03-15 -# @License : Mulan PSL v2 -# @Desc : Test logging functionality -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - # 测试日志功能 - LOG_INFO "开始测试日志功能" - - # 定义软件包名称 - PACKAGE_NAME="auto-common-function-logging" - TEST_PACKAGE_NAME="auto-common-function-logging-test" - - # 检查软件包是否在yum源中 - LOG_INFO "检查软件包是否在yum源中" - dnf list available $PACKAGE_NAME &>/dev/null - if [ $? -ne 0 ]; then - LOG_ERROR "软件包 $PACKAGE_NAME 不在yum源中" - exit 255 - fi - - # 检查测试软件包是否在yum源中 - dnf list available $TEST_PACKAGE_NAME &>/dev/null - if [ $? -ne 0 ]; then - LOG_ERROR "软件包 $TEST_PACKAGE_NAME 不在yum源中" - exit 255 - fi - - # 检查当前是否已安装软件包 - LOG_INFO "检查软件包是否已安装" - rpm -q $PACKAGE_NAME &>/dev/null - PACKAGE_INSTALLED=$? - - rpm -q $TEST_PACKAGE_NAME &>/dev/null - TEST_PACKAGE_INSTALLED=$? - - # 记录初始安装状态 - INITIAL_INSTALL=0 - if [ $PACKAGE_INSTALLED -eq 0 ] && [ $TEST_PACKAGE_INSTALLED -eq 0 ]; then - INITIAL_INSTALL=1 - LOG_INFO "软件包已安装,测试结束后将保持安装状态" - else - LOG_INFO "软件包未安装,将进行安装测试" - fi - - # 如果未安装,则安装软件包 - if [ $INITIAL_INSTALL -eq 0 ]; then - LOG_INFO "安装软件包" - dnf install -y $PACKAGE_NAME $TEST_PACKAGE_NAME - CHECK_RESULT $? 0 0 "安装软件包失败" - - # 验证安装 - rpm -q $PACKAGE_NAME - CHECK_RESULT $? 0 0 "软件包 $PACKAGE_NAME 未正确安装" - - rpm -q $TEST_PACKAGE_NAME - CHECK_RESULT $? 0 0 "软件包 $TEST_PACKAGE_NAME 未正确安装" - fi - - # 测试日志功能 - LOG_INFO "测试基本日志功能" - - # 检查日志命令是否存在 - LOG_INFO "检查日志命令是否可用" - which logtest &>/dev/null - if [ $? -ne 0 ]; then - LOG_ERROR "日志测试命令不存在" - if [ $INITIAL_INSTALL -eq 0 ]; then - LOG_INFO "清理环境:卸载软件包" - dnf remove -y $PACKAGE_NAME $TEST_PACKAGE_NAME - fi - exit 255 - fi - - # 测试日志命令的基本功能 - LOG_INFO "执行日志测试命令" - logtest --help &>/dev/null - CHECK_RESULT $? 0 0 "日志测试命令帮助信息获取失败" - - # 测试日志级别参数 - LOG_INFO "测试日志级别参数" - logtest --level info "测试信息日志" &>/dev/null - CHECK_RESULT $? 0 0 "信息日志级别测试失败" - - logtest --level error "测试错误日志" &>/dev/null - CHECK_RESULT $? 0 0 "错误日志级别测试失败" - - # 测试无效参数 - LOG_INFO "测试无效参数处理" - logtest --invalid-param &>/dev/null - if [ $? -ne 255 ] && [ $? -ne 1 ]; then - LOG_ERROR "无效参数处理不符合预期" - if [ $INITIAL_INSTALL -eq 0 ]; then - LOG_INFO "清理环境:卸载软件包" - dnf remove -y $PACKAGE_NAME $TEST_PACKAGE_NAME - fi - exit 255 - fi - - # 测试日志文件输出 - LOG_INFO "测试日志文件输出" - TEST_LOG_FILE="/tmp/test_log_$(date +%s).log" - logtest --level info --output $TEST_LOG_FILE "测试文件输出" &>/dev/null - CHECK_RESULT $? 0 0 "日志文件输出测试失败" - - # 检查日志文件是否存在且包含内容 - if [ -f "$TEST_LOG_FILE" ]; then - LOG_INFO "日志文件创建成功" - FILE_SIZE=$(stat -c%s "$TEST_LOG_FILE" 2>/dev/null || stat -f%z "$TEST_LOG_FILE" 2>/dev/null) - if [ $FILE_SIZE -gt 0 ]; then - LOG_INFO "日志文件包含内容" - else - LOG_ERROR "日志文件为空" - fi - # 清理测试日志文件 - rm -f $TEST_LOG_FILE - else - LOG_ERROR "日志文件未创建" - fi - - # 在多节点环境下测试(如果定义了相关变量) - LOG_INFO "测试多节点日志功能" - if [ -n "$NODE2_IPV4" ] && [ -n "$NODE2_PASSWORD" ] && [ -n "$NODE2_USER" ]; then - SSH_CMD "which logtest" $NODE2_IPV4 $NODE2_PASSWORD $NODE2_USER - if [ $? -eq 0 ]; then - LOG_INFO "在节点2上测试日志功能" - SSH_CMD "logtest --level info "远程节点测试"" $NODE2_IPV4 $NODE2_PASSWORD $NODE2_USER - CHECK_RESULT $? 0 0 "远程节点日志测试失败" - else - LOG_INFO "节点2未安装日志测试工具,跳过远程测试" - fi - else - LOG_INFO "未配置多节点环境,跳过远程测试" - fi - - # 环境清理 - LOG_INFO "开始环境清理" - - # 如果测试前未安装,则卸载软件包 - if [ $INITIAL_INSTALL -eq 0 ]; then - LOG_INFO "卸载测试安装的软件包" - dnf remove -y $PACKAGE_NAME $TEST_PACKAGE_NAME - CHECK_RESULT $? 0 0 "卸载软件包失败" - - # 验证卸载 - rpm -q $PACKAGE_NAME &>/dev/null - if [ $? -eq 0 ]; then - LOG_ERROR "软件包 $PACKAGE_NAME 卸载失败" - exit 1 - fi - - rpm -q $TEST_PACKAGE_NAME &>/dev/null - if [ $? -eq 0 ]; then - LOG_ERROR "软件包 $TEST_PACKAGE_NAME 卸载失败" - exit 1 - fi - - LOG_INFO "软件包卸载成功,环境已恢复" - else - LOG_INFO "保持软件包安装状态,不进行卸载" - fi - - # 清理临时文件 - LOG_INFO "清理临时文件" - rm -f /tmp/test_log_*.log 2>/dev/null - - LOG_INFO "日志功能测试完成" -} - -main "$@" \ No newline at end of file diff --git a/testcases/function_test/pkg_test/auto/auto-common/test_auto-common_function_uninstall.sh b/testcases/function_test/pkg_test/auto/auto-common/test_auto-common_function_uninstall.sh deleted file mode 100644 index 850aac38c85..00000000000 --- a/testcases/function_test/pkg_test/auto/auto-common/test_auto-common_function_uninstall.sh +++ /dev/null @@ -1,81 +0,0 @@ -#!/usr/bin/bash - -# Copyright (c) 2024 ISCAS .ALL rights reserved. -# This program is licensed under Mulan PSL v2. -# You can use it according to the terms and conditions of the Mulan PSL v2. -# http://license.coscl.org.cn/MulanPSL2 -# THIS PROGRAM IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, -# EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, -# MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. -# See the Mulan PSL v2 for more details. - -# ############################################# -# @Author : honghua -# @Contact : honghua@iscas.ac.cn -# @Date : 2026-03-15 -# @License : Mulan PSL v2 -# @Desc : Test uninstallation of auto-common package -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - LOG_INFO "开始测试:卸载auto-common软件包" - - # 检查yum源中是否存在auto-common软件包 - LOG_INFO "检查yum源中是否存在auto-common软件包" - dnf list available auto-common > /dev/null 2>&1 - if [ $? -ne 0 ]; then - LOG_ERROR "yum源中不存在auto-common软件包" - exit 255 - fi - - # 检查当前环境是否已安装auto-common - LOG_INFO "检查当前环境是否已安装auto-common" - rpm -q auto-common > /dev/null 2>&1 - if [ $? -eq 0 ]; then - LOG_INFO "环境已安装auto-common,测试结束后保持安装状态" - INSTALLED=1 - else - LOG_INFO "环境未安装auto-common,将进行安装和卸载测试" - INSTALLED=0 - # 安装auto-common软件包 - LOG_INFO "安装auto-common软件包" - dnf install -y auto-common - CHECK_RESULT $? 0 0 "安装auto-common失败" - fi - - # 模拟测试场景:检查auto-common的某个命令或功能 - LOG_INFO "测试auto-common的某个功能" - # 假设auto-common提供了一个命令auto-common-version,这里检查其是否存在 - LOG_INFO "检查auto-common-version命令是否存在" - auto-common-version --help > /dev/null 2>&1 - if [ $? -ne 0 ]; then - LOG_ERROR "auto-common-version命令不存在或不支持" - exit 255 - fi - - # 执行命令并检查结果 - LOG_INFO "执行auto-common-version命令" - auto-common-version - CHECK_RESULT $? 0 0 "执行auto-common-version失败" - - # 如果需要第二个服务器操作,示例: - # LOG_INFO "在第二个服务器上执行命令" - # SSH_CMD "ls" $NODE2_IPV4 $NODE2_PASSWORD $NODE2_USER - # CHECK_RESULT $? 0 0 "在第二个服务器上执行命令失败" - - # 环境清理:如果测试前未安装,则卸载软件包 - if [ $INSTALLED -eq 0 ]; then - LOG_INFO "卸载auto-common软件包" - dnf remove -y auto-common - CHECK_RESULT $? 0 0 "卸载auto-common失败" - LOG_INFO "环境已恢复到未安装auto-common的状态" - else - LOG_INFO "环境保持已安装auto-common的状态" - fi - - LOG_INFO "测试完成:卸载auto-common软件包" -} - -main "$@" \ No newline at end of file diff --git a/testcases/function_test/pkg_test/auto/auto-common/test_auto-common_function_util_parse.sh b/testcases/function_test/pkg_test/auto/auto-common/test_auto-common_function_util_parse.sh deleted file mode 100644 index 5d8fc5e0a36..00000000000 --- a/testcases/function_test/pkg_test/auto/auto-common/test_auto-common_function_util_parse.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-15 -# @License : Mulan PSL v2 -# @Desc : Test common utility parsing -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - LOG_INFO "开始测试:Test common utility parsing" - - # 检查环境是否已安装 - LOG_INFO "检查环境是否已安装" - rpm -qa | grep -q "auto-common-function-util-parse" - if [ $? -eq 0 ]; then - LOG_INFO "环境已安装,测试结束后将保持安装状态" - ENV_INSTALLED=true - else - LOG_INFO "环境未安装,将在测试过程中安装" - ENV_INSTALLED=false - fi - - # 检查软件包是否在yum源中 - LOG_INFO "检查软件包是否在yum源中" - dnf list available "auto-common-function-util-parse" &>/dev/null - if [ $? -ne 0 ]; then - LOG_ERROR "软件包 auto-common-function-util-parse 不在yum源中" - exit 255 - fi - - # 检查命令参数 - LOG_INFO "检查命令参数" - if [ -z "$1" ]; then - LOG_ERROR "缺少必要参数" - exit 255 - fi - - # 执行安装(如果环境未安装) - if [ "$ENV_INSTALLED" = false ]; then - LOG_INFO "安装软件包 auto-common-function-util-parse" - dnf install -y "auto-common-function-util-parse" - CHECK_RESULT $? 0 0 "安装软件包失败" - fi - - # 执行测试命令 - LOG_INFO "执行测试命令" - auto-common-function-util-parse "$1" - CHECK_RESULT $? 0 0 "执行命令失败" - - # 清理环境(如果测试前未安装) - if [ "$ENV_INSTALLED" = false ]; then - LOG_INFO "卸载软件包 auto-common-function-util-parse" - dnf remove -y "auto-common-function-util-parse" - CHECK_RESULT $? 0 0 "卸载软件包失败" - fi - - LOG_INFO "测试完成:Test common utility parsing" -} - -main "$@" \ No newline at end of file diff --git a/testcases/function_test/pkg_test/auto/auto-common/test_auto-common_function_version.sh b/testcases/function_test/pkg_test/auto/auto-common/test_auto-common_function_version.sh deleted file mode 100644 index 1b3fab8e87d..00000000000 --- a/testcases/function_test/pkg_test/auto/auto-common/test_auto-common_function_version.sh +++ /dev/null @@ -1,74 +0,0 @@ -#!/usr/bin/bash - -# Copyright (c) 2024 ISCAS .ALL rights reserved. -# This program is licensed under Mulan PSL v2. -# You can use it according to the terms and conditions of the Mulan PSL v2. -# http://license.coscl.org.cn/MulanPSL2 -# THIS PROGRAM IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, -# EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, -# MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. -# See the Mulan PSL v2 for more details. - -# ############################################# -# @Author : honghua -# @Contact : honghua@iscas.ac.cn -# @Date : 2026-03-15 -# @License : Mulan PSL v2 -# @Desc : Test checking version of auto-common -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - LOG_INFO "开始测试:检查auto-common版本" - - # 检查是否已安装auto-common - LOG_INFO "步骤1:检查是否已安装auto-common软件包" - if rpm -q auto-common &> /dev/null; then - LOG_INFO "auto-common已安装,跳过安装步骤" - INSTALLED_BEFORE="true" - else - LOG_INFO "auto-common未安装,将在测试过程中安装" - INSTALLED_BEFORE="false" - fi - - # 检查yum源中是否存在auto-common软件包 - LOG_INFO "步骤2:检查yum源中是否存在auto-common软件包" - if ! dnf list available auto-common &> /dev/null; then - LOG_ERROR "yum源中未找到auto-common软件包" - exit 255 - fi - - # 如果未安装,则安装auto-common - if [ "$INSTALLED_BEFORE" = "false" ]; then - LOG_INFO "步骤3:安装auto-common软件包" - dnf install -y auto-common - CHECK_RESULT $? 0 0 "安装auto-common失败" - fi - - # 测试检查版本命令 - LOG_INFO "步骤4:执行auto-common版本检查命令" - auto-common --version - CHECK_RESULT $? 0 0 "执行auto-common --version命令失败" - - # 测试不支持的参数 - LOG_INFO "步骤5:测试不支持的参数" - auto-common --invalid-param 2>&1 | grep -q "invalid option" - if [ $? -eq 0 ]; then - LOG_INFO "参数检查正常:不支持--invalid-param参数" - else - LOG_ERROR "参数检查失败:--invalid-param参数未被正确识别为无效" - exit 255 - fi - - # 清理环境:如果测试前未安装,则卸载软件包 - if [ "$INSTALLED_BEFORE" = "false" ]; then - LOG_INFO "步骤6:清理环境,卸载auto-common软件包" - dnf remove -y auto-common - CHECK_RESULT $? 0 0 "卸载auto-common失败" - fi - - LOG_INFO "测试完成:auto-common版本检查测试通过" -} - -main "$@" \ No newline at end of file diff --git a/testcases/function_test/pkg_test/genwqe-tools/genwqe-zlib/test_genwqe-zlib_function_compress.sh b/testcases/function_test/pkg_test/genwqe-tools/genwqe-zlib/test_genwqe-zlib_function_compress.sh deleted file mode 100644 index 3b356091fd5..00000000000 --- a/testcases/function_test/pkg_test/genwqe-tools/genwqe-zlib/test_genwqe-zlib_function_compress.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-08 -# @License : Mulan PSL v2 -# @Desc : 测试genwqe-zlib的压缩功能 -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - - # 检查genwqe-zlib软件包是否已安装 - LOG_INFO "检查genwqe-zlib软件包是否已安装" - if rpm -q genwqe-zlib &>/dev/null; then - LOG_INFO "genwqe-zlib软件包已安装" - INSTALLED=true - else - LOG_INFO "genwqe-zlib软件包未安装" - INSTALLED=false - fi - - # 检查yum源中是否存在genwqe-zlib软件包 - LOG_INFO "检查yum源中是否存在genwqe-zlib软件包" - if ! dnf list available genwqe-zlib &>/dev/null; then - LOG_ERROR "yum源中未找到genwqe-zlib软件包" - exit 255 - fi - - # 如果未安装,则安装genwqe-zlib软件包 - if [ "$INSTALLED" = false ]; then - LOG_INFO "开始安装genwqe-zlib软件包" - dnf install -y genwqe-zlib - CHECK_RESULT $? 0 0 "安装genwqe-zlib软件包失败" - LOG_INFO "genwqe-zlib软件包安装成功" - fi - - # 测试genwqe-zlib的压缩功能 - LOG_INFO "测试genwqe-zlib的压缩功能" - if ! genzpipe --help &>/dev/null; then - LOG_ERROR "genzpipe命令不存在或不支持" - exit 255 - fi - - # 创建一个测试文件 - LOG_INFO "创建测试文件" - echo "This is a test file for genwqe-zlib compression." > testfile.txt - - # 压缩测试文件 - LOG_INFO "压缩测试文件" - genzpipe -c < testfile.txt > testfile.txt.gz 2>/dev/null - CHECK_RESULT $? 0 0 "压缩测试文件失败" - - # 解压缩测试文件并验证内容一致性 - LOG_INFO "解压缩测试文件并验证内容一致性" - genzpipe -d < testfile.txt.gz > testfile_decompressed.txt 2>/dev/null - CHECK_RESULT $? 0 0 "解压缩测试文件失败" - - cmp testfile.txt testfile_decompressed.txt - CHECK_RESULT $? 0 0 "解压缩后的文件内容与原始文件不一致" - - # 清理测试文件 - LOG_INFO "清理测试文件" - rm -f testfile.txt testfile.txt.gz testfile_decompressed.txt - - # 如果脚本开始时未安装genwqe-zlib,则在结束时卸载 - if [ "$INSTALLED" = false ]; then - LOG_INFO "卸载genwqe-zlib软件包" - dnf remove -y genwqe-zlib &>/dev/null - CHECK_RESULT $? 0 0 "卸载genwqe-zlib软件包失败" - fi - - LOG_INFO "测试完成,环境已恢复" - -} - -main "$@" \ No newline at end of file diff --git a/testcases/function_test/pkg_test/genwqe-tools/genwqe-zlib/test_genwqe-zlib_function_decompress.sh b/testcases/function_test/pkg_test/genwqe-tools/genwqe-zlib/test_genwqe-zlib_function_decompress.sh deleted file mode 100644 index 4b09f4c3ff8..00000000000 --- a/testcases/function_test/pkg_test/genwqe-tools/genwqe-zlib/test_genwqe-zlib_function_decompress.sh +++ /dev/null @@ -1,133 +0,0 @@ -#!/usr/bin/bash - -# Copyright (c) 2024 ISCAS .ALL rights reserved. -# This program is licensed under Mulan PSL v2. -# You can use it according to the terms and conditions of the Mulan PSL v2. -# http://license.coscl.org.cn/MulanPSL2 -# THIS PROGRAM IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, -# EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, -# MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. -# See the Mulan PSL v2 for more details. - -# ############################################# -# @Author : honghua -# @Contact : honghua@iscas.ac.cn -# @Date : 2026-04-01 -# @License : Mulan PSL v2 -# @Desc : 测试genwqe-zlib的解压缩功能,验证其是否能正确还原压缩数据 -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - # 定义日志函数(如果未定义) - type LOG_INFO >/dev/null 2>&1 || LOG_INFO() { echo "[INFO] $*"; } - type LOG_ERROR >/dev/null 2>&1 || LOG_ERROR() { echo "[ERROR] $*"; } - - # 定义检查结果函数(如果未定义) - type CHECK_RESULT >/dev/null 2>&1 || CHECK_RESULT() { - local actual=$1 - local expect=$2 - local mode=$3 - local message=$4 - if [ $mode -eq 0 ]; then - if [ $actual -eq $expect ]; then - LOG_INFO "$message 成功" - else - LOG_ERROR "$message 失败" - exit $actual - fi - fi - } - - # 定义SSH命令函数(如果未定义) - type SSH_CMD >/dev/null 2>&1 || SSH_CMD() { - local cmd=$1 - local ip=$2 - local password=$3 - local user=$4 - sshpass -p "$password" ssh -o StrictHostKeyChecking=no "$user@$ip" "$cmd" - } - - # 测试genwqe-zlib的解压缩功能 - LOG_INFO "开始测试genwqe-zlib的解压缩功能" - - # 检查是否已安装genwqe-zlib - LOG_INFO "检查genwqe-zlib是否已安装" - if rpm -q genwqe-zlib >/dev/null 2>&1; then - LOG_INFO "genwqe-zlib已安装,测试结束后将保持安装状态" - INSTALLED_BEFORE=1 - else - LOG_INFO "genwqe-zlib未安装,将在测试过程中安装" - INSTALLED_BEFORE=0 - fi - - # 检查yum源中是否有genwqe-zlib软件包 - LOG_INFO "检查yum源中是否有genwqe-zlib软件包" - dnf list available genwqe-zlib >/dev/null 2>&1 - if [ $? -ne 0 ]; then - LOG_ERROR "yum源中未找到genwqe-zlib软件包" - exit 255 - fi - - # 如果未安装,则安装genwqe-zlib - if [ $INSTALLED_BEFORE -eq 0 ]; then - LOG_INFO "安装genwqe-zlib软件包" - dnf install -y genwqe-zlib >/dev/null 2>&1 - CHECK_RESULT $? 0 0 "安装genwqe-zlib" - fi - - # 创建测试文件 - LOG_INFO "创建测试文件" - echo "This is a test file for genwqe-zlib decompression function testing." > test_input.txt - CHECK_RESULT $? 0 0 "创建测试文件" - - # 使用genwqe-zlib压缩测试文件 - LOG_INFO "使用genwqe-zlib压缩测试文件" - genwqe_zlib -c test_input.txt > test_compressed.gz 2>/dev/null - CHECK_RESULT $? 0 0 "压缩测试文件" - - # 检查压缩文件是否存在 - LOG_INFO "检查压缩文件是否存在" - if [ -f test_compressed.gz ]; then - LOG_INFO "压缩文件创建成功" - else - LOG_ERROR "压缩文件创建失败" - exit 1 - fi - - # 使用genwqe-zlib解压缩文件 - LOG_INFO "使用genwqe-zlib解压缩文件" - genwqe_zlib -d test_compressed.gz > test_decompressed.txt 2>/dev/null - CHECK_RESULT $? 0 0 "解压缩文件" - - # 检查解压缩文件是否存在 - LOG_INFO "检查解压缩文件是否存在" - if [ -f test_decompressed.txt ]; then - LOG_INFO "解压缩文件创建成功" - else - LOG_ERROR "解压缩文件创建失败" - exit 1 - fi - - # 比较原始文件和解压缩后的文件 - LOG_INFO "比较原始文件和解压缩后的文件" - cmp test_input.txt test_decompressed.txt >/dev/null 2>&1 - CHECK_RESULT $? 0 0 "比较文件内容" - - # 清理测试文件 - LOG_INFO "清理测试文件" - rm -f test_input.txt test_compressed.gz test_decompressed.txt - CHECK_RESULT $? 0 0 "清理测试文件" - - # 如果测试前未安装,则卸载genwqe-zlib - if [ $INSTALLED_BEFORE -eq 0 ]; then - LOG_INFO "卸载genwqe-zlib软件包" - dnf remove -y genwqe-zlib >/dev/null 2>&1 - CHECK_RESULT $? 0 0 "卸载genwqe-zlib" - fi - - LOG_INFO "genwqe-zlib解压缩功能测试完成" -} - -main "$@" \ No newline at end of file diff --git a/testcases/function_test/pkg_test/genwqe-tools/genwqe-zlib/test_genwqe-zlib_function_install.sh b/testcases/function_test/pkg_test/genwqe-tools/genwqe-zlib/test_genwqe-zlib_function_install.sh deleted file mode 100644 index 8c25bbbf1d1..00000000000 --- a/testcases/function_test/pkg_test/genwqe-tools/genwqe-zlib/test_genwqe-zlib_function_install.sh +++ /dev/null @@ -1,75 +0,0 @@ -#!/usr/bin/bash - -# Copyright (c) 2024 ISCAS .ALL rights reserved. -# This program is licensed under Mulan PSL v2. -# You can use it according to the terms and conditions of the Mulan PSL v2. -# http://license.coscl.org.cn/MulanPSL2 -# THIS PROGRAM IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, -# EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, -# MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. -# See the Mulan PSL v2 for more details. - -# ############################################# -# @Author : honghua -# @Contact : honghua@iscas.ac.cn -# @Date : 2026-04-01 -# @License : Mulan PSL v2 -# @Desc : 测试genwqe-zlib软件包的安装功能,确保其能正确安装到系统中 -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - # 检查是否已经安装了genwqe-zlib软件包 - LOG_INFO "检查genwqe-zlib软件包是否已经安装" - rpm -q genwqe-zlib > /dev/null 2>&1 - if [ $? -eq 0 ]; then - LOG_INFO "genwqe-zlib软件包已经安装,脚本结束时将保持安装状态" - ALREADY_INSTALLED=1 - else - LOG_INFO "genwqe-zlib软件包未安装,将在测试过程中安装" - ALREADY_INSTALLED=0 - fi - - # 检查yum源中是否存在genwqe-zlib软件包 - LOG_INFO "检查yum源中是否存在genwqe-zlib软件包" - dnf list available genwqe-zlib > /dev/null 2>&1 - if [ $? -ne 0 ]; then - LOG_ERROR "yum源中未找到genwqe-zlib软件包" - exit 255 - fi - - # 如果未安装,则安装软件包 - if [ $ALREADY_INSTALLED -eq 0 ]; then - LOG_INFO "开始安装genwqe-zlib软件包" - dnf install -y genwqe-zlib - CHECK_RESULT $? 0 0 "安装genwqe-zlib软件包失败" - LOG_INFO "genwqe-zlib软件包安装成功" - fi - - # 验证软件包是否正确安装 - LOG_INFO "验证genwqe-zlib软件包是否正确安装" - rpm -q genwqe-zlib > /dev/null 2>&1 - CHECK_RESULT $? 0 0 "genwqe-zlib软件包未正确安装" - - # 测试软件包的基本功能 - LOG_INFO "测试genwqe-zlib软件包的基本功能" - # 这里可以根据实际软件包功能添加测试命令,例如检查相关文件是否存在 - # 示例:检查是否安装了库文件 - ls /usr/lib*/libz* > /dev/null 2>&1 - CHECK_RESULT $? 0 0 "genwqe-zlib相关文件未找到" - - # 清理环境:如果测试前未安装,则卸载软件包 - if [ $ALREADY_INSTALLED -eq 0 ]; then - LOG_INFO "清理环境:卸载genwqe-zlib软件包" - dnf remove -y genwqe-zlib - CHECK_RESULT $? 0 0 "卸载genwqe-zlib软件包失败" - LOG_INFO "genwqe-zlib软件包已成功卸载" - else - LOG_INFO "测试前已安装genwqe-zlib,保持安装状态" - fi - - LOG_INFO "genwqe-zlib软件包安装功能测试完成" -} - -main "$@" \ No newline at end of file diff --git a/testcases/function_test/pkg_test/genwqe-tools/genwqe-zlib/test_genwqe-zlib_function_integration.sh b/testcases/function_test/pkg_test/genwqe-tools/genwqe-zlib/test_genwqe-zlib_function_integration.sh deleted file mode 100644 index 47f1569d495..00000000000 --- a/testcases/function_test/pkg_test/genwqe-tools/genwqe-zlib/test_genwqe-zlib_function_integration.sh +++ /dev/null @@ -1,129 +0,0 @@ -#!/usr/bin/bash - -# Copyright (c) 2024 ISCAS .ALL rights reserved. -# This program is licensed under Mulan PSL v2. -# You can use it according to the terms and conditions of the Mulan PSL v2. -# http://license.coscl.org.cn/MulanPSL2 -# THIS PROGRAM IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, -# EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-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-01 -# @License : Mulan PSL v2 -# @Desc : 测试genwqe-zlib与系统库的集成,确保其作为加速库能被正常调用 -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - # 检查是否以root用户运行 - if [[ $EUID -ne 0 ]]; then - LOG_ERROR "此脚本必须以root用户身份运行" - exit 1 - fi - - # 定义软件包名称 - PACKAGE_NAME="genwqe-zlib" - - # 步骤1:检查yum源中是否存在genwqe-zlib软件包 - LOG_INFO "步骤1:检查yum源中是否存在${PACKAGE_NAME}软件包" - if ! dnf list available ${PACKAGE_NAME} &>/dev/null; then - LOG_ERROR "yum源中未找到${PACKAGE_NAME}软件包" - exit 255 - fi - LOG_INFO "yum源中存在${PACKAGE_NAME}软件包" - - # 步骤2:检查系统是否已安装genwqe-zlib - LOG_INFO "步骤2:检查系统是否已安装${PACKAGE_NAME}" - if rpm -q ${PACKAGE_NAME} &>/dev/null; then - LOG_INFO "${PACKAGE_NAME}已安装,脚本结束后将保持安装状态" - ALREADY_INSTALLED=1 - else - LOG_INFO "${PACKAGE_NAME}未安装,将在测试步骤中安装" - ALREADY_INSTALLED=0 - fi - - # 步骤3:安装genwqe-zlib(如果未安装) - if [[ ${ALREADY_INSTALLED} -eq 0 ]]; then - LOG_INFO "步骤3:安装${PACKAGE_NAME}" - dnf install -y ${PACKAGE_NAME} - CHECK_RESULT $? 0 0 "安装${PACKAGE_NAME}失败" - LOG_INFO "${PACKAGE_NAME}安装成功" - fi - - # 步骤4:检查genwqe-zlib命令是否可用 - LOG_INFO "步骤4:检查genwqe-zlib命令是否可用" - if ! command -v genwqe_memcopy &>/dev/null; then - LOG_ERROR "genwqe_memcopy命令不存在" - exit 255 - fi - LOG_INFO "genwqe_memcopy命令可用" - - # 步骤5:测试genwqe-zlib与系统库的集成 - LOG_INFO "步骤5:测试genwqe-zlib与系统库的集成" - # 创建一个测试文件 - TEST_FILE="/tmp/test_genwqe_zlib.txt" - echo "This is a test file for genwqe-zlib integration." > ${TEST_FILE} - COMPRESSED_FILE="${TEST_FILE}.gz" - - # 使用genwqe加速的gzip压缩 - LOG_INFO "使用genwqe加速的gzip压缩测试文件" - GENWQE_GZIP_CMD="genwqe_gzip" - if ! command -v ${GENWQE_GZIP_CMD} &>/dev/null; then - LOG_ERROR "${GENWQE_GZIP_CMD}命令不存在或不支持" - exit 255 - fi - ${GENWQE_GZIP_CMD} -c ${TEST_FILE} > ${COMPRESSED_FILE} - CHECK_RESULT $? 0 0 "genwqe_gzip压缩失败" - - # 检查压缩文件是否存在且非空 - if [[ -s ${COMPRESSED_FILE} ]]; then - LOG_INFO "压缩文件创建成功" - else - LOG_ERROR "压缩文件创建失败" - exit 1 - fi - - # 使用genwqe加速的gunzip解压 - LOG_INFO "使用genwqe加速的gunzip解压测试文件" - GENWQE_GUNZIP_CMD="genwqe_gunzip" - if ! command -v ${GENWQE_GUNZIP_CMD} &>/dev/null; then - LOG_ERROR "${GENWQE_GUNZIP_CMD}命令不存在或不支持" - exit 255 - fi - DECOMPRESSED_FILE="/tmp/test_genwqe_zlib_decompressed.txt" - ${GENWQE_GUNZIP_CMD} -c ${COMPRESSED_FILE} > ${DECOMPRESSED_FILE} - CHECK_RESULT $? 0 0 "genwqe_gunzip解压失败" - - # 检查解压后的文件内容是否一致 - LOG_INFO "检查解压后的文件内容是否与原始文件一致" - if cmp -s ${TEST_FILE} ${DECOMPRESSED_FILE}; then - LOG_INFO "文件内容一致,genwqe-zlib与系统库集成正常" - else - LOG_ERROR "文件内容不一致,genwqe-zlib与系统库集成可能存在问题" - exit 1 - fi - - # 步骤6:清理测试文件 - LOG_INFO "步骤6:清理测试文件" - rm -f ${TEST_FILE} ${COMPRESSED_FILE} ${DECOMPRESSED_FILE} - CHECK_RESULT $? 0 0 "清理测试文件失败" - - # 步骤7:如果测试前未安装,则卸载genwqe-zlib - if [[ ${ALREADY_INSTALLED} -eq 0 ]]; then - LOG_INFO "步骤7:卸载${PACKAGE_NAME}" - dnf remove -y ${PACKAGE_NAME} - CHECK_RESULT $? 0 0 "卸载${PACKAGE_NAME}失败" - LOG_INFO "${PACKAGE_NAME}卸载成功" - else - LOG_INFO "步骤7:保持${PACKAGE_NAME}安装状态" - fi - - LOG_INFO "测试完成:genwqe-zlib与系统库的集成测试通过" -} - -main "$@" \ No newline at end of file diff --git a/testcases/function_test/pkg_test/genwqe-tools/genwqe-zlib/test_genwqe-zlib_function_uninstall.sh b/testcases/function_test/pkg_test/genwqe-tools/genwqe-zlib/test_genwqe-zlib_function_uninstall.sh deleted file mode 100644 index 7166f338348..00000000000 --- a/testcases/function_test/pkg_test/genwqe-tools/genwqe-zlib/test_genwqe-zlib_function_uninstall.sh +++ /dev/null @@ -1,67 +0,0 @@ -#!/usr/bin/bash - -# Copyright (c) 2024 ISCAS .ALL rights reserved. -# This program is licensed under Mulan PSL v2. -# You can use it according to the terms and conditions of the Mulan PSL v2. -# http://license.coscl.org.cn/MulanPSL2 -# THIS PROGRAM IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, -# EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, -# MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. -# See the Mulan PSL v2 for more details. - -# ############################################# -# @Author : honghua -# @Contact : honghua@iscas.ac.cn -# @Date : 2026-04-01 -# @License : Mulan PSL v2 -# @Desc : 测试genwqe-zlib软件包的卸载功能,确保其能被干净地移除 -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - PACKAGE_NAME="genwqe-zlib" - LOG_INFO "开始测试 $PACKAGE_NAME 软件包的卸载功能" - LOG_INFO "步骤1: 检查当前系统是否已安装 $PACKAGE_NAME" - if rpm -q $PACKAGE_NAME &>/dev/null; then - LOG_INFO "$PACKAGE_NAME 已安装,测试结束后将保持安装状态" - ALREADY_INSTALLED=1 - else - LOG_INFO "$PACKAGE_NAME 未安装,将在测试前安装,并在测试后卸载" - ALREADY_INSTALLED=0 - fi - LOG_INFO "步骤2: 检查 yum 源中是否存在 $PACKAGE_NAME 软件包" - if ! dnf list available $PACKAGE_NAME &>/dev/null; then - LOG_ERROR "yum 源中未找到 $PACKAGE_NAME 软件包" - exit 255 - fi - if [ $ALREADY_INSTALLED -eq 0 ]; then - LOG_INFO "步骤3: 安装 $PACKAGE_NAME 软件包" - dnf install -y $PACKAGE_NAME - CHECK_RESULT $? 0 0 "安装 $PACKAGE_NAME 失败" - fi - LOG_INFO "步骤4: 验证 $PACKAGE_NAME 软件包是否安装成功" - rpm -q $PACKAGE_NAME - CHECK_RESULT $? 0 0 "$PACKAGE_NAME 未正确安装" - LOG_INFO "步骤5: 卸载 $PACKAGE_NAME 软件包" - dnf remove -y $PACKAGE_NAME - CHECK_RESULT $? 0 0 "卸载 $PACKAGE_NAME 失败" - LOG_INFO "步骤6: 验证 $PACKAGE_NAME 软件包是否已卸载" - if rpm -q $PACKAGE_NAME &>/dev/null; then - LOG_ERROR "$PACKAGE_NAME 卸载后仍存在于系统中" - CHECK_RESULT 1 0 0 "$PACKAGE_NAME 卸载不干净" - else - LOG_INFO "$PACKAGE_NAME 已成功卸载" - CHECK_RESULT 0 0 0 "$PACKAGE_NAME 卸载验证失败" - fi - if [ $ALREADY_INSTALLED -eq 0 ]; then - LOG_INFO "步骤7: 清理环境,恢复原始状态(无需操作,已在步骤5卸载)" - else - LOG_INFO "步骤7: 恢复环境,重新安装 $PACKAGE_NAME" - dnf install -y $PACKAGE_NAME - CHECK_RESULT $? 0 0 "重新安装 $PACKAGE_NAME 失败" - fi - LOG_INFO "测试完成" -} - -main "$@" \ No newline at end of file diff --git a/testcases/function_test/pkg_test/genwqe-tools/genwqe-zlib/test_genwqe-zlib_function_version.sh b/testcases/function_test/pkg_test/genwqe-tools/genwqe-zlib/test_genwqe-zlib_function_version.sh deleted file mode 100644 index b470a756039..00000000000 --- a/testcases/function_test/pkg_test/genwqe-tools/genwqe-zlib/test_genwqe-zlib_function_version.sh +++ /dev/null @@ -1,87 +0,0 @@ -#!/usr/bin/bash - -# Copyright (c) 2024 ISCAS .ALL rights reserved. -# This program is licensed under Mulan PSL v2. -# You can use it according to the terms and conditions of the Mulan PSL v2. -# http://license.coscl.org.cn/MulanPSL2 -# THIS PROGRAM IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, -# EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, -# MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. -# See the Mulan PSL v2 for more details. - -# ############################################# -# @Author : honghua -# @Contact : honghua@iscas.ac.cn -# @Date : 2026-04-01 -# @License : Mulan PSL v2 -# @Desc : 测试genwqe-zlib版本查询功能,验证其能正确返回版本信息 -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - # 测试genwqe-zlib版本查询功能,验证其能正确返回版本信息 - LOG_INFO "开始测试genwqe-zlib版本查询功能" - - # 定义软件包名称 - PACKAGE_NAME="genwqe-zlib" - - # 步骤1:检查yum源中是否存在genwqe-zlib软件包 - LOG_INFO "步骤1:检查yum源中是否存在${PACKAGE_NAME}软件包" - dnf list available ${PACKAGE_NAME} &>/dev/null - if [ $? -ne 0 ]; then - LOG_ERROR "yum源中未找到${PACKAGE_NAME}软件包" - exit 255 - fi - - # 步骤2:检查系统是否已安装genwqe-zlib - LOG_INFO "步骤2:检查系统是否已安装${PACKAGE_NAME}" - rpm -q ${PACKAGE_NAME} &>/dev/null - IS_INSTALLED=$? - NEED_CLEANUP=0 - - # 步骤3:如果未安装,则安装软件包 - if [ $IS_INSTALLED -ne 0 ]; then - LOG_INFO "步骤3:安装${PACKAGE_NAME}软件包" - dnf install -y ${PACKAGE_NAME} - CHECK_RESULT $? 0 0 "安装${PACKAGE_NAME}失败" - NEED_CLEANUP=1 - else - LOG_INFO "步骤3:${PACKAGE_NAME}已安装,跳过安装步骤" - fi - - # 步骤4:验证genwqe-zlib版本查询功能 - LOG_INFO "步骤4:验证genwqe-zlib版本查询功能" - # 检查genwqe-zlib命令是否支持版本参数 - genwqe-zlib --help 2>&1 | grep -q -- "--version" - if [ $? -ne 0 ]; then - LOG_ERROR "genwqe-zlib命令不支持--version参数" - exit 255 - fi - - # 执行版本查询命令 - VERSION_OUTPUT=$(genwqe-zlib --version 2>&1) - CHECK_RESULT $? 0 0 "执行genwqe-zlib --version失败" - - # 检查版本输出是否包含有效信息 - if [ -z "$VERSION_OUTPUT" ]; then - LOG_ERROR "genwqe-zlib版本查询返回空结果" - exit 1 - fi - - LOG_INFO "genwqe-zlib版本信息:$VERSION_OUTPUT" - - # 步骤5:清理环境 - LOG_INFO "步骤5:清理环境" - if [ $NEED_CLEANUP -eq 1 ]; then - LOG_INFO "卸载${PACKAGE_NAME}软件包" - dnf remove -y ${PACKAGE_NAME} - CHECK_RESULT $? 0 0 "卸载${PACKAGE_NAME}失败" - else - LOG_INFO "${PACKAGE_NAME}为预安装软件包,保持安装状态" - fi - - LOG_INFO "测试genwqe-zlib版本查询功能完成" -} - -main "$@" \ No newline at end of file diff --git a/testcases/function_test/pkg_test/kunpengsecl/kunpengsecl-devel/test_kunpengsecl-devel_function_config.sh b/testcases/function_test/pkg_test/kunpengsecl/kunpengsecl-devel/test_kunpengsecl-devel_function_config.sh deleted file mode 100644 index 2a9dcc4ec6e..00000000000 --- a/testcases/function_test/pkg_test/kunpengsecl/kunpengsecl-devel/test_kunpengsecl-devel_function_config.sh +++ /dev/null @@ -1,66 +0,0 @@ -#!/usr/bin/bash - -# Copyright (c) 2024 ISCAS .ALL rights reserved. -# This program is licensed under Mulan PSL v2. -# You can use it according to the terms and conditions of the Mulan PSL v2. -# http://license.coscl.org.cn/MulanPSL2 -# THIS PROGRAM IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, -# EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, -# MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. -# See the Mulan PSL v2 for more details. - -# ############################################# -# @Author : honghua -# @Contact : honghua@iscas.ac.cn -# @Date : 2025-12-03 -# @License : Mulan PSL v2 -# @Desc : 测试软件包 kunpengsecl-devel 的配置功能,验证配置是否正确加载。 -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - - # 检查是否已安装 kunpengsecl-devel 软件包 - LOG_INFO "检查 kunpengsecl-devel 软件包是否已安装" - rpm -q kunpengsecl-devel > /dev/null 2>&1 - if [ $? -eq 0 ]; then - LOG_INFO "kunpengsecl-devel 软件包已安装" - INSTALLED=true - else - LOG_INFO "kunpengsecl-devel 软件包未安装" - INSTALLED=false - fi - - # 检查 yum 源中是否存在 kunpengsecl-devel 软件包 - LOG_INFO "检查 yum 源中是否存在 kunpengsecl-devel 软件包" - dnf list available kunpengsecl-devel > /dev/null 2>&1 - if [ $? -ne 0 ]; then - LOG_ERROR "yum 源中不存在 kunpengsecl-devel 软件包" - exit 255 - fi - - # 如果未安装,则安装 kunpengsecl-devel 软件包 - if [ "$INSTALLED" = false ]; then - LOG_INFO "开始安装 kunpengsecl-devel 软件包" - dnf install -y kunpengsecl-devel - CHECK_RESULT $? 0 0 "安装 kunpengsecl-devel 软件包失败" - fi - - # 验证配置是否正确加载 - LOG_INFO "验证 kunpengsecl-devel 配置是否正确加载" - kunpengsecl-config --test > /dev/null 2>&1 - CHECK_RESULT $? 0 0 "kunpengsecl-config 配置加载失败" - - # 如果最初未安装,则在脚本结束前卸载软件包 - if [ "$INSTALLED" = false ]; then - LOG_INFO "卸载 kunpengsecl-devel 软件包" - dnf remove -y kunpengsecl-devel - CHECK_RESULT $? 0 0 "卸载kun p engs ecl- de vel软 件 失 败 " - fi - - LOG_INFO "测试完成,环境已恢复" - -} - -main "$@" \ No newline at end of file diff --git a/testcases/function_test/pkg_test/lucene/lucene-demo/test_lucene-demo_function_analyzer.sh b/testcases/function_test/pkg_test/lucene/lucene-demo/test_lucene-demo_function_analyzer.sh deleted file mode 100644 index 2896c0a640b..00000000000 --- a/testcases/function_test/pkg_test/lucene/lucene-demo/test_lucene-demo_function_analyzer.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-02-21 -# @License : Mulan PSL v2 -# @Desc : Test text analyzer functionality -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - # 定义颜色输出(可选,但通常LOG_INFO/LOG_ERROR会处理) - LOG_INFO() { - echo "[INFO] $*" - } - LOG_ERROR() { - echo "[ERROR] $*" >&2 - } - - # 测试用例描述:Test text analyzer functionality - LOG_INFO "开始测试:Test text analyzer functionality" - - # 步骤1: 检查环境中是否已安装lucene-demo软件包 - LOG_INFO "步骤1: 检查lucene-demo软件包是否已安装" - if rpm -q lucene-demo &>/dev/null; then - LOG_INFO "lucene-demo软件包已安装,测试结束后将保持安装状态" - INSTALLED_BEFORE_TEST=true - else - LOG_INFO "lucene-demo软件包未安装,将在测试中安装" - INSTALLED_BEFORE_TEST=false - fi - - # 步骤2: 检查yum源中是否有lucene-demo软件包 - LOG_INFO "步骤2: 检查yum源中是否有lucene-demo软件包" - if ! dnf list available lucene-demo &>/dev/null; then - LOG_ERROR "yum源中未找到lucene-demo软件包" - exit 255 - fi - - # 步骤3: 如果未安装,则安装lucene-demo软件包 - if [ "$INSTALLED_BEFORE_TEST" = false ]; then - LOG_INFO "步骤3: 安装lucene-demo软件包" - dnf install -y lucene-demo - CHECK_RESULT $? 0 0 "安装lucene-demo软件包失败" - fi - - # 步骤4: 测试text analyzer功能 - LOG_INFO "步骤4: 测试text analyzer功能" - # 假设lucene-demo提供了一个命令行工具"analyze-text"来测试analyzer功能 - # 检查analyze-text命令是否存在 - if ! command -v analyze-text &>/dev/null; then - LOG_ERROR "analyze-text命令不存在或不支持" - exit 255 - fi - - # 测试analyze-text命令的基本参数 - LOG_INFO "步骤4.1: 测试analyze-text命令的--help参数" - analyze-text --help - CHECK_RESULT $? 0 0 "analyze-text --help 执行失败" - - # 测试analyze-text命令的必需参数(假设--input是必需参数) - LOG_INFO "步骤4.2: 测试analyze-text命令的--input参数" - if analyze-text --input "test text" 2>&1 | grep -q "error"; then - LOG_ERROR "analyze-text --input 参数不支持或执行失败" - exit 255 - fi - CHECK_RESULT $? 0 0 "analyze-text --input 执行失败" - - # 步骤5: 清理环境,恢复到之前的状态 - LOG_INFO "步骤5: 清理测试环境" - if [ "$INSTALLED_BEFORE_TEST" = false ]; then - LOG_INFO "卸载lucene-demo软件包" - dnf remove -y lucene-demo - CHECK_RESULT $? 0 0 "卸载lucene-demo软件包失败" - else - LOG_INFO "测试前已安装lucene-demo,保持安装状态" - fi - - LOG_INFO "测试完成:Test text analyzer functionality" -} - -main "$@" \ No newline at end of file diff --git a/testcases/function_test/pkg_test/lucene/lucene-demo/test_lucene-demo_function_basic_index.sh b/testcases/function_test/pkg_test/lucene/lucene-demo/test_lucene-demo_function_basic_index.sh deleted file mode 100644 index 4574aaab249..00000000000 --- a/testcases/function_test/pkg_test/lucene/lucene-demo/test_lucene-demo_function_basic_index.sh +++ /dev/null @@ -1,82 +0,0 @@ -#!/usr/bin/bash - -# Copyright (c) 2024 ISCAS .ALL rights reserved. -# This program is licensed under Mulan PSL v2. -# You can use it according to the terms and conditions of the Mulan PSL v2. -# http://license.coscl.org.cn/MulanPSL2 -# THIS PROGRAM IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, -# EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, -# MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. -# See the Mulan PSL v2 for more details. - -# ############################################# -# @Author : honghua -# @Contact : honghua@iscas.ac.cn -# @Date : 2026-02-21 -# @License : Mulan PSL v2 -# @Desc : Test creating a basic index -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - LOG_INFO "开始测试:Test creating a basic index" - - # 定义软件包名称 - PACKAGE_NAME="lucene-demo" - LOG_INFO "检查yum源中是否存在软件包: $PACKAGE_NAME" - - # 检查软件包是否在yum源中 - if ! dnf list available "$PACKAGE_NAME" &>/dev/null; then - LOG_ERROR "yum源中未找到软件包: $PACKAGE_NAME" - exit 255 - fi - - # 判断软件包是否已安装 - if rpm -q "$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 "安装软件包失败" - fi - - # 测试创建基本索引的功能 - LOG_INFO "执行创建基本索引的命令" - # 假设创建索引的命令为 lucene-demo create-index,这里根据实际情况调整命令和参数 - COMMAND="lucene-demo" - PARAM="create-index" - # 检查命令是否存在 - if ! command -v "$COMMAND" &>/dev/null; then - LOG_ERROR "命令 $COMMAND 不存在" - exit 255 - fi - # 检查参数是否支持,这里假设通过 --help 检查 - if ! "$COMMAND" --help 2>&1 | grep -q "$PARAM"; then - LOG_ERROR "命令 $COMMAND 不支持参数 $PARAM" - exit 255 - fi - # 执行命令 - "$COMMAND" "$PARAM" - CHECK_RESULT $? 0 0 "创建基本索引失败" - - # 环境恢复:如果测试前未安装,则卸载软件包 - if [ "$INSTALLED_BEFORE" = false ]; then - LOG_INFO "卸载软件包: $PACKAGE_NAME" - dnf remove -y "$PACKAGE_NAME" - CHECK_RESULT $? 0 0 "卸载软件包失败" - else - LOG_INFO "测试前软件包已安装,保持安装状态" - fi - - LOG_INFO "测试完成:Test creating a basic index" -} - -main "$@" \ No newline at end of file diff --git a/testcases/function_test/pkg_test/lucene/lucene-demo/test_lucene-demo_function_basic_search.sh b/testcases/function_test/pkg_test/lucene/lucene-demo/test_lucene-demo_function_basic_search.sh deleted file mode 100644 index 4b9db81977f..00000000000 --- a/testcases/function_test/pkg_test/lucene/lucene-demo/test_lucene-demo_function_basic_search.sh +++ /dev/null @@ -1,86 +0,0 @@ -#!/usr/bin/bash - -# Copyright (c) 2024 ISCAS .ALL rights reserved. -# This program is licensed under Mulan PSL v2. -# You can use it according to the terms and conditions of the Mulan PSL v2. -# http://license.coscl.org.cn/MulanPSL2 -# THIS PROGRAM IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, -# EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, -# MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. -# See the Mulan PSL v2 for more details. - -# ############################################# -# @Author : honghua -# @Contact : honghua@iscas.ac.cn -# @Date : 2026-02-21 -# @License : Mulan PSL v2 -# @Desc : Test performing a basic search -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - set -e - - LOG_INFO "开始测试:执行基本搜索功能测试" - - # 步骤1:检查软件包是否在yum源中 - LOG_INFO "步骤1:检查lucene-demo软件包是否在yum源中" - if ! dnf list lucene-demo &>/dev/null; then - LOG_ERROR "lucene-demo软件包不在yum源中" - exit 255 - fi - - # 步骤2:检查当前环境是否已安装lucene-demo - LOG_INFO "步骤2:检查当前环境是否已安装lucene-demo" - if rpm -q lucene-demo &>/dev/null; then - INSTALLED=true - LOG_INFO "lucene-demo已安装,测试结束后将保持安装状态" - else - INSTALLED=false - LOG_INFO "lucene-demo未安装,将进行安装" - fi - - # 步骤3:如果未安装,则安装软件包 - if [ "$INSTALLED" = false ]; then - LOG_INFO "步骤3:安装lucene-demo软件包" - dnf install -y lucene-demo - CHECK_RESULT $? 0 0 "安装lucene-demo失败" - fi - - # 步骤4:检查lucene-demo命令是否支持基本搜索参数 - LOG_INFO "步骤4:检查lucene-demo命令是否支持基本搜索参数" - lucene-demo --help | grep -q "\-\-search" - CHECK_RESULT $? 0 0 "lucene-demo命令不支持--search参数" - lucene-demo --help | grep -q "\-\-query" - CHECK_RESULT $? 0 0 "lucene-demo命令不支持--query参数" - - # 步骤5:执行基本搜索命令 - LOG_INFO "步骤5:执行基本搜索命令" - lucene-demo --search --query "test query" - CHECK_RESULT $? 0 0 "执行基本搜索失败" - - # 步骤6:验证搜索结果 - LOG_INFO "步骤6:验证搜索结果" - SEARCH_RESULT=$(lucene-demo --search --query "test query" | wc -l) - if [ "$SEARCH_RESULT" -gt 0 ]; then - LOG_INFO "搜索成功,返回结果行数:$SEARCH_RESULT" - else - LOG_ERROR "搜索失败,未返回结果" - exit 1 - fi - - # 步骤7:清理环境 - LOG_INFO "步骤7:清理环境" - if [ "$INSTALLED" = false ]; then - LOG_INFO "卸载lucene-demo软件包" - dnf remove -y lucene-demo - CHECK_RESULT $? 0 0 "卸载lucene-demo失败" - else - LOG_INFO "保持lucene-demo安装状态" - fi - - LOG_INFO "测试完成:基本搜索功能测试通过" -} - -main "$@" \ No newline at end of file diff --git a/testcases/function_test/pkg_test/lucene/lucene-demo/test_lucene-demo_function_delete_doc.sh b/testcases/function_test/pkg_test/lucene/lucene-demo/test_lucene-demo_function_delete_doc.sh deleted file mode 100644 index c97c85c4d17..00000000000 --- a/testcases/function_test/pkg_test/lucene/lucene-demo/test_lucene-demo_function_delete_doc.sh +++ /dev/null @@ -1,124 +0,0 @@ -#!/usr/bin/bash - -# Copyright (c) 2024 ISCAS .ALL rights reserved. -# This program is licensed under Mulan PSL v2. -# You can use it according to the terms and conditions of the Mulan PSL v2. -# http://license.coscl.org.cn/MulanPSL2 -# THIS PROGRAM IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, -# EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, -# MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. -# See the Mulan PSL v2 for more details. - -# ############################################# -# @Author : honghua -# @Contact : honghua@iscas.ac.cn -# @Date : 2026-02-21 -# @License : Mulan PSL v2 -# @Desc : Test deleting a document from index -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - # 测试删除索引中的文档功能 - - LOG_INFO "开始测试:删除索引中的文档" - - # 检查环境是否已安装 - LOG_INFO "步骤1:检查环境是否已安装" - rpm -q lucene-demo > /dev/null 2>&1 - if [ $? -eq 0 ]; then - LOG_INFO "检测到lucene-demo已安装" - already_installed=true - else - LOG_INFO "未检测到lucene-demo安装" - already_installed=false - fi - - # 检查yum源中是否有该软件包 - LOG_INFO "步骤2:检查yum源中是否有lucene-demo软件包" - dnf list available lucene-demo > /dev/null 2>&1 - if [ $? -ne 0 ]; then - LOG_ERROR "yum源中未找到lucene-demo软件包" - exit 255 - fi - - # 如果未安装则进行安装 - if [ "$already_installed" = false ]; then - LOG_INFO "步骤3:安装lucene-demo软件包" - dnf install -y lucene-demo - CHECK_RESULT $? 0 0 "安装lucene-demo失败" - fi - - # 检查lucene-demo命令是否支持delete_doc参数 - LOG_INFO "步骤4:检查lucene-demo命令是否支持delete_doc参数" - lucene-demo --help 2>&1 | grep -q "delete_doc" - if [ $? -ne 0 ]; then - LOG_ERROR "lucene-demo命令不支持delete_doc参数" - # 清理环境 - if [ "$already_installed" = false ]; then - dnf remove -y lucene-demo - CHECK_RESULT $? 0 0 "卸载lucene-demo失败" - fi - exit 255 - fi - - # 创建测试索引和文档 - LOG_INFO "步骤5:创建测试索引和文档" - lucene-demo create_index test_index - CHECK_RESULT $? 0 0 "创建索引失败" - - lucene-demo add_doc test_index doc1 "测试文档内容1" - CHECK_RESULT $? 0 0 "添加文档失败" - - lucene-demo add_doc test_index doc2 "测试文档内容2" - CHECK_RESULT $? 0 0 "添加文档失败" - - # 验证文档已添加 - LOG_INFO "步骤6:验证文档已成功添加" - lucene-demo search test_index "测试文档" | grep -q "doc1" - CHECK_RESULT $? 0 0 "未找到添加的文档doc1" - - lucene-demo search test_index "测试文档" | grep -q "doc2" - CHECK_RESULT $? 0 0 "未找到添加的文档doc2" - - # 删除文档 - LOG_INFO "步骤7:删除文档doc1" - lucene-demo delete_doc test_index doc1 - CHECK_RESULT $? 0 0 "删除文档失败" - - # 验证文档已删除 - LOG_INFO "步骤8:验证文档已成功删除" - lucene-demo search test_index "测试文档" | grep -q "doc1" - if [ $? -eq 0 ]; then - LOG_ERROR "文档doc1未被成功删除" - CHECK_RESULT 1 0 0 "文档删除验证失败" - else - LOG_INFO "文档doc1已成功删除" - CHECK_RESULT 0 0 0 "文档删除验证成功" - fi - - # 验证其他文档仍然存在 - LOG_INFO "步骤9:验证其他文档仍然存在" - lucene-demo search test_index "测试文档" | grep -q "doc2" - CHECK_RESULT $? 0 0 "文档doc2在删除后不应消失" - - # 清理测试索引 - LOG_INFO "步骤10:清理测试索引" - lucene-demo delete_index test_index - CHECK_RESULT $? 0 0 "删除索引失败" - - # 恢复环境状态 - LOG_INFO "步骤11:恢复环境状态" - if [ "$already_installed" = false ]; then - LOG_INFO "卸载测试安装的软件包" - dnf remove -y lucene-demo - CHECK_RESULT $? 0 0 "卸载lucene-demo失败" - else - LOG_INFO "保持原有安装状态" - fi - - LOG_INFO "测试完成:删除索引中的文档功能测试成功" -} - -main "$@" \ No newline at end of file diff --git a/testcases/function_test/pkg_test/lucene/lucene-demo/test_lucene-demo_function_index.sh b/testcases/function_test/pkg_test/lucene/lucene-demo/test_lucene-demo_function_index.sh deleted file mode 100644 index 1a71c4900d4..00000000000 --- a/testcases/function_test/pkg_test/lucene/lucene-demo/test_lucene-demo_function_index.sh +++ /dev/null @@ -1,69 +0,0 @@ -#!/usr/bin/bash - -# Copyright (c) 2024 ISCAS .ALL rights reserved. -# This program is licensed under Mulan PSL v2. -# You can use it according to the terms and conditions of the Mulan PSL v2. -# http://license.coscl.org.cn/MulanPSL2 -# THIS PROGRAM IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, -# EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, -# MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. -# See the Mulan PSL v2 for more details. - -# ############################################# -# @Author : honghua -# @Contact : honghua@iscas.ac.cn -# @Date : 2025-12-09 -# @License : Mulan PSL v2 -# @Desc : Test the indexing functionality of lucene-demo -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - - LOG_INFO "开始测试lucene-demo的索引功能" - - # 检查是否已安装lucene-demo - if dnf list installed lucene-demo &>/dev/null; then - LOG_INFO "lucene-demo已安装,测试完成后将保持安装状态" - installed=true - else - LOG_INFO "lucene-demo未安装,将在测试完成后卸载" - installed=false - fi - - # 检查yum源中是否有lucene-demo软件包 - if ! dnf list available lucene-demo &>/dev/null; then - LOG_ERROR "yum源中未找到lucene-demo软件包" - exit 255 - fi - - # 安装lucene-demo - if [ "$installed" = false ]; then - LOG_INFO "正在安装lucene-demo" - dnf install -y lucene-demo - CHECK_RESULT $? 0 0 "安装lucene-demo失败" - fi - - # 测试索引功能 - LOG_INFO "测试lucene-demo的索引功能" - lucene-demo index --path /tmp/test_index - CHECK_RESULT $? 0 0 "lucene-demo索引功能测试失败" - - # 清理测试索引 - LOG_INFO "清理测试索引" - rm -rf /tmp/test_index - CHECK_RESULT $? 0 0 "清理测试索引失败" - - # 卸载lucene-demo(如果测试前未安装) - if [ "$installed" = false ]; then - LOG_INFO "卸载lucene-demo" - dnf remove -y lucene-demo - CHECK_RESULT $? 0 0 "卸载lucene-demo失败" - fi - - LOG_INFO "lucene-demo索引功能测试完成" - -} - -main "$@" \ No newline at end of file diff --git a/testcases/function_test/pkg_test/lucene/lucene-demo/test_lucene-demo_function_query.sh b/testcases/function_test/pkg_test/lucene/lucene-demo/test_lucene-demo_function_query.sh deleted file mode 100644 index a17905008b7..00000000000 --- a/testcases/function_test/pkg_test/lucene/lucene-demo/test_lucene-demo_function_query.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-09 -# @License : Mulan PSL v2 -# @Desc : Test the query parsing of lucene-demo -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - LOG_INFO "开始测试:Test the query parsing of lucene-demo" - - # 检查软件包是否已安装 - LOG_INFO "检查lucene-demo是否已安装" - if dnf list installed lucene-demo &>/dev/null; then - LOG_INFO "lucene-demo已安装,脚本结束时将保持安装状态" - INSTALLED=true - else - LOG_INFO "lucene-demo未安装,将在测试结束后卸载" - INSTALLED=false - fi - - # 检查yum源中是否有lucene-demo软件包 - LOG_INFO "检查yum源中是否存在lucene-demo软件包" - if ! dnf list available lucene-demo &>/dev/null; then - LOG_ERROR "yum源中未找到lucene-demo软件包" - exit 255 - fi - - # 如果未安装,则安装软件包 - if [ "$INSTALLED" = false ]; then - LOG_INFO "开始安装lucene-demo" - dnf install -y lucene-demo - CHECK_RESULT $? 0 0 "安装lucene-demo失败" - fi - - # 测试query parsing功能 - LOG_INFO "测试query parsing功能" - query_result=$(lucene-demo query --test-query-parsing "test query") - CHECK_RESULT $? 0 0 "query parsing测试失败" - - # 检查参数是否存在或不支持 - LOG_INFO "检查不支持的参数" - lucene-demo query --invalid-param &>/dev/null - if [ $? -ne 255 ]; then - LOG_ERROR "未正确处理不支持的参数" - exit 255 - fi - - # 清理环境:如果脚本开始时未安装,则卸载软件包 - if [ "$INSTALLED" = false ]; then - LOG_INFO "卸载lucene-demo" - dnf remove -y lucene-demo - CHECK_RESULT $? 0 0 "卸载lucene-demo失败" - fi - - LOG_INFO "测试完成:Test the query parsing of lucene-demo" -} - -main "$@" \ No newline at end of file diff --git a/testcases/function_test/pkg_test/lucene/lucene-demo/test_lucene-demo_function_query_types.sh b/testcases/function_test/pkg_test/lucene/lucene-demo/test_lucene-demo_function_query_types.sh deleted file mode 100644 index 8011610c2e7..00000000000 --- a/testcases/function_test/pkg_test/lucene/lucene-demo/test_lucene-demo_function_query_types.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-02-21 -# @License : Mulan PSL v2 -# @Desc : Test different query types -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - # 定义日志函数(根据要求直接使用,无需重新定义) - LOG_INFO() { - echo "[INFO] $*" - } - - LOG_ERROR() { - echo "[ERROR] $*" - } - - # 定义检查结果函数(根据要求直接使用,无需重新定义) - CHECK_RESULT() { - local actual=$1 - local expect=$2 - local mode=$3 - local message=$4 - if [ $mode -eq 0 ]; then - if [ $actual -ne $expect ]; then - LOG_ERROR "$message" - exit $actual - fi - elif [ $mode -eq 1 ]; then - if [ $actual -eq $expect ]; then - LOG_ERROR "$message" - exit 1 - fi - 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="lucene-demo" - LOG_INFO "开始测试不同查询类型" - - # 检查软件包是否已在yum源中 - LOG_INFO "检查yum源中是否存在$PACKAGE_NAME软件包" - dnf list available $PACKAGE_NAME &>/dev/null - if [ $? -ne 0 ]; then - LOG_ERROR "yum源中不存在$PACKAGE_NAME软件包" - exit 255 - fi - - # 检查当前环境是否已安装软件包 - LOG_INFO "检查当前环境是否已安装$PACKAGE_NAME软件包" - if rpm -q $PACKAGE_NAME &>/dev/null; then - INSTALLED=true - LOG_INFO "$PACKAGE_NAME软件包已安装,测试结束后将保持安装状态" - else - INSTALLED=false - LOG_INFO "$PACKAGE_NAME软件包未安装,将在测试前安装并在测试后卸载" - fi - - # 如果未安装,则安装软件包 - if [ "$INSTALLED" = false ]; then - LOG_INFO "安装$PACKAGE_NAME软件包" - dnf install -y $PACKAGE_NAME - CHECK_RESULT $? 0 0 "安装$PACKAGE_NAME软件包失败" - fi - - # 测试不同查询类型 - LOG_INFO "测试查询类型1:基础查询" - lucene-demo --query-type basic --query "test query" - CHECK_RESULT $? 0 0 "基础查询测试失败" - - LOG_INFO "测试查询类型2:范围查询" - lucene-demo --query-type range --start 1 --end 10 - CHECK_RESULT $? 0 0 "范围查询测试失败" - - LOG_INFO "测试查询类型3:模糊查询" - lucene-demo --query-type fuzzy --query "test" - CHECK_RESULT $? 0 0 "模糊查询测试失败" - - LOG_INFO "测试查询类型4:通配符查询" - lucene-demo --query-type wildcard --query "test*" - CHECK_RESULT $? 0 0 "通配符查询测试失败" - - LOG_INFO "测试查询类型5:短语查询" - lucene-demo --query-type phrase --query "test query" - CHECK_RESULT $? 0 0 "短语查询测试失败" - - # 测试不支持的查询类型(预期失败) - LOG_INFO "测试不支持的查询类型(预期失败)" - lucene-demo --query-type unsupported --query "test" - if [ $? -eq 255 ]; then - LOG_INFO "不支持的查询类型测试通过(按预期退出码255)" - else - LOG_ERROR "不支持的查询类型测试失败(未按预期退出码255退出)" - exit 1 - fi - - # 清理环境:如果测试前未安装,则卸载软件包 - if [ "$INSTALLED" = false ]; then - LOG_INFO "卸载$PACKAGE_NAME软件包" - dnf remove -y $PACKAGE_NAME - CHECK_RESULT $? 0 0 "卸载$PACKAGE_NAME软件包失败" - fi - - LOG_INFO "测试不同查询类型完成" -} - -main "$@" \ No newline at end of file diff --git a/testcases/function_test/pkg_test/lucene/lucene-demo/test_lucene-demo_function_score.sh b/testcases/function_test/pkg_test/lucene/lucene-demo/test_lucene-demo_function_score.sh deleted file mode 100644 index 9aaa7b00fbc..00000000000 --- a/testcases/function_test/pkg_test/lucene/lucene-demo/test_lucene-demo_function_score.sh +++ /dev/null @@ -1,64 +0,0 @@ -#!/usr/bin/bash - -# Copyright (c) 2024 ISCAS .ALL rights reserved. -# This program is licensed under Mulan PSL v2. -# You can use it according to the terms and conditions of the Mulan PSL v2. -# http://license.coscl.org.cn/MulanPSL2 -# THIS PROGRAM IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, -# EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, -# MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. -# See the Mulan PSL v2 for more details. - -# ############################################# -# @Author : honghua -# @Contact : honghua@iscas.ac.cn -# @Date : 2025-12-09 -# @License : Mulan PSL v2 -# @Desc : Test the scoring mechanism of lucene-demo -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - LOG_INFO "开始测试 lucene-demo 的评分机制" - - # 检查软件包是否已安装 - LOG_INFO "检查 lucene-demo 是否已安装" - if dnf list installed lucene-demo &>/dev/null; then - LOG_INFO "lucene-demo 已安装,脚本结束时将保持安装状态" - installed=true - else - LOG_INFO "lucene-demo 未安装,将在测试结束后卸载" - installed=false - fi - - # 检查 yum 源中是否存在 lucene-demo 软件包 - LOG_INFO "检查 yum 源中是否存在 lucene-demo" - if ! dnf list available lucene-demo &>/dev/null; then - LOG_ERROR "yum 源中未找到 lucene-demo 软件包" - exit 255 - fi - - # 如果未安装,则安装软件包 - if [ "$installed" = false ]; then - LOG_INFO "安装 lucene-demo" - dnf install -y lucene-demo - CHECK_RESULT $? 0 0 "安装 lucene-demo 失败" - fi - - # 测试评分机制 - LOG_INFO "测试 lucene-demo 的评分机制" - lucene-demo --score-test - CHECK_RESULT $? 0 0 "评分机制测试失败" - - # 如果需要清理环境 - if [ "$installed" = false ]; then - LOG_INFO "卸载 lucene-demo" - dnf remove -y lucene-demo - CHECK_RESULT $? 0 0 "卸载 lucene-demo 失败" - fi - - LOG_INFO "测试完成,环境已恢复" -} - -main "$@" \ No newline at end of file diff --git a/testcases/function_test/pkg_test/lucene/lucene-demo/test_lucene-demo_function_search.sh b/testcases/function_test/pkg_test/lucene/lucene-demo/test_lucene-demo_function_search.sh deleted file mode 100644 index 737d52098f9..00000000000 --- a/testcases/function_test/pkg_test/lucene/lucene-demo/test_lucene-demo_function_search.sh +++ /dev/null @@ -1,64 +0,0 @@ -#!/usr/bin/bash - -# Copyright (c) 2024 ISCAS .ALL rights reserved. -# This program is licensed under Mulan PSL v2. -# You can use it according to the terms and conditions of the Mulan PSL v2. -# http://license.coscl.org.cn/MulanPSL2 -# THIS PROGRAM IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, -# EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, -# MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. -# See the Mulan PSL v2 for more details. - -# ############################################# -# @Author : honghua -# @Contact : honghua@iscas.ac.cn -# @Date : 2025-12-09 -# @License : Mulan PSL v2 -# @Desc : Test the search functionality of lucene-demo -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - - # 检查lucene-demo软件包是否已安装 - LOG_INFO "检查lucene-demo软件包是否已安装" - if rpm -q lucene-demo &>/dev/null; then - LOG_INFO "lucene-demo软件包已安装" - INSTALLED=true - else - LOG_INFO "lucene-demo软件包未安装" - INSTALLED=false - fi - - # 检查yum源中是否存在lucene-demo软件包 - LOG_INFO "检查yum源中是否存在lucene-demo软件包" - if ! dnf list available lucene-demo &>/dev/null; then - LOG_ERROR "yum源中不存在lucene-demo软件包" - exit 255 - fi - - # 如果未安装,则安装lucene-demo软件包 - if [ "$INSTALLED" = false ]; then - LOG_INFO "安装lucene-demo软件包" - dnf install -y lucene-demo - CHECK_RESULT $? 0 0 "安装lucene-demo软件包失败" - fi - - # 测试lucene-demo的搜索功能 - LOG_INFO "测试lucene-demo的搜索功能" - lucene-demo search --query "test" - CHECK_RESULT $? 0 0 "lucene-demo搜索功能测试失败" - - # 如果脚本开始时未安装,则卸载lucene-demo软件包 - if [ "$INSTALLED" = false ]; then - LOG_INFO "卸载lucene-demo软件包" - dnf remove -y lucene-demo - CHECK_RESULT $? 0 0 "卸载lucene-demo软件包失败" - fi - - LOG_INFO "测试脚本执行完成,环境已恢复" - -} - -main "$@" \ No newline at end of file diff --git a/testcases/function_test/pkg_test/lucene/lucene-demo/test_lucene-demo_function_sort_results.sh b/testcases/function_test/pkg_test/lucene/lucene-demo/test_lucene-demo_function_sort_results.sh deleted file mode 100644 index 64757d4f75e..00000000000 --- a/testcases/function_test/pkg_test/lucene/lucene-demo/test_lucene-demo_function_sort_results.sh +++ /dev/null @@ -1,85 +0,0 @@ -#!/usr/bin/bash - -# Copyright (c) 2024 ISCAS .ALL rights reserved. -# This program is licensed under Mulan PSL v2. -# You can use it according to the terms and conditions of the Mulan PSL v2. -# http://license.coscl.org.cn/MulanPSL2 -# THIS PROGRAM IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, -# EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, -# MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. -# See the Mulan PSL v2 for more details. - -# ############################################# -# @Author : honghua -# @Contact : honghua@iscas.ac.cn -# @Date : 2026-02-21 -# @License : Mulan PSL v2 -# @Desc : Test sorting search results -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - LOG_INFO "开始测试:Test sorting search results" - - # 检查是否已安装lucene-demo包 - LOG_INFO "检查lucene-demo包是否已安装" - if dnf list installed lucene-demo &>/dev/null; then - LOG_INFO "lucene-demo包已安装,测试结束后将保持安装状态" - INSTALLED_BEFORE=true - else - LOG_INFO "lucene-demo包未安装,将在测试步骤中安装" - INSTALLED_BEFORE=false - fi - - # 检查yum源中是否有lucene-demo包 - LOG_INFO "检查yum源中是否有lucene-demo包" - if ! dnf list available lucene-demo &>/dev/null; then - LOG_ERROR "yum源中未找到lucene-demo包" - exit 255 - fi - - # 如果未安装,则安装lucene-demo包 - if [ "$INSTALLED_BEFORE" = false ]; then - LOG_INFO "安装lucene-demo包" - dnf install -y lucene-demo - CHECK_RESULT $? 0 0 "安装lucene-demo包失败" - fi - - # 检查lucene-demo命令是否存在 - LOG_INFO "检查lucene-demo命令是否存在" - if ! command -v lucene-demo &>/dev/null; then - LOG_ERROR "lucene-demo命令不存在" - exit 255 - fi - - # 检查lucene-demo命令是否支持sort参数 - LOG_INFO "检查lucene-demo命令是否支持sort参数" - if ! lucene-demo --help | grep -q "sort"; then - LOG_ERROR "lucene-demo命令不支持sort参数" - exit 255 - fi - - # 执行排序搜索测试 - LOG_INFO "执行排序搜索测试" - lucene-demo search --query "test" --sort "field1" - CHECK_RESULT $? 0 0 "排序搜索测试失败" - - # 如果需要第二个服务器执行命令,示例: - # LOG_INFO "在第二个服务器上执行命令" - # SSH_CMD "ls" "$NODE2_IPV4" "$NODE2_PASSWORD" "$NODE2_USER" - # CHECK_RESULT $? 0 0 "在第二个服务器上执行命令失败" - - # 清理环境:如果测试前未安装,则卸载lucene-demo包 - if [ "$INSTALLED_BEFORE" = false ]; then - LOG_INFO "卸载lucene-demo包" - dnf remove -y lucene-demo - CHECK_RESULT $? 0 0 "卸载lucene-demo包失败" - else - LOG_INFO "测试前已安装lucene-demo包,测试结束后保持安装状态" - fi - - LOG_INFO "测试完成:Test sorting search results" -} - -main "$@" \ No newline at end of file diff --git a/testcases/function_test/pkg_test/lucene/lucene-demo/test_lucene-demo_function_uninstall.sh b/testcases/function_test/pkg_test/lucene/lucene-demo/test_lucene-demo_function_uninstall.sh deleted file mode 100644 index 8e0d0d4f956..00000000000 --- a/testcases/function_test/pkg_test/lucene/lucene-demo/test_lucene-demo_function_uninstall.sh +++ /dev/null @@ -1,78 +0,0 @@ -#!/usr/bin/bash - -# Copyright (c) 2024 ISCAS .ALL rights reserved. -# This program is licensed under Mulan PSL v2. -# You can use it according to the terms and conditions of the Mulan PSL v2. -# http://license.coscl.org.cn/MulanPSL2 -# THIS PROGRAM IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, -# EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, -# MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. -# See the Mulan PSL v2 for more details. - -# ############################################# -# @Author : honghua -# @Contact : honghua@iscas.ac.cn -# @Date : 2026-02-21 -# @License : Mulan PSL v2 -# @Desc : Test uninstallation of lucene-demo package -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - LOG_INFO "开始测试:Test uninstallation of lucene-demo package" - - LOG_INFO "步骤1:检查lucene-demo软件包是否已在yum源中" - if ! dnf list available lucene-demo &>/dev/null; then - LOG_ERROR "yum源中未找到lucene-demo软件包" - exit 255 - fi - LOG_INFO "yum源中存在lucene-demo软件包" - - LOG_INFO "步骤2:检查当前是否已安装lucene-demo" - if rpm -q lucene-demo &>/dev/null; then - LOG_INFO "lucene-demo已安装,测试结束前保持安装状态" - INSTALLED_BEFORE_TEST=1 - else - LOG_INFO "lucene-demo未安装,将在测试前安装" - INSTALLED_BEFORE_TEST=0 - fi - - if [ $INSTALLED_BEFORE_TEST -eq 0 ]; then - LOG_INFO "步骤3:安装lucene-demo软件包" - dnf install -y lucene-demo - CHECK_RESULT $? 0 0 "安装lucene-demo失败" - LOG_INFO "lucene-demo安装成功" - fi - - LOG_INFO "步骤4:验证lucene-demo安装状态" - rpm -q lucene-demo - CHECK_RESULT $? 0 0 "验证lucene-demo安装状态失败" - - LOG_INFO "步骤5:卸载lucene-demo软件包" - dnf remove -y lucene-demo - CHECK_RESULT $? 0 0 "卸载lucene-demo失败" - LOG_INFO "lucene-demo卸载成功" - - LOG_INFO "步骤6:验证lucene-demo是否已卸载" - if rpm -q lucene-demo &>/dev/null; then - LOG_ERROR "lucene-demo卸载后仍存在" - CHECK_RESULT 1 0 0 "lucene-demo卸载验证失败" - else - LOG_INFO "lucene-demo已成功卸载" - fi - - LOG_INFO "步骤7:环境恢复" - if [ $INSTALLED_BEFORE_TEST -eq 1 ]; then - LOG_INFO "恢复:重新安装lucene-demo" - dnf install -y lucene-demo - CHECK_RESULT $? 0 0 "恢复安装lucene-demo失败" - LOG_INFO "lucene-demo恢复安装成功" - else - LOG_INFO "测试前未安装lucene-demo,无需恢复安装" - fi - - LOG_INFO "测试完成:Test uninstallation of lucene-demo package" -} - -main "$@" \ No newline at end of file diff --git a/testcases/function_test/pkg_test/lucene/lucene-demo/test_lucene-demo_function_update_index.sh b/testcases/function_test/pkg_test/lucene/lucene-demo/test_lucene-demo_function_update_index.sh deleted file mode 100644 index 60bbd707008..00000000000 --- a/testcases/function_test/pkg_test/lucene/lucene-demo/test_lucene-demo_function_update_index.sh +++ /dev/null @@ -1,87 +0,0 @@ -#!/usr/bin/bash - -# Copyright (c) 2024 ISCAS .ALL rights reserved. -# This program is licensed under Mulan PSL v2. -# You can use it according to the terms and conditions of the Mulan PSL v2. -# http://license.coscl.org.cn/MulanPSL2 -# THIS PROGRAM IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, -# EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, -# MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. -# See the Mulan PSL v2 for more details. - -# ############################################# -# @Author : honghua -# @Contact : honghua@iscas.ac.cn -# @Date : 2026-02-21 -# @License : Mulan PSL v2 -# @Desc : Test updating an existing index -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - # 检查是否已安装lucene-demo - LOG_INFO "检查是否已安装lucene-demo" - if dnf list installed lucene-demo &>/dev/null; then - LOG_INFO "lucene-demo已安装" - INSTALLED="true" - else - LOG_INFO "lucene-demo未安装" - INSTALLED="false" - fi - - # 检查yum源中是否有lucene-demo软件包 - LOG_INFO "检查yum源中是否有lucene-demo软件包" - if ! dnf list available lucene-demo &>/dev/null; then - LOG_ERROR "yum源中未找到lucene-demo软件包" - exit 255 - fi - - # 如果未安装,则安装lucene-demo - if [ "$INSTALLED" = "false" ]; then - LOG_INFO "安装lucene-demo软件包" - dnf install -y lucene-demo - CHECK_RESULT $? 0 0 "安装lucene-demo失败" - fi - - # 测试更新现有索引 - LOG_INFO "测试更新现有索引" - # 假设lucene-demo提供了更新索引的命令,这里使用示例命令 - # 实际命令需根据lucene-demo的具体实现进行调整 - if ! lucene-demo --help | grep -q "update-index"; then - LOG_ERROR "lucene-demo不支持update-index参数" - exit 255 - fi - - # 执行更新索引命令 - LOG_INFO "执行更新索引命令" - lucene-demo update-index --path /tmp/test_index - CHECK_RESULT $? 0 0 "更新索引失败" - - # 验证索引是否更新成功 - LOG_INFO "验证索引是否更新成功" - # 这里假设有一个验证索引的命令,例如检查索引文件是否存在或内容是否正确 - # 实际验证逻辑需根据lucene-demo的具体实现进行调整 - if [ -f /tmp/test_index/updated_flag ]; then - LOG_INFO "索引更新成功" - else - LOG_ERROR "索引更新失败" - exit 1 - fi - - # 清理测试环境 - LOG_INFO "清理测试环境" - rm -rf /tmp/test_index - CHECK_RESULT $? 0 0 "清理测试环境失败" - - # 如果脚本开始时未安装lucene-demo,则在结束时卸载 - if [ "$INSTALLED" = "false" ]; then - LOG_INFO "卸载lucene-demo软件包" - dnf remove -y lucene-demo - CHECK_RESULT $? 0 0 "卸载lucene-demo失败" - fi - - LOG_INFO "测试完成" -} - -main "$@" \ No newline at end of file diff --git a/testcases/function_test/pkg_test/lucene/lucene-demo/test_lucene-demo_function_version.sh b/testcases/function_test/pkg_test/lucene/lucene-demo/test_lucene-demo_function_version.sh deleted file mode 100644 index dd2f3812100..00000000000 --- a/testcases/function_test/pkg_test/lucene/lucene-demo/test_lucene-demo_function_version.sh +++ /dev/null @@ -1,79 +0,0 @@ -#!/usr/bin/bash - -# Copyright (c) 2024 ISCAS .ALL rights reserved. -# This program is licensed under Mulan PSL v2. -# You can use it according to the terms and conditions of the Mulan PSL v2. -# http://license.coscl.org.cn/MulanPSL2 -# THIS PROGRAM IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, -# EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, -# MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. -# See the Mulan PSL v2 for more details. - -# ############################################# -# @Author : honghua -# @Contact : honghua@iscas.ac.cn -# @Date : 2026-02-21 -# @License : Mulan PSL v2 -# @Desc : Test checking package version -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - # 判断当前环境是否已经安装lucene-demo软件包 - LOG_INFO "检查lucene-demo软件包是否已安装" - rpm -q lucene-demo > /dev/null 2>&1 - if [ $? -eq 0 ]; then - LOG_INFO "lucene-demo软件包已安装,测试结束后将保持安装状态" - INSTALLED_BEFORE="yes" - else - LOG_INFO "lucene-demo软件包未安装,将在测试步骤中安装" - INSTALLED_BEFORE="no" - fi - - # 检查yum源中是否存在lucene-demo软件包 - LOG_INFO "检查yum源中是否存在lucene-demo软件包" - dnf list available lucene-demo > /dev/null 2>&1 - if [ $? -ne 0 ]; then - LOG_ERROR "yum源中未找到lucene-demo软件包" - exit 255 - fi - - # 安装lucene-demo软件包(如果未安装) - if [ "$INSTALLED_BEFORE" = "no" ]; then - LOG_INFO "安装lucene-demo软件包" - dnf install -y lucene-demo - CHECK_RESULT $? 0 0 "安装lucene-demo软件包失败" - fi - - # 测试lucene-demo版本查询功能 - LOG_INFO "测试lucene-demo版本查询功能" - lucene-demo --version > /dev/null 2>&1 - if [ $? -eq 0 ]; then - LOG_INFO "lucene-demo支持--version参数" - lucene-demo --version - CHECK_RESULT $? 0 0 "执行lucene-demo --version命令失败" - else - LOG_INFO "lucene-demo不支持--version参数,尝试使用-v参数" - lucene-demo -v > /dev/null 2>&1 - if [ $? -eq 0 ]; then - LOG_INFO "lucene-demo支持-v参数" - lucene-demo -v - CHECK_RESULT $? 0 0 "执行lucene-demo -v命令失败" - else - LOG_ERROR "lucene-demo不支持--version或-v参数" - exit 255 - fi - fi - - # 清理环境:如果测试前未安装,则卸载软件包 - if [ "$INSTALLED_BEFORE" = "no" ]; then - LOG_INFO "清理环境:卸载lucene-demo软件包" - dnf remove -y lucene-demo - CHECK_RESULT $? 0 0 "卸载lucene-demo软件包失败" - else - LOG_INFO "测试前已安装lucene-demo,保持安装状态" - fi -} - -main "$@" \ No newline at end of file diff --git a/testcases/function_test/pkg_test/perl-Date-Calc/perl-Date-Calc-help/test_perl-Date-Calc-help_function_info.sh b/testcases/function_test/pkg_test/perl-Date-Calc/perl-Date-Calc-help/test_perl-Date-Calc-help_function_info.sh deleted file mode 100644 index 021fc9637fc..00000000000 --- a/testcases/function_test/pkg_test/perl-Date-Calc/perl-Date-Calc-help/test_perl-Date-Calc-help_function_info.sh +++ /dev/null @@ -1,78 +0,0 @@ -#!/usr/bin/bash - -# Copyright (c) 2024 ISCAS .ALL rights reserved. -# This program is licensed under Mulan PSL v2. -# You can use it according to the terms and conditions of the Mulan PSL v2. -# http://license.coscl.org.cn/MulanPSL2 -# THIS PROGRAM IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, -# EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, -# MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. -# See the Mulan PSL v2 for more details. - -# ############################################# -# @Author : honghua -# @Contact : honghua@iscas.ac.cn -# @Date : 2026-03-21 -# @License : Mulan PSL v2 -# @Desc : 测试查询 perl-Date-Calc-help 软件包的基本信息 -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - LOG_INFO "开始测试查询perl-Date-Calc-help软件包的基本信息" - - # 检查环境是否已安装perl-Date-Calc-help - LOG_INFO "检查perl-Date-Calc-help是否已安装" - rpm -q perl-Date-Calc-help > /dev/null 2>&1 - if [ $? -eq 0 ]; then - LOG_INFO "perl-Date-Calc-help已安装,标记为保持安装状态" - KEEP_INSTALLED=1 - else - LOG_INFO "perl-Date-Calc-help未安装,标记为需要清理" - KEEP_INSTALLED=0 - fi - - # 检查yum源中是否有该软件包 - LOG_INFO "检查yum源中是否存在perl-Date-Calc-help软件包" - dnf list available perl-Date-Calc-help > /dev/null 2>&1 - if [ $? -ne 0 ]; then - LOG_ERROR "yum源中未找到perl-Date-Calc-help软件包" - exit 255 - fi - - # 如果未安装,则安装软件包 - if [ $KEEP_INSTALLED -eq 0 ]; then - LOG_INFO "安装perl-Date-Calc-help软件包" - dnf install -y perl-Date-Calc-help - CHECK_RESULT $? 0 0 "安装perl-Date-Calc-help失败" - fi - - # 测试查询软件包基本信息 - LOG_INFO "测试查询perl-Date-Calc-help软件包基本信息" - rpm -qi perl-Date-Calc-help - CHECK_RESULT $? 0 0 "查询perl-Date-Calc-help基本信息失败" - - # 测试查询软件包文件列表 - LOG_INFO "测试查询perl-Date-Calc-help软件包文件列表" - rpm -ql perl-Date-Calc-help - CHECK_RESULT $? 0 0 "查询perl-Date-Calc-help文件列表失败" - - # 测试查询软件包依赖关系 - LOG_INFO "测试查询perl-Date-Calc-help软件包依赖关系" - rpm -qR perl-Date-Calc-help - CHECK_RESULT $? 0 0 "查询perl-Date-Calc-help依赖关系失败" - - # 清理环境:如果测试前未安装,则卸载软件包 - if [ $KEEP_INSTALLED -eq 0 ]; then - LOG_INFO "清理环境:卸载perl-Date-Calc-help软件包" - dnf remove -y perl-Date-Calc-help - CHECK_RESULT $? 0 0 "卸载perl-Date-Calc-help失败" - else - LOG_INFO "保持perl-Date-Calc-help安装状态,无需清理" - fi - - LOG_INFO "测试完成:成功查询perl-Date-Calc-help软件包的基本信息" -} - -main "$@" \ No newline at end of file diff --git a/testcases/function_test/pkg_test/perl-Date-Calc/perl-Date-Calc-help/test_perl-Date-Calc-help_function_man.sh b/testcases/function_test/pkg_test/perl-Date-Calc/perl-Date-Calc-help/test_perl-Date-Calc-help_function_man.sh deleted file mode 100644 index bb61dd138ba..00000000000 --- a/testcases/function_test/pkg_test/perl-Date-Calc/perl-Date-Calc-help/test_perl-Date-Calc-help_function_man.sh +++ /dev/null @@ -1,64 +0,0 @@ -#!/usr/bin/bash - -# Copyright (c) 2024 ISCAS .ALL rights reserved. -# This program is licensed under Mulan PSL v2. -# You can use it according to the terms and conditions of the Mulan PSL v2. -# http://license.coscl.org.cn/MulanPSL2 -# THIS PROGRAM IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, -# EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, -# MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. -# See the Mulan PSL v2 for more details. - -# ############################################# -# @Author : honghua -# @Contact : honghua@iscas.ac.cn -# @Date : 2026-03-21 -# @License : Mulan PSL v2 -# @Desc : 测试查看 perl-Date-Calc-help 提供的 man 帮助文档 -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - LOG_INFO "测试开始:测试查看 perl-Date-Calc-help 提供的 man 帮助文档" - LOG_INFO "步骤1:检查 perl-Date-Calc-help 软件包是否在 yum 源中" - if ! dnf list available perl-Date-Calc-help &>/dev/null; then - LOG_ERROR "perl-Date-Calc-help 软件包不在 yum 源中" - exit 255 - fi - - LOG_INFO "步骤2:检查 perl-Date-Calc-help 是否已安装" - if rpm -q perl-Date-Calc-help &>/dev/null; then - LOG_INFO "perl-Date-Calc-help 已安装,标记为已存在安装" - INSTALLED_FLAG=1 - else - LOG_INFO "perl-Date-Calc-help 未安装,标记为未安装" - INSTALLED_FLAG=0 - LOG_INFO "步骤3:安装 perl-Date-Calc-help 软件包" - dnf install -y perl-Date-Calc-help - CHECK_RESULT $? 0 0 "安装 perl-Date-Calc-help 失败" - fi - - LOG_INFO "步骤4:检查 man 命令是否支持 perl-Date-Calc-help 参数" - if ! man -w perl-Date-Calc-help &>/dev/null; then - LOG_ERROR "man 命令不支持 perl-Date-Calc-help 参数" - exit 255 - fi - - LOG_INFO "步骤5:执行 man perl-Date-Calc-help 命令查看帮助文档" - man perl-Date-Calc-help - CHECK_RESULT $? 0 0 "执行 man perl-Date-Calc-help 命令失败" - - LOG_INFO "步骤6:环境恢复" - if [ $INSTALLED_FLAG -eq 0 ]; then - LOG_INFO "卸载 perl-Date-Calc-help 软件包" - dnf remove -y perl-Date-Calc-help - CHECK_RESULT $? 0 0 "卸载 perl-Date-Calc-help 失败" - else - LOG_INFO "保持 perl-Date-Calc-help 安装状态" - fi - - LOG_INFO "测试完成" -} - -main "$@" \ No newline at end of file diff --git a/testcases/function_test/pkg_test/perl-Date-Calc/perl-Date-Calc-help/test_perl-Date-Calc-help_function_remove.sh b/testcases/function_test/pkg_test/perl-Date-Calc/perl-Date-Calc-help/test_perl-Date-Calc-help_function_remove.sh deleted file mode 100644 index 248f73b860e..00000000000 --- a/testcases/function_test/pkg_test/perl-Date-Calc/perl-Date-Calc-help/test_perl-Date-Calc-help_function_remove.sh +++ /dev/null @@ -1,75 +0,0 @@ -#!/usr/bin/bash - -# Copyright (c) 2024 ISCAS .ALL rights reserved. -# This program is licensed under Mulan PSL v2. -# You can use it according to the terms and conditions of the Mulan PSL v2. -# http://license.coscl.org.cn/MulanPSL2 -# THIS PROGRAM IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, -# EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, -# MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. -# See the Mulan PSL v2 for more details. - -# ############################################# -# @Author : honghua -# @Contact : honghua@iscas.ac.cn -# @Date : 2026-03-21 -# @License : Mulan PSL v2 -# @Desc : 测试卸载 perl-Date-Calc-help 软件包 -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - LOG_INFO "开始测试卸载 perl-Date-Calc-help 软件包" - - LOG_INFO "步骤1: 检查 yum 源中是否存在 perl-Date-Calc-help 软件包" - dnf list available perl-Date-Calc-help 2>/dev/null | grep -q perl-Date-Calc-help - if [ $? -ne 0 ]; then - LOG_ERROR "yum 源中未找到 perl-Date-Calc-help 软件包" - exit 255 - fi - - LOG_INFO "步骤2: 检查系统是否已安装 perl-Date-Calc-help 软件包" - rpm -q perl-Date-Calc-help >/dev/null 2>&1 - if [ $? -eq 0 ]; then - LOG_INFO "perl-Date-Calc-help 软件包已安装,测试结束后将保持安装状态" - INSTALLED=1 - else - LOG_INFO "perl-Date-Calc-help 软件包未安装,将在测试前安装" - INSTALLED=0 - fi - - if [ $INSTALLED -eq 0 ]; then - LOG_INFO "步骤3: 安装 perl-Date-Calc-help 软件包" - dnf install -y perl-Date-Calc-help - CHECK_RESULT $? 0 0 "安装 perl-Date-Calc-help 软件包失败" - fi - - LOG_INFO "步骤4: 执行卸载命令" - dnf remove -y perl-Date-Calc-help - CHECK_RESULT $? 0 0 "卸载 perl-Date-Calc-help 软件包失败" - - LOG_INFO "步骤5: 验证卸载结果" - rpm -q perl-Date-Calc-help >/dev/null 2>&1 - if [ $? -eq 0 ]; then - LOG_ERROR "卸载后 perl-Date-Calc-help 软件包仍然存在" - exit 1 - else - LOG_INFO "perl-Date-Calc-help 软件包已成功卸载" - fi - - if [ $INSTALLED -eq 0 ]; then - LOG_INFO "步骤6: 恢复环境,卸载测试安装的软件包" - dnf remove -y perl-Date-Calc-help 2>/dev/null - LOG_INFO "环境已恢复" - else - LOG_INFO "步骤6: 重新安装 perl-Date-Calc-help 软件包以恢复原始状态" - dnf install -y perl-Date-Calc-help - CHECK_RESULT $? 0 0 "重新安装 perl-Date-Calc-help 软件包失败" - LOG_INFO "环境已恢复" - fi - - LOG_INFO "测试结束" -} - -main "$@" \ No newline at end of file diff --git a/testcases/function_test/pkg_test/python-httmock/python3-httmock/test_python3-httmock_function_mock.sh b/testcases/function_test/pkg_test/python-httmock/python3-httmock/test_python3-httmock_function_mock.sh deleted file mode 100644 index 5cdabc696c6..00000000000 --- a/testcases/function_test/pkg_test/python-httmock/python3-httmock/test_python3-httmock_function_mock.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-04 -# @License : Mulan PSL v2 -# @Desc : Test basic HTTP mock functionality -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - - # 检查python3-httmock是否已安装 - LOG_INFO "检查python3-httmock是否已安装" - if dnf list installed python3-httmock &>/dev/null; then - LOG_INFO "python3-httmock已安装,脚本结束后将保持安装状态" - INSTALLED=true - else - LOG_INFO "python3-httmock未安装,将在测试结束后卸载" - INSTALLED=false - fi - - # 检查yum源中是否有python3-httmock - LOG_INFO "检查yum源中是否有python3-httmock" - if ! dnf list available python3-httmock &>/dev/null; then - LOG_ERROR "yum源中未找到python3-httmock,退出" - exit 255 - fi - - # 安装python3-httmock(如果未安装) - if [ "$INSTALLED" = false ]; then - LOG_INFO "安装python3-httmock" - dnf install -y python3-httmock - CHECK_RESULT $? 0 0 "安装python3-httmock失败" - fi - - # 测试HTTP mock功能 - LOG_INFO "测试HTTP mock功能" - python3 -c " - import httmock - def mock_response(url, request): - return {"status_code": 200, "content": "Mock response"} - with httmock.HTTMock(mock_response): - import requests - response = requests.get("http://example.com") - assert response.status_code == 200 - assert response.text == "Mock response" - " - CHECK_RESULT $? 0 0 "HTTP mock功能测试失败" - - # 清理环境(如果之前未安装) - if [ "$INSTALLED" = false ]; then - LOG_INFO "卸载python3-httmock" - dnf remove -y python3-httmock - CHECK_RESULT $? 0 0 "卸载python3-httmock失败" - fi - - LOG_INFO "测试脚本执行完成" - -} - -main "$@" \ No newline at end of file diff --git a/testcases/function_test/pkg_test/python-olefile/python3-olefile/test_python3-olefile_function_get_metadata.sh b/testcases/function_test/pkg_test/python-olefile/python3-olefile/test_python3-olefile_function_get_metadata.sh deleted file mode 100644 index 1f862789f3c..00000000000 --- a/testcases/function_test/pkg_test/python-olefile/python3-olefile/test_python3-olefile_function_get_metadata.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-02-26 -# @License : Mulan PSL v2 -# @Desc : 测试能否获取OLE文件的元数据信息 -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - LOG_INFO "开始测试:测试能否获取OLE文件的元数据信息" - - # 检查是否已安装python3-olefile软件包 - LOG_INFO "检查是否已安装python3-olefile软件包" - if dnf list installed python3-olefile &>/dev/null; then - LOG_INFO "python3-olefile软件包已安装,脚本结束前将保持安装状态" - INSTALLED=true - else - LOG_INFO "python3-olefile软件包未安装,将在测试步骤中安装" - INSTALLED=false - fi - - # 检查yum源中是否有python3-olefile软件包 - LOG_INFO "检查yum源中是否有python3-olefile软件包" - if ! dnf list available python3-olefile &>/dev/null; then - LOG_ERROR "yum源中未找到python3-olefile软件包" - exit 255 - fi - - # 如果未安装,则安装python3-olefile软件包 - if [ "$INSTALLED" = false ]; then - LOG_INFO "安装python3-olefile软件包" - dnf install -y python3-olefile - CHECK_RESULT $? 0 0 "安装python3-olefile软件包失败" - fi - - # 创建一个测试用的OLE文件(例如一个简单的Excel文件) - LOG_INFO "创建一个测试用的OLE文件" - cat > test_excel.xlsx << "EOF" - 这是一个测试用的Excel文件,用于测试OLE文件的元数据信息获取功能。 - EOF - - # 检查是否成功创建了测试文件 - if [ ! -f test_excel.xlsx ]; then - LOG_ERROR "创建测试文件失败" - exit 1 - fi - - # 使用python3-olefile获取OLE文件的元数据信息 - LOG_INFO "使用python3-olefile获取OLE文件的元数据信息" - python3 -c " - import olefile - try: - ole = olefile.OleFileIO("test_excel.xlsx") - metadata = ole.get_metadata() - if metadata: - print("成功获取OLE文件的元数据信息") - print(metadata) - else: - print("未找到元数据信息") - except Exception as e: - print("获取元数据信息失败:", e) - exit(1) - " - CHECK_RESULT $? 0 0 "获取OLE文件的元数据信息失败" - - # 清理测试文件 - LOG_INFO "清理测试文件" - rm -f test_excel.xlsx - - # 如果之前未安装python3-olefile软件包,则卸载 - if [ "$INSTALLED" = false ]; then - LOG_INFO "卸载python3-olefile软件包" - dnf remove -y python3-olefile - CHECK_RESULT $? 0 0 "卸载python3-olefile软件包失败" - fi - - LOG_INFO "测试完成:成功测试能否获取OLE文件的元数据信息" -} - -main "$@" \ No newline at end of file diff --git a/testcases/function_test/pkg_test/python-olefile/python3-olefile/test_python3-olefile_function_import.sh b/testcases/function_test/pkg_test/python-olefile/python3-olefile/test_python3-olefile_function_import.sh deleted file mode 100644 index 18682e521f8..00000000000 --- a/testcases/function_test/pkg_test/python-olefile/python3-olefile/test_python3-olefile_function_import.sh +++ /dev/null @@ -1,66 +0,0 @@ -#!/usr/bin/bash - -# Copyright (c) 2024 ISCAS .ALL rights reserved. -# This program is licensed under Mulan PSL v2. -# You can use it according to the terms and conditions of the Mulan PSL v2. -# http://license.coscl.org.cn/MulanPSL2 -# THIS PROGRAM IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, -# EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, -# MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. -# See the Mulan PSL v2 for more details. - -# ############################################# -# @Author : honghua -# @Contact : honghua@iscas.ac.cn -# @Date : 2026-02-26 -# @License : Mulan PSL v2 -# @Desc : 测试安装后能否成功导入olefile模块 -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - set -e - - LOG_INFO "开始测试:测试安装后能否成功导入olefile模块" - - LOG_INFO "步骤1:检查yum源中是否存在python3-olefile软件包" - dnf list available python3-olefile > /dev/null 2>&1 - if [ $? -ne 0 ]; then - LOG_ERROR "yum源中未找到python3-olefile软件包" - exit 255 - fi - - LOG_INFO "步骤2:检查当前是否已安装python3-olefile" - rpm -q python3-olefile > /dev/null 2>&1 - if [ $? -eq 0 ]; then - LOG_INFO "python3-olefile已安装,标记为无需清理" - NEED_CLEANUP=0 - else - LOG_INFO "python3-olefile未安装,标记为需要清理" - NEED_CLEANUP=1 - fi - - if [ ${NEED_CLEANUP} -eq 1 ]; then - LOG_INFO "步骤3:安装python3-olefile软件包" - dnf install -y python3-olefile - CHECK_RESULT $? 0 0 "安装python3-olefile失败" - fi - - LOG_INFO "步骤4:测试能否成功导入olefile模块" - python3 -c "import olefile; print("olefile模块导入成功")" - CHECK_RESULT $? 0 0 "导入olefile模块失败" - - LOG_INFO "步骤5:清理环境" - if [ ${NEED_CLEANUP} -eq 1 ]; then - LOG_INFO "卸载python3-olefile软件包" - dnf remove -y python3-olefile - CHECK_RESULT $? 0 0 "卸载python3-olefile失败" - else - LOG_INFO "保持python3-olefile已安装状态" - fi - - LOG_INFO "测试完成" -} - -main "$@" \ No newline at end of file diff --git a/testcases/function_test/pkg_test/python-olefile/python3-olefile/test_python3-olefile_function_install.sh b/testcases/function_test/pkg_test/python-olefile/python3-olefile/test_python3-olefile_function_install.sh deleted file mode 100644 index f5f3ab5e887..00000000000 --- a/testcases/function_test/pkg_test/python-olefile/python3-olefile/test_python3-olefile_function_install.sh +++ /dev/null @@ -1,74 +0,0 @@ -#!/usr/bin/bash - -# Copyright (c) 2024 ISCAS .ALL rights reserved. -# This program is licensed under Mulan PSL v2. -# You can use it according to the terms and conditions of the Mulan PSL v2. -# http://license.coscl.org.cn/MulanPSL2 -# THIS PROGRAM IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, -# EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, -# MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. -# See the Mulan PSL v2 for more details. - -# ############################################# -# @Author : honghua -# @Contact : honghua@iscas.ac.cn -# @Date : 2026-02-26 -# @License : Mulan PSL v2 -# @Desc : 测试python3-olefile软件包能否正常安装 -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - # 检查是否已经安装了python3-olefile - LOG_INFO "检查当前环境是否已安装python3-olefile软件包" - rpm -q python3-olefile &> /dev/null - if [ $? -eq 0 ]; then - LOG_INFO "当前环境已安装python3-olefile,脚本结束时将保持安装状态" - already_installed=1 - else - LOG_INFO "当前环境未安装python3-olefile,将在测试过程中安装" - already_installed=0 - fi - - # 检查yum源中是否有python3-olefile软件包 - LOG_INFO "检查yum源中是否存在python3-olefile软件包" - dnf list available python3-olefile &> /dev/null - if [ $? -ne 0 ]; then - LOG_ERROR "yum源中未找到python3-olefile软件包" - exit 255 - fi - LOG_INFO "yum源中存在python3-olefile软件包" - - # 如果未安装,则进行安装 - if [ $already_installed -eq 0 ]; then - LOG_INFO "开始安装python3-olefile软件包" - dnf install -y python3-olefile - CHECK_RESULT $? 0 0 "安装python3-olefile失败" - LOG_INFO "成功安装python3-olefile软件包" - fi - - # 验证软件包是否安装成功 - LOG_INFO "验证python3-olefile软件包是否安装成功" - rpm -q python3-olefile - CHECK_RESULT $? 0 0 "python3-olefile软件包未正确安装" - - # 验证python3-olefile的基本功能 - LOG_INFO "验证python3-olefile的基本功能" - python3 -c "import olefile; print("olefile module version:", olefile.__version__)" 2>/dev/null - CHECK_RESULT $? 0 0 "python3-olefile模块导入失败" - - # 清理环境:如果测试前未安装,则在测试后卸载 - if [ $already_installed -eq 0 ]; then - LOG_INFO "清理环境:卸载python3-olefile软件包" - dnf remove -y python3-olefile - CHECK_RESULT $? 0 0 "卸载python3-olefile失败" - LOG_INFO "成功卸载python3-olefile软件包" - else - LOG_INFO "测试前已安装python3-olefile,保持安装状态" - fi - - LOG_INFO "测试完成:python3-olefile软件包能正常安装和卸载" -} - -main "$@" \ No newline at end of file diff --git a/testcases/function_test/pkg_test/python-olefile/python3-olefile/test_python3-olefile_function_is_olefile.sh b/testcases/function_test/pkg_test/python-olefile/python3-olefile/test_python3-olefile_function_is_olefile.sh deleted file mode 100644 index eab9c32e771..00000000000 --- a/testcases/function_test/pkg_test/python-olefile/python3-olefile/test_python3-olefile_function_is_olefile.sh +++ /dev/null @@ -1,125 +0,0 @@ -#!/usr/bin/bash - -# Copyright (c) 2024 ISCAS .ALL rights reserved. -# This program is licensed under Mulan PSL v2. -# You can use it according to the terms and conditions of the Mulan PSL v2. -# http://license.coscl.org.cn/MulanPSL2 -# THIS PROGRAM IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, -# EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, -# MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. -# See the Mulan PSL v2 for more details. - -# ############################################# -# @Author : honghua -# @Contact : honghua@iscas.ac.cn -# @Date : 2026-02-26 -# @License : Mulan PSL v2 -# @Desc : 测试isOleFile函数能否正确识别OLE文件 -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - # 检查是否已经安装了python3-olefile软件包 - LOG_INFO "检查python3-olefile软件包是否已安装" - if dnf list installed python3-olefile &>/dev/null; then - LOG_INFO "python3-olefile软件包已安装,标记为保持安装状态" - KEEP_INSTALLED=1 - else - LOG_INFO "python3-olefile软件包未安装" - KEEP_INSTALLED=0 - fi - - # 检查yum源中是否有python3-olefile软件包 - LOG_INFO "检查yum源中是否有python3-olefile软件包" - if ! dnf list available python3-olefile &>/dev/null; then - LOG_ERROR "yum源中未找到python3-olefile软件包" - exit 255 - fi - - # 如果未安装,则安装python3-olefile - if [ $KEEP_INSTALLED -eq 0 ]; then - LOG_INFO "开始安装python3-olefile软件包" - dnf install -y python3-olefile - CHECK_RESULT $? 0 0 "安装python3-olefile软件包失败" - fi - - # 创建测试用的OLE文件和非OLE文件 - LOG_INFO "创建测试文件" - cat > /tmp/test_ole.doc << "EOF" - 这是一个OLE文件测试内容 - EOF - # 创建一个简单的OLE文件头 - printf "\xD0\xCF\x11\xE0\xA1\xB1\x1A\xE1" > /tmp/real_ole.ole - cat > /tmp/non_ole.txt << "EOF" - 这是一个普通文本文件 - EOF - - # 测试isOleFile函数识别OLE文件 - LOG_INFO "测试isOleFile函数识别OLE文件" - python3 -c " - from olefile import isOleFile - import sys - - # 测试真实OLE文件 - if isOleFile("/tmp/real_ole.ole"): - print("SUCCESS: 正确识别OLE文件") - else: - print("FAIL: 未能识别OLE文件") - sys.exit(1) - - # 测试非OLE文件 - if not isOleFile("/tmp/non_ole.txt"): - print("SUCCESS: 正确识别非OLE文件") - else: - print("FAIL: 错误地将非OLE文件识别为OLE文件") - sys.exit(1) - - # 测试不存在的文件 - try: - isOleFile("/tmp/nonexistent.file") - print("FAIL: 不存在的文件未引发异常") - sys.exit(1) - except Exception as e: - print("SUCCESS: 不存在的文件正确处理") - " - CHECK_RESULT $? 0 0 "isOleFile函数测试失败" - - # 测试isOleFile函数参数 - LOG_INFO "测试isOleFile函数参数" - python3 -c " - from olefile import isOleFile - - # 测试无参数调用 - try: - isOleFile() - print("FAIL: 无参数调用未引发异常") - exit(1) - except TypeError: - print("SUCCESS: 无参数调用正确处理") - - # 测试错误类型参数 - try: - isOleFile(123) - print("FAIL: 错误类型参数未引发异常") - exit(1) - except TypeError: - print("SUCCESS: 错误类型参数正确处理") - " - CHECK_RESULT $? 0 0 "isOleFile函数参数测试失败" - - # 清理测试文件 - LOG_INFO "清理测试文件" - rm -f /tmp/test_ole.doc /tmp/real_ole.ole /tmp/non_ole.txt - - # 如果测试前未安装,则卸载软件包 - if [ $KEEP_INSTALLED -eq 0 ]; then - LOG_INFO "卸载python3-olefile软件包" - dnf remove -y python3-olefile - CHECK_RESULT $? 0 0 "卸载python3-olefile软件包失败" - fi - - LOG_INFO "测试完成" -} - -main "$@" \ No newline at end of file diff --git a/testcases/function_test/pkg_test/python-olefile/python3-olefile/test_python3-olefile_function_list_streams.sh b/testcases/function_test/pkg_test/python-olefile/python3-olefile/test_python3-olefile_function_list_streams.sh deleted file mode 100644 index 2c7aabf8ad3..00000000000 --- a/testcases/function_test/pkg_test/python-olefile/python3-olefile/test_python3-olefile_function_list_streams.sh +++ /dev/null @@ -1,166 +0,0 @@ -#!/usr/bin/bash - -# Copyright (c) 2024 ISCAS .ALL rights reserved. -# This program is licensed under Mulan PSL v2. -# You can use it according to the terms and conditions of the Mulan PSL v2. -# http://license.coscl.org.cn/MulanPSL2 -# THIS PROGRAM IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, -# EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, -# MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. -# See the Mulan PSL v2 for more details. - -# ############################################# -# @Author : honghua -# @Contact : honghua@iscas.ac.cn -# @Date : 2026-02-26 -# @License : Mulan PSL v2 -# @Desc : 测试能否列出OLE文件中的流和存储 -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - # 定义日志函数(虽然题目说直接使用,但实际未定义,这里提供定义) - LOG_INFO() { - echo "[INFO] $*" - } - LOG_ERROR() { - echo "[ERROR] $*" >&2 - } - - # 检查软件包是否存在 - check_package_exist() { - local pkg=$1 - dnf list available "$pkg" &>/dev/null - if [ $? -ne 0 ]; then - LOG_ERROR "软件包 $pkg 在yum源中不存在" - exit 255 - fi - } - - # 检查命令参数是否支持 - check_command_param() { - local cmd=$1 - local param=$2 - $cmd --help 2>&1 | grep -q "$param" - if [ $? -ne 0 ]; then - LOG_ERROR "命令 $cmd 不支持参数 $param" - exit 255 - fi - } - - # 检查命令执行结果 - check_cmd_result() { - local result=$1 - local expected=$2 - local error_msg=$3 - if [ $result -ne $expected ]; then - LOG_ERROR "$error_msg" - exit $result - fi - } - - # 主测试函数 - main() { - LOG_INFO "开始测试:测试能否列出OLE文件中的流和存储" - - # 检查是否已安装python3-olefile - LOG_INFO "检查python3-olefile是否已安装" - if rpm -q python3-olefile &>/dev/null; then - LOG_INFO "python3-olefile已安装,测试结束后将保持安装状态" - already_installed=1 - else - LOG_INFO "python3-olefile未安装,将在测试过程中安装" - already_installed=0 - fi - - # 检查软件包是否存在 - LOG_INFO "检查yum源中是否存在python3-olefile软件包" - check_package_exist "python3-olefile" - - # 安装软件包(如果未安装) - if [ $already_installed -eq 0 ]; then - LOG_INFO "安装python3-olefile软件包" - dnf install -y python3-olefile - CHECK_RESULT $? 0 0 "安装python3-olefile失败" - fi - - # 检查olefile命令参数是否支持 - LOG_INFO "检查olefile命令是否支持list-streams参数" - check_command_param "olefile" "list-streams" - - # 创建测试OLE文件 - LOG_INFO "创建测试OLE文件" - cat > test_ole.py << "EOF" - from olefile import OleFileIO - import io - - # 创建一个简单的OLE文件 - ole = OleFileIO() - stream_data = b"Test stream data" - ole.write_stream("Root Entry/TestStream", stream_data) - ole.write_stream("Root Entry/AnotherStream", b"Another test data") - ole.save("test.ole") - EOF - - python3 test_ole.py - CHECK_RESULT $? 0 0 "创建测试OLE文件失败" - - # 测试列出OLE文件中的流和存储 - LOG_INFO "执行olefile list-streams命令测试" - olefile list-streams test.ole - CHECK_RESULT $? 0 0 "列出OLE文件流和存储失败" - - # 验证输出结果 - LOG_INFO "验证输出结果" - output=$(olefile list-streams test.ole 2>/dev/null) - echo "$output" | grep -q "TestStream" - CHECK_RESULT $? 0 0 "未找到预期的TestStream" - - echo "$output" | grep -q "AnotherStream" - CHECK_RESULT $? 0 0 "未找到预期的AnotherStream" - - LOG_INFO "测试通过:成功列出OLE文件中的流和存储" - } - - # 环境清理函数 - cleanup() { - LOG_INFO "开始清理测试环境" - - # 删除测试文件 - if [ -f test.ole ]; then - rm -f test.ole - LOG_INFO "删除测试文件test.ole" - fi - - if [ -f test_ole.py ]; then - rm -f test_ole.py - LOG_INFO "删除测试脚本test_ole.py" - fi - - # 卸载软件包(如果是测试期间安装的) - if [ $already_installed -eq 0 ]; then - LOG_INFO "卸载python3-olefile软件包" - dnf remove -y python3-olefile - if [ $? -ne 0 ]; then - LOG_ERROR "卸载python3-olefile失败" - else - LOG_INFO "成功卸载python3-olefile" - fi - else - LOG_INFO "保持python3-olefile安装状态" - fi - - LOG_INFO "环境清理完成" - } - - # 设置陷阱确保环境清理 - trap cleanup EXIT - - # 执行主测试 - main - - exit 0 -} - -main "$@" \ No newline at end of file diff --git a/testcases/function_test/pkg_test/python-olefile/python3-olefile/test_python3-olefile_function_open_ole.sh b/testcases/function_test/pkg_test/python-olefile/python3-olefile/test_python3-olefile_function_open_ole.sh deleted file mode 100644 index cc9380114eb..00000000000 --- a/testcases/function_test/pkg_test/python-olefile/python3-olefile/test_python3-olefile_function_open_ole.sh +++ /dev/null @@ -1,94 +0,0 @@ -#!/usr/bin/bash - -# Copyright (c) 2024 ISCAS .ALL rights reserved. -# This program is licensed under Mulan PSL v2. -# You can use it according to the terms and conditions of the Mulan PSL v2. -# http://license.coscl.org.cn/MulanPSL2 -# THIS PROGRAM IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, -# EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, -# MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. -# See the Mulan PSL v2 for more details. - -# ############################################# -# @Author : honghua -# @Contact : honghua@iscas.ac.cn -# @Date : 2026-02-26 -# @License : Mulan PSL v2 -# @Desc : 测试能否使用OleFileIO打开一个有效的OLE文件 -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - # 定义日志函数 - LOG_INFO() { - echo "[INFO] $1" - } - - LOG_ERROR() { - echo "[ERROR] $1" - } - - # 测试函数:测试能否使用OleFileIO打开一个有效的OLE文件 - test_python3_olefile_function_open_ole() { - # 步骤1:检查是否已安装python3-olefile软件包 - LOG_INFO "步骤1:检查是否已安装python3-olefile软件包" - if dnf list installed python3-olefile &>/dev/null; then - LOG_INFO "python3-olefile已安装,测试完成后将保持安装状态" - INSTALLED_BEFORE=true - else - LOG_INFO "python3-olefile未安装,将在测试前安装并在测试后卸载" - INSTALLED_BEFORE=false - fi - - # 步骤2:检查yum源中是否有python3-olefile软件包 - LOG_INFO "步骤2:检查yum源中是否有python3-olefile软件包" - if ! dnf list available python3-olefile &>/dev/null; then - LOG_ERROR "yum源中未找到python3-olefile软件包" - exit 255 - fi - - # 步骤3:如果未安装,则安装python3-olefile - if [ "$INSTALLED_BEFORE" = false ]; then - LOG_INFO "步骤3:安装python3-olefile软件包" - dnf install -y python3-olefile - CHECK_RESULT $? 0 0 "安装python3-olefile失败" - fi - - # 步骤4:创建一个有效的OLE文件用于测试 - LOG_INFO "步骤4:创建一个有效的OLE文件用于测试" - cat > test_ole_file.py << "EOF" - import olefile - ole = olefile.OleFileIO("test.ole") - ole.close() - EOF - # 创建一个简单的OLE文件(这里使用一个示例文件) - # 注意:这里使用一个虚拟的OLE文件,实际测试中应使用真实的OLE文件 - echo "这是一个虚拟的OLE文件内容" > test.ole - - # 步骤5:使用OleFileIO打开OLE文件 - LOG_INFO "步骤5:使用OleFileIO打开OLE文件" - python3 test_ole_file.py - CHECK_RESULT $? 0 0 "使用OleFileIO打开OLE文件失败" - - # 步骤6:清理测试文件 - LOG_INFO "步骤6:清理测试文件" - rm -f test_ole_file.py test.ole - - # 步骤7:如果测试前未安装,则卸载python3-olefile - if [ "$INSTALLED_BEFORE" = false ]; then - LOG_INFO "步骤7:卸载python3-olefile软件包" - dnf remove -y python3-olefile - CHECK_RESULT $? 0 0 "卸载python3-olefile失败" - else - LOG_INFO "步骤7:测试前已安装python3-olefile,保持安装状态" - fi - - LOG_INFO "测试完成:成功使用OleFileIO打开一个有效的OLE文件" - } - - # 执行测试函数 - test_python3_olefile_function_open_ole -} - -main "$@" \ No newline at end of file diff --git a/testcases/function_test/pkg_test/python-olefile/python3-olefile/test_python3-olefile_function_read_stream.sh b/testcases/function_test/pkg_test/python-olefile/python3-olefile/test_python3-olefile_function_read_stream.sh deleted file mode 100644 index b75c2ecd663..00000000000 --- a/testcases/function_test/pkg_test/python-olefile/python3-olefile/test_python3-olefile_function_read_stream.sh +++ /dev/null @@ -1,90 +0,0 @@ -#!/usr/bin/bash - -# Copyright (c) 2024 ISCAS .ALL rights reserved. -# This program is licensed under Mulan PSL v2. -# You can use it according to the terms and conditions of the Mulan PSL v2. -# http://license.coscl.org.cn/MulanPSL2 -# THIS PROGRAM IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, -# EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, -# MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. -# See the Mulan PSL v2 for more details. - -# ############################################# -# @Author : honghua -# @Contact : honghua@iscas.ac.cn -# @Date : 2026-02-26 -# @License : Mulan PSL v2 -# @Desc : 测试能否从OLE文件的指定流中读取数据 -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - set -e - - LOG_INFO "1. 检查测试环境是否已安装python3-olefile软件包" - if rpm -q python3-olefile &>/dev/null; then - LOG_INFO "检测到python3-olefile已安装,脚本结束后将保持安装状态" - INSTALLED_BEFORE="true" - else - LOG_INFO "未检测到python3-olefile安装" - INSTALLED_BEFORE="false" - fi - - LOG_INFO "2. 检查yum源中是否存在python3-olefile软件包" - if ! dnf list available python3-olefile &>/dev/null; then - LOG_ERROR "yum源中未找到python3-olefile软件包" - exit 255 - fi - - if [ "$INSTALLED_BEFORE" = "false" ]; then - LOG_INFO "3. 安装python3-olefile软件包" - dnf install -y python3-olefile - CHECK_RESULT $? 0 0 "安装python3-olefile失败" - fi - - LOG_INFO "4. 创建一个简单的OLE文件用于测试" - cat > /tmp/create_ole.py << "EOF" - import olefile - ole = olefile.OleFileIO("/tmp/test.ole", write_mode=True) - ole.write_stream("test_stream", b"This is test data for olefile read_stream function.") - ole.close() - EOF - python3 /tmp/create_ole.py - CHECK_RESULT $? 0 0 "创建测试OLE文件失败" - - LOG_INFO "5. 测试能否从OLE文件的指定流中读取数据" - cat > /tmp/test_read_stream.py << "EOF" - import olefile - import sys - try: - ole = olefile.OleFileIO("/tmp/test.ole") - data = ole.openstream("test_stream").read() - if data == b"This is test data for olefile read_stream function.": - print("SUCCESS: 成功从指定流中读取数据") - sys.exit(0) - else: - print("FAIL: 读取的数据与预期不符") - sys.exit(1) - except Exception as e: - print(f"FAIL: 读取流时发生异常: {e}") - sys.exit(1) - EOF - python3 /tmp/test_read_stream.py - CHECK_RESULT $? 0 0 "从OLE文件指定流读取数据失败" - - LOG_INFO "6. 清理测试过程中创建的临时文件" - rm -f /tmp/test.ole /tmp/create_ole.py /tmp/test_read_stream.py - - if [ "$INSTALLED_BEFORE" = "false" ]; then - LOG_INFO "7. 卸载测试安装的python3-olefile软件包" - dnf remove -y python3-olefile - CHECK_RESULT $? 0 0 "卸载python3-olefile失败" - else - LOG_INFO "7. 测试前已安装python3-olefile,保持安装状态,无需卸载" - fi - - LOG_INFO "测试完成,环境已恢复" -} - -main "$@" \ No newline at end of file diff --git a/testcases/function_test/pkg_test/python-prometheus-client/python-prometheus-client-help/test_python-prometheus-client-help_command_001.sh b/testcases/function_test/pkg_test/python-prometheus-client/python-prometheus-client-help/test_python-prometheus-client-help_command_001.sh deleted file mode 100644 index 5b2ae0eb340..00000000000 --- a/testcases/function_test/pkg_test/python-prometheus-client/python-prometheus-client-help/test_python-prometheus-client-help_command_001.sh +++ /dev/null @@ -1,69 +0,0 @@ -#!/usr/bin/bash - -# Copyright (c) 2024 ISCAS .ALL rights reserved. -# This program is licensed under Mulan PSL v2. -# You can use it according to the terms and conditions of the Mulan PSL v2. -# http://license.coscl.org.cn/MulanPSL2 -# THIS PROGRAM IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, -# EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, -# MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. -# See the Mulan PSL v2 for more details. - -# ############################################# -# @Author : honghua -# @Contact : honghua@iscas.ac.cn -# @Date : 2025-06-19 -# @License : Mulan PSL v2 -# @Desc : 测试python-prometheus-client-help包的安装功能,验证软件包能否正常安装。 -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - - LOG_INFO "开始测试python-prometheus-client-help包的安装功能" - - # 检查软件包是否已在yum源中 - LOG_INFO "检查yum源中是否存在python-prometheus-client-help包" - dnf list available python-prometheus-client-help > /dev/null 2>&1 - if [ $? -ne 0 ]; then - LOG_ERROR "yum源中未找到python-prometheus-client-help包" - exit 255 - fi - - # 检查是否已安装软件包 - LOG_INFO "检查系统中是否已安装python-prometheus-client-help包" - rpm -q python-prometheus-client-help > /dev/null 2>&1 - if [ $? -eq 0 ]; then - LOG_INFO "系统中已安装python-prometheus-client-help包,跳过安装步骤" - installed=true - else - installed=false - fi - - # 如果未安装,则进行安装 - if [ "$installed" = false ]; then - LOG_INFO "开始安装python-prometheus-client-help包" - dnf install -y python-prometheus-client-help > /dev/null 2>&1 - CHECK_RESULT $? 0 0 "安装python-prometheus-client-help包失败" - LOG_INFO "成功安装python-prometheus-client-help包" - fi - - # 验证软件包功能(此处假设验证命令为查看帮助信息) - LOG_INFO "验证python-prometheus-client-help包的帮助命令" - prometheus_client_help --help > /dev/null 2>&1 - CHECK_RESULT $? 0 0 "验证python-prometheus-client-help包的帮助命令失败" - - # 清理环境:如果脚本开始时未安装,则卸载软件包 - if [ "$installed" = false ]; then - LOG_INFO "卸载python-prometheus-client-help包以恢复环境" - dnf remove -y python-prometheus-client-help > /dev/null 2>&1 - CHECK_RESULT $? 0 0 "卸载python-prometheus-client-help包失败" - LOG_INFO "成功卸载python-prometheus-client-help包" - fi - - LOG_INFO "测试完成,环境已恢复" - -} - -main "$@" \ No newline at end of file diff --git a/testcases/function_test/pkg_test/python-prometheus-client/python-prometheus-client-help/test_python-prometheus-client-help_command_004.sh b/testcases/function_test/pkg_test/python-prometheus-client/python-prometheus-client-help/test_python-prometheus-client-help_command_004.sh deleted file mode 100644 index e0e7178c5f9..00000000000 --- a/testcases/function_test/pkg_test/python-prometheus-client/python-prometheus-client-help/test_python-prometheus-client-help_command_004.sh +++ /dev/null @@ -1,99 +0,0 @@ -#!/usr/bin/bash - -# Copyright (c) 2024 ISCAS .ALL rights reserved. -# This program is licensed under Mulan PSL v2. -# You can use it according to the terms and conditions of the Mulan PSL v2. -# http://license.coscl.org.cn/MulanPSL2 -# THIS PROGRAM IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, -# EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, -# MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. -# See the Mulan PSL v2 for more details. - -# ############################################# -# @Author : honghua -# @Contact : honghua@iscas.ac.cn -# @Date : 2025-06-19 -# @License : Mulan PSL v2 -# @Desc : 测试python-prometheus-client-help包的降级功能,验证软件包能否正常降级。 -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - LOG_INFO "开始测试python-prometheus-client-help包的降级功能" - - # 检查yum源中是否存在python-prometheus-client-help包 - LOG_INFO "检查yum源中是否存在python-prometheus-client-help包" - dnf list available python-prometheus-client-help &> /dev/null - if [ $? -ne 0 ]; then - LOG_ERROR "yum源中不存在python-prometheus-client-help包" - exit 255 - fi - - # 检查当前是否已安装python-prometheus-client-help包 - LOG_INFO "检查当前是否已安装python-prometheus-client-help包" - rpm -q python-prometheus-client-help &> /dev/null - if [ $? -eq 0 ]; then - installed=true - LOG_INFO "环境已安装python-prometheus-client-help包" - else - installed=false - LOG_INFO "环境未安装python-prometheus-client-help包,将进行安装" - fi - - # 如果未安装,则安装软件包作为测试步骤 - if [ "$installed" = false ]; then - LOG_INFO "安装python-prometheus-client-help包" - dnf install -y python-prometheus-client-help - CHECK_RESULT $? 0 0 "安装python-prometheus-client-help包失败" - fi - - # 获取当前软件包的版本信息 - LOG_INFO "获取当前软件包的版本信息" - current_version=$(rpm -q --queryformat '%{VERSION}-%{RELEASE}' python-prometheus-client-help) - CHECK_RESULT $? 0 0 "获取当前软件包版本失败" - - # 检查是否存在旧版本可供降级 - LOG_INFO "检查是否存在旧版本可供降级" - dnf list --showduplicates python-prometheus-client-help | grep -v "$current_version" &> /dev/null - if [ $? -ne 0 ]; then - LOG_ERROR "没有可用的旧版本供降级" - exit 255 - fi - - # 获取一个旧版本的软件包信息 - LOG_INFO "获取一个旧版本的软件包信息" - old_version=$(dnf list --showduplicates python-prometheus-client-help | grep -v "$current_version" | head -n1 | awk '{print $2}') - CHECK_RESULT $? 0 0 "获取旧版本软件包信息失败" - - # 执行降级操作 - LOG_INFO "执行降级操作到版本: $old_version" - dnf downgrade -y python-prometheus-client-help-$old_version - CHECK_RESULT $? 0 0 "降级操作失败" - - # 验证降级后的版本是否正确 - LOG_INFO "验证降级后的版本是否正确" - downgraded_version=$(rpm -q --queryformat '%{VERSION}-%{RELEASE}' python-prometheus-client-help) - if [ "$downgraded_version" != "$old_version" ]; then - LOG_ERROR "降级后的版本与预期不符,预期: $old_version, 实际: $downgraded_version" - exit 1 - else - LOG_INFO "降级成功,当前版本: $downgraded_version" - fi - - # 恢复环境到初始状态(如果初始未安装则卸载) - if [ "$installed" = false ]; then - LOG_INFO "恢复环境,卸载python-prometheus-client-help包" - dnf remove -y python-prometheus-client-help - CHECK_RESULT $? 0 0 "卸载python-prometheus-client-help包失败" - else - # 如果初始已安装,则恢复到原始版本(重新升级) - LOG_INFO "恢复到原始版本: $current_version" - dnf upgrade -y python-prometheus-client-help-$current_version - CHECK_RESULT $? 0 0 "恢复到原始版本失败" - fi - - LOG_INFO "测试完成,环境已恢复" -} - -main "$@" \ No newline at end of file diff --git a/testcases/function_test/pkg_test/python-prometheus-client/python-prometheus-client-help/test_python-prometheus-client-help_command_005.sh b/testcases/function_test/pkg_test/python-prometheus-client/python-prometheus-client-help/test_python-prometheus-client-help_command_005.sh deleted file mode 100644 index 524cb22edfd..00000000000 --- a/testcases/function_test/pkg_test/python-prometheus-client/python-prometheus-client-help/test_python-prometheus-client-help_command_005.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-06-19 -# @License : Mulan PSL v2 -# @Desc : 测试python-prometheus-client-help包的回退功能,验证软件包能否正常回退到上一个版本。 -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - - LOG_INFO "开始测试python-prometheus-client-help包的回退功能" - - # 检查软件包是否已安装 - if rpm -q python-prometheus-client-help &> /dev/null; then - LOG_INFO "检测到python-prometheus-client-help已安装,脚本结束后将保持安装状态" - INSTALLED=true - else - LOG_INFO "未检测到python-prometheus-client-help安装,将在测试结束后卸载" - INSTALLED=false - fi - - # 检查yum源中是否存在软件包 - LOG_INFO "检查yum源中是否存在python-prometheus-client-help软件包" - if ! dnf list available python-prometheus-client-help &> /dev/null; then - LOG_ERROR "yum源中未找到python-prometheus-client-help软件包" - exit 255 - fi - - # 获取当前版本 - CURRENT_VERSION=$(rpm -q --queryformat '%{VERSION}-%{RELEASE}' python-prometheus-client-help) - LOG_INFO "当前安装的版本为: $CURRENT_VERSION" - - # 获取可用的旧版本列表 - LOG_INFO "获取可用的旧版本列表" - OLD_VERSIONS=$(dnf history package python-prometheus-client-help | grep -oP 'python-prometheus-client-help-\K[0-9].*?(?=\.)' | sort -u) - if [ -z "$OLD_VERSIONS" ]; then - LOG_ERROR "未找到可回退的旧版本" - exit 255 - fi - - # 选择第一个旧版本作为回退目标 - TARGET_VERSION=$(echo "$OLD_VERSIONS" | head -n1) - LOG_INFO "准备回退到版本: $TARGET_VERSION" - - # 执行回退操作 - LOG_INFO "执行回退操作" - dnf downgrade -y python-prometheus-client-help-$TARGET_VERSION &> /dev/null - CHECK_RESULT $? 0 0 "回退操作失败" - - # 验证回退后的版本 - NEW_VERSION=$(rpm -q --queryformat '%{VERSION}-%{RELEASE}' python-prometheus-client-help) - LOG_INFO "回退后的版本为: $NEW_VERSION" - if [ "$NEW_VERSION" != "$TARGET_VERSION" ]; then - LOG_ERROR "回退后的版本与目标版本不一致" - exit 1 - fi - - # 清理环境:如果最初未安装,则卸载软件包 - if [ "$INSTALLED" = false ]; then - LOG_INFO "清理环境:卸载python-prometheus-client-help" - dnf remove -y python-prometheus-client-help &> /dev/null - CHECK_RESULT $? 0 0 "卸载操作失败" - fi - - LOG_INFO "测试完成,环境已恢复" - -} - -main "$@" \ No newline at end of file diff --git a/testcases/function_test/pkg_test/python-prometheus-client/python-prometheus-client-help/test_python-prometheus-client-help_command_006.sh b/testcases/function_test/pkg_test/python-prometheus-client/python-prometheus-client-help/test_python-prometheus-client-help_command_006.sh deleted file mode 100644 index 83050ac1ad2..00000000000 --- a/testcases/function_test/pkg_test/python-prometheus-client/python-prometheus-client-help/test_python-prometheus-client-help_command_006.sh +++ /dev/null @@ -1,78 +0,0 @@ -#!/usr/bin/bash - -# Copyright (c) 2024 ISCAS .ALL rights reserved. -# This program is licensed under Mulan PSL v2. -# You can use it according to the terms and conditions of the Mulan PSL v2. -# http://license.coscl.org.cn/MulanPSL2 -# THIS PROGRAM IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, -# EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, -# MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. -# See the Mulan PSL v2 for more details. - -# ############################################# -# @Author : honghua -# @Contact : honghua@iscas.ac.cn -# @Date : 2025-06-19 -# @License : Mulan PSL v2 -# @Desc : 测试python-prometheus-client-help包的回滚功能,验证软件包能否正常回滚到指定版本。 -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - - LOG_INFO "开始测试python-prometheus-client-help包的回滚功能" - - # 检查是否已安装python-prometheus-client-help包 - if dnf list installed python-prometheus-client-help &> /dev/null; then - LOG_INFO "检测到python-prometheus-client-help包已安装,脚本结束后将保持安装状态" - INSTALLED=true - else - LOG_INFO "未检测到python-prometheus-client-help包,将在测试步骤中安装" - INSTALLED=false - fi - - # 检查yum源中是否存在python-prometheus-client-help包 - if ! dnf list available python-prometheus-client-help &> /dev/null; then - LOG_ERROR "yum源中未找到python-prometheus-client-help包" - exit 255 - fi - - # 安装软件包(如果未安装) - if [ "$INSTALLED" = false ]; then - LOG_INFO "正在安装python-prometheus-client-help包..." - dnf install -y python-prometheus-client-help - CHECK_RESULT $? 0 0 "安装python-prometheus-client-help包失败" - fi - - # 验证软件包能否正常回滚到指定版本 - LOG_INFO "验证软件包回滚功能..." - dnf history | grep python-prometheus-client-help &> /dev/null - if [ $? -ne 0 ]; then - LOG_ERROR "未找到python-prometheus-client-help包的安装历史记录" - exit 255 - fi - - # 获取最近一次安装的版本ID - VERSION_ID=$(dnf history list python-prometheus-client-help | awk 'NR==3 {print $1}') - if [ -z "$VERSION_ID" ]; then - LOG_ERROR "无法获取python-prometheus-client-help包的版本ID" - exit 255 - fi - - LOG_INFO "尝试回滚到版本ID: $VERSION_ID" - dnf history undo -y "$VERSION_ID" - CHECK_RESULT $? 0 0 "回滚python-prometheus-client-help包失败" - - # 清理环境(如果最初未安装) - if [ "$INSTALLED" = false ]; then - LOG_INFO "清理环境,卸载python-prometheus-client-help包..." - dnf remove -y python-prometheus-client-help - CHECK_RESULT $? 0 0 "卸载python-prometheus-client-help包失败" - fi - - LOG_INFO "测试完成,环境已恢复" - -} - -main "$@" \ No newline at end of file diff --git a/testcases/function_test/pkg_test/python-prometheus-client/python-prometheus-client-help/test_python-prometheus-client-help_command_007.sh b/testcases/function_test/pkg_test/python-prometheus-client/python-prometheus-client-help/test_python-prometheus-client-help_command_007.sh deleted file mode 100644 index f9e03cd52ff..00000000000 --- a/testcases/function_test/pkg_test/python-prometheus-client/python-prometheus-client-help/test_python-prometheus-client-help_command_007.sh +++ /dev/null @@ -1,95 +0,0 @@ -#!/usr/bin/bash - -# Copyright (c) 2024 ISCAS .ALL rights reserved. -# This program is licensed under Mulan PSL v2. -# You can use it according to the terms and conditions of the Mulan PSL v2. -# http://license.coscl.org.cn/MulanPSL2 -# THIS PROGRAM IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, -# EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, -# MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. -# See the Mulan PSL v2 for more details. - -# ############################################# -# @Author : honghua -# @Contact : honghua@iscas.ac.cn -# @Date : 2025-06-19 -# @License : Mulan PSL v2 -# @Desc : 测试python-prometheus-client-help包的升级回滚功能,验证软件包能否在升级后回滚到升级前的版本。 -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - LOG_INFO "开始测试python-prometheus-client-help包的升级回滚功能" - - # 检查yum源中是否存在python-prometheus-client-help包 - LOG_INFO "检查yum源中是否存在python-prometheus-client-help包" - dnf list available python-prometheus-client-help &> /dev/null - if [ $? -ne 0 ]; then - LOG_ERROR "yum源中不存在python-prometheus-client-help包" - exit 255 - fi - - # 检查当前是否已安装python-prometheus-client-help包 - LOG_INFO "检查当前是否已安装python-prometheus-client-help包" - rpm -q python-prometheus-client-help &> /dev/null - if [ $? -eq 0 ]; then - installed=true - current_version=$(rpm -q --queryformat '%{VERSION}-%{RELEASE}' python-prometheus-client-help) - LOG_INFO "当前已安装版本: $current_version" - else - installed=false - LOG_INFO "当前未安装python-prometheus-client-help包" - fi - - # 如果未安装,则安装软件包作为测试步骤 - if [ "$installed" = false ]; then - LOG_INFO "安装python-prometheus-client-help包" - dnf install -y python-prometheus-client-help - CHECK_RESULT $? 0 0 "安装python-prometheus-client-help包失败" - fi - - # 获取当前版本信息 - current_version=$(rpm -q --queryformat '%{VERSION}-%{RELEASE}' python-prometheus-client-help) - LOG_INFO "当前版本: $current_version" - - # 检查是否有可升级的版本 - LOG_INFO "检查是否有可升级的版本" - dnf list updates python-prometheus-client-help &> /dev/null - if [ $? -ne 0 ]; then - LOG_ERROR "没有可升级的版本" - exit 255 - fi - - # 升级软件包 - LOG_INFO "升级python-prometheus-client-help包" - dnf upgrade -y python-prometheus-client-help - CHECK_RESULT $? 0 0 "升级python-prometheus-client-help包失败" - - # 获取升级后的版本信息 - upgraded_version=$(rpm -q --queryformat '%{VERSION}-%{RELEASE}' python-prometheus-client-help) - LOG_INFO "升级后版本: $upgraded_version" - - # 回滚到之前的版本 - LOG_INFO "回滚到之前的版本: $current_version" - dnf downgrade -y python-prometheus-client-help-$current_version - CHECK_RESULT $? 0 0 "回滚到之前的版本失败" - - # 验证回滚后的版本是否与之前一致 - rolled_back_version=$(rpm -q --queryformat '%{VERSION}-%{RELEASE}' python-prometheus-client-help) - LOG_INFO "回滚后版本: $rolled_back_version" - CHECK_RESULT "$rolled_back_version" "$current_version" 0 "回滚后的版本与预期不一致" - - # 清理环境:如果最初未安装,则卸载软件包;否则保持安装状态 - if [ "$installed" = false ]; then - LOG_INFO "清理环境:卸载python-prometheus-client-help包" - dnf remove -y python-prometheus-client-help - CHECK_RESULT $? 0 0 "卸载python-prometheus-client-help包失败" - else - LOG_INFO "保持环境:保留已安装的python-prometheus-client-help包" - fi - - LOG_INFO "测试完成:验证了python-prometheus-client-help包的升级回滚功能" -} - -main "$@" \ No newline at end of file diff --git a/testcases/function_test/pkg_test/qt5-qtvirtualkeyboard/qt5-qtvirtualkeyboard-examples/test_qt5-qtvirtualkeyboard-examples_dependency.sh b/testcases/function_test/pkg_test/qt5-qtvirtualkeyboard/qt5-qtvirtualkeyboard-examples/test_qt5-qtvirtualkeyboard-examples_dependency.sh deleted file mode 100644 index b25d5cdd2f3..00000000000 --- a/testcases/function_test/pkg_test/qt5-qtvirtualkeyboard/qt5-qtvirtualkeyboard-examples/test_qt5-qtvirtualkeyboard-examples_dependency.sh +++ /dev/null @@ -1,67 +0,0 @@ -#!/usr/bin/bash - -# Copyright (c) 2024 ISCAS .ALL rights reserved. -# This program is licensed under Mulan PSL v2. -# You can use it according to the terms and conditions of the Mulan PSL v2. -# http://license.coscl.org.cn/MulanPSL2 -# THIS PROGRAM IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, -# EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, -# MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. -# See the Mulan PSL v2 for more details. - -# ############################################# -# @Author : honghua -# @Contact : honghua@iscas.ac.cn -# @Date : 2025-06-16 -# @License : Mulan PSL v2 -# @Desc : 测试qt5-qtvirtualkeyboard-examples包的依赖关系,验证软件包是否能够正确识别和满足所有依赖项。 -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - - - # 检查软件包是否存在于yum源中 - LOG_INFO "检查yum源中是否存在qt5-qtvirtualkeyboard-examples软件包..." - dnf list available qt5-qtvirtualkeyboard-examples > /dev/null 2>&1 - if [ $? -ne 0 ]; then - LOG_ERROR "yum源中未找到qt5-qtvirtualkeyboard-examples软件包" - exit 255 - fi - - # 检查是否已安装软件包 - LOG_INFO "检查系统是否已安装qt5-qtvirtualkeyboard-examples软件包..." - rpm -q qt5-qtvirtualkeyboard-examples > /dev/null 2>&1 - if [ $? -eq 0 ]; then - LOG_INFO "系统已安装qt5-qtvirtualkeyboard-examples软件包,测试完成后将保持安装状态" - INSTALLED=true - else - LOG_INFO "系统未安装qt5-qtvirtualkeyboard-examples软件包,测试完成后将卸载" - INSTALLED=false - fi - - # 安装软件包 - if [ "$INSTALLED" = false ]; then - LOG_INFO "开始安装qt5-qtvirtualkeyboard-examples软件包..." - dnf install -y qt5-qtvirtualkeyboard-examples > /dev/null 2>&1 - CHECK_RESULT $? 0 0 "安装qt5-qtvirtualkeyboard-examples失败" - fi - - # 验证依赖关系 - LOG_INFO "验证qt5-qtvirtualkeyboard-examples的依赖关系..." - rpm -qR qt5-qtvirtualkeyboard-examples > /dev/null 2>&1 - CHECK_RESULT $? 0 0 "验证依赖关系失败" - - # 清理环境(如果测试前未安装) - if [ "$INSTALLED" = false ]; then - LOG_INFO "卸载qt5-qtvirtualkeyboard-examples软件包..." - dnf remove -y qt5-qtvirtualkeyboard-examples > /dev/null 2>&1 - CHECK_RESULT $? 0 0 "卸载qt5-qtvirtualkeyboard-examples失败" - fi - - LOG_INFO "测试完成,环境已恢复" - -} - -main "$@" \ No newline at end of file diff --git a/testcases/function_test/pkg_test/qt5-qtvirtualkeyboard/qt5-qtvirtualkeyboard-examples/test_qt5-qtvirtualkeyboard-examples_downgrade.sh b/testcases/function_test/pkg_test/qt5-qtvirtualkeyboard/qt5-qtvirtualkeyboard-examples/test_qt5-qtvirtualkeyboard-examples_downgrade.sh deleted file mode 100644 index d1f65785e88..00000000000 --- a/testcases/function_test/pkg_test/qt5-qtvirtualkeyboard/qt5-qtvirtualkeyboard-examples/test_qt5-qtvirtualkeyboard-examples_downgrade.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 : 2025-06-16 -# @License : Mulan PSL v2 -# @Desc : 测试qt5-qtvirtualkeyboard-examples包的降级功能,验证软件包是否能够正常降级。 -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - - - # 检查yum源中是否存在qt5-qtvirtualkeyboard-examples包 - LOG_INFO "检查yum源中是否存在qt5-qtvirtualkeyboard-examples包" - dnf list available qt5-qtvirtualkeyboard-examples > /dev/null 2>&1 - if [ $? -ne 0 ]; then - LOG_ERROR "yum源中未找到qt5-qtvirtualkeyboard-examples包" - exit 255 - fi - - # 检查当前是否已安装qt5-qtvirtualkeyboard-examples包 - LOG_INFO "检查当前是否已安装qt5-qtvirtualkeyboard-examples包" - rpm -q qt5-qtvirtualkeyboard-examples > /dev/null 2>&1 - if [ $? -eq 0 ]; then - installed=true - LOG_INFO "当前环境已安装qt5-qtvirtualkeyboard-examples包" - else - installed=false - LOG_INFO "当前环境未安装qt5-qtvirtualkeyboard-examples包" - fi - - # 如果未安装,则安装软件包作为测试步骤 - if [ "$installed" = false ]; then - LOG_INFO "开始安装qt5-qtvirtualkeyboard-examples包" - dnf install -y qt5-qtvirtualkeyboard-examples - CHECK_RESULT $? 0 0 "安装qt5-qtvirtualkeyboard-examples包失败" - fi - - # 获取当前软件包的版本信息 - LOG_INFO "获取当前软件包的版本信息" - current_version=$(rpm -q --queryformat '%{VERSION}-%{RELEASE}' qt5-qtvirtualkeyboard-examples) - CHECK_RESULT $? 0 0 "获取当前软件包版本失败" - - # 检查是否存在可降级的版本 - LOG_INFO "检查是否存在可降级的版本" - dnf list --showduplicates qt5-qtvirtualkeyboard-examples | grep -v "$current_version" > /dev/null 2>&1 - if [ $? -ne 0 ]; then - LOG_ERROR "没有可降级的版本" - exit 255 - fi - - # 获取可降级的版本列表并选择第一个旧版本 - LOG_INFO "选择第一个旧版本进行降级测试" - downgrade_version=$(dnf list --showduplicates qt5-qtvirtualkeyboard-examples | grep -v "$current_version" | head -n 1 | awk '{print $2}') - CHECK_RESULT $? 0 0 "获取可降级版本失败" - - # 执行降级操作 - LOG_INFO "开始降级到版本: $downgrade_version" - dnf downgrade -y qt5-qtvirtualkeyboard-examples-$downgrade_version > /dev/null 2>&1 - CHECK_RESULT $? 0 0 "降级操作失败" - - # 验证降级后的版本是否正确 - LOG_INFO "验证降级后的版本是否正确" - downgraded_version=$(rpm -q --queryformat '%{VERSION}-%{RELEASE}' qt5-qtvirtualkeyboard-examples) - if [ "$downgraded_version" != "$downgrade_version" ]; then - LOG_ERROR "降级后版本验证失败,预期: $downgrade_version, 实际: $downgraded_version" - exit 1 - else - LOG_INFO "降级后版本验证成功: $downgraded_version" - fi - - # 恢复环境:如果最初未安装,则卸载软件包;否则保持安装状态不变 - if [ "$installed" = false ]; then - LOG_INFO "恢复环境:卸载测试安装的软件包" - dnf remove -y qt5-qtvirtualkeyboard-examples > /dev/null 2>&1 - CHECK_RESULT $? 0 0 "卸载软件包失败" - else - LOG_INFO "恢复环境:保持原有安装状态不变" - fi - - LOG_INFO "测试脚本执行完成,所有步骤均通过验证" - -} - -main "$@" \ No newline at end of file diff --git a/testcases/function_test/pkg_test/qt5-qtvirtualkeyboard/qt5-qtvirtualkeyboard-examples/test_qt5-qtvirtualkeyboard-examples_function_theme.sh b/testcases/function_test/pkg_test/qt5-qtvirtualkeyboard/qt5-qtvirtualkeyboard-examples/test_qt5-qtvirtualkeyboard-examples_function_theme.sh deleted file mode 100644 index 474cc3233ea..00000000000 --- a/testcases/function_test/pkg_test/qt5-qtvirtualkeyboard/qt5-qtvirtualkeyboard-examples/test_qt5-qtvirtualkeyboard-examples_function_theme.sh +++ /dev/null @@ -1,119 +0,0 @@ -#!/usr/bin/bash - -# Copyright (c) 2024 ISCAS .ALL rights reserved. -# This program is licensed under Mulan PSL v2. -# You can use it according to the terms and conditions of the Mulan PSL v2. -# http://license.coscl.org.cn/MulanPSL2 -# THIS PROGRAM IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, -# EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, -# MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. -# See the Mulan PSL v2 for more details. - -# ############################################# -# @Author : honghua -# @Contact : honghua@iscas.ac.cn -# @Date : 2026-04-06 -# @License : Mulan PSL v2 -# @Desc : 测试qt5-qtvirtualkeyboard-examples的主题或样式切换功能,验证虚拟键盘的界面主题可以正常更改。 -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - # 定义软件包名称 - PACKAGE_NAME="qt5-qtvirtualkeyboard-examples" - - # 检查软件包是否在yum源中 - LOG_INFO "步骤1: 检查yum源中是否存在${PACKAGE_NAME}软件包" - dnf list available ${PACKAGE_NAME} > /dev/null 2>&1 - if [ $? -ne 0 ]; then - LOG_ERROR "yum源中不存在${PACKAGE_NAME}软件包" - exit 255 - fi - - # 检查软件包是否已安装 - LOG_INFO "步骤2: 检查${PACKAGE_NAME}是否已安装" - rpm -q ${PACKAGE_NAME} > /dev/null 2>&1 - if [ $? -eq 0 ]; then - LOG_INFO "${PACKAGE_NAME}已安装,标记为保持安装状态" - KEEP_INSTALLED=true - else - LOG_INFO "${PACKAGE_NAME}未安装,标记为需要清理" - KEEP_INSTALLED=false - fi - - # 如果未安装则安装软件包 - if [ "${KEEP_INSTALLED}" = "false" ]; then - LOG_INFO "步骤3: 安装${PACKAGE_NAME}软件包" - dnf install -y ${PACKAGE_NAME} - CHECK_RESULT $? 0 0 "安装${PACKAGE_NAME}失败" - fi - - # 检查虚拟键盘示例程序是否存在 - LOG_INFO "步骤4: 检查虚拟键盘示例程序是否存在" - EXAMPLE_PATH=$(find /usr -name "*virtualkeyboard*example*" -type f -executable | head -1) - if [ -z "${EXAMPLE_PATH}" ]; then - LOG_ERROR "未找到虚拟键盘示例程序" - if [ "${KEEP_INSTALLED}" = "false" ]; then - dnf remove -y ${PACKAGE_NAME} - fi - exit 255 - fi - - # 检查示例程序是否支持主题参数 - LOG_INFO "步骤5: 检查示例程序是否支持主题参数" - ${EXAMPLE_PATH} --help 2>&1 | grep -i "theme\|style" > /dev/null - if [ $? -ne 0 ]; then - LOG_ERROR "示例程序不支持主题或样式参数" - if [ "${KEEP_INSTALLED}" = "false" ]; then - dnf remove -y ${PACKAGE_NAME} - fi - exit 255 - fi - - # 测试默认主题启动 - LOG_INFO "步骤6: 测试使用默认主题启动虚拟键盘示例" - timeout 5s ${EXAMPLE_PATH} & - DEFAULT_PID=$! - sleep 2 - if ps -p ${DEFAULT_PID} > /dev/null; then - LOG_INFO "默认主题启动成功" - kill ${DEFAULT_PID} 2>/dev/null - else - LOG_ERROR "默认主题启动失败" - if [ "${KEEP_INSTALLED}" = "false" ]; then - dnf remove -y ${PACKAGE_NAME} - fi - exit 1 - fi - - # 测试指定主题启动 - LOG_INFO "步骤7: 测试使用指定主题启动虚拟键盘示例" - timeout 5s ${EXAMPLE_PATH} --theme "default" & - THEME_PID=$! - sleep 2 - if ps -p ${THEME_PID} > /dev/null; then - LOG_INFO "指定主题启动成功" - kill ${THEME_PID} 2>/dev/null - else - LOG_ERROR "指定主题启动失败" - if [ "${KEEP_INSTALLED}" = "false" ]; then - dnf remove -y ${PACKAGE_NAME} - fi - exit 1 - fi - - # 清理测试环境 - LOG_INFO "步骤8: 清理测试环境" - if [ "${KEEP_INSTALLED}" = "false" ]; then - LOG_INFO "卸载${PACKAGE_NAME}软件包" - dnf remove -y ${PACKAGE_NAME} - CHECK_RESULT $? 0 0 "卸载${PACKAGE_NAME}失败" - else - LOG_INFO "保持${PACKAGE_NAME}软件包安装状态" - fi - - LOG_INFO "测试完成:虚拟键盘主题切换功能验证成功" -} - -main "$@" \ No newline at end of file diff --git a/testcases/function_test/pkg_test/qt5-qtvirtualkeyboard/qt5-qtvirtualkeyboard-examples/test_qt5-qtvirtualkeyboard-examples_reinstall.sh b/testcases/function_test/pkg_test/qt5-qtvirtualkeyboard/qt5-qtvirtualkeyboard-examples/test_qt5-qtvirtualkeyboard-examples_reinstall.sh deleted file mode 100644 index fd237b07791..00000000000 --- a/testcases/function_test/pkg_test/qt5-qtvirtualkeyboard/qt5-qtvirtualkeyboard-examples/test_qt5-qtvirtualkeyboard-examples_reinstall.sh +++ /dev/null @@ -1,69 +0,0 @@ -#!/usr/bin/bash - -# Copyright (c) 2024 ISCAS .ALL rights reserved. -# This program is licensed under Mulan PSL v2. -# You can use it according to the terms and conditions of the Mulan PSL v2. -# http://license.coscl.org.cn/MulanPSL2 -# THIS PROGRAM IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, -# EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, -# MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. -# See the Mulan PSL v2 for more details. - -# ############################################# -# @Author : honghua -# @Contact : honghua@iscas.ac.cn -# @Date : 2025-06-16 -# @License : Mulan PSL v2 -# @Desc : 测试qt5-qtvirtualkeyboard-examples包的重新安装功能,验证软件包是否能够正常重新安装。 -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - - - # 检查软件包是否存在于yum源中 - LOG_INFO "检查yum源中是否存在qt5-qtvirtualkeyboard-examples软件包" - dnf list available qt5-qtvirtualkeyboard-examples > /dev/null 2>&1 - if [ $? -ne 0 ]; then - LOG_ERROR "yum源中未找到qt5-qtvirtualkeyboard-examples软件包" - exit 255 - fi - - # 检查当前环境是否已安装软件包 - LOG_INFO "检查当前环境是否已安装qt5-qtvirtualkeyboard-examples软件包" - rpm -q qt5-qtvirtualkeyboard-examples > /dev/null 2>&1 - if [ $? -eq 0 ]; then - LOG_INFO "当前环境已安装qt5-qtvirtualkeyboard-examples软件包,脚本结束后将保持安装状态" - INSTALLED=true - else - LOG_INFO "当前环境未安装qt5-qtvirtualkeyboard-examples软件包,脚本结束后将卸载该软件包" - INSTALLED=false - fi - - # 如果未安装,则执行安装步骤 - if [ "$INSTALLED" = false ]; then - LOG_INFO "开始安装qt5-qtvirtualkeyboard-examples软件包" - dnf install -y qt5-qtvirtualkeyboard-examples > /dev/null 2>&1 - CHECK_RESULT $? 0 0 "安装qt5-qtvirtualkeyboard-examples软件包失败" - fi - - # 测试重新安装功能 - LOG_INFO "测试重新安装qt5-qtvirtualkeyboard-examples软件包" - dnf reinstall -y qt5-qtvirtualkeyboard-examples > /dev/null 2>&1 - CHECK_RESULT $? 0 0 "重新安装qt5-qtvirtualkeyboard-examples软件包失败" - - # 清理环境:如果脚本开始时未安装,则卸载软件包;否则保持安装状态 - if [ "$INSTALLED" = false ]; then - LOG_INFO "清理环境:卸载qt5-qtvirtualkeyboard-examples软件包" - dnf remove -y qt5-qtvirtualkeyboard-examples > /dev/null 2>&1 - CHECK_RESULT $? 0 0 "卸载qt5-qtvirtualkeyboard-examples软件包失败" - else - LOG_INFO "清理环境:保持已安装的qt5-qtvirtualkeyboard-examples软件包状态" - fi - - LOG_INFO "测试完成:验证了qt5-qtvirtualkeyboard-examples包的重新安装功能" - -} - -main "$@" \ No newline at end of file diff --git a/testcases/function_test/pkg_test/qt5-qtvirtualkeyboard/qt5-qtvirtualkeyboard-examples/test_qt5-qtvirtualkeyboard-examples_rollback.sh b/testcases/function_test/pkg_test/qt5-qtvirtualkeyboard/qt5-qtvirtualkeyboard-examples/test_qt5-qtvirtualkeyboard-examples_rollback.sh deleted file mode 100644 index c2b80e46e95..00000000000 --- a/testcases/function_test/pkg_test/qt5-qtvirtualkeyboard/qt5-qtvirtualkeyboard-examples/test_qt5-qtvirtualkeyboard-examples_rollback.sh +++ /dev/null @@ -1,128 +0,0 @@ -#!/usr/bin/bash - -# Copyright (c) 2024 ISCAS .ALL rights reserved. -# This program is licensed under Mulan PSL v2. -# You can use it according to the terms and conditions of the Mulan PSL v2. -# http://license.coscl.org.cn/MulanPSL2 -# THIS PROGRAM IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, -# EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, -# MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. -# See the Mulan PSL v2 for more details. - -# ############################################# -# @Author : honghua -# @Contact : honghua@iscas.ac.cn -# @Date : 2025-06-16 -# @License : Mulan PSL v2 -# @Desc : 测试qt5-qtvirtualkeyboard-examples包的回滚功能,验证软件包是否能够正常回滚到之前的版本。 -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - - # 检查软件包是否存在于yum源中 - check_package_in_repo() { - local package_name=$1 - LOG_INFO "检查yum源中是否存在软件包: $package_name" - dnf list available "$package_name" &>/dev/null - if [ $? -ne 0 ]; then - LOG_ERROR "yum源中不存在软件包: $package_name" - exit 255 - fi - } - - # 检查命令参数是否有效 - check_command_param() { - local command=$1 - local param=$2 - LOG_INFO "检查命令参数: $command $param" - $command --help | grep -q "$param" - if [ $? -ne 0 ]; then - LOG_ERROR "命令参数不支持: $command $param" - exit 255 - fi - } - - # 安装软件包 - install_package() { - local package_name=$1 - LOG_INFO "安装软件包: $package_name" - dnf install -y "$package_name" - CHECK_RESULT $? 0 0 "安装软件包失败: $package_name" - } - - # 卸载软件包 - uninstall_package() { - local package_name=$1 - LOG_INFO "卸载软件包: $package_name" - dnf remove -y "$package_name" - CHECK_RESULT $? 0 0 "卸载软件包失败: $package_name" - } - - # 检查软件包是否已安装 - is_package_installed() { - local package_name=$1 - rpm -q "$package_name" &>/dev/null - return $? - } - - # 回滚软件包版本 - rollback_package() { - local package_name=$1 - LOG_INFO "回滚软件包版本: $package_name" - dnf history undo last -y --skip-broken | grep -q "Undo complete." - CHECK_RESULT $? 0 0 "回滚软件包失败: $package_name" - } - - # 主函数 - main() { - local package="qt5-qtvirtualkeyboard-examples" - - # 步骤1:检查yum源中是否存在目标软件包 - check_package_in_repo "$package" - - # 步骤2:检查dnf工具的history和undo参数是否支持 - check_command_param "dnf" "history" - check_command_param "dnf" "undo" - - # 步骤3:判断环境是否已安装目标软件包,记录初始状态是否需要卸载 - local need_uninstall=false - if ! is_package_installed "$package"; then - need_uninstall=true - install_package "$package" - CHECK_RESULT $? 0 0 "初始安装软件包失败: $package" - LOG_INFO "初始安装完成,标记为需要卸载状态" - else - LOG_INFO "目标软件包已安装,无需初始安装操作" - # 获取当前版本信息,用于后续回滚验证(可选) - current_version=$(rpm -q --qf "%{VERSION}-%{RELEASE}" "$package") - LOG_INFO "当前版本为: ${current_version}" - # TODO:如果需要验证回滚前后的版本差异,可以在此处记录当前版本信息(可选) - # echo "${current_version}" > /tmp/${package}_current_version.txt(可选) - fi - - # TODO:此处可以添加测试用例的具体逻辑(例如启动应用、验证功能等)(可选) - - #步骤4:执行回滚操作并验证结果(核心测试步骤) - rollback_package "$package" - - # TODO:此处可以添加回滚后的验证逻辑(例如对比版本号、验证功能等)(可选) - - #步骤5:恢复环境到初始状态(如果初始未安装则卸载) - if [ "$need_uninstall" = true ]; then - uninstall_package "$package" - CHECK_RESULT \$? \0 \0 \"卸载失败\" - LOG_INFO \"环境已恢复到未安装状态\" - else - LOG_INFO \"环境保持原状\" - fi - - exit \0 - } - - main - -} - -main "$@" \ No newline at end of file diff --git a/testcases/function_test/pkg_test/qt5-qtvirtualkeyboard/qt5-qtvirtualkeyboard-examples/test_qt5-qtvirtualkeyboard-examples_service_config.sh b/testcases/function_test/pkg_test/qt5-qtvirtualkeyboard/qt5-qtvirtualkeyboard-examples/test_qt5-qtvirtualkeyboard-examples_service_config.sh deleted file mode 100644 index 31f9c0b8365..00000000000 --- a/testcases/function_test/pkg_test/qt5-qtvirtualkeyboard/qt5-qtvirtualkeyboard-examples/test_qt5-qtvirtualkeyboard-examples_service_config.sh +++ /dev/null @@ -1,65 +0,0 @@ -#!/usr/bin/bash - -# Copyright (c) 2024 ISCAS .ALL rights reserved. -# This program is licensed under Mulan PSL v2. -# You can use it according to the terms and conditions of the Mulan PSL v2. -# http://license.coscl.org.cn/MulanPSL2 -# THIS PROGRAM IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, -# EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, -# MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. -# See the Mulan PSL v2 for more details. - -# ############################################# -# @Author : honghua -# @Contact : honghua@iscas.ac.cn -# @Date : 2025-06-16 -# @License : Mulan PSL v2 -# @Desc : 测试qt5-qtvirtualkeyboard-examples包的服务配置功能,验证服务是否能够正常配置。 -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - - - # 检查yum源中是否存在qt5-qtvirtualkeyboard-examples包 - LOG_INFO "检查yum源中是否存在qt5-qtvirtualkeyboard-examples包" - dnf list available qt5-qtvirtualkeyboard-examples > /dev/null 2>&1 - if [ $? -ne 0 ]; then - LOG_ERROR "yum源中未找到qt5-qtvirtualkeyboard-examples包" - exit 255 - fi - - # 检查是否已安装qt5-qtvirtualkeyboard-examples包 - LOG_INFO "检查是否已安装qt5-qtvirtualkeyboard-examples包" - rpm -q qt5-qtvirtualkeyboard-examples > /dev/null 2>&1 - if [ $? -eq 0 ]; then - LOG_INFO "qt5-qtvirtualkeyboard-examples包已安装,跳过安装步骤" - INSTALLED=true - else - LOG_INFO "qt5-qtvirtualkeyboard-examples包未安装,开始安装" - dnf install -y qt5-qtvirtualkeyboard-examples - CHECK_RESULT $? 0 0 "安装qt5-qtvirtualkeyboard-examples包失败" - INSTALLED=false - fi - - # 测试服务配置功能 - LOG_INFO "测试服务配置功能" - # 假设服务配置命令为configure_service,此处仅为示例,需替换为实际命令 - configure_service --test > /dev/null 2>&1 - CHECK_RESULT $? 0 0 "服务配置功能测试失败" - - # 清理环境:如果脚本开始时未安装,则卸载软件包 - if [ "$INSTALLED" = false ]; then - LOG_INFO "卸载qt5-qtvirtualkeyboard-examples包" - dnf remove -y qt5-qtvirtualkeyboard-examples - CHECK_RESULT $? 0 0 "卸载qt5-qtvirtualkeyboard-examples包失败" - fi - - LOG_INFO "测试脚本执行完成" - - - ### 脚本说明: -} - -main "$@" \ No newline at end of file diff --git a/testcases/function_test/pkg_test/qt5-qtvirtualkeyboard/qt5-qtvirtualkeyboard-examples/test_qt5-qtvirtualkeyboard-examples_service_log.sh b/testcases/function_test/pkg_test/qt5-qtvirtualkeyboard/qt5-qtvirtualkeyboard-examples/test_qt5-qtvirtualkeyboard-examples_service_log.sh deleted file mode 100644 index 7ee7efccc09..00000000000 --- a/testcases/function_test/pkg_test/qt5-qtvirtualkeyboard/qt5-qtvirtualkeyboard-examples/test_qt5-qtvirtualkeyboard-examples_service_log.sh +++ /dev/null @@ -1,67 +0,0 @@ -#!/usr/bin/bash - -# Copyright (c) 2024 ISCAS .ALL rights reserved. -# This program is licensed under Mulan PSL v2. -# You can use it according to the terms and conditions of the Mulan PSL v2. -# http://license.coscl.org.cn/MulanPSL2 -# THIS PROGRAM IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, -# EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, -# MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. -# See the Mulan PSL v2 for more details. - -# ############################################# -# @Author : honghua -# @Contact : honghua@iscas.ac.cn -# @Date : 2025-06-16 -# @License : Mulan PSL v2 -# @Desc : 测试qt5-qtvirtualkeyboard-examples包的服务日志查看功能,验证服务是否能够正常查看日志。 -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - - - # 检查yum源中是否存在qt5-qtvirtualkeyboard-examples包 - LOG_INFO "检查yum源中是否存在qt5-qtvirtualkeyboard-examples包" - dnf list available qt5-qtvirtualkeyboard-examples > /dev/null 2>&1 - if [ $? -ne 0 ]; then - LOG_ERROR "yum源中未找到qt5-qtvirtualkeyboard-examples包" - exit 255 - fi - - # 检查是否已安装qt5-qtvirtualkeyboard-examples包 - LOG_INFO "检查是否已安装qt5-qtvirtualkeyboard-examples包" - rpm -q qt5-qtvirtualkeyboard-examples > /dev/null 2>&1 - if [ $? -eq 0 ]; then - installed=true - LOG_INFO "qt5-qtvirtualkeyboard-examples包已安装,测试完成后将保持安装状态" - else - installed=false - LOG_INFO "qt5-qtvirtualkeyboard-examples包未安装,将进行安装测试" - fi - - # 如果未安装,则安装软件包 - if [ "$installed" = false ]; then - LOG_INFO "开始安装qt5-qtvirtualkeyboard-examples包" - dnf install -y qt5-qtvirtualkeyboard-examples > /dev/null 2>&1 - CHECK_RESULT $? 0 0 "安装qt5-qtvirtualkeyboard-examples包失败" - fi - - # 测试服务日志查看功能 - LOG_INFO "测试服务日志查看功能" - journalctl --unit=qt5-qtvirtualkeyboard-examples > /dev/null 2>&1 - CHECK_RESULT $? 0 0 "查看服务日志失败" - - # 如果之前未安装,则卸载软件包以恢复环境 - if [ "$installed" = false ]; then - LOG_INFO "卸载qt5-qtvirtualkeyboard-examples包以恢复环境" - dnf remove -y qt5-qtvirtualkeyboard-examples > /dev/null 2>&1 - CHECK_RESULT $? 0 0 "卸载qt5-qtvirtualkeyboard-examples包失败" - fi - - LOG_INFO "测试完成,环境已恢复" - -} - -main "$@" \ No newline at end of file diff --git a/testcases/function_test/pkg_test/qt5-qtvirtualkeyboard/qt5-qtvirtualkeyboard-examples/test_qt5-qtvirtualkeyboard-examples_service_reload.sh b/testcases/function_test/pkg_test/qt5-qtvirtualkeyboard/qt5-qtvirtualkeyboard-examples/test_qt5-qtvirtualkeyboard-examples_service_reload.sh deleted file mode 100644 index 05e0d999fa7..00000000000 --- a/testcases/function_test/pkg_test/qt5-qtvirtualkeyboard/qt5-qtvirtualkeyboard-examples/test_qt5-qtvirtualkeyboard-examples_service_reload.sh +++ /dev/null @@ -1,67 +0,0 @@ -#!/usr/bin/bash - -# Copyright (c) 2024 ISCAS .ALL rights reserved. -# This program is licensed under Mulan PSL v2. -# You can use it according to the terms and conditions of the Mulan PSL v2. -# http://license.coscl.org.cn/MulanPSL2 -# THIS PROGRAM IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, -# EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, -# MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. -# See the Mulan PSL v2 for more details. - -# ############################################# -# @Author : honghua -# @Contact : honghua@iscas.ac.cn -# @Date : 2025-06-16 -# @License : Mulan PSL v2 -# @Desc : 测试qt5-qtvirtualkeyboard-examples包的服务重载功能,验证服务是否能够正常重载配置。 -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - - - # 检查软件包是否存在于yum源中 - LOG_INFO "检查yum源中是否存在qt5-qtvirtualkeyboard-examples软件包..." - dnf list available qt5-qtvirtualkeyboard-examples > /dev/null 2>&1 - if [ $? -ne 0 ]; then - LOG_ERROR "yum源中未找到qt5-qtvirtualkeyboard-examples软件包,退出测试..." - exit 255 - fi - - # 检查当前环境是否已安装软件包 - LOG_INFO "检查当前环境是否已安装qt5-qtvirtualkeyboard-examples软件包..." - rpm -q qt5-qtvirtualkeyboard-examples > /dev/null 2>&1 - if [ $? -eq 0 ]; then - LOG_INFO "当前环境已安装qt5-qtvirtualkeyboard-examples软件包,测试完成后将保持安装状态..." - INSTALLED=true - else - LOG_INFO "当前环境未安装qt5-qtvirtualkeyboard-examples软件包,测试完成后将卸载..." - INSTALLED=false - fi - - # 若未安装,则安装软件包 - if [ "$INSTALLED" = false ]; then - LOG_INFO "开始安装qt5-qtvirtualkeyboard-examples软件包..." - dnf install -y qt5-qtvirtualkeyboard-examples > /dev/null 2>&1 - CHECK_RESULT $? 0 0 "安装qt5-qtvirtualkeyboard-examples软件包失败" - fi - - # 验证服务重载功能 - LOG_INFO "验证服务重载功能..." - systemctl reload qt5-qtvirtualkeyboard-examples > /dev/null 2>&1 - CHECK_RESULT $? 0 0 "服务重载失败" - - # 清理环境:若测试前未安装,则卸载软件包;否则保持原状 - if [ "$INSTALLED" = false ]; then - LOG_INFO "卸载qt5-qtvirtualkeyboard-examples软件包..." - dnf remove -y qt5-qtvirtualkeyboard-examples > /dev/null 2>&1 - CHECK_RESULT $? 0 0 "卸载qt5-qtvirtualkeyboard-examples软件包失败" - fi - - LOG_INFO "测试完成,环境已恢复。" - -} - -main "$@" \ No newline at end of file diff --git a/testcases/function_test/pkg_test/qt5-qtvirtualkeyboard/qt5-qtvirtualkeyboard-examples/test_qt5-qtvirtualkeyboard-examples_service_start.sh b/testcases/function_test/pkg_test/qt5-qtvirtualkeyboard/qt5-qtvirtualkeyboard-examples/test_qt5-qtvirtualkeyboard-examples_service_start.sh deleted file mode 100644 index e36abaca2bb..00000000000 --- a/testcases/function_test/pkg_test/qt5-qtvirtualkeyboard/qt5-qtvirtualkeyboard-examples/test_qt5-qtvirtualkeyboard-examples_service_start.sh +++ /dev/null @@ -1,71 +0,0 @@ -#!/usr/bin/bash - -# Copyright (c) 2024 ISCAS .ALL rights reserved. -# This program is licensed under Mulan PSL v2. -# You can use it according to the terms and conditions of the Mulan PSL v2. -# http://license.coscl.org.cn/MulanPSL2 -# THIS PROGRAM IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, -# EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, -# MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. -# See the Mulan PSL v2 for more details. - -# ############################################# -# @Author : honghua -# @Contact : honghua@iscas.ac.cn -# @Date : 2025-06-16 -# @License : Mulan PSL v2 -# @Desc : 测试qt5-qtvirtualkeyboard-examples包的服务启动功能,验证服务是否能够正常启动。 -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - - # 检查软件包是否已安装 - LOG_INFO "检查qt5-qtvirtualkeyboard-examples是否已安装..." - rpm -q qt5-qtvirtualkeyboard-examples > /dev/null 2>&1 - if [ $? -eq 0 ]; then - LOG_INFO "qt5-qtvirtualkeyboard-examples已安装,跳过安装步骤..." - INSTALLED=1 - else - LOG_INFO "qt5-qtvirtualkeyboard-examples未安装,准备安装..." - INSTALLED=0 - fi - - # 检查yum源中是否存在软件包 - LOG_INFO "检查yum源中是否存在qt5-qtvirtualkeyboard-examples..." - dnf list available qt5-qtvirtualkeyboard-examples > /dev/null 2>&1 - if [ $? -ne 0 ]; then - LOG_ERROR "yum源中未找到qt5-qtvirtualkeyboard-examples,退出测试..." - exit 255 - fi - - # 如果未安装,则安装软件包 - if [ $INSTALLED -eq 0 ]; then - LOG_INFO "开始安装qt5-qtvirtualkeyboard-examples..." - dnf install -y qt5-qtvirtualkeyboard-examples > /dev/null 2>&1 - CHECK_RESULT $? 0 0 "安装qt5-qtvirtualkeyboard-examples失败" - fi - - # 测试服务启动功能 - LOG_INFO "测试服务启动功能..." - systemctl start qt5-qtvirtualkeyboard-examples > /dev/null 2>&1 - CHECK_RESULT $? 0 0 "启动服务失败" - - # 验证服务状态 - LOG_INFO "验证服务状态..." - systemctl status qt5-qtvirtualkeyboard-examples > /dev/null 2>&1 - CHECK_RESULT $? 0 0 "服务状态异常" - - # 清理环境:如果脚本开始时未安装,则卸载软件包 - if [ $INSTALLED -eq 0 ]; then - LOG_INFO "清理环境,卸载qt5-qtvirtualkeyboard-examples..." - dnf remove -y qt5-qtvirtualkeyboard-examples > /dev/null 2>&1 - CHECK_RESULT $? 0 0 "卸载qt5-qtvirtualkeyboard-examples失败" - fi - - LOG_INFO "测试完成,环境已恢复。" - -} - -main "$@" \ No newline at end of file diff --git a/testcases/function_test/pkg_test/qt5-qtvirtualkeyboard/qt5-qtvirtualkeyboard-examples/test_qt5-qtvirtualkeyboard-examples_service_status.sh b/testcases/function_test/pkg_test/qt5-qtvirtualkeyboard/qt5-qtvirtualkeyboard-examples/test_qt5-qtvirtualkeyboard-examples_service_status.sh deleted file mode 100644 index 00af816f0a9..00000000000 --- a/testcases/function_test/pkg_test/qt5-qtvirtualkeyboard/qt5-qtvirtualkeyboard-examples/test_qt5-qtvirtualkeyboard-examples_service_status.sh +++ /dev/null @@ -1,66 +0,0 @@ -#!/usr/bin/bash - -# Copyright (c) 2024 ISCAS .ALL rights reserved. -# This program is licensed under Mulan PSL v2. -# You can use it according to the terms and conditions of the Mulan PSL v2. -# http://license.coscl.org.cn/MulanPSL2 -# THIS PROGRAM IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, -# EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, -# MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. -# See the Mulan PSL v2 for more details. - -# ############################################# -# @Author : honghua -# @Contact : honghua@iscas.ac.cn -# @Date : 2025-06-16 -# @License : Mulan PSL v2 -# @Desc : 测试qt5-qtvirtualkeyboard-examples包的服务状态查询功能,验证服务是否能够正常查询状态。 -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - - # 检查软件包是否已安装 - LOG_INFO "检查qt5-qtvirtualkeyboard-examples是否已安装" - rpm -q qt5-qtvirtualkeyboard-examples > /dev/null 2>&1 - if [ $? -eq 0 ]; then - LOG_INFO "qt5-qtvirtualkeyboard-examples已安装,脚本结束时将保持安装状态" - INSTALLED=true - else - LOG_INFO "qt5-qtvirtualkeyboard-examples未安装,将在测试结束后卸载" - INSTALLED=false - fi - - # 检查yum源中是否存在软件包 - LOG_INFO "检查yum源中是否存在qt5-qtvirtualkeyboard-examples" - dnf list available qt5-qtvirtualkeyboard-examples > /dev/null 2>&1 - if [ $? -ne 0 ]; then - LOG_ERROR "yum源中未找到qt5-qtvirtualkeyboard-examples软件包" - exit 255 - fi - - # 安装软件包 - if [ "$INSTALLED" = false ]; then - LOG_INFO "开始安装qt5-qtvirtualkeyboard-examples" - dnf install -y qt5-qtvirtualkeyboard-examples > /dev/null 2>&1 - CHECK_RESULT $? 0 0 "安装qt5-qtvirtualkeyboard-examples失败" - fi - - # 测试服务状态查询功能 - LOG_INFO "测试服务状态查询功能" - systemctl status qt5-qtvirtualkeyboard-examples > /dev/null 2>&1 - CHECK_RESULT $? 0 0 "服务状态查询失败" - - # 清理环境 - if [ "$INSTALLED" = false ]; then - LOG_INFO "卸载qt5-qtvirtualkeyboard-examples" - dnf remove -y qt5-qtvirtualkeyboard-examples > /dev/null 2>&1 - CHECK_RESULT $? 0 0 "卸载qt5-qtvirtualkeyboard-examples失败" - fi - - LOG_INFO "测试完成,环境已恢复" - -} - -main "$@" \ No newline at end of file diff --git a/testcases/function_test/pkg_test/qt5-qtvirtualkeyboard/qt5-qtvirtualkeyboard-examples/test_qt5-qtvirtualkeyboard-examples_service_stop.sh b/testcases/function_test/pkg_test/qt5-qtvirtualkeyboard/qt5-qtvirtualkeyboard-examples/test_qt5-qtvirtualkeyboard-examples_service_stop.sh deleted file mode 100644 index 56fb5c6cc9e..00000000000 --- a/testcases/function_test/pkg_test/qt5-qtvirtualkeyboard/qt5-qtvirtualkeyboard-examples/test_qt5-qtvirtualkeyboard-examples_service_stop.sh +++ /dev/null @@ -1,66 +0,0 @@ -#!/usr/bin/bash - -# Copyright (c) 2024 ISCAS .ALL rights reserved. -# This program is licensed under Mulan PSL v2. -# You can use it according to the terms and conditions of the Mulan PSL v2. -# http://license.coscl.org.cn/MulanPSL2 -# THIS PROGRAM IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, -# EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, -# MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. -# See the Mulan PSL v2 for more details. - -# ############################################# -# @Author : honghua -# @Contact : honghua@iscas.ac.cn -# @Date : 2025-06-16 -# @License : Mulan PSL v2 -# @Desc : 测试qt5-qtvirtualkeyboard-examples包的服务停止功能,验证服务是否能够正常停止。 -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - - # 检查是否已安装qt5-qtvirtualkeyboard-examples包 - LOG_INFO "检查qt5-qtvirtualkeyboard-examples包是否已安装" - rpm -q qt5-qtvirtualkeyboard-examples > /dev/null 2>&1 - if [ $? -eq 0 ]; then - LOG_INFO "qt5-qtvirtualkeyboard-examples包已安装,脚本结束后将保持安装状态" - INSTALLED=true - else - LOG_INFO "qt5-qtvirtualkeyboard-examples包未安装,将在测试完成后卸载" - INSTALLED=false - fi - - # 检查yum源中是否存在qt5-qtvirtualkeyboard-examples包 - LOG_INFO "检查yum源中是否存在qt5-qtvirtualkeyboard-examples包" - dnf list available qt5-qtvirtualkeyboard-examples > /dev/null 2>&1 - if [ $? -ne 0 ]; then - LOG_ERROR "yum源中未找到qt5-qtvirtualkeyboard-examples包" - exit 255 - fi - - # 安装qt5-qtvirtualkeyboard-examples包(如果未安装) - if [ "$INSTALLED" = false ]; then - LOG_INFO "开始安装qt5-qtvirtualkeyboard-examples包" - dnf install -y qt5-qtvirtualkeyboard-examples > /dev/null 2>&1 - CHECK_RESULT $? 0 0 "安装qt5-qtvirtualkeyboard-examples包失败" - fi - - # 验证服务停止功能 - LOG_INFO "验证服务停止功能" - systemctl stop qt5-qtvirtualkeyboard-examples > /dev/null 2>&1 - CHECK_RESULT $? 0 0 "停止服务失败" - - # 清理环境(如果最初未安装) - if [ "$INSTALLED" = false ]; then - LOG_INFO "卸载qt5-qtvirtualkeyboard-examples包" - dnf remove -y qt5-qtvirtualkeyboard-examples > /dev/null 2>&1 - CHECK_RESULT $? 0 0 "卸载qt5-qtvirtualkeyboard-examples包失败" - fi - - LOG_INFO "测试完成,环境已恢复" - -} - -main "$@" \ No newline at end of file diff --git a/testcases/function_test/pkg_test/qt5-qtvirtualkeyboard/qt5-qtvirtualkeyboard-examples/test_qt5-qtvirtualkeyboard-examples_upgrade.sh b/testcases/function_test/pkg_test/qt5-qtvirtualkeyboard/qt5-qtvirtualkeyboard-examples/test_qt5-qtvirtualkeyboard-examples_upgrade.sh deleted file mode 100644 index 227ec1bd09a..00000000000 --- a/testcases/function_test/pkg_test/qt5-qtvirtualkeyboard/qt5-qtvirtualkeyboard-examples/test_qt5-qtvirtualkeyboard-examples_upgrade.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-06-16 -# @License : Mulan PSL v2 -# @Desc : 测试qt5-qtvirtualkeyboard-examples包的升级功能,验证软件包是否能够正常升级。 -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - - - # 检查软件包是否存在于yum源中 - LOG_INFO "检查yum源中是否存在qt5-qtvirtualkeyboard-examples包" - dnf list available qt5-qtvirtualkeyboard-examples &> /dev/null - if [ $? -ne 0 ]; then - LOG_ERROR "yum源中未找到qt5-qtvirtualkeyboard-examples包" - exit 255 - fi - - # 检查当前环境是否已安装软件包 - LOG_INFO "检查当前环境是否已安装qt5-qtvirtualkeyboard-examples包" - rpm -q qt5-qtvirtualkeyboard-examples &> /dev/null - if [ $? -eq 0 ]; then - LOG_INFO "当前环境已安装qt5-qtvirtualkeyboard-examples包,脚本结束后将保持安装状态" - INSTALLED=true - else - LOG_INFO "当前环境未安装qt5-qtvirtualkeyboard-examples包,将进行安装测试" - INSTALLED=false - fi - - # 如果未安装,则安装软件包作为测试步骤 - if [ "$INSTALLED" = false ]; then - LOG_INFO "开始安装qt5-qtvirtualkeyboard-examples包" - dnf install -y qt5-qtvirtualkeyboard-examples - CHECK_RESULT $? 0 0 "安装qt5-qtvirtualkeyboard-examples包失败" - fi - - # 测试升级功能 - LOG_INFO "测试升级qt5-qtvirtualkeyboard-examples包" - dnf upgrade -y qt5-qtvirtualkeyboard-examples - CHECK_RESULT $? 0 0 "升级qt5-qtvirtualkeyboard-examples包失败" - - # 验证软件包是否正常升级 - LOG_INFO "验证软件包是否正常升级" - rpm -q qt5-qtvirtualkeyboard-examples &> /dev/null - CHECK_RESULT $? 0 0 "验证软件包升级失败" - - # 清理环境:如果最初未安装,则卸载软件包 - if [ "$INSTALLED" = false ]; then - LOG_INFO "清理环境:卸载qt5-qtvirtualkeyboard-examples包" - dnf remove -y qt5-qtvirtualkeyboard-examples - CHECK_RESULT $? 0 0 "卸载qt5-qtvirtualkeyboard-examples包失败" - fi - - LOG_INFO "测试脚本执行完成,环境已恢复初始状态" - -} - -main "$@" \ No newline at end of file diff --git a/testcases/function_test/pkg_test/rpm/rpm-devel/test_rpm-devel_function_check_deps.sh b/testcases/function_test/pkg_test/rpm/rpm-devel/test_rpm-devel_function_check_deps.sh deleted file mode 100644 index 9af5e7cbc38..00000000000 --- a/testcases/function_test/pkg_test/rpm/rpm-devel/test_rpm-devel_function_check_deps.sh +++ /dev/null @@ -1,127 +0,0 @@ -#!/usr/bin/bash - -# Copyright (c) 2024 ISCAS .ALL rights reserved. -# This program is licensed under Mulan PSL v2. -# You can use it according to the terms and conditions of the Mulan PSL v2. -# http://license.coscl.org.cn/MulanPSL2 -# THIS PROGRAM IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, -# EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-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 : 测试检查rpm-devel包依赖关系 -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - # 定义日志函数(如果未定义) - if ! command -v LOG_INFO > /dev/null 2>&1; then - LOG_INFO() { - echo "[INFO] $*" - } - fi - if ! command -v LOG_ERROR > /dev/null 2>&1; then - LOG_ERROR() { - echo "[ERROR] $*" >&2 - } - fi - - # 定义CHECK_RESULT函数(如果未定义) - if ! command -v CHECK_RESULT > /dev/null 2>&1; then - CHECK_RESULT() { - local actual=$1 - local expect=$2 - local mode=$3 - local msg=$4 - if [ $mode -eq 0 ]; then - if [ $actual -eq $expect ]; then - LOG_INFO "$msg 成功" - else - LOG_ERROR "$msg 失败" - exit $actual - fi - fi - } - fi - - # 定义SSH_CMD函数(如果未定义) - if ! command -v SSH_CMD > /dev/null 2>&1; then - SSH_CMD() { - local cmd=$1 - local ip=$2 - local passwd=$3 - local user=$4 - LOG_INFO "在节点 $ip 上执行命令: $cmd" - sshpass -p "$passwd" ssh -o StrictHostKeyChecking=no "$user@$ip" "$cmd" - return $? - } - fi - - # 测试脚本开始 - LOG_INFO "开始测试:检查rpm-devel包依赖关系" - - # 步骤1: 检查rpm-devel包是否已在yum源中 - LOG_INFO "步骤1: 检查rpm-devel包是否在yum源中" - if ! dnf list available rpm-devel > /dev/null 2>&1; then - LOG_ERROR "yum源中未找到rpm-devel包" - exit 255 - fi - LOG_INFO "yum源中存在rpm-devel包" - - # 步骤2: 检查是否已安装rpm-devel包 - LOG_INFO "步骤2: 检查是否已安装rpm-devel包" - if rpm -q rpm-devel > /dev/null 2>&1; then - LOG_INFO "rpm-devel包已安装,测试结束后将保持安装状态" - already_installed=1 - else - LOG_INFO "rpm-devel包未安装,将在测试步骤中安装" - already_installed=0 - fi - - # 步骤3: 安装rpm-devel包(如果未安装) - if [ $already_installed -eq 0 ]; then - LOG_INFO "步骤3: 安装rpm-devel包" - dnf install -y rpm-devel - CHECK_RESULT $? 0 0 "安装rpm-devel包" - fi - - # 步骤4: 检查rpm-devel包的依赖关系 - LOG_INFO "步骤4: 检查rpm-devel包的依赖关系" - rpm -qR rpm-devel - CHECK_RESULT $? 0 0 "检查rpm-devel包依赖关系" - - # 步骤5: 验证rpm-devel包提供的头文件和库文件 - LOG_INFO "步骤5: 验证rpm-devel包提供的头文件和库文件" - if [ -d /usr/include/rpm ]; then - LOG_INFO "rpm头文件目录存在" - else - LOG_ERROR "rpm头文件目录不存在" - exit 1 - fi - - if [ -f /usr/lib/librpm.so ] || [ -f /usr/lib64/librpm.so ]; then - LOG_INFO "rpm库文件存在" - else - LOG_ERROR "rpm库文件不存在" - exit 1 - fi - - # 步骤6: 清理环境(如果测试前未安装,则卸载rpm-devel包) - if [ $already_installed -eq 0 ]; then - LOG_INFO "步骤6: 清理环境,卸载rpm-devel包" - dnf remove -y rpm-devel - CHECK_RESULT $? 0 0 "卸载rpm-devel包" - else - LOG_INFO "步骤6: 环境已安装rpm-devel包,保持安装状态" - fi - - LOG_INFO "测试完成:rpm-devel包依赖关系检查成功" -} - -main "$@" \ No newline at end of file diff --git a/testcases/function_test/pkg_test/rpm/rpm-devel/test_rpm-devel_function_check_install.sh b/testcases/function_test/pkg_test/rpm/rpm-devel/test_rpm-devel_function_check_install.sh deleted file mode 100644 index 614812e3148..00000000000 --- a/testcases/function_test/pkg_test/rpm/rpm-devel/test_rpm-devel_function_check_install.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-11 -# @License : Mulan PSL v2 -# @Desc : 测试检查rpm-devel是否已安装 -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - set -e - - LOG_INFO "开始测试:检查rpm-devel是否已安装" - - # 检查yum源中是否有rpm-devel包 - LOG_INFO "步骤1:检查yum源中是否有rpm-devel包" - if ! dnf list available rpm-devel &>/dev/null; then - LOG_ERROR "yum源中未找到rpm-devel包" - exit 255 - fi - - # 检查是否已安装rpm-devel - LOG_INFO "步骤2:检查系统是否已安装rpm-devel" - if rpm -q rpm-devel &>/dev/null; then - LOG_INFO "rpm-devel已安装,脚本结束时将保持安装状态" - already_installed=true - else - LOG_INFO "rpm-devel未安装,将在测试步骤中安装" - already_installed=false - fi - - # 如果未安装,则进行安装 - if [ "$already_installed" = false ]; then - LOG_INFO "步骤3:安装rpm-devel包" - dnf install -y rpm-devel - CHECK_RESULT $? 0 0 "安装rpm-devel失败" - LOG_INFO "rpm-devel安装成功" - fi - - # 测试rpm-devel功能 - LOG_INFO "步骤4:测试rpm-devel功能" - # 检查rpmbuild命令是否存在(rpm-devel安装后会提供) - if command -v rpmbuild &>/dev/null; then - LOG_INFO "rpmbuild命令存在,rpm-devel功能正常" - else - LOG_ERROR "rpmbuild命令不存在,rpm-devel功能异常" - CHECK_RESULT 1 0 0 "rpm-devel功能测试失败" - fi - - # 环境恢复 - LOG_INFO "步骤5:环境恢复" - if [ "$already_installed" = false ]; then - LOG_INFO "卸载测试安装的rpm-devel包" - dnf remove -y rpm-devel - CHECK_RESULT $? 0 0 "卸载rpm-devel失败" - LOG_INFO "rpm-devel卸载成功" - else - LOG_INFO "系统原本已安装rpm-devel,保持安装状态" - fi - - LOG_INFO "测试完成:rpm-devel功能检查完毕" -} - -main "$@" \ No newline at end of file diff --git a/testcases/function_test/pkg_test/rpm/rpm-devel/test_rpm-devel_function_install.sh b/testcases/function_test/pkg_test/rpm/rpm-devel/test_rpm-devel_function_install.sh deleted file mode 100644 index ff819586b23..00000000000 --- a/testcases/function_test/pkg_test/rpm/rpm-devel/test_rpm-devel_function_install.sh +++ /dev/null @@ -1,67 +0,0 @@ -#!/usr/bin/bash - -# Copyright (c) 2024 ISCAS .ALL rights reserved. -# This program is licensed under Mulan PSL v2. -# You can use it according to the terms and conditions of the Mulan PSL v2. -# http://license.coscl.org.cn/MulanPSL2 -# THIS PROGRAM IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, -# EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, -# MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. -# See the Mulan PSL v2 for more details. - -# ############################################# -# @Author : honghua -# @Contact : honghua@iscas.ac.cn -# @Date : 2026-03-11 -# @License : Mulan PSL v2 -# @Desc : 测试安装rpm-devel软件包 -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - LOG_INFO "开始测试安装rpm-devel软件包" - - # 检查是否已安装rpm-devel软件包 - LOG_INFO "检查是否已安装rpm-devel软件包" - if dnf list installed rpm-devel &>/dev/null; then - LOG_INFO "rpm-devel软件包已安装,脚本结束时将保持安装状态" - already_installed=1 - else - LOG_INFO "rpm-devel软件包未安装" - already_installed=0 - fi - - # 检查yum源中是否有rpm-devel软件包 - LOG_INFO "检查yum源中是否有rpm-devel软件包" - if ! dnf list available rpm-devel &>/dev/null; then - LOG_ERROR "yum源中未找到rpm-devel软件包" - exit 255 - fi - - # 如果未安装,则安装rpm-devel软件包 - if [ $already_installed -eq 0 ]; then - LOG_INFO "安装rpm-devel软件包" - dnf install -y rpm-devel - CHECK_RESULT $? 0 0 "安装rpm-devel软件包失败" - fi - - # 验证rpm-devel软件包安装后的功能(例如检查rpmbuild命令是否存在) - LOG_INFO "验证rpm-devel软件包安装后的功能" - command -v rpmbuild &>/dev/null - CHECK_RESULT $? 0 0 "rpmbuild命令未找到,rpm-devel软件包可能未正确安装" - - # 如果脚本开始时未安装rpm-devel,则在测试结束后卸载 - if [ $already_installed -eq 0 ]; then - LOG_INFO "卸载rpm-devel软件包" - dnf remove -y rpm-devel - CHECK_RESULT $? 0 0 "卸载rpm-devel软件包失败" - LOG_INFO "环境已恢复到未安装rpm-devel软件包的状态" - else - LOG_INFO "环境保持已安装rpm-devel软件包的状态" - fi - - LOG_INFO "测试安装rpm-devel软件包完成" -} - -main "$@" \ No newline at end of file diff --git a/testcases/function_test/pkg_test/rpm/rpm-devel/test_rpm-devel_function_list_files.sh b/testcases/function_test/pkg_test/rpm/rpm-devel/test_rpm-devel_function_list_files.sh deleted file mode 100644 index 249aacdd1b3..00000000000 --- a/testcases/function_test/pkg_test/rpm/rpm-devel/test_rpm-devel_function_list_files.sh +++ /dev/null @@ -1,67 +0,0 @@ -#!/usr/bin/bash - -# Copyright (c) 2024 ISCAS .ALL rights reserved. -# This program is licensed under Mulan PSL v2. -# You can use it according to the terms and conditions of the Mulan PSL v2. -# http://license.coscl.org.cn/MulanPSL2 -# THIS PROGRAM IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, -# EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, -# MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. -# See the Mulan PSL v2 for more details. - -# ############################################# -# @Author : honghua -# @Contact : honghua@iscas.ac.cn -# @Date : 2026-03-11 -# @License : Mulan PSL v2 -# @Desc : 测试列出rpm-devel包内文件 -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - LOG_INFO "开始测试:列出rpm-devel包内文件" - - # 检查是否已安装rpm-devel包 - if rpm -q rpm-devel > /dev/null 2>&1; then - LOG_INFO "rpm-devel包已安装,测试后保持安装状态" - already_installed=true - else - LOG_INFO "rpm-devel包未安装,将在测试前安装" - already_installed=false - fi - - # 检查yum源中是否有rpm-devel包 - LOG_INFO "检查yum源中是否存在rpm-devel包" - dnf list available rpm-devel > /dev/null 2>&1 - CHECK_RESULT $? 0 0 "yum源中未找到rpm-devel包" - if [ $? -ne 0 ]; then - LOG_ERROR "yum源中不存在rpm-devel包" - exit 255 - fi - - # 如果未安装,则安装rpm-devel包 - if [ "$already_installed" = false ]; then - LOG_INFO "安装rpm-devel包" - dnf install -y rpm-devel - CHECK_RESULT $? 0 0 "安装rpm-devel包失败" - fi - - # 测试列出rpm-devel包内文件 - LOG_INFO "执行rpm -ql rpm-devel列出包内文件" - rpm -ql rpm-devel - CHECK_RESULT $? 0 0 "列出rpm-devel包内文件失败" - - # 环境恢复:如果测试前未安装,则卸载rpm-devel包 - if [ "$already_installed" = false ]; then - LOG_INFO "卸载rpm-devel包" - dnf remove -y rpm-devel - CHECK_RESULT $? 0 0 "卸载rpm-devel包失败" - else - LOG_INFO "测试前已安装rpm-devel包,保持安装状态" - fi - - LOG_INFO "测试完成:成功列出rpm-devel包内文件" -} - -main "$@" \ No newline at end of file diff --git a/testcases/function_test/pkg_test/rpm/rpm-devel/test_rpm-devel_function_list_info.sh b/testcases/function_test/pkg_test/rpm/rpm-devel/test_rpm-devel_function_list_info.sh deleted file mode 100644 index 4f09e8a2c82..00000000000 --- a/testcases/function_test/pkg_test/rpm/rpm-devel/test_rpm-devel_function_list_info.sh +++ /dev/null @@ -1,53 +0,0 @@ -#!/usr/bin/bash - -# Copyright (c) 2024 ISCAS .ALL rights reserved. -# This program is licensed under Mulan PSL v2. -# You can use it according to the terms and conditions of the Mulan PSL v2. -# http://license.coscl.org.cn/MulanPSL2 -# THIS PROGRAM IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, -# EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-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 : 测试显示rpm-devel包详细信息 -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - LOG_INFO "开始测试显示rpm-devel包详细信息" - LOG_INFO "检查环境中是否已安装rpm-devel软件包" - if rpm -q rpm-devel >/dev/null 2>&1; then - LOG_INFO "rpm-devel软件包已安装" - INSTALLED="true" - else - LOG_INFO "rpm-devel软件包未安装" - INSTALLED="false" - fi - LOG_INFO "检查yum源中是否存在rpm-devel软件包" - if ! dnf list available rpm-devel >/dev/null 2>&1; then - LOG_ERROR "yum源中未找到rpm-devel软件包" - exit 255 - fi - if [ "$INSTALLED" = "false" ]; then - LOG_INFO "安装rpm-devel软件包" - dnf install -y rpm-devel - CHECK_RESULT $? 0 0 "安装rpm-devel软件包失败" - fi - LOG_INFO "显示rpm-devel包详细信息" - rpm -qi rpm-devel - CHECK_RESULT $? 0 0 "显示rpm-devel包详细信息失败" - if [ "$INSTALLED" = "false" ]; then - LOG_INFO "卸载rpm-devel软件包" - dnf remove -y rpm-devel - CHECK_RESULT $? 0 0 "卸载rpm-devel软件包失败" - fi - LOG_INFO "测试完成,环境已恢复" -} - -main "$@" \ No newline at end of file diff --git a/testcases/function_test/pkg_test/rpm/rpm-devel/test_rpm-devel_function_query_all.sh b/testcases/function_test/pkg_test/rpm/rpm-devel/test_rpm-devel_function_query_all.sh deleted file mode 100644 index e730e538e2d..00000000000 --- a/testcases/function_test/pkg_test/rpm/rpm-devel/test_rpm-devel_function_query_all.sh +++ /dev/null @@ -1,89 +0,0 @@ -#!/usr/bin/bash - -# Copyright (c) 2024 ISCAS .ALL rights reserved. -# This program is licensed under Mulan PSL v2. -# You can use it according to the terms and conditions of the Mulan PSL v2. -# http://license.coscl.org.cn/MulanPSL2 -# THIS PROGRAM IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, -# EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, -# MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. -# See the Mulan PSL v2 for more details. - -# ############################################# -# @Author : honghua -# @Contact : honghua@iscas.ac.cn -# @Date : 2026-03-11 -# @License : Mulan PSL v2 -# @Desc : 测试查询所有已安装的rpm包 -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - set -e - - LOG_INFO "开始测试:查询所有已安装的rpm包" - - # 检查是否已安装rpm包管理器 - LOG_INFO "检查rpm命令是否可用" - command -v rpm >/dev/null 2>&1 - CHECK_RESULT $? 0 0 "rpm命令不存在" - - # 检查是否已安装rpm-devel包 - LOG_INFO "检查rpm-devel包是否已安装" - if rpm -q rpm-devel >/dev/null 2>&1; then - LOG_INFO "rpm-devel包已安装,测试结束后保持安装状态" - already_installed=true - else - LOG_INFO "rpm-devel包未安装,将在测试中安装" - already_installed=false - fi - - # 如果需要安装rpm-devel包 - if [ "$already_installed" = false ]; then - # 检查yum源中是否有rpm-devel包 - LOG_INFO "检查yum源中是否有rpm-devel包" - dnf list available rpm-devel >/dev/null 2>&1 - if [ $? -ne 0 ]; then - LOG_ERROR "yum源中没有rpm-devel包" - exit 255 - fi - - # 安装rpm-devel包 - LOG_INFO "安装rpm-devel包" - dnf install -y rpm-devel - CHECK_RESULT $? 0 0 "安装rpm-devel包失败" - fi - - # 测试查询所有已安装的rpm包 - LOG_INFO "测试查询所有已安装的rpm包" - rpm -qa - CHECK_RESULT $? 0 0 "查询所有已安装的rpm包失败" - - # 检查查询结果是否包含rpm-devel包 - LOG_INFO "检查查询结果是否包含rpm-devel包" - rpm -qa | grep -q "^rpm-devel-" - CHECK_RESULT $? 0 0 "查询结果中未找到rpm-devel包" - - # 环境恢复 - if [ "$already_installed" = false ]; then - LOG_INFO "卸载rpm-devel包" - dnf remove -y rpm-devel - CHECK_RESULT $? 0 0 "卸载rpm-devel包失败" - - # 验证卸载是否成功 - LOG_INFO "验证rpm-devel包是否已卸载" - rpm -q rpm-devel >/dev/null 2>&1 - if [ $? -eq 0 ]; then - LOG_ERROR "rpm-devel包卸载失败" - exit 1 - fi - LOG_INFO "rpm-devel包已成功卸载" - else - LOG_INFO "保持rpm-devel包的安装状态" - fi - - LOG_INFO "测试完成:查询所有已安装的rpm包" -} - -main "$@" \ No newline at end of file diff --git a/testcases/function_test/pkg_test/rpm/rpm-devel/test_rpm-devel_function_query_file.sh b/testcases/function_test/pkg_test/rpm/rpm-devel/test_rpm-devel_function_query_file.sh deleted file mode 100644 index c46c48ce2f5..00000000000 --- a/testcases/function_test/pkg_test/rpm/rpm-devel/test_rpm-devel_function_query_file.sh +++ /dev/null @@ -1,79 +0,0 @@ -#!/usr/bin/bash - -# Copyright (c) 2024 ISCAS .ALL rights reserved. -# This program is licensed under Mulan PSL v2. -# You can use it according to the terms and conditions of the Mulan PSL v2. -# http://license.coscl.org.cn/MulanPSL2 -# THIS PROGRAM IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, -# EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, -# MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. -# See the Mulan PSL v2 for more details. - -# ############################################# -# @Author : honghua -# @Contact : honghua@iscas.ac.cn -# @Date : 2026-03-11 -# @License : Mulan PSL v2 -# @Desc : 测试查询文件所属的rpm包 -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - # 定义测试软件包名称 - TEST_PKG="rpm-devel" - # 定义测试文件(通常rpm-devel包含rpmbuild等,这里使用一个已知的文件进行测试) - TEST_FILE="/usr/bin/rpmbuild" - - # 步骤1:检查yum源中是否存在指定软件包 - LOG_INFO "步骤1:检查yum源中是否存在软件包 $TEST_PKG" - dnf list available $TEST_PKG 2>&1 | grep -q "^$TEST_PKG" - if [ $? -ne 0 ]; then - LOG_ERROR "软件包 $TEST_PKG 在yum源中不存在" - exit 255 - fi - - # 步骤2:检查测试文件是否存在,如果不存在则尝试安装软件包 - LOG_INFO "步骤2:检查测试文件 $TEST_FILE 是否存在" - if [ -f "$TEST_FILE" ]; then - LOG_INFO "测试文件已存在,无需安装软件包" - INSTALLED="false" - else - LOG_INFO "测试文件不存在,开始安装软件包 $TEST_PKG" - dnf install -y $TEST_PKG - CHECK_RESULT $? 0 0 "安装软件包 $TEST_PKG 失败" - INSTALLED="true" - fi - - # 步骤3:测试查询文件所属的rpm包功能 - LOG_INFO "步骤3:测试查询文件 $TEST_FILE 所属的rpm包" - rpm -qf "$TEST_FILE" - CHECK_RESULT $? 0 0 "查询文件所属rpm包失败" - - # 步骤4:测试无效参数(例如不存在的参数) - LOG_INFO "步骤4:测试无效参数" - rpm -qf --invalid-option "$TEST_FILE" 2>/dev/null - if [ $? -ne 255 ] && [ $? -ne 1 ]; then - LOG_ERROR "无效参数未被正确处理" - exit 255 - fi - - # 步骤5:测试不存在的文件 - LOG_INFO "步骤5:测试查询不存在的文件" - rpm -qf /path/to/nonexistent/file 2>&1 | grep -q "没有那个文件或目录\|No such file or directory" - CHECK_RESULT $? 0 0 "查询不存在的文件时未返回预期错误" - - # 步骤6:环境恢复 - LOG_INFO "步骤6:环境恢复" - if [ "$INSTALLED" = "true" ]; then - LOG_INFO "卸载测试安装的软件包 $TEST_PKG" - dnf remove -y $TEST_PKG - CHECK_RESULT $? 0 0 "卸载软件包 $TEST_PKG 失败" - else - LOG_INFO "测试前已安装软件包,保持安装状态" - fi - - LOG_INFO "测试完成" -} - -main "$@" \ No newline at end of file diff --git a/testcases/function_test/pkg_test/rpm/rpm-devel/test_rpm-devel_function_verify.sh b/testcases/function_test/pkg_test/rpm/rpm-devel/test_rpm-devel_function_verify.sh deleted file mode 100644 index 461a1f59207..00000000000 --- a/testcases/function_test/pkg_test/rpm/rpm-devel/test_rpm-devel_function_verify.sh +++ /dev/null @@ -1,98 +0,0 @@ -#!/usr/bin/bash - -# Copyright (c) 2024 ISCAS .ALL rights reserved. -# This program is licensed under Mulan PSL v2. -# You can use it according to the terms and conditions of the Mulan PSL v2. -# http://license.coscl.org.cn/MulanPSL2 -# THIS PROGRAM IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, -# EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, -# MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. -# See the Mulan PSL v2 for more details. - -# ############################################# -# @Author : honghua -# @Contact : honghua@iscas.ac.cn -# @Date : 2026-03-11 -# @License : Mulan PSL v2 -# @Desc : 测试验证已安装rpm包完整性 -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - set -e - - LOG_INFO "开始测试:验证已安装rpm包完整性" - - # 检查是否已安装rpm包 - LOG_INFO "检查rpm包是否已安装" - rpm -q rpm > /dev/null 2>&1 - if [ $? -eq 0 ]; then - LOG_INFO "rpm包已安装,测试后保持安装状态" - ALREADY_INSTALLED=1 - else - LOG_INFO "rpm包未安装,将进行安装测试" - ALREADY_INSTALLED=0 - - LOG_INFO "检查yum源中是否有rpm包" - dnf list available rpm 2>/dev/null | grep -q "^rpm\." - if [ $? -ne 0 ]; then - LOG_ERROR "yum源中未找到rpm包" - exit 255 - fi - - LOG_INFO "安装rpm包" - dnf install -y rpm - CHECK_RESULT $? 0 0 "安装rpm包失败" - fi - - # 验证rpm命令的基本功能 - LOG_INFO "验证rpm命令版本查询" - rpm --version - CHECK_RESULT $? 0 0 "rpm命令版本查询失败" - - LOG_INFO "验证rpm命令帮助信息" - rpm --help > /dev/null 2>&1 - CHECK_RESULT $? 0 0 "rpm命令帮助信息查询失败" - - # 验证rpm包查询功能 - LOG_INFO "验证已安装rpm包查询" - rpm -qa | grep -q "^rpm-" - CHECK_RESULT $? 0 0 "查询已安装rpm包失败" - - # 验证rpm包信息查询 - LOG_INFO "验证rpm包详细信息查询" - rpm -qi rpm > /dev/null 2>&1 - CHECK_RESULT $? 0 0 "查询rpm包详细信息失败" - - # 验证rpm包文件列表 - LOG_INFO "验证rpm包文件列表查询" - rpm -ql rpm > /dev/null 2>&1 - CHECK_RESULT $? 0 0 "查询rpm包文件列表失败" - - # 验证rpm包校验功能 - LOG_INFO "验证rpm包文件完整性校验" - rpm -V rpm - CHECK_RESULT $? 0 0 "rpm包文件完整性校验失败" - - # 验证不支持的参数 - LOG_INFO "验证不支持的参数处理" - rpm --invalid-parameter > /dev/null 2>&1 - if [ $? -ne 255 ]; then - LOG_ERROR "不支持的参数处理异常" - exit 255 - fi - - # 清理环境 - if [ $ALREADY_INSTALLED -eq 0 ]; then - LOG_INFO "卸载测试安装的rpm包" - dnf remove -y rpm - CHECK_RESULT $? 0 0 "卸载rpm包失败" - else - LOG_INFO "保持rpm包安装状态" - fi - - LOG_INFO "测试完成:rpm包完整性验证成功" -} - -main "$@" \ No newline at end of file diff --git a/testcases/function_test/pkg_test/rpm/rpm-devel/test_rpm-devel_function_whatprovides.sh b/testcases/function_test/pkg_test/rpm/rpm-devel/test_rpm-devel_function_whatprovides.sh deleted file mode 100644 index d783287d15b..00000000000 --- a/testcases/function_test/pkg_test/rpm/rpm-devel/test_rpm-devel_function_whatprovides.sh +++ /dev/null @@ -1,99 +0,0 @@ -#!/usr/bin/bash - -# Copyright (c) 2024 ISCAS .ALL rights reserved. -# This program is licensed under Mulan PSL v2. -# You can use it according to the terms and conditions of the Mulan PSL v2. -# http://license.coscl.org.cn/MulanPSL2 -# THIS PROGRAM IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, -# EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, -# MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. -# See the Mulan PSL v2 for more details. - -# ############################################# -# @Author : honghua -# @Contact : honghua@iscas.ac.cn -# @Date : 2026-03-11 -# @License : Mulan PSL v2 -# @Desc : 测试查询提供特定功能的包 -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - LOG_INFO "开始测试查询提供特定功能的包功能" - LOG_INFO "步骤1: 检查dnf工具是否可用" - command -v dnf >/dev/null 2>&1 - if [ $? -ne 0 ]; then - LOG_ERROR "dnf工具未安装,测试无法继续" - exit 255 - fi - LOG_INFO "dnf工具检查通过" - - LOG_INFO "步骤2: 判断测试所需的rpm-devel包在yum源中是否存在" - dnf list available rpm-devel >/dev/null 2>&1 - if [ $? -ne 0 ]; then - LOG_ERROR "yum源中未找到rpm-devel软件包" - exit 255 - fi - LOG_INFO "rpm-devel软件包在yum源中存在" - - LOG_INFO "步骤3: 检查当前环境中是否已经安装了rpm-devel包" - rpm -q rpm-devel >/dev/null 2>&1 - if [ $? -eq 0 ]; then - LOG_INFO "检测到rpm-devel已安装,标记为已安装状态" - INSTALLED_FLAG=1 - else - LOG_INFO "检测到rpm-devel未安装,标记为未安装状态" - INSTALLED_FLAG=0 - fi - - LOG_INFO "步骤4: 如果未安装,则执行安装操作" - if [ $INSTALLED_FLAG -eq 0 ]; then - LOG_INFO "开始安装rpm-devel软件包" - dnf install -y rpm-devel - CHECK_RESULT $? 0 0 "安装rpm-devel软件包失败" - LOG_INFO "rpm-devel软件包安装成功" - fi - - LOG_INFO "步骤5: 测试dnf provides命令的基本功能" - LOG_INFO "执行命令: dnf provides "*/rpmbuild"" - dnf provides "*/rpmbuild" - CHECK_RESULT $? 0 0 "dnf provides命令执行失败" - LOG_INFO "dnf provides命令基本功能测试通过" - - LOG_INFO "步骤6: 测试dnf provides命令查询提供特定文件的功能" - LOG_INFO "执行命令: dnf provides /usr/bin/rpmbuild" - dnf provides /usr/bin/rpmbuild - CHECK_RESULT $? 0 0 "查询提供/usr/bin/rpmbuild文件的功能失败" - LOG_INFO "查询提供特定文件功能测试通过" - - LOG_INFO "步骤7: 测试dnf provides命令查询提供特定能力的功能" - LOG_INFO "执行命令: dnf provides "rpmlib(VersionedDependencies)"" - dnf provides "rpmlib(VersionedDependencies)" - CHECK_RESULT $? 0 0 "查询提供rpmlib能力的功能失败" - LOG_INFO "查询提供特定能力功能测试通过" - - LOG_INFO "步骤8: 测试dnf provides命令不支持的参数" - LOG_INFO "执行命令: dnf provides --invalid-option" - dnf provides --invalid-option >/dev/null 2>&1 - if [ $? -eq 255 ]; then - LOG_INFO "不支持的参数处理正确,返回退出码255" - else - LOG_ERROR "不支持的参数处理异常" - exit 255 - fi - - LOG_INFO "步骤9: 环境清理,如果脚本开始时未安装,则卸载软件包" - if [ $INSTALLED_FLAG -eq 0 ]; then - LOG_INFO "开始卸载rpm-devel软件包" - dnf remove -y rpm-devel - CHECK_RESULT $? 0 0 "卸载rpm-devel软件包失败" - LOG_INFO "rpm-devel软件包卸载成功,环境已恢复" - else - LOG_INFO "脚本开始时rpm-devel已安装,保持安装状态,无需卸载" - fi - - LOG_INFO "测试查询提供特定功能的包功能完成" -} - -main "$@" \ No newline at end of file diff --git a/testcases/function_test/pkg_test/rpm/rpm-devel/test_rpm-devel_rpmgraph_--dbpath.sh b/testcases/function_test/pkg_test/rpm/rpm-devel/test_rpm-devel_rpmgraph_--dbpath.sh deleted file mode 100644 index 4a5b67e2ed8..00000000000 --- a/testcases/function_test/pkg_test/rpm/rpm-devel/test_rpm-devel_rpmgraph_--dbpath.sh +++ /dev/null @@ -1,93 +0,0 @@ -#!/usr/bin/bash - -# Copyright (c) 2024 ISCAS .ALL rights reserved. -# This program is licensed under Mulan PSL v2. -# You can use it according to the terms and conditions of the Mulan PSL v2. -# http://license.coscl.org.cn/MulanPSL2 -# THIS PROGRAM IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, -# EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, -# MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. -# See the Mulan PSL v2 for more details. - -# ############################################# -# @Author : honghua -# @Contact : honghua@iscas.ac.cn -# @Date : 2026-03-11 -# @License : Mulan PSL v2 -# @Desc : 测试使用 --dbpath 参数指定数据库目录 -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - # 检查是否已安装rpm-devel和rpmgraph软件包 - LOG_INFO "检查是否已安装rpm-devel和rpmgraph软件包" - rpm -q rpm-devel > /dev/null 2>&1 - rpm_devel_installed=$? - rpm -q rpmgraph > /dev/null 2>&1 - rpmgraph_installed=$? - - # 定义安装和卸载函数 - install_packages() { - LOG_INFO "开始安装rpm-devel和rpmgraph软件包" - dnf install -y rpm-devel rpmgraph - CHECK_RESULT $? 0 0 "安装软件包失败" - } - - uninstall_packages() { - LOG_INFO "开始卸载rpm-devel和rpmgraph软件包" - dnf remove -y rpm-devel rpmgraph - CHECK_RESULT $? 0 0 "卸载软件包失败" - } - - # 检查yum源中是否有软件包 - LOG_INFO "检查yum源中是否有rpm-devel软件包" - dnf list available rpm-devel > /dev/null 2>&1 - CHECK_RESULT $? 0 255 "yum源中没有rpm-devel软件包" - - LOG_INFO "检查yum源中是否有rpmgraph软件包" - dnf list available rpmgraph > /dev/null 2>&1 - CHECK_RESULT $? 0 255 "yum源中没有rpmgraph软件包" - - # 记录初始安装状态 - initial_installed=0 - if [ $rpm_devel_installed -eq 0 ] && [ $rpmgraph_installed -eq 0 ]; then - LOG_INFO "环境已安装rpm-devel和rpmgraph软件包" - initial_installed=1 - else - LOG_INFO "环境未安装rpm-devel和rpmgraph软件包,将进行安装" - install_packages - fi - - # 测试rpmgraph命令的--dbpath参数 - LOG_INFO "测试rpmgraph命令是否支持--dbpath参数" - rpmgraph --help | grep -q "\-\-dbpath" - CHECK_RESULT $? 0 255 "rpmgraph命令不支持--dbpath参数" - - # 创建测试用的数据库目录 - LOG_INFO "创建测试用的数据库目录" - test_db_dir=$(mktemp -d) - CHECK_RESULT $? 0 0 "创建测试数据库目录失败" - - # 使用--dbpath参数执行rpmgraph命令 - LOG_INFO "使用--dbpath参数执行rpmgraph命令" - rpmgraph --dbpath $test_db_dir --help > /dev/null 2>&1 - CHECK_RESULT $? 0 0 "使用--dbpath参数执行rpmgraph命令失败" - - # 清理测试数据库目录 - LOG_INFO "清理测试数据库目录" - rm -rf $test_db_dir - CHECK_RESULT $? 0 0 "清理测试数据库目录失败" - - # 环境恢复 - if [ $initial_installed -eq 0 ]; then - LOG_INFO "恢复环境:卸载测试安装的软件包" - uninstall_packages - else - LOG_INFO "环境已安装,保持安装状态" - fi - - LOG_INFO "测试完成" -} - -main "$@" \ No newline at end of file diff --git a/testcases/function_test/pkg_test/rpm/rpm-devel/test_rpm-devel_rpmgraph_--help.sh b/testcases/function_test/pkg_test/rpm/rpm-devel/test_rpm-devel_rpmgraph_--help.sh deleted file mode 100644 index 075c78b5550..00000000000 --- a/testcases/function_test/pkg_test/rpm/rpm-devel/test_rpm-devel_rpmgraph_--help.sh +++ /dev/null @@ -1,79 +0,0 @@ -#!/usr/bin/bash - -# Copyright (c) 2024 ISCAS .ALL rights reserved. -# This program is licensed under Mulan PSL v2. -# You can use it according to the terms and conditions of the Mulan PSL v2. -# http://license.coscl.org.cn/MulanPSL2 -# THIS PROGRAM IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, -# EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, -# MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. -# See the Mulan PSL v2 for more details. - -# ############################################# -# @Author : honghua -# @Contact : honghua@iscas.ac.cn -# @Date : 2026-03-11 -# @License : Mulan PSL v2 -# @Desc : 测试使用 --help 参数,显示帮助信息 -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - LOG_INFO "开始测试rpm-devel和rpmgraph命令的--help参数功能" - LOG_INFO "步骤1:检查yum源中是否存在rpm-devel和rpmgraph软件包" - if ! dnf list available rpm-devel &> /dev/null; then - LOG_ERROR "yum源中未找到rpm-devel软件包" - exit 255 - fi - if ! dnf list available rpmgraph &> /dev/null; then - LOG_ERROR "yum源中未找到rpmgraph软件包" - exit 255 - fi - - LOG_INFO "步骤2:检查系统是否已安装rpm-devel和rpmgraph软件包" - installed=0 - if rpm -q rpm-devel &> /dev/null && rpm -q rpmgraph &> /dev/null; then - LOG_INFO "软件包已安装,测试后将保持安装状态" - installed=1 - else - LOG_INFO "软件包未安装,将进行安装并在测试后卸载" - dnf install -y rpm-devel rpmgraph - CHECK_RESULT $? 0 0 "安装rpm-devel和rpmgraph软件包失败" - fi - - LOG_INFO "步骤3:测试rpm-devel命令的--help参数" - if rpm-devel --help &> /dev/null; then - LOG_INFO "rpm-devel --help 执行成功" - else - LOG_ERROR "rpm-devel --help 参数不存在或不支持" - if [ $installed -eq 0 ]; then - dnf remove -y rpm-devel rpmgraph - fi - exit 255 - fi - - LOG_INFO "步骤4:测试rpmgraph命令的--help参数" - if rpmgraph --help &> /dev/null; then - LOG_INFO "rpmgraph --help 执行成功" - else - LOG_ERROR "rpmgraph --help 参数不存在或不支持" - if [ $installed -eq 0 ]; then - dnf remove -y rpm-devel rpmgraph - fi - exit 255 - fi - - LOG_INFO "步骤5:清理测试环境" - if [ $installed -eq 0 ]; then - LOG_INFO "卸载测试安装的软件包" - dnf remove -y rpm-devel rpmgraph - CHECK_RESULT $? 0 0 "卸载rpm-devel和rpmgraph软件包失败" - else - LOG_INFO "保持软件包安装状态" - fi - - LOG_INFO "测试完成" -} - -main "$@" \ No newline at end of file diff --git a/testcases/function_test/pkg_test/rpm/rpm-devel/test_rpm-devel_rpmgraph_--load.sh b/testcases/function_test/pkg_test/rpm/rpm-devel/test_rpm-devel_rpmgraph_--load.sh deleted file mode 100644 index 3af83dc0afc..00000000000 --- a/testcases/function_test/pkg_test/rpm/rpm-devel/test_rpm-devel_rpmgraph_--load.sh +++ /dev/null @@ -1,121 +0,0 @@ -#!/usr/bin/bash - -# Copyright (c) 2024 ISCAS .ALL rights reserved. -# This program is licensed under Mulan PSL v2. -# You can use it according to the terms and conditions of the Mulan PSL v2. -# http://license.coscl.org.cn/MulanPSL2 -# THIS PROGRAM IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, -# EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, -# MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. -# See the Mulan PSL v2 for more details. - -# ############################################# -# @Author : honghua -# @Contact : honghua@iscas.ac.cn -# @Date : 2026-03-11 -# @License : Mulan PSL v2 -# @Desc : 测试使用 --load 参数加载单个宏文件 -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - # 定义函数:检查软件包是否在yum源中 - check_package_in_repo() { - local package_name=$1 - dnf list available "$package_name" &>/dev/null - if [[ $? -ne 0 ]]; then - LOG_ERROR "软件包 $package_name 不在yum源中" - exit 255 - fi - } - - # 定义函数:检查命令参数是否支持 - check_command_option() { - local command_name=$1 - local option=$2 - if ! $command_name --help 2>&1 | grep -q -- "$option"; then - LOG_ERROR "命令 $command_name 不支持参数 $option" - exit 255 - fi - } - - # 定义函数:检查软件包是否已安装 - check_package_installed() { - local package_name=$1 - rpm -q "$package_name" &>/dev/null - return $? - } - - # 定义函数:清理环境 - cleanup_environment() { - if [[ $installed_by_script -eq 1 ]]; then - LOG_INFO "清理环境:卸载由脚本安装的软件包" - dnf remove -y rpm-devel rpmgraph &>/dev/null - CHECK_RESULT $? 0 0 "卸载软件包失败" - fi - } - - # 主函数 - main() { - # 初始化变量 - local installed_by_script=0 - local macro_file="/tmp/test_macro.mac" - - # 步骤1:检查yum源中是否存在rpm-devel和rpmgraph软件包 - LOG_INFO "步骤1:检查yum源中是否存在rpm-devel和rpmgraph软件包" - check_package_in_repo "rpm-devel" - check_package_in_repo "rpmgraph" - - # 步骤2:检查rpmgraph命令是否支持--load参数 - LOG_INFO "步骤2:检查rpmgraph命令是否支持--load参数" - check_command_option "rpmgraph" "--load" - - # 步骤3:检查rpm-devel和rpmgraph是否已安装 - LOG_INFO "步骤3:检查rpm-devel和rpmgraph是否已安装" - local need_install=0 - if ! check_package_installed "rpm-devel"; then - need_install=1 - fi - if ! check_package_installed "rpmgraph"; then - need_install=1 - fi - - # 步骤4:如果需要则安装软件包 - if [[ $need_install -eq 1 ]]; then - LOG_INFO "步骤4:安装rpm-devel和rpmgraph软件包" - dnf install -y rpm-devel rpmgraph &>/dev/null - CHECK_RESULT $? 0 0 "安装软件包失败" - installed_by_script=1 - else - LOG_INFO "步骤4:软件包已安装,无需重复安装" - fi - - # 步骤5:创建测试用的宏文件 - LOG_INFO "步骤5:创建测试用的宏文件" - echo "%_topdir /usr/src/rpm" > "$macro_file" - CHECK_RESULT $? 0 0 "创建宏文件失败" - - # 步骤6:使用rpmgraph --load加载单个宏文件 - LOG_INFO "步骤6:使用rpmgraph --load加载单个宏文件" - rpmgraph --load "$macro_file" &>/dev/null - CHECK_RESULT $? 0 0 "rpmgraph --load命令执行失败" - - # 步骤7:清理临时文件 - LOG_INFO "步骤7:清理临时文件" - rm -f "$macro_file" - CHECK_RESULT $? 0 0 "删除临时文件失败" - - # 步骤8:清理环境 - LOG_INFO "步骤8:清理环境" - cleanup_environment - } - - # 设置异常处理 - trap cleanup_environment EXIT - - # 执行主函数 - main -} - -main "$@" \ No newline at end of file diff --git a/testcases/function_test/pkg_test/rpm/rpm-devel/test_rpm-devel_rpmgraph_--macros.sh b/testcases/function_test/pkg_test/rpm/rpm-devel/test_rpm-devel_rpmgraph_--macros.sh deleted file mode 100644 index 2c378fb820f..00000000000 --- a/testcases/function_test/pkg_test/rpm/rpm-devel/test_rpm-devel_rpmgraph_--macros.sh +++ /dev/null @@ -1,89 +0,0 @@ -#!/usr/bin/bash - -# Copyright (c) 2024 ISCAS .ALL rights reserved. -# This program is licensed under Mulan PSL v2. -# You can use it according to the terms and conditions of the Mulan PSL v2. -# http://license.coscl.org.cn/MulanPSL2 -# THIS PROGRAM IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, -# EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, -# MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. -# See the Mulan PSL v2 for more details. - -# ############################################# -# @Author : honghua -# @Contact : honghua@iscas.ac.cn -# @Date : 2026-03-11 -# @License : Mulan PSL v2 -# @Desc : 测试使用 --macros 参数指定宏文件 -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - # 检查是否已经安装了rpm-devel和rpmgraph包 - LOG_INFO "检查是否已经安装了rpm-devel和rpmgraph软件包" - if rpm -q rpm-devel rpmgraph >/dev/null 2>&1; then - LOG_INFO "rpm-devel和rpmgraph已经安装,脚本结束时将保持安装状态" - already_installed=true - else - LOG_INFO "rpm-devel和rpmgraph未安装,将在测试过程中安装" - already_installed=false - fi - - # 检查yum源中是否存在rpm-devel和rpmgraph包 - LOG_INFO "检查yum源中是否存在rpm-devel和rpmgraph软件包" - if ! dnf list available rpm-devel rpmgraph >/dev/null 2>&1; then - LOG_ERROR "yum源中不存在rpm-devel或rpmgraph软件包" - exit 255 - fi - - # 如果未安装,则安装软件包 - if [ "$already_installed" = false ]; then - LOG_INFO "安装rpm-devel和rpmgraph软件包" - dnf install -y rpm-devel rpmgraph - CHECK_RESULT $? 0 0 "安装rpm-devel和rpmgraph失败" - fi - - # 测试使用--macros参数指定宏文件 - LOG_INFO "测试使用--macros参数指定宏文件" - # 创建一个临时宏文件用于测试 - temp_macro_file=$(mktemp) - echo "%_topdir /tmp/rpmbuild" > "$temp_macro_file" - - # 测试rpmgraph命令是否支持--macros参数 - LOG_INFO "检查rpmgraph命令是否支持--macros参数" - if ! rpmgraph --help 2>&1 | grep -q "\-\-macros"; then - LOG_ERROR "rpmgraph命令不支持--macros参数" - # 清理临时文件 - rm -f "$temp_macro_file" - # 如果测试过程中安装了软件包,需要卸载 - if [ "$already_installed" = false ]; then - LOG_INFO "卸载测试过程中安装的软件包" - dnf remove -y rpm-devel rpmgraph - fi - exit 255 - fi - - # 使用--macros参数执行rpmgraph命令 - LOG_INFO "使用--macros参数执行rpmgraph命令" - rpmgraph --macros "$temp_macro_file" --help >/dev/null 2>&1 - CHECK_RESULT $? 0 0 "使用--macros参数执行rpmgraph命令失败" - - # 清理临时文件 - LOG_INFO "清理临时文件" - rm -f "$temp_macro_file" - - # 环境恢复 - LOG_INFO "恢复测试环境" - if [ "$already_installed" = false ]; then - LOG_INFO "卸载测试过程中安装的软件包" - dnf remove -y rpm-devel rpmgraph - CHECK_RESULT $? 0 0 "卸载rpm-devel和rpmgraph失败" - else - LOG_INFO "保持rpm-devel和rpmgraph的安装状态" - fi - - LOG_INFO "测试脚本执行完成" -} - -main "$@" \ No newline at end of file diff --git a/testcases/function_test/pkg_test/rpm/rpm-devel/test_rpm-devel_rpmgraph_--nodigest.sh b/testcases/function_test/pkg_test/rpm/rpm-devel/test_rpm-devel_rpmgraph_--nodigest.sh deleted file mode 100644 index 03049210ffb..00000000000 --- a/testcases/function_test/pkg_test/rpm/rpm-devel/test_rpm-devel_rpmgraph_--nodigest.sh +++ /dev/null @@ -1,93 +0,0 @@ -#!/usr/bin/bash - -# Copyright (c) 2024 ISCAS .ALL rights reserved. -# This program is licensed under Mulan PSL v2. -# You can use it according to the terms and conditions of the Mulan PSL v2. -# http://license.coscl.org.cn/MulanPSL2 -# THIS PROGRAM IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, -# EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, -# MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. -# See the Mulan PSL v2 for more details. - -# ############################################# -# @Author : honghua -# @Contact : honghua@iscas.ac.cn -# @Date : 2026-03-11 -# @License : Mulan PSL v2 -# @Desc : 测试使用 --nodigest 参数,不验证软件包摘要 -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - # 检查是否已安装rpm-devel和rpmgraph包 - LOG_INFO "检查rpm-devel和rpmgraph包是否已安装" - rpm -q rpm-devel rpmgraph >/dev/null 2>&1 - PACKAGES_INSTALLED=$? - - # 如果未安装,则安装软件包 - if [ $PACKAGES_INSTALLED -ne 0 ]; then - LOG_INFO "rpm-devel和rpmgraph包未安装,开始安装" - - # 检查yum源中是否有rpm-devel包 - LOG_INFO "检查yum源中是否有rpm-devel包" - dnf list available rpm-devel >/dev/null 2>&1 - CHECK_RESULT $? 0 0 "yum源中没有rpm-devel包" - if [ $? -ne 0 ]; then - LOG_ERROR "yum源中没有rpm-devel包" - exit 255 - fi - - # 检查yum源中是否有rpmgraph包 - LOG_INFO "检查yum源中是否有rpmgraph包" - dnf list available rpmgraph >/dev/null 2>&1 - CHECK_RESULT $? 0 0 "yum源中没有rpmgraph包" - if [ $? -ne 0 ]; then - LOG_ERROR "yum源中没有rpmgraph包" - exit 255 - fi - - # 安装rpm-devel和rpmgraph包 - LOG_INFO "开始安装rpm-devel和rpmgraph包" - dnf install -y rpm-devel rpmgraph - CHECK_RESULT $? 0 0 "安装rpm-devel和rpmgraph包失败" - - # 设置安装标志 - NEED_CLEANUP=1 - else - LOG_INFO "rpm-devel和rpmgraph包已安装" - NEED_CLEANUP=0 - fi - - # 测试rpmgraph命令的--nodigest参数是否存在 - LOG_INFO "测试rpmgraph命令的--nodigest参数是否存在" - rpmgraph --help 2>&1 | grep -q -- "--nodigest" - CHECK_RESULT $? 0 0 "rpmgraph命令不支持--nodigest参数" - if [ $? -ne 0 ]; then - LOG_ERROR "rpmgraph命令不支持--nodigest参数" - # 如果之前安装了软件包,需要清理 - if [ $NEED_CLEANUP -eq 1 ]; then - LOG_INFO "清理安装的软件包" - dnf remove -y rpm-devel rpmgraph - fi - exit 255 - fi - - # 测试使用--nodigest参数,不验证软件包摘要 - LOG_INFO "测试使用--nodigest参数,不验证软件包摘要" - # 使用一个已安装的包进行测试 - TEST_PACKAGE="rpm" - rpmgraph --nodigest $TEST_PACKAGE >/dev/null 2>&1 - CHECK_RESULT $? 0 0 "使用--nodigest参数执行rpmgraph命令失败" - - # 清理环境 - if [ $NEED_CLEANUP -eq 1 ]; then - LOG_INFO "清理安装的软件包" - dnf remove -y rpm-devel rpmgraph - CHECK_RESULT $? 0 0 "卸载rpm-devel和rpmgraph包失败" - fi - - LOG_INFO "测试完成" -} - -main "$@" \ No newline at end of file diff --git a/testcases/function_test/pkg_test/rpm/rpm-devel/test_rpm-devel_rpmgraph_--nolegacy.sh b/testcases/function_test/pkg_test/rpm/rpm-devel/test_rpm-devel_rpmgraph_--nolegacy.sh deleted file mode 100644 index fab972e0a5f..00000000000 --- a/testcases/function_test/pkg_test/rpm/rpm-devel/test_rpm-devel_rpmgraph_--nolegacy.sh +++ /dev/null @@ -1,74 +0,0 @@ -#!/usr/bin/bash - -# Copyright (c) 2024 ISCAS .ALL rights reserved. -# This program is licensed under Mulan PSL v2. -# You can use it according to the terms and conditions of the Mulan PSL v2. -# http://license.coscl.org.cn/MulanPSL2 -# THIS PROGRAM IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, -# EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, -# MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. -# See the Mulan PSL v2 for more details. - -# ############################################# -# @Author : honghua -# @Contact : honghua@iscas.ac.cn -# @Date : 2026-03-11 -# @License : Mulan PSL v2 -# @Desc : 测试使用 --nolegacy 参数,不验证头部和负载签名 -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - # 定义变量 - PKG_NAME="rpm-devel" - CMD_NAME="rpmgraph" - CMD_OPTION="--nolegacy" - - # 步骤1: 检查yum源中是否存在rpm-devel软件包 - LOG_INFO "检查yum源中是否存在${PKG_NAME}软件包" - if ! dnf list available ${PKG_NAME} &>/dev/null; then - LOG_ERROR "yum源中不存在${PKG_NAME}软件包" - exit 255 - fi - - # 步骤2: 检查rpmgraph命令是否支持--nolegacy参数 - LOG_INFO "检查${CMD_NAME}命令是否支持${CMD_OPTION}参数" - if ! ${CMD_NAME} --help 2>&1 | grep -q "${CMD_OPTION}"; then - LOG_ERROR "${CMD_NAME}命令不支持${CMD_OPTION}参数" - exit 255 - fi - - # 步骤3: 检查环境是否已安装rpm-devel软件包 - LOG_INFO "检查环境是否已安装${PKG_NAME}软件包" - if rpm -q ${PKG_NAME} &>/dev/null; then - LOG_INFO "${PKG_NAME}软件包已安装,脚本结束时将保持安装状态" - INSTALLED_BEFORE=true - else - LOG_INFO "${PKG_NAME}软件包未安装,将在测试过程中安装" - INSTALLED_BEFORE=false - fi - - # 步骤4: 如果未安装,则安装rpm-devel软件包 - if [ "${INSTALLED_BEFORE}" = "false" ]; then - LOG_INFO "安装${PKG_NAME}软件包" - dnf install -y ${PKG_NAME} - CHECK_RESULT $? 0 0 "安装${PKG_NAME}软件包失败" - fi - - # 步骤5: 执行rpmgraph --nolegacy命令测试 - LOG_INFO "执行${CMD_NAME} ${CMD_OPTION}命令测试" - ${CMD_NAME} ${CMD_OPTION} - CHECK_RESULT $? 0 0 "执行${CMD_NAME} ${CMD_OPTION}命令失败" - - # 步骤6: 如果之前未安装,则在测试结束后卸载rpm-devel软件包 - if [ "${INSTALLED_BEFORE}" = "false" ]; then - LOG_INFO "卸载${PKG_NAME}软件包" - dnf remove -y ${PKG_NAME} - CHECK_RESULT $? 0 0 "卸载${PKG_NAME}软件包失败" - fi - - LOG_INFO "测试完成" -} - -main "$@" \ No newline at end of file diff --git a/testcases/function_test/pkg_test/rpm/rpm-devel/test_rpm-devel_rpmgraph_--nolegacy_--nodigest.sh b/testcases/function_test/pkg_test/rpm/rpm-devel/test_rpm-devel_rpmgraph_--nolegacy_--nodigest.sh deleted file mode 100644 index ed323d998b8..00000000000 --- a/testcases/function_test/pkg_test/rpm/rpm-devel/test_rpm-devel_rpmgraph_--nolegacy_--nodigest.sh +++ /dev/null @@ -1,84 +0,0 @@ -#!/usr/bin/bash - -# Copyright (c) 2024 ISCAS .ALL rights reserved. -# This program is licensed under Mulan PSL v2. -# You can use it according to the terms and conditions of the Mulan PSL v2. -# http://license.coscl.org.cn/MulanPSL2 -# THIS PROGRAM IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, -# EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, -# MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. -# See the Mulan PSL v2 for more details. - -# ############################################# -# @Author : honghua -# @Contact : honghua@iscas.ac.cn -# @Date : 2026-03-11 -# @License : Mulan PSL v2 -# @Desc : 测试同时使用 --nolegacy 和 --nodigest 参数,不验证签名和摘要 -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - # 检查是否已安装rpm-devel和rpmgraph - LOG_INFO "检查是否已安装rpm-devel和rpmgraph" - if rpm -q rpm-devel &>/dev/null && rpm -q rpmgraph &>/dev/null; then - LOG_INFO "rpm-devel和rpmgraph已安装" - INSTALLED=1 - else - LOG_INFO "rpm-devel和rpmgraph未安装" - INSTALLED=0 - fi - - # 检查yum源中是否存在rpm-devel和rpmgraph - LOG_INFO "检查yum源中是否存在rpm-devel和rpmgraph" - if ! dnf list available rpm-devel &>/dev/null; then - LOG_ERROR "yum源中不存在rpm-devel" - exit 255 - fi - if ! dnf list available rpmgraph &>/dev/null; then - LOG_ERROR "yum源中不存在rpmgraph" - exit 255 - fi - LOG_INFO "yum源中存在rpm-devel和rpmgraph" - - # 如果未安装,则安装软件包 - if [ $INSTALLED -eq 0 ]; then - LOG_INFO "开始安装rpm-devel和rpmgraph" - dnf install -y rpm-devel rpmgraph - CHECK_RESULT $? 0 0 "安装rpm-devel和rpmgraph失败" - LOG_INFO "安装rpm-devel和rpmgraph成功" - fi - - # 检查rpmgraph命令是否支持--nolegacy和--nodigest参数 - LOG_INFO "检查rpmgraph命令是否支持--nolegacy和--nodigest参数" - if ! rpmgraph --help 2>&1 | grep -q -- "--nolegacy"; then - LOG_ERROR "rpmgraph不支持--nolegacy参数" - exit 255 - fi - if ! rpmgraph --help 2>&1 | grep -q -- "--nodigest"; then - LOG_ERROR "rpmgraph不支持--nodigest参数" - exit 255 - fi - LOG_INFO "rpmgraph支持--nolegacy和--nodigest参数" - - # 测试同时使用--nolegacy和--nodigest参数 - LOG_INFO "测试同时使用--nolegacy和--nodigest参数,不验证签名和摘要" - rpmgraph --nolegacy --nodigest - CHECK_RESULT $? 0 0 "rpmgraph --nolegacy --nodigest执行失败" - LOG_INFO "rpmgraph --nolegacy --nodigest执行成功" - - # 清理环境:如果之前未安装,则卸载软件包 - if [ $INSTALLED -eq 0 ]; then - LOG_INFO "清理环境:卸载rpm-devel和rpmgraph" - dnf remove -y rpm-devel rpmgraph - CHECK_RESULT $? 0 0 "卸载rpm-devel和rpmgraph失败" - LOG_INFO "卸载rpm-devel和rpmgraph成功" - else - LOG_INFO "环境已安装rpm-devel和rpmgraph,保持安装状态" - fi - - LOG_INFO "测试脚本执行完成" -} - -main "$@" \ No newline at end of file diff --git a/testcases/function_test/pkg_test/rpm/rpm-devel/test_rpm-devel_rpmgraph_--nosignature.sh b/testcases/function_test/pkg_test/rpm/rpm-devel/test_rpm-devel_rpmgraph_--nosignature.sh deleted file mode 100644 index 0058d28cdba..00000000000 --- a/testcases/function_test/pkg_test/rpm/rpm-devel/test_rpm-devel_rpmgraph_--nosignature.sh +++ /dev/null @@ -1,162 +0,0 @@ -#!/usr/bin/bash - -# Copyright (c) 2024 ISCAS .ALL rights reserved. -# This program is licensed under Mulan PSL v2. -# You can use it according to the terms and conditions of the Mulan PSL v2. -# http://license.coscl.org.cn/MulanPSL2 -# THIS PROGRAM IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, -# EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-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 : 测试使用 --nosignature 参数,不验证软件包签名 -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - # 测试使用 --nosignature 参数,不验证软件包签名 - - LOG_INFO "开始测试rpmgraph命令的--nosignature参数" - - # 定义需要测试的软件包 - PACKAGE_NAME="rpm-devel" - COMMAND="rpmgraph" - PARAM="--nosignature" - - # 步骤1:检查yum源中是否存在需要测试的软件包 - LOG_INFO "步骤1:检查yum源中是否存在${PACKAGE_NAME}软件包" - dnf list available ${PACKAGE_NAME} 2>/dev/null | grep -q ${PACKAGE_NAME} - if [ $? -ne 0 ]; then - LOG_ERROR "yum源中不存在${PACKAGE_NAME}软件包" - exit 255 - fi - LOG_INFO "yum源中存在${PACKAGE_NAME}软件包" - - # 步骤2:检查rpmgraph命令是否支持--nosignature参数 - LOG_INFO "步骤2:检查${COMMAND}命令是否支持${PARAM}参数" - ${COMMAND} --help 2>&1 | grep -q "${PARAM}" - if [ $? -ne 0 ]; then - LOG_ERROR "${COMMAND}命令不支持${PARAM}参数" - exit 255 - fi - LOG_INFO "${COMMAND}命令支持${PARAM}参数" - - # 步骤3:检查测试环境是否已安装rpm-devel软件包 - LOG_INFO "步骤3:检查测试环境是否已安装${PACKAGE_NAME}软件包" - rpm -q ${PACKAGE_NAME} >/dev/null 2>&1 - PACKAGE_INSTALLED=$? - - # 记录初始安装状态 - if [ ${PACKAGE_INSTALLED} -eq 0 ]; then - LOG_INFO "${PACKAGE_NAME}软件包已安装,测试结束后将保持安装状态" - NEED_CLEANUP=0 - else - LOG_INFO "${PACKAGE_NAME}软件包未安装,测试结束后将卸载" - NEED_CLEANUP=1 - fi - - # 步骤4:如果未安装,则安装rpm-devel软件包 - if [ ${PACKAGE_INSTALLED} -ne 0 ]; then - LOG_INFO "步骤4:安装${PACKAGE_NAME}软件包" - dnf install -y ${PACKAGE_NAME} - CHECK_RESULT $? 0 0 "安装${PACKAGE_NAME}软件包失败" - LOG_INFO "成功安装${PACKAGE_NAME}软件包" - fi - - # 步骤5:测试rpmgraph命令的--nosignature参数 - LOG_INFO "步骤5:测试${COMMAND}命令的${PARAM}参数" - - # 创建一个临时的rpm包用于测试 - TEST_RPM="/tmp/test-package.rpm" - LOG_INFO "创建测试用的rpm包" - rpmbuild -bb --quiet --define "_topdir /tmp/rpmbuild" \ - --define "name test-package" \ - --define "version 1.0" \ - --define "release 1" \ - --define "summary Test package" /dev/null 2>/dev/null || true - - # 查找生成的rpm包 - find /tmp/rpmbuild/RPMS -name "*.rpm" -type f 2>/dev/null | head -1 > ${TEST_RPM} - if [ -s ${TEST_RPM} ]; then - RPM_FILE=$(cat ${TEST_RPM}) - - # 测试不带--nosignature参数 - LOG_INFO "测试不带${PARAM}参数的rpmgraph命令" - ${COMMAND} ${RPM_FILE} >/dev/null 2>&1 - RESULT_WITHOUT=$? - - # 测试带--nosignature参数 - LOG_INFO "测试带${PARAM}参数的rpmgraph命令" - ${COMMAND} ${PARAM} ${RPM_FILE} >/dev/null 2>&1 - RESULT_WITH=$? - - # 清理临时rpm包 - if [ -f "${RPM_FILE}" ]; then - rm -f "${RPM_FILE}" - fi - rm -rf /tmp/rpmbuild ${TEST_RPM} 2>/dev/null || true - - # 检查两个命令的执行结果 - LOG_INFO "检查rpmgraph命令执行结果" - if [ ${RESULT_WITHOUT} -eq 0 ] || [ ${RESULT_WITH} -eq 0 ]; then - LOG_INFO "rpmgraph命令执行成功" - CHECK_RESULT 0 0 0 "rpmgraph命令执行失败" - else - LOG_ERROR "rpmgraph命令执行失败" - CHECK_RESULT 1 0 0 "rpmgraph命令执行失败" - fi - else - LOG_INFO "使用已安装的rpm包测试rpmgraph命令" - - # 获取一个已安装的rpm包进行测试 - INSTALLED_RPM=$(rpm -qa | head -1) - if [ -n "${INSTALLED_RPM}" ]; then - # 测试不带--nosignature参数 - ${COMMAND} ${INSTALLED_RPM} >/dev/null 2>&1 - RESULT_WITHOUT=$? - - # 测试带--nosignature参数 - ${COMMAND} ${PARAM} ${INSTALLED_RPM} >/dev/null 2>&1 - RESULT_WITH=$? - - LOG_INFO "检查rpmgraph命令执行结果" - if [ ${RESULT_WITHOUT} -eq 0 ] || [ ${RESULT_WITH} -eq 0 ]; then - LOG_INFO "rpmgraph命令执行成功" - CHECK_RESULT 0 0 0 "rpmgraph命令执行失败" - else - LOG_ERROR "rpmgraph命令执行失败" - CHECK_RESULT 1 0 0 "rpmgraph命令执行失败" - fi - else - LOG_ERROR "没有找到可用于测试的rpm包" - CHECK_RESULT 1 0 0 "没有找到可用于测试的rpm包" - fi - fi - - # 步骤6:清理测试环境 - LOG_INFO "步骤6:清理测试环境" - if [ ${NEED_CLEANUP} -eq 1 ]; then - LOG_INFO "卸载${PACKAGE_NAME}软件包" - dnf remove -y ${PACKAGE_NAME} - if [ $? -eq 0 ]; then - LOG_INFO "成功卸载${PACKAGE_NAME}软件包" - else - LOG_ERROR "卸载${PACKAGE_NAME}软件包失败" - fi - else - LOG_INFO "保持${PACKAGE_NAME}软件包安装状态" - fi - - # 清理临时文件 - rm -rf /tmp/rpmbuild /tmp/test-package.rpm 2>/dev/null || true - - LOG_INFO "测试完成" -} - -main "$@" \ No newline at end of file diff --git a/testcases/function_test/pkg_test/rpm/rpm-devel/test_rpm-devel_rpmgraph_--querytags.sh b/testcases/function_test/pkg_test/rpm/rpm-devel/test_rpm-devel_rpmgraph_--querytags.sh deleted file mode 100644 index 7deef500031..00000000000 --- a/testcases/function_test/pkg_test/rpm/rpm-devel/test_rpm-devel_rpmgraph_--querytags.sh +++ /dev/null @@ -1,72 +0,0 @@ -#!/usr/bin/bash - -# Copyright (c) 2024 ISCAS .ALL rights reserved. -# This program is licensed under Mulan PSL v2. -# You can use it according to the terms and conditions of the Mulan PSL v2. -# http://license.coscl.org.cn/MulanPSL2 -# THIS PROGRAM IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, -# EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, -# MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. -# See the Mulan PSL v2 for more details. - -# ############################################# -# @Author : honghua -# @Contact : honghua@iscas.ac.cn -# @Date : 2026-03-11 -# @License : Mulan PSL v2 -# @Desc : 测试使用 --querytags 参数,显示已知的查询标签 -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - # 检查是否已安装rpm-devel和rpmgraph软件包 - LOG_INFO "检查是否已安装rpm-devel和rpmgraph软件包" - rpm -q rpm-devel rpmgraph > /dev/null 2>&1 - if [ $? -eq 0 ]; then - LOG_INFO "软件包已安装,测试结束后将保持安装状态" - INSTALLED=1 - else - LOG_INFO "软件包未安装,将在测试过程中安装" - INSTALLED=0 - fi - - # 检查yum源中是否存在rpm-devel和rpmgraph软件包 - LOG_INFO "检查yum源中是否存在rpm-devel和rpmgraph软件包" - dnf list available rpm-devel rpmgraph > /dev/null 2>&1 - if [ $? -ne 0 ]; then - LOG_ERROR "yum源中缺少rpm-devel或rpmgraph软件包" - exit 255 - fi - - # 如果未安装,则安装软件包 - if [ $INSTALLED -eq 0 ]; then - LOG_INFO "安装rpm-devel和rpmgraph软件包" - dnf install -y rpm-devel rpmgraph - CHECK_RESULT $? 0 0 "安装rpm-devel和rpmgraph软件包失败" - fi - - # 检查rpmgraph命令是否支持--querytags参数 - LOG_INFO "检查rpmgraph命令是否支持--querytags参数" - rpmgraph --help 2>&1 | grep -q "\-\-querytags" - if [ $? -ne 0 ]; then - LOG_ERROR "rpmgraph命令不支持--querytags参数" - exit 255 - fi - - # 测试使用--querytags参数显示已知的查询标签 - LOG_INFO "测试使用--querytags参数显示已知的查询标签" - rpmgraph --querytags - CHECK_RESULT $? 0 0 "执行rpmgraph --querytags命令失败" - - # 清理环境:如果测试前未安装软件包,则卸载 - if [ $INSTALLED -eq 0 ]; then - LOG_INFO "卸载rpm-devel和rpmgraph软件包" - dnf remove -y rpm-devel rpmgraph - CHECK_RESULT $? 0 0 "卸载rpm-devel和rpmgraph软件包失败" - fi - - LOG_INFO "测试完成,环境已恢复" -} - -main "$@" \ No newline at end of file diff --git a/testcases/function_test/pkg_test/rpm/rpm-devel/test_rpm-devel_rpmgraph_--quiet.sh b/testcases/function_test/pkg_test/rpm/rpm-devel/test_rpm-devel_rpmgraph_--quiet.sh deleted file mode 100644 index efc7bba5890..00000000000 --- a/testcases/function_test/pkg_test/rpm/rpm-devel/test_rpm-devel_rpmgraph_--quiet.sh +++ /dev/null @@ -1,79 +0,0 @@ -#!/usr/bin/bash - -# Copyright (c) 2024 ISCAS .ALL rights reserved. -# This program is licensed under Mulan PSL v2. -# You can use it according to the terms and conditions of the Mulan PSL v2. -# http://license.coscl.org.cn/MulanPSL2 -# THIS PROGRAM IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, -# EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, -# MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. -# See the Mulan PSL v2 for more details. - -# ############################################# -# @Author : honghua -# @Contact : honghua@iscas.ac.cn -# @Date : 2026-03-11 -# @License : Mulan PSL v2 -# @Desc : 测试使用 --quiet 参数,提供更少的详细信息输出 -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - LOG_INFO "开始测试 rpm-devel 包的 rpmgraph --quiet 参数功能" - LOG_INFO "检查系统中是否已安装 rpm-devel 包" - if rpm -q rpm-devel > /dev/null 2>&1; then - LOG_INFO "rpm-devel 包已安装,测试结束后将保持安装状态" - ALREADY_INSTALLED=1 - else - LOG_INFO "rpm-devel 包未安装,将在测试过程中安装" - ALREADY_INSTALLED=0 - fi - - LOG_INFO "检查 yum 源中是否存在 rpm-devel 包" - if ! dnf list available rpm-devel > /dev/null 2>&1; then - LOG_ERROR "yum 源中未找到 rpm-devel 包" - exit 255 - fi - - if [ $ALREADY_INSTALLED -eq 0 ]; then - LOG_INFO "安装 rpm-devel 包" - dnf install -y rpm-devel - CHECK_RESULT $? 0 0 "安装 rpm-devel 包失败" - fi - - LOG_INFO "检查 rpmgraph 命令是否支持 --quiet 参数" - rpmgraph --help 2>&1 | grep -q -- "--quiet" - if [ $? -ne 0 ]; then - LOG_ERROR "rpmgraph 命令不支持 --quiet 参数" - if [ $ALREADY_INSTALLED -eq 0 ]; then - LOG_INFO "清理环境:卸载 rpm-devel 包" - dnf remove -y rpm-devel - fi - exit 255 - fi - - LOG_INFO "测试 rpmgraph --quiet 参数功能" - rpmgraph --quiet > /dev/null 2>&1 - CHECK_RESULT $? 0 0 "rpmgraph --quiet 命令执行失败" - - LOG_INFO "验证 --quiet 参数是否减少了输出信息" - NORMAL_OUTPUT=$(rpmgraph 2>&1 | wc -l) - QUIET_OUTPUT=$(rpmgraph --quiet 2>&1 | wc -l) - if [ $QUIET_OUTPUT -ge $NORMAL_OUTPUT ]; then - LOG_ERROR "--quiet 参数未减少输出信息" - CHECK_RESULT 1 0 0 "--quiet 参数验证失败" - else - LOG_INFO "--quiet 参数成功减少了输出信息" - fi - - if [ $ALREADY_INSTALLED -eq 0 ]; then - LOG_INFO "清理环境:卸载 rpm-devel 包" - dnf remove -y rpm-devel - CHECK_RESULT $? 0 0 "卸载 rpm-devel 包失败" - fi - - LOG_INFO "测试完成,环境已恢复" -} - -main "$@" \ No newline at end of file diff --git a/testcases/function_test/pkg_test/rpm/rpm-devel/test_rpm-devel_rpmgraph_--rcfile.sh b/testcases/function_test/pkg_test/rpm/rpm-devel/test_rpm-devel_rpmgraph_--rcfile.sh deleted file mode 100644 index ce9acaf8edf..00000000000 --- a/testcases/function_test/pkg_test/rpm/rpm-devel/test_rpm-devel_rpmgraph_--rcfile.sh +++ /dev/null @@ -1,84 +0,0 @@ -#!/usr/bin/bash - -# Copyright (c) 2024 ISCAS .ALL rights reserved. -# This program is licensed under Mulan PSL v2. -# You can use it according to the terms and conditions of the Mulan PSL v2. -# http://license.coscl.org.cn/MulanPSL2 -# THIS PROGRAM IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, -# EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, -# MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. -# See the Mulan PSL v2 for more details. - -# ############################################# -# @Author : honghua -# @Contact : honghua@iscas.ac.cn -# @Date : 2026-03-11 -# @License : Mulan PSL v2 -# @Desc : 测试使用 --rcfile 参数指定配置文件 -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - LOG_INFO "测试开始:测试使用 --rcfile 参数指定配置文件" - - LOG_INFO "步骤1:检查软件包 rpm-devel 和 rpmgraph 是否在 yum 源中" - if ! dnf list available rpm-devel &> /dev/null; then - LOG_ERROR "软件包 rpm-devel 不在 yum 源中" - exit 255 - fi - if ! dnf list available rpmgraph &> /dev/null; then - LOG_ERROR "软件包 rpmgraph 不在 yum 源中" - exit 255 - fi - LOG_INFO "软件包 rpm-devel 和 rpmgraph 在 yum 源中" - - LOG_INFO "步骤2:检查环境中是否已安装 rpm-devel 和 rpmgraph" - INSTALLED=false - if rpm -q rpm-devel &> /dev/null && rpm -q rpmgraph &> /dev/null; then - LOG_INFO "软件包 rpm-devel 和 rpmgraph 已安装" - INSTALLED=true - else - LOG_INFO "软件包 rpm-devel 和 rpmgraph 未安装,开始安装" - dnf install -y rpm-devel rpmgraph - CHECK_RESULT $? 0 0 "安装 rpm-devel 和 rpmgraph 失败" - LOG_INFO "安装 rpm-devel 和 rpmgraph 成功" - fi - - LOG_INFO "步骤3:检查 rpmgraph 命令是否支持 --rcfile 参数" - if ! rpmgraph --help 2>&1 | grep -q -- "--rcfile"; then - LOG_ERROR "rpmgraph 命令不支持 --rcfile 参数" - exit 255 - fi - LOG_INFO "rpmgraph 命令支持 --rcfile 参数" - - LOG_INFO "步骤4:创建测试配置文件" - TEST_RCFILE="/tmp/test_rpmgraph_rcfile" - cat > "$TEST_RCFILE" << EOF - # 测试配置文件 - # 这里可以添加配置内容 - EOF - CHECK_RESULT $? 0 0 "创建测试配置文件失败" - - LOG_INFO "步骤5:使用 --rcfile 参数执行 rpmgraph 命令" - rpmgraph --rcfile "$TEST_RCFILE" --help - CHECK_RESULT $? 0 0 "使用 --rcfile 参数执行 rpmgraph 命令失败" - - LOG_INFO "步骤6:清理测试配置文件" - rm -f "$TEST_RCFILE" - CHECK_RESULT $? 0 0 "删除测试配置文件失败" - - LOG_INFO "步骤7:根据初始状态决定是否卸载软件包" - if [ "$INSTALLED" = "false" ]; then - LOG_INFO "初始状态未安装,卸载软件包 rpm-devel 和 rpmgraph" - dnf remove -y rpm-devel rpmgraph - CHECK_RESULT $? 0 0 "卸载 rpm-devel 和 rpmgraph 失败" - LOG_INFO "卸载 rpm-devel 和 rpmgraph 成功" - else - LOG_INFO "初始状态已安装,保持安装状态" - fi - - LOG_INFO "测试结束:测试使用 --rcfile 参数指定配置文件完成" -} - -main "$@" \ No newline at end of file diff --git a/testcases/function_test/pkg_test/rpm/rpm-devel/test_rpm-devel_rpmgraph_--showrc.sh b/testcases/function_test/pkg_test/rpm/rpm-devel/test_rpm-devel_rpmgraph_--showrc.sh deleted file mode 100644 index 876807d962e..00000000000 --- a/testcases/function_test/pkg_test/rpm/rpm-devel/test_rpm-devel_rpmgraph_--showrc.sh +++ /dev/null @@ -1,84 +0,0 @@ -#!/usr/bin/bash - -# Copyright (c) 2024 ISCAS .ALL rights reserved. -# This program is licensed under Mulan PSL v2. -# You can use it according to the terms and conditions of the Mulan PSL v2. -# http://license.coscl.org.cn/MulanPSL2 -# THIS PROGRAM IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, -# EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, -# MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. -# See the Mulan PSL v2 for more details. - -# ############################################# -# @Author : honghua -# @Contact : honghua@iscas.ac.cn -# @Date : 2026-03-11 -# @License : Mulan PSL v2 -# @Desc : 测试使用 --showrc 参数,显示最终的rpmrc和宏配置 -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - # 测试使用 --showrc 参数,显示最终的rpmrc和宏配置 - - # 定义软件包名称 - PACKAGE_NAME="rpm-devel" - COMMAND_NAME="rpmgraph" - PARAMETER="--showrc" - - # 步骤1:检查yum源中是否有rpm-devel软件包 - LOG_INFO "检查yum源中是否有${PACKAGE_NAME}软件包" - dnf list available ${PACKAGE_NAME} > /dev/null 2>&1 - if [ $? -ne 0 ]; then - LOG_ERROR "yum源中没有找到${PACKAGE_NAME}软件包" - exit 255 - fi - - # 步骤2:检查是否已经安装了rpm-devel软件包 - LOG_INFO "检查是否已经安装了${PACKAGE_NAME}软件包" - rpm -q ${PACKAGE_NAME} > /dev/null 2>&1 - PACKAGE_INSTALLED=$? - - # 步骤3:如果未安装,则安装软件包 - if [ ${PACKAGE_INSTALLED} -ne 0 ]; then - LOG_INFO "安装${PACKAGE_NAME}软件包" - dnf install -y ${PACKAGE_NAME} - CHECK_RESULT $? 0 0 "安装${PACKAGE_NAME}失败" - fi - - # 步骤4:检查rpmgraph命令是否支持--showrc参数 - LOG_INFO "检查${COMMAND_NAME}命令是否支持${PARAMETER}参数" - ${COMMAND_NAME} ${PARAMETER} 2>&1 | grep -q "unknown option" - if [ $? -eq 0 ]; then - LOG_ERROR "${COMMAND_NAME}命令不支持${PARAMETER}参数" - exit 255 - fi - - # 步骤5:执行rpmgraph --showrc命令 - LOG_INFO "执行${COMMAND_NAME} ${PARAMETER}命令" - ${COMMAND_NAME} ${PARAMETER} > /dev/null 2>&1 - CHECK_RESULT $? 0 0 "执行${COMMAND_NAME} ${PARAMETER}命令失败" - - # 步骤6:验证输出内容包含rpmrc和宏配置信息 - LOG_INFO "验证输出内容包含rpmrc和宏配置信息" - ${COMMAND_NAME} ${PARAMETER} | grep -q "rpmrc" - CHECK_RESULT $? 0 0 "输出内容不包含rpmrc配置信息" - - ${COMMAND_NAME} ${PARAMETER} | grep -q "macros" - CHECK_RESULT $? 0 0 "输出内容不包含宏配置信息" - - # 步骤7:清理环境 - LOG_INFO "清理测试环境" - if [ ${PACKAGE_INSTALLED} -ne 0 ]; then - LOG_INFO "卸载${PACKAGE_NAME}软件包" - dnf remove -y ${PACKAGE_NAME} - CHECK_RESULT $? 0 0 "卸载${PACKAGE_NAME}失败" - else - LOG_INFO "${PACKAGE_NAME}软件包原本已安装,保持安装状态" - fi - - LOG_INFO "测试完成" -} - -main "$@" \ No newline at end of file diff --git a/testcases/function_test/pkg_test/rpm/rpm-devel/test_rpm-devel_rpmgraph_--undefine.sh b/testcases/function_test/pkg_test/rpm/rpm-devel/test_rpm-devel_rpmgraph_--undefine.sh deleted file mode 100644 index e6da72e7c03..00000000000 --- a/testcases/function_test/pkg_test/rpm/rpm-devel/test_rpm-devel_rpmgraph_--undefine.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-11 -# @License : Mulan PSL v2 -# @Desc : 测试使用 --undefine 参数取消宏定义 -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - LOG_INFO "开始测试rpmgraph --undefine参数功能" - LOG_INFO "步骤1: 检查系统是否已安装rpm-devel和rpmgraph软件包" - if rpm -q rpm-devel rpmgraph >/dev/null 2>&1; then - LOG_INFO "rpm-devel和rpmgraph已安装,测试结束后将保持安装状态" - INSTALLED=1 - else - LOG_INFO "rpm-devel和rpmgraph未安装,将在测试过程中安装" - INSTALLED=0 - fi - - LOG_INFO "步骤2: 检查yum源中是否存在rpm-devel和rpmgraph软件包" - if ! dnf list available rpm-devel rpmgraph >/dev/null 2>&1; then - LOG_ERROR "yum源中不存在rpm-devel或rpmgraph软件包" - exit 255 - fi - - if [ $INSTALLED -eq 0 ]; then - LOG_INFO "步骤3: 安装rpm-devel和rpmgraph软件包" - dnf install -y rpm-devel rpmgraph - CHECK_RESULT $? 0 0 "安装rpm-devel和rpmgraph失败" - fi - - LOG_INFO "步骤4: 检查rpmgraph命令是否支持--undefine参数" - rpmgraph --help | grep -q "\-\-undefine" - CHECK_RESULT $? 0 0 "rpmgraph命令不支持--undefine参数" - if [ $? -ne 0 ]; then - exit 255 - fi - - LOG_INFO "步骤5: 测试使用--undefine参数取消宏定义" - TEST_RPM="/tmp/test_package.rpm" - rpmbuild -bb --define "_topdir /tmp/rpmbuild" --define "test_macro test_value" /dev/null 2>/dev/null || true - find /tmp/rpmbuild -name "*.rpm" -exec cp {} $TEST_RPM \; 2>/dev/null || true - - if [ -f $TEST_RPM ]; then - rpmgraph --undefine "test_macro" $TEST_RPM >/dev/null 2>&1 - CHECK_RESULT $? 0 0 "使用--undefine参数执行rpmgraph失败" - else - LOG_INFO "未生成测试rpm包,跳过具体参数测试" - fi - - LOG_INFO "步骤6: 清理测试环境" - rm -rf /tmp/rpmbuild $TEST_RPM 2>/dev/null - - if [ $INSTALLED -eq 0 ]; then - LOG_INFO "步骤7: 卸载测试安装的软件包" - dnf remove -y rpm-devel rpmgraph - CHECK_RESULT $? 0 0 "卸载rpm-devel和rpmgraph失败" - fi - - LOG_INFO "测试完成" -} - -main "$@" \ No newline at end of file diff --git a/testcases/function_test/pkg_test/rpm/rpm-devel/test_rpm-devel_rpmgraph__r.sh b/testcases/function_test/pkg_test/rpm/rpm-devel/test_rpm-devel_rpmgraph__r.sh deleted file mode 100644 index 9de767a9658..00000000000 --- a/testcases/function_test/pkg_test/rpm/rpm-devel/test_rpm-devel_rpmgraph__r.sh +++ /dev/null @@ -1,74 +0,0 @@ -#!/usr/bin/bash - -# Copyright (c) 2024 ISCAS .ALL rights reserved. -# This program is licensed under Mulan PSL v2. -# You can use it according to the terms and conditions of the Mulan PSL v2. -# http://license.coscl.org.cn/MulanPSL2 -# THIS PROGRAM IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, -# EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, -# MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. -# See the Mulan PSL v2 for more details. - -# ############################################# -# @Author : honghua -# @Contact : honghua@iscas.ac.cn -# @Date : 2026-03-11 -# @License : Mulan PSL v2 -# @Desc : 测试使用 -r 参数指定根目录 -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - LOG_INFO "开始测试 rpmgraph 命令的 -r 参数功能" - - LOG_INFO "步骤1:检查系统中是否已安装 rpm-devel 和 rpmgraph 软件包" - if rpm -q rpm-devel > /dev/null 2>&1 && rpm -q rpmgraph > /dev/null 2>&1; then - LOG_INFO "软件包已安装,测试后保持安装状态" - installed=true - else - LOG_INFO "软件包未安装,将在测试过程中安装" - installed=false - fi - - LOG_INFO "步骤2:检查 yum 源中是否存在 rpm-devel 和 rpmgraph 软件包" - if ! dnf list available rpm-devel > /dev/null 2>&1; then - LOG_ERROR "yum 源中未找到 rpm-devel 软件包" - exit 255 - fi - if ! dnf list available rpmgraph > /dev/null 2>&1; then - LOG_ERROR "yum 源中未找到 rpmgraph 软件包" - exit 255 - fi - - if [ "$installed" = false ]; then - LOG_INFO "步骤3:安装 rpm-devel 和 rpmgraph 软件包" - dnf install -y rpm-devel rpmgraph - CHECK_RESULT $? 0 0 "安装软件包失败" - fi - - LOG_INFO "步骤4:检查 rpmgraph 命令是否支持 -r 参数" - if ! rpmgraph --help 2>&1 | grep -q -- "-r"; then - LOG_ERROR "rpmgraph 命令不支持 -r 参数" - exit 255 - fi - - LOG_INFO "步骤5:测试使用 -r 参数指定根目录" - test_root="/tmp/test_rpmgraph_root" - mkdir -p "$test_root" - rpmgraph -r "$test_root" > /dev/null 2>&1 - CHECK_RESULT $? 0 0 "使用 -r 参数执行 rpmgraph 失败" - - LOG_INFO "步骤6:清理测试环境" - rm -rf "$test_root" - - if [ "$installed" = false ]; then - LOG_INFO "步骤7:卸载测试安装的软件包" - dnf remove -y rpm-devel rpmgraph - CHECK_RESULT $? 0 0 "卸载软件包失败" - fi - - LOG_INFO "测试完成" -} - -main "$@" \ No newline at end of file diff --git a/testcases/function_test/pkg_test/rpm/rpm-devel/test_rpm-devel_rpmgraph__upper_d.sh b/testcases/function_test/pkg_test/rpm/rpm-devel/test_rpm-devel_rpmgraph__upper_d.sh deleted file mode 100644 index b5f211f4dd5..00000000000 --- a/testcases/function_test/pkg_test/rpm/rpm-devel/test_rpm-devel_rpmgraph__upper_d.sh +++ /dev/null @@ -1,66 +0,0 @@ -#!/usr/bin/bash - -# Copyright (c) 2024 ISCAS .ALL rights reserved. -# This program is licensed under Mulan PSL v2. -# You can use it according to the terms and conditions of the Mulan PSL v2. -# http://license.coscl.org.cn/MulanPSL2 -# THIS PROGRAM IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, -# EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, -# MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. -# See the Mulan PSL v2 for more details. - -# ############################################# -# @Author : honghua -# @Contact : honghua@iscas.ac.cn -# @Date : 2026-03-11 -# @License : Mulan PSL v2 -# @Desc : 测试使用 -D 参数定义宏 -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - LOG_INFO "开始测试:测试使用 -D 参数定义宏" - LOG_INFO "步骤1:检查软件包 rpm-devel 和 rpmgraph 是否在 yum 源中" - if ! dnf list available rpm-devel &>/dev/null; then - LOG_ERROR "软件包 rpm-devel 不在 yum 源中" - exit 255 - fi - if ! dnf list available rpmgraph &>/dev/null; then - LOG_ERROR "软件包 rpmgraph 不在 yum 源中" - exit 255 - fi - LOG_INFO "步骤2:检查当前环境是否已安装 rpm-devel 和 rpmgraph" - if rpm -q rpm-devel &>/dev/null && rpm -q rpmgraph &>/dev/null; then - LOG_INFO "软件包已安装,测试结束后保持安装状态" - INSTALLED=1 - else - LOG_INFO "软件包未安装,开始安装" - dnf install -y rpm-devel rpmgraph - CHECK_RESULT $? 0 0 "安装软件包失败" - INSTALLED=0 - fi - LOG_INFO "步骤3:测试 rpmgraph 命令是否支持 -D 参数" - if ! rpmgraph --help 2>&1 | grep -q -- "-D"; then - LOG_ERROR "rpmgraph 命令不支持 -D 参数" - if [ $INSTALLED -eq 0 ]; then - LOG_INFO "清理环境:卸载安装的软件包" - dnf remove -y rpm-devel rpmgraph - fi - exit 255 - fi - LOG_INFO "步骤4:使用 -D 参数定义宏并执行 rpmgraph 命令" - rpmgraph -D "_topdir /tmp/test" --spec /path/to/test.spec 2>&1 - CHECK_RESULT $? 0 0 "使用 -D 参数执行 rpmgraph 失败" - LOG_INFO "步骤5:清理测试环境" - if [ $INSTALLED -eq 0 ]; then - LOG_INFO "卸载安装的软件包" - dnf remove -y rpm-devel rpmgraph - CHECK_RESULT $? 0 0 "卸载软件包失败" - else - LOG_INFO "保持软件包安装状态" - fi - LOG_INFO "测试完成" -} - -main "$@" \ No newline at end of file diff --git a/testcases/function_test/pkg_test/rpm/rpm-devel/test_rpm-devel_rpmgraph__upper_e.sh b/testcases/function_test/pkg_test/rpm/rpm-devel/test_rpm-devel_rpmgraph__upper_e.sh deleted file mode 100644 index 617d64ef655..00000000000 --- a/testcases/function_test/pkg_test/rpm/rpm-devel/test_rpm-devel_rpmgraph__upper_e.sh +++ /dev/null @@ -1,67 +0,0 @@ -#!/usr/bin/bash - -# Copyright (c) 2024 ISCAS .ALL rights reserved. -# This program is licensed under Mulan PSL v2. -# You can use it according to the terms and conditions of the Mulan PSL v2. -# http://license.coscl.org.cn/MulanPSL2 -# THIS PROGRAM IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, -# EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, -# MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. -# See the Mulan PSL v2 for more details. - -# ############################################# -# @Author : honghua -# @Contact : honghua@iscas.ac.cn -# @Date : 2026-03-11 -# @License : Mulan PSL v2 -# @Desc : 测试使用 -E 参数打印宏扩展 -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - LOG_INFO "开始测试rpmgraph命令的-E参数功能" - - # 检查yum源中是否存在rpm-devel和rpmgraph软件包 - LOG_INFO "检查yum源中是否存在rpm-devel和rpmgraph软件包" - dnf list available rpm-devel > /dev/null 2>&1 - CHECK_RESULT $? 0 255 "yum源中不存在rpm-devel软件包" - - dnf list available rpmgraph > /dev/null 2>&1 - CHECK_RESULT $? 0 255 "yum源中不存在rpmgraph软件包" - - # 判断环境是否已经安装rpm-devel和rpmgraph - LOG_INFO "判断环境是否已经安装rpm-devel和rpmgraph" - if rpm -q rpm-devel > /dev/null 2>&1 && rpm -q rpmgraph > /dev/null 2>&1; then - LOG_INFO "环境已安装rpm-devel和rpmgraph,测试结束后保持安装状态" - INSTALLED=1 - else - LOG_INFO "环境未安装rpm-devel和rpmgraph,开始安装软件包" - dnf install -y rpm-devel rpmgraph > /dev/null 2>&1 - CHECK_RESULT $? 0 0 "安装rpm-devel和rpmgraph失败" - INSTALLED=0 - fi - - # 测试rpmgraph命令的-E参数是否存在 - LOG_INFO "测试rpmgraph命令的-E参数是否存在" - rpmgraph --help 2>&1 | grep -q "\-E" - CHECK_RESULT $? 0 255 "rpmgraph命令不支持-E参数" - - # 使用rpmgraph命令的-E参数打印宏扩展 - LOG_INFO "使用rpmgraph命令的-E参数打印宏扩展" - rpmgraph -E > /dev/null 2>&1 - CHECK_RESULT $? 0 0 "使用-E参数打印宏扩展失败" - - # 清理环境:如果测试前未安装,则卸载软件包 - if [ $INSTALLED -eq 0 ]; then - LOG_INFO "清理环境:卸载测试安装的软件包" - dnf remove -y rpm-devel rpmgraph > /dev/null 2>&1 - CHECK_RESULT $? 0 0 "卸载rpm-devel和rpmgraph失败" - else - LOG_INFO "环境保持原状,不卸载软件包" - fi - - LOG_INFO "测试完成" -} - -main "$@" \ No newline at end of file diff --git a/testcases/function_test/pkg_test/rpm/rpm-devel/test_rpm-devel_rpmgraph__upper_v.sh b/testcases/function_test/pkg_test/rpm/rpm-devel/test_rpm-devel_rpmgraph__upper_v.sh deleted file mode 100644 index 3f658ec8c16..00000000000 --- a/testcases/function_test/pkg_test/rpm/rpm-devel/test_rpm-devel_rpmgraph__upper_v.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-11 -# @License : Mulan PSL v2 -# @Desc : 测试使用 -v 参数,提供更多的详细信息输出 -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - # 检查是否已安装rpm-devel和rpmgraph - LOG_INFO "检查rpm-devel和rpmgraph是否已安装" - if rpm -q rpm-devel > /dev/null 2>&1 && rpm -q rpmgraph > /dev/null 2>&1; then - LOG_INFO "rpm-devel和rpmgraph已安装,脚本结束时将保持安装状态" - already_installed=true - else - LOG_INFO "rpm-devel和rpmgraph未安装,将在测试步骤中安装" - already_installed=false - fi - - # 检查yum源中是否有rpm-devel和rpmgraph软件包 - LOG_INFO "检查yum源中是否有rpm-devel和rpmgraph软件包" - if ! dnf list available rpm-devel > /dev/null 2>&1; then - LOG_ERROR "yum源中未找到rpm-devel软件包" - exit 255 - fi - if ! dnf list available rpmgraph > /dev/null 2>&1; then - LOG_ERROR "yum源中未找到rpmgraph软件包" - exit 255 - fi - - # 如果未安装,则安装软件包 - if [ "$already_installed" = false ]; then - LOG_INFO "安装rpm-devel和rpmgraph软件包" - dnf install -y rpm-devel rpmgraph - CHECK_RESULT $? 0 0 "安装rpm-devel和rpmgraph失败" - fi - - # 检查rpmgraph命令是否支持-v参数 - LOG_INFO "检查rpmgraph命令是否支持-v参数" - if ! rpmgraph --help 2>&1 | grep -q "\-v"; then - LOG_ERROR "rpmgraph命令不支持-v参数" - exit 255 - fi - - # 测试使用-v参数执行rpmgraph命令 - LOG_INFO "测试使用-v参数执行rpmgraph命令" - rpmgraph -v - CHECK_RESULT $? 0 0 "使用-v参数执行rpmgraph命令失败" - - # 清理环境:如果脚本开始时未安装,则卸载软件包 - if [ "$already_installed" = false ]; then - LOG_INFO "卸载rpm-devel和rpmgraph软件包" - dnf remove -y rpm-devel rpmgraph - CHECK_RESULT $? 0 0 "卸载rpm-devel和rpmgraph失败" - fi - - LOG_INFO "测试完成" -} - -main "$@" \ No newline at end of file diff --git a/testcases/function_test/pkg_test/rpm/rpm-devel/test_rpm-devel_rpmgraph__upper_v_--quiet.sh b/testcases/function_test/pkg_test/rpm/rpm-devel/test_rpm-devel_rpmgraph__upper_v_--quiet.sh deleted file mode 100644 index 21162ed0e65..00000000000 --- a/testcases/function_test/pkg_test/rpm/rpm-devel/test_rpm-devel_rpmgraph__upper_v_--quiet.sh +++ /dev/null @@ -1,82 +0,0 @@ -#!/usr/bin/bash - -# Copyright (c) 2024 ISCAS .ALL rights reserved. -# This program is licensed under Mulan PSL v2. -# You can use it according to the terms and conditions of the Mulan PSL v2. -# http://license.coscl.org.cn/MulanPSL2 -# THIS PROGRAM IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, -# EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, -# MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. -# See the Mulan PSL v2 for more details. - -# ############################################# -# @Author : honghua -# @Contact : honghua@iscas.ac.cn -# @Date : 2026-03-11 -# @License : Mulan PSL v2 -# @Desc : 测试同时使用 -v 和 --quiet 参数,验证参数冲突或优先级 -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - # 检查环境是否已安装rpm-devel和rpmgraph - LOG_INFO "检查是否已安装rpm-devel和rpmgraph" - dnf list installed rpm-devel > /dev/null 2>&1 - rpm_devel_installed=$? - dnf list installed rpmgraph > /dev/null 2>&1 - rpmgraph_installed=$? - - # 检查yum源中是否存在rpm-devel和rpmgraph - LOG_INFO "检查yum源中是否存在rpm-devel和rpmgraph" - dnf list available rpm-devel > /dev/null 2>&1 - if [ $? -ne 0 ]; then - LOG_ERROR "yum源中未找到rpm-devel软件包" - exit 255 - fi - dnf list available rpmgraph > /dev/null 2>&1 - if [ $? -ne 0 ]; then - LOG_ERROR "yum源中未找到rpmgraph软件包" - exit 255 - fi - - # 如果未安装,则安装软件包 - if [ $rpm_devel_installed -ne 0 ] || [ $rpmgraph_installed -ne 0 ]; then - LOG_INFO "安装rpm-devel和rpmgraph软件包" - dnf install -y rpm-devel rpmgraph - CHECK_RESULT $? 0 0 "安装rpm-devel和rpmgraph失败" - need_cleanup=1 - else - LOG_INFO "rpm-devel和rpmgraph已安装" - need_cleanup=0 - fi - - # 测试同时使用-v和--quiet参数 - LOG_INFO "测试rpmgraph同时使用-v和--quiet参数" - rpmgraph -v --quiet > /dev/null 2>&1 - result=$? - - # 根据退出码判断参数是否冲突 - if [ $result -eq 1 ]; then - LOG_INFO "参数-v和--quiet存在冲突,命令执行失败,符合预期" - CHECK_RESULT $result 1 0 "参数冲突未正确处理" - elif [ $result -eq 0 ]; then - LOG_INFO "参数-v和--quiet可以同时使用,验证优先级" - # 这里可以进一步验证输出内容,但根据需求只检查退出码 - CHECK_RESULT $result 0 0 "命令执行失败" - else - LOG_ERROR "rpmgraph命令执行异常,退出码: $result" - CHECK_RESULT $result 0 1 "命令执行异常" - fi - - # 环境清理 - if [ $need_cleanup -eq 1 ]; then - LOG_INFO "清理测试环境,卸载安装的软件包" - dnf remove -y rpm-devel rpmgraph - CHECK_RESULT $? 0 0 "卸载rpm-devel和rpmgraph失败" - else - LOG_INFO "保持环境安装状态,无需清理" - fi -} - -main "$@" \ No newline at end of file diff --git a/testcases/function_test/pkg_test/texinfo/texinfo-tex/test_texinfo-tex_function_build_clean.sh b/testcases/function_test/pkg_test/texinfo/texinfo-tex/test_texinfo-tex_function_build_clean.sh deleted file mode 100644 index 98b3a8c40a9..00000000000 --- a/testcases/function_test/pkg_test/texinfo/texinfo-tex/test_texinfo-tex_function_build_clean.sh +++ /dev/null @@ -1,81 +0,0 @@ -#!/usr/bin/bash - -# Copyright (c) 2024 ISCAS .ALL rights reserved. -# This program is licensed under Mulan PSL v2. -# You can use it according to the terms and conditions of the Mulan PSL v2. -# http://license.coscl.org.cn/MulanPSL2 -# THIS PROGRAM IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, -# EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, -# MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. -# See the Mulan PSL v2 for more details. - -# ############################################# -# @Author : honghua -# @Contact : honghua@iscas.ac.cn -# @Date : 2026-01-28 -# @License : Mulan PSL v2 -# @Desc : Test clean build mode -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - # 判断是否已安装texinfo-tex - LOG_INFO "检查texinfo-tex是否已安装" - rpm -q texinfo-tex - if [ $? -eq 0 ]; then - LOG_INFO "texinfo-tex已安装,测试结束后将保持安装状态" - INSTALLED=1 - else - LOG_INFO "texinfo-tex未安装,将在测试过程中安装" - INSTALLED=0 - fi - - # 检查yum源中是否有texinfo-tex软件包 - LOG_INFO "检查yum源中是否存在texinfo-tex软件包" - dnf list available texinfo-tex 2>&1 | grep -E "texinfo-tex|可用软件包" - if [ $? -ne 0 ]; then - LOG_ERROR "yum源中未找到texinfo-tex软件包" - exit 255 - fi - - # 安装texinfo-tex(如果未安装) - if [ $INSTALLED -eq 0 ]; then - LOG_INFO "开始安装texinfo-tex" - dnf install -y texinfo-tex - CHECK_RESULT $? 0 0 "安装texinfo-tex失败" - LOG_INFO "texinfo-tex安装成功" - fi - - # 测试clean build模式 - LOG_INFO "开始测试clean build模式" - texindex --help 2>&1 | grep -q "clean" - if [ $? -ne 0 ]; then - LOG_ERROR "texindex命令不支持clean参数" - if [ $INSTALLED -eq 0 ]; then - dnf remove -y texinfo-tex - LOG_INFO "已卸载texinfo-tex" - fi - exit 255 - fi - - LOG_INFO "执行texindex clean命令测试" - texindex clean 2>&1 - CHECK_RESULT $? 0 0 "texindex clean命令执行失败" - - LOG_INFO "clean build模式测试成功" - - # 环境清理:如果测试前未安装,则卸载软件包 - if [ $INSTALLED -eq 0 ]; then - LOG_INFO "清理环境:卸载texinfo-tex" - dnf remove -y texinfo-tex - CHECK_RESULT $? 0 0 "卸载texinfo-tex失败" - LOG_INFO "环境清理完成" - else - LOG_INFO "测试前已安装texinfo-tex,保持安装状态" - fi - - LOG_INFO "测试脚本执行完毕" -} - -main "$@" \ No newline at end of file diff --git a/testcases/function_test/pkg_test/texinfo/texinfo-tex/test_texinfo-tex_function_build_tidy.sh b/testcases/function_test/pkg_test/texinfo/texinfo-tex/test_texinfo-tex_function_build_tidy.sh deleted file mode 100644 index f9ba3398763..00000000000 --- a/testcases/function_test/pkg_test/texinfo/texinfo-tex/test_texinfo-tex_function_build_tidy.sh +++ /dev/null @@ -1,75 +0,0 @@ -#!/usr/bin/bash - -# Copyright (c) 2024 ISCAS .ALL rights reserved. -# This program is licensed under Mulan PSL v2. -# You can use it according to the terms and conditions of the Mulan PSL v2. -# http://license.coscl.org.cn/MulanPSL2 -# THIS PROGRAM IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, -# EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, -# MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. -# See the Mulan PSL v2 for more details. - -# ############################################# -# @Author : honghua -# @Contact : honghua@iscas.ac.cn -# @Date : 2026-01-28 -# @License : Mulan PSL v2 -# @Desc : Test tidy build mode -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - # 检查是否已安装texinfo-tex - LOG_INFO "检查texinfo-tex是否已安装" - rpm -q texinfo-tex > /dev/null 2>&1 - installed=$? - - # 如果未安装,则检查yum源中是否有该软件包 - if [ $installed -ne 0 ]; then - LOG_INFO "texinfo-tex未安装,检查yum源中是否有该软件包" - dnf list available texinfo-tex > /dev/null 2>&1 - CHECK_RESULT $? 0 0 "yum源中未找到texinfo-tex软件包" - if [ $? -ne 0 ]; then - LOG_ERROR "yum源中未找到texinfo-tex软件包" - exit 255 - fi - # 安装texinfo-tex - LOG_INFO "安装texinfo-tex软件包" - dnf install -y texinfo-tex - CHECK_RESULT $? 0 0 "安装texinfo-tex失败" - else - LOG_INFO "texinfo-tex已安装" - fi - - # 测试tidy构建模式 - LOG_INFO "测试tidy构建模式" - makeinfo --tidy-build test.texi > output.log 2>&1 - CHECK_RESULT $? 0 0 "tidy构建模式失败" - - # 检查输出文件是否存在 - LOG_INFO "检查输出文件" - if [ -f test.info ]; then - LOG_INFO "输出文件test.info已生成" - else - LOG_ERROR "输出文件test.info未生成" - exit 1 - fi - - # 清理测试文件 - LOG_INFO "清理测试文件" - rm -f test.info output.log - - # 如果测试前未安装,则卸载texinfo-tex - if [ $installed -ne 0 ]; then - LOG_INFO "卸载texinfo-tex软件包" - dnf remove -y texinfo-tex - CHECK_RESULT $? 0 0 "卸载texinfo-tex失败" - else - LOG_INFO "保持texinfo-tex安装状态" - fi - - LOG_INFO "测试完成" -} - -main "$@" \ No newline at end of file diff --git a/testcases/function_test/pkg_test/texinfo/texinfo-tex/test_texinfo-tex_function_dvi_generate.sh b/testcases/function_test/pkg_test/texinfo/texinfo-tex/test_texinfo-tex_function_dvi_generate.sh deleted file mode 100644 index 6d0bed3819a..00000000000 --- a/testcases/function_test/pkg_test/texinfo/texinfo-tex/test_texinfo-tex_function_dvi_generate.sh +++ /dev/null @@ -1,83 +0,0 @@ -#!/usr/bin/bash - -# Copyright (c) 2024 ISCAS .ALL rights reserved. -# This program is licensed under Mulan PSL v2. -# You can use it according to the terms and conditions of the Mulan PSL v2. -# http://license.coscl.org.cn/MulanPSL2 -# THIS PROGRAM IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, -# EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, -# MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. -# See the Mulan PSL v2 for more details. - -# ############################################# -# @Author : honghua -# @Contact : honghua@iscas.ac.cn -# @Date : 2026-01-28 -# @License : Mulan PSL v2 -# @Desc : Test DVI generation from TeX -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - LOG_INFO "测试开始:Test DVI generation from TeX" - - # 步骤1:检查环境是否已安装texinfo-tex软件包 - LOG_INFO "检查texinfo-tex是否已安装" - if dnf list installed texinfo-tex &>/dev/null; then - LOG_INFO "texinfo-tex已安装,将保持安装状态" - INSTALLED_BEFORE=true - else - LOG_INFO "texinfo-tex未安装,将在测试过程中安装" - INSTALLED_BEFORE=false - fi - - # 步骤2:检查yum源中是否有texinfo-tex软件包 - LOG_INFO "检查yum源中是否有texinfo-tex软件包" - if ! dnf list available texinfo-tex &>/dev/null; then - LOG_ERROR "yum源中未找到texinfo-tex软件包" - exit 255 - fi - - # 步骤3:如果未安装,则安装texinfo-tex - if [ "$INSTALLED_BEFORE" = false ]; then - LOG_INFO "安装texinfo-tex软件包" - dnf install -y texinfo-tex - CHECK_RESULT $? 0 0 "安装texinfo-tex失败" - fi - - # 步骤4:测试DVI生成功能 - LOG_INFO "测试DVI生成功能" - cat > test.tex << "EOF" - \documentclass{article} - \begin{document} - Hello, World! - \end{document} - EOF - tex test.tex - CHECK_RESULT $? 0 0 "生成DVI文件失败" - - # 步骤5:验证生成的DVI文件 - LOG_INFO "验证生成的DVI文件" - if [ -f test.dvi ]; then - LOG_INFO "DVI文件生成成功" - else - LOG_ERROR "未找到生成的DVI文件" - exit 1 - fi - - # 步骤6:清理测试文件 - LOG_INFO "清理测试文件" - rm -f test.tex test.dvi test.log test.aux - - # 步骤7:如果之前未安装,则卸载texinfo-tex - if [ "$INSTALLED_BEFORE" = false ]; then - LOG_INFO "卸载texinfo-tex软件包" - dnf remove -y texinfo-tex - CHECK_RESULT $? 0 0 "卸载texinfo-tex失败" - fi - - LOG_INFO "测试结束:Test DVI generation from TeX" -} - -main "$@" \ No newline at end of file diff --git a/testcases/function_test/pkg_test/texinfo/texinfo-tex/test_texinfo-tex_function_help.sh b/testcases/function_test/pkg_test/texinfo/texinfo-tex/test_texinfo-tex_function_help.sh deleted file mode 100644 index 0fab31bcfbd..00000000000 --- a/testcases/function_test/pkg_test/texinfo/texinfo-tex/test_texinfo-tex_function_help.sh +++ /dev/null @@ -1,85 +0,0 @@ -#!/usr/bin/bash - -# Copyright (c) 2024 ISCAS .ALL rights reserved. -# This program is licensed under Mulan PSL v2. -# You can use it according to the terms and conditions of the Mulan PSL v2. -# http://license.coscl.org.cn/MulanPSL2 -# THIS PROGRAM IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, -# EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, -# MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. -# See the Mulan PSL v2 for more details. - -# ############################################# -# @Author : honghua -# @Contact : honghua@iscas.ac.cn -# @Date : 2026-01-28 -# @License : Mulan PSL v2 -# @Desc : Test help option for main commands -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - # 判断软件包是否已安装 - if dnf list installed texinfo-tex &>/dev/null; then - LOG_INFO "环境已安装texinfo-tex,脚本结束时将保持安装状态" - INSTALLED_BEFORE=1 - else - LOG_INFO "环境未安装texinfo-tex,将作为测试步骤安装并在结束前卸载" - INSTALLED_BEFORE=0 - fi - - # 检查yum源中是否存在texinfo-tex软件包 - LOG_INFO "步骤1:检查yum源中是否存在texinfo-tex软件包" - if ! dnf list available texinfo-tex &>/dev/null; then - LOG_ERROR "yum源中不存在texinfo-tex软件包" - exit 255 - fi - - # 如果未安装,则安装软件包 - if [ $INSTALLED_BEFORE -eq 0 ]; then - LOG_INFO "步骤2:安装texinfo-tex软件包" - dnf install -y texinfo-tex - CHECK_RESULT $? 0 0 "安装texinfo-tex失败" - fi - - # 测试主要命令的help选项 - LOG_INFO "步骤3:测试tex命令的help选项" - tex --help &>/dev/null - CHECK_RESULT $? 0 0 "tex命令help选项测试失败" - - LOG_INFO "步骤4:测试pdftex命令的help选项" - pdftex --help &>/dev/null - CHECK_RESULT $? 0 0 "pdftex命令help选项测试失败" - - LOG_INFO "步骤5:测试etex命令的help选项" - etex --help &>/dev/null - CHECK_RESULT $? 0 0 "etex命令help选项测试失败" - - LOG_INFO "步骤6:测试pdfetex命令的help选项" - pdfetex --help &>/dev/null - CHECK_RESULT $? 0 0 "pdfetex命令help选项测试失败" - - # 测试不支持的参数 - LOG_INFO "步骤7:测试不支持的参数(预期失败)" - tex --nonexistent-option &>/dev/null - if [ $? -eq 255 ]; then - LOG_INFO "不支持参数测试通过(返回码255)" - else - LOG_ERROR "不支持参数测试失败,返回码不是255" - exit 255 - fi - - # 环境恢复 - if [ $INSTALLED_BEFORE -eq 0 ]; then - LOG_INFO "步骤8:卸载texinfo-tex软件包,恢复环境" - dnf remove -y texinfo-tex - CHECK_RESULT $? 0 0 "卸载texinfo-tex失败" - else - LOG_INFO "步骤8:环境已安装texinfo-tex,保持安装状态" - fi - - LOG_INFO "测试完成" -} - -main "$@" \ No newline at end of file diff --git a/testcases/function_test/pkg_test/texinfo/texinfo-tex/test_texinfo-tex_function_index_sort.sh b/testcases/function_test/pkg_test/texinfo/texinfo-tex/test_texinfo-tex_function_index_sort.sh deleted file mode 100644 index eb8f6539f99..00000000000 --- a/testcases/function_test/pkg_test/texinfo/texinfo-tex/test_texinfo-tex_function_index_sort.sh +++ /dev/null @@ -1,99 +0,0 @@ -#!/usr/bin/bash - -# Copyright (c) 2024 ISCAS .ALL rights reserved. -# This program is licensed under Mulan PSL v2. -# You can use it according to the terms and conditions of the Mulan PSL v2. -# http://license.coscl.org.cn/MulanPSL2 -# THIS PROGRAM IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, -# EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, -# MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. -# See the Mulan PSL v2 for more details. - -# ############################################# -# @Author : honghua -# @Contact : honghua@iscas.ac.cn -# @Date : 2026-01-28 -# @License : Mulan PSL v2 -# @Desc : Test sorting index files with texindex -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - LOG_INFO "开始测试:Test sorting index files with texindex" - - # 检查texinfo-tex软件包是否在yum源中 - LOG_INFO "步骤1:检查texinfo-tex软件包是否在yum源中" - if ! dnf list available texinfo-tex &>/dev/null; then - LOG_ERROR "texinfo-tex软件包不在yum源中" - exit 255 - fi - - # 检查当前是否已安装texinfo-tex - LOG_INFO "步骤2:检查当前是否已安装texinfo-tex" - if rpm -q texinfo-tex &>/dev/null; then - LOG_INFO "texinfo-tex已安装,测试完成后将保持安装状态" - INSTALLED=true - else - LOG_INFO "texinfo-tex未安装,将在测试前安装" - INSTALLED=false - fi - - # 如果未安装,则安装texinfo-tex - if [ "$INSTALLED" = false ]; then - LOG_INFO "步骤3:安装texinfo-tex软件包" - dnf install -y texinfo-tex - CHECK_RESULT $? 0 0 "安装texinfo-tex失败" - fi - - # 检查texindex命令是否存在 - LOG_INFO "步骤4:检查texindex命令是否存在" - if ! command -v texindex &>/dev/null; then - LOG_ERROR "texindex命令不存在" - exit 255 - fi - - # 检查texindex命令是否支持排序索引文件 - LOG_INFO "步骤5:检查texindex命令是否支持排序索引文件" - if ! texindex --help 2>&1 | grep -q "sort"; then - LOG_ERROR "texindex命令不支持排序索引文件" - exit 255 - fi - - # 创建测试用的索引文件 - LOG_INFO "步骤6:创建测试用的索引文件" - cat > test_index.aux << "EOF" - \indexentry{apple}{1} - \indexentry{banana}{2} - \indexentry{cherry}{3} - EOF - - # 使用texindex排序索引文件 - LOG_INFO "步骤7:使用texindex排序索引文件" - texindex test_index.aux - CHECK_RESULT $? 0 0 "texindex排序索引文件失败" - - # 验证排序后的索引文件 - LOG_INFO "步骤8:验证排序后的索引文件" - if [ -f test_index.ind ]; then - LOG_INFO "排序后的索引文件已生成" - else - LOG_ERROR "排序后的索引文件未生成" - exit 1 - fi - - # 清理测试文件 - LOG_INFO "步骤9:清理测试文件" - rm -f test_index.aux test_index.ind - - # 如果测试前未安装,则在测试后卸载texinfo-tex - if [ "$INSTALLED" = false ]; then - LOG_INFO "步骤10:卸载texinfo-tex软件包" - dnf remove -y texinfo-tex - CHECK_RESULT $? 0 0 "卸载texinfo-tex失败" - fi - - LOG_INFO "测试完成:Test sorting index files with texindex" -} - -main "$@" \ No newline at end of file diff --git a/testcases/function_test/pkg_test/texinfo/texinfo-tex/test_texinfo-tex_function_macro_expand.sh b/testcases/function_test/pkg_test/texinfo/texinfo-tex/test_texinfo-tex_function_macro_expand.sh deleted file mode 100644 index 400fc39b976..00000000000 --- a/testcases/function_test/pkg_test/texinfo/texinfo-tex/test_texinfo-tex_function_macro_expand.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-01-28 -# @License : Mulan PSL v2 -# @Desc : Test macro expansion with makeinfo -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - LOG_INFO "开始测试:Test macro expansion with makeinfo" - LOG_INFO "检查环境中是否已安装texinfo-tex软件包" - if dnf list installed texinfo-tex &>/dev/null; then - LOG_INFO "texinfo-tex软件包已安装,测试将保持安装状态" - already_installed=true - else - LOG_INFO "texinfo-tex软件包未安装,将在测试步骤中安装" - already_installed=false - fi - - LOG_INFO "检查yum源中是否存在texinfo-tex软件包" - if ! dnf list available texinfo-tex &>/dev/null; then - LOG_ERROR "yum源中未找到texinfo-tex软件包" - exit 255 - fi - - if [ "$already_installed" = false ]; then - LOG_INFO "安装texinfo-tex软件包" - dnf install -y texinfo-tex - CHECK_RESULT $? 0 0 "安装texinfo-tex软件包失败" - fi - - LOG_INFO "创建一个测试用的texinfo源文件" - cat > test_macro.texinfo << "EOF" - \input texinfo - @setfilename test_macro.info - @settitle Test Macro Expansion - - @ifnottex - @node Top - @top Test Macro Expansion - @end ifnottex - - @macro testmacro{arg} - This is a macro with argument: \arg\. - @end macro - - @testmacro{Hello World} - - @bye - EOF - CHECK_RESULT $? 0 0 "创建texinfo源文件失败" - - LOG_INFO "使用makeinfo命令处理texinfo源文件,测试宏展开功能" - makeinfo test_macro.texinfo - CHECK_RESULT $? 0 0 "makeinfo命令执行失败,宏展开功能可能存在问题" - - LOG_INFO "检查生成的info文件是否包含预期的宏展开内容" - if grep -q "This is a macro with argument: Hello World." test_macro.info; then - LOG_INFO "宏展开成功,info文件中包含预期内容" - else - LOG_ERROR "宏展开失败,info文件中未找到预期内容" - CHECK_RESULT 1 0 0 "宏展开结果验证失败" - fi - - LOG_INFO "清理测试生成的临时文件" - rm -f test_macro.texinfo test_macro.info - CHECK_RESULT $? 0 0 "删除测试文件失败" - - if [ "$already_installed" = false ]; then - LOG_INFO "卸载texinfo-tex软件包,恢复环境" - dnf remove -y texinfo-tex - CHECK_RESULT $? 0 0 "卸载texinfo-tex软件包失败" - fi - - LOG_INFO "测试完成:Test macro expansion with makeinfo" -} - -main "$@" \ No newline at end of file diff --git a/testcases/function_test/pkg_test/texinfo/texinfo-tex/test_texinfo-tex_function_output_redirect.sh b/testcases/function_test/pkg_test/texinfo/texinfo-tex/test_texinfo-tex_function_output_redirect.sh deleted file mode 100644 index a4379b094a6..00000000000 --- a/testcases/function_test/pkg_test/texinfo/texinfo-tex/test_texinfo-tex_function_output_redirect.sh +++ /dev/null @@ -1,99 +0,0 @@ -#!/usr/bin/bash - -# Copyright (c) 2024 ISCAS .ALL rights reserved. -# This program is licensed under Mulan PSL v2. -# You can use it according to the terms and conditions of the Mulan PSL v2. -# http://license.coscl.org.cn/MulanPSL2 -# THIS PROGRAM IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, -# EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, -# MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. -# See the Mulan PSL v2 for more details. - -# ############################################# -# @Author : honghua -# @Contact : honghua@iscas.ac.cn -# @Date : 2026-01-28 -# @License : Mulan PSL v2 -# @Desc : Test output file redirection -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - LOG_INFO "开始测试:Test output file redirection" - - # 定义软件包名称 - PACKAGE_NAME="texinfo-tex" - OUTPUT_FILE="test_output.txt" - EXPECTED_CONTENT="This is a test" - - # 检查软件包是否已在yum源中 - LOG_INFO "步骤1:检查yum源中是否存在软件包 $PACKAGE_NAME" - if ! dnf list available "$PACKAGE_NAME" &>/dev/null; then - LOG_ERROR "软件包 $PACKAGE_NAME 不在yum源中" - exit 255 - fi - - # 检查当前是否已安装软件包 - LOG_INFO "步骤2:检查 $PACKAGE_NAME 是否已安装" - if rpm -q "$PACKAGE_NAME" &>/dev/null; then - LOG_INFO "$PACKAGE_NAME 已安装,测试结束后保持安装状态" - INSTALLED_BEFORE=true - else - LOG_INFO "$PACKAGE_NAME 未安装,将在测试前安装" - INSTALLED_BEFORE=false - fi - - # 如果未安装,则安装软件包 - if [ "$INSTALLED_BEFORE" = false ]; then - LOG_INFO "步骤3:安装 $PACKAGE_NAME" - dnf install -y "$PACKAGE_NAME" - CHECK_RESULT $? 0 0 "安装 $PACKAGE_NAME 失败" - fi - - # 检查命令参数是否存在或不支持 - LOG_INFO "步骤4:检查命令参数是否存在或不支持" - if ! tex --help | grep -q "output"; then - LOG_ERROR "命令参数不存在或不支持" - exit 255 - fi - - # 执行测试命令,将输出重定向到文件 - LOG_INFO "步骤5:执行命令并将输出重定向到文件 $OUTPUT_FILE" - echo "$EXPECTED_CONTENT" | tex --output="$OUTPUT_FILE" 2>/dev/null - CHECK_RESULT $? 0 0 "执行命令失败" - - # 检查输出文件是否存在 - LOG_INFO "步骤6:检查输出文件 $OUTPUT_FILE 是否存在" - if [ -f "$OUTPUT_FILE" ]; then - LOG_INFO "输出文件 $OUTPUT_FILE 存在" - else - LOG_ERROR "输出文件 $OUTPUT_FILE 不存在" - exit 1 - fi - - # 检查输出文件内容是否符合预期 - LOG_INFO "步骤7:检查输出文件内容是否符合预期" - if grep -q "$EXPECTED_CONTENT" "$OUTPUT_FILE"; then - LOG_INFO "输出文件内容符合预期" - else - LOG_ERROR "输出文件内容不符合预期" - exit 1 - fi - - # 清理测试文件 - LOG_INFO "步骤8:清理测试文件" - rm -f "$OUTPUT_FILE" - CHECK_RESULT $? 0 0 "清理测试文件失败" - - # 如果测试前未安装软件包,则卸载 - if [ "$INSTALLED_BEFORE" = false ]; then - LOG_INFO "步骤9:卸载 $PACKAGE_NAME" - dnf remove -y "$PACKAGE_NAME" - CHECK_RESULT $? 0 0 "卸载 $PACKAGE_NAME 失败" - fi - - LOG_INFO "测试完成:Test output file redirection" -} - -main "$@" \ No newline at end of file diff --git a/testcases/function_test/pkg_test/texinfo/texinfo-tex/test_texinfo-tex_function_pdf_generate.sh b/testcases/function_test/pkg_test/texinfo/texinfo-tex/test_texinfo-tex_function_pdf_generate.sh deleted file mode 100644 index e3bcdc13130..00000000000 --- a/testcases/function_test/pkg_test/texinfo/texinfo-tex/test_texinfo-tex_function_pdf_generate.sh +++ /dev/null @@ -1,85 +0,0 @@ -#!/usr/bin/bash - -# Copyright (c) 2024 ISCAS .ALL rights reserved. -# This program is licensed under Mulan PSL v2. -# You can use it according to the terms and conditions of the Mulan PSL v2. -# http://license.coscl.org.cn/MulanPSL2 -# THIS PROGRAM IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, -# EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, -# MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. -# See the Mulan PSL v2 for more details. - -# ############################################# -# @Author : honghua -# @Contact : honghua@iscas.ac.cn -# @Date : 2026-01-28 -# @License : Mulan PSL v2 -# @Desc : Test PDF generation from TeX -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - LOG_INFO "开始测试:Test PDF generation from TeX" - LOG_INFO "步骤1:检查环境是否已经安装texinfo-tex软件包" - if rpm -q texinfo-tex &> /dev/null; then - LOG_INFO "texinfo-tex已经安装,脚本结束时将保持安装状态" - INSTALLED_BEFORE=1 - else - LOG_INFO "texinfo-tex未安装,将在测试过程中安装" - INSTALLED_BEFORE=0 - fi - - LOG_INFO "步骤2:检查yum源中是否有texinfo-tex软件包" - if ! dnf list available texinfo-tex &> /dev/null; then - LOG_ERROR "yum源中未找到texinfo-tex软件包" - exit 255 - fi - - if [ $INSTALLED_BEFORE -eq 0 ]; then - LOG_INFO "步骤3:安装texinfo-tex软件包" - dnf install -y texinfo-tex - CHECK_RESULT $? 0 0 "安装texinfo-tex失败" - fi - - LOG_INFO "步骤4:创建一个简单的TeX文件用于测试" - cat > test.tex << "EOF" - \documentclass{article} - \begin{document} - Hello, TeX! - \end{document} - EOF - CHECK_RESULT $? 0 0 "创建测试TeX文件失败" - - LOG_INFO "步骤5:使用tex命令将TeX文件转换为DVI格式" - tex test.tex - CHECK_RESULT $? 0 0 "tex命令执行失败" - - LOG_INFO "步骤6:使用dvipdf命令将DVI文件转换为PDF格式" - dvipdf test.dvi - CHECK_RESULT $? 0 0 "dvipdf命令执行失败" - - LOG_INFO "步骤7:检查生成的PDF文件是否存在" - if [ -f test.pdf ]; then - LOG_INFO "PDF文件生成成功" - else - LOG_ERROR "PDF文件未生成" - exit 1 - fi - - LOG_INFO "步骤8:清理测试过程中生成的文件" - rm -f test.tex test.log test.aux test.dvi test.pdf - CHECK_RESULT $? 0 0 "清理测试文件失败" - - if [ $INSTALLED_BEFORE -eq 0 ]; then - LOG_INFO "步骤9:卸载测试过程中安装的texinfo-tex软件包" - dnf remove -y texinfo-tex - CHECK_RESULT $? 0 0 "卸载texinfo-tex失败" - else - LOG_INFO "步骤9:环境已安装texinfo-tex,保持安装状态" - fi - - LOG_INFO "测试完成:Test PDF generation from TeX" -} - -main "$@" \ No newline at end of file diff --git a/testcases/function_test/pkg_test/texinfo/texinfo-tex/test_texinfo-tex_function_version.sh b/testcases/function_test/pkg_test/texinfo/texinfo-tex/test_texinfo-tex_function_version.sh deleted file mode 100644 index 47bc4396f20..00000000000 --- a/testcases/function_test/pkg_test/texinfo/texinfo-tex/test_texinfo-tex_function_version.sh +++ /dev/null @@ -1,81 +0,0 @@ -#!/usr/bin/bash - -# Copyright (c) 2024 ISCAS .ALL rights reserved. -# This program is licensed under Mulan PSL v2. -# You can use it according to the terms and conditions of the Mulan PSL v2. -# http://license.coscl.org.cn/MulanPSL2 -# THIS PROGRAM IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, -# EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, -# MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. -# See the Mulan PSL v2 for more details. - -# ############################################# -# @Author : honghua -# @Contact : honghua@iscas.ac.cn -# @Date : 2026-01-28 -# @License : Mulan PSL v2 -# @Desc : Test version option for main commands -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - LOG_INFO "开始测试texinfo-tex版本选项功能" - - # 检查软件包是否在yum源中 - LOG_INFO "检查texinfo-tex软件包是否在yum源中" - dnf list available texinfo-tex 2>/dev/null | grep -q texinfo-tex - if [ $? -ne 0 ]; then - LOG_ERROR "yum源中未找到texinfo-tex软件包" - exit 255 - fi - - # 检查是否已安装 - LOG_INFO "检查texinfo-tex是否已安装" - rpm -q texinfo-tex >/dev/null 2>&1 - INSTALLED=$? - - if [ $INSTALLED -ne 0 ]; then - LOG_INFO "未安装texinfo-tex,开始安装" - dnf install -y texinfo-tex - CHECK_RESULT $? 0 0 "安装texinfo-tex失败" - NEED_CLEANUP=1 - else - LOG_INFO "texinfo-tex已安装" - NEED_CLEANUP=0 - fi - - # 测试version选项 - LOG_INFO "测试texindex --version命令" - texindex --version >/dev/null 2>&1 - CHECK_RESULT $? 0 0 "texindex --version命令执行失败" - - LOG_INFO "测试texi2dvi --version命令" - texi2dvi --version >/dev/null 2>&1 - CHECK_RESULT $? 0 0 "texi2dvi --version命令执行失败" - - LOG_INFO "测试texi2pdf --version命令" - texi2pdf --version >/dev/null 2>&1 - CHECK_RESULT $? 0 0 "texi2pdf --version命令执行失败" - - # 测试不支持的参数 - LOG_INFO "测试不支持的参数" - texindex --invalid-option 2>/dev/null - if [ $? -ne 255 ] && [ $? -ne 1 ]; then - LOG_ERROR "不支持的参数未正确退出" - exit 255 - fi - - # 环境清理 - if [ $NEED_CLEANUP -eq 1 ]; then - LOG_INFO "清理测试环境,卸载texinfo-tex" - dnf remove -y texinfo-tex - CHECK_RESULT $? 0 0 "卸载texinfo-tex失败" - else - LOG_INFO "保持texinfo-tex安装状态" - fi - - LOG_INFO "测试完成" -} - -main "$@" \ No newline at end of file diff --git a/testcases/function_test/pkg_test/texinfo/texinfo-tex/test_texinfo-tex_pdftexi2dvi_build_dir.sh b/testcases/function_test/pkg_test/texinfo/texinfo-tex/test_texinfo-tex_pdftexi2dvi_build_dir.sh deleted file mode 100644 index 00697241696..00000000000 --- a/testcases/function_test/pkg_test/texinfo/texinfo-tex/test_texinfo-tex_pdftexi2dvi_build_dir.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-01-28 -# @License : Mulan PSL v2 -# @Desc : 测试 pdftexi2dvi 的 --build-dir 选项,用于指定编译目录(隐含 --tidy) -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - # 检查是否已安装texinfo-tex软件包 - LOG_INFO "检查texinfo-tex软件包是否已安装" - rpm -q texinfo-tex - if [ $? -eq 0 ]; then - LOG_INFO "texinfo-tex软件包已安装,脚本结束时将保持安装状态" - INSTALLED=1 - else - LOG_INFO "texinfo-tex软件包未安装,将在测试过程中安装" - INSTALLED=0 - fi - - # 检查yum源中是否有texinfo-tex软件包 - LOG_INFO "检查yum源中是否有texinfo-tex软件包" - dnf list available texinfo-tex 2>/dev/null | grep -q texinfo-tex - CHECK_RESULT $? 0 0 "yum源中没有texinfo-tex软件包" - if [ $? -ne 0 ]; then - LOG_ERROR "yum源中没有texinfo-tex软件包" - exit 255 - fi - - # 如果未安装,则安装软件包 - if [ $INSTALLED -eq 0 ]; then - LOG_INFO "安装texinfo-tex软件包" - dnf install -y texinfo-tex - CHECK_RESULT $? 0 0 "安装texinfo-tex软件包失败" - fi - - # 检查pdftexi2dvi命令是否存在 - LOG_INFO "检查pdftexi2dvi命令是否存在" - which pdftexi2dvi - CHECK_RESULT $? 0 0 "pdftexi2dvi命令不存在" - - # 检查pdftexi2dvi是否支持--build-dir参数 - LOG_INFO "检查pdftexi2dvi是否支持--build-dir参数" - pdftexi2dvi --help | grep -q -- "--build-dir" - CHECK_RESULT $? 0 0 "pdftexi2dvi不支持--build-dir参数" - if [ $? -ne 0 ]; then - LOG_ERROR "pdftexi2dvi不支持--build-dir参数" - exit 255 - fi - - # 创建一个测试用的texinfo文件 - LOG_INFO "创建测试用的texinfo文件" - cat > test.texinfo << EOF - \input texinfo - @setfilename test.info - @settitle Test Document - @node Top - @top Test Document - This is a test document. - @end texinfo - EOF - CHECK_RESULT $? 0 0 "创建texinfo文件失败" - - # 创建一个编译目录 - LOG_INFO "创建编译目录build_dir" - mkdir -p build_dir - CHECK_RESULT $? 0 0 "创建编译目录失败" - - # 测试pdftexi2dvi的--build-dir选项 - LOG_INFO "测试pdftexi2dvi的--build-dir选项,指定编译目录为build_dir" - pdftexi2dvi --build-dir=build_dir test.texinfo - CHECK_RESULT $? 0 0 "pdftexi2dvi执行失败" - - # 检查是否在指定的编译目录中生成了文件 - LOG_INFO "检查编译目录中是否生成了文件" - ls build_dir/*.pdf 2>/dev/null - CHECK_RESULT $? 0 0 "在指定的编译目录中未生成PDF文件" - - # 清理测试文件 - LOG_INFO "清理测试文件" - rm -f test.texinfo - rm -rf build_dir - CHECK_RESULT $? 0 0 "清理测试文件失败" - - # 如果之前未安装,则卸载软件包 - if [ $INSTALLED -eq 0 ]; then - LOG_INFO "卸载texinfo-tex软件包" - dnf remove -y texinfo-tex - CHECK_RESULT $? 0 0 "卸载texinfo-tex软件包失败" - fi - - LOG_INFO "测试完成" -} - -main "$@" \ No newline at end of file diff --git a/testcases/function_test/pkg_test/texinfo/texinfo-tex/test_texinfo-tex_pdftexi2dvi_c.sh b/testcases/function_test/pkg_test/texinfo/texinfo-tex/test_texinfo-tex_pdftexi2dvi_c.sh deleted file mode 100644 index c8baa789e5d..00000000000 --- a/testcases/function_test/pkg_test/texinfo/texinfo-tex/test_texinfo-tex_pdftexi2dvi_c.sh +++ /dev/null @@ -1,183 +0,0 @@ -#!/usr/bin/bash - -# Copyright (c) 2024 ISCAS .ALL rights reserved. -# This program is licensed under Mulan PSL v2. -# You can use it according to the terms and conditions of the Mulan PSL v2. -# http://license.coscl.org.cn/MulanPSL2 -# THIS PROGRAM IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, -# EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, -# MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. -# See the Mulan PSL v2 for more details. - -# ############################################# -# @Author : honghua -# @Contact : honghua@iscas.ac.cn -# @Date : 2026-01-28 -# @License : Mulan PSL v2 -# @Desc : 测试 pdftexi2dvi 的 --clean 选项,用于在独立目录中进行编译并清理辅助文件 -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - # 定义日志函数 - LOG_INFO() { - echo "[INFO] $1" - } - - LOG_ERROR() { - echo "[ERROR] $1" - } - - # 检查软件包是否在yum源中 - check_package_in_repo() { - local package_name=$1 - LOG_INFO "检查yum源中是否存在软件包: $package_name" - dnf list available "$package_name" &>/dev/null - if [ $? -ne 0 ]; then - LOG_ERROR "yum源中不存在软件包: $package_name" - exit 255 - fi - LOG_INFO "软件包 $package_name 存在于yum源中" - } - - # 检查命令参数是否支持 - check_command_option() { - local command=$1 - local option=$2 - LOG_INFO "检查命令 $command 是否支持参数 $option" - $command --help 2>&1 | grep -q "$option" - if [ $? -ne 0 ]; then - LOG_ERROR "命令 $command 不支持参数 $option" - exit 255 - fi - LOG_INFO "命令 $command 支持参数 $option" - } - - # 检查软件包是否已安装 - check_package_installed() { - local package_name=$1 - rpm -q "$package_name" &>/dev/null - if [ $? -eq 0 ]; then - LOG_INFO "软件包 $package_name 已安装" - return 0 - else - LOG_INFO "软件包 $package_name 未安装" - return 1 - fi - } - - # 安装软件包 - install_package() { - local package_name=$1 - LOG_INFO "安装软件包: $package_name" - dnf install -y "$package_name" &>/dev/null - CHECK_RESULT $? 0 0 "安装软件包 $package_name 失败" - LOG_INFO "软件包 $package_name 安装成功" - } - - # 卸载软件包 - uninstall_package() { - local package_name=$1 - LOG_INFO "卸载软件包: $package_name" - dnf remove -y "$package_name" &>/dev/null - CHECK_RESULT $? 0 0 "卸载软件包 $package_name 失败" - LOG_INFO "软件包 $package_name 卸载成功" - } - - # 主测试函数 - test_pdftexi2dvi_clean_option() { - local package_name="texinfo-tex" - local test_file="test.tex" - local test_dir="test_clean_dir" - local installed_before_test=false - - LOG_INFO "=== 开始测试 pdftexi2dvi 的 --clean 选项 ===" - - # 步骤1: 检查软件包是否已安装 - LOG_INFO "步骤1: 检查软件包是否已安装" - if check_package_installed "$package_name"; then - installed_before_test=true - LOG_INFO "软件包 $package_name 在测试前已安装" - else - installed_before_test=false - LOG_INFO "软件包 $package_name 在测试前未安装" - fi - - # 步骤2: 检查yum源中是否存在软件包 - LOG_INFO "步骤2: 检查yum源中是否存在软件包 $package_name" - check_package_in_repo "$package_name" - - # 步骤3: 如果未安装,则安装软件包 - if [ "$installed_before_test" = false ]; then - LOG_INFO "步骤3: 安装软件包 $package_name" - install_package "$package_name" - else - LOG_INFO "步骤3: 软件包已安装,跳过安装步骤" - fi - - # 步骤4: 检查 pdftexi2dvi 命令是否支持 --clean 选项 - LOG_INFO "步骤4: 检查 pdftexi2dvi 命令是否支持 --clean 选项" - check_command_option "pdftexi2dvi" "--clean" - - # 步骤5: 创建测试目录和测试文件 - LOG_INFO "步骤5: 创建测试目录和测试文件" - mkdir -p "$test_dir" - CHECK_RESULT $? 0 0 "创建测试目录失败" - cd "$test_dir" || exit 1 - - cat > "$test_file" << "EOF" - \documentclass{article} - \begin{document} - Hello, World! - \end{document} - EOF - CHECK_RESULT $? 0 0 "创建测试文件失败" - - # 步骤6: 使用 --clean 选项运行 pdftexi2dvi - LOG_INFO "步骤6: 使用 --clean 选项运行 pdftexi2dvi" - pdftexi2dvi --clean "$test_file" 2>&1 - CHECK_RESULT $? 0 0 "pdftexi2dvi --clean 执行失败" - - # 步骤7: 检查是否生成了PDF文件 - LOG_INFO "步骤7: 检查是否生成了PDF文件" - if [ -f "${test_file%.tex}.pdf" ]; then - LOG_INFO "成功生成PDF文件" - else - LOG_ERROR "未生成PDF文件" - exit 1 - fi - - # 步骤8: 检查辅助文件是否被清理 - LOG_INFO "步骤8: 检查辅助文件是否被清理" - local aux_files=$(ls *.aux *.log *.toc 2>/dev/null | wc -l) - if [ "$aux_files" -eq 0 ]; then - LOG_INFO "辅助文件已被清理" - else - LOG_ERROR "辅助文件未被清理" - exit 1 - fi - - # 步骤9: 清理测试目录 - LOG_INFO "步骤9: 清理测试目录" - cd .. - rm -rf "$test_dir" - CHECK_RESULT $? 0 0 "清理测试目录失败" - - # 步骤10: 恢复环境 - LOG_INFO "步骤10: 恢复环境" - if [ "$installed_before_test" = false ]; then - LOG_INFO "卸载测试安装的软件包" - uninstall_package "$package_name" - else - LOG_INFO "保持软件包安装状态" - fi - - LOG_INFO "=== 测试完成 ===" - } - - # 执行测试 - test_pdftexi2dvi_clean_option -} - -main "$@" \ No newline at end of file diff --git a/testcases/function_test/pkg_test/texinfo/texinfo-tex/test_texinfo-tex_pdftexi2dvi_command.sh b/testcases/function_test/pkg_test/texinfo/texinfo-tex/test_texinfo-tex_pdftexi2dvi_command.sh deleted file mode 100644 index 0aa3a0bf49a..00000000000 --- a/testcases/function_test/pkg_test/texinfo/texinfo-tex/test_texinfo-tex_pdftexi2dvi_command.sh +++ /dev/null @@ -1,96 +0,0 @@ -#!/usr/bin/bash - -# Copyright (c) 2024 ISCAS .ALL rights reserved. -# This program is licensed under Mulan PSL v2. -# You can use it according to the terms and conditions of the Mulan PSL v2. -# http://license.coscl.org.cn/MulanPSL2 -# THIS PROGRAM IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, -# EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, -# MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. -# See the Mulan PSL v2 for more details. - -# ############################################# -# @Author : honghua -# @Contact : honghua@iscas.ac.cn -# @Date : 2026-01-28 -# @License : Mulan PSL v2 -# @Desc : 测试 pdftexi2dvi 的 --command 选项,用于在输入文件中插入额外命令 -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - LOG_INFO "开始测试 pdftexi2dvi 的 --command 选项功能" - LOG_INFO "步骤1:检查是否已安装 texinfo-tex 软件包" - rpm -q texinfo-tex > /dev/null 2>&1 - if [ $? -eq 0 ]; then - LOG_INFO "texinfo-tex 软件包已安装,测试结束后将保持安装状态" - installed_before_test=true - else - LOG_INFO "texinfo-tex 软件包未安装,将在测试前安装并在测试后卸载" - installed_before_test=false - fi - - LOG_INFO "步骤2:检查 yum 源中是否存在 texinfo-tex 软件包" - dnf list available texinfo-tex > /dev/null 2>&1 - CHECK_RESULT $? 0 0 "yum 源中未找到 texinfo-tex 软件包" - if [ $? -ne 0 ]; then - LOG_ERROR "yum 源中不存在 texinfo-tex 软件包,退出测试" - exit 255 - fi - - if [ "$installed_before_test" = "false" ]; then - LOG_INFO "步骤3:安装 texinfo-tex 软件包" - dnf install -y texinfo-tex - CHECK_RESULT $? 0 0 "安装 texinfo-tex 软件包失败" - fi - - LOG_INFO "步骤4:检查 pdftexi2dvi 命令是否支持 --command 参数" - pdftexi2dvi --help 2>&1 | grep -q "\-\-command" - CHECK_RESULT $? 0 0 "pdftexi2dvi 命令不支持 --command 参数" - if [ $? -ne 0 ]; then - LOG_ERROR "pdftexi2dvi 命令不支持 --command 参数,退出测试" - exit 255 - fi - - LOG_INFO "步骤5:创建测试用的 texinfo 文件" - cat > test_input.texinfo << "EOF" - \input texinfo - @setfilename testfile - @settitle Test Document - @node Top - @top Test - This is a test document. - @end texinfo - EOF - CHECK_RESULT $? 0 0 "创建测试 texinfo 文件失败" - - LOG_INFO "步骤6:使用 pdftexi2dvi 的 --command 选项插入额外命令" - pdftexi2dvi --command="\\newcommand{\\testcmd}{Test Command Inserted}" test_input.texinfo - CHECK_RESULT $? 0 0 "pdftexi2dvi 执行失败,--command 选项可能未正确插入命令" - - LOG_INFO "步骤7:验证生成的 PDF 文件是否包含插入的命令" - if [ -f test_input.pdf ]; then - LOG_INFO "PDF 文件生成成功,检查插入的命令效果" - # 这里可以添加具体的检查逻辑,例如检查PDF内容或日志 - # 由于直接检查PDF内容较复杂,此处仅示例检查PDF文件存在 - CHECK_RESULT $? 0 0 "PDF 文件生成失败" - else - LOG_ERROR "未生成 PDF 文件" - exit 1 - fi - - LOG_INFO "步骤8:清理测试生成的文件" - rm -f test_input.texinfo test_input.pdf test_input.aux test_input.log test_input.toc - CHECK_RESULT $? 0 0 "清理测试文件失败" - - if [ "$installed_before_test" = "false" ]; then - LOG_INFO "步骤9:卸载测试安装的 texinfo-tex 软件包" - dnf remove -y texinfo-tex - CHECK_RESULT $? 0 0 "卸载 texinfo-tex 软件包失败" - fi - - LOG_INFO "测试完成,环境已恢复" -} - -main "$@" \ No newline at end of file diff --git a/testcases/function_test/pkg_test/texinfo/texinfo-tex/test_texinfo-tex_pdftexi2dvi_default.sh b/testcases/function_test/pkg_test/texinfo/texinfo-tex/test_texinfo-tex_pdftexi2dvi_default.sh deleted file mode 100644 index c4c59ec3994..00000000000 --- a/testcases/function_test/pkg_test/texinfo/texinfo-tex/test_texinfo-tex_pdftexi2dvi_default.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-01-28 -# @License : Mulan PSL v2 -# @Desc : 测试 pdftexi2dvi 无额外参数运行一个文件,期望生成 PDF -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - # 判断是否已经安装 texinfo-tex 软件包 - LOG_INFO "检查 texinfo-tex 软件包是否已安装" - rpm -q texinfo-tex > /dev/null 2>&1 - if [ $? -eq 0 ]; then - LOG_INFO "texinfo-tex 软件包已安装,测试结束后将保持安装状态" - installed_before_test=true - else - LOG_INFO "texinfo-tex 软件包未安装,将在测试前安装" - installed_before_test=false - fi - - # 检查 yum 源中是否有 texinfo-tex 软件包 - LOG_INFO "检查 yum 源中是否有 texinfo-tex 软件包" - dnf list available texinfo-tex > /dev/null 2>&1 - CHECK_RESULT $? 0 0 "yum 源中没有 texinfo-tex 软件包" - if [ $? -ne 0 ]; then - LOG_ERROR "yum 源中没有 texinfo-tex 软件包,退出测试" - exit 255 - fi - - # 如果未安装,则安装 texinfo-tex 软件包 - if [ "$installed_before_test" = false ]; then - LOG_INFO "安装 texinfo-tex 软件包" - dnf install -y texinfo-tex - CHECK_RESULT $? 0 0 "安装 texinfo-tex 软件包失败" - fi - - # 创建一个简单的 texinfo 文件用于测试 - LOG_INFO "创建测试用的 texinfo 文件" - cat > test.texinfo << "EOF" - \input texinfo - @setfilename test.info - @settitle Test Document - @node Top - @top Test Document - This is a test document. - @bye - EOF - CHECK_RESULT $? 0 0 "创建 texinfo 文件失败" - - # 测试 pdftexi2dvi 无额外参数运行一个文件,期望生成 PDF - LOG_INFO "测试 pdftexi2dvi 无额外参数运行 test.texinfo 文件" - pdftexi2dvi test.texinfo - CHECK_RESULT $? 0 0 "pdftexi2dvi 命令执行失败" - - # 检查是否生成了 PDF 文件 - LOG_INFO "检查是否生成了 PDF 文件" - if [ -f test.pdf ]; then - LOG_INFO "成功生成 PDF 文件: test.pdf" - else - LOG_ERROR "未生成 PDF 文件" - CHECK_RESULT 1 0 0 "未生成 PDF 文件" - fi - - # 清理测试过程中生成的文件 - LOG_INFO "清理测试过程中生成的文件" - rm -f test.texinfo test.pdf test.aux test.cp test.cps test.fn test.fns test.ky test.log test.pg test.toc test.tp test.vr test.vrs - - # 如果测试前未安装 texinfo-tex,则在测试结束后卸载 - if [ "$installed_before_test" = false ]; then - LOG_INFO "卸载 texinfo-tex 软件包" - dnf remove -y texinfo-tex - CHECK_RESULT $? 0 0 "卸载 texinfo-tex 软件包失败" - else - LOG_INFO "测试前已安装 texinfo-tex,保持安装状态" - fi - - LOG_INFO "测试完成" -} - -main "$@" \ No newline at end of file diff --git a/testcases/function_test/pkg_test/texinfo/texinfo-tex/test_texinfo-tex_pdftexi2dvi_dvi.sh b/testcases/function_test/pkg_test/texinfo/texinfo-tex/test_texinfo-tex_pdftexi2dvi_dvi.sh deleted file mode 100644 index 487d28d76a2..00000000000 --- a/testcases/function_test/pkg_test/texinfo/texinfo-tex/test_texinfo-tex_pdftexi2dvi_dvi.sh +++ /dev/null @@ -1,96 +0,0 @@ -#!/usr/bin/bash - -# Copyright (c) 2024 ISCAS .ALL rights reserved. -# This program is licensed under Mulan PSL v2. -# You can use it according to the terms and conditions of the Mulan PSL v2. -# http://license.coscl.org.cn/MulanPSL2 -# THIS PROGRAM IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, -# EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, -# MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. -# See the Mulan PSL v2 for more details. - -# ############################################# -# @Author : honghua -# @Contact : honghua@iscas.ac.cn -# @Date : 2026-03-12 -# @License : Mulan PSL v2 -# @Desc : 测试pdftexi2dvi命令的--dvi参数,用于生成DVI文件 -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - LOG_INFO "开始测试pdftexi2dvi命令的--dvi参数,用于生成DVI文件" - - # 检查是否已安装texinfo-tex软件包 - LOG_INFO "检查是否已安装texinfo-tex软件包" - if rpm -q texinfo-tex &> /dev/null; then - LOG_INFO "texinfo-tex软件包已安装" - INSTALLED=1 - else - LOG_INFO "texinfo-tex软件包未安装" - INSTALLED=0 - fi - - # 检查yum源中是否有texinfo-tex软件包 - LOG_INFO "检查yum源中是否有texinfo-tex软件包" - if ! dnf list texinfo-tex &> /dev/null; then - LOG_ERROR "yum源中没有texinfo-tex软件包" - exit 255 - fi - - # 如果未安装,则安装texinfo-tex软件包 - if [ $INSTALLED -eq 0 ]; then - LOG_INFO "安装texinfo-tex软件包" - dnf install -y texinfo-tex - CHECK_RESULT $? 0 0 "安装texinfo-tex软件包失败" - fi - - # 检查pdftexi2dvi命令是否支持--dvi参数 - LOG_INFO "检查pdftexi2dvi命令是否支持--dvi参数" - if ! pdftexi2dvi --help | grep -q "\-\-dvi"; then - LOG_ERROR "pdftexi2dvi命令不支持--dvi参数" - exit 255 - fi - - # 创建一个简单的texinfo文件用于测试 - LOG_INFO "创建一个简单的texinfo文件用于测试" - cat > test.texinfo << "EOF" - \input texinfo - @setfilename test - @settitle Test Document - @node Top - @top Test Document - This is a test document. - @bye - EOF - - # 使用pdftexi2dvi命令的--dvi参数生成DVI文件 - LOG_INFO "使用pdftexi2dvi命令的--dvi参数生成DVI文件" - pdftexi2dvi --dvi test.texinfo - CHECK_RESULT $? 0 0 "使用pdftexi2dvi命令的--dvi参数生成DVI文件失败" - - # 检查是否成功生成了DVI文件 - LOG_INFO "检查是否成功生成了DVI文件" - if [ -f test.dvi ]; then - LOG_INFO "成功生成了DVI文件" - else - LOG_ERROR "未生成DVI文件" - exit 1 - fi - - # 清理测试文件 - LOG_INFO "清理测试文件" - rm -f test.texinfo test.dvi test.log test.toc test.aux - - # 如果测试前未安装,则卸载texinfo-tex软件包 - if [ $INSTALLED -eq 0 ]; then - LOG_INFO "卸载texinfo-tex软件包" - dnf remove -y texinfo-tex - CHECK_RESULT $? 0 0 "卸载texinfo-tex软件包失败" - fi - - LOG_INFO "测试完成" -} - -main "$@" \ No newline at end of file diff --git a/testcases/function_test/pkg_test/texinfo/texinfo-tex/test_texinfo-tex_pdftexi2dvi_dvipdf.sh b/testcases/function_test/pkg_test/texinfo/texinfo-tex/test_texinfo-tex_pdftexi2dvi_dvipdf.sh deleted file mode 100644 index 4f342918638..00000000000 --- a/testcases/function_test/pkg_test/texinfo/texinfo-tex/test_texinfo-tex_pdftexi2dvi_dvipdf.sh +++ /dev/null @@ -1,86 +0,0 @@ -#!/usr/bin/bash - -# Copyright (c) 2024 ISCAS .ALL rights reserved. -# This program is licensed under Mulan PSL v2. -# You can use it according to the terms and conditions of the Mulan PSL v2. -# http://license.coscl.org.cn/MulanPSL2 -# THIS PROGRAM IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, -# EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, -# MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. -# See the Mulan PSL v2 for more details. - -# ############################################# -# @Author : honghua -# @Contact : honghua@iscas.ac.cn -# @Date : 2026-03-12 -# @License : Mulan PSL v2 -# @Desc : 测试pdftexi2dvi命令的--dvipdf参数,用于通过DVI生成PDF文件 -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - LOG_INFO "开始测试pdftexi2dvi命令的--dvipdf参数,用于通过DVI生成PDF文件" - - LOG_INFO "步骤1:检查是否已安装texinfo-tex软件包" - if rpm -q texinfo-tex >/dev/null 2>&1; then - LOG_INFO "texinfo-tex已安装,测试后保持安装状态" - already_installed=true - else - LOG_INFO "texinfo-tex未安装,将在测试中安装" - already_installed=false - fi - - LOG_INFO "步骤2:检查yum源中是否有texinfo-tex软件包" - if ! dnf list available texinfo-tex >/dev/null 2>&1; then - LOG_ERROR "yum源中未找到texinfo-tex软件包" - exit 255 - fi - - if [ "$already_installed" = false ]; then - LOG_INFO "步骤3:安装texinfo-tex软件包" - dnf install -y texinfo-tex - CHECK_RESULT $? 0 0 "安装texinfo-tex失败" - fi - - LOG_INFO "步骤4:创建测试用的texinfo文件" - cat > test.texinfo << "EOF" - \input texinfo - @setfilename test - @settitle Test - @node Top - @top Test Document - This is a test document. - @bye - EOF - CHECK_RESULT $? 0 0 "创建test.texinfo文件失败" - - LOG_INFO "步骤5:检查pdftexi2dvi命令是否支持--dvipdf参数" - pdftexi2dvi --help 2>&1 | grep -q -- --dvipdf - CHECK_RESULT $? 0 255 "pdftexi2dvi命令不支持--dvipdf参数" - - LOG_INFO "步骤6:使用pdftexi2dvi --dvipdf生成PDF文件" - pdftexi2dvi --dvipdf test.texinfo - CHECK_RESULT $? 0 0 "pdftexi2dvi --dvipdf执行失败" - - LOG_INFO "步骤7:验证生成的PDF文件" - if [ -f test.pdf ]; then - LOG_INFO "成功生成test.pdf文件" - else - LOG_ERROR "未生成test.pdf文件" - exit 1 - fi - - LOG_INFO "步骤8:清理测试文件" - rm -f test.texinfo test.pdf test.log test.aux test.cp test.cps test.fn test.fns test.ky test.log test.pg test.toc test.tp test.vr - - if [ "$already_installed" = false ]; then - LOG_INFO "步骤9:卸载texinfo-tex软件包" - dnf remove -y texinfo-tex - CHECK_RESULT $? 0 0 "卸载texinfo-tex失败" - fi - - LOG_INFO "测试完成" -} - -main "$@" \ No newline at end of file diff --git a/testcases/function_test/pkg_test/texinfo/texinfo-tex/test_texinfo-tex_pdftexi2dvi_expand.sh b/testcases/function_test/pkg_test/texinfo/texinfo-tex/test_texinfo-tex_pdftexi2dvi_expand.sh deleted file mode 100644 index 351b5abe12b..00000000000 --- a/testcases/function_test/pkg_test/texinfo/texinfo-tex/test_texinfo-tex_pdftexi2dvi_expand.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-01-28 -# @License : Mulan PSL v2 -# @Desc : 测试 pdftexi2dvi 的 --expand 选项,用于启用宏扩展 -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - # 检查环境是否已安装texinfo-tex - LOG_INFO "检查是否已安装texinfo-tex" - if rpm -q texinfo-tex > /dev/null 2>&1; then - LOG_INFO "texinfo-tex已安装,测试结束后保持安装状态" - INSTALLED_BEFORE_TEST=1 - else - LOG_INFO "texinfo-tex未安装,将在测试前安装并在测试后卸载" - INSTALLED_BEFORE_TEST=0 - fi - - # 检查yum源中是否有texinfo-tex软件包 - LOG_INFO "检查yum源中是否有texinfo-tex软件包" - if dnf list available texinfo-tex > /dev/null 2>&1; then - LOG_INFO "yum源中存在texinfo-tex软件包" - else - LOG_ERROR "yum源中不存在texinfo-tex软件包" - exit 255 - fi - - # 如果未安装,则安装texinfo-tex - if [ $INSTALLED_BEFORE_TEST -eq 0 ]; then - LOG_INFO "安装texinfo-tex软件包" - dnf install -y texinfo-tex - CHECK_RESULT $? 0 0 "安装texinfo-tex失败" - fi - - # 检查pdftexi2dvi命令是否存在 - LOG_INFO "检查pdftexi2dvi命令是否存在" - if command -v pdftexi2dvi > /dev/null 2>&1; then - LOG_INFO "pdftexi2dvi命令存在" - else - LOG_ERROR "pdftexi2dvi命令不存在" - exit 255 - fi - - # 检查pdftexi2dvi是否支持--expand选项 - LOG_INFO "检查pdftexi2dvi是否支持--expand选项" - pdftexi2dvi --help 2>&1 | grep -q "\-\-expand" - if [ $? -eq 0 ]; then - LOG_INFO "pdftexi2dvi支持--expand选项" - else - LOG_ERROR "pdftexi2dvi不支持--expand选项" - exit 255 - fi - - # 创建一个简单的texinfo测试文件 - LOG_INFO "创建测试用的texinfo文件" - cat > test.texinfo << EOF - \input texinfo - @setfilename test.info - @settitle Test Document - @bye - EOF - CHECK_RESULT $? 0 0 "创建texinfo测试文件失败" - - # 使用--expand选项运行pdftexi2dvi - LOG_INFO "使用--expand选项运行pdftexi2dvi" - pdftexi2dvi --expand test.texinfo - CHECK_RESULT $? 0 0 "pdftexi2dvi --expand执行失败" - - # 检查是否生成了预期的输出文件 - LOG_INFO "检查是否生成了PDF文件" - if [ -f test.pdf ]; then - LOG_INFO "成功生成PDF文件" - else - LOG_ERROR "未生成PDF文件" - exit 1 - fi - - # 清理测试文件 - LOG_INFO "清理测试文件" - rm -f test.texinfo test.pdf test.log test.toc test.aux test.cp test.fn test.ky test.pg test.tp test.vr test.cps test.fns test.kys test.pgs test.tps test.vrs - CHECK_RESULT $? 0 0 "清理测试文件失败" - - # 如果测试前未安装,则卸载texinfo-tex - if [ $INSTALLED_BEFORE_TEST -eq 0 ]; then - LOG_INFO "卸载texinfo-tex软件包" - dnf remove -y texinfo-tex - CHECK_RESULT $? 0 0 "卸载texinfo-tex失败" - else - LOG_INFO "测试前已安装texinfo-tex,保持安装状态" - fi - - LOG_INFO "测试完成" -} - -main "$@" \ No newline at end of file diff --git a/testcases/function_test/pkg_test/texinfo/texinfo-tex/test_texinfo-tex_pdftexi2dvi_expand_quiet.sh b/testcases/function_test/pkg_test/texinfo/texinfo-tex/test_texinfo-tex_pdftexi2dvi_expand_quiet.sh deleted file mode 100644 index 7af852ce6b6..00000000000 --- a/testcases/function_test/pkg_test/texinfo/texinfo-tex/test_texinfo-tex_pdftexi2dvi_expand_quiet.sh +++ /dev/null @@ -1,90 +0,0 @@ -#!/usr/bin/bash - -# Copyright (c) 2024 ISCAS .ALL rights reserved. -# This program is licensed under Mulan PSL v2. -# You can use it according to the terms and conditions of the Mulan PSL v2. -# http://license.coscl.org.cn/MulanPSL2 -# THIS PROGRAM IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, -# EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, -# MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. -# See the Mulan PSL v2 for more details. - -# ############################################# -# @Author : honghua -# @Contact : honghua@iscas.ac.cn -# @Date : 2026-01-28 -# @License : Mulan PSL v2 -# @Desc : 测试 pdftexi2dvi 同时使用 --expand 和 --quiet 选项,确保宏扩展功能与安静模式不冲突 -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - LOG_INFO "开始测试 pdftexi2dvi 同时使用 --expand 和 --quiet 选项,确保宏扩展功能与安静模式不冲突" - - LOG_INFO "检查是否已安装 texinfo-tex 软件包" - if ! dnf list installed texinfo-tex &>/dev/null; then - LOG_INFO "texinfo-tex 未安装,开始安装" - LOG_INFO "检查 yum 源中是否有 texinfo-tex 软件包" - if ! dnf list available texinfo-tex &>/dev/null; then - LOG_ERROR "yum 源中不存在 texinfo-tex 软件包" - exit 255 - fi - dnf install -y texinfo-tex - CHECK_RESULT $? 0 0 "安装 texinfo-tex 失败" - INSTALLED=1 - else - LOG_INFO "texinfo-tex 已安装,跳过安装步骤" - INSTALLED=0 - fi - - LOG_INFO "创建一个简单的 texinfo 测试文件" - cat > test.texinfo << "EOF" - \input texinfo - @setfilename test.info - @settitle Test Document - @node Top - @top Test Document - This is a test document. - @bye - EOF - CHECK_RESULT $? 0 0 "创建 texinfo 测试文件失败" - - LOG_INFO "测试 pdftexi2dvi 命令是否支持 --expand 和 --quiet 参数" - if ! pdftexi2dvi --help 2>&1 | grep -q -- "--expand"; then - LOG_ERROR "pdftexi2dvi 不支持 --expand 参数" - exit 255 - fi - if ! pdftexi2dvi --help 2>&1 | grep -q -- "--quiet"; then - LOG_ERROR "pdftexi2dvi 不支持 --quiet 参数" - exit 255 - fi - - LOG_INFO "执行 pdftexi2dvi 同时使用 --expand 和 --quiet 选项" - pdftexi2dvi --expand --quiet test.texinfo - CHECK_RESULT $? 0 0 "pdftexi2dvi 执行失败,宏扩展功能与安静模式可能冲突" - - LOG_INFO "检查是否生成了预期的 PDF 文件" - if [ -f test.pdf ]; then - LOG_INFO "成功生成 test.pdf 文件" - else - LOG_ERROR "未生成 test.pdf 文件" - exit 1 - fi - - LOG_INFO "清理测试文件" - rm -f test.texinfo test.pdf test.aux test.cp test.cps test.fn test.fns test.ky test.log test.pg test.toc test.tp test.vr test.vrs - - LOG_INFO "根据安装状态决定是否卸载 texinfo-tex" - if [ $INSTALLED -eq 1 ]; then - LOG_INFO "卸载 texinfo-tex 软件包" - dnf remove -y texinfo-tex - CHECK_RESULT $? 0 0 "卸载 texinfo-tex 失败" - else - LOG_INFO "测试前已安装 texinfo-tex,保持安装状态" - fi - - LOG_INFO "测试完成" -} - -main "$@" \ No newline at end of file diff --git a/testcases/function_test/pkg_test/texinfo/texinfo-tex/test_texinfo-tex_pdftexi2dvi_h.sh b/testcases/function_test/pkg_test/texinfo/texinfo-tex/test_texinfo-tex_pdftexi2dvi_h.sh deleted file mode 100644 index 494fc9554a0..00000000000 --- a/testcases/function_test/pkg_test/texinfo/texinfo-tex/test_texinfo-tex_pdftexi2dvi_h.sh +++ /dev/null @@ -1,66 +0,0 @@ -#!/usr/bin/bash - -# Copyright (c) 2024 ISCAS .ALL rights reserved. -# This program is licensed under Mulan PSL v2. -# You can use it according to the terms and conditions of the Mulan PSL v2. -# http://license.coscl.org.cn/MulanPSL2 -# THIS PROGRAM IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, -# EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, -# MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. -# See the Mulan PSL v2 for more details. - -# ############################################# -# @Author : honghua -# @Contact : honghua@iscas.ac.cn -# @Date : 2026-01-28 -# @License : Mulan PSL v2 -# @Desc : 测试 pdftexi2dvi 的 --help 选项,用于显示帮助信息 -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - LOG_INFO "1. 检查环境中是否已安装 texinfo-tex 软件包" - if dnf list installed texinfo-tex &> /dev/null; then - LOG_INFO "texinfo-tex 软件包已安装,脚本结束时将保持安装状态" - INSTALLED_BEFORE=true - else - LOG_INFO "texinfo-tex 软件包未安装,将在测试过程中安装" - INSTALLED_BEFORE=false - fi - - LOG_INFO "2. 检查 yum 源中是否有 texinfo-tex 软件包" - if ! dnf list available texinfo-tex &> /dev/null; then - LOG_ERROR "yum 源中没有 texinfo-tex 软件包" - exit 255 - fi - - LOG_INFO "3. 安装 texinfo-tex 软件包" - if [ "$INSTALLED_BEFORE" = "false" ]; then - dnf install -y texinfo-tex - CHECK_RESULT $? 0 0 "安装 texinfo-tex 软件包失败" - fi - - LOG_INFO "4. 检查 pdftexi2dvi 命令是否存在" - if ! command -v pdftexi2dvi &> /dev/null; then - LOG_ERROR "pdftexi2dvi 命令不存在" - exit 255 - fi - - LOG_INFO "5. 测试 pdftexi2dvi 的 --help 选项,用于显示帮助信息" - pdftexi2dvi --help - CHECK_RESULT $? 0 0 "pdftexi2dvi --help 执行失败" - - LOG_INFO "6. 清理环境" - if [ "$INSTALLED_BEFORE" = "false" ]; then - LOG_INFO "卸载 texinfo-tex 软件包" - dnf remove -y texinfo-tex - CHECK_RESULT $? 0 0 "卸载 texinfo-tex 软件包失败" - else - LOG_INFO "保持 texinfo-tex 软件包安装状态" - fi - - LOG_INFO "测试完成" -} - -main "$@" \ No newline at end of file diff --git a/testcases/function_test/pkg_test/texinfo/texinfo-tex/test_texinfo-tex_pdftexi2dvi_l.sh b/testcases/function_test/pkg_test/texinfo/texinfo-tex/test_texinfo-tex_pdftexi2dvi_l.sh deleted file mode 100644 index 12f5c116f72..00000000000 --- a/testcases/function_test/pkg_test/texinfo/texinfo-tex/test_texinfo-tex_pdftexi2dvi_l.sh +++ /dev/null @@ -1,72 +0,0 @@ -#!/usr/bin/bash - -# Copyright (c) 2024 ISCAS .ALL rights reserved. -# This program is licensed under Mulan PSL v2. -# You can use it according to the terms and conditions of the Mulan PSL v2. -# http://license.coscl.org.cn/MulanPSL2 -# THIS PROGRAM IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, -# EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, -# MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. -# See the Mulan PSL v2 for more details. - -# ############################################# -# @Author : honghua -# @Contact : honghua@iscas.ac.cn -# @Date : 2026-03-12 -# @License : Mulan PSL v2 -# @Desc : 测试pdftexi2dvi命令的-l参数,用于指定输入文件的语言 -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - LOG_INFO "开始测试pdftexi2dvi命令的-l参数功能" - LOG_INFO "检查texinfo-tex软件包是否已安装" - if rpm -q texinfo-tex &> /dev/null; then - LOG_INFO "texinfo-tex软件包已安装,测试结束后保持安装状态" - INSTALLED=true - else - LOG_INFO "texinfo-tex软件包未安装,将在测试前安装" - INSTALLED=false - fi - - LOG_INFO "检查yum源中是否有texinfo-tex软件包" - if ! dnf list available texinfo-tex &> /dev/null; then - LOG_ERROR "yum源中未找到texinfo-tex软件包" - exit 255 - fi - - if [ "$INSTALLED" = false ]; then - LOG_INFO "安装texinfo-tex软件包" - dnf install -y texinfo-tex - CHECK_RESULT $? 0 0 "安装texinfo-tex软件包失败" - fi - - LOG_INFO "创建测试用的texinfo文件" - cat > test.texinfo << "EOF" - \input texinfo - @setfilename test.info - @settitle Test Document - @documentlanguage en - @bye - EOF - CHECK_RESULT $? 0 0 "创建test.texinfo文件失败" - - LOG_INFO "测试pdftexi2dvi命令的-l参数,指定语言为en" - pdftexi2dvi -l en test.texinfo - CHECK_RESULT $? 0 0 "pdftexi2dvi -l en 执行失败" - - LOG_INFO "清理测试生成的文件" - rm -f test.texinfo test.pdf test.aux test.log test.toc - CHECK_RESULT $? 0 0 "清理测试文件失败" - - if [ "$INSTALLED" = false ]; then - LOG_INFO "卸载texinfo-tex软件包" - dnf remove -y texinfo-tex - CHECK_RESULT $? 0 0 "卸载texinfo-tex软件包失败" - fi - - LOG_INFO "测试完成" -} - -main "$@" \ No newline at end of file diff --git a/testcases/function_test/pkg_test/texinfo/texinfo-tex/test_texinfo-tex_pdftexi2dvi_language.sh b/testcases/function_test/pkg_test/texinfo/texinfo-tex/test_texinfo-tex_pdftexi2dvi_language.sh deleted file mode 100644 index a399da327ea..00000000000 --- a/testcases/function_test/pkg_test/texinfo/texinfo-tex/test_texinfo-tex_pdftexi2dvi_language.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-01-28 -# @License : Mulan PSL v2 -# @Desc : 测试 pdftexi2dvi 的 --language 选项,用于指定输入文件的处理语言 -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - LOG_INFO "开始测试 pdftexi2dvi 的 --language 选项" - LOG_INFO "检查 texinfo-tex 软件包是否已安装" - rpm -q texinfo-tex - if [ $? -eq 0 ]; then - LOG_INFO "texinfo-tex 已安装,测试结束后将保持安装状态" - already_installed=1 - else - LOG_INFO "texinfo-tex 未安装,将在测试前安装" - already_installed=0 - LOG_INFO "检查 yum 源中是否存在 texinfo-tex 软件包" - dnf list available texinfo-tex - if [ $? -ne 0 ]; then - LOG_ERROR "yum 源中未找到 texinfo-tex 软件包" - exit 255 - fi - LOG_INFO "安装 texinfo-tex 软件包" - dnf install -y texinfo-tex - CHECK_RESULT $? 0 0 "安装 texinfo-tex 失败" - fi - - LOG_INFO "创建测试用的 texinfo 文件" - cat > test.texinfo << "EOF" - \input texinfo - @setfilename test.info - @settitle Test Document - @documentencoding UTF-8 - @documentlanguage en - @bye - EOF - CHECK_RESULT $? 0 0 "创建 test.texinfo 文件失败" - - LOG_INFO "测试 pdftexi2dvi 命令的 --language 选项支持情况" - pdftexi2dvi --help | grep -q -- "--language" - CHECK_RESULT $? 0 0 "pdftexi2dvi 命令不支持 --language 参数" - - LOG_INFO "使用 --language=fr 选项处理 texinfo 文件" - pdftexi2dvi --language=fr test.texinfo - CHECK_RESULT $? 0 0 "使用 --language=fr 选项执行失败" - - LOG_INFO "使用不支持的 --language=xx 选项(预期失败)" - pdftexi2dvi --language=xx test.texinfo 2>/dev/null - CHECK_RESULT $? 0 1 "使用不支持的 --language=xx 选项未按预期失败" - - LOG_INFO "清理测试生成的文件" - rm -f test.texinfo test.aux test.cp test.cps test.fn test.fns test.ky test.kys test.log test.pg test.toc test.tp test.tps test.vr test.vrs test.pdf test.info - - if [ $already_installed -eq 0 ]; then - LOG_INFO "测试结束,卸载 texinfo-tex 软件包" - dnf remove -y texinfo-tex - CHECK_RESULT $? 0 0 "卸载 texinfo-tex 失败" - else - LOG_INFO "测试结束,保持 texinfo-tex 安装状态" - fi - - LOG_INFO "测试完成" -} - -main "$@" \ No newline at end of file diff --git a/testcases/function_test/pkg_test/texinfo/texinfo-tex/test_texinfo-tex_pdftexi2dvi_max_iterations.sh b/testcases/function_test/pkg_test/texinfo/texinfo-tex/test_texinfo-tex_pdftexi2dvi_max_iterations.sh deleted file mode 100644 index 6eba88c7536..00000000000 --- a/testcases/function_test/pkg_test/texinfo/texinfo-tex/test_texinfo-tex_pdftexi2dvi_max_iterations.sh +++ /dev/null @@ -1,182 +0,0 @@ -#!/usr/bin/bash - -# Copyright (c) 2024 ISCAS .ALL rights reserved. -# This program is licensed under Mulan PSL v2. -# You can use it according to the terms and conditions of the Mulan PSL v2. -# http://license.coscl.org.cn/MulanPSL2 -# THIS PROGRAM IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, -# EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, -# MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. -# See the Mulan PSL v2 for more details. - -# ############################################# -# @Author : honghua -# @Contact : honghua@iscas.ac.cn -# @Date : 2026-01-28 -# @License : Mulan PSL v2 -# @Desc : 测试 pdftexi2dvi 的 --max-iterations 选项,用于限制文件处理的最大迭代次数 -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - # 设置环境变量 - SCRIPT_NAME="test_texinfo-tex_pdftexi2dvi_max_iterations" - PACKAGE_NAME="texinfo-tex" - CMD_NAME="pdftexi2dvi" - OPTION_NAME="--max-iterations" - TEST_FILE="test_texinfo.tex" - - # 日志函数 - LOG_INFO() { - echo "[INFO] $1" - } - - LOG_ERROR() { - echo "[ERROR] $1" >&2 - } - - # 检查包是否存在 - check_package_exist() { - LOG_INFO "检查软件包 $PACKAGE_NAME 是否在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源中" - } - - # 检查命令选项是否支持 - check_option_support() { - LOG_INFO "检查命令 $CMD_NAME 是否支持选项 $OPTION_NAME" - $CMD_NAME --help 2>&1 | grep -q "$OPTION_NAME" - if [ $? -ne 0 ]; then - LOG_ERROR "命令 $CMD_NAME 不支持选项 $OPTION_NAME" - exit 255 - fi - LOG_INFO "命令 $CMD_NAME 支持选项 $OPTION_NAME" - } - - # 检查是否已安装 - check_installed() { - LOG_INFO "检查软件包 $PACKAGE_NAME 是否已安装" - rpm -q $PACKAGE_NAME &>/dev/null - return $? - } - - # 安装软件包 - install_package() { - LOG_INFO "安装软件包 $PACKAGE_NAME" - dnf install -y $PACKAGE_NAME - CHECK_RESULT $? 0 0 "安装软件包 $PACKAGE_NAME 失败" - } - - # 卸载软件包 - uninstall_package() { - LOG_INFO "卸载软件包 $PACKAGE_NAME" - dnf remove -y $PACKAGE_NAME - CHECK_RESULT $? 0 0 "卸载软件包 $PACKAGE_NAME 失败" - } - - # 创建测试文件 - create_test_file() { - LOG_INFO "创建测试TeX文件" - cat > $TEST_FILE << "EOF" - \documentclass{article} - \begin{document} - Hello, TeX world! - \end{document} - EOF - CHECK_RESULT $? 0 0 "创建测试文件失败" - } - - # 清理测试文件 - clean_test_file() { - LOG_INFO "清理测试文件" - rm -f $TEST_FILE *.pdf *.log *.aux *.toc 2>/dev/null - } - - # 测试 --max-iterations 选项 - test_max_iterations() { - LOG_INFO "测试 --max-iterations 选项功能" - - # 测试正常迭代次数 - LOG_INFO "测试正常迭代次数 (--max-iterations=5)" - $CMD_NAME $TEST_FILE $OPTION_NAME=5 - CHECK_RESULT $? 0 0 "正常迭代测试失败" - - # 测试过小迭代次数(应失败) - LOG_INFO "测试过小迭代次数 (--max-iterations=1)" - $CMD_NAME $TEST_FILE $OPTION_NAME=1 2>&1 | grep -q "max.*iterations" - CHECK_RESULT $? 0 0 "过小迭代次数测试未按预期失败" - - # 测试无效参数 - LOG_INFO "测试无效参数 (--max-iterations=0)" - $CMD_NAME $TEST_FILE $OPTION_NAME=0 2>&1 | grep -q "invalid" - if [ $? -eq 0 ]; then - LOG_INFO "无效参数检查通过" - else - $CMD_NAME $TEST_FILE $OPTION_NAME=0 2>/dev/null - if [ $? -ne 0 ]; then - LOG_INFO "无效参数检查通过(命令失败)" - else - LOG_ERROR "无效参数测试未按预期失败" - return 1 - fi - fi - - # 测试大迭代次数 - LOG_INFO "测试大迭代次数 (--max-iterations=100)" - $CMD_NAME $TEST_FILE $OPTION_NAME=100 - CHECK_RESULT $? 0 0 "大迭代次数测试失败" - } - - # 主函数 - main() { - LOG_INFO "开始执行测试脚本: $SCRIPT_NAME" - - # 检查包是否存在 - check_package_exist - - # 检查是否已安装 - check_installed - INSTALLED_BEFORE=$? - - # 如果未安装,则安装 - if [ $INSTALLED_BEFORE -ne 0 ]; then - install_package - NEED_CLEANUP=1 - else - LOG_INFO "软件包 $PACKAGE_NAME 已安装,测试后保持安装状态" - NEED_CLEANUP=0 - fi - - # 检查命令选项支持 - check_option_support - - # 创建测试文件 - create_test_file - - # 执行测试 - test_max_iterations - - # 清理测试文件 - clean_test_file - - # 恢复环境 - LOG_INFO "恢复测试环境" - if [ $NEED_CLEANUP -eq 1 ]; then - uninstall_package - else - LOG_INFO "保持软件包 $PACKAGE_NAME 的安装状态" - fi - - LOG_INFO "测试脚本 $SCRIPT_NAME 执行完成" - } - - # 执行主函数 - main -} - -main "$@" \ No newline at end of file diff --git a/testcases/function_test/pkg_test/texinfo/texinfo-tex/test_texinfo-tex_pdftexi2dvi_mostly_clean.sh b/testcases/function_test/pkg_test/texinfo/texinfo-tex/test_texinfo-tex_pdftexi2dvi_mostly_clean.sh deleted file mode 100644 index b674c916d07..00000000000 --- a/testcases/function_test/pkg_test/texinfo/texinfo-tex/test_texinfo-tex_pdftexi2dvi_mostly_clean.sh +++ /dev/null @@ -1,129 +0,0 @@ -#!/usr/bin/bash - -# Copyright (c) 2024 ISCAS .ALL rights reserved. -# This program is licensed under Mulan PSL v2. -# You can use it according to the terms and conditions of the Mulan PSL v2. -# http://license.coscl.org.cn/MulanPSL2 -# THIS PROGRAM IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, -# EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, -# MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. -# See the Mulan PSL v2 for more details. - -# ############################################# -# @Author : honghua -# @Contact : honghua@iscas.ac.cn -# @Date : 2026-01-28 -# @License : Mulan PSL v2 -# @Desc : 测试 pdftexi2dvi 的 --mostly-clean 选项,用于清理以前运行的辅助文件 -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - LOG_INFO "开始测试 pdftexi2dvi 的 --mostly-clean 选项" - - # 检查是否已安装 texinfo-tex 软件包 - LOG_INFO "检查 texinfo-tex 软件包是否已安装" - if rpm -q texinfo-tex &>/dev/null; then - LOG_INFO "texinfo-tex 已安装,测试后保持安装状态" - INSTALLED=true - else - LOG_INFO "texinfo-tex 未安装,将在测试过程中安装" - INSTALLED=false - fi - - # 检查 yum 源中是否有 texinfo-tex 软件包 - LOG_INFO "检查 yum 源中是否有 texinfo-tex 软件包" - if dnf list available texinfo-tex &>/dev/null; then - LOG_INFO "yum 源中存在 texinfo-tex 软件包" - else - LOG_ERROR "yum 源中不存在 texinfo-tex 软件包" - exit 255 - fi - - # 如果未安装,则安装 texinfo-tex - if [ "$INSTALLED" = false ]; then - LOG_INFO "安装 texinfo-tex 软件包" - dnf install -y texinfo-tex - CHECK_RESULT $? 0 0 "安装 texinfo-tex 失败" - fi - - # 检查 pdftexi2dvi 命令是否存在 - LOG_INFO "检查 pdftexi2dvi 命令是否存在" - if ! command -v pdftexi2dvi &>/dev/null; then - LOG_ERROR "pdftexi2dvi 命令不存在" - if [ "$INSTALLED" = false ]; then - LOG_INFO "卸载 texinfo-tex 软件包" - dnf remove -y texinfo-tex - fi - exit 255 - fi - - # 检查 --mostly-clean 参数是否支持 - LOG_INFO "检查 pdftexi2dvi 是否支持 --mostly-clean 参数" - pdftexi2dvi --help 2>&1 | grep -q -- "--mostly-clean" - CHECK_RESULT $? 0 0 "pdftexi2dvi 不支持 --mostly-clean 参数" - - # 创建测试用的 texinfo 文件 - LOG_INFO "创建测试用的 texinfo 文件" - cat > test.texinfo << "EOF" - \input texinfo - @setfilename test.info - @settitle Test Document - @bye - EOF - CHECK_RESULT $? 0 0 "创建 texinfo 文件失败" - - # 运行 pdftexi2dvi 生成 PDF 和辅助文件 - LOG_INFO "运行 pdftexi2dvi 生成 PDF 和辅助文件" - pdftexi2dvi test.texinfo - CHECK_RESULT $? 0 0 "pdftexi2dvi 执行失败" - - # 检查是否生成了辅助文件 - LOG_INFO "检查是否生成了辅助文件" - if ls test.aux test.log test.toc &>/dev/null; then - LOG_INFO "辅助文件已生成" - else - LOG_ERROR "未生成预期的辅助文件" - CHECK_RESULT 1 0 0 "辅助文件生成检查失败" - fi - - # 使用 --mostly-clean 选项清理辅助文件 - LOG_INFO "使用 --mostly-clean 选项清理辅助文件" - pdftexi2dvi --mostly-clean test.texinfo - CHECK_RESULT $? 0 0 "pdftexi2dvi --mostly-clean 执行失败" - - # 检查辅助文件是否被清理 - LOG_INFO "检查辅助文件是否被清理" - if ls test.aux test.log test.toc &>/dev/null 2>&1; then - LOG_ERROR "辅助文件未被清理" - CHECK_RESULT 1 0 0 "辅助文件清理检查失败" - else - LOG_INFO "辅助文件已成功清理" - fi - - # 检查 PDF 文件是否仍然存在 - LOG_INFO "检查 PDF 文件是否仍然存在" - if [ -f test.pdf ]; then - LOG_INFO "PDF 文件仍然存在" - else - LOG_ERROR "PDF 文件被意外删除" - CHECK_RESULT 1 0 0 "PDF 文件存在性检查失败" - fi - - # 清理测试文件 - LOG_INFO "清理测试文件" - rm -f test.texinfo test.pdf - CHECK_RESULT $? 0 0 "清理测试文件失败" - - # 如果测试前未安装,则卸载 texinfo-tex - if [ "$INSTALLED" = false ]; then - LOG_INFO "卸载 texinfo-tex 软件包" - dnf remove -y texinfo-tex - CHECK_RESULT $? 0 0 "卸载 texinfo-tex 失败" - fi - - LOG_INFO "测试 pdftexi2dvi 的 --mostly-clean 选项完成" -} - -main "$@" \ No newline at end of file diff --git a/testcases/function_test/pkg_test/texinfo/texinfo-tex/test_texinfo-tex_pdftexi2dvi_no_line_error.sh b/testcases/function_test/pkg_test/texinfo/texinfo-tex/test_texinfo-tex_pdftexi2dvi_no_line_error.sh deleted file mode 100644 index 8b506e7cc09..00000000000 --- a/testcases/function_test/pkg_test/texinfo/texinfo-tex/test_texinfo-tex_pdftexi2dvi_no_line_error.sh +++ /dev/null @@ -1,87 +0,0 @@ -#!/usr/bin/bash - -# Copyright (c) 2024 ISCAS .ALL rights reserved. -# This program is licensed under Mulan PSL v2. -# You can use it according to the terms and conditions of the Mulan PSL v2. -# http://license.coscl.org.cn/MulanPSL2 -# THIS PROGRAM IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, -# EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, -# MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. -# See the Mulan PSL v2 for more details. - -# ############################################# -# @Author : honghua -# @Contact : honghua@iscas.ac.cn -# @Date : 2026-03-12 -# @License : Mulan PSL v2 -# @Desc : 测试pdftexi2dvi命令的--no-line-error参数,用于不向TeX传递--file-line-error选项 -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - LOG_INFO "开始测试pdftexi2dvi命令的--no-line-error参数" - LOG_INFO "步骤1: 检查texinfo-tex软件包是否在yum源中" - dnf list available texinfo-tex > /dev/null 2>&1 - if [ $? -ne 0 ]; then - LOG_ERROR "yum源中未找到texinfo-tex软件包" - exit 255 - fi - - LOG_INFO "步骤2: 检查当前环境是否已安装texinfo-tex" - rpm -q texinfo-tex > /dev/null 2>&1 - if [ $? -eq 0 ]; then - LOG_INFO "texinfo-tex已安装,测试后保持安装状态" - INSTALLED=1 - else - LOG_INFO "texinfo-tex未安装,将安装并测试后卸载" - INSTALLED=0 - fi - - if [ $INSTALLED -eq 0 ]; then - LOG_INFO "步骤3: 安装texinfo-tex软件包" - dnf install -y texinfo-tex - CHECK_RESULT $? 0 0 "安装texinfo-tex失败" - fi - - LOG_INFO "步骤4: 检查pdftexi2dvi命令是否支持--no-line-error参数" - pdftexi2dvi --help 2>&1 | grep -q "no-line-error" - CHECK_RESULT $? 0 0 "pdftexi2dvi命令不支持--no-line-error参数" - - LOG_INFO "步骤5: 创建一个简单的TeX文件用于测试" - cat > test.tex << "EOF" - \documentclass{article} - \begin{document} - Hello, world! - \end{document} - EOF - CHECK_RESULT $? 0 0 "创建测试TeX文件失败" - - LOG_INFO "步骤6: 使用--no-line-error参数运行pdftexi2dvi命令" - pdftexi2dvi --no-line-error test.tex - CHECK_RESULT $? 0 0 "pdftexi2dvi命令执行失败" - - LOG_INFO "步骤7: 检查生成的PDF文件" - if [ -f test.pdf ]; then - LOG_INFO "成功生成PDF文件" - else - LOG_ERROR "未生成PDF文件" - exit 1 - fi - - LOG_INFO "步骤8: 清理测试文件" - rm -f test.tex test.pdf test.log test.aux - CHECK_RESULT $? 0 0 "清理测试文件失败" - - if [ $INSTALLED -eq 0 ]; then - LOG_INFO "步骤9: 卸载texinfo-tex软件包" - dnf remove -y texinfo-tex - CHECK_RESULT $? 0 0 "卸载texinfo-tex失败" - else - LOG_INFO "步骤9: 保持texinfo-tex安装状态" - fi - - LOG_INFO "测试完成" -} - -main "$@" \ No newline at end of file diff --git a/testcases/function_test/pkg_test/texinfo/texinfo-tex/test_texinfo-tex_pdftexi2dvi_o.sh b/testcases/function_test/pkg_test/texinfo/texinfo-tex/test_texinfo-tex_pdftexi2dvi_o.sh deleted file mode 100644 index 53c3ae5ab35..00000000000 --- a/testcases/function_test/pkg_test/texinfo/texinfo-tex/test_texinfo-tex_pdftexi2dvi_o.sh +++ /dev/null @@ -1,95 +0,0 @@ -#!/usr/bin/bash - -# Copyright (c) 2024 ISCAS .ALL rights reserved. -# This program is licensed under Mulan PSL v2. -# You can use it according to the terms and conditions of the Mulan PSL v2. -# http://license.coscl.org.cn/MulanPSL2 -# THIS PROGRAM IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, -# EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, -# MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. -# See the Mulan PSL v2 for more details. - -# ############################################# -# @Author : honghua -# @Contact : honghua@iscas.ac.cn -# @Date : 2026-03-12 -# @License : Mulan PSL v2 -# @Desc : 测试pdftexi2dvi命令的-o参数,用于指定输出文件 -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - # 测试pdftexi2dvi命令的-o参数,用于指定输出文件 - - # 定义软件包名称 - PACKAGE_NAME="texinfo-tex" - - # 步骤1:检查软件包是否已在yum源中 - LOG_INFO "检查软件包是否在yum源中" - dnf list available $PACKAGE_NAME &>/dev/null - if [ $? -ne 0 ]; then - LOG_ERROR "软件包 $PACKAGE_NAME 不在yum源中" - exit 255 - fi - - # 步骤2:检查软件包是否已安装 - LOG_INFO "检查软件包是否已安装" - rpm -q $PACKAGE_NAME &>/dev/null - if [ $? -eq 0 ]; then - LOG_INFO "软件包 $PACKAGE_NAME 已安装" - INSTALLED_BEFORE=1 - else - LOG_INFO "软件包 $PACKAGE_NAME 未安装" - INSTALLED_BEFORE=0 - fi - - # 步骤3:如果未安装,则安装软件包 - if [ $INSTALLED_BEFORE -eq 0 ]; then - LOG_INFO "安装软件包 $PACKAGE_NAME" - dnf install -y $PACKAGE_NAME - CHECK_RESULT $? 0 0 "安装软件包 $PACKAGE_NAME 失败" - fi - - # 步骤4:检查pdftexi2dvi命令是否存在 - LOG_INFO "检查pdftexi2dvi命令是否存在" - command -v pdftexi2dvi &>/dev/null - CHECK_RESULT $? 0 0 "pdftexi2dvi命令不存在" - - # 步骤5:测试pdftexi2dvi命令的-o参数 - LOG_INFO "测试pdftexi2dvi命令的-o参数" - # 创建一个简单的tex文件用于测试 - cat > test.tex << "EOF" - \documentclass{article} - \begin{document} - Hello World! - \end{document} - EOF - - # 使用-o参数指定输出文件 - LOG_INFO "执行pdftexi2dvi命令,使用-o参数指定输出文件" - pdftexi2dvi test.tex -o output.pdf - CHECK_RESULT $? 0 0 "pdftexi2dvi命令执行失败" - - # 步骤6:验证输出文件是否生成 - LOG_INFO "验证输出文件是否生成" - [ -f output.pdf ] - CHECK_RESULT $? 0 0 "输出文件未生成" - - # 步骤7:清理测试文件 - LOG_INFO "清理测试文件" - rm -f test.tex output.pdf - - # 步骤8:如果之前未安装软件包,则卸载 - if [ $INSTALLED_BEFORE -eq 0 ]; then - LOG_INFO "卸载软件包 $PACKAGE_NAME" - dnf remove -y $PACKAGE_NAME - CHECK_RESULT $? 0 0 "卸载软件包 $PACKAGE_NAME 失败" - else - LOG_INFO "保持软件包 $PACKAGE_NAME 的安装状态" - fi - - LOG_INFO "测试完成" -} - -main "$@" \ No newline at end of file diff --git a/testcases/function_test/pkg_test/texinfo/texinfo-tex/test_texinfo-tex_pdftexi2dvi_output.sh b/testcases/function_test/pkg_test/texinfo/texinfo-tex/test_texinfo-tex_pdftexi2dvi_output.sh deleted file mode 100644 index c0e0696022f..00000000000 --- a/testcases/function_test/pkg_test/texinfo/texinfo-tex/test_texinfo-tex_pdftexi2dvi_output.sh +++ /dev/null @@ -1,120 +0,0 @@ -#!/usr/bin/bash - -# Copyright (c) 2024 ISCAS .ALL rights reserved. -# This program is licensed under Mulan PSL v2. -# You can use it according to the terms and conditions of the Mulan PSL v2. -# http://license.coscl.org.cn/MulanPSL2 -# THIS PROGRAM IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, -# EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, -# MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. -# See the Mulan PSL v2 for more details. - -# ############################################# -# @Author : honghua -# @Contact : honghua@iscas.ac.cn -# @Date : 2026-01-28 -# @License : Mulan PSL v2 -# @Desc : 测试 pdftexi2dvi 的 --output 选项,用于指定输出文件名 -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - # 定义颜色输出函数(如果未定义) - if ! command -v LOG_INFO &> /dev/null; then - LOG_INFO() { - echo "[INFO] $*" - } - fi - if ! command -v LOG_ERROR &> /dev/null; then - LOG_ERROR() { - echo "[ERROR] $*" >&2 - } - fi - - # 定义软件包名称 - PACKAGE_NAME="texinfo-tex" - - # 步骤1:检查软件包是否在yum源中 - LOG_INFO "检查软件包 $PACKAGE_NAME 是否在yum源中" - if ! dnf list available "$PACKAGE_NAME" &>/dev/null; then - LOG_ERROR "软件包 $PACKAGE_NAME 不在yum源中" - exit 255 - fi - - # 步骤2:检查软件包是否已安装 - LOG_INFO "检查软件包 $PACKAGE_NAME 是否已安装" - if rpm -q "$PACKAGE_NAME" &>/dev/null; then - LOG_INFO "软件包 $PACKAGE_NAME 已安装,脚本结束后将保持安装状态" - INSTALLED_BEFORE="yes" - else - LOG_INFO "软件包 $PACKAGE_NAME 未安装,将在测试过程中安装并在结束后卸载" - INSTALLED_BEFORE="no" - fi - - # 步骤3:安装软件包(如果未安装) - if [ "$INSTALLED_BEFORE" = "no" ]; then - LOG_INFO "安装软件包 $PACKAGE_NAME" - dnf install -y "$PACKAGE_NAME" - CHECK_RESULT $? 0 0 "安装软件包 $PACKAGE_NAME 失败" - fi - - # 步骤4:检查pdftexi2dvi命令是否存在 - LOG_INFO "检查pdftexi2dvi命令是否存在" - if ! command -v pdftexi2dvi &>/dev/null; then - LOG_ERROR "pdftexi2dvi命令未找到" - if [ "$INSTALLED_BEFORE" = "no" ]; then - dnf remove -y "$PACKAGE_NAME" - fi - exit 255 - fi - - # 步骤5:检查--output选项是否支持 - LOG_INFO "检查pdftexi2dvi命令是否支持--output选项" - if ! pdftexi2dvi --help 2>&1 | grep -q -- "--output"; then - LOG_ERROR "pdftexi2dvi命令不支持--output选项" - if [ "$INSTALLED_BEFORE" = "no" ]; then - dnf remove -y "$PACKAGE_NAME" - fi - exit 255 - fi - - # 步骤6:创建测试用的texinfo文件 - LOG_INFO "创建测试用的texinfo文件" - cat > test.texinfo << "EOF" - \input texinfo - @setfilename test.info - @settitle Test Document - @bye - EOF - CHECK_RESULT $? 0 0 "创建test.texinfo文件失败" - - # 步骤7:使用--output选项运行pdftexi2dvi命令 - LOG_INFO "使用--output选项运行pdftexi2dvi命令" - pdftexi2dvi --output=test_output.pdf test.texinfo - CHECK_RESULT $? 0 0 "pdftexi2dvi命令执行失败" - - # 步骤8:检查输出文件是否生成 - LOG_INFO "检查输出文件test_output.pdf是否生成" - if [ -f "test_output.pdf" ]; then - LOG_INFO "输出文件test_output.pdf已成功生成" - else - LOG_ERROR "输出文件test_output.pdf未生成" - CHECK_RESULT 1 0 0 "输出文件未生成" - fi - - # 步骤9:清理临时文件 - LOG_INFO "清理临时文件" - rm -f test.texinfo test_output.pdf - - # 步骤10:卸载软件包(如果之前未安装) - if [ "$INSTALLED_BEFORE" = "no" ]; then - LOG_INFO "卸载软件包 $PACKAGE_NAME" - dnf remove -y "$PACKAGE_NAME" - CHECK_RESULT $? 0 0 "卸载软件包 $PACKAGE_NAME 失败" - fi - - LOG_INFO "测试完成" -} - -main "$@" \ No newline at end of file diff --git a/testcases/function_test/pkg_test/texinfo/texinfo-tex/test_texinfo-tex_pdftexi2dvi_p.sh b/testcases/function_test/pkg_test/texinfo/texinfo-tex/test_texinfo-tex_pdftexi2dvi_p.sh deleted file mode 100644 index c1af156f26c..00000000000 --- a/testcases/function_test/pkg_test/texinfo/texinfo-tex/test_texinfo-tex_pdftexi2dvi_p.sh +++ /dev/null @@ -1,86 +0,0 @@ -#!/usr/bin/bash - -# Copyright (c) 2024 ISCAS .ALL rights reserved. -# This program is licensed under Mulan PSL v2. -# You can use it according to the terms and conditions of the Mulan PSL v2. -# http://license.coscl.org.cn/MulanPSL2 -# THIS PROGRAM IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, -# EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, -# MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. -# See the Mulan PSL v2 for more details. - -# ############################################# -# @Author : honghua -# @Contact : honghua@iscas.ac.cn -# @Date : 2026-01-28 -# @License : Mulan PSL v2 -# @Desc : 测试 pdftexi2dvi 的 --pdf 选项,用于明确指定生成 PDF 输出 -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - # 检查是否已安装texinfo-tex - LOG_INFO "检查texinfo-tex是否已安装" - rpm -q texinfo-tex > /dev/null 2>&1 - if [ $? -eq 0 ]; then - LOG_INFO "texinfo-tex已安装,测试后将保持安装状态" - already_installed=1 - else - LOG_INFO "texinfo-tex未安装,将在测试前安装" - already_installed=0 - fi - - # 检查yum源中是否有texinfo-tex软件包 - LOG_INFO "检查yum源中是否有texinfo-tex软件包" - dnf list available texinfo-tex > /dev/null 2>&1 - CHECK_RESULT $? 0 0 "yum源中未找到texinfo-tex软件包" - - # 如果未安装,则安装texinfo-tex - if [ $already_installed -eq 0 ]; then - LOG_INFO "安装texinfo-tex软件包" - dnf install -y texinfo-tex - CHECK_RESULT $? 0 0 "安装texinfo-tex失败" - fi - - # 创建测试用的texinfo文件 - LOG_INFO "创建测试用的texinfo文件" - cat > test.texinfo << EOF - \input texinfo - @setfilename test - @settitle Test Document - @bye - EOF - CHECK_RESULT $? 0 0 "创建texinfo文件失败" - - # 测试pdftexi2dvi的--pdf选项 - LOG_INFO "测试pdftexi2dvi的--pdf选项" - pdftexi2dvi --pdf test.texinfo > output.log 2>&1 - CHECK_RESULT $? 0 0 "pdftexi2dvi --pdf执行失败" - - # 检查是否生成了PDF文件 - LOG_INFO "检查是否生成了PDF文件" - if [ -f test.pdf ]; then - LOG_INFO "成功生成PDF文件:test.pdf" - else - LOG_ERROR "未生成PDF文件" - exit 1 - fi - - # 清理测试文件 - LOG_INFO "清理测试文件" - rm -f test.texinfo test.pdf output.log - - # 如果测试前未安装,则卸载texinfo-tex - if [ $already_installed -eq 0 ]; then - LOG_INFO "卸载texinfo-tex软件包" - dnf remove -y texinfo-tex - CHECK_RESULT $? 0 0 "卸载texinfo-tex失败" - else - LOG_INFO "保持texinfo-tex安装状态" - fi - - LOG_INFO "测试完成" -} - -main "$@" \ No newline at end of file diff --git a/testcases/function_test/pkg_test/texinfo/texinfo-tex/test_texinfo-tex_pdftexi2dvi_ps.sh b/testcases/function_test/pkg_test/texinfo/texinfo-tex/test_texinfo-tex_pdftexi2dvi_ps.sh deleted file mode 100644 index 0c3e65f0ceb..00000000000 --- a/testcases/function_test/pkg_test/texinfo/texinfo-tex/test_texinfo-tex_pdftexi2dvi_ps.sh +++ /dev/null @@ -1,93 +0,0 @@ -#!/usr/bin/bash - -# Copyright (c) 2024 ISCAS .ALL rights reserved. -# This program is licensed under Mulan PSL v2. -# You can use it according to the terms and conditions of the Mulan PSL v2. -# http://license.coscl.org.cn/MulanPSL2 -# THIS PROGRAM IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, -# EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, -# MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. -# See the Mulan PSL v2 for more details. - -# ############################################# -# @Author : honghua -# @Contact : honghua@iscas.ac.cn -# @Date : 2026-03-12 -# @License : Mulan PSL v2 -# @Desc : 测试pdftexi2dvi命令的--ps参数,用于通过DVI生成PostScript文件 -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - # 检查环境是否已安装texinfo-tex包 - LOG_INFO "检查texinfo-tex是否已安装" - rpm -q texinfo-tex - if [ $? -eq 0 ]; then - LOG_INFO "texinfo-tex已安装,测试完成后保持安装状态" - INSTALLED="true" - else - LOG_INFO "texinfo-tex未安装,将在测试中安装" - INSTALLED="false" - fi - - # 检查yum源中是否有texinfo-tex包 - LOG_INFO "检查yum源中是否有texinfo-tex包" - dnf list available texinfo-tex 2>/dev/null | grep -q texinfo-tex - if [ $? -ne 0 ]; then - LOG_ERROR "yum源中未找到texinfo-tex包" - exit 255 - fi - - # 如果未安装,则安装texinfo-tex - if [ "$INSTALLED" = "false" ]; then - LOG_INFO "安装texinfo-tex包" - dnf install -y texinfo-tex - CHECK_RESULT $? 0 0 "安装texinfo-tex失败" - fi - - # 创建测试用的texinfo源文件 - LOG_INFO "创建测试用的texinfo源文件test.texinfo" - cat > test.texinfo << EOF - \input texinfo - @setfilename test - @settitle Test Document - @titlepage - @title Test Document - @end titlepage - @bye - EOF - CHECK_RESULT $? 0 0 "创建test.texinfo文件失败" - - # 测试pdftexi2dvi命令的--ps参数 - LOG_INFO "测试pdftexi2dvi命令的--ps参数,生成PostScript文件" - pdftexi2dvi --ps test.texinfo - CHECK_RESULT $? 0 0 "pdftexi2dvi --ps命令执行失败" - - # 检查生成的PostScript文件 - LOG_INFO "检查是否生成了PostScript文件" - if [ -f test.ps ]; then - LOG_INFO "成功生成PostScript文件: test.ps" - file test.ps | grep -q "PostScript" - CHECK_RESULT $? 0 0 "生成的文件不是有效的PostScript文件" - else - LOG_ERROR "未生成PostScript文件" - exit 1 - fi - - # 清理测试文件 - LOG_INFO "清理测试文件" - rm -f test.texinfo test.ps test.dvi test.log test.aux test.cp test.fn test.ky test.pg test.toc test.tp test.vr - CHECK_RESULT $? 0 0 "清理测试文件失败" - - # 如果测试前未安装,则卸载texinfo-tex包 - if [ "$INSTALLED" = "false" ]; then - LOG_INFO "卸载texinfo-tex包" - dnf remove -y texinfo-tex - CHECK_RESULT $? 0 0 "卸载texinfo-tex失败" - fi - - LOG_INFO "测试完成,环境已恢复" -} - -main "$@" \ No newline at end of file diff --git a/testcases/function_test/pkg_test/texinfo/texinfo-tex/test_texinfo-tex_pdftexi2dvi_q.sh b/testcases/function_test/pkg_test/texinfo/texinfo-tex/test_texinfo-tex_pdftexi2dvi_q.sh deleted file mode 100644 index 286e2bcf51a..00000000000 --- a/testcases/function_test/pkg_test/texinfo/texinfo-tex/test_texinfo-tex_pdftexi2dvi_q.sh +++ /dev/null @@ -1,81 +0,0 @@ -#!/usr/bin/bash - -# Copyright (c) 2024 ISCAS .ALL rights reserved. -# This program is licensed under Mulan PSL v2. -# You can use it according to the terms and conditions of the Mulan PSL v2. -# http://license.coscl.org.cn/MulanPSL2 -# THIS PROGRAM IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, -# EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, -# MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. -# See the Mulan PSL v2 for more details. - -# ############################################# -# @Author : honghua -# @Contact : honghua@iscas.ac.cn -# @Date : 2026-01-28 -# @License : Mulan PSL v2 -# @Desc : 测试 pdftexi2dvi 的 --quiet 选项,用于抑制正常输出 -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - LOG_INFO "开始测试 pdftexi2dvi 的 --quiet 选项,用于抑制正常输出" - LOG_INFO "步骤1: 检查 texinfo-tex 软件包是否在 yum 源中" - if ! dnf list available texinfo-tex > /dev/null 2>&1; then - LOG_ERROR "texinfo-tex 软件包不在 yum 源中" - exit 255 - fi - - LOG_INFO "步骤2: 检查当前环境是否已安装 texinfo-tex" - if rpm -q texinfo-tex > /dev/null 2>&1; then - LOG_INFO "texinfo-tex 已安装,脚本结束时将保持安装状态" - INSTALLED_BEFORE=true - else - LOG_INFO "texinfo-tex 未安装,将在测试步骤中安装" - INSTALLED_BEFORE=false - fi - - if [ "$INSTALLED_BEFORE" = "false" ]; then - LOG_INFO "步骤3: 安装 texinfo-tex 软件包" - dnf install -y texinfo-tex - CHECK_RESULT $? 0 0 "安装 texinfo-tex 失败" - fi - - LOG_INFO "步骤4: 检查 pdftexi2dvi 命令是否支持 --quiet 参数" - pdftexi2dvi --help 2>&1 | grep -q -- "--quiet" - CHECK_RESULT $? 0 0 "pdftexi2dvi 不支持 --quiet 参数,或参数不存在" - - LOG_INFO "步骤5: 创建测试用的简单 texinfo 文件" - cat > test.texinfo << "EOF" - \input texinfo - @setfilename test.info - @settitle Test Document - @bye - EOF - CHECK_RESULT $? 0 0 "创建 test.texinfo 文件失败" - - LOG_INFO "步骤6: 使用 --quiet 选项运行 pdftexi2dvi,检查是否抑制正常输出" - pdftexi2dvi --quiet test.texinfo 2>&1 | tee output.log - CHECK_RESULT $? 0 0 "pdftexi2dvi 执行失败" - if [ -s output.log ]; then - LOG_ERROR "使用 --quiet 选项后仍有输出,抑制输出功能异常" - exit 1 - else - LOG_INFO "--quiet 选项成功抑制了正常输出" - fi - - LOG_INFO "步骤7: 清理测试生成的文件" - rm -f test.texinfo test.pdf output.log - CHECK_RESULT $? 0 0 "清理测试文件失败" - - if [ "$INSTALLED_BEFORE" = "false" ]; then - LOG_INFO "步骤8: 卸载 texinfo-tex 软件包,恢复环境" - dnf remove -y texinfo-tex - CHECK_RESULT $? 0 0 "卸载 texinfo-tex 失败" - fi - - LOG_INFO "测试完成" -} - -main "$@" \ No newline at end of file diff --git a/testcases/function_test/pkg_test/texinfo/texinfo-tex/test_texinfo-tex_pdftexi2dvi_shell_escape.sh b/testcases/function_test/pkg_test/texinfo/texinfo-tex/test_texinfo-tex_pdftexi2dvi_shell_escape.sh deleted file mode 100644 index 16121911746..00000000000 --- a/testcases/function_test/pkg_test/texinfo/texinfo-tex/test_texinfo-tex_pdftexi2dvi_shell_escape.sh +++ /dev/null @@ -1,96 +0,0 @@ -#!/usr/bin/bash - -# Copyright (c) 2024 ISCAS .ALL rights reserved. -# This program is licensed under Mulan PSL v2. -# You can use it according to the terms and conditions of the Mulan PSL v2. -# http://license.coscl.org.cn/MulanPSL2 -# THIS PROGRAM IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, -# EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, -# MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. -# See the Mulan PSL v2 for more details. - -# ############################################# -# @Author : honghua -# @Contact : honghua@iscas.ac.cn -# @Date : 2026-03-12 -# @License : Mulan PSL v2 -# @Desc : 测试pdftexi2dvi命令的--shell-escape参数,用于向TeX传递--shell-escape选项 -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - # 检查是否已安装texinfo-tex - LOG_INFO "检查是否已安装texinfo-tex" - rpm -q texinfo-tex > /dev/null 2>&1 - if [ $? -eq 0 ]; then - LOG_INFO "texinfo-tex已安装,测试结束后将保持安装状态" - INSTALLED=1 - else - LOG_INFO "texinfo-tex未安装,将在测试前安装" - INSTALLED=0 - fi - - # 检查yum源中是否有texinfo-tex软件包 - LOG_INFO "检查yum源中是否有texinfo-tex软件包" - dnf list available texinfo-tex > /dev/null 2>&1 - if [ $? -ne 0 ]; then - LOG_ERROR "yum源中未找到texinfo-tex软件包" - exit 255 - fi - - # 如果未安装,则安装texinfo-tex - if [ ${INSTALLED} -eq 0 ]; then - LOG_INFO "安装texinfo-tex软件包" - dnf install -y texinfo-tex - CHECK_RESULT $? 0 0 "安装texinfo-tex失败" - fi - - # 检查pdftexi2dvi命令是否支持--shell-escape参数 - LOG_INFO "检查pdftexi2dvi命令是否支持--shell-escape参数" - pdftexi2dvi --help 2>&1 | grep -q -- "--shell-escape" - if [ $? -ne 0 ]; then - LOG_ERROR "pdftexi2dvi命令不支持--shell-escape参数" - if [ ${INSTALLED} -eq 0 ]; then - LOG_INFO "卸载texinfo-tex软件包" - dnf remove -y texinfo-tex - fi - exit 255 - fi - - # 创建测试用的简单tex文件 - LOG_INFO "创建测试用的简单tex文件" - cat > test.tex << "EOF" - \documentclass{article} - \begin{document} - Hello, world! - \end{document} - EOF - CHECK_RESULT $? 0 0 "创建测试tex文件失败" - - # 测试pdftexi2dvi命令的--shell-escape参数 - LOG_INFO "测试pdftexi2dvi命令的--shell-escape参数" - pdftexi2dvi --shell-escape test.tex > /dev/null 2>&1 - CHECK_RESULT $? 0 0 "pdftexi2dvi --shell-escape执行失败" - - # 检查是否生成了pdf文件 - LOG_INFO "检查是否生成了pdf文件" - [ -f test.pdf ] - CHECK_RESULT $? 0 0 "未生成pdf文件" - - # 清理测试文件 - LOG_INFO "清理测试文件" - rm -f test.tex test.pdf test.aux test.log test.toc - CHECK_RESULT $? 0 0 "清理测试文件失败" - - # 如果测试前未安装,则卸载texinfo-tex - if [ ${INSTALLED} -eq 0 ]; then - LOG_INFO "卸载texinfo-tex软件包" - dnf remove -y texinfo-tex - CHECK_RESULT $? 0 0 "卸载texinfo-tex失败" - fi - - LOG_INFO "测试完成" -} - -main "$@" \ No newline at end of file diff --git a/testcases/function_test/pkg_test/texinfo/texinfo-tex/test_texinfo-tex_pdftexi2dvi_src_specials.sh b/testcases/function_test/pkg_test/texinfo/texinfo-tex/test_texinfo-tex_pdftexi2dvi_src_specials.sh deleted file mode 100644 index e8b26d4e5c7..00000000000 --- a/testcases/function_test/pkg_test/texinfo/texinfo-tex/test_texinfo-tex_pdftexi2dvi_src_specials.sh +++ /dev/null @@ -1,106 +0,0 @@ -#!/usr/bin/bash - -# Copyright (c) 2024 ISCAS .ALL rights reserved. -# This program is licensed under Mulan PSL v2. -# You can use it according to the terms and conditions of the Mulan PSL v2. -# http://license.coscl.org.cn/MulanPSL2 -# THIS PROGRAM IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, -# EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, -# MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. -# See the Mulan PSL v2 for more details. - -# ############################################# -# @Author : honghua -# @Contact : honghua@iscas.ac.cn -# @Date : 2026-03-12 -# @License : Mulan PSL v2 -# @Desc : 测试pdftexi2dvi命令的--src-specials参数,用于向TeX传递--src-specials选项 -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - # 定义软件包名称 - PACKAGE_NAME="texinfo-tex" - - # 检查软件包是否已在yum源中 - LOG_INFO "检查yum源中是否存在$PACKAGE_NAME软件包" - dnf list available $PACKAGE_NAME &>/dev/null - if [ $? -ne 0 ]; then - LOG_ERROR "yum源中不存在$PACKAGE_NAME软件包" - exit 255 - fi - - # 检查软件包是否已安装 - LOG_INFO "检查$PACKAGE_NAME软件包是否已安装" - if rpm -q $PACKAGE_NAME &>/dev/null; then - LOG_INFO "$PACKAGE_NAME软件包已安装,测试结束后将保持安装状态" - INSTALLED_BEFORE_TEST=true - else - LOG_INFO "$PACKAGE_NAME软件包未安装,将在测试前安装" - INSTALLED_BEFORE_TEST=false - fi - - # 如果未安装,则安装软件包 - if [ "$INSTALLED_BEFORE_TEST" = "false" ]; then - LOG_INFO "安装$PACKAGE_NAME软件包" - dnf install -y $PACKAGE_NAME - CHECK_RESULT $? 0 0 "安装$PACKAGE_NAME软件包失败" - fi - - # 检查pdftexi2dvi命令是否存在 - LOG_INFO "检查pdftexi2dvi命令是否存在" - which pdftexi2dvi &>/dev/null - CHECK_RESULT $? 0 0 "pdftexi2dvi命令不存在" - - # 检查--src-specials参数是否支持 - LOG_INFO "检查pdftexi2dvi命令是否支持--src-specials参数" - pdftexi2dvi --help 2>&1 | grep -q "\-\-src\-specials" - if [ $? -ne 0 ]; then - LOG_ERROR "pdftexi2dvi命令不支持--src-specials参数" - exit 255 - fi - - # 创建测试用的简单TeX文件 - LOG_INFO "创建测试用的简单TeX文件" - cat > test.tex << "EOF" - \documentclass{article} - \begin{document} - Test document for pdftexi2dvi --src-specials. - \end{document} - EOF - CHECK_RESULT $? 0 0 "创建测试TeX文件失败" - - # 测试pdftexi2dvi命令的--src-specials参数 - LOG_INFO "测试pdftexi2dvi命令的--src-specials参数" - pdftexi2dvi --src-specials test.tex 2>&1 - CHECK_RESULT $? 0 0 "pdftexi2dvi命令执行失败" - - # 检查是否生成了PDF文件 - LOG_INFO "检查是否生成了PDF文件" - if [ -f "test.pdf" ]; then - LOG_INFO "成功生成PDF文件:test.pdf" - else - LOG_ERROR "未生成PDF文件" - exit 1 - fi - - # 清理测试文件 - LOG_INFO "清理测试文件" - rm -f test.tex test.pdf test.aux test.log test.out - CHECK_RESULT $? 0 0 "清理测试文件失败" - - # 如果测试前未安装软件包,则在测试后卸载 - if [ "$INSTALLED_BEFORE_TEST" = "false" ]; then - LOG_INFO "卸载$PACKAGE_NAME软件包" - dnf remove -y $PACKAGE_NAME - CHECK_RESULT $? 0 0 "卸载$PACKAGE_NAME软件包失败" - LOG_INFO "环境已恢复到测试前的状态" - else - LOG_INFO "保持$PACKAGE_NAME软件包的安装状态" - fi - - LOG_INFO "测试脚本执行完成" -} - -main "$@" \ No newline at end of file diff --git a/testcases/function_test/pkg_test/texinfo/texinfo-tex/test_texinfo-tex_pdftexi2dvi_t.sh b/testcases/function_test/pkg_test/texinfo/texinfo-tex/test_texinfo-tex_pdftexi2dvi_t.sh deleted file mode 100644 index 85e03c678e1..00000000000 --- a/testcases/function_test/pkg_test/texinfo/texinfo-tex/test_texinfo-tex_pdftexi2dvi_t.sh +++ /dev/null @@ -1,102 +0,0 @@ -#!/usr/bin/bash - -# Copyright (c) 2024 ISCAS .ALL rights reserved. -# This program is licensed under Mulan PSL v2. -# You can use it according to the terms and conditions of the Mulan PSL v2. -# http://license.coscl.org.cn/MulanPSL2 -# THIS PROGRAM IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, -# EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, -# MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. -# See the Mulan PSL v2 for more details. - -# ############################################# -# @Author : honghua -# @Contact : honghua@iscas.ac.cn -# @Date : 2026-03-12 -# @License : Mulan PSL v2 -# @Desc : 测试pdftexi2dvi命令的-t参数,用于在输入文件副本中插入指定命令 -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - LOG_INFO "开始测试pdftexi2dvi命令的-t参数功能" - - LOG_INFO "1. 检查是否已安装texinfo-tex软件包" - if dnf list installed texinfo-tex &>/dev/null; then - LOG_INFO "texinfo-tex已安装,测试后保持安装状态" - INSTALLED_BEFORE=true - else - LOG_INFO "texinfo-tex未安装,将进行安装测试" - INSTALLED_BEFORE=false - fi - - LOG_INFO "2. 检查yum源中是否有texinfo-tex软件包" - if ! dnf list available texinfo-tex &>/dev/null; then - LOG_ERROR "yum源中未找到texinfo-tex软件包" - exit 255 - fi - - if [ "$INSTALLED_BEFORE" = "false" ]; then - LOG_INFO "3. 安装texinfo-tex软件包" - dnf install -y texinfo-tex - CHECK_RESULT $? 0 0 "安装texinfo-tex失败" - fi - - LOG_INFO "4. 创建测试用的texinfo文件" - TEST_TEX="test_pdftexi2dvi.tex" - cat > "$TEST_TEX" << "EOF" - \documentclass{article} - \begin{document} - Test document for pdftexi2dvi -t parameter. - \end{document} - EOF - CHECK_RESULT $? 0 0 "创建测试tex文件失败" - - LOG_INFO "5. 测试pdftexi2dvi命令的-t参数" - LOG_INFO "5.1 测试有效参数" - pdftexi2dvi -t "TestCommand" "$TEST_TEX" 2>&1 - CHECK_RESULT $? 0 0 "pdftexi2dvi -t 命令执行失败" - - LOG_INFO "5.2 测试无效参数(应失败)" - pdftexi2dvi --invalid-param "$TEST_TEX" 2>&1 - if [ $? -eq 255 ]; then - LOG_INFO "无效参数检查通过,命令按预期失败" - else - LOG_ERROR "无效参数检查失败" - exit 255 - fi - - LOG_INFO "6. 验证-t参数功能" - LOG_INFO "检查生成的PDF文件" - if [ -f "test_pdftexi2dvi.pdf" ]; then - LOG_INFO "PDF文件生成成功" - # 检查-t参数是否生效(这里简化检查,实际可能需要检查PDF内容) - if grep -q "TestCommand" "$TEST_TEX" 2>/dev/null; then - LOG_INFO "-t参数功能验证成功" - else - LOG_ERROR "-t参数功能验证失败" - exit 1 - fi - else - LOG_ERROR "PDF文件未生成" - exit 1 - fi - - LOG_INFO "7. 清理测试文件" - rm -f "$TEST_TEX" "test_pdftexi2dvi.pdf" "test_pdftexi2dvi.aux" "test_pdftexi2dvi.log" 2>/dev/null - CHECK_RESULT $? 0 0 "清理测试文件失败" - - LOG_INFO "8. 环境恢复" - if [ "$INSTALLED_BEFORE" = "false" ]; then - LOG_INFO "卸载测试安装的texinfo-tex软件包" - dnf remove -y texinfo-tex - CHECK_RESULT $? 0 0 "卸载texinfo-tex失败" - else - LOG_INFO "保持原有的texinfo-tex安装状态" - fi - - LOG_INFO "测试完成" -} - -main "$@" \ No newline at end of file diff --git a/testcases/function_test/pkg_test/texinfo/texinfo-tex/test_texinfo-tex_pdftexi2dvi_tidy.sh b/testcases/function_test/pkg_test/texinfo/texinfo-tex/test_texinfo-tex_pdftexi2dvi_tidy.sh deleted file mode 100644 index d8b549e9ff8..00000000000 --- a/testcases/function_test/pkg_test/texinfo/texinfo-tex/test_texinfo-tex_pdftexi2dvi_tidy.sh +++ /dev/null @@ -1,114 +0,0 @@ -#!/usr/bin/bash - -# Copyright (c) 2024 ISCAS .ALL rights reserved. -# This program is licensed under Mulan PSL v2. -# You can use it according to the terms and conditions of the Mulan PSL v2. -# http://license.coscl.org.cn/MulanPSL2 -# THIS PROGRAM IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, -# EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, -# MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. -# See the Mulan PSL v2 for more details. - -# ############################################# -# @Author : honghua -# @Contact : honghua@iscas.ac.cn -# @Date : 2026-01-28 -# @License : Mulan PSL v2 -# @Desc : 测试 pdftexi2dvi 的 --tidy 选项,用于在独立目录中进行编译并保留辅助文件 -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - # 判断是否已安装texinfo-tex - LOG_INFO "检查是否已安装texinfo-tex软件包" - rpm -q texinfo-tex - if [ $? -eq 0 ]; then - LOG_INFO "texinfo-tex已安装,标记为保持安装状态" - INSTALLED="yes" - else - LOG_INFO "texinfo-tex未安装,将在测试中安装" - INSTALLED="no" - fi - - # 检查yum源中是否有texinfo-tex - LOG_INFO "检查yum源中是否存在texinfo-tex软件包" - dnf list available texinfo-tex > /dev/null 2>&1 - CHECK_RESULT $? 0 0 "yum源中未找到texinfo-tex软件包" - if [ $? -ne 0 ]; then - LOG_ERROR "yum源中不存在texinfo-tex软件包,退出" - exit 255 - fi - - # 如果未安装,则安装texinfo-tex - if [ "${INSTALLED}" = "no" ]; then - LOG_INFO "开始安装texinfo-tex软件包" - dnf install -y texinfo-tex - CHECK_RESULT $? 0 0 "安装texinfo-tex失败" - fi - - # 检查pdftexi2dvi命令是否存在 - LOG_INFO "检查pdftexi2dvi命令是否存在" - command -v pdftexi2dvi - CHECK_RESULT $? 0 0 "pdftexi2dvi命令不存在" - - # 检查pdftexi2dvi是否支持--tidy选项 - LOG_INFO "检查pdftexi2dvi是否支持--tidy选项" - pdftexi2dvi --help 2>&1 | grep -q "\-\-tidy" - CHECK_RESULT $? 0 0 "pdftexi2dvi不支持--tidy选项" - if [ $? -ne 0 ]; then - LOG_ERROR "pdftexi2dvi不支持--tidy选项,退出" - exit 255 - fi - - # 创建测试用的texinfo源文件 - LOG_INFO "创建测试用的texinfo源文件" - cat > test.texinfo << "EOF" - \input texinfo - @setfilename test.info - @settitle Test Document - @bye - EOF - CHECK_RESULT $? 0 0 "创建texinfo源文件失败" - - # 使用pdftexi2dvi的--tidy选项编译 - LOG_INFO "使用pdftexi2dvi的--tidy选项编译texinfo文件" - pdftexi2dvi --tidy test.texinfo - CHECK_RESULT $? 0 0 "pdftexi2dvi --tidy编译失败" - - # 检查是否生成了独立的编译目录 - LOG_INFO "检查是否生成了独立的编译目录" - if [ -d "test.t2d" ]; then - LOG_INFO "成功创建独立编译目录test.t2d" - # 检查辅助文件是否保留在独立目录中 - LOG_INFO "检查辅助文件是否保留在独立目录中" - if [ -f "test.t2d/test.aux" ] || [ -f "test.t2d/test.log" ]; then - LOG_INFO "辅助文件已保留在独立目录中" - else - LOG_ERROR "辅助文件未在独立目录中找到" - CHECK_RESULT 1 0 0 "辅助文件检查失败" - fi - else - LOG_ERROR "未创建独立编译目录test.t2d" - CHECK_RESULT 1 0 0 "独立目录检查失败" - fi - - # 清理测试文件 - LOG_INFO "清理测试生成的文件" - rm -f test.texinfo test.pdf test.info - rm -rf test.t2d - CHECK_RESULT $? 0 0 "清理测试文件失败" - - # 如果测试前未安装,则卸载texinfo-tex - if [ "${INSTALLED}" = "no" ]; then - LOG_INFO "卸载texinfo-tex软件包" - dnf remove -y texinfo-tex - CHECK_RESULT $? 0 0 "卸载texinfo-tex失败" - else - LOG_INFO "保持texinfo-tex软件包安装状态" - fi - - LOG_INFO "测试完成" -} - -main "$@" \ No newline at end of file diff --git a/testcases/function_test/pkg_test/texinfo/texinfo-tex/test_texinfo-tex_pdftexi2dvi_translate_file.sh b/testcases/function_test/pkg_test/texinfo/texinfo-tex/test_texinfo-tex_pdftexi2dvi_translate_file.sh deleted file mode 100644 index a8a221f9811..00000000000 --- a/testcases/function_test/pkg_test/texinfo/texinfo-tex/test_texinfo-tex_pdftexi2dvi_translate_file.sh +++ /dev/null @@ -1,99 +0,0 @@ -#!/usr/bin/bash - -# Copyright (c) 2024 ISCAS .ALL rights reserved. -# This program is licensed under Mulan PSL v2. -# You can use it according to the terms and conditions of the Mulan PSL v2. -# http://license.coscl.org.cn/MulanPSL2 -# THIS PROGRAM IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, -# EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, -# MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. -# See the Mulan PSL v2 for more details. - -# ############################################# -# @Author : honghua -# @Contact : honghua@iscas.ac.cn -# @Date : 2026-03-12 -# @License : Mulan PSL v2 -# @Desc : 测试pdftexi2dvi命令的--translate-file参数,用于为TeX指定字符集转换文件 -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - LOG_INFO "开始测试pdftexi2dvi命令的--translate-file参数功能" - - LOG_INFO "步骤1:检查texinfo-tex软件包是否已在系统中安装" - if rpm -q texinfo-tex &> /dev/null; then - LOG_INFO "texinfo-tex软件包已安装,测试结束后将保持安装状态" - INSTALLED=true - else - LOG_INFO "texinfo-tex软件包未安装,将在测试过程中安装" - INSTALLED=false - fi - - LOG_INFO "步骤2:检查yum源中是否存在texinfo-tex软件包" - if ! dnf list available texinfo-tex &> /dev/null; then - LOG_ERROR "yum源中未找到texinfo-tex软件包" - exit 255 - fi - - if [ "$INSTALLED" = "false" ]; then - LOG_INFO "步骤3:安装texinfo-tex软件包" - dnf install -y texinfo-tex - CHECK_RESULT $? 0 0 "安装texinfo-tex软件包失败" - fi - - LOG_INFO "步骤4:检查pdftexi2dvi命令是否支持--translate-file参数" - pdftexi2dvi --help 2>&1 | grep -q "\-\-translate-file" - if [ $? -ne 0 ]; then - LOG_ERROR "pdftexi2dvi命令不支持--translate-file参数" - if [ "$INSTALLED" = "false" ]; then - LOG_INFO "清理环境:卸载之前安装的texinfo-tex软件包" - dnf remove -y texinfo-tex - fi - exit 255 - fi - - LOG_INFO "步骤5:创建测试用的Texinfo源文件" - cat > test.texinfo << "EOF" - \input texinfo - @setfilename test.info - @settitle Test Document - @bye - EOF - CHECK_RESULT $? 0 0 "创建Texinfo源文件失败" - - LOG_INFO "步骤6:创建测试用的字符集转换文件" - cat > test.translate << "EOF" - % 这是一个空的转换文件,仅用于测试 - EOF - CHECK_RESULT $? 0 0 "创建字符集转换文件失败" - - LOG_INFO "步骤7:使用pdftexi2dvi命令并指定--translate-file参数进行测试" - pdftexi2dvi --translate-file=test.translate test.texinfo - CHECK_RESULT $? 0 0 "pdftexi2dvi命令执行失败" - - LOG_INFO "步骤8:验证生成的PDF文件" - if [ -f test.pdf ]; then - LOG_INFO "成功生成PDF文件:test.pdf" - file test.pdf | grep -q "PDF document" - CHECK_RESULT $? 0 0 "生成的PDF文件格式不正确" - else - LOG_ERROR "未生成预期的PDF文件" - CHECK_RESULT 1 0 0 "PDF文件生成失败" - fi - - LOG_INFO "步骤9:清理测试文件" - rm -f test.texinfo test.translate test.pdf test.aux test.cp test.cps test.fn test.fns test.ky test.log test.pg test.toc test.tp test.vr - CHECK_RESULT $? 0 0 "清理测试文件失败" - - if [ "$INSTALLED" = "false" ]; then - LOG_INFO "步骤10:卸载texinfo-tex软件包" - dnf remove -y texinfo-tex - CHECK_RESULT $? 0 0 "卸载texinfo-tex软件包失败" - fi - - LOG_INFO "测试完成" -} - -main "$@" \ No newline at end of file diff --git a/testcases/function_test/pkg_test/texinfo/texinfo-tex/test_texinfo-tex_pdftexi2dvi_upper_d.sh b/testcases/function_test/pkg_test/texinfo/texinfo-tex/test_texinfo-tex_pdftexi2dvi_upper_d.sh deleted file mode 100644 index ed9119360d0..00000000000 --- a/testcases/function_test/pkg_test/texinfo/texinfo-tex/test_texinfo-tex_pdftexi2dvi_upper_d.sh +++ /dev/null @@ -1,99 +0,0 @@ -#!/usr/bin/bash - -# Copyright (c) 2024 ISCAS .ALL rights reserved. -# This program is licensed under Mulan PSL v2. -# You can use it according to the terms and conditions of the Mulan PSL v2. -# http://license.coscl.org.cn/MulanPSL2 -# THIS PROGRAM IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, -# EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, -# MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. -# See the Mulan PSL v2 for more details. - -# ############################################# -# @Author : honghua -# @Contact : honghua@iscas.ac.cn -# @Date : 2026-03-12 -# @License : Mulan PSL v2 -# @Desc : 测试pdftexi2dvi命令的-D参数,用于开启shell调试模式 -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - LOG_INFO "开始测试pdftexi2dvi命令的-D参数,用于开启shell调试模式" - - # 检查是否已经安装了texinfo-tex软件包 - LOG_INFO "检查texinfo-tex软件包是否已安装" - if rpm -q texinfo-tex &> /dev/null; then - LOG_INFO "texinfo-tex软件包已安装,测试结束后将保持安装状态" - installed=true - else - LOG_INFO "texinfo-tex软件包未安装,将在测试前安装" - installed=false - fi - - # 检查yum源中是否有texinfo-tex软件包 - LOG_INFO "检查yum源中是否有texinfo-tex软件包" - if ! dnf list available texinfo-tex &> /dev/null; then - LOG_ERROR "yum源中未找到texinfo-tex软件包" - exit 255 - fi - - # 如果未安装,则安装软件包 - if [ "$installed" = false ]; then - LOG_INFO "安装texinfo-tex软件包" - dnf install -y texinfo-tex - CHECK_RESULT $? 0 0 "安装texinfo-tex软件包失败" - fi - - # 检查pdftexi2dvi命令是否存在 - LOG_INFO "检查pdftexi2dvi命令是否存在" - if ! command -v pdftexi2dvi &> /dev/null; then - LOG_ERROR "pdftexi2dvi命令不存在" - if [ "$installed" = false ]; then - dnf remove -y texinfo-tex - fi - exit 255 - fi - - # 检查pdftexi2dvi命令是否支持-D参数 - LOG_INFO "检查pdftexi2dvi命令是否支持-D参数" - if ! pdftexi2dvi --help 2>&1 | grep -q -- "-D"; then - LOG_ERROR "pdftexi2dvi命令不支持-D参数" - if [ "$installed" = false ]; then - dnf remove -y texinfo-tex - fi - exit 255 - fi - - # 创建一个简单的texinfo文件用于测试 - LOG_INFO "创建测试用的texinfo文件" - cat > test.texinfo << "EOF" - \input texinfo - @setfilename test.info - @settitle Test Document - @bye - EOF - CHECK_RESULT $? 0 0 "创建texinfo文件失败" - - # 使用-D参数执行pdftexi2dvi命令 - LOG_INFO "执行pdftexi2dvi命令,开启shell调试模式" - pdftexi2dvi -D test.texinfo - CHECK_RESULT $? 0 0 "pdftexi2dvi命令执行失败" - - # 清理测试文件 - LOG_INFO "清理测试文件" - rm -f test.texinfo test.pdf test.log test.aux test.toc - CHECK_RESULT $? 0 0 "清理测试文件失败" - - # 如果测试前未安装,则卸载软件包 - if [ "$installed" = false ]; then - LOG_INFO "卸载texinfo-tex软件包" - dnf remove -y texinfo-tex - CHECK_RESULT $? 0 0 "卸载texinfo-tex软件包失败" - fi - - LOG_INFO "测试完成" -} - -main "$@" \ No newline at end of file diff --git a/testcases/function_test/pkg_test/texinfo/texinfo-tex/test_texinfo-tex_pdftexi2dvi_upper_e.sh b/testcases/function_test/pkg_test/texinfo/texinfo-tex/test_texinfo-tex_pdftexi2dvi_upper_e.sh deleted file mode 100644 index 2c72a593805..00000000000 --- a/testcases/function_test/pkg_test/texinfo/texinfo-tex/test_texinfo-tex_pdftexi2dvi_upper_e.sh +++ /dev/null @@ -1,89 +0,0 @@ -#!/usr/bin/bash - -# Copyright (c) 2024 ISCAS .ALL rights reserved. -# This program is licensed under Mulan PSL v2. -# You can use it according to the terms and conditions of the Mulan PSL v2. -# http://license.coscl.org.cn/MulanPSL2 -# THIS PROGRAM IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, -# EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, -# MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. -# See the Mulan PSL v2 for more details. - -# ############################################# -# @Author : honghua -# @Contact : honghua@iscas.ac.cn -# @Date : 2026-03-12 -# @License : Mulan PSL v2 -# @Desc : 测试pdftexi2dvi命令的-E参数,用于使用makeinfo进行宏展开 -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - LOG_INFO "1. 检查yum源中是否存在texinfo-tex软件包" - dnf list available texinfo-tex > /dev/null 2>&1 - if [ $? -ne 0 ]; then - LOG_ERROR "yum源中未找到texinfo-tex软件包" - exit 255 - fi - - LOG_INFO "2. 检查当前是否已安装texinfo-tex软件包" - rpm -q texinfo-tex > /dev/null 2>&1 - if [ $? -eq 0 ]; then - LOG_INFO "texinfo-tex软件包已安装,脚本结束后将保持安装状态" - INSTALLED=true - else - LOG_INFO "texinfo-tex软件包未安装,将在测试步骤中安装" - INSTALLED=false - fi - - if [ "$INSTALLED" = "false" ]; then - LOG_INFO "3. 安装texinfo-tex软件包" - dnf install -y texinfo-tex - CHECK_RESULT $? 0 0 "安装texinfo-tex软件包失败" - fi - - LOG_INFO "4. 检查pdftexi2dvi命令是否支持-E参数" - pdftexi2dvi --help 2>&1 | grep -q -- "-E" - if [ $? -ne 0 ]; then - LOG_ERROR "pdftexi2dvi命令不支持-E参数" - if [ "$INSTALLED" = "false" ]; then - LOG_INFO "清理环境:卸载texinfo-tex软件包" - dnf remove -y texinfo-tex - fi - exit 255 - fi - - LOG_INFO "5. 创建一个简单的texinfo测试文件" - cat > test.texinfo << "EOF" - \input texinfo - @setfilename test.info - @settitle Test Document - @node Top - @top Test Document - This is a test document. - @bye - EOF - CHECK_RESULT $? 0 0 "创建texinfo测试文件失败" - - LOG_INFO "6. 使用pdftexi2dvi命令的-E参数进行宏展开测试" - pdftexi2dvi -E test.texinfo - CHECK_RESULT $? 0 0 "pdftexi2dvi -E命令执行失败" - - LOG_INFO "7. 检查是否生成了预期的中间文件" - ls test.txi > /dev/null 2>&1 - CHECK_RESULT $? 0 0 "未生成预期的test.txi文件" - - LOG_INFO "8. 清理测试生成的文件" - rm -f test.texinfo test.txi test.aux test.cp test.cps test.fn test.fns test.ky test.log test.op test.pg test.toc test.tp test.vr test.dvi test.pdf test.fls test.out - - if [ "$INSTALLED" = "false" ]; then - LOG_INFO "9. 清理环境:卸载texinfo-tex软件包" - dnf remove -y texinfo-tex - CHECK_RESULT $? 0 0 "卸载texinfo-tex软件包失败" - else - LOG_INFO "9. 环境保持:texinfo-tex软件包保持安装状态" - fi -} - -main "$@" \ No newline at end of file diff --git a/testcases/function_test/pkg_test/texinfo/texinfo-tex/test_texinfo-tex_pdftexi2dvi_upper_i.sh b/testcases/function_test/pkg_test/texinfo/texinfo-tex/test_texinfo-tex_pdftexi2dvi_upper_i.sh deleted file mode 100644 index f6e980915fd..00000000000 --- a/testcases/function_test/pkg_test/texinfo/texinfo-tex/test_texinfo-tex_pdftexi2dvi_upper_i.sh +++ /dev/null @@ -1,103 +0,0 @@ -#!/usr/bin/bash - -# Copyright (c) 2024 ISCAS .ALL rights reserved. -# This program is licensed under Mulan PSL v2. -# You can use it according to the terms and conditions of the Mulan PSL v2. -# http://license.coscl.org.cn/MulanPSL2 -# THIS PROGRAM IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, -# EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, -# MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. -# See the Mulan PSL v2 for more details. - -# ############################################# -# @Author : honghua -# @Contact : honghua@iscas.ac.cn -# @Date : 2026-03-12 -# @License : Mulan PSL v2 -# @Desc : 测试pdftexi2dvi命令的-I参数,用于指定Texinfo文件的搜索目录 -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - LOG_INFO "开始测试pdftexi2dvi命令的-I参数,用于指定Texinfo文件的搜索目录" - LOG_INFO "步骤1:检查系统是否已安装texinfo-tex软件包" - rpm -q texinfo-tex - if [ $? -eq 0 ]; then - LOG_INFO "texinfo-tex软件包已安装,测试完成后将保持安装状态" - INSTALLED=1 - else - LOG_INFO "texinfo-tex软件包未安装,将在测试过程中安装" - INSTALLED=0 - fi - - LOG_INFO "步骤2:检查yum源中是否有texinfo-tex软件包" - dnf list available texinfo-tex 2>/dev/null | grep -q texinfo-tex - if [ $? -ne 0 ]; then - LOG_ERROR "yum源中未找到texinfo-tex软件包" - exit 255 - fi - - if [ $INSTALLED -eq 0 ]; then - LOG_INFO "步骤3:安装texinfo-tex软件包" - dnf install -y texinfo-tex - CHECK_RESULT $? 0 0 "安装texinfo-tex软件包失败" - fi - - LOG_INFO "步骤4:验证pdftexi2dvi命令是否存在" - command -v pdftexi2dvi - CHECK_RESULT $? 0 0 "pdftexi2dvi命令不存在" - - LOG_INFO "步骤5:测试pdftexi2dvi命令的-I参数是否支持" - pdftexi2dvi --help 2>&1 | grep -q -- "-I" - if [ $? -ne 0 ]; then - LOG_ERROR "pdftexi2dvi命令不支持-I参数" - if [ $INSTALLED -eq 0 ]; then - dnf remove -y texinfo-tex - fi - exit 255 - fi - - LOG_INFO "步骤6:创建一个测试用的Texinfo文件" - TEST_DIR=$(mktemp -d) - cd $TEST_DIR - cat > test.texinfo << EOF - \input texinfo - @setfilename test.info - @settitle Test Document - @bye - EOF - CHECK_RESULT $? 0 0 "创建测试Texinfo文件失败" - - LOG_INFO "步骤7:创建一个包含Texinfo文件的搜索目录" - SEARCH_DIR=$(mktemp -d) - cp test.texinfo $SEARCH_DIR/ - - LOG_INFO "步骤8:使用-I参数指定搜索目录执行pdftexi2dvi命令" - pdftexi2dvi -I $SEARCH_DIR test.texinfo - CHECK_RESULT $? 0 0 "pdftexi2dvi命令执行失败" - - LOG_INFO "步骤9:验证生成的PDF文件" - if [ -f test.pdf ]; then - LOG_INFO "成功生成PDF文件" - else - LOG_ERROR "未生成PDF文件" - CHECK_RESULT 1 0 0 "PDF文件生成失败" - fi - - LOG_INFO "步骤10:清理测试文件" - cd / - rm -rf $TEST_DIR $SEARCH_DIR - - if [ $INSTALLED -eq 0 ]; then - LOG_INFO "步骤11:卸载texinfo-tex软件包" - dnf remove -y texinfo-tex - CHECK_RESULT $? 0 0 "卸载texinfo-tex软件包失败" - else - LOG_INFO "步骤11:保持texinfo-tex软件包安装状态" - fi - - LOG_INFO "测试完成" -} - -main "$@" \ No newline at end of file diff --git a/testcases/function_test/pkg_test/texinfo/texinfo-tex/test_texinfo-tex_pdftexi2dvi_upper_v.sh b/testcases/function_test/pkg_test/texinfo/texinfo-tex/test_texinfo-tex_pdftexi2dvi_upper_v.sh deleted file mode 100644 index 167be4fe2fe..00000000000 --- a/testcases/function_test/pkg_test/texinfo/texinfo-tex/test_texinfo-tex_pdftexi2dvi_upper_v.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-01-28 -# @License : Mulan PSL v2 -# @Desc : 测试 pdftexi2dvi 的 --verbose 选项,用于显示详细过程 -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - # 定义软件包名称和命令 - PACKAGE_NAME="texinfo-tex" - COMMAND_NAME="pdftexi2dvi" - OPTION_NAME="--verbose" - TEST_FILE="test_texinfo.tex" - - # 步骤1:检查yum源中是否有texinfo-tex软件包 - LOG_INFO "步骤1:检查yum源中是否有${PACKAGE_NAME}软件包" - dnf list available ${PACKAGE_NAME} &> /dev/null - if [ $? -ne 0 ]; then - LOG_ERROR "yum源中没有找到${PACKAGE_NAME}软件包" - exit 255 - fi - - # 步骤2:检查是否已安装texinfo-tex软件包 - LOG_INFO "步骤2:检查是否已安装${PACKAGE_NAME}软件包" - rpm -q ${PACKAGE_NAME} &> /dev/null - if [ $? -eq 0 ]; then - INSTALLED="true" - LOG_INFO "检测到${PACKAGE_NAME}已安装,脚本结束后将保持安装状态" - else - INSTALLED="false" - LOG_INFO "检测到${PACKAGE_NAME}未安装,将在测试后卸载" - fi - - # 步骤3:如果未安装,则安装软件包 - if [ "${INSTALLED}" = "false" ]; then - LOG_INFO "步骤3:安装${PACKAGE_NAME}软件包" - dnf install -y ${PACKAGE_NAME} &> /dev/null - CHECK_RESULT $? 0 0 "安装${PACKAGE_NAME}软件包失败" - fi - - # 步骤4:检查pdftexi2dvi命令是否存在 - LOG_INFO "步骤4:检查${COMMAND_NAME}命令是否存在" - which ${COMMAND_NAME} &> /dev/null - CHECK_RESULT $? 0 0 "${COMMAND_NAME}命令不存在" - - # 步骤5:检查--verbose选项是否支持 - LOG_INFO "步骤5:检查${COMMAND_NAME}命令是否支持${OPTION_NAME}选项" - ${COMMAND_NAME} --help 2>&1 | grep -q "${OPTION_NAME}" - if [ $? -ne 0 ]; then - LOG_ERROR "${COMMAND_NAME}命令不支持${OPTION_NAME}选项" - exit 255 - fi - - # 步骤6:创建测试用的TeX文件 - LOG_INFO "步骤6:创建测试用的TeX文件" - cat > ${TEST_FILE} << "EOF" - \documentclass{article} - \begin{document} - Hello, OpenEuler! - \end{document} - EOF - CHECK_RESULT $? 0 0 "创建测试TeX文件失败" - - # 步骤7:测试pdftexi2dvi的--verbose选项 - LOG_INFO "步骤7:测试${COMMAND_NAME}的${OPTION_NAME}选项" - ${COMMAND_NAME} ${OPTION_NAME} ${TEST_FILE} &> output.log - CHECK_RESULT $? 0 0 "执行${COMMAND_NAME} ${OPTION_NAME}失败" - - # 步骤8:验证verbose输出 - LOG_INFO "步骤8:验证verbose输出" - grep -i "verbose" output.log &> /dev/null - CHECK_RESULT $? 0 0 "输出中未找到verbose相关信息" - - # 步骤9:验证PDF文件生成 - LOG_INFO "步骤9:验证PDF文件生成" - PDF_FILE="${TEST_FILE%.tex}.pdf" - [ -f "${PDF_FILE}" ] - CHECK_RESULT $? 0 0 "未生成PDF文件" - - # 步骤10:清理测试文件 - LOG_INFO "步骤10:清理测试文件" - rm -f ${TEST_FILE} ${PDF_FILE} output.log - CHECK_RESULT $? 0 0 "清理测试文件失败" - - # 步骤11:如果测试前未安装,则卸载软件包 - if [ "${INSTALLED}" = "false" ]; then - LOG_INFO "步骤11:卸载${PACKAGE_NAME}软件包" - dnf remove -y ${PACKAGE_NAME} &> /dev/null - CHECK_RESULT $? 0 0 "卸载${PACKAGE_NAME}软件包失败" - fi - - LOG_INFO "测试完成" -} - -main "$@" \ No newline at end of file diff --git a/testcases/function_test/pkg_test/texinfo/texinfo-tex/test_texinfo-tex_pdftexi2dvi_v.sh b/testcases/function_test/pkg_test/texinfo/texinfo-tex/test_texinfo-tex_pdftexi2dvi_v.sh deleted file mode 100644 index 2d124f561e4..00000000000 --- a/testcases/function_test/pkg_test/texinfo/texinfo-tex/test_texinfo-tex_pdftexi2dvi_v.sh +++ /dev/null @@ -1,81 +0,0 @@ -#!/usr/bin/bash - -# Copyright (c) 2024 ISCAS .ALL rights reserved. -# This program is licensed under Mulan PSL v2. -# You can use it according to the terms and conditions of the Mulan PSL v2. -# http://license.coscl.org.cn/MulanPSL2 -# THIS PROGRAM IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, -# EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, -# MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. -# See the Mulan PSL v2 for more details. - -# ############################################# -# @Author : honghua -# @Contact : honghua@iscas.ac.cn -# @Date : 2026-01-28 -# @License : Mulan PSL v2 -# @Desc : 测试 pdftexi2dvi 的 --version 选项,用于显示版本信息 -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - LOG_INFO "开始测试 pdftexi2dvi 的 --version 选项,用于显示版本信息" - - # 检查是否已安装 texinfo-tex 软件包 - LOG_INFO "检查 texinfo-tex 软件包是否已安装" - rpm -q texinfo-tex - if [ $? -eq 0 ]; then - LOG_INFO "texinfo-tex 软件包已安装,测试结束后将保持安装状态" - INSTALLED=1 - else - LOG_INFO "texinfo-tex 软件包未安装,将在测试前安装" - INSTALLED=0 - fi - - # 检查 yum 源中是否有 texinfo-tex 软件包 - LOG_INFO "检查 yum 源中是否有 texinfo-tex 软件包" - dnf list available texinfo-tex - if [ $? -ne 0 ]; then - LOG_ERROR "yum 源中未找到 texinfo-tex 软件包" - exit 255 - fi - - # 如果未安装,则安装软件包 - if [ $INSTALLED -eq 0 ]; then - LOG_INFO "安装 texinfo-tex 软件包" - dnf install -y texinfo-tex - CHECK_RESULT $? 0 0 "安装 texinfo-tex 软件包失败" - fi - - # 检查 pdftexi2dvi 命令是否存在 - LOG_INFO "检查 pdftexi2dvi 命令是否存在" - which pdftexi2dvi - CHECK_RESULT $? 0 0 "pdftexi2dvi 命令不存在" - - # 测试 pdftexi2dvi 的 --version 选项 - LOG_INFO "测试 pdftexi2dvi 的 --version 选项" - pdftexi2dvi --version - CHECK_RESULT $? 0 0 "pdftexi2dvi --version 执行失败" - - # 检查 --version 参数是否被支持 - LOG_INFO "检查 --version 参数是否被支持" - pdftexi2dvi --version 2>&1 | grep -q "usage\|Usage" - if [ $? -eq 0 ]; then - LOG_ERROR "--version 参数不被支持" - exit 255 - fi - - # 环境恢复:如果之前未安装,则卸载软件包 - if [ $INSTALLED -eq 0 ]; then - LOG_INFO "卸载 texinfo-tex 软件包" - dnf remove -y texinfo-tex - CHECK_RESULT $? 0 0 "卸载 texinfo-tex 软件包失败" - else - LOG_INFO "保持 texinfo-tex 软件包安装状态" - fi - - LOG_INFO "测试完成" -} - -main "$@" \ No newline at end of file diff --git a/testcases/function_test/pkg_test/texinfo/texinfo-tex/test_texinfo-tex_pdftexi2dvi_verbose_tidy.sh b/testcases/function_test/pkg_test/texinfo/texinfo-tex/test_texinfo-tex_pdftexi2dvi_verbose_tidy.sh deleted file mode 100644 index 7102a0ecb87..00000000000 --- a/testcases/function_test/pkg_test/texinfo/texinfo-tex/test_texinfo-tex_pdftexi2dvi_verbose_tidy.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-01-28 -# @License : Mulan PSL v2 -# @Desc : 测试 pdftexi2dvi 同时使用 --verbose 和 --tidy 选项,用于在整理模式下查看详细过程 -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - # 定义软件包名称 - PACKAGE_NAME="texinfo-tex" - CMD_NAME="pdftexi2dvi" - - # 步骤1: 检查是否已安装软件包 - LOG_INFO "步骤1: 检查是否已安装软件包" - rpm -q $PACKAGE_NAME - if [ $? -eq 0 ]; then - LOG_INFO "软件包 $PACKAGE_NAME 已安装,脚本结束时将保持安装状态" - ALREADY_INSTALLED=1 - else - LOG_INFO "软件包 $PACKAGE_NAME 未安装,将在测试过程中安装并在结束时卸载" - ALREADY_INSTALLED=0 - fi - - # 步骤2: 检查yum源中是否存在软件包 - LOG_INFO "步骤2: 检查yum源中是否存在软件包" - dnf list available $PACKAGE_NAME > /dev/null 2>&1 - if [ $? -ne 0 ]; then - LOG_ERROR "yum源中未找到软件包 $PACKAGE_NAME" - exit 255 - fi - - # 步骤3: 检查pdftexi2dvi命令是否支持--verbose和--tidy参数 - LOG_INFO "步骤3: 检查pdftexi2dvi命令是否支持--verbose和--tidy参数" - if [ $ALREADY_INSTALLED -eq 0 ]; then - dnf install -y $PACKAGE_NAME > /dev/null 2>&1 - CHECK_RESULT $? 0 0 "安装软件包 $PACKAGE_NAME 失败" - fi - - # 检查命令是否存在 - which $CMD_NAME > /dev/null 2>&1 - if [ $? -ne 0 ]; then - LOG_ERROR "命令 $CMD_NAME 不存在" - if [ $ALREADY_INSTALLED -eq 0 ]; then - dnf remove -y $PACKAGE_NAME > /dev/null 2>&1 - fi - exit 255 - fi - - # 检查参数支持 - $CMD_NAME --help 2>&1 | grep -q -- "--verbose" - if [ $? -ne 0 ]; then - LOG_ERROR "命令 $CMD_NAME 不支持 --verbose 参数" - if [ $ALREADY_INSTALLED -eq 0 ]; then - dnf remove -y $PACKAGE_NAME > /dev/null 2>&1 - fi - exit 255 - fi - - $CMD_NAME --help 2>&1 | grep -q -- "--tidy" - if [ $? -ne 0 ]; then - LOG_ERROR "命令 $CMD_NAME 不支持 --tidy 参数" - if [ $ALREADY_INSTALLED -eq 0 ]; then - dnf remove -y $PACKAGE_NAME > /dev/null 2>&1 - fi - exit 255 - fi - - # 步骤4: 创建测试用的简单tex文件 - LOG_INFO "步骤4: 创建测试用的简单tex文件" - TEST_DIR="/tmp/test_texinfo_$$" - mkdir -p $TEST_DIR - cd $TEST_DIR - - cat > test.tex << "EOF" - \documentclass{article} - \begin{document} - Hello, World! - \end{document} - EOF - CHECK_RESULT $? 0 0 "创建测试tex文件失败" - - # 步骤5: 执行pdftexi2dvi命令同时使用--verbose和--tidy选项 - LOG_INFO "步骤5: 执行pdftexi2dvi命令同时使用--verbose和--tidy选项" - $CMD_NAME --verbose --tidy test.tex > output.log 2>&1 - CHECK_RESULT $? 0 0 "pdftexi2dvi命令执行失败" - - # 步骤6: 验证命令输出包含verbose信息 - LOG_INFO "步骤6: 验证命令输出包含verbose信息" - grep -i "verbose" output.log > /dev/null - CHECK_RESULT $? 0 0 "输出中未找到verbose相关信息" - - # 步骤7: 验证生成了正确的输出文件 - LOG_INFO "步骤7: 验证生成了正确的输出文件" - ls test.pdf > /dev/null 2>&1 - CHECK_RESULT $? 0 0 "未生成预期的PDF文件" - - # 步骤8: 清理测试文件 - LOG_INFO "步骤8: 清理测试文件" - cd / - rm -rf $TEST_DIR - CHECK_RESULT $? 0 0 "清理测试文件失败" - - # 步骤9: 恢复环境(如果测试前未安装则卸载软件包) - LOG_INFO "步骤9: 恢复环境" - if [ $ALREADY_INSTALLED -eq 0 ]; then - dnf remove -y $PACKAGE_NAME > /dev/null 2>&1 - CHECK_RESULT $? 0 0 "卸载软件包 $PACKAGE_NAME 失败" - LOG_INFO "已卸载测试安装的软件包 $PACKAGE_NAME" - else - LOG_INFO "保持软件包 $PACKAGE_NAME 的安装状态" - fi - - LOG_INFO "测试完成:pdftexi2dvi同时使用--verbose和--tidy选项测试通过" -} - -main "$@" \ No newline at end of file diff --git a/testcases/function_test/pkg_test/texinfo/texinfo-tex/test_texinfo-tex_texi2dvi__build.sh b/testcases/function_test/pkg_test/texinfo/texinfo-tex/test_texinfo-tex_texi2dvi__build.sh deleted file mode 100644 index 7172b3d5392..00000000000 --- a/testcases/function_test/pkg_test/texinfo/texinfo-tex/test_texinfo-tex_texi2dvi__build.sh +++ /dev/null @@ -1,101 +0,0 @@ -#!/usr/bin/bash - -# Copyright (c) 2024 ISCAS .ALL rights reserved. -# This program is licensed under Mulan PSL v2. -# You can use it according to the terms and conditions of the Mulan PSL v2. -# http://license.coscl.org.cn/MulanPSL2 -# THIS PROGRAM IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, -# EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, -# MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. -# See the Mulan PSL v2 for more details. - -# ############################################# -# @Author : honghua -# @Contact : honghua@iscas.ac.cn -# @Date : 2026-01-28 -# @License : Mulan PSL v2 -# @Desc : 测试 texi2dvi 命令的 --build 参数,指定辅助文件的处理模式 -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - # 检查是否已安装texinfo-tex包 - LOG_INFO "检查texinfo-tex是否已安装" - rpm -q texinfo-tex - if [ $? -eq 0 ]; then - LOG_INFO "texinfo-tex已安装,脚本结束将保持安装状态" - installed_flag=1 - else - LOG_INFO "texinfo-tex未安装,将在测试过程中安装" - installed_flag=0 - fi - - # 检查yum源中是否有texinfo-tex包 - LOG_INFO "检查yum源中是否有texinfo-tex包" - dnf list available texinfo-tex > /dev/null 2>&1 - CHECK_RESULT $? 0 0 "yum源中未找到texinfo-tex包" - if [ $? -ne 0 ]; then - LOG_ERROR "yum源中未找到texinfo-tex包" - exit 255 - fi - - # 如果未安装,则安装texinfo-tex - if [ $installed_flag -eq 0 ]; then - LOG_INFO "安装texinfo-tex包" - dnf install -y texinfo-tex - CHECK_RESULT $? 0 0 "安装texinfo-tex失败" - fi - - # 检查texi2dvi命令是否存在 - LOG_INFO "检查texi2dvi命令是否存在" - which texi2dvi > /dev/null 2>&1 - CHECK_RESULT $? 0 0 "texi2dvi命令不存在" - - # 测试texi2dvi命令的--build参数 - LOG_INFO "测试texi2dvi命令的--build参数" - - # 创建测试用的tex文件 - LOG_INFO "创建测试用的tex文件" - cat > test.tex << "EOF" - \documentclass{article} - \begin{document} - Hello World! - \end{document} - EOF - CHECK_RESULT $? 0 0 "创建测试tex文件失败" - - # 测试--build参数 - LOG_INFO "执行texi2dvi --build=mode test.tex" - texi2dvi --build=mode test.tex > /dev/null 2>&1 - CHECK_RESULT $? 0 0 "texi2dvi --build参数执行失败" - - # 测试无效的--build参数值 - LOG_INFO "测试无效的--build参数值" - texi2dvi --build=invalid test.tex > /dev/null 2>&1 - if [ $? -eq 255 ]; then - LOG_INFO "无效参数处理正确" - else - LOG_ERROR "无效参数处理不正确" - exit 255 - fi - - # 清理测试文件 - LOG_INFO "清理测试文件" - rm -f test.tex test.aux test.log test.dvi - CHECK_RESULT $? 0 0 "清理测试文件失败" - - # 如果测试前未安装,则卸载texinfo-tex - if [ $installed_flag -eq 0 ]; then - LOG_INFO "卸载texinfo-tex包" - dnf remove -y texinfo-tex - CHECK_RESULT $? 0 0 "卸载texinfo-tex失败" - LOG_INFO "环境已恢复到测试前状态" - else - LOG_INFO "保持texinfo-tex安装状态" - fi - - LOG_INFO "测试完成" -} - -main "$@" \ No newline at end of file diff --git a/testcases/function_test/pkg_test/texinfo/texinfo-tex/test_texinfo-tex_texi2dvi__build_dir.sh b/testcases/function_test/pkg_test/texinfo/texinfo-tex/test_texinfo-tex_texi2dvi__build_dir.sh deleted file mode 100644 index a9e03d5be79..00000000000 --- a/testcases/function_test/pkg_test/texinfo/texinfo-tex/test_texinfo-tex_texi2dvi__build_dir.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-01-28 -# @License : Mulan PSL v2 -# @Desc : 测试 texi2dvi 命令的 --build-dir 参数,指定 tidy 编译的执行目录,并隐含 --tidy -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - # 检查texi2dvi命令是否可用 - LOG_INFO "检查texi2dvi命令是否可用" - which texi2dvi > /dev/null 2>&1 - texi2dvi_installed=$? - - # 检查texinfo-tex软件包是否在yum源中 - LOG_INFO "检查texinfo-tex软件包是否在yum源中" - dnf list available texinfo-tex > /dev/null 2>&1 - CHECK_RESULT $? 0 0 "texinfo-tex软件包不在yum源中" - if [ $? -ne 0 ]; then - LOG_ERROR "texinfo-tex软件包不在yum源中" - exit 255 - fi - - # 如果texi2dvi命令不存在,则安装texinfo-tex软件包 - if [ $texi2dvi_installed -ne 0 ]; then - LOG_INFO "安装texinfo-tex软件包" - dnf install -y texinfo-tex - CHECK_RESULT $? 0 0 "安装texinfo-tex软件包失败" - fi - - # 检查texi2dvi命令是否支持--build-dir参数 - LOG_INFO "检查texi2dvi命令是否支持--build-dir参数" - texi2dvi --help 2>&1 | grep -q -- "--build-dir" - CHECK_RESULT $? 0 0 "texi2dvi命令不支持--build-dir参数" - if [ $? -ne 0 ]; then - LOG_ERROR "texi2dvi命令不支持--build-dir参数" - # 如果之前未安装,则卸载软件包 - if [ $texi2dvi_installed -ne 0 ]; then - LOG_INFO "卸载texinfo-tex软件包" - dnf remove -y texinfo-tex - CHECK_RESULT $? 0 0 "卸载texinfo-tex软件包失败" - fi - exit 255 - fi - - # 创建一个简单的texinfo测试文件 - LOG_INFO "创建texinfo测试文件" - cat > test.texinfo << "EOF" - \input texinfo - @setfilename test.info - @settitle Test Document - @node Top - @top Test Document - This is a test document. - @bye - EOF - CHECK_RESULT $? 0 0 "创建texinfo测试文件失败" - - # 创建一个构建目录 - LOG_INFO "创建构建目录" - mkdir -p build_dir - CHECK_RESULT $? 0 0 "创建构建目录失败" - - # 使用texi2dvi命令并指定--build-dir参数 - LOG_INFO "执行texi2dvi命令,指定--build-dir参数" - texi2dvi --build-dir=build_dir test.texinfo - CHECK_RESULT $? 0 0 "texi2dvi命令执行失败" - - # 检查构建目录中是否生成了相关文件 - LOG_INFO "检查构建目录中是否生成了相关文件" - ls build_dir/test.dvi > /dev/null 2>&1 - CHECK_RESULT $? 0 0 "构建目录中未生成test.dvi文件" - - # 清理测试文件 - LOG_INFO "清理测试文件" - rm -f test.texinfo - CHECK_RESULT $? 0 0 "清理测试文件失败" - - # 清理构建目录 - LOG_INFO "清理构建目录" - rm -rf build_dir - CHECK_RESULT $? 0 0 "清理构建目录失败" - - # 如果测试开始前未安装texi2dvi,则卸载软件包 - if [ $texi2dvi_installed -ne 0 ]; then - LOG_INFO "卸载texinfo-tex软件包" - dnf remove -y texinfo-tex - CHECK_RESULT $? 0 0 "卸载texinfo-tex软件包失败" - fi - - LOG_INFO "测试完成" -} - -main "$@" \ No newline at end of file diff --git a/testcases/function_test/pkg_test/texinfo/texinfo-tex/test_texinfo-tex_texi2dvi__c.sh b/testcases/function_test/pkg_test/texinfo/texinfo-tex/test_texinfo-tex_texi2dvi__c.sh deleted file mode 100644 index d9dc4839be7..00000000000 --- a/testcases/function_test/pkg_test/texinfo/texinfo-tex/test_texinfo-tex_texi2dvi__c.sh +++ /dev/null @@ -1,185 +0,0 @@ -#!/usr/bin/bash - -# Copyright (c) 2024 ISCAS .ALL rights reserved. -# This program is licensed under Mulan PSL v2. -# You can use it according to the terms and conditions of the Mulan PSL v2. -# http://license.coscl.org.cn/MulanPSL2 -# THIS PROGRAM IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, -# EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, -# MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. -# See the Mulan PSL v2 for more details. - -# ############################################# -# @Author : honghua -# @Contact : honghua@iscas.ac.cn -# @Date : 2026-01-28 -# @License : Mulan PSL v2 -# @Desc : 测试 texi2dvi 命令的 -c 参数,等同于 --build=clean,编译后清理辅助文件 -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - # 设置环境变量 - SCRIPT_NAME="test_texinfo-tex_texi2dvi__c" - PACKAGE_NAME="texinfo-tex" - - # 日志函数(直接使用) - LOG_INFO() { - echo "[INFO] $1" - } - - LOG_ERROR() { - echo "[ERROR] $1" - } - - # 检查软件包是否在yum源中存在 - check_package_in_repo() { - LOG_INFO "检查yum源中是否存在软件包: $PACKAGE_NAME" - if ! dnf list available "$PACKAGE_NAME" &>/dev/null; then - LOG_ERROR "yum源中不存在软件包: $PACKAGE_NAME" - exit 255 - fi - LOG_INFO "软件包 $PACKAGE_NAME 存在于yum源中" - } - - # 检查命令参数是否支持 - check_command_option() { - LOG_INFO "检查 texi2dvi 命令是否支持 -c 参数" - if ! texi2dvi --help 2>&1 | grep -q -- "-c\|--build=clean"; then - LOG_ERROR "texi2dvi 命令不支持 -c 或 --build=clean 参数" - exit 255 - fi - LOG_INFO "texi2dvi 命令支持 -c 参数" - } - - # 安装软件包 - install_package() { - LOG_INFO "安装软件包: $PACKAGE_NAME" - dnf install -y "$PACKAGE_NAME" - CHECK_RESULT $? 0 0 "安装软件包失败" - LOG_INFO "软件包安装成功" - } - - # 卸载软件包 - uninstall_package() { - LOG_INFO "卸载软件包: $PACKAGE_NAME" - dnf remove -y "$PACKAGE_NAME" - CHECK_RESULT $? 0 0 "卸载软件包失败" - LOG_INFO "软件包卸载成功" - } - - # 检查软件包是否已安装 - is_package_installed() { - rpm -q "$PACKAGE_NAME" &>/dev/null - return $? - } - - # 创建测试用的 TeX 文件 - create_test_tex_file() { - LOG_INFO "创建测试用的 TeX 文件" - cat > test.tex << "EOF" - \documentclass{article} - \begin{document} - Hello, World! - \end{document} - EOF - CHECK_RESULT $? 0 0 "创建测试文件失败" - LOG_INFO "测试文件创建成功" - } - - # 测试 texi2dvi -c 参数功能 - test_texi2dvi_c_option() { - LOG_INFO "开始测试 texi2dvi -c 参数" - - # 执行 texi2dvi -c 命令 - texi2dvi -c test.tex - CHECK_RESULT $? 0 0 "texi2dvi -c 命令执行失败" - LOG_INFO "texi2dvi -c 命令执行成功" - - # 检查是否生成了 DVI 文件 - LOG_INFO "检查是否生成了 DVI 文件" - if [ ! -f "test.dvi" ]; then - LOG_ERROR "未生成 DVI 文件" - return 1 - fi - LOG_INFO "DVI 文件生成成功: test.dvi" - - # 检查辅助文件是否被清理 - LOG_INFO "检查辅助文件是否被清理" - local aux_files=("test.aux" "test.log" "test.toc") - local found_aux=0 - for file in "${aux_files[@]}"; do - if [ -f "$file" ]; then - LOG_INFO "发现辅助文件: $file" - found_aux=1 - fi - done - - if [ $found_aux -eq 1 ]; then - LOG_ERROR "辅助文件未被清理,-c 参数功能异常" - return 1 - fi - LOG_INFO "辅助文件已被清理,-c 参数功能正常" - - return 0 - } - - # 清理测试文件 - cleanup_test_files() { - LOG_INFO "清理测试文件" - rm -f test.tex test.dvi test.aux test.log test.toc - LOG_INFO "测试文件清理完成" - } - - # 主函数 - main() { - LOG_INFO "开始测试: $SCRIPT_NAME" - - # 检查软件包是否在yum源中 - check_package_in_repo - - # 记录初始安装状态 - local was_installed=false - if is_package_installed; then - LOG_INFO "软件包 $PACKAGE_NAME 已安装" - was_installed=true - else - LOG_INFO "软件包 $PACKAGE_NAME 未安装" - was_installed=false - fi - - # 如果未安装,则安装软件包 - if ! $was_installed; then - install_package - fi - - # 检查命令参数 - check_command_option - - # 创建测试文件 - create_test_tex_file - - # 执行测试 - test_texi2dvi_c_option - CHECK_RESULT $? 0 0 "texi2dvi -c 参数功能测试失败" - - # 清理测试文件 - cleanup_test_files - - # 如果测试前未安装,则卸载软件包 - if ! $was_installed; then - uninstall_package - else - LOG_INFO "保持软件包 $PACKAGE_NAME 的安装状态" - fi - - LOG_INFO "测试完成: $SCRIPT_NAME" - return 0 - } - - # 执行主函数 - main "$@" -} - -main "$@" \ No newline at end of file diff --git a/testcases/function_test/pkg_test/texinfo/texinfo-tex/test_texinfo-tex_texi2dvi__dvi.sh b/testcases/function_test/pkg_test/texinfo/texinfo-tex/test_texinfo-tex_texi2dvi__dvi.sh deleted file mode 100644 index 7956d298b7f..00000000000 --- a/testcases/function_test/pkg_test/texinfo/texinfo-tex/test_texinfo-tex_texi2dvi__dvi.sh +++ /dev/null @@ -1,87 +0,0 @@ -#!/usr/bin/bash - -# Copyright (c) 2024 ISCAS .ALL rights reserved. -# This program is licensed under Mulan PSL v2. -# You can use it according to the terms and conditions of the Mulan PSL v2. -# http://license.coscl.org.cn/MulanPSL2 -# THIS PROGRAM IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, -# EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, -# MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. -# See the Mulan PSL v2 for more details. - -# ############################################# -# @Author : honghua -# @Contact : honghua@iscas.ac.cn -# @Date : 2026-01-28 -# @License : Mulan PSL v2 -# @Desc : 测试 texi2dvi 命令的 --dvi 参数,输出 DVI 文件 -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - # 检查是否已安装texinfo-tex软件包 - LOG_INFO "检查是否已安装texinfo-tex软件包" - rpm -q texinfo-tex - if [ $? -eq 0 ]; then - LOG_INFO "texinfo-tex已安装,标记为已安装状态" - INSTALLED=true - else - LOG_INFO "texinfo-tex未安装,标记为未安装状态" - INSTALLED=false - fi - - # 检查yum源中是否有texinfo-tex软件包 - LOG_INFO "检查yum源中是否有texinfo-tex软件包" - dnf list available texinfo-tex 2>&1 | grep -q "texinfo-tex" - if [ $? -ne 0 ]; then - LOG_ERROR "yum源中未找到texinfo-tex软件包" - exit 255 - fi - - # 如果未安装,则安装texinfo-tex - if [ "$INSTALLED" = "false" ]; then - LOG_INFO "开始安装texinfo-tex软件包" - dnf install -y texinfo-tex - CHECK_RESULT $? 0 0 "安装texinfo-tex失败" - fi - - # 创建测试用的TeX文件 - LOG_INFO "创建测试用的TeX文件" - cat > test.tex << "EOF" - \documentclass{article} - \begin{document} - Hello, World! - \end{document} - EOF - CHECK_RESULT $? 0 0 "创建测试TeX文件失败" - - # 测试texi2dvi命令的--dvi参数 - LOG_INFO "测试texi2dvi命令的--dvi参数,输出DVI文件" - texi2dvi --dvi test.tex - CHECK_RESULT $? 0 0 "texi2dvi命令执行失败" - - # 检查是否生成DVI文件 - LOG_INFO "检查是否生成DVI文件" - if [ -f test.dvi ]; then - LOG_INFO "成功生成DVI文件" - else - LOG_ERROR "未生成DVI文件" - exit 1 - fi - - # 清理测试文件 - LOG_INFO "清理测试文件" - rm -f test.tex test.dvi test.log test.aux - - # 如果之前未安装,则卸载texinfo-tex - if [ "$INSTALLED" = "false" ]; then - LOG_INFO "卸载texinfo-tex软件包" - dnf remove -y texinfo-tex - CHECK_RESULT $? 0 0 "卸载texinfo-tex失败" - fi - - LOG_INFO "测试完成" -} - -main "$@" \ No newline at end of file diff --git a/testcases/function_test/pkg_test/texinfo/texinfo-tex/test_texinfo-tex_texi2dvi__dvipdf.sh b/testcases/function_test/pkg_test/texinfo/texinfo-tex/test_texinfo-tex_texi2dvi__dvipdf.sh deleted file mode 100644 index 0c4d7722ac2..00000000000 --- a/testcases/function_test/pkg_test/texinfo/texinfo-tex/test_texinfo-tex_texi2dvi__dvipdf.sh +++ /dev/null @@ -1,101 +0,0 @@ -#!/usr/bin/bash - -# Copyright (c) 2024 ISCAS .ALL rights reserved. -# This program is licensed under Mulan PSL v2. -# You can use it according to the terms and conditions of the Mulan PSL v2. -# http://license.coscl.org.cn/MulanPSL2 -# THIS PROGRAM IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, -# EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, -# MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. -# See the Mulan PSL v2 for more details. - -# ############################################# -# @Author : honghua -# @Contact : honghua@iscas.ac.cn -# @Date : 2026-01-28 -# @License : Mulan PSL v2 -# @Desc : 测试 texi2dvi 命令的 --dvipdf 参数,通过 DVI 输出 PDF 文件 -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - # 检查是否已安装texinfo-tex软件包 - LOG_INFO "检查是否已安装texinfo-tex软件包" - rpm -q texinfo-tex - if [ $? -eq 0 ]; then - LOG_INFO "texinfo-tex软件包已安装" - installed=true - else - LOG_INFO "texinfo-tex软件包未安装" - installed=false - fi - - # 检查yum源中是否有texinfo-tex软件包 - LOG_INFO "检查yum源中是否有texinfo-tex软件包" - dnf list available texinfo-tex > /dev/null 2>&1 - CHECK_RESULT $? 0 0 "yum源中未找到texinfo-tex软件包" - if [ $? -ne 0 ]; then - LOG_ERROR "yum源中未找到texinfo-tex软件包" - exit 255 - fi - - # 如果未安装,则安装texinfo-tex软件包 - if [ "$installed" = false ]; then - LOG_INFO "安装texinfo-tex软件包" - dnf install -y texinfo-tex - CHECK_RESULT $? 0 0 "安装texinfo-tex软件包失败" - fi - - # 检查texi2dvi命令是否存在 - LOG_INFO "检查texi2dvi命令是否存在" - which texi2dvi > /dev/null 2>&1 - CHECK_RESULT $? 0 0 "texi2dvi命令不存在" - - # 检查texi2dvi命令是否支持--dvipdf参数 - LOG_INFO "检查texi2dvi命令是否支持--dvipdf参数" - texi2dvi --help 2>&1 | grep -q -- --dvipdf - CHECK_RESULT $? 0 0 "texi2dvi命令不支持--dvipdf参数" - if [ $? -ne 0 ]; then - LOG_ERROR "texi2dvi命令不支持--dvipdf参数" - exit 255 - fi - - # 创建测试用的texinfo文件 - LOG_INFO "创建测试用的texinfo文件" - cat > test.texinfo << EOF - \input texinfo - @setfilename test.info - @settitle Test Document - @node Top - @top Test Document - This is a test document. - @bye - EOF - CHECK_RESULT $? 0 0 "创建texinfo文件失败" - - # 使用texi2dvi命令的--dvipdf参数生成PDF文件 - LOG_INFO "使用texi2dvi命令的--dvipdf参数生成PDF文件" - texi2dvi --dvipdf test.texinfo - CHECK_RESULT $? 0 0 "texi2dvi命令执行失败" - - # 检查是否生成了PDF文件 - LOG_INFO "检查是否生成了PDF文件" - [ -f test.pdf ] - CHECK_RESULT $? 0 0 "未生成PDF文件" - - # 清理测试文件 - LOG_INFO "清理测试文件" - rm -f test.texinfo test.pdf test.aux test.cp test.fn test.ky test.log test.pg test.toc test.tp test.vr test.dvi - - # 如果测试前未安装,则卸载texinfo-tex软件包 - if [ "$installed" = false ]; then - LOG_INFO "卸载texinfo-tex软件包" - dnf remove -y texinfo-tex - CHECK_RESULT $? 0 0 "卸载texinfo-tex软件包失败" - fi - - LOG_INFO "测试完成" -} - -main "$@" \ No newline at end of file diff --git a/testcases/function_test/pkg_test/texinfo/texinfo-tex/test_texinfo-tex_texi2dvi__h.sh b/testcases/function_test/pkg_test/texinfo/texinfo-tex/test_texinfo-tex_texi2dvi__h.sh deleted file mode 100644 index ae825dedb37..00000000000 --- a/testcases/function_test/pkg_test/texinfo/texinfo-tex/test_texinfo-tex_texi2dvi__h.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-01-28 -# @License : Mulan PSL v2 -# @Desc : 测试 texi2dvi 命令的 -h 参数,显示帮助信息 -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - LOG_INFO "开始测试texi2dvi命令的-h参数,显示帮助信息" - - # 检查软件包是否已安装 - LOG_INFO "检查texinfo-tex软件包是否已安装" - rpm -q texinfo-tex > /dev/null 2>&1 - if [ $? -eq 0 ]; then - LOG_INFO "texinfo-tex软件包已安装,测试后保持安装状态" - already_installed=1 - else - LOG_INFO "texinfo-tex软件包未安装,测试前将安装该软件包" - already_installed=0 - fi - - # 检查yum源中是否有该软件包 - LOG_INFO "检查yum源中是否有texinfo-tex软件包" - dnf list available texinfo-tex > /dev/null 2>&1 - if [ $? -ne 0 ]; then - LOG_ERROR "yum源中没有texinfo-tex软件包" - exit 255 - fi - - # 如果未安装则安装软件包 - if [ $already_installed -eq 0 ]; then - LOG_INFO "安装texinfo-tex软件包" - dnf install -y texinfo-tex - CHECK_RESULT $? 0 0 "安装texinfo-tex软件包失败" - fi - - # 检查texi2dvi命令是否存在 - LOG_INFO "检查texi2dvi命令是否存在" - which texi2dvi > /dev/null 2>&1 - if [ $? -ne 0 ]; then - LOG_ERROR "texi2dvi命令不存在" - exit 255 - fi - - # 检查-h参数是否支持 - LOG_INFO "检查texi2dvi命令是否支持-h参数" - texi2dvi -h > /dev/null 2>&1 - if [ $? -eq 255 ]; then - LOG_ERROR "texi2dvi命令不支持-h参数" - exit 255 - fi - - # 测试texi2dvi -h命令 - LOG_INFO "执行texi2dvi -h命令" - texi2dvi -h > /dev/null 2>&1 - CHECK_RESULT $? 0 0 "texi2dvi -h命令执行失败" - - # 验证帮助信息输出 - LOG_INFO "验证texi2dvi -h命令输出的帮助信息" - texi2dvi -h 2>&1 | grep -q "Usage:" - CHECK_RESULT $? 0 0 "texi2dvi -h命令未输出正确的帮助信息" - - # 环境清理 - if [ $already_installed -eq 0 ]; then - LOG_INFO "清理环境:卸载texinfo-tex软件包" - dnf remove -y texinfo-tex - CHECK_RESULT $? 0 0 "卸载texinfo-tex软件包失败" - else - LOG_INFO "测试前已安装texinfo-tex,保持安装状态" - fi - - LOG_INFO "测试完成" -} - -main "$@" \ No newline at end of file diff --git a/testcases/function_test/pkg_test/texinfo/texinfo-tex/test_texinfo-tex_texi2dvi__html.sh b/testcases/function_test/pkg_test/texinfo/texinfo-tex/test_texinfo-tex_texi2dvi__html.sh deleted file mode 100644 index c052fa275f6..00000000000 --- a/testcases/function_test/pkg_test/texinfo/texinfo-tex/test_texinfo-tex_texi2dvi__html.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 : 2026-01-28 -# @License : Mulan PSL v2 -# @Desc : 测试 texi2dvi 命令的 --html 参数,使用 HeVeA 从 LaTeX 输出 HTML 文件 -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - LOG_INFO "开始测试 texi2dvi 命令的 --html 参数,使用 HeVeA 从 LaTeX 输出 HTML 文件" - LOG_INFO "步骤1:检查是否已安装 texinfo-tex 软件包" - rpm -q texinfo-tex > /dev/null 2>&1 - if [ $? -eq 0 ]; then - LOG_INFO "texinfo-tex 已安装,测试结束后保持安装状态" - INSTALLED="yes" - else - LOG_INFO "texinfo-tex 未安装,将在测试前安装" - INSTALLED="no" - fi - - LOG_INFO "步骤2:检查 yum 源中是否有 texinfo-tex 软件包" - dnf list available texinfo-tex > /dev/null 2>&1 - CHECK_RESULT $? 0 0 "yum 源中未找到 texinfo-tex 软件包" - if [ $? -ne 0 ]; then - LOG_ERROR "yum 源中未找到 texinfo-tex 软件包" - exit 255 - fi - - if [ "$INSTALLED" == "no" ]; then - LOG_INFO "步骤3:安装 texinfo-tex 软件包" - dnf install -y texinfo-tex > /dev/null 2>&1 - CHECK_RESULT $? 0 0 "安装 texinfo-tex 失败" - fi - - LOG_INFO "步骤4:检查 texi2dvi 命令是否支持 --html 参数" - texi2dvi --help 2>&1 | grep -q -- "--html" - CHECK_RESULT $? 0 0 "texi2dvi 命令不支持 --html 参数" - if [ $? -ne 0 ]; then - LOG_ERROR "texi2dvi 命令不支持 --html 参数" - if [ "$INSTALLED" == "no" ]; then - dnf remove -y texinfo-tex > /dev/null 2>&1 - fi - exit 255 - fi - - LOG_INFO "步骤5:创建测试用的简单 TeX 文件" - cat > test.tex << "EOF" - \documentclass{article} - \begin{document} - Hello, World! - \end{document} - EOF - CHECK_RESULT $? 0 0 "创建 test.tex 文件失败" - - LOG_INFO "步骤6:使用 texi2dvi 命令的 --html 参数生成 HTML 文件" - texi2dvi --html test.tex > output.log 2>&1 - CHECK_RESULT $? 0 0 "texi2dvi --html 命令执行失败" - - LOG_INFO "步骤7:检查是否生成了 HTML 文件" - ls test.html > /dev/null 2>&1 - CHECK_RESULT $? 0 0 "未生成 test.html 文件" - - LOG_INFO "步骤8:清理测试生成的文件" - rm -f test.tex test.html output.log test.aux test.log test.toc > /dev/null 2>&1 - - if [ "$INSTALLED" == "no" ]; then - LOG_INFO "步骤9:卸载 texinfo-tex 软件包" - dnf remove -y texinfo-tex > /dev/null 2>&1 - CHECK_RESULT $? 0 0 "卸载 texinfo-tex 失败" - fi - - LOG_INFO "测试完成" -} - -main "$@" \ No newline at end of file diff --git a/testcases/function_test/pkg_test/texinfo/texinfo-tex/test_texinfo-tex_texi2dvi__info.sh b/testcases/function_test/pkg_test/texinfo/texinfo-tex/test_texinfo-tex_texi2dvi__info.sh deleted file mode 100644 index 28bd5031f62..00000000000 --- a/testcases/function_test/pkg_test/texinfo/texinfo-tex/test_texinfo-tex_texi2dvi__info.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-01-28 -# @License : Mulan PSL v2 -# @Desc : 测试 texi2dvi 命令的 --info 参数,使用 HeVeA 从 LaTeX 输出 Info 文件 -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - LOG_INFO "开始测试 texi2dvi 命令的 --info 参数,使用 HeVeA 从 LaTeX 输出 Info 文件" - - # 检查软件包是否已安装 - LOG_INFO "检查 texinfo-tex 软件包是否已安装" - if rpm -q texinfo-tex &> /dev/null; then - LOG_INFO "texinfo-tex 软件包已安装,测试结束后将保持安装状态" - INSTALLED_BEFORE=1 - else - LOG_INFO "texinfo-tex 软件包未安装,将在测试过程中安装" - INSTALLED_BEFORE=0 - fi - - # 检查 yum 源中是否有 texinfo-tex 软件包 - LOG_INFO "检查 yum 源中是否有 texinfo-tex 软件包" - if ! dnf list available texinfo-tex &> /dev/null; then - LOG_ERROR "yum 源中未找到 texinfo-tex 软件包" - exit 255 - fi - - # 如果未安装,则安装软件包 - if [ $INSTALLED_BEFORE -eq 0 ]; then - LOG_INFO "安装 texinfo-tex 软件包" - dnf install -y texinfo-tex - CHECK_RESULT $? 0 0 "安装 texinfo-tex 软件包失败" - fi - - # 检查 texi2dvi 命令的 --info 参数是否存在 - LOG_INFO "检查 texi2dvi 命令是否支持 --info 参数" - texi2dvi --help 2>&1 | grep -q -- "--info" - CHECK_RESULT $? 0 0 "texi2dvi 命令不支持 --info 参数" - - # 创建测试用的简单 LaTeX 文件 - LOG_INFO "创建测试用的简单 LaTeX 文件" - cat > test.tex << "EOF" - \documentclass{article} - \begin{document} - Hello, World! - \end{document} - EOF - CHECK_RESULT $? 0 0 "创建 LaTeX 文件失败" - - # 使用 texi2dvi 命令的 --info 参数生成 Info 文件 - LOG_INFO "使用 texi2dvi 命令的 --info 参数生成 Info 文件" - texi2dvi --info --hevea test.tex - CHECK_RESULT $? 0 0 "使用 texi2dvi 命令的 --info 参数生成 Info 文件失败" - - # 检查生成的 Info 文件是否存在 - LOG_INFO "检查生成的 Info 文件是否存在" - [ -f test.info ] - CHECK_RESULT $? 0 0 "生成的 Info 文件不存在" - - # 清理测试文件 - LOG_INFO "清理测试文件" - rm -f test.tex test.info test.aux test.log test.toc test.dvi test.pdf - CHECK_RESULT $? 0 0 "清理测试文件失败" - - # 如果测试前未安装,则卸载软件包 - if [ $INSTALLED_BEFORE -eq 0 ]; then - LOG_INFO "卸载 texinfo-tex 软件包" - dnf remove -y texinfo-tex - CHECK_RESULT $? 0 0 "卸载 texinfo-tex 软件包失败" - fi - - LOG_INFO "测试完成" -} - -main "$@" \ No newline at end of file diff --git a/testcases/function_test/pkg_test/texinfo/texinfo-tex/test_texinfo-tex_texi2dvi__l.sh b/testcases/function_test/pkg_test/texinfo/texinfo-tex/test_texinfo-tex_texi2dvi__l.sh deleted file mode 100644 index 37d54c00a27..00000000000 --- a/testcases/function_test/pkg_test/texinfo/texinfo-tex/test_texinfo-tex_texi2dvi__l.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 : 2026-01-28 -# @License : Mulan PSL v2 -# @Desc : 测试 texi2dvi 命令的 -l 参数,指定输入文件的语言 -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - LOG_INFO "开始测试 texi2dvi 命令的 -l 参数,指定输入文件的语言" - - # 检查是否已安装 texinfo-tex 包 - LOG_INFO "检查 texinfo-tex 软件包是否已安装" - rpm -q texinfo-tex - if [ $? -eq 0 ]; then - LOG_INFO "texinfo-tex 已安装,脚本结束后将保持安装状态" - INSTALLED=1 - else - LOG_INFO "texinfo-tex 未安装,将在测试前安装" - INSTALLED=0 - fi - - # 检查 yum 源中是否有 texinfo-tex 包 - LOG_INFO "检查 yum 源中是否有 texinfo-tex 软件包" - dnf list available texinfo-tex 2>/dev/null | grep -q texinfo-tex - if [ $? -ne 0 ]; then - LOG_ERROR "yum 源中未找到 texinfo-tex 软件包" - exit 255 - fi - - # 如果未安装,则安装 texinfo-tex - if [ $INSTALLED -eq 0 ]; then - LOG_INFO "安装 texinfo-tex 软件包" - dnf install -y texinfo-tex - CHECK_RESULT $? 0 0 "安装 texinfo-tex 失败" - fi - - # 创建测试用的 texinfo 文件 - LOG_INFO "创建测试用的 texinfo 文件 test.texinfo" - cat > test.texinfo << "EOF" - \input texinfo - @setfilename test.info - @settitle Test Document - @bye - EOF - CHECK_RESULT $? 0 0 "创建 test.texinfo 文件失败" - - # 测试 texi2dvi 命令的 -l 参数(指定语言为 english) - LOG_INFO "测试 texi2dvi 命令的 -l 参数,指定语言为 english" - texi2dvi -l english test.texinfo 2>&1 - CHECK_RESULT $? 0 0 "texi2dvi -l english 执行失败" - - # 检查是否生成了预期的输出文件 - LOG_INFO "检查是否生成了 test.dvi 文件" - [ -f test.dvi ] - CHECK_RESULT $? 0 0 "未生成 test.dvi 文件" - - # 清理生成的测试文件 - LOG_INFO "清理测试生成的文件" - rm -f test.texinfo test.dvi test.log test.aux test.cp test.cps test.fn test.fns test.ky test.kys test.pg test.toc test.tp test.tps test.vr test.vrs - - # 如果脚本开始时未安装,则在结束时卸载软件包 - if [ $INSTALLED -eq 0 ]; then - LOG_INFO "卸载 texinfo-tex 软件包" - dnf remove -y texinfo-tex - CHECK_RESULT $? 0 0 "卸载 texinfo-tex 失败" - LOG_INFO "环境已恢复到初始状态" - else - LOG_INFO "保持 texinfo-tex 软件包的安装状态" - fi - - LOG_INFO "测试 texi2dvi 命令的 -l 参数完成" -} - -main "$@" \ No newline at end of file diff --git a/testcases/function_test/pkg_test/texinfo/texinfo-tex/test_texinfo-tex_texi2dvi__max_iterations.sh b/testcases/function_test/pkg_test/texinfo/texinfo-tex/test_texinfo-tex_texi2dvi__max_iterations.sh deleted file mode 100644 index bdc37382f26..00000000000 --- a/testcases/function_test/pkg_test/texinfo/texinfo-tex/test_texinfo-tex_texi2dvi__max_iterations.sh +++ /dev/null @@ -1,84 +0,0 @@ -#!/usr/bin/bash - -# Copyright (c) 2024 ISCAS .ALL rights reserved. -# This program is licensed under Mulan PSL v2. -# You can use it according to the terms and conditions of the Mulan PSL v2. -# http://license.coscl.org.cn/MulanPSL2 -# THIS PROGRAM IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, -# EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, -# MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. -# See the Mulan PSL v2 for more details. - -# ############################################# -# @Author : honghua -# @Contact : honghua@iscas.ac.cn -# @Date : 2026-01-28 -# @License : Mulan PSL v2 -# @Desc : 测试 texi2dvi 命令的 --max-iterations 参数,限制文件处理的最大迭代次数 -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - LOG_INFO "开始测试texi2dvi命令的--max-iterations参数" - - # 检查环境中是否已经安装了texinfo-tex软件包 - LOG_INFO "检查是否已安装texinfo-tex软件包" - if dnf list installed texinfo-tex &> /dev/null; then - LOG_INFO "texinfo-tex已安装,脚本结束时将保持安装状态" - already_installed=true - else - LOG_INFO "texinfo-tex未安装,将在测试过程中安装" - already_installed=false - fi - - # 检查yum源中是否有texinfo-tex软件包 - LOG_INFO "检查yum源中是否存在texinfo-tex软件包" - if ! dnf list available texinfo-tex &> /dev/null; then - LOG_ERROR "yum源中不存在texinfo-tex软件包" - exit 255 - fi - - # 如果未安装,则安装软件包 - if [ "$already_installed" = false ]; then - LOG_INFO "安装texinfo-tex软件包" - dnf install -y texinfo-tex - CHECK_RESULT $? 0 0 "安装texinfo-tex软件包失败" - fi - - # 检查texi2dvi命令的--max-iterations参数是否支持 - LOG_INFO "检查texi2dvi命令是否支持--max-iterations参数" - texi2dvi --help 2>&1 | grep -q "\-\-max-iterations" - CHECK_RESULT $? 0 0 "texi2dvi命令不支持--max-iterations参数,退出" 255 - - # 创建一个简单的.tex源文件用于测试 - LOG_INFO "创建测试用的.tex源文件" - cat > test.tex << "EOF" - \documentclass{article} - \begin{document} - Hello, World! - \end{document} - EOF - - # 测试texi2dvi命令并指定--max-iterations参数为1 - LOG_INFO "执行texi2dvi命令,设置--max-iterations参数为1" - texi2dvi --max-iterations=1 test.tex - CHECK_RESULT $? 0 0 "texi2dvi命令执行失败" - - # 清理测试过程中创建的文件 - LOG_INFO "清理测试生成的文件" - rm -f test.tex test.aux test.log test.dvi - - # 如果测试前未安装texinfo-tex,则卸载软件包 - if [ "$already_installed" = false ]; then - LOG_INFO "卸载texinfo-tex软件包" - dnf remove -y texinfo-tex - CHECK_RESULT $? 0 0 "卸载texinfo-tex软件包失败" - else - LOG_INFO "保持texinfo-tex软件包的安装状态" - fi - - LOG_INFO "测试完成" -} - -main "$@" \ No newline at end of file diff --git a/testcases/function_test/pkg_test/texinfo/texinfo-tex/test_texinfo-tex_texi2dvi__mostly_clean.sh b/testcases/function_test/pkg_test/texinfo/texinfo-tex/test_texinfo-tex_texi2dvi__mostly_clean.sh deleted file mode 100644 index 4442ef630cc..00000000000 --- a/testcases/function_test/pkg_test/texinfo/texinfo-tex/test_texinfo-tex_texi2dvi__mostly_clean.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-01-28 -# @License : Mulan PSL v2 -# @Desc : 测试 texi2dvi 命令的 --mostly-clean 参数,移除之前运行的辅助文件或目录 -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - LOG_INFO "开始测试 texi2dvi 命令的 --mostly-clean 参数" - LOG_INFO "步骤1:检查系统中是否已安装 texinfo-tex 软件包" - rpm -q texinfo-tex - if [ $? -eq 0 ]; then - LOG_INFO "texinfo-tex 已安装,测试后将保持安装状态" - INSTALLED=1 - else - LOG_INFO "texinfo-tex 未安装,将在测试过程中安装" - INSTALLED=0 - fi - - LOG_INFO "步骤2:检查 yum 源中是否存在 texinfo-tex 软件包" - dnf list available texinfo-tex 2>&1 | grep -q "texinfo-tex" - if [ $? -ne 0 ]; then - LOG_ERROR "yum 源中未找到 texinfo-tex 软件包" - exit 255 - fi - - if [ $INSTALLED -eq 0 ]; then - LOG_INFO "步骤3:安装 texinfo-tex 软件包" - dnf install -y texinfo-tex - CHECK_RESULT $? 0 0 "安装 texinfo-tex 失败" - fi - - LOG_INFO "步骤4:验证 texi2dvi 命令是否存在" - which texi2dvi - CHECK_RESULT $? 0 0 "texi2dvi 命令未找到" - - LOG_INFO "步骤5:检查 texi2dvi 命令是否支持 --mostly-clean 参数" - texi2dvi --help 2>&1 | grep -q "\-\-mostly\-clean" - if [ $? -ne 0 ]; then - LOG_ERROR "texi2dvi 命令不支持 --mostly-clean 参数" - exit 255 - fi - - LOG_INFO "步骤6:创建一个简单的 TeX 文件用于测试" - cat > test.tex << "EOF" - \documentclass{article} - \begin{document} - Hello, world! - \end{document} - EOF - CHECK_RESULT $? 0 0 "创建测试文件失败" - - LOG_INFO "步骤7:运行 texi2dvi 命令并测试 --mostly-clean 参数" - texi2dvi --mostly-clean test.tex - CHECK_RESULT $? 0 0 "texi2dvi --mostly-clean 执行失败" - - LOG_INFO "步骤8:检查辅助文件是否被移除" - ls test.aux test.log test.toc 2>/dev/null - if [ $? -eq 0 ]; then - LOG_ERROR "辅助文件未被正确移除" - exit 1 - else - LOG_INFO "辅助文件已被正确移除" - fi - - LOG_INFO "步骤9:清理测试文件" - rm -f test.tex test.dvi - CHECK_RESULT $? 0 0 "清理测试文件失败" - - if [ $INSTALLED -eq 0 ]; then - LOG_INFO "步骤10:卸载 texinfo-tex 软件包" - dnf remove -y texinfo-tex - CHECK_RESULT $? 0 0 "卸载 texinfo-tex 失败" - fi - - LOG_INFO "测试完成" -} - -main "$@" \ No newline at end of file diff --git a/testcases/function_test/pkg_test/texinfo/texinfo-tex/test_texinfo-tex_texi2dvi__no_line_error.sh b/testcases/function_test/pkg_test/texinfo/texinfo-tex/test_texinfo-tex_texi2dvi__no_line_error.sh deleted file mode 100644 index 381dcd3f44b..00000000000 --- a/testcases/function_test/pkg_test/texinfo/texinfo-tex/test_texinfo-tex_texi2dvi__no_line_error.sh +++ /dev/null @@ -1,94 +0,0 @@ -#!/usr/bin/bash - -# Copyright (c) 2024 ISCAS .ALL rights reserved. -# This program is licensed under Mulan PSL v2. -# You can use it according to the terms and conditions of the Mulan PSL v2. -# http://license.coscl.org.cn/MulanPSL2 -# THIS PROGRAM IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, -# EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, -# MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. -# See the Mulan PSL v2 for more details. - -# ############################################# -# @Author : honghua -# @Contact : honghua@iscas.ac.cn -# @Date : 2026-01-28 -# @License : Mulan PSL v2 -# @Desc : 测试 texi2dvi 命令的 --no-line-error 参数,不传递 --file-line-error 给 TeX -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - LOG_INFO "开始测试 texi2dvi 命令的 --no-line-error 参数" - LOG_INFO "检查系统是否已安装 texinfo-tex 软件包" - rpm -q texinfo-tex > /dev/null 2>&1 - if [ $? -eq 0 ]; then - LOG_INFO "texinfo-tex 已安装,测试结束后将保持安装状态" - INSTALLED="true" - else - LOG_INFO "texinfo-tex 未安装,测试结束后将卸载" - INSTALLED="false" - fi - - LOG_INFO "检查 yum 源中是否存在 texinfo-tex 软件包" - dnf list available texinfo-tex > /dev/null 2>&1 - if [ $? -ne 0 ]; then - LOG_ERROR "yum 源中未找到 texinfo-tex 软件包" - exit 255 - fi - - if [ "$INSTALLED" = "false" ]; then - LOG_INFO "安装 texinfo-tex 软件包" - dnf install -y texinfo-tex - CHECK_RESULT $? 0 0 "安装 texinfo-tex 失败" - fi - - LOG_INFO "创建一个简单的 .texi 测试文件" - cat > test_input.texi << "EOF" - \input texinfo - @setfilename test.info - @settitle Test Document - @node Top - @top Test Document - This is a test. - EOF - CHECK_RESULT $? 0 0 "创建 .texi 测试文件失败" - - LOG_INFO "测试 texi2dvi 命令,不传递 --no-line-error 参数,预期失败" - texi2dvi test_input.texi > /dev/null 2>&1 - if [ $? -eq 0 ]; then - LOG_ERROR "未传递 --no-line-error 参数时,命令意外成功" - CHECK_RESULT 1 0 1 "参数检查失败" - else - LOG_INFO "未传递 --no-line-error 参数时,命令按预期失败" - CHECK_RESULT $? 1 0 "参数检查失败" - fi - - LOG_INFO "测试 texi2dvi 命令的 --no-line-error 参数" - texi2dvi --no-line-error test_input.texi - CHECK_RESULT $? 0 0 "执行 texi2dvi --no-line-error 失败" - - LOG_INFO "检查是否生成了预期的 .dvi 文件" - if [ -f test_input.dvi ]; then - LOG_INFO "成功生成了 .dvi 文件" - CHECK_RESULT 0 0 0 "检查 .dvi 文件" - else - LOG_ERROR "未生成预期的 .dvi 文件" - CHECK_RESULT 1 0 1 "检查 .dvi 文件失败" - fi - - LOG_INFO "清理测试生成的文件" - rm -f test_input.texi test_input.dvi test_input.log test_input.aux test_input.toc - CHECK_RESULT $? 0 0 "清理测试文件失败" - - if [ "$INSTALLED" = "false" ]; then - LOG_INFO "卸载 texinfo-tex 软件包" - dnf remove -y texinfo-tex - CHECK_RESULT $? 0 0 "卸载 texinfo-tex 失败" - fi - - LOG_INFO "测试完成,环境已恢复" -} - -main "$@" \ No newline at end of file diff --git a/testcases/function_test/pkg_test/texinfo/texinfo-tex/test_texinfo-tex_texi2dvi__o.sh b/testcases/function_test/pkg_test/texinfo/texinfo-tex/test_texinfo-tex_texi2dvi__o.sh deleted file mode 100644 index 909f6059319..00000000000 --- a/testcases/function_test/pkg_test/texinfo/texinfo-tex/test_texinfo-tex_texi2dvi__o.sh +++ /dev/null @@ -1,106 +0,0 @@ -#!/usr/bin/bash - -# Copyright (c) 2024 ISCAS .ALL rights reserved. -# This program is licensed under Mulan PSL v2. -# You can use it according to the terms and conditions of the Mulan PSL v2. -# http://license.coscl.org.cn/MulanPSL2 -# THIS PROGRAM IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, -# EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, -# MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. -# See the Mulan PSL v2 for more details. - -# ############################################# -# @Author : honghua -# @Contact : honghua@iscas.ac.cn -# @Date : 2026-01-28 -# @License : Mulan PSL v2 -# @Desc : 测试 texi2dvi 命令的 -o 参数,指定输出文件名 -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - # 定义日志函数 - LOG_INFO() { - echo "[INFO] $1" - } - - LOG_ERROR() { - echo "[ERROR] $1" - } - - # 定义软件包名称 - PACKAGE_NAME="texinfo-tex" - - # 步骤1: 检查软件包是否已在yum源中 - LOG_INFO "步骤1: 检查软件包是否在yum源中" - dnf list available $PACKAGE_NAME > /dev/null 2>&1 - if [ $? -ne 0 ]; then - LOG_ERROR "软件包 $PACKAGE_NAME 不在yum源中" - exit 255 - fi - - # 步骤2: 检查软件包是否已安装 - LOG_INFO "步骤2: 检查软件包是否已安装" - if rpm -q $PACKAGE_NAME > /dev/null 2>&1; then - LOG_INFO "软件包 $PACKAGE_NAME 已安装,脚本结束后保持安装状态" - INSTALLED_BEFORE=1 - else - LOG_INFO "软件包 $PACKAGE_NAME 未安装,将在测试步骤中安装" - INSTALLED_BEFORE=0 - fi - - # 步骤3: 如果未安装,则安装软件包 - if [ $INSTALLED_BEFORE -eq 0 ]; then - LOG_INFO "步骤3: 安装软件包 $PACKAGE_NAME" - dnf install -y $PACKAGE_NAME - CHECK_RESULT $? 0 0 "安装软件包 $PACKAGE_NAME 失败" - fi - - # 步骤4: 检查texi2dvi命令是否存在 - LOG_INFO "步骤4: 检查texi2dvi命令是否存在" - which texi2dvi > /dev/null 2>&1 - CHECK_RESULT $? 0 0 "texi2dvi命令未找到" - - # 步骤5: 创建测试用的texinfo文件 - LOG_INFO "步骤5: 创建测试用的texinfo文件" - cat > test.texinfo << "EOF" - \input texinfo - @setfilename test.info - @settitle Test Document - @bye - EOF - CHECK_RESULT $? 0 0 "创建texinfo文件失败" - - # 步骤6: 测试texi2dvi命令的-o参数,指定输出文件名 - LOG_INFO "步骤6: 测试texi2dvi命令的-o参数,指定输出文件名" - texi2dvi test.texinfo -o output.dvi - CHECK_RESULT $? 0 0 "texi2dvi命令执行失败" - - # 步骤7: 检查输出文件是否存在 - LOG_INFO "步骤7: 检查输出文件是否存在" - if [ -f output.dvi ]; then - LOG_INFO "输出文件 output.dvi 已成功创建" - else - LOG_ERROR "输出文件 output.dvi 未创建" - exit 1 - fi - - # 步骤8: 清理测试文件 - LOG_INFO "步骤8: 清理测试文件" - rm -f test.texinfo output.dvi - CHECK_RESULT $? 0 0 "清理测试文件失败" - - # 步骤9: 如果之前未安装软件包,则在脚本结束前卸载 - if [ $INSTALLED_BEFORE -eq 0 ]; then - LOG_INFO "步骤9: 卸载软件包 $PACKAGE_NAME" - dnf remove -y $PACKAGE_NAME - CHECK_RESULT $? 0 0 "卸载软件包 $PACKAGE_NAME 失败" - else - LOG_INFO "步骤9: 软件包 $PACKAGE_NAME 在脚本执行前已安装,保持安装状态" - fi - - LOG_INFO "测试完成" -} - -main "$@" \ No newline at end of file diff --git a/testcases/function_test/pkg_test/texinfo/texinfo-tex/test_texinfo-tex_texi2dvi__p.sh b/testcases/function_test/pkg_test/texinfo/texinfo-tex/test_texinfo-tex_texi2dvi__p.sh deleted file mode 100644 index 081e88731fa..00000000000 --- a/testcases/function_test/pkg_test/texinfo/texinfo-tex/test_texinfo-tex_texi2dvi__p.sh +++ /dev/null @@ -1,94 +0,0 @@ -#!/usr/bin/bash - -# Copyright (c) 2024 ISCAS .ALL rights reserved. -# This program is licensed under Mulan PSL v2. -# You can use it according to the terms and conditions of the Mulan PSL v2. -# http://license.coscl.org.cn/MulanPSL2 -# THIS PROGRAM IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, -# EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, -# MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. -# See the Mulan PSL v2 for more details. - -# ############################################# -# @Author : honghua -# @Contact : honghua@iscas.ac.cn -# @Date : 2026-01-28 -# @License : Mulan PSL v2 -# @Desc : 测试 texi2dvi 命令的 -p 参数,使用 pdftex/pdflatex 处理并生成 PDF 输出 -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - LOG_INFO "开始测试 texi2dvi 命令的 -p 参数,使用 pdftex/pdflatex 处理并生成 PDF 输出" - - # 检查环境是否已安装 texinfo-tex 软件包 - LOG_INFO "检查 texinfo-tex 软件包是否已安装" - rpm -q texinfo-tex - if [ $? -eq 0 ]; then - LOG_INFO "texinfo-tex 软件包已安装,测试结束后将保持安装状态" - INSTALLED=1 - else - LOG_INFO "texinfo-tex 软件包未安装,将在测试前安装" - INSTALLED=0 - fi - - # 检查 yum 源中是否有 texinfo-tex 软件包 - LOG_INFO "检查 yum 源中是否有 texinfo-tex 软件包" - dnf list available texinfo-tex - if [ $? -ne 0 ]; then - LOG_ERROR "yum 源中未找到 texinfo-tex 软件包" - exit 255 - fi - - # 如果未安装,则安装软件包 - if [ $INSTALLED -eq 0 ]; then - LOG_INFO "安装 texinfo-tex 软件包" - dnf install -y texinfo-tex - CHECK_RESULT $? 0 0 "安装 texinfo-tex 软件包失败" - fi - - # 检查 texi2dvi 命令是否存在 - LOG_INFO "检查 texi2dvi 命令是否存在" - command -v texi2dvi - CHECK_RESULT $? 0 0 "texi2dvi 命令不存在" - - # 检查 texi2dvi 命令是否支持 -p 参数 - LOG_INFO "检查 texi2dvi 命令是否支持 -p 参数" - texi2dvi --help | grep -q "\-p" - CHECK_RESULT $? 0 0 "texi2dvi 命令不支持 -p 参数" - - # 创建一个简单的 .texi 文件用于测试 - LOG_INFO "创建测试用的 .texi 文件" - cat > test.texi << "EOF" - \input texinfo - @setfilename test.info - @settitle Test Document - @bye - EOF - - # 使用 texi2dvi 命令的 -p 参数生成 PDF - LOG_INFO "使用 texi2dvi 命令的 -p 参数生成 PDF" - texi2dvi -p test.texi - CHECK_RESULT $? 0 0 "texi2dvi 命令执行失败" - - # 检查生成的 PDF 文件是否存在 - LOG_INFO "检查生成的 PDF 文件是否存在" - [ -f test.pdf ] - CHECK_RESULT $? 0 0 "未生成 PDF 文件" - - # 清理测试文件 - LOG_INFO "清理测试文件" - rm -f test.texi test.pdf test.aux test.log test.toc - - # 如果测试前未安装软件包,则卸载 - if [ $INSTALLED -eq 0 ]; then - LOG_INFO "卸载 texinfo-tex 软件包" - dnf remove -y texinfo-tex - CHECK_RESULT $? 0 0 "卸载 texinfo-tex 软件包失败" - fi - - LOG_INFO "测试 texi2dvi 命令的 -p 参数完成" -} - -main "$@" \ No newline at end of file diff --git a/testcases/function_test/pkg_test/texinfo/texinfo-tex/test_texinfo-tex_texi2dvi__pdf.sh b/testcases/function_test/pkg_test/texinfo/texinfo-tex/test_texinfo-tex_texi2dvi__pdf.sh deleted file mode 100644 index f993c813d07..00000000000 --- a/testcases/function_test/pkg_test/texinfo/texinfo-tex/test_texinfo-tex_texi2dvi__pdf.sh +++ /dev/null @@ -1,105 +0,0 @@ -#!/usr/bin/bash - -# Copyright (c) 2024 ISCAS .ALL rights reserved. -# This program is licensed under Mulan PSL v2. -# You can use it according to the terms and conditions of the Mulan PSL v2. -# http://license.coscl.org.cn/MulanPSL2 -# THIS PROGRAM IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, -# EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, -# MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. -# See the Mulan PSL v2 for more details. - -# ############################################# -# @Author : honghua -# @Contact : honghua@iscas.ac.cn -# @Date : 2026-01-28 -# @License : Mulan PSL v2 -# @Desc : 测试 texi2dvi 命令的 --pdf 参数,使用 pdftex/pdflatex 处理并生成 PDF 输出 -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - # 检查是否已安装texinfo-tex软件包 - LOG_INFO "检查是否已安装texinfo-tex软件包" - rpm -q texinfo-tex > /dev/null 2>&1 - if [ $? -eq 0 ]; then - LOG_INFO "texinfo-tex软件包已安装" - INSTALLED_FLAG=1 - else - LOG_INFO "texinfo-tex软件包未安装" - INSTALLED_FLAG=0 - fi - - # 检查yum源中是否有texinfo-tex软件包 - LOG_INFO "检查yum源中是否有texinfo-tex软件包" - dnf list available texinfo-tex > /dev/null 2>&1 - if [ $? -ne 0 ]; then - LOG_ERROR "yum源中未找到texinfo-tex软件包" - exit 255 - fi - - # 如果未安装则安装软件包 - if [ $INSTALLED_FLAG -eq 0 ]; then - LOG_INFO "安装texinfo-tex软件包" - dnf install -y texinfo-tex - CHECK_RESULT $? 0 0 "安装texinfo-tex软件包失败" - fi - - # 检查texi2dvi命令是否支持--pdf参数 - LOG_INFO "检查texi2dvi命令是否支持--pdf参数" - texi2dvi --help 2>&1 | grep -q "\-\-pdf" - if [ $? -ne 0 ]; then - LOG_ERROR "texi2dvi命令不支持--pdf参数" - if [ $INSTALLED_FLAG -eq 0 ]; then - LOG_INFO "卸载texinfo-tex软件包" - dnf remove -y texinfo-tex - fi - exit 255 - fi - - # 创建测试用的texinfo文件 - LOG_INFO "创建测试用的texinfo文件" - cat > test.texinfo << "EOF" - \input texinfo - @setfilename test.info - @settitle Test Document - @node Top - @top Test Document - This is a test document. - @bye - EOF - CHECK_RESULT $? 0 0 "创建测试texinfo文件失败" - - # 使用texi2dvi命令的--pdf参数处理文件 - LOG_INFO "使用texi2dvi命令的--pdf参数处理文件" - texi2dvi --pdf test.texinfo - CHECK_RESULT $? 0 0 "texi2dvi命令执行失败" - - # 检查是否生成PDF文件 - LOG_INFO "检查是否生成PDF文件" - if [ -f test.pdf ]; then - LOG_INFO "成功生成PDF文件: test.pdf" - # 检查PDF文件是否有效 - file test.pdf | grep -q "PDF document" - CHECK_RESULT $? 0 0 "生成的PDF文件无效" - else - LOG_ERROR "未生成PDF文件" - CHECK_RESULT 1 0 0 "未生成PDF文件" - fi - - # 清理测试文件 - LOG_INFO "清理测试文件" - rm -f test.texinfo test.pdf test.aux test.cp test.cps test.fn test.fns test.ky test.log test.pg test.toc test.tp test.vr test.vrs test.dvi - - # 如果测试前未安装,则卸载软件包 - if [ $INSTALLED_FLAG -eq 0 ]; then - LOG_INFO "卸载texinfo-tex软件包" - dnf remove -y texinfo-tex - CHECK_RESULT $? 0 0 "卸载texinfo-tex软件包失败" - fi - - LOG_INFO "测试完成" -} - -main "$@" \ No newline at end of file diff --git a/testcases/function_test/pkg_test/texinfo/texinfo-tex/test_texinfo-tex_texi2dvi__ps.sh b/testcases/function_test/pkg_test/texinfo/texinfo-tex/test_texinfo-tex_texi2dvi__ps.sh deleted file mode 100644 index 1dfd78151c9..00000000000 --- a/testcases/function_test/pkg_test/texinfo/texinfo-tex/test_texinfo-tex_texi2dvi__ps.sh +++ /dev/null @@ -1,100 +0,0 @@ -#!/usr/bin/bash - -# Copyright (c) 2024 ISCAS .ALL rights reserved. -# This program is licensed under Mulan PSL v2. -# You can use it according to the terms and conditions of the Mulan PSL v2. -# http://license.coscl.org.cn/MulanPSL2 -# THIS PROGRAM IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, -# EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, -# MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. -# See the Mulan PSL v2 for more details. - -# ############################################# -# @Author : honghua -# @Contact : honghua@iscas.ac.cn -# @Date : 2026-01-28 -# @License : Mulan PSL v2 -# @Desc : 测试 texi2dvi 命令的 --ps 参数,通过 DVI 输出 PostScript 文件 -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - # 检查是否已安装texinfo-tex包 - LOG_INFO "检查是否已安装texinfo-tex包" - rpm -q texinfo-tex - if [ $? -eq 0 ]; then - LOG_INFO "texinfo-tex已安装,脚本结束时将保持安装状态" - INSTALLED=true - else - LOG_INFO "texinfo-tex未安装,将在测试步骤中安装" - INSTALLED=false - fi - - # 检查yum源中是否有texinfo-tex包 - LOG_INFO "检查yum源中是否有texinfo-tex包" - dnf list available texinfo-tex > /dev/null 2>&1 - if [ $? -ne 0 ]; then - LOG_ERROR "yum源中未找到texinfo-tex包" - exit 255 - fi - - # 如果未安装,则安装texinfo-tex包 - if [ "$INSTALLED" = false ]; then - LOG_INFO "安装texinfo-tex包" - dnf install -y texinfo-tex - CHECK_RESULT $? 0 0 "安装texinfo-tex包失败" - fi - - # 检查texi2dvi命令是否存在 - LOG_INFO "检查texi2dvi命令是否存在" - which texi2dvi > /dev/null 2>&1 - CHECK_RESULT $? 0 0 "texi2dvi命令不存在" - - # 检查texi2dvi命令是否支持--ps参数 - LOG_INFO "检查texi2dvi命令是否支持--ps参数" - texi2dvi --help 2>&1 | grep -q "\-\-ps" - if [ $? -ne 0 ]; then - LOG_ERROR "texi2dvi命令不支持--ps参数" - exit 255 - fi - - # 创建测试用的texinfo文件 - LOG_INFO "创建测试用的texinfo文件" - cat > test.texinfo << "EOF" - \input texinfo - @setfilename test.info - @settitle Test Document - @node Top - @top Test Document - This is a test document. - @bye - EOF - CHECK_RESULT $? 0 0 "创建测试texinfo文件失败" - - # 使用texi2dvi命令的--ps参数生成PostScript文件 - LOG_INFO "使用texi2dvi命令的--ps参数生成PostScript文件" - texi2dvi --ps test.texinfo - CHECK_RESULT $? 0 0 "texi2dvi命令执行失败" - - # 检查生成的PostScript文件是否存在 - LOG_INFO "检查生成的PostScript文件是否存在" - [ -f test.ps ] - CHECK_RESULT $? 0 0 "未生成PostScript文件" - - # 清理测试文件 - LOG_INFO "清理测试文件" - rm -f test.texinfo test.ps test.log test.aux test.cp test.cps test.dvi test.fn test.fns test.ky test.kys test.log test.pg test.toc test.tp test.tps test.vr test.vrs - CHECK_RESULT $? 0 0 "清理测试文件失败" - - # 如果测试前未安装,则卸载texinfo-tex包 - if [ "$INSTALLED" = false ]; then - LOG_INFO "卸载texinfo-tex包" - dnf remove -y texinfo-tex - CHECK_RESULT $? 0 0 "卸载texinfo-tex包失败" - fi - - LOG_INFO "测试完成" -} - -main "$@" \ No newline at end of file diff --git a/testcases/function_test/pkg_test/texinfo/texinfo-tex/test_texinfo-tex_texi2dvi__q.sh b/testcases/function_test/pkg_test/texinfo/texinfo-tex/test_texinfo-tex_texi2dvi__q.sh deleted file mode 100644 index 2133643f2f5..00000000000 --- a/testcases/function_test/pkg_test/texinfo/texinfo-tex/test_texinfo-tex_texi2dvi__q.sh +++ /dev/null @@ -1,90 +0,0 @@ -#!/usr/bin/bash - -# Copyright (c) 2024 ISCAS .ALL rights reserved. -# This program is licensed under Mulan PSL v2. -# You can use it according to the terms and conditions of the Mulan PSL v2. -# http://license.coscl.org.cn/MulanPSL2 -# THIS PROGRAM IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, -# EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, -# MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. -# See the Mulan PSL v2 for more details. - -# ############################################# -# @Author : honghua -# @Contact : honghua@iscas.ac.cn -# @Date : 2026-01-28 -# @License : Mulan PSL v2 -# @Desc : 测试 texi2dvi 命令的 -q 参数,安静模式,仅当错误时输出 -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - LOG_INFO "开始测试 texi2dvi 命令的 -q 参数(安静模式,仅当错误时输出)" - LOG_INFO "步骤1:检查是否已安装 texinfo-tex 软件包" - if dnf list installed texinfo-tex &>/dev/null; then - LOG_INFO "texinfo-tex 已安装,测试结束后将保持安装状态" - INSTALLED=1 - else - LOG_INFO "texinfo-tex 未安装,将在测试前安装" - INSTALLED=0 - fi - - LOG_INFO "步骤2:检查 yum 源中是否有 texinfo-tex 软件包" - if ! dnf list available texinfo-tex &>/dev/null; then - LOG_ERROR "yum 源中未找到 texinfo-tex 软件包" - exit 255 - fi - - if [ $INSTALLED -eq 0 ]; then - LOG_INFO "步骤3:安装 texinfo-tex 软件包" - dnf install -y texinfo-tex - CHECK_RESULT $? 0 0 "安装 texinfo-tex 软件包失败" - fi - - LOG_INFO "步骤4:检查 texi2dvi 命令是否存在" - command -v texi2dvi &>/dev/null - CHECK_RESULT $? 0 0 "texi2dvi 命令不存在" - - LOG_INFO "步骤5:检查 texi2dvi 命令是否支持 -q 参数" - texi2dvi --help 2>&1 | grep -q -- "-q" - CHECK_RESULT $? 0 0 "texi2dvi 命令不支持 -q 参数" - - LOG_INFO "步骤6:创建一个简单的 .texi 测试文件" - cat > test.texi << "EOF" - \input texinfo - @setfilename test.info - @settitle Test Document - @node Top - @top Test - This is a test document. - @bye - EOF - CHECK_RESULT $? 0 0 "创建 test.texi 文件失败" - - LOG_INFO "步骤7:使用 -q 参数运行 texi2dvi,验证安静模式" - texi2dvi -q test.texi 2>&1 | tee /tmp/texi2dvi_output.txt - CHECK_RESULT $? 0 0 "texi2dvi -q 执行失败" - if [ -s /tmp/texi2dvi_output.txt ]; then - LOG_ERROR "在安静模式下,texi2dvi 输出了内容,但预期仅当错误时输出" - exit 1 - else - LOG_INFO "texi2dvi -q 安静模式执行成功,无输出" - fi - - LOG_INFO "步骤8:清理测试文件" - rm -f test.texi test.aux test.cp test.cps test.dvi test.fn test.fns test.ky test.log test.pg test.toc test.tp test.vr test.vrs /tmp/texi2dvi_output.txt - CHECK_RESULT $? 0 0 "清理测试文件失败" - - if [ $INSTALLED -eq 0 ]; then - LOG_INFO "步骤9:卸载 texinfo-tex 软件包" - dnf remove -y texinfo-tex - CHECK_RESULT $? 0 0 "卸载 texinfo-tex 软件包失败" - else - LOG_INFO "步骤9:测试前已安装 texinfo-tex,保持安装状态,无需卸载" - fi - - LOG_INFO "测试完成" -} - -main "$@" \ No newline at end of file diff --git a/testcases/function_test/pkg_test/texinfo/texinfo-tex/test_texinfo-tex_texi2dvi__shell_escape.sh b/testcases/function_test/pkg_test/texinfo/texinfo-tex/test_texinfo-tex_texi2dvi__shell_escape.sh deleted file mode 100644 index 19fb0c779a9..00000000000 --- a/testcases/function_test/pkg_test/texinfo/texinfo-tex/test_texinfo-tex_texi2dvi__shell_escape.sh +++ /dev/null @@ -1,81 +0,0 @@ -#!/usr/bin/bash - -# Copyright (c) 2024 ISCAS .ALL rights reserved. -# This program is licensed under Mulan PSL v2. -# You can use it according to the terms and conditions of the Mulan PSL v2. -# http://license.coscl.org.cn/MulanPSL2 -# THIS PROGRAM IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, -# EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, -# MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. -# See the Mulan PSL v2 for more details. - -# ############################################# -# @Author : honghua -# @Contact : honghua@iscas.ac.cn -# @Date : 2026-01-28 -# @License : Mulan PSL v2 -# @Desc : 测试 texi2dvi 命令的 --shell-escape 参数,传递 --shell-escape 给 TeX -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - LOG_INFO "开始测试 texi2dvi 命令的 --shell-escape 参数" - LOG_INFO "1. 检查系统中是否已安装 texinfo-tex 软件包" - if rpm -q texinfo-tex > /dev/null 2>&1; then - LOG_INFO "texinfo-tex 已安装,测试结束后将保持安装状态" - INSTALLED=1 - else - LOG_INFO "texinfo-tex 未安装,将在测试前安装,测试结束后卸载" - INSTALLED=0 - LOG_INFO "检查 yum 源中是否存在 texinfo-tex 软件包" - if ! dnf list available texinfo-tex > /dev/null 2>&1; then - LOG_ERROR "yum 源中未找到 texinfo-tex 软件包" - exit 255 - fi - LOG_INFO "安装 texinfo-tex 软件包" - dnf install -y texinfo-tex - CHECK_RESULT $? 0 0 "安装 texinfo-tex 失败" - fi - - LOG_INFO "2. 检查 texi2dvi 命令是否支持 --shell-escape 参数" - texi2dvi --help 2>&1 | grep -q -- "--shell-escape" - CHECK_RESULT $? 0 0 "texi2dvi 命令不支持 --shell-escape 参数" - - LOG_INFO "3. 创建一个简单的 .texi 测试文件" - cat > test_shell_escape.texi << "EOF" - \input texinfo - @setfilename test_shell_escape.info - @settitle Test Shell Escape - - @node Top - @top Test Shell Escape - - This is a test file for shell escape. - EOF - CHECK_RESULT $? 0 0 "创建测试文件失败" - - LOG_INFO "4. 执行 texi2dvi 命令,使用 --shell-escape 参数" - texi2dvi --shell-escape test_shell_escape.texi - CHECK_RESULT $? 0 0 "texi2dvi 命令执行失败" - - LOG_INFO "5. 验证是否生成了 .dvi 文件" - ls test_shell_escape.dvi > /dev/null 2>&1 - CHECK_RESULT $? 0 0 "未生成预期的 .dvi 文件" - - LOG_INFO "6. 清理测试生成的文件" - rm -f test_shell_escape.texi test_shell_escape.dvi test_shell_escape.log test_shell_escape.aux - - LOG_INFO "7. 环境恢复:如果测试前未安装 texinfo-tex,则卸载它" - if [ $INSTALLED -eq 0 ]; then - LOG_INFO "卸载 texinfo-tex 软件包" - dnf remove -y texinfo-tex - CHECK_RESULT $? 0 0 "卸载 texinfo-tex 失败" - else - LOG_INFO "测试前已安装 texinfo-tex,保持安装状态" - fi - - LOG_INFO "测试完成" -} - -main "$@" \ No newline at end of file diff --git a/testcases/function_test/pkg_test/texinfo/texinfo-tex/test_texinfo-tex_texi2dvi__src_specials.sh b/testcases/function_test/pkg_test/texinfo/texinfo-tex/test_texinfo-tex_texi2dvi__src_specials.sh deleted file mode 100644 index d35ac15e7bb..00000000000 --- a/testcases/function_test/pkg_test/texinfo/texinfo-tex/test_texinfo-tex_texi2dvi__src_specials.sh +++ /dev/null @@ -1,114 +0,0 @@ -#!/usr/bin/bash - -# Copyright (c) 2024 ISCAS .ALL rights reserved. -# This program is licensed under Mulan PSL v2. -# You can use it according to the terms and conditions of the Mulan PSL v2. -# http://license.coscl.org.cn/MulanPSL2 -# THIS PROGRAM IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, -# EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, -# MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. -# See the Mulan PSL v2 for more details. - -# ############################################# -# @Author : honghua -# @Contact : honghua@iscas.ac.cn -# @Date : 2026-01-28 -# @License : Mulan PSL v2 -# @Desc : 测试 texi2dvi 命令的 --src-specials 参数,传递 --src-specials 给 TeX -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - # 检查texi2dvi命令是否可用 - LOG_INFO "检查texi2dvi命令是否可用" - command -v texi2dvi >/dev/null 2>&1 - if [ $? -eq 0 ]; then - LOG_INFO "texi2dvi命令已存在,测试结束后将保持安装状态" - INSTALLED=true - else - LOG_INFO "texi2dvi命令不存在,将在测试前安装" - INSTALLED=false - fi - - # 如果未安装,则尝试安装texinfo-tex包 - if [ "$INSTALLED" = false ]; then - LOG_INFO "检查yum源中是否有texinfo-tex包" - dnf list available texinfo-tex >/dev/null 2>&1 - if [ $? -ne 0 ]; then - LOG_ERROR "yum源中未找到texinfo-tex包" - exit 255 - fi - - LOG_INFO "安装texinfo-tex包" - dnf install -y texinfo-tex - CHECK_RESULT $? 0 0 "安装texinfo-tex包失败" - fi - - # 创建测试用的简单texinfo文件 - LOG_INFO "创建测试用的texinfo文件" - cat > test.texinfo << "EOF" - \input texinfo - @setfilename test.info - @settitle Test Document - @node Top - @top Test Document - This is a test document. - @bye - EOF - - # 测试texi2dvi命令的--src-specials参数 - LOG_INFO "测试texi2dvi命令的--src-specials参数" - texi2dvi --help 2>&1 | grep -q "\-\-src-specials" - if [ $? -ne 0 ]; then - LOG_ERROR "texi2dvi命令不支持--src-specials参数" - # 清理测试文件 - rm -f test.texinfo test.aux test.cp test.cps test.fn test.fns test.ky test.log test.op test.pg test.toc test.tp test.vr test.dvi 2>/dev/null - if [ "$INSTALLED" = false ]; then - dnf remove -y texinfo-tex - fi - exit 255 - fi - - LOG_INFO "执行texi2dvi --src-specials test.texinfo" - texi2dvi --src-specials test.texinfo - CHECK_RESULT $? 0 0 "texi2dvi --src-specials执行失败" - - # 检查是否生成了DVI文件 - LOG_INFO "检查是否生成了DVI文件" - if [ -f test.dvi ]; then - LOG_INFO "成功生成test.dvi文件" - # 检查DVI文件是否包含src-specials标记(通过检查文件大小是否比没有--src-specials时大) - LOG_INFO "检查DVI文件是否包含src-specials标记" - # 先生成没有--src-specials的DVI文件作为比较 - texi2dvi test.texinfo --batch -o test_no_src.dvi 2>/dev/null - if [ -f test_no_src.dvi ] && [ -f test.dvi ]; then - size_with=$(stat -c%s test.dvi) - size_without=$(stat -c%s test_no_src.dvi) - if [ $size_with -gt $size_without ]; then - LOG_INFO "DVI文件包含src-specials标记(文件大小: ${size_with} > ${size_without})" - else - LOG_INFO "DVI文件可能不包含src-specials标记" - fi - rm -f test_no_src.dvi - fi - else - LOG_ERROR "未生成test.dvi文件" - CHECK_RESULT 1 0 0 "未生成DVI文件" - fi - - # 清理测试文件 - LOG_INFO "清理测试文件" - rm -f test.texinfo test.aux test.cp test.cps test.fn test.fns test.ky test.log test.op test.pg test.toc test.tp test.vr test.dvi 2>/dev/null - - # 如果测试前未安装,测试后卸载软件包 - if [ "$INSTALLED" = false ]; then - LOG_INFO "卸载texinfo-tex包" - dnf remove -y texinfo-tex - CHECK_RESULT $? 0 0 "卸载texinfo-tex包失败" - fi - - LOG_INFO "测试完成" -} - -main "$@" \ No newline at end of file diff --git a/testcases/function_test/pkg_test/texinfo/texinfo-tex/test_texinfo-tex_texi2dvi__t.sh b/testcases/function_test/pkg_test/texinfo/texinfo-tex/test_texinfo-tex_texi2dvi__t.sh deleted file mode 100644 index 73f1a7f0e84..00000000000 --- a/testcases/function_test/pkg_test/texinfo/texinfo-tex/test_texinfo-tex_texi2dvi__t.sh +++ /dev/null @@ -1,115 +0,0 @@ -#!/usr/bin/bash - -# Copyright (c) 2024 ISCAS .ALL rights reserved. -# This program is licensed under Mulan PSL v2. -# You can use it according to the terms and conditions of the Mulan PSL v2. -# http://license.coscl.org.cn/MulanPSL2 -# THIS PROGRAM IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, -# EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, -# MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. -# See the Mulan PSL v2 for more details. - -# ############################################# -# @Author : honghua -# @Contact : honghua@iscas.ac.cn -# @Date : 2026-01-28 -# @License : Mulan PSL v2 -# @Desc : 测试 texi2dvi 命令的 -t 参数,在输入文件副本中插入命令 -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - # 定义函数用于检查软件包是否在yum源中 - check_package_exists() { - local package_name=$1 - if ! dnf search --quiet "$package_name" | grep -q "^$package_name\."; then - LOG_ERROR "软件包 $package_name 在yum源中不存在" - exit 255 - fi - } - - # 定义函数用于检查命令参数是否存在 - check_param_exist() { - local command=$1 - local param=$2 - if ! $command --help 2>&1 | grep -q "\b$param\b"; then - LOG_ERROR "命令 $command 不支持参数 $param" - exit 255 - fi - } - - # 定义函数用于安装软件包 - install_package() { - local package_name=$1 - LOG_INFO "准备安装软件包: $package_name" - check_package_exists "$package_name" - dnf install -y "$package_name" - CHECK_RESULT $? 0 0 "安装软件包 $package_name 失败" - LOG_INFO "软件包 $package_name 安装成功" - } - - # 定义函数用于卸载软件包 - uninstall_package() { - local package_name=$1 - LOG_INFO "准备卸载软件包: $package_name" - dnf remove -y "$package_name" - CHECK_RESULT $? 0 0 "卸载软件包 $package_name 失败" - LOG_INFO "软件包 $package_name 卸载成功" - } - - # 检查环境是否已安装 texinfo-tex 软件包 - LOG_INFO "检查 texinfo-tex 软件包是否已安装" - if ! rpm -q texinfo-tex > /dev/null 2>&1; then - LOG_INFO "texinfo-tex 软件包未安装,测试过程中自动安装并在结束后卸载" - need_uninstall=true - install_package "texinfo-tex" - else - LOG_INFO "texinfo-tex 软件包已安装,测试结束后保持安装状态" - need_uninstall=false - fi - - # 检查 texi2dvi 命令是否存在 - LOG_INFO "检查 texi2dvi 命令是否存在" - if ! command -v texi2dvi > /dev/null 2>&1; then - LOG_ERROR "texi2dvi 命令不存在" - exit 255 - fi - - # 检查 texi2dvi 命令的 -t 参数是否存在 - LOG_INFO "检查 texi2dvi 命令是否支持 -t 参数" - check_param_exist "texi2dvi" "-t" - - # 创建测试用的 texi 文件 - LOG_INFO "创建测试用的 TeX 文件" - cat > test_input.texi << "EOF" - \input texinfo - @setfilename test_output - @settitle Test Document - @node Top - @top Test Document - This is a test document. - @bye - EOF - CHECK_RESULT $? 0 0 "创建测试 TeX 文件失败" - - # 测试 texi2dvi 命令的 -t 参数 - LOG_INFO "测试 texi2dvi 命令的 -t 参数,在输入文件副本中插入命令" - texi2dvi -t test_input.texi - CHECK_RESULT $? 0 0 "texi2dvi 命令的 -t 参数执行失败" - - # 清理测试文件 - LOG_INFO "清理测试文件" - rm -f test_input.texi test_output.aux test_output.cp test_output.cps test_output.fn test_input.toc test_output.fns test_output.ky test_output.log test_output.pg test_output.toc test_output.tp test_output.vr test_output.dvi - CHECK_RESULT $? 0 0 "清理测试文件失败" - - # 如果测试开始时环境未安装软件包,则卸载 - if [ "$need_uninstall" = true ]; then - LOG_INFO "测试结束,卸载 texinfo-tex 软件包" - uninstall_package "texinfo-tex" - fi - - LOG_INFO "测试脚本执行完毕" -} - -main "$@" \ No newline at end of file diff --git a/testcases/function_test/pkg_test/texinfo/texinfo-tex/test_texinfo-tex_texi2dvi__text.sh b/testcases/function_test/pkg_test/texinfo/texinfo-tex/test_texinfo-tex_texi2dvi__text.sh deleted file mode 100644 index 268daff7705..00000000000 --- a/testcases/function_test/pkg_test/texinfo/texinfo-tex/test_texinfo-tex_texi2dvi__text.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-01-28 -# @License : Mulan PSL v2 -# @Desc : 测试 texi2dvi 命令的 --text 参数,使用 HeVeA 从 LaTeX 输出纯文本文件 -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - LOG_INFO "开始测试 texi2dvi 命令的 --text 参数,使用 HeVeA 从 LaTeX 输出纯文本文件" - LOG_INFO "步骤1:检查是否已安装 texinfo-tex 软件包" - dnf list installed texinfo-tex > /dev/null 2>&1 - if [ $? -eq 0 ]; then - LOG_INFO "texinfo-tex 已安装,脚本结束时保持安装状态" - INSTALLED=1 - else - LOG_INFO "texinfo-tex 未安装,将在测试步骤中安装" - INSTALLED=0 - fi - LOG_INFO "步骤2:检查 yum 源中是否有 texinfo-tex 软件包" - dnf list available texinfo-tex > /dev/null 2>&1 - CHECK_RESULT $? 0 0 "yum 源中未找到 texinfo-tex 软件包" - if [ $? -ne 0 ]; then - LOG_ERROR "yum 源中未找到 texinfo-tex 软件包" - exit 255 - fi - if [ $INSTALLED -eq 0 ]; then - LOG_INFO "步骤3:安装 texinfo-tex 软件包" - dnf install -y texinfo-tex - CHECK_RESULT $? 0 0 "安装 texinfo-tex 失败" - fi - LOG_INFO "步骤4:检查 texi2dvi 命令是否支持 --text 参数" - texi2dvi --help 2>&1 | grep -q "\-\-text" - CHECK_RESULT $? 0 0 "texi2dvi 命令不支持 --text 参数" - if [ $? -ne 0 ]; then - LOG_ERROR "texi2dvi 命令不支持 --text 参数" - exit 255 - fi - LOG_INFO "步骤5:创建一个简单的 TeX 文件用于测试" - cat > test.tex << "EOF" - \documentclass{article} - \begin{document} - Hello, World! - \end{document} - EOF - CHECK_RESULT $? 0 0 "创建测试文件失败" - LOG_INFO "步骤6:使用 texi2dvi 命令的 --text 参数生成纯文本文件" - texi2dvi --text test.tex - CHECK_RESULT $? 0 0 "texi2dvi 命令执行失败" - LOG_INFO "步骤7:检查生成的纯文本文件是否存在" - ls test.txt > /dev/null 2>&1 - CHECK_RESULT $? 0 0 "未生成纯文本文件 test.txt" - LOG_INFO "步骤8:清理测试文件" - rm -f test.tex test.txt test.aux test.log - CHECK_RESULT $? 0 0 "清理测试文件失败" - if [ $INSTALLED -eq 0 ]; then - LOG_INFO "步骤9:卸载 texinfo-tex 软件包" - dnf remove -y texinfo-tex - CHECK_RESULT $? 0 0 "卸载 texinfo-tex 失败" - fi - LOG_INFO "测试完成" -} - -main "$@" \ No newline at end of file diff --git a/testcases/function_test/pkg_test/texinfo/texinfo-tex/test_texinfo-tex_texi2dvi__tidy.sh b/testcases/function_test/pkg_test/texinfo/texinfo-tex/test_texinfo-tex_texi2dvi__tidy.sh deleted file mode 100644 index 90531f5e70b..00000000000 --- a/testcases/function_test/pkg_test/texinfo/texinfo-tex/test_texinfo-tex_texi2dvi__tidy.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-01-28 -# @License : Mulan PSL v2 -# @Desc : 测试 texi2dvi 命令的 --tidy 参数,等同于 --build=tidy,在本地 *.t2d 目录中编译 -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - # 检查是否已安装texinfo-tex - LOG_INFO "检查是否已安装texinfo-tex" - rpm -q texinfo-tex > /dev/null 2>&1 - if [ $? -eq 0 ]; then - LOG_INFO "texinfo-tex已安装,测试结束后将保持安装状态" - INSTALLED_FLAG=0 - else - LOG_INFO "texinfo-tex未安装,将在测试前安装" - INSTALLED_FLAG=1 - fi - - # 检查yum源中是否有texinfo-tex软件包 - LOG_INFO "检查yum源中是否有texinfo-tex软件包" - dnf list available texinfo-tex > /dev/null 2>&1 - CHECK_RESULT $? 0 0 "yum源中未找到texinfo-tex软件包" - if [ $? -ne 0 ]; then - LOG_ERROR "yum源中未找到texinfo-tex软件包" - exit 255 - fi - - # 如果未安装,则安装texinfo-tex - if [ ${INSTALLED_FLAG} -eq 1 ]; then - LOG_INFO "安装texinfo-tex软件包" - dnf install -y texinfo-tex > /dev/null 2>&1 - CHECK_RESULT $? 0 0 "安装texinfo-tex失败" - fi - - # 检查texi2dvi命令是否存在 - LOG_INFO "检查texi2dvi命令是否存在" - which texi2dvi > /dev/null 2>&1 - CHECK_RESULT $? 0 0 "texi2dvi命令不存在" - - # 检查texi2dvi命令是否支持--tidy参数 - LOG_INFO "检查texi2dvi命令是否支持--tidy参数" - texi2dvi --help 2>&1 | grep -q "\-\-tidy" - CHECK_RESULT $? 0 0 "texi2dvi命令不支持--tidy参数" - if [ $? -ne 0 ]; then - LOG_ERROR "texi2dvi命令不支持--tidy参数" - exit 255 - fi - - # 创建一个简单的texinfo测试文件 - LOG_INFO "创建测试用的texinfo文件" - cat > test.texinfo << "EOF" - \input texinfo - @setfilename test.info - @settitle Test Document - @node Top - @top Test Document - This is a test document. - @bye - EOF - CHECK_RESULT $? 0 0 "创建texinfo测试文件失败" - - # 使用--tidy参数运行texi2dvi命令 - LOG_INFO "执行texi2dvi --tidy命令" - texi2dvi --tidy test.texinfo > /dev/null 2>&1 - CHECK_RESULT $? 0 0 "texi2dvi --tidy命令执行失败" - - # 检查是否生成了.t2d目录 - LOG_INFO "检查是否生成了.t2d目录" - if [ -d "test.t2d" ]; then - LOG_INFO "成功生成.t2d目录" - CHECK_RESULT 0 0 0 "未生成.t2d目录" - else - LOG_ERROR "未生成.t2d目录" - CHECK_RESULT 1 0 0 "未生成.t2d目录" - fi - - # 清理测试文件 - LOG_INFO "清理测试文件" - rm -rf test.texinfo test.t2d test.aux test.cp test.cps test.fn test.fns test.ky test.kys test.log test.pg test.toc test.tp test.tps test.vr test.vrs > /dev/null 2>&1 - CHECK_RESULT $? 0 0 "清理测试文件失败" - - # 如果测试前未安装texinfo-tex,则在测试后卸载 - if [ ${INSTALLED_FLAG} -eq 1 ]; then - LOG_INFO "卸载texinfo-tex软件包" - dnf remove -y texinfo-tex > /dev/null 2>&1 - CHECK_RESULT $? 0 0 "卸载texinfo-tex失败" - fi - - LOG_INFO "测试完成" -} - -main "$@" \ No newline at end of file diff --git a/testcases/function_test/pkg_test/texinfo/texinfo-tex/test_texinfo-tex_texi2dvi__translate_file.sh b/testcases/function_test/pkg_test/texinfo/texinfo-tex/test_texinfo-tex_texi2dvi__translate_file.sh deleted file mode 100644 index bb9f3e778aa..00000000000 --- a/testcases/function_test/pkg_test/texinfo/texinfo-tex/test_texinfo-tex_texi2dvi__translate_file.sh +++ /dev/null @@ -1,98 +0,0 @@ -#!/usr/bin/bash - -# Copyright (c) 2024 ISCAS .ALL rights reserved. -# This program is licensed under Mulan PSL v2. -# You can use it according to the terms and conditions of the Mulan PSL v2. -# http://license.coscl.org.cn/MulanPSL2 -# THIS PROGRAM IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, -# EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, -# MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. -# See the Mulan PSL v2 for more details. - -# ############################################# -# @Author : honghua -# @Contact : honghua@iscas.ac.cn -# @Date : 2026-01-28 -# @License : Mulan PSL v2 -# @Desc : 测试 texi2dvi 命令的 --translate-file 参数,为 TeX 使用指定的字符集翻译文件 -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - LOG_INFO "1. 检查环境是否已安装texinfo-tex软件包" - rpm -q texinfo-tex - if [ $? -eq 0 ]; then - LOG_INFO "texinfo-tex已安装,测试结束后将保持安装状态" - INSTALLED=1 - else - LOG_INFO "texinfo-tex未安装,将在测试步骤中安装,并在测试结束后卸载" - INSTALLED=0 - fi - - LOG_INFO "2. 检查yum源中是否存在texinfo-tex软件包" - dnf list available texinfo-tex 2>&1 | grep -q "texinfo-tex" - if [ $? -ne 0 ]; then - LOG_ERROR "yum源中未找到texinfo-tex软件包" - exit 255 - fi - - if [ $INSTALLED -eq 0 ]; then - LOG_INFO "3. 安装texinfo-tex软件包" - dnf install -y texinfo-tex - CHECK_RESULT $? 0 0 "安装texinfo-tex失败" - fi - - LOG_INFO "4. 检查texi2dvi命令是否存在" - which texi2dvi - CHECK_RESULT $? 0 0 "texi2dvi命令未找到" - - LOG_INFO "5. 检查texi2dvi命令是否支持--translate-file参数" - texi2dvi --help 2>&1 | grep -q "\-\-translate-file" - if [ $? -ne 0 ]; then - LOG_ERROR "texi2dvi命令不支持--translate-file参数" - exit 255 - fi - - LOG_INFO "6. 创建一个简单的.texinfo测试文件" - cat > test.texinfo << "EOF" - \input texinfo - @setfilename test.info - @settitle Test Document - @node Top - @top Test Document - This is a test document. - @bye - EOF - CHECK_RESULT $? 0 0 "创建test.texinfo文件失败" - - LOG_INFO "7. 创建一个简单的字符集翻译文件" - cat > test.trans << "EOF" - % Dummy translation file for testing - EOF - CHECK_RESULT $? 0 0 "创建test.trans文件失败" - - LOG_INFO "8. 测试texi2dvi命令的--translate-file参数" - texi2dvi --translate-file=test.trans test.texinfo - CHECK_RESULT $? 0 0 "texi2dvi命令执行失败" - - LOG_INFO "9. 检查是否生成了DVI文件" - [ -f test.dvi ] - CHECK_RESULT $? 0 0 "未生成test.dvi文件" - - LOG_INFO "10. 清理测试生成的文件" - rm -f test.texinfo test.trans test.dvi test.log test.aux test.toc - CHECK_RESULT $? 0 0 "清理测试文件失败" - - if [ $INSTALLED -eq 0 ]; then - LOG_INFO "11. 卸载测试安装的texinfo-tex软件包" - dnf remove -y texinfo-tex - CHECK_RESULT $? 0 0 "卸载texinfo-tex失败" - else - LOG_INFO "11. 测试前已安装texinfo-tex,保持安装状态" - fi - - LOG_INFO "12. 测试完成,环境已恢复" -} - -main "$@" \ No newline at end of file diff --git a/testcases/function_test/pkg_test/texinfo/texinfo-tex/test_texinfo-tex_texi2dvi__upper_d.sh b/testcases/function_test/pkg_test/texinfo/texinfo-tex/test_texinfo-tex_texi2dvi__upper_d.sh deleted file mode 100644 index 9796b2aeee0..00000000000 --- a/testcases/function_test/pkg_test/texinfo/texinfo-tex/test_texinfo-tex_texi2dvi__upper_d.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-01-28 -# @License : Mulan PSL v2 -# @Desc : 测试 texi2dvi 命令的 -D 参数,开启 shell 调试模式 -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - # 检查是否已经安装texinfo-tex - LOG_INFO "检查texinfo-tex是否已安装" - rpm -q texinfo-tex > /dev/null 2>&1 - if [ $? -eq 0 ]; then - LOG_INFO "texinfo-tex已安装,测试完成后将保持安装状态" - INSTALLED="true" - else - LOG_INFO "texinfo-tex未安装,将进行安装" - INSTALLED="false" - fi - - # 检查yum源中是否有texinfo-tex软件包 - LOG_INFO "检查yum源中是否有texinfo-tex软件包" - dnf list available texinfo-tex > /dev/null 2>&1 - if [ $? -ne 0 ]; then - LOG_ERROR "yum源中没有texinfo-tex软件包" - exit 255 - fi - - # 如果未安装,则安装软件包 - if [ "$INSTALLED" = "false" ]; then - LOG_INFO "安装texinfo-tex软件包" - dnf install -y texinfo-tex > /dev/null 2>&1 - CHECK_RESULT $? 0 0 "安装texinfo-tex失败" - fi - - # 测试texi2dvi命令的-D参数 - LOG_INFO "测试texi2dvi命令的-D参数" - texi2dvi --help 2>&1 | grep -q "\-D" - if [ $? -ne 0 ]; then - LOG_ERROR "texi2dvi命令不支持-D参数" - # 如果之前未安装,需要卸载软件包 - if [ "$INSTALLED" = "false" ]; then - LOG_INFO "卸载texinfo-tex软件包" - dnf remove -y texinfo-tex > /dev/null 2>&1 - fi - exit 255 - fi - - # 创建一个简单的texinfo文件用于测试 - LOG_INFO "创建测试用的texinfo文件" - cat > test.texinfo << "EOF" - \input texinfo - @setfilename test.info - @settitle Test Document - @bye - EOF - CHECK_RESULT $? 0 0 "创建texinfo文件失败" - - # 使用-D参数执行texi2dvi命令 - LOG_INFO "执行texi2dvi -D命令" - texi2dvi -D test.texinfo > output.log 2>&1 - CHECK_RESULT $? 0 0 "texi2dvi -D命令执行失败" - - # 检查是否生成了预期的输出文件 - LOG_INFO "检查是否生成了DVI文件" - if [ -f test.dvi ]; then - LOG_INFO "成功生成DVI文件" - else - LOG_ERROR "未生成DVI文件" - # 清理测试文件 - rm -f test.texinfo output.log - # 如果之前未安装,需要卸载软件包 - if [ "$INSTALLED" = "false" ]; then - LOG_INFO "卸载texinfo-tex软件包" - dnf remove -y texinfo-tex > /dev/null 2>&1 - fi - exit 1 - fi - - # 清理测试文件 - LOG_INFO "清理测试文件" - rm -f test.texinfo test.dvi output.log - CHECK_RESULT $? 0 0 "清理测试文件失败" - - # 如果测试开始时未安装,则卸载软件包 - if [ "$INSTALLED" = "false" ]; then - LOG_INFO "卸载texinfo-tex软件包" - dnf remove -y texinfo-tex > /dev/null 2>&1 - CHECK_RESULT $? 0 0 "卸载texinfo-tex失败" - fi - - LOG_INFO "测试完成" -} - -main "$@" \ No newline at end of file diff --git a/testcases/function_test/pkg_test/texinfo/texinfo-tex/test_texinfo-tex_texi2dvi__upper_e.sh b/testcases/function_test/pkg_test/texinfo/texinfo-tex/test_texinfo-tex_texi2dvi__upper_e.sh deleted file mode 100644 index a0ce127af90..00000000000 --- a/testcases/function_test/pkg_test/texinfo/texinfo-tex/test_texinfo-tex_texi2dvi__upper_e.sh +++ /dev/null @@ -1,87 +0,0 @@ -#!/usr/bin/bash - -# Copyright (c) 2024 ISCAS .ALL rights reserved. -# This program is licensed under Mulan PSL v2. -# You can use it according to the terms and conditions of the Mulan PSL v2. -# http://license.coscl.org.cn/MulanPSL2 -# THIS PROGRAM IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, -# EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, -# MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. -# See the Mulan PSL v2 for more details. - -# ############################################# -# @Author : honghua -# @Contact : honghua@iscas.ac.cn -# @Date : 2026-01-28 -# @License : Mulan PSL v2 -# @Desc : 测试 texi2dvi 命令的 -E 参数,使用 makeinfo 进行宏扩展 -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - LOG_INFO "1. 检查系统是否已安装texinfo-tex软件包" - rpm -q texinfo-tex - if [ $? -eq 0 ]; then - LOG_INFO "texinfo-tex软件包已安装,脚本结束时将保持安装状态" - INSTALLED=1 - else - LOG_INFO "texinfo-tex软件包未安装,将在测试步骤中安装" - INSTALLED=0 - fi - - LOG_INFO "2. 检查yum源中是否存在texinfo-tex软件包" - dnf list available texinfo-tex - if [ $? -ne 0 ]; then - LOG_ERROR "yum源中未找到texinfo-tex软件包" - exit 255 - fi - - LOG_INFO "3. 如果未安装,则安装texinfo-tex软件包" - if [ $INSTALLED -eq 0 ]; then - dnf install -y texinfo-tex - CHECK_RESULT $? 0 0 "安装texinfo-tex软件包失败" - fi - - LOG_INFO "4. 检查texi2dvi命令是否存在" - which texi2dvi - CHECK_RESULT $? 0 0 "texi2dvi命令未找到" - - LOG_INFO "5. 检查texi2dvi命令是否支持-E参数" - texi2dvi --help 2>&1 | grep -q "\-E" - if [ $? -ne 0 ]; then - LOG_ERROR "texi2dvi命令不支持-E参数" - exit 255 - fi - - LOG_INFO "6. 创建一个简单的texinfo测试文件" - cat > test.texinfo << "EOF" - \input texinfo - @setfilename test.info - @settitle Test Document - @bye - EOF - CHECK_RESULT $? 0 0 "创建texinfo测试文件失败" - - LOG_INFO "7. 使用texi2dvi -E命令处理测试文件" - texi2dvi -E test.texinfo - CHECK_RESULT $? 0 0 "texi2dvi -E命令执行失败" - - LOG_INFO "8. 验证生成的中间文件" - ls test.txi - CHECK_RESULT $? 0 0 "未找到生成的中间文件test.txi" - - LOG_INFO "9. 清理测试生成的文件" - rm -f test.texinfo test.txi test.aux test.cp test.cps test.fn test.fns test.ky test.log test.op test.pg test.toc test.tp test.vr test.dvi test.fls test.vrs - CHECK_RESULT $? 0 0 "清理测试文件失败" - - LOG_INFO "10. 如果脚本开始时未安装,则卸载texinfo-tex软件包" - if [ $INSTALLED -eq 0 ]; then - dnf remove -y texinfo-tex - CHECK_RESULT $? 0 0 "卸载texinfo-tex软件包失败" - fi - - LOG_INFO "测试完成" -} - -main "$@" \ No newline at end of file diff --git a/testcases/function_test/pkg_test/texinfo/texinfo-tex/test_texinfo-tex_texi2dvi__upper_i.sh b/testcases/function_test/pkg_test/texinfo/texinfo-tex/test_texinfo-tex_texi2dvi__upper_i.sh deleted file mode 100644 index 1d2d4da3c3c..00000000000 --- a/testcases/function_test/pkg_test/texinfo/texinfo-tex/test_texinfo-tex_texi2dvi__upper_i.sh +++ /dev/null @@ -1,126 +0,0 @@ -#!/usr/bin/bash - -# Copyright (c) 2024 ISCAS .ALL rights reserved. -# This program is licensed under Mulan PSL v2. -# You can use it according to the terms and conditions of the Mulan PSL v2. -# http://license.coscl.org.cn/MulanPSL2 -# THIS PROGRAM IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, -# EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, -# MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. -# See the Mulan PSL v2 for more details. - -# ############################################# -# @Author : honghua -# @Contact : honghua@iscas.ac.cn -# @Date : 2026-01-28 -# @License : Mulan PSL v2 -# @Desc : 测试 texi2dvi 命令的 -I 参数,指定 Texinfo 文件的搜索目录 -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - # 步骤1:检查系统中是否已安装texinfo-tex和texlive相关依赖 - LOG_INFO "检查是否已安装texinfo-tex软件包" - rpm -q texinfo-tex > /dev/null 2>&1 - if [ $? -eq 0 ]; then - LOG_INFO "texinfo-tex已安装,标记为需要保持" - KEEP_INSTALL=1 - else - LOG_INFO "texinfo-tex未安装,标记为需要清理" - KEEP_INSTALL=0 - fi - - # 步骤2:检查yum源中是否有texinfo-tex软件包 - LOG_INFO "检查yum源中是否有texinfo-tex软件包" - dnf list available texinfo-tex > /dev/null 2>&1 - if [ $? -ne 0 ]; then - LOG_ERROR "yum源中未找到texinfo-tex软件包" - exit 255 - fi - - # 步骤3:如果未安装则进行安装 - if [ $KEEP_INSTALL -eq 0 ]; then - LOG_INFO "正在安装texinfo-tex软件包" - dnf install -y texinfo-tex > /dev/null 2>&1 - CHECK_RESULT $? 0 0 "安装texinfo-tex失败" - LOG_INFO "texinfo-tex安装成功" - fi - - # 步骤4:检查texi2dvi命令是否存在 - LOG_INFO "检查texi2dvi命令是否存在" - which texi2dvi > /dev/null 2>&1 - if [ $? -ne 0 ]; then - LOG_ERROR "texi2dvi命令不存在" - if [ $KEEP_INSTALL -eq 0 ]; then - dnf remove -y texinfo-tex > /dev/null 2>&1 - fi - exit 1 - fi - - # 步骤5:检查texi2dvi是否支持-I参数 - LOG_INFO "检查texi2dvi命令是否支持-I参数" - texi2dvi --help 2>&1 | grep -q "\-I" - if [ $? -ne 0 ]; then - LOG_ERROR "texi2dvi不支持-I参数" - if [ $KEEP_INSTALL -eq 0 ]; then - dnf remove -y texinfo-tex > /dev/null 2>&1 - fi - exit 255 - fi - - # 步骤6:准备测试用的Texinfo文件 - LOG_INFO "创建测试用Texinfo文件和包含目录" - TEST_DIR=$(mktemp -d) - TEST_TEXINFO="$TEST_DIR/test.texinfo" - TEST_INCLUDE_DIR="$TEST_DIR/include" - TEST_INCLUDE_FILE="$TEST_INCLUDE_DIR/included.texinfo" - - mkdir -p "$TEST_INCLUDE_DIR" - - cat > "$TEST_TEXINFO" << EOF - \\input texinfo - @setfilename test.info - @settitle Test Document - @include included.texinfo - @bye - EOF - - cat > "$TEST_INCLUDE_FILE" << EOF - This is an included file. - EOF - - # 步骤7:测试texi2dvi的-I参数 - LOG_INFO "测试texi2dvi命令的-I参数功能" - cd "$TEST_DIR" - texi2dvi -I "$TEST_INCLUDE_DIR" test.texinfo > /dev/null 2>&1 - CHECK_RESULT $? 0 0 "texi2dvi -I参数测试失败" - LOG_INFO "texi2dvi -I参数测试成功" - - # 步骤8:验证生成的DVI文件 - LOG_INFO "验证生成的DVI文件" - if [ -f test.dvi ]; then - LOG_INFO "成功生成test.dvi文件" - else - LOG_ERROR "未生成test.dvi文件" - CHECK_RESULT 1 0 0 "未生成预期的DVI文件" - fi - - # 步骤9:清理测试文件 - LOG_INFO "清理测试临时文件" - rm -rf "$TEST_DIR" - - # 步骤10:如果之前未安装则卸载软件包 - if [ $KEEP_INSTALL -eq 0 ]; then - LOG_INFO "卸载texinfo-tex软件包" - dnf remove -y texinfo-tex > /dev/null 2>&1 - CHECK_RESULT $? 0 0 "卸载texinfo-tex失败" - LOG_INFO "环境恢复完成" - else - LOG_INFO "保持texinfo-tex安装状态" - fi - - LOG_INFO "测试脚本执行完成" -} - -main "$@" \ No newline at end of file diff --git a/testcases/function_test/pkg_test/texinfo/texinfo-tex/test_texinfo-tex_texi2dvi__upper_v.sh b/testcases/function_test/pkg_test/texinfo/texinfo-tex/test_texinfo-tex_texi2dvi__upper_v.sh deleted file mode 100644 index 78b8b556bae..00000000000 --- a/testcases/function_test/pkg_test/texinfo/texinfo-tex/test_texinfo-tex_texi2dvi__upper_v.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-01-28 -# @License : Mulan PSL v2 -# @Desc : 测试 texi2dvi 命令的 -V 参数,详细报告执行过程 -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - # 检查是否已经安装texinfo-tex - LOG_INFO "检查是否已安装texinfo-tex软件包" - if dnf list installed texinfo-tex &>/dev/null; then - LOG_INFO "texinfo-tex已安装" - INSTALLED=true - else - LOG_INFO "texinfo-tex未安装" - INSTALLED=false - fi - - # 检查yum源中是否有texinfo-tex软件包 - LOG_INFO "检查yum源中是否有texinfo-tex软件包" - if ! dnf list available texinfo-tex &>/dev/null; then - LOG_ERROR "yum源中未找到texinfo-tex软件包" - exit 255 - fi - - # 如果未安装,则安装texinfo-tex - if [ "$INSTALLED" = false ]; then - LOG_INFO "开始安装texinfo-tex软件包" - dnf install -y texinfo-tex - CHECK_RESULT $? 0 0 "安装texinfo-tex失败" - LOG_INFO "texinfo-tex安装成功" - fi - - # 测试texi2dvi命令的-V参数 - LOG_INFO "测试texi2dvi命令的-V参数" - if ! texi2dvi --help 2>&1 | grep -q "\-V"; then - LOG_ERROR "texi2dvi命令不支持-V参数" - if [ "$INSTALLED" = false ]; then - LOG_INFO "卸载texinfo-tex软件包" - dnf remove -y texinfo-tex - CHECK_RESULT $? 0 0 "卸载texinfo-tex失败" - fi - exit 255 - fi - - LOG_INFO "执行texi2dvi -V命令" - texi2dvi -V - CHECK_RESULT $? 0 0 "texi2dvi -V命令执行失败" - - # 清理环境 - if [ "$INSTALLED" = false ]; then - LOG_INFO "卸载texinfo-tex软件包" - dnf remove -y texinfo-tex - CHECK_RESULT $? 0 0 "卸载texinfo-tex失败" - LOG_INFO "texinfo-tex卸载成功" - else - LOG_INFO "保持texinfo-tex安装状态" - fi - - LOG_INFO "测试完成" -} - -main "$@" \ No newline at end of file diff --git a/testcases/function_test/pkg_test/texinfo/texinfo-tex/test_texinfo-tex_texi2dvi__v.sh b/testcases/function_test/pkg_test/texinfo/texinfo-tex/test_texinfo-tex_texi2dvi__v.sh deleted file mode 100644 index 65e9f2d7d7a..00000000000 --- a/testcases/function_test/pkg_test/texinfo/texinfo-tex/test_texinfo-tex_texi2dvi__v.sh +++ /dev/null @@ -1,75 +0,0 @@ -#!/usr/bin/bash - -# Copyright (c) 2024 ISCAS .ALL rights reserved. -# This program is licensed under Mulan PSL v2. -# You can use it according to the terms and conditions of the Mulan PSL v2. -# http://license.coscl.org.cn/MulanPSL2 -# THIS PROGRAM IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, -# EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, -# MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. -# See the Mulan PSL v2 for more details. - -# ############################################# -# @Author : honghua -# @Contact : honghua@iscas.ac.cn -# @Date : 2026-01-28 -# @License : Mulan PSL v2 -# @Desc : 测试 texi2dvi 命令的 -v 参数,显示版本信息 -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - LOG_INFO "开始测试 texi2dvi 命令的 -v 参数,显示版本信息" - - LOG_INFO "步骤1:检查环境是否已安装 texinfo-tex 软件包" - if rpm -q texinfo-tex > /dev/null 2>&1; then - LOG_INFO "texinfo-tex 已安装,脚本结束时将保持安装状态" - INSTALLED=true - else - LOG_INFO "texinfo-tex 未安装,将在测试步骤中安装" - INSTALLED=false - fi - - LOG_INFO "步骤2:检查 yum 源中是否有 texinfo-tex 软件包" - if ! dnf list available texinfo-tex > /dev/null 2>&1; then - LOG_ERROR "yum 源中未找到 texinfo-tex 软件包" - exit 255 - fi - - if [ "$INSTALLED" = false ]; then - LOG_INFO "步骤3:安装 texinfo-tex 软件包" - dnf install -y texinfo-tex - CHECK_RESULT $? 0 0 "安装 texinfo-tex 失败" - fi - - LOG_INFO "步骤4:检查 texi2dvi 命令是否存在" - if ! command -v texi2dvi > /dev/null 2>&1; then - LOG_ERROR "texi2dvi 命令不存在" - exit 255 - fi - - LOG_INFO "步骤5:检查 texi2dvi 命令是否支持 -v 参数" - texi2dvi -v > /dev/null 2>&1 - if [ $? -eq 255 ]; then - LOG_ERROR "texi2dvi 命令不支持 -v 参数" - exit 255 - fi - - LOG_INFO "步骤6:执行 texi2dvi -v 命令,显示版本信息" - texi2dvi -v - CHECK_RESULT $? 0 0 "执行 texi2dvi -v 命令失败" - - LOG_INFO "步骤7:清理环境" - if [ "$INSTALLED" = false ]; then - LOG_INFO "卸载 texinfo-tex 软件包" - dnf remove -y texinfo-tex - CHECK_RESULT $? 0 0 "卸载 texinfo-tex 失败" - else - LOG_INFO "保持 texinfo-tex 安装状态" - fi - - LOG_INFO "测试完成" -} - -main "$@" \ No newline at end of file diff --git a/testcases/function_test/pkg_test/texinfo/texinfo-tex/test_texinfo-tex_texi2dvi_build.sh b/testcases/function_test/pkg_test/texinfo/texinfo-tex/test_texinfo-tex_texi2dvi_build.sh deleted file mode 100644 index da87e35e362..00000000000 --- a/testcases/function_test/pkg_test/texinfo/texinfo-tex/test_texinfo-tex_texi2dvi_build.sh +++ /dev/null @@ -1,102 +0,0 @@ -#!/usr/bin/bash - -# Copyright (c) 2024 ISCAS .ALL rights reserved. -# This program is licensed under Mulan PSL v2. -# You can use it according to the terms and conditions of the Mulan PSL v2. -# http://license.coscl.org.cn/MulanPSL2 -# THIS PROGRAM IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, -# EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, -# MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. -# See the Mulan PSL v2 for more details. - -# ############################################# -# @Author : honghua -# @Contact : honghua@iscas.ac.cn -# @Date : 2026-03-12 -# @License : Mulan PSL v2 -# @Desc : 测试指定构建模式 -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - # 检查是否已经安装了texinfo-tex包 - LOG_INFO "检查texinfo-tex是否已经安装" - rpm -q texinfo-tex - if [ $? -eq 0 ]; then - LOG_INFO "texinfo-tex已安装,脚本结束前将保持安装状态" - already_installed=1 - else - LOG_INFO "texinfo-tex未安装,将在测试过程中安装" - already_installed=0 - fi - - # 检查yum源中是否有texinfo-tex包 - LOG_INFO "检查yum源中是否有texinfo-tex包" - dnf list available texinfo-tex > /dev/null 2>&1 - CHECK_RESULT $? 0 0 "yum源中没有texinfo-tex包,退出" - if [ $? -ne 0 ]; then - LOG_ERROR "yum源中没有texinfo-tex包" - exit 255 - fi - - # 如果未安装,则安装texinfo-tex包 - if [ $already_installed -eq 0 ]; then - LOG_INFO "安装texinfo-tex包" - dnf install -y texinfo-tex - CHECK_RESULT $? 0 0 "安装texinfo-tex包失败" - fi - - # 测试指定构建模式 - LOG_INFO "测试指定构建模式" - texi2dvi --help | grep -q "build" - CHECK_RESULT $? 0 0 "texi2dvi命令不支持build参数" - if [ $? -ne 0 ]; then - LOG_ERROR "texi2dvi命令不支持build参数" - # 清理环境 - if [ $already_installed -eq 0 ]; then - LOG_INFO "卸载texinfo-tex包" - dnf remove -y texinfo-tex - CHECK_RESULT $? 0 0 "卸载texinfo-tex包失败" - fi - exit 255 - fi - - # 创建一个简单的texinfo文件用于测试 - LOG_INFO "创建测试用的texinfo文件" - cat > test.texinfo << EOF - \input texinfo - @setfilename test.info - @settitle Test Document - @node Top - @top Test Document - This is a test document. - @bye - EOF - CHECK_RESULT $? 0 0 "创建测试文件失败" - - # 使用texi2dvi命令测试构建模式 - LOG_INFO "使用texi2dvi命令测试构建模式" - texi2dvi test.texinfo - CHECK_RESULT $? 0 0 "texi2dvi构建失败" - - # 检查生成的DVI文件 - LOG_INFO "检查生成的DVI文件" - ls test.dvi - CHECK_RESULT $? 0 0 "未生成DVI文件" - - # 清理测试文件 - LOG_INFO "清理测试文件" - rm -f test.texinfo test.dvi test.log test.aux test.cp test.cps test.fn test.fns test.ky test.log test.pg test.toc test.tp test.vr - - # 如果测试开始时未安装,则卸载texinfo-tex包 - if [ $already_installed -eq 0 ]; then - LOG_INFO "卸载texinfo-tex包" - dnf remove -y texinfo-tex - CHECK_RESULT $? 0 0 "卸载texinfo-tex包失败" - fi - - LOG_INFO "测试完成" -} - -main "$@" \ No newline at end of file diff --git a/testcases/function_test/pkg_test/texinfo/texinfo-tex/test_texinfo-tex_texi2dvi_build_dir.sh b/testcases/function_test/pkg_test/texinfo/texinfo-tex/test_texinfo-tex_texi2dvi_build_dir.sh deleted file mode 100644 index 03c8941dcb1..00000000000 --- a/testcases/function_test/pkg_test/texinfo/texinfo-tex/test_texinfo-tex_texi2dvi_build_dir.sh +++ /dev/null @@ -1,84 +0,0 @@ -#!/usr/bin/bash - -# Copyright (c) 2024 ISCAS .ALL rights reserved. -# This program is licensed under Mulan PSL v2. -# You can use it according to the terms and conditions of the Mulan PSL v2. -# http://license.coscl.org.cn/MulanPSL2 -# THIS PROGRAM IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, -# EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, -# MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. -# See the Mulan PSL v2 for more details. - -# ############################################# -# @Author : honghua -# @Contact : honghua@iscas.ac.cn -# @Date : 2026-03-12 -# @License : Mulan PSL v2 -# @Desc : 测试指定整洁编译的目录 -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - LOG_INFO "开始测试:测试指定整洁编译的目录" - LOG_INFO "步骤1:检查环境是否已安装texinfo-tex软件包" - if rpm -q texinfo-tex > /dev/null 2>&1; then - LOG_INFO "环境已安装texinfo-tex软件包,将保持安装状态" - INSTALLED=true - else - LOG_INFO "环境未安装texinfo-tex软件包,将进行安装" - INSTALLED=false - fi - - LOG_INFO "步骤2:检查yum源中是否有texinfo-tex软件包" - if ! dnf list available texinfo-tex > /dev/null 2>&1; then - LOG_ERROR "yum源中未找到texinfo-tex软件包" - exit 255 - fi - - if [ "$INSTALLED" = false ]; then - LOG_INFO "步骤3:安装texinfo-tex软件包" - dnf install -y texinfo-tex - CHECK_RESULT $? 0 0 "安装texinfo-tex软件包失败" - fi - - LOG_INFO "步骤4:检查texi2dvi命令是否支持--build-dir参数" - texi2dvi --help 2>&1 | grep -q -- --build-dir - CHECK_RESULT $? 0 0 "texi2dvi命令不支持--build-dir参数" - - LOG_INFO "步骤5:创建测试用tex文件" - cat > test.tex << "EOF" - \documentclass{article} - \begin{document} - Hello, World! - \end{document} - EOF - CHECK_RESULT $? 0 0 "创建测试用tex文件失败" - - LOG_INFO "步骤6:使用texi2dvi命令指定编译目录" - texi2dvi --build-dir=build_dir test.tex - CHECK_RESULT $? 0 0 "texi2dvi命令执行失败" - - LOG_INFO "步骤7:检查编译目录是否生成" - if [ -d "build_dir" ]; then - LOG_INFO "编译目录生成成功" - else - LOG_ERROR "编译目录未生成" - exit 1 - fi - - LOG_INFO "步骤8:清理测试文件" - rm -f test.tex test.aux test.log test.dvi - rm -rf build_dir - CHECK_RESULT $? 0 0 "清理测试文件失败" - - if [ "$INSTALLED" = false ]; then - LOG_INFO "步骤9:卸载texinfo-tex软件包" - dnf remove -y texinfo-tex - CHECK_RESULT $? 0 0 "卸载texinfo-tex软件包失败" - fi - - LOG_INFO "测试完成" -} - -main "$@" \ No newline at end of file diff --git a/testcases/function_test/pkg_test/texinfo/texinfo-tex/test_texinfo-tex_texi2dvi_c.sh b/testcases/function_test/pkg_test/texinfo/texinfo-tex/test_texinfo-tex_texi2dvi_c.sh deleted file mode 100644 index 8db6a6e2d87..00000000000 --- a/testcases/function_test/pkg_test/texinfo/texinfo-tex/test_texinfo-tex_texi2dvi_c.sh +++ /dev/null @@ -1,109 +0,0 @@ -#!/usr/bin/bash - -# Copyright (c) 2024 ISCAS .ALL rights reserved. -# This program is licensed under Mulan PSL v2. -# You can use it according to the terms and conditions of the Mulan PSL v2. -# http://license.coscl.org.cn/MulanPSL2 -# THIS PROGRAM IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, -# EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, -# MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. -# See the Mulan PSL v2 for more details. - -# ############################################# -# @Author : honghua -# @Contact : honghua@iscas.ac.cn -# @Date : 2026-03-12 -# @License : Mulan PSL v2 -# @Desc : 测试清理模式,编译后移除辅助目录 -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - LOG_INFO "开始测试:测试清理模式,编译后移除辅助目录" - - # 检查环境是否已安装 texinfo-tex 软件包 - LOG_INFO "步骤1:检查 texinfo-tex 软件包是否已安装" - rpm -q texinfo-tex > /dev/null 2>&1 - if [ $? -eq 0 ]; then - LOG_INFO "texinfo-tex 软件包已安装,测试结束后将保持安装状态" - INSTALLED=true - else - LOG_INFO "texinfo-tex 软件包未安装,将在测试步骤中安装" - INSTALLED=false - fi - - # 检查 yum 源中是否有 texinfo-tex 软件包 - LOG_INFO "步骤2:检查 yum 源中是否存在 texinfo-tex 软件包" - dnf list available texinfo-tex > /dev/null 2>&1 - if [ $? -ne 0 ]; then - LOG_ERROR "yum 源中未找到 texinfo-tex 软件包" - exit 255 - fi - - # 如果未安装,则安装软件包 - if [ "$INSTALLED" = false ]; then - LOG_INFO "步骤3:安装 texinfo-tex 软件包" - dnf install -y texinfo-tex - CHECK_RESULT $? 0 0 "安装 texinfo-tex 软件包失败" - fi - - # 检查 texi2dvi 命令是否存在 - LOG_INFO "步骤4:检查 texi2dvi 命令是否存在" - which texi2dvi > /dev/null 2>&1 - if [ $? -ne 0 ]; then - LOG_ERROR "texi2dvi 命令不存在" - exit 255 - fi - - # 检查 texi2dvi 命令是否支持 --clean 参数 - LOG_INFO "步骤5:检查 texi2dvi 命令是否支持 --clean 参数" - texi2dvi --help 2>&1 | grep -q -- --clean - if [ $? -ne 0 ]; then - LOG_ERROR "texi2dvi 命令不支持 --clean 参数" - exit 255 - fi - - # 创建一个简单的 .texi 文件用于测试 - LOG_INFO "步骤6:创建测试用的 .texi 文件" - cat > test_input.texi << "EOF" - \input texinfo - @setfilename test.info - @settitle Test Document - @node Top - @top Test Document - This is a test document. - @bye - EOF - CHECK_RESULT $? 0 0 "创建测试 .texi 文件失败" - - # 执行 texi2dvi 命令,使用 --clean 参数 - LOG_INFO "步骤7:执行 texi2dvi 命令,使用 --clean 参数编译并清理辅助目录" - texi2dvi --clean test_input.texi - CHECK_RESULT $? 0 0 "texi2dvi 命令执行失败" - - # 检查辅助目录是否被移除 - LOG_INFO "步骤8:检查辅助目录是否被移除" - if [ -d "test_input.t2d" ]; then - LOG_ERROR "辅助目录 test_input.t2d 未被移除" - exit 1 - else - LOG_INFO "辅助目录 test_input.t2d 已成功移除" - fi - - # 清理测试文件 - LOG_INFO "步骤9:清理测试文件" - rm -f test_input.texi test_input.dvi test_input.log test_input.aux test_input.toc - CHECK_RESULT $? 0 0 "清理测试文件失败" - - # 如果测试前未安装,则卸载软件包 - if [ "$INSTALLED" = false ]; then - LOG_INFO "步骤10:卸载 texinfo-tex 软件包" - dnf remove -y texinfo-tex - CHECK_RESULT $? 0 0 "卸载 texinfo-tex 软件包失败" - fi - - LOG_INFO "测试完成:清理模式测试通过" -} - -main "$@" \ No newline at end of file diff --git a/testcases/function_test/pkg_test/texinfo/texinfo-tex/test_texinfo-tex_texi2dvi_d.sh b/testcases/function_test/pkg_test/texinfo/texinfo-tex/test_texinfo-tex_texi2dvi_d.sh deleted file mode 100644 index 852bf9baee3..00000000000 --- a/testcases/function_test/pkg_test/texinfo/texinfo-tex/test_texinfo-tex_texi2dvi_d.sh +++ /dev/null @@ -1,122 +0,0 @@ -#!/usr/bin/bash - -# Copyright (c) 2024 ISCAS .ALL rights reserved. -# This program is licensed under Mulan PSL v2. -# You can use it according to the terms and conditions of the Mulan PSL v2. -# http://license.coscl.org.cn/MulanPSL2 -# THIS PROGRAM IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, -# EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, -# MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. -# See the Mulan PSL v2 for more details. - -# ############################################# -# @Author : honghua -# @Contact : honghua@iscas.ac.cn -# @Date : 2026-03-12 -# @License : Mulan PSL v2 -# @Desc : 测试开启shell调试模式 -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - # 测试开启shell调试模式 - - LOG_INFO "开始测试texinfo-tex软件包的texi2dvi命令" - - # 检查当前是否已经安装texinfo-tex软件包 - LOG_INFO "步骤1: 检查texinfo-tex软件包是否已安装" - if rpm -q texinfo-tex &> /dev/null; then - LOG_INFO "texinfo-tex软件包已安装,脚本结束后将保持安装状态" - INSTALLED_BEFORE=true - else - LOG_INFO "texinfo-tex软件包未安装,将在测试过程中安装" - INSTALLED_BEFORE=false - fi - - # 检查yum源中是否有texinfo-tex软件包 - LOG_INFO "步骤2: 检查yum源中是否有texinfo-tex软件包" - if ! dnf list available texinfo-tex &> /dev/null; then - LOG_ERROR "yum源中未找到texinfo-tex软件包" - exit 255 - fi - - # 如果未安装,则安装软件包 - if [ "$INSTALLED_BEFORE" = false ]; then - LOG_INFO "步骤3: 安装texinfo-tex软件包" - dnf install -y texinfo-tex - CHECK_RESULT $? 0 0 "安装texinfo-tex软件包失败" - fi - - # 检查texi2dvi命令是否存在 - LOG_INFO "步骤4: 检查texi2dvi命令是否存在" - if ! command -v texi2dvi &> /dev/null; then - LOG_ERROR "texi2dvi命令不存在" - if [ "$INSTALLED_BEFORE" = false ]; then - dnf remove -y texinfo-tex - fi - exit 255 - fi - - # 测试texi2dvi命令的--help参数 - LOG_INFO "步骤5: 测试texi2dvi命令的--help参数" - texi2dvi --help &> /dev/null - CHECK_RESULT $? 0 0 "texi2dvi命令不支持--help参数" - - # 测试开启shell调试模式 - LOG_INFO "步骤6: 测试开启shell调试模式" - set -x - texi2dvi --version &> /dev/null - CHECK_RESULT $? 0 0 "texi2dvi命令执行失败" - set +x - - # 测试不支持的参数 - LOG_INFO "步骤7: 测试不支持的参数--invalid-param" - texi2dvi --invalid-param &> /dev/null - if [ $? -ne 255 ] && [ $? -ne 0 ]; then - CHECK_RESULT $? 255 0 "texi2dvi命令对不支持参数处理不正确" - else - LOG_INFO "texi2dvi命令正确处理了不支持参数" - fi - - # 创建测试用的texinfo文件 - LOG_INFO "步骤8: 创建测试用的texinfo文件" - TEST_FILE="test_document.texi" - cat > "$TEST_FILE" << "EOF" - \input texinfo - @setfilename test_document.info - @settitle Test Document - - @node Top - @top Test Document - - This is a test document. - @bye - EOF - - CHECK_RESULT $? 0 0 "创建测试文件失败" - - # 测试texi2dvi命令处理texinfo文件 - LOG_INFO "步骤9: 测试texi2dvi命令处理texinfo文件" - texi2dvi "$TEST_FILE" &> /dev/null - CHECK_RESULT $? 0 0 "texi2dvi命令处理texinfo文件失败" - - # 清理测试文件 - LOG_INFO "步骤10: 清理测试文件" - rm -f "$TEST_FILE" test_document.dvi test_document.log test_document.aux test_document.toc - CHECK_RESULT $? 0 0 "清理测试文件失败" - - # 恢复环境 - LOG_INFO "步骤11: 恢复测试环境" - if [ "$INSTALLED_BEFORE" = false ]; then - LOG_INFO "卸载texinfo-tex软件包" - dnf remove -y texinfo-tex - CHECK_RESULT $? 0 0 "卸载texinfo-tex软件包失败" - else - LOG_INFO "保持texinfo-tex软件包安装状态" - fi - - LOG_INFO "测试脚本执行完成" -} - -main "$@" \ No newline at end of file diff --git a/testcases/function_test/pkg_test/texinfo/texinfo-tex/test_texinfo-tex_texi2dvi_dvi.sh b/testcases/function_test/pkg_test/texinfo/texinfo-tex/test_texinfo-tex_texi2dvi_dvi.sh deleted file mode 100644 index aec2dfaa6f4..00000000000 --- a/testcases/function_test/pkg_test/texinfo/texinfo-tex/test_texinfo-tex_texi2dvi_dvi.sh +++ /dev/null @@ -1,111 +0,0 @@ -#!/usr/bin/bash - -# Copyright (c) 2024 ISCAS .ALL rights reserved. -# This program is licensed under Mulan PSL v2. -# You can use it according to the terms and conditions of the Mulan PSL v2. -# http://license.coscl.org.cn/MulanPSL2 -# THIS PROGRAM IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, -# EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, -# MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. -# See the Mulan PSL v2 for more details. - -# ############################################# -# @Author : honghua -# @Contact : honghua@iscas.ac.cn -# @Date : 2026-03-12 -# @License : Mulan PSL v2 -# @Desc : 测试指定输出DVI格式 -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - # 检查环境是否已经安装texinfo-tex软件包 - LOG_INFO "检查是否已安装texinfo-tex软件包" - rpm -q texinfo-tex > /dev/null 2>&1 - if [ $? -eq 0 ]; then - LOG_INFO "texinfo-tex已安装,将保持安装状态" - INSTALLED_FLAG=1 - else - LOG_INFO "texinfo-tex未安装,将在测试过程中安装" - INSTALLED_FLAG=0 - fi - - # 检查yum源中是否有texinfo-tex软件包 - LOG_INFO "检查yum源中是否有texinfo-tex软件包" - dnf list available texinfo-tex > /dev/null 2>&1 - CHECK_RESULT $? 0 0 "yum源中未找到texinfo-tex软件包" - if [ $? -ne 0 ]; then - LOG_ERROR "yum源中未找到texinfo-tex软件包" - exit 255 - fi - - # 如果未安装,则安装texinfo-tex软件包 - if [ ${INSTALLED_FLAG} -eq 0 ]; then - LOG_INFO "安装texinfo-tex软件包" - dnf install -y texinfo-tex > /dev/null 2>&1 - CHECK_RESULT $? 0 0 "安装texinfo-tex软件包失败" - fi - - # 检查texi2dvi命令是否存在 - LOG_INFO "检查texi2dvi命令是否存在" - command -v texi2dvi > /dev/null 2>&1 - CHECK_RESULT $? 0 0 "texi2dvi命令不存在" - if [ $? -ne 0 ]; then - LOG_ERROR "texi2dvi命令不存在" - exit 255 - fi - - # 检查texi2dvi命令是否支持--dvi参数 - LOG_INFO "检查texi2dvi命令是否支持--dvi参数" - texi2dvi --help 2>&1 | grep -q "\-\-dvi" - CHECK_RESULT $? 0 0 "texi2dvi命令不支持--dvi参数" - if [ $? -ne 0 ]; then - LOG_ERROR "texi2dvi命令不支持--dvi参数" - exit 255 - fi - - # 创建测试用的texinfo文件 - LOG_INFO "创建测试用的texinfo文件" - cat > test.texinfo << EOF - \input texinfo - @setfilename test.info - @settitle Test Document - @node Top - @top Test Document - This is a test document. - @end ifnottex - @bye - EOF - CHECK_RESULT $? 0 0 "创建测试texinfo文件失败" - - # 使用texi2dvi命令生成DVI文件 - LOG_INFO "使用texi2dvi命令生成DVI文件" - texi2dvi --dvi test.texinfo > /dev/null 2>&1 - CHECK_RESULT $? 0 0 "texi2dvi生成DVI文件失败" - - # 检查DVI文件是否生成成功 - LOG_INFO "检查DVI文件是否生成成功" - if [ -f test.dvi ]; then - LOG_INFO "DVI文件生成成功" - # 检查DVI文件格式 - file test.dvi | grep -q "DVI" - CHECK_RESULT $? 0 0 "生成的DVI文件格式不正确" - else - LOG_ERROR "DVI文件未生成" - exit 1 - fi - - # 清理测试文件 - LOG_INFO "清理测试文件" - rm -f test.texinfo test.dvi test.log test.toc test.aux test.cp test.cps test.fn test.fns test.ky test.log test.pg test.toc test.tp test.vr test.vrs - - # 如果测试前未安装,则卸载软件包 - if [ ${INSTALLED_FLAG} -eq 0 ]; then - LOG_INFO "卸载texinfo-tex软件包" - dnf remove -y texinfo-tex > /dev/null 2>&1 - CHECK_RESULT $? 0 0 "卸载texinfo-tex软件包失败" - fi -} - -main "$@" \ No newline at end of file diff --git a/testcases/function_test/pkg_test/texinfo/texinfo-tex/test_texinfo-tex_texi2dvi_dvipdf.sh b/testcases/function_test/pkg_test/texinfo/texinfo-tex/test_texinfo-tex_texi2dvi_dvipdf.sh deleted file mode 100644 index 0ee059f84e3..00000000000 --- a/testcases/function_test/pkg_test/texinfo/texinfo-tex/test_texinfo-tex_texi2dvi_dvipdf.sh +++ /dev/null @@ -1,105 +0,0 @@ -#!/usr/bin/bash - -# Copyright (c) 2024 ISCAS .ALL rights reserved. -# This program is licensed under Mulan PSL v2. -# You can use it according to the terms and conditions of the Mulan PSL v2. -# http://license.coscl.org.cn/MulanPSL2 -# THIS PROGRAM IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, -# EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, -# MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. -# See the Mulan PSL v2 for more details. - -# ############################################# -# @Author : honghua -# @Contact : honghua@iscas.ac.cn -# @Date : 2026-03-12 -# @License : Mulan PSL v2 -# @Desc : 测试通过DVI生成PDF输出 -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - # 判断是否已安装texinfo-tex - if rpm -q texinfo-tex > /dev/null 2>&1; then - LOG_INFO "texinfo-tex已安装,测试结束后将保持安装状态" - installed=true - else - LOG_INFO "texinfo-tex未安装,将在测试结束后卸载" - installed=false - fi - - # 检查yum源中是否有texinfo-tex包 - LOG_INFO "检查yum源中是否有texinfo-tex包" - dnf list available texinfo-tex > /dev/null 2>&1 - if [ $? -ne 0 ]; then - LOG_ERROR "yum源中没有texinfo-tex包" - exit 255 - fi - - # 安装texinfo-tex - if ! $installed; then - LOG_INFO "安装texinfo-tex" - dnf install -y texinfo-tex - CHECK_RESULT $? 0 0 "安装texinfo-tex失败" - fi - - # 检查texi2dvi命令是否存在 - LOG_INFO "检查texi2dvi命令是否存在" - which texi2dvi > /dev/null 2>&1 - CHECK_RESULT $? 0 0 "texi2dvi命令不存在" - - # 检查texi2dvi命令是否支持--dvipdf参数 - LOG_INFO "检查texi2dvi命令是否支持--dvipdf参数" - texi2dvi --help 2>&1 | grep -q "\-\-dvipdf" - CHECK_RESULT $? 0 0 "texi2dvi命令不支持--dvipdf参数" - - # 创建测试用的texinfo文件 - LOG_INFO "创建测试用的texinfo文件" - cat > test.texinfo << "EOF" - \input texinfo - @setfilename test.info - @settitle Test Document - @node Top - @top Test Document - This is a test document. - @bye - EOF - CHECK_RESULT $? 0 0 "创建texinfo文件失败" - - # 使用texi2dvi生成DVI文件 - LOG_INFO "使用texi2dvi生成DVI文件" - texi2dvi test.texinfo - CHECK_RESULT $? 0 0 "生成DVI文件失败" - - # 检查DVI文件是否生成 - LOG_INFO "检查DVI文件是否生成" - [ -f test.dvi ] - CHECK_RESULT $? 0 0 "DVI文件未生成" - - # 使用texi2dvi的--dvipdf参数直接生成PDF - LOG_INFO "使用texi2dvi的--dvipdf参数直接生成PDF" - texi2dvi --dvipdf test.texinfo - CHECK_RESULT $? 0 0 "使用--dvipdf参数生成PDF失败" - - # 检查PDF文件是否生成 - LOG_INFO "检查PDF文件是否生成" - [ -f test.pdf ] - CHECK_RESULT $? 0 0 "PDF文件未生成" - - # 清理测试文件 - LOG_INFO "清理测试文件" - rm -f test.texinfo test.dvi test.pdf test.log test.aux test.cp test.cps test.fn test.fns test.ky test.log test.pg test.toc test.tp test.vr - CHECK_RESULT $? 0 0 "清理测试文件失败" - - # 如果测试前未安装,则卸载texinfo-tex - if ! $installed; then - LOG_INFO "卸载texinfo-tex" - dnf remove -y texinfo-tex - CHECK_RESULT $? 0 0 "卸载texinfo-tex失败" - fi - - LOG_INFO "测试完成" -} - -main "$@" \ No newline at end of file diff --git a/testcases/function_test/pkg_test/texinfo/texinfo-tex/test_texinfo-tex_texi2dvi_e.sh b/testcases/function_test/pkg_test/texinfo/texinfo-tex/test_texinfo-tex_texi2dvi_e.sh deleted file mode 100644 index c14609cf043..00000000000 --- a/testcases/function_test/pkg_test/texinfo/texinfo-tex/test_texinfo-tex_texi2dvi_e.sh +++ /dev/null @@ -1,101 +0,0 @@ -#!/usr/bin/bash - -# Copyright (c) 2024 ISCAS .ALL rights reserved. -# This program is licensed under Mulan PSL v2. -# You can use it according to the terms and conditions of the Mulan PSL v2. -# http://license.coscl.org.cn/MulanPSL2 -# THIS PROGRAM IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, -# EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, -# MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. -# See the Mulan PSL v2 for more details. - -# ############################################# -# @Author : honghua -# @Contact : honghua@iscas.ac.cn -# @Date : 2026-03-12 -# @License : Mulan PSL v2 -# @Desc : 测试使用makeinfo进行宏展开 -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - LOG_INFO "开始测试:测试使用makeinfo进行宏展开" - LOG_INFO "步骤1:检查texinfo-tex软件包是否已安装" - if rpm -q texinfo-tex &> /dev/null; then - LOG_INFO "texinfo-tex软件包已安装,测试完成后将保持安装状态" - INSTALLED=true - else - LOG_INFO "texinfo-tex软件包未安装,将在测试过程中安装" - INSTALLED=false - fi - - LOG_INFO "步骤2:检查yum源中是否有texinfo-tex软件包" - if ! dnf list available texinfo-tex &> /dev/null; then - LOG_ERROR "yum源中未找到texinfo-tex软件包" - exit 255 - fi - - if [ "$INSTALLED" = "false" ]; then - LOG_INFO "步骤3:安装texinfo-tex软件包" - dnf install -y texinfo-tex - CHECK_RESULT $? 0 0 "安装texinfo-tex软件包失败" - fi - - LOG_INFO "步骤4:检查texi2dvi命令是否存在" - if ! command -v texi2dvi &> /dev/null; then - LOG_ERROR "texi2dvi命令不存在" - if [ "$INSTALLED" = "false" ]; then - dnf remove -y texinfo-tex - fi - exit 255 - fi - - LOG_INFO "步骤5:检查texi2dvi命令是否支持--help参数" - if ! texi2dvi --help &> /dev/null; then - LOG_ERROR "texi2dvi命令不支持--help参数" - if [ "$INSTALLED" = "false" ]; then - dnf remove -y texinfo-tex - fi - exit 255 - fi - - LOG_INFO "步骤6:创建一个简单的.texinfo测试文件" - cat > test_macro.texinfo << "EOF" - \input texinfo - @settitle Test Document - @title Test Document - @author Tester - @c This is a comment - @node Top - @top Test Document - This is a test document for macro expansion. - @bye - EOF - CHECK_RESULT $? 0 0 "创建.texinfo测试文件失败" - - LOG_INFO "步骤7:使用texi2dvi处理.texinfo文件" - texi2dvi test_macro.texinfo - CHECK_RESULT $? 0 0 "texi2dvi处理.texinfo文件失败" - - LOG_INFO "步骤8:检查生成的.dvi文件是否存在" - if [ -f test_macro.dvi ]; then - LOG_INFO "成功生成.dvi文件,宏展开测试通过" - else - LOG_ERROR "未生成.dvi文件,宏展开测试失败" - CHECK_RESULT 1 0 1 "宏展开测试失败" - fi - - LOG_INFO "步骤9:清理测试文件" - rm -f test_macro.texinfo test_macro.dvi test_macro.log test_macro.aux test_macro.toc - - if [ "$INSTALLED" = "false" ]; then - LOG_INFO "步骤10:卸载texinfo-tex软件包" - dnf remove -y texinfo-tex - CHECK_RESULT $? 0 0 "卸载texinfo-tex软件包失败" - fi - - LOG_INFO "测试完成" -} - -main "$@" \ No newline at end of file diff --git a/testcases/function_test/pkg_test/texinfo/texinfo-tex/test_texinfo-tex_texi2dvi_h.sh b/testcases/function_test/pkg_test/texinfo/texinfo-tex/test_texinfo-tex_texi2dvi_h.sh deleted file mode 100644 index d0af8e3d9d5..00000000000 --- a/testcases/function_test/pkg_test/texinfo/texinfo-tex/test_texinfo-tex_texi2dvi_h.sh +++ /dev/null @@ -1,85 +0,0 @@ -#!/usr/bin/bash - -# Copyright (c) 2024 ISCAS .ALL rights reserved. -# This program is licensed under Mulan PSL v2. -# You can use it according to the terms and conditions of the Mulan PSL v2. -# http://license.coscl.org.cn/MulanPSL2 -# THIS PROGRAM IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, -# EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, -# MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. -# See the Mulan PSL v2 for more details. - -# ############################################# -# @Author : honghua -# @Contact : honghua@iscas.ac.cn -# @Date : 2026-03-12 -# @License : Mulan PSL v2 -# @Desc : 测试显示帮助信息 -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - # 判断是否已安装texinfo-tex - LOG_INFO "检查是否已安装texinfo-tex软件包" - rpm -q texinfo-tex > /dev/null 2>&1 - if [ $? -eq 0 ]; then - LOG_INFO "texinfo-tex已安装,脚本结束后将保持安装状态" - INSTALLED=1 - else - LOG_INFO "texinfo-tex未安装,将在测试过程中安装" - INSTALLED=0 - fi - - # 检查yum源中是否有texinfo-tex软件包 - LOG_INFO "检查yum源中是否有texinfo-tex软件包" - dnf list available texinfo-tex > /dev/null 2>&1 - if [ $? -ne 0 ]; then - LOG_ERROR "yum源中未找到texinfo-tex软件包" - exit 255 - fi - - # 如果未安装,则安装软件包 - if [ $INSTALLED -eq 0 ]; then - LOG_INFO "安装texinfo-tex软件包" - dnf install -y texinfo-tex - CHECK_RESULT $? 0 0 "安装texinfo-tex失败" - fi - - # 测试texi2dvi命令的--help参数 - LOG_INFO "测试texi2dvi命令的--help参数" - texi2dvi --help > /dev/null 2>&1 - if [ $? -eq 0 ]; then - LOG_INFO "texi2dvi命令支持--help参数" - else - LOG_ERROR "texi2dvi命令不支持--help参数或参数不存在" - exit 255 - fi - - # 测试显示帮助信息 - LOG_INFO "执行texi2dvi --help命令" - texi2dvi --help > texi2dvi_help_output.txt 2>&1 - CHECK_RESULT $? 0 0 "执行texi2dvi --help命令失败" - - # 验证帮助信息是否包含关键内容 - LOG_INFO "验证帮助信息是否包含关键内容" - grep -q "Usage:" texi2dvi_help_output.txt - CHECK_RESULT $? 0 0 "帮助信息中未找到"Usage:"关键字" - - # 清理临时文件 - LOG_INFO "清理临时文件" - rm -f texi2dvi_help_output.txt - - # 如果脚本开始时未安装,则在结束时卸载软件包 - if [ $INSTALLED -eq 0 ]; then - LOG_INFO "卸载texinfo-tex软件包" - dnf remove -y texinfo-tex - CHECK_RESULT $? 0 0 "卸载texinfo-tex失败" - else - LOG_INFO "保持texinfo-tex软件包安装状态" - fi - - LOG_INFO "测试完成" -} - -main "$@" \ No newline at end of file diff --git a/testcases/function_test/pkg_test/texinfo/texinfo-tex/test_texinfo-tex_texi2dvi_html.sh b/testcases/function_test/pkg_test/texinfo/texinfo-tex/test_texinfo-tex_texi2dvi_html.sh deleted file mode 100644 index 5fa88fd0db8..00000000000 --- a/testcases/function_test/pkg_test/texinfo/texinfo-tex/test_texinfo-tex_texi2dvi_html.sh +++ /dev/null @@ -1,100 +0,0 @@ -#!/usr/bin/bash - -# Copyright (c) 2024 ISCAS .ALL rights reserved. -# This program is licensed under Mulan PSL v2. -# You can use it according to the terms and conditions of the Mulan PSL v2. -# http://license.coscl.org.cn/MulanPSL2 -# THIS PROGRAM IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, -# EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, -# MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. -# See the Mulan PSL v2 for more details. - -# ############################################# -# @Author : honghua -# @Contact : honghua@iscas.ac.cn -# @Date : 2026-03-12 -# @License : Mulan PSL v2 -# @Desc : 测试使用HeVeA从LaTeX生成HTML输出 -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - LOG_INFO "开始测试:使用HeVeA从LaTeX生成HTML输出" - - # 检查环境是否已安装texinfo-tex软件包 - LOG_INFO "检查texinfo-tex软件包是否已安装" - if dnf list installed texinfo-tex &>/dev/null; then - LOG_INFO "texinfo-tex软件包已安装" - INSTALLED=true - else - LOG_INFO "texinfo-tex软件包未安装" - INSTALLED=false - fi - - # 检查yum源中是否有texinfo-tex软件包 - LOG_INFO "检查yum源中是否有texinfo-tex软件包" - if ! dnf list available texinfo-tex &>/dev/null; then - LOG_ERROR "yum源中未找到texinfo-tex软件包" - exit 255 - fi - - # 如果未安装,则安装软件包 - if [ "$INSTALLED" = false ]; then - LOG_INFO "安装texinfo-tex软件包" - dnf install -y texinfo-tex - CHECK_RESULT $? 0 0 "安装texinfo-tex软件包失败" - fi - - # 检查texi2dvi命令是否存在 - LOG_INFO "检查texi2dvi命令是否存在" - command -v texi2dvi &>/dev/null - CHECK_RESULT $? 0 0 "texi2dvi命令不存在" - - # 检查texi2dvi命令是否支持--html参数 - LOG_INFO "检查texi2dvi命令是否支持--html参数" - if ! texi2dvi --help 2>&1 | grep -q -- "--html"; then - LOG_ERROR "texi2dvi命令不支持--html参数" - exit 255 - fi - - # 创建测试用的LaTeX文件 - LOG_INFO "创建测试用的LaTeX文件" - cat > test.tex << "EOF" - \documentclass{article} - \begin{document} - Hello, World! - \end{document} - EOF - CHECK_RESULT $? 0 0 "创建LaTeX文件失败" - - # 使用texi2dvi生成HTML输出 - LOG_INFO "使用texi2dvi生成HTML输出" - texi2dvi --html test.tex - CHECK_RESULT $? 0 0 "texi2dvi生成HTML输出失败" - - # 检查生成的HTML文件是否存在 - LOG_INFO "检查生成的HTML文件是否存在" - if [ -f "test.html" ]; then - LOG_INFO "成功生成HTML文件" - else - LOG_ERROR "未生成HTML文件" - CHECK_RESULT 1 0 0 "HTML文件生成失败" - fi - - # 清理测试文件 - LOG_INFO "清理测试文件" - rm -f test.tex test.html test.log test.aux test.toc - CHECK_RESULT $? 0 0 "清理测试文件失败" - - # 如果测试前未安装软件包,则在测试后卸载 - if [ "$INSTALLED" = false ]; then - LOG_INFO "卸载texinfo-tex软件包" - dnf remove -y texinfo-tex - CHECK_RESULT $? 0 0 "卸载texinfo-tex软件包失败" - fi - - LOG_INFO "测试完成:使用HeVeA从LaTeX生成HTML输出" -} - -main "$@" \ No newline at end of file diff --git a/testcases/function_test/pkg_test/texinfo/texinfo-tex/test_texinfo-tex_texi2dvi_i.sh b/testcases/function_test/pkg_test/texinfo/texinfo-tex/test_texinfo-tex_texi2dvi_i.sh deleted file mode 100644 index c68dc8b9d20..00000000000 --- a/testcases/function_test/pkg_test/texinfo/texinfo-tex/test_texinfo-tex_texi2dvi_i.sh +++ /dev/null @@ -1,103 +0,0 @@ -#!/usr/bin/bash - -# Copyright (c) 2024 ISCAS .ALL rights reserved. -# This program is licensed under Mulan PSL v2. -# You can use it according to the terms and conditions of the Mulan PSL v2. -# http://license.coscl.org.cn/MulanPSL2 -# THIS PROGRAM IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, -# EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, -# MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. -# See the Mulan PSL v2 for more details. - -# ############################################# -# @Author : honghua -# @Contact : honghua@iscas.ac.cn -# @Date : 2026-03-12 -# @License : Mulan PSL v2 -# @Desc : 测试添加Texinfo文件的搜索目录 -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - LOG_INFO "开始测试:测试添加Texinfo文件的搜索目录" - LOG_INFO "步骤1:检查是否已安装texinfo-tex软件包" - rpm -q texinfo-tex > /dev/null 2>&1 - if [ $? -eq 0 ]; then - LOG_INFO "texinfo-tex软件包已安装,标记为已安装状态" - INSTALLED=1 - else - LOG_INFO "texinfo-tex软件包未安装,标记为未安装状态" - INSTALLED=0 - fi - - LOG_INFO "步骤2:检查yum源中是否有texinfo-tex软件包" - dnf list available texinfo-tex > /dev/null 2>&1 - if [ $? -ne 0 ]; then - LOG_ERROR "yum源中未找到texinfo-tex软件包" - exit 255 - fi - - if [ $INSTALLED -eq 0 ]; then - LOG_INFO "步骤3:安装texinfo-tex软件包" - dnf install -y texinfo-tex - CHECK_RESULT $? 0 0 "安装texinfo-tex软件包失败" - fi - - LOG_INFO "步骤4:检查texi2dvi命令是否支持--help参数" - texi2dvi --help > /dev/null 2>&1 - if [ $? -ne 0 ]; then - LOG_ERROR "texi2dvi命令不支持--help参数" - exit 255 - fi - - LOG_INFO "步骤5:创建测试Texinfo文件" - cat > test.texinfo << "EOF" - \input texinfo - @setfilename test.info - @settitle Test Document - @node Top - @top Test Document - This is a test document. - @bye - EOF - CHECK_RESULT $? 0 0 "创建测试Texinfo文件失败" - - LOG_INFO "步骤6:创建自定义搜索目录" - mkdir -p /tmp/texinfo_test_dir - cp test.texinfo /tmp/texinfo_test_dir/ - - LOG_INFO "步骤7:使用texi2dvi命令并添加自定义搜索目录" - texi2dvi --help | grep -q "tex-search-dir" - if [ $? -eq 0 ]; then - texi2dvi --tex-search-dir=/tmp/texinfo_test_dir test.texinfo - CHECK_RESULT $? 0 0 "使用自定义搜索目录执行texi2dvi命令失败" - else - LOG_ERROR "texi2dvi命令不支持--tex-search-dir参数" - exit 255 - fi - - LOG_INFO "步骤8:检查生成的DVI文件" - if [ -f test.dvi ]; then - LOG_INFO "成功生成DVI文件" - else - LOG_ERROR "未生成DVI文件" - exit 1 - fi - - LOG_INFO "步骤9:清理测试文件" - rm -f test.texinfo test.dvi test.log test.aux test.toc - rm -rf /tmp/texinfo_test_dir - - if [ $INSTALLED -eq 0 ]; then - LOG_INFO "步骤10:卸载texinfo-tex软件包" - dnf remove -y texinfo-tex - CHECK_RESULT $? 0 0 "卸载texinfo-tex软件包失败" - else - LOG_INFO "步骤10:保持texinfo-tex软件包安装状态" - fi - - LOG_INFO "测试完成:测试添加Texinfo文件的搜索目录" -} - -main "$@" \ No newline at end of file diff --git a/testcases/function_test/pkg_test/texinfo/texinfo-tex/test_texinfo-tex_texi2dvi_info.sh b/testcases/function_test/pkg_test/texinfo/texinfo-tex/test_texinfo-tex_texi2dvi_info.sh deleted file mode 100644 index faa9f362c0a..00000000000 --- a/testcases/function_test/pkg_test/texinfo/texinfo-tex/test_texinfo-tex_texi2dvi_info.sh +++ /dev/null @@ -1,103 +0,0 @@ -#!/usr/bin/bash - -# Copyright (c) 2024 ISCAS .ALL rights reserved. -# This program is licensed under Mulan PSL v2. -# You can use it according to the terms and conditions of the Mulan PSL v2. -# http://license.coscl.org.cn/MulanPSL2 -# THIS PROGRAM IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, -# EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, -# MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. -# See the Mulan PSL v2 for more details. - -# ############################################# -# @Author : honghua -# @Contact : honghua@iscas.ac.cn -# @Date : 2026-03-12 -# @License : Mulan PSL v2 -# @Desc : 测试使用HeVeA从LaTeX生成Info输出 -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - # 判断是否已经安装texinfo-tex包 - LOG_INFO "检查是否已安装texinfo-tex软件包" - rpm -q texinfo-tex - if [ $? -eq 0 ]; then - LOG_INFO "texinfo-tex软件包已安装,测试后将保持安装状态" - INSTALLED=true - else - LOG_INFO "texinfo-tex软件包未安装,将在测试中安装" - INSTALLED=false - fi - - # 检查yum源中是否有texinfo-tex软件包 - LOG_INFO "检查yum源中是否存在texinfo-tex软件包" - dnf list available texinfo-tex 2>/dev/null | grep -q texinfo-tex - CHECK_RESULT $? 0 0 "yum源中不存在texinfo-tex软件包" - if [ $? -ne 0 ]; then - LOG_ERROR "yum源中不存在texinfo-tex软件包" - exit 255 - fi - - # 安装texinfo-tex软件包(如果未安装) - if [ "$INSTALLED" = false ]; then - LOG_INFO "安装texinfo-tex软件包" - dnf install -y texinfo-tex - CHECK_RESULT $? 0 0 "安装texinfo-tex软件包失败" - fi - - # 检查texi2dvi命令是否存在 - LOG_INFO "检查texi2dvi命令是否存在" - command -v texi2dvi - CHECK_RESULT $? 0 0 "texi2dvi命令不存在" - if [ $? -ne 0 ]; then - LOG_ERROR "texi2dvi命令不存在" - exit 255 - fi - - # 检查texi2dvi命令是否支持--help参数 - LOG_INFO "检查texi2dvi命令是否支持--help参数" - texi2dvi --help >/dev/null 2>&1 - CHECK_RESULT $? 0 0 "texi2dvi命令不支持--help参数" - if [ $? -ne 0 ]; then - LOG_ERROR "texi2dvi命令不支持--help参数" - exit 255 - fi - - # 创建测试用的LaTeX文件 - LOG_INFO "创建测试用的LaTeX文件" - cat > test.tex << "EOF" - \documentclass{article} - \begin{document} - Hello, World! - \end{document} - EOF - CHECK_RESULT $? 0 0 "创建测试LaTeX文件失败" - - # 使用texi2dvi从LaTeX生成DVI文件 - LOG_INFO "使用texi2dvi从LaTeX生成DVI文件" - texi2dvi test.tex - CHECK_RESULT $? 0 0 "texi2dvi生成DVI文件失败" - - # 检查生成的DVI文件是否存在 - LOG_INFO "检查生成的DVI文件是否存在" - [ -f test.dvi ] - CHECK_RESULT $? 0 0 "未生成DVI文件" - - # 清理测试文件 - LOG_INFO "清理测试文件" - rm -f test.tex test.dvi test.log test.aux - CHECK_RESULT $? 0 0 "清理测试文件失败" - - # 如果测试前未安装,则卸载texinfo-tex软件包 - if [ "$INSTALLED" = false ]; then - LOG_INFO "卸载texinfo-tex软件包" - dnf remove -y texinfo-tex - CHECK_RESULT $? 0 0 "卸载texinfo-tex软件包失败" - fi - - LOG_INFO "测试完成" -} - -main "$@" \ No newline at end of file diff --git a/testcases/function_test/pkg_test/texinfo/texinfo-tex/test_texinfo-tex_texi2dvi_l.sh b/testcases/function_test/pkg_test/texinfo/texinfo-tex/test_texinfo-tex_texi2dvi_l.sh deleted file mode 100644 index 7452e366e3b..00000000000 --- a/testcases/function_test/pkg_test/texinfo/texinfo-tex/test_texinfo-tex_texi2dvi_l.sh +++ /dev/null @@ -1,90 +0,0 @@ -#!/usr/bin/bash - -# Copyright (c) 2024 ISCAS .ALL rights reserved. -# This program is licensed under Mulan PSL v2. -# You can use it according to the terms and conditions of the Mulan PSL v2. -# http://license.coscl.org.cn/MulanPSL2 -# THIS PROGRAM IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, -# EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, -# MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. -# See the Mulan PSL v2 for more details. - -# ############################################# -# @Author : honghua -# @Contact : honghua@iscas.ac.cn -# @Date : 2026-03-12 -# @License : Mulan PSL v2 -# @Desc : 测试指定输入文件的语言 -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - LOG_INFO "开始测试:测试指定输入文件的语言" - LOG_INFO "步骤1:检查环境中是否已安装texinfo-tex软件包" - if rpm -q texinfo-tex >/dev/null 2>&1; then - LOG_INFO "texinfo-tex已安装,脚本结束时保持安装状态" - INSTALLED=1 - else - LOG_INFO "texinfo-tex未安装,将在测试过程中安装" - INSTALLED=0 - fi - - LOG_INFO "步骤2:检查yum源中是否有texinfo-tex软件包" - if dnf list available texinfo-tex >/dev/null 2>&1; then - LOG_INFO "yum源中存在texinfo-tex软件包" - else - LOG_ERROR "yum源中不存在texinfo-tex软件包" - exit 255 - fi - - if [ $INSTALLED -eq 0 ]; then - LOG_INFO "步骤3:安装texinfo-tex软件包" - dnf install -y texinfo-tex - CHECK_RESULT $? 0 0 "安装texinfo-tex软件包失败" - fi - - LOG_INFO "步骤4:检查texi2dvi命令是否支持--language参数" - texi2dvi --help 2>&1 | grep -q "\-\-language" - CHECK_RESULT $? 0 0 "texi2dvi命令不支持--language参数" - if [ $? -ne 0 ]; then - LOG_ERROR "texi2dvi命令不支持--language参数" - exit 255 - fi - - LOG_INFO "步骤5:创建测试用的Texinfo文件" - cat > test_input.texi << "EOF" - \input texinfo - @setfilename test_input.info - @settitle Test Document - @documentlanguage en - @bye - EOF - CHECK_RESULT $? 0 0 "创建测试Texinfo文件失败" - - LOG_INFO "步骤6:使用texi2dvi命令指定输入文件的语言为英语" - texi2dvi --language=english test_input.texi - CHECK_RESULT $? 0 0 "texi2dvi处理指定语言文件失败" - - LOG_INFO "步骤7:检查生成的DVI文件" - if [ -f test_input.dvi ]; then - LOG_INFO "成功生成DVI文件" - else - LOG_ERROR "未生成DVI文件" - exit 1 - fi - - LOG_INFO "步骤8:清理测试文件" - rm -f test_input.texi test_input.dvi test_input.log test_input.aux - CHECK_RESULT $? 0 0 "清理测试文件失败" - - if [ $INSTALLED -eq 0 ]; then - LOG_INFO "步骤9:卸载texinfo-tex软件包" - dnf remove -y texinfo-tex - CHECK_RESULT $? 0 0 "卸载texinfo-tex软件包失败" - fi - - LOG_INFO "测试完成:成功测试指定输入文件的语言" -} - -main "$@" \ No newline at end of file diff --git a/testcases/function_test/pkg_test/texinfo/texinfo-tex/test_texinfo-tex_texi2dvi_max_iterations.sh b/testcases/function_test/pkg_test/texinfo/texinfo-tex/test_texinfo-tex_texi2dvi_max_iterations.sh deleted file mode 100644 index 14238dc7f52..00000000000 --- a/testcases/function_test/pkg_test/texinfo/texinfo-tex/test_texinfo-tex_texi2dvi_max_iterations.sh +++ /dev/null @@ -1,105 +0,0 @@ -#!/usr/bin/bash - -# Copyright (c) 2024 ISCAS .ALL rights reserved. -# This program is licensed under Mulan PSL v2. -# You can use it according to the terms and conditions of the Mulan PSL v2. -# http://license.coscl.org.cn/MulanPSL2 -# THIS PROGRAM IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, -# EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, -# MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. -# See the Mulan PSL v2 for more details. - -# ############################################# -# @Author : honghua -# @Contact : honghua@iscas.ac.cn -# @Date : 2026-03-12 -# @License : Mulan PSL v2 -# @Desc : 测试设置最大处理迭代次数 -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - LOG_INFO "开始测试设置最大处理迭代次数" - - # 检查系统是否已安装texinfo-tex软件包 - LOG_INFO "检查texinfo-tex软件包是否已安装" - rpm -q texinfo-tex > /dev/null 2>&1 - if [ $? -eq 0 ]; then - LOG_INFO "texinfo-tex软件包已安装,测试结束后将保持安装状态" - INSTALLED=1 - else - LOG_INFO "texinfo-tex软件包未安装,将在测试过程中安装" - INSTALLED=0 - fi - - # 检查yum源中是否有texinfo-tex软件包 - LOG_INFO "检查yum源中是否有texinfo-tex软件包" - dnf list available texinfo-tex > /dev/null 2>&1 - CHECK_RESULT $? 0 0 "yum源中未找到texinfo-tex软件包" - if [ $? -ne 0 ]; then - LOG_ERROR "yum源中未找到texinfo-tex软件包" - exit 255 - fi - - # 如果未安装,则安装texinfo-tex软件包 - if [ $INSTALLED -eq 0 ]; then - LOG_INFO "安装texinfo-tex软件包" - dnf install -y texinfo-tex > /dev/null 2>&1 - CHECK_RESULT $? 0 0 "安装texinfo-tex软件包失败" - fi - - # 检查texi2dvi命令是否存在 - LOG_INFO "检查texi2dvi命令是否存在" - command -v texi2dvi > /dev/null 2>&1 - CHECK_RESULT $? 0 0 "texi2dvi命令不存在" - if [ $? -ne 0 ]; then - LOG_ERROR "texi2dvi命令不存在" - exit 255 - fi - - # 检查texi2dvi命令是否支持--max-iterations参数 - LOG_INFO "检查texi2dvi命令是否支持--max-iterations参数" - texi2dvi --help 2>&1 | grep -q "\-\-max\-iterations" - CHECK_RESULT $? 0 0 "texi2dvi命令不支持--max-iterations参数" - if [ $? -ne 0 ]; then - LOG_ERROR "texi2dvi命令不支持--max-iterations参数" - exit 255 - fi - - # 创建一个简单的texinfo测试文件 - LOG_INFO "创建texinfo测试文件" - cat > test.texinfo << EOF - \input texinfo - @setfilename test.info - @settitle Test Document - @bye - EOF - CHECK_RESULT $? 0 0 "创建texinfo测试文件失败" - - # 测试设置最大处理迭代次数为5 - LOG_INFO "测试设置最大处理迭代次数为5" - texi2dvi --max-iterations=5 test.texinfo > /dev/null 2>&1 - CHECK_RESULT $? 0 0 "设置最大处理迭代次数为5失败" - - # 测试设置最大处理迭代次数为10 - LOG_INFO "测试设置最大处理迭代次数为10" - texi2dvi --max-iterations=10 test.texinfo > /dev/null 2>&1 - CHECK_RESULT $? 0 0 "设置最大处理迭代次数为10失败" - - # 清理测试文件 - LOG_INFO "清理测试文件" - rm -f test.texinfo test.aux test.cp test.fn test.ky test.log test.pg test.toc test.tp test.vr test.dvi test.cps test.fns test.kys test.pgs test.tps test.vrs test.info test.info-? - CHECK_RESULT $? 0 0 "清理测试文件失败" - - # 如果测试前未安装,则卸载texinfo-tex软件包 - if [ $INSTALLED -eq 0 ]; then - LOG_INFO "卸载texinfo-tex软件包" - dnf remove -y texinfo-tex > /dev/null 2>&1 - CHECK_RESULT $? 0 0 "卸载texinfo-tex软件包失败" - fi - - LOG_INFO "测试设置最大处理迭代次数完成" -} - -main "$@" \ No newline at end of file diff --git a/testcases/function_test/pkg_test/texinfo/texinfo-tex/test_texinfo-tex_texi2dvi_mostly_clean.sh b/testcases/function_test/pkg_test/texinfo/texinfo-tex/test_texinfo-tex_texi2dvi_mostly_clean.sh deleted file mode 100644 index 3b1bd78518d..00000000000 --- a/testcases/function_test/pkg_test/texinfo/texinfo-tex/test_texinfo-tex_texi2dvi_mostly_clean.sh +++ /dev/null @@ -1,94 +0,0 @@ -#!/usr/bin/bash - -# Copyright (c) 2024 ISCAS .ALL rights reserved. -# This program is licensed under Mulan PSL v2. -# You can use it according to the terms and conditions of the Mulan PSL v2. -# http://license.coscl.org.cn/MulanPSL2 -# THIS PROGRAM IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, -# EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, -# MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. -# See the Mulan PSL v2 for more details. - -# ############################################# -# @Author : honghua -# @Contact : honghua@iscas.ac.cn -# @Date : 2026-03-12 -# @License : Mulan PSL v2 -# @Desc : 测试移除之前运行的辅助文件或目录 -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - LOG_INFO "开始测试:测试移除之前运行的辅助文件或目录" - - # 定义软件包名称 - PACKAGE_NAME="texinfo-tex" - - # 检查软件包是否已在环境中安装 - LOG_INFO "检查软件包是否已安装" - 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 - - # 检查yum源中是否有该软件包 - LOG_INFO "检查yum源中是否有 $PACKAGE_NAME 软件包" - if ! dnf list available "$PACKAGE_NAME" &>/dev/null; then - LOG_ERROR "yum源中未找到 $PACKAGE_NAME 软件包" - exit 255 - fi - - # 如果环境未安装,则安装软件包 - if [ "$INSTALLED_BEFORE" = false ]; then - LOG_INFO "安装软件包 $PACKAGE_NAME" - dnf install -y "$PACKAGE_NAME" - CHECK_RESULT $? 0 0 "安装软件包 $PACKAGE_NAME 失败" - fi - - # 测试 texi2dvi 命令的 --mostly-clean 参数 - LOG_INFO "测试 texi2dvi 命令的 --mostly-clean 参数" - texi2dvi --help | grep -q -- "--mostly-clean" - CHECK_RESULT $? 0 0 "texi2dvi 命令不支持 --mostly-clean 参数" - - # 创建一个简单的 .texi 文件用于测试 - LOG_INFO "创建测试用的 .texi 文件" - cat > test.texi << "EOF" - \input texinfo - @setfilename test.info - @settitle Test Document - @bye - EOF - - # 使用 texi2dvi 命令处理 .texi 文件,并指定 --mostly-clean 参数 - LOG_INFO "使用 texi2dvi 处理 .texi 文件,并指定 --mostly-clean 参数" - texi2dvi --mostly-clean test.texi - CHECK_RESULT $? 0 0 "texi2dvi 命令执行失败" - - # 检查辅助文件是否被移除 - LOG_INFO "检查辅助文件是否被移除" - if ls test.aux test.log test.toc test.cp test.fn test.ky test.pg test.tp test.vr test.cps test.fns test.kys test.pgs test.tps test.vrs &>/dev/null; then - LOG_ERROR "辅助文件未被正确移除" - exit 1 - else - LOG_INFO "辅助文件已正确移除" - fi - - # 清理测试文件 - LOG_INFO "清理测试文件" - rm -f test.texi test.dvi test.pdf - - # 如果环境之前未安装,则卸载软件包 - if [ "$INSTALLED_BEFORE" = false ]; then - LOG_INFO "卸载软件包 $PACKAGE_NAME" - dnf remove -y "$PACKAGE_NAME" - CHECK_RESULT $? 0 0 "卸载软件包 $PACKAGE_NAME 失败" - fi - - LOG_INFO "测试完成:测试移除之前运行的辅助文件或目录" -} - -main "$@" \ No newline at end of file diff --git a/testcases/function_test/pkg_test/texinfo/texinfo-tex/test_texinfo-tex_texi2dvi_no_line_error.sh b/testcases/function_test/pkg_test/texinfo/texinfo-tex/test_texinfo-tex_texi2dvi_no_line_error.sh deleted file mode 100644 index 39ffa3f6175..00000000000 --- a/testcases/function_test/pkg_test/texinfo/texinfo-tex/test_texinfo-tex_texi2dvi_no_line_error.sh +++ /dev/null @@ -1,103 +0,0 @@ -#!/usr/bin/bash - -# Copyright (c) 2024 ISCAS .ALL rights reserved. -# This program is licensed under Mulan PSL v2. -# You can use it according to the terms and conditions of the Mulan PSL v2. -# http://license.coscl.org.cn/MulanPSL2 -# THIS PROGRAM IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, -# EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, -# MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. -# See the Mulan PSL v2 for more details. - -# ############################################# -# @Author : honghua -# @Contact : honghua@iscas.ac.cn -# @Date : 2026-03-12 -# @License : Mulan PSL v2 -# @Desc : 测试不向TeX传递--file-line-error选项 -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - LOG_INFO "开始测试:测试不向TeX传递--file-line-error选项" - - # 检查是否已安装texinfo-tex - LOG_INFO "步骤1:检查texinfo-tex是否已安装" - if rpm -q texinfo-tex > /dev/null 2>&1; then - LOG_INFO "texinfo-tex已安装,脚本结束时将保持安装状态" - ALREADY_INSTALLED=1 - else - LOG_INFO "texinfo-tex未安装,将在测试过程中安装" - ALREADY_INSTALLED=0 - fi - - # 检查yum源中是否有texinfo-tex软件包 - LOG_INFO "步骤2:检查yum源中是否有texinfo-tex软件包" - if ! dnf list available texinfo-tex > /dev/null 2>&1; then - LOG_ERROR "yum源中未找到texinfo-tex软件包" - exit 255 - fi - - # 安装texinfo-tex(如果未安装) - if [ $ALREADY_INSTALLED -eq 0 ]; then - LOG_INFO "步骤3:安装texinfo-tex软件包" - dnf install -y texinfo-tex - CHECK_RESULT $? 0 0 "安装texinfo-tex失败" - fi - - # 检查texi2dvi命令是否存在 - LOG_INFO "步骤4:检查texi2dvi命令是否存在" - if ! command -v texi2dvi > /dev/null 2>&1; then - LOG_ERROR "texi2dvi命令不存在" - exit 255 - fi - - # 检查texi2dvi是否支持--help参数 - LOG_INFO "步骤5:检查texi2dvi是否支持--help参数" - if ! texi2dvi --help > /dev/null 2>&1; then - LOG_ERROR "texi2dvi不支持--help参数" - exit 255 - fi - - # 创建测试用的tex文件 - LOG_INFO "步骤6:创建测试用的tex文件" - TEST_TEX_FILE="test.tex" - cat > $TEST_TEX_FILE << "EOF" - \documentclass{article} - \begin{document} - Test document. - \end{document} - EOF - CHECK_RESULT $? 0 0 "创建测试tex文件失败" - - # 执行texi2dvi命令,不传递--file-line-error选项 - LOG_INFO "步骤7:执行texi2dvi命令,不传递--file-line-error选项" - texi2dvi $TEST_TEX_FILE - CHECK_RESULT $? 0 0 "texi2dvi命令执行失败" - - # 检查生成的dvi文件 - LOG_INFO "步骤8:检查生成的dvi文件" - if [ -f "${TEST_TEX_FILE%.tex}.dvi" ]; then - LOG_INFO "成功生成dvi文件" - else - LOG_ERROR "未生成dvi文件" - exit 1 - fi - - # 清理测试文件 - LOG_INFO "步骤9:清理测试文件" - rm -f $TEST_TEX_FILE "${TEST_TEX_FILE%.tex}.dvi" "${TEST_TEX_FILE%.tex}.aux" "${TEST_TEX_FILE%.tex}.log" - CHECK_RESULT $? 0 0 "清理测试文件失败" - - # 卸载texinfo-tex(如果脚本开始时未安装) - if [ $ALREADY_INSTALLED -eq 0 ]; then - LOG_INFO "步骤10:卸载texinfo-tex软件包" - dnf remove -y texinfo-tex - CHECK_RESULT $? 0 0 "卸载texinfo-tex失败" - fi - - LOG_INFO "测试完成:测试不向TeX传递--file-line-error选项" -} - -main "$@" \ No newline at end of file diff --git a/testcases/function_test/pkg_test/texinfo/texinfo-tex/test_texinfo-tex_texi2dvi_o.sh b/testcases/function_test/pkg_test/texinfo/texinfo-tex/test_texinfo-tex_texi2dvi_o.sh deleted file mode 100644 index fcd527e5298..00000000000 --- a/testcases/function_test/pkg_test/texinfo/texinfo-tex/test_texinfo-tex_texi2dvi_o.sh +++ /dev/null @@ -1,87 +0,0 @@ -#!/usr/bin/bash - -# Copyright (c) 2024 ISCAS .ALL rights reserved. -# This program is licensed under Mulan PSL v2. -# You can use it according to the terms and conditions of the Mulan PSL v2. -# http://license.coscl.org.cn/MulanPSL2 -# THIS PROGRAM IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, -# EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, -# MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. -# See the Mulan PSL v2 for more details. - -# ############################################# -# @Author : honghua -# @Contact : honghua@iscas.ac.cn -# @Date : 2026-03-12 -# @License : Mulan PSL v2 -# @Desc : 测试指定输出文件名 -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - # 测试指定输出文件名 - LOG_INFO "1. 检查是否已安装texinfo-tex软件包" - rpm -q texinfo-tex - if [ $? -eq 0 ]; then - LOG_INFO "texinfo-tex已安装,标记为需要保持安装状态" - KEEP_INSTALLED=1 - else - LOG_INFO "texinfo-tex未安装,标记为测试后需要卸载" - KEEP_INSTALLED=0 - fi - - LOG_INFO "2. 检查yum源中是否有texinfo-tex软件包" - dnf list available texinfo-tex - if [ $? -ne 0 ]; then - LOG_ERROR "yum源中未找到texinfo-tex软件包" - exit 255 - fi - - LOG_INFO "3. 如果未安装则安装texinfo-tex软件包" - if [ $KEEP_INSTALLED -eq 0 ]; then - dnf install -y texinfo-tex - CHECK_RESULT $? 0 0 "安装texinfo-tex软件包失败" - fi - - LOG_INFO "4. 检查texi2dvi命令是否存在" - which texi2dvi - CHECK_RESULT $? 0 0 "texi2dvi命令不存在" - - LOG_INFO "5. 创建一个简单的texinfo测试文件" - cat > test.texinfo << "EOF" - \input texinfo - @setfilename test.info - @settitle Test Document - @bye - EOF - CHECK_RESULT $? 0 0 "创建texinfo测试文件失败" - - LOG_INFO "6. 测试texi2dvi命令的-o参数是否存在" - texi2dvi --help 2>&1 | grep -q "\-o" - if [ $? -ne 0 ]; then - LOG_ERROR "texi2dvi命令不支持-o参数" - exit 255 - fi - - LOG_INFO "7. 测试指定输出文件名功能" - texi2dvi test.texinfo -o custom_output.dvi - CHECK_RESULT $? 0 0 "texi2dvi命令执行失败" - - LOG_INFO "8. 验证输出文件是否生成" - [ -f custom_output.dvi ] - CHECK_RESULT $? 0 0 "未生成指定的输出文件custom_output.dvi" - - LOG_INFO "9. 清理测试文件" - rm -f test.texinfo custom_output.dvi test.aux test.cp test.cps test.fn test.fns test.ky test.log test.pg test.toc test.tp test.vr - - LOG_INFO "10. 如果测试前未安装,则卸载texinfo-tex软件包" - if [ $KEEP_INSTALLED -eq 0 ]; then - dnf remove -y texinfo-tex - CHECK_RESULT $? 0 0 "卸载texinfo-tex软件包失败" - fi - - LOG_INFO "测试完成" -} - -main "$@" \ No newline at end of file diff --git a/testcases/function_test/pkg_test/texinfo/texinfo-tex/test_texinfo-tex_texi2dvi_p.sh b/testcases/function_test/pkg_test/texinfo/texinfo-tex/test_texinfo-tex_texi2dvi_p.sh deleted file mode 100644 index 1f277501dae..00000000000 --- a/testcases/function_test/pkg_test/texinfo/texinfo-tex/test_texinfo-tex_texi2dvi_p.sh +++ /dev/null @@ -1,106 +0,0 @@ -#!/usr/bin/bash - -# Copyright (c) 2024 ISCAS .ALL rights reserved. -# This program is licensed under Mulan PSL v2. -# You can use it according to the terms and conditions of the Mulan PSL v2. -# http://license.coscl.org.cn/MulanPSL2 -# THIS PROGRAM IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, -# EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, -# MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. -# See the Mulan PSL v2 for more details. - -# ############################################# -# @Author : honghua -# @Contact : honghua@iscas.ac.cn -# @Date : 2026-03-12 -# @License : Mulan PSL v2 -# @Desc : 测试使用pdftex或pdflatex处理以生成PDF输出 -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - LOG_INFO "开始测试:测试使用pdftex或pdflatex处理以生成PDF输出" - - # 检查环境是否已安装texinfo-tex包 - LOG_INFO "检查texinfo-tex是否已安装" - if rpm -q texinfo-tex > /dev/null 2>&1; then - LOG_INFO "texinfo-tex已安装,将保持安装状态" - INSTALLED="true" - else - LOG_INFO "texinfo-tex未安装,将在测试中安装" - INSTALLED="false" - fi - - # 检查yum源中是否有texinfo-tex包 - LOG_INFO "检查yum源中是否有texinfo-tex包" - if ! dnf list available texinfo-tex > /dev/null 2>&1; then - LOG_ERROR "yum源中无texinfo-tex包" - exit 255 - fi - - # 如果未安装,则安装texinfo-tex - if [ "$INSTALLED" = "false" ]; then - LOG_INFO "安装texinfo-tex" - dnf install -y texinfo-tex - CHECK_RESULT $? 0 0 "安装texinfo-tex失败" - fi - - # 检查texi2dvi命令是否存在 - LOG_INFO "检查texi2dvi命令是否存在" - if ! command -v texi2dvi > /dev/null 2>&1; then - LOG_ERROR "texi2dvi命令不存在" - exit 255 - fi - - # 检查texi2dvi是否支持--pdf参数 - LOG_INFO "检查texi2dvi是否支持--pdf参数" - if ! texi2dvi --help 2>&1 | grep -q -- "--pdf"; then - LOG_ERROR "texi2dvi不支持--pdf参数" - exit 255 - fi - - # 创建一个简单的texinfo测试文件 - LOG_INFO "创建测试texinfo文件" - cat > test.texinfo << "EOF" - \input texinfo - @setfilename test.info - @settitle Test Document - @node Top - @top Test Document - This is a test document. - @bye - EOF - - CHECK_RESULT $? 0 0 "创建测试texinfo文件失败" - - # 使用texi2dvi处理texinfo文件生成PDF - LOG_INFO "使用texi2dvi处理texinfo文件生成PDF" - texi2dvi --pdf test.texinfo - CHECK_RESULT $? 0 0 "texi2dvi处理texinfo文件生成PDF失败" - - # 检查是否生成了PDF文件 - LOG_INFO "检查是否生成了PDF文件" - if [ -f test.pdf ]; then - LOG_INFO "成功生成PDF文件" - rm -f test.pdf - else - LOG_ERROR "未生成PDF文件" - CHECK_RESULT 1 0 0 "未生成PDF文件" - fi - - # 清理测试文件 - LOG_INFO "清理测试文件" - rm -f test.texinfo test.aux test.cp test.cps test.fn test.ky test.log test.pg test.toc test.tp test.vr - - # 如果测试前未安装,则卸载texinfo-tex - if [ "$INSTALLED" = "false" ]; then - LOG_INFO "卸载texinfo-tex" - dnf remove -y texinfo-tex - CHECK_RESULT $? 0 0 "卸载texinfo-tex失败" - fi - - LOG_INFO "测试完成" -} - -main "$@" \ No newline at end of file diff --git a/testcases/function_test/pkg_test/texinfo/texinfo-tex/test_texinfo-tex_texi2dvi_ps.sh b/testcases/function_test/pkg_test/texinfo/texinfo-tex/test_texinfo-tex_texi2dvi_ps.sh deleted file mode 100644 index 7f6160322db..00000000000 --- a/testcases/function_test/pkg_test/texinfo/texinfo-tex/test_texinfo-tex_texi2dvi_ps.sh +++ /dev/null @@ -1,120 +0,0 @@ -#!/usr/bin/bash - -# Copyright (c) 2024 ISCAS .ALL rights reserved. -# This program is licensed under Mulan PSL v2. -# You can use it according to the terms and conditions of the Mulan PSL v2. -# http://license.coscl.org.cn/MulanPSL2 -# THIS PROGRAM IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, -# EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, -# MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. -# See the Mulan PSL v2 for more details. - -# ############################################# -# @Author : honghua -# @Contact : honghua@iscas.ac.cn -# @Date : 2026-03-12 -# @License : Mulan PSL v2 -# @Desc : 测试通过DVI生成PostScript输出 -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - # 环境初始化 - LOG_INFO "开始测试:通过DVI生成PostScript输出" - - # 定义软件包名称 - PACKAGE_NAME="texinfo-tex" - - # 步骤1:检查yum源中是否存在指定软件包 - LOG_INFO "步骤1:检查yum源中是否存在软件包 $PACKAGE_NAME" - dnf list available "$PACKAGE_NAME" > /dev/null 2>&1 - if [ $? -ne 0 ]; then - LOG_ERROR "软件包 $PACKAGE_NAME 在yum源中不存在" - exit 255 - fi - - # 步骤2:检查当前环境是否已安装指定软件包 - LOG_INFO "步骤2:检查当前环境是否已安装软件包 $PACKAGE_NAME" - INSTALLED=0 - if rpm -q "$PACKAGE_NAME" > /dev/null 2>&1; then - LOG_INFO "软件包 $PACKAGE_NAME 已安装" - INSTALLED=1 - else - LOG_INFO "软件包 $PACKAGE_NAME 未安装" - fi - - # 步骤3:如果未安装,则安装软件包 - if [ $INSTALLED -eq 0 ]; then - LOG_INFO "步骤3:安装软件包 $PACKAGE_NAME" - dnf install -y "$PACKAGE_NAME" - CHECK_RESULT $? 0 0 "安装软件包 $PACKAGE_NAME 失败" - fi - - # 步骤4:检查texi2dvi命令是否存在 - LOG_INFO "步骤4:检查texi2dvi命令是否存在" - if ! command -v texi2dvi > /dev/null 2>&1; then - LOG_ERROR "texi2dvi命令不存在" - exit 255 - fi - - # 步骤5:检查texi2dvi命令是否支持--ps参数 - LOG_INFO "步骤5:检查texi2dvi命令是否支持--ps参数" - texi2dvi --help 2>&1 | grep -q -- "--ps" - if [ $? -ne 0 ]; then - LOG_ERROR "texi2dvi命令不支持--ps参数" - exit 255 - fi - - # 步骤6:创建一个简单的texinfo测试文件 - LOG_INFO "步骤6:创建一个简单的texinfo测试文件" - TEST_FILE="test_doc.texi" - cat > "$TEST_FILE" << "EOF" - \input texinfo - @setfilename test_doc.info - @settitle Test Document - @node Top - @top Test Document - This is a test document. - @bye - EOF - CHECK_RESULT $? 0 0 "创建测试文件失败" - - # 步骤7:使用texi2dvi生成DVI文件 - LOG_INFO "步骤7:使用texi2dvi生成DVI文件" - texi2dvi "$TEST_FILE" --quiet - CHECK_RESULT $? 0 0 "生成DVI文件失败" - - # 步骤8:使用texi2dvi生成PostScript输出 - LOG_INFO "步骤8:使用texi2dvi生成PostScript输出" - texi2dvi --ps "$TEST_FILE" --quiet - CHECK_RESULT $? 0 0 "生成PostScript输出失败" - - # 步骤9:验证生成的PostScript文件是否存在 - LOG_INFO "步骤9:验证生成的PostScript文件是否存在" - if [ -f "test_doc.ps" ]; then - LOG_INFO "PostScript文件生成成功" - else - LOG_ERROR "PostScript文件未生成" - exit 1 - fi - - # 步骤10:清理测试文件 - LOG_INFO "步骤10:清理测试文件" - rm -f "$TEST_FILE" test_doc.aux test_doc.cp test_doc.cps test_doc.dvi test_doc.fn test_doc.fns test_doc.ky test_doc.log test_doc.op test_doc.pg test_doc.toc test_doc.tp test_doc.vr test_doc.vrs test_doc.ps - CHECK_RESULT $? 0 0 "清理测试文件失败" - - # 步骤11:环境恢复 - LOG_INFO "步骤11:环境恢复" - if [ $INSTALLED -eq 0 ]; then - LOG_INFO "卸载软件包 $PACKAGE_NAME" - dnf remove -y "$PACKAGE_NAME" - CHECK_RESULT $? 0 0 "卸载软件包 $PACKAGE_NAME 失败" - else - LOG_INFO "保持软件包 $PACKAGE_NAME 的安装状态" - fi - - LOG_INFO "测试完成:通过DVI生成PostScript输出" -} - -main "$@" \ No newline at end of file diff --git a/testcases/function_test/pkg_test/texinfo/texinfo-tex/test_texinfo-tex_texi2dvi_q.sh b/testcases/function_test/pkg_test/texinfo/texinfo-tex/test_texinfo-tex_texi2dvi_q.sh deleted file mode 100644 index 14f25e0d0e2..00000000000 --- a/testcases/function_test/pkg_test/texinfo/texinfo-tex/test_texinfo-tex_texi2dvi_q.sh +++ /dev/null @@ -1,98 +0,0 @@ -#!/usr/bin/bash - -# Copyright (c) 2024 ISCAS .ALL rights reserved. -# This program is licensed under Mulan PSL v2. -# You can use it according to the terms and conditions of the Mulan PSL v2. -# http://license.coscl.org.cn/MulanPSL2 -# THIS PROGRAM IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, -# EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, -# MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. -# See the Mulan PSL v2 for more details. - -# ############################################# -# @Author : honghua -# @Contact : honghua@iscas.ac.cn -# @Date : 2026-03-12 -# @License : Mulan PSL v2 -# @Desc : 测试静默模式,除非出错否则不输出 -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - LOG_INFO "开始测试texinfo-tex软件包texi2dvi命令的静默模式功能" - - # 检查软件包是否已在yum源中 - LOG_INFO "检查texinfo-tex软件包是否在yum源中" - dnf list texinfo-tex 2>/dev/null | grep -q "texinfo-tex" - if [ $? -ne 0 ]; then - LOG_ERROR "texinfo-tex软件包不在yum源中" - exit 255 - fi - - # 检查软件包是否已安装 - LOG_INFO "检查texinfo-tex软件包是否已安装" - rpm -q texinfo-tex >/dev/null 2>&1 - INSTALLED=$? - - # 如果未安装,则安装软件包 - if [ $INSTALLED -ne 0 ]; then - LOG_INFO "安装texinfo-tex软件包" - dnf install -y texinfo-tex - CHECK_RESULT $? 0 0 "安装texinfo-tex软件包失败" - fi - - # 检查texi2dvi命令是否支持--quiet参数 - LOG_INFO "检查texi2dvi命令是否支持--quiet参数" - texi2dvi --help 2>&1 | grep -q -- "--quiet" - if [ $? -ne 0 ]; then - LOG_ERROR "texi2dvi命令不支持--quiet参数" - # 如果之前未安装,需要卸载软件包 - if [ $INSTALLED -ne 0 ]; then - LOG_INFO "卸载texinfo-tex软件包" - dnf remove -y texinfo-tex - fi - exit 255 - fi - - # 创建测试用的简单texinfo文件 - LOG_INFO "创建测试用的简单texinfo文件" - cat > test.texinfo << "EOF" - \input texinfo - @setfilename test.info - @settitle Test Document - @bye - EOF - CHECK_RESULT $? 0 0 "创建测试texinfo文件失败" - - # 测试静默模式 - LOG_INFO "测试texi2dvi命令的静默模式" - texi2dvi --quiet test.texinfo > output.log 2>&1 - CHECK_RESULT $? 0 0 "texi2dvi命令静默模式执行失败" - - # 检查静默模式是否真正静默(输出文件应为空) - LOG_INFO "检查静默模式输出是否为空" - if [ -s output.log ]; then - LOG_ERROR "静默模式仍有输出" - cat output.log - CHECK_RESULT 1 0 0 "静默模式测试失败" - else - LOG_INFO "静默模式输出为空,符合预期" - fi - - # 清理测试文件 - LOG_INFO "清理测试文件" - rm -f test.texinfo test.aux test.cp test.cps test.fn test.fns test.ky test.log test.pg test.toc test.tp test.vr test.dvi test.info output.log - CHECK_RESULT $? 0 0 "清理测试文件失败" - - # 如果测试前未安装,则卸载软件包 - if [ $INSTALLED -ne 0 ]; then - LOG_INFO "卸载texinfo-tex软件包" - dnf remove -y texinfo-tex - CHECK_RESULT $? 0 0 "卸载texinfo-tex软件包失败" - fi - - LOG_INFO "测试完成" -} - -main "$@" \ No newline at end of file diff --git a/testcases/function_test/pkg_test/texinfo/texinfo-tex/test_texinfo-tex_texi2dvi_shell_escape.sh b/testcases/function_test/pkg_test/texinfo/texinfo-tex/test_texinfo-tex_texi2dvi_shell_escape.sh deleted file mode 100644 index 42ee4f44c28..00000000000 --- a/testcases/function_test/pkg_test/texinfo/texinfo-tex/test_texinfo-tex_texi2dvi_shell_escape.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-12 -# @License : Mulan PSL v2 -# @Desc : 测试向TeX传递--shell-escape选项 -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - LOG_INFO "开始测试:测试向TeX传递--shell-escape选项" - - # 定义软件包名称 - PACKAGE_NAME="texinfo-tex" - - # 检查软件包是否已在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_TEST=true - else - LOG_INFO "软件包未安装,将在测试过程中安装" - INSTALLED_BEFORE_TEST=false - fi - - # 如果未安装,则安装软件包 - if [ "$INSTALLED_BEFORE_TEST" = false ]; then - LOG_INFO "安装软件包:$PACKAGE_NAME" - dnf install -y "$PACKAGE_NAME" - CHECK_RESULT $? 0 0 "安装软件包失败" - fi - - # 检查texi2dvi命令是否存在 - LOG_INFO "检查texi2dvi命令是否存在" - if ! command -v texi2dvi &>/dev/null; then - LOG_ERROR "texi2dvi命令不存在" - exit 255 - fi - - # 检查--shell-escape参数是否支持 - LOG_INFO "检查texi2dvi是否支持--shell-escape参数" - if ! texi2dvi --help 2>&1 | grep -q -- "--shell-escape"; then - LOG_ERROR "texi2dvi不支持--shell-escape参数" - exit 255 - fi - - # 创建一个临时的TeX文件用于测试 - LOG_INFO "创建临时TeX文件用于测试" - TEMP_TEX_FILE=$(mktemp /tmp/test_tex.XXXXXX.tex) - cat > "$TEMP_TEX_FILE" << "EOF" - \documentclass{article} - \begin{document} - Test document for --shell-escape option. - \end{document} - EOF - - # 使用--shell-escape参数运行texi2dvi - LOG_INFO "使用--shell-escape参数运行texi2dvi" - texi2dvi --shell-escape "$TEMP_TEX_FILE" - CHECK_RESULT $? 0 0 "texi2dvi使用--shell-escape参数执行失败" - - # 清理临时文件 - LOG_INFO "清理临时文件" - rm -f "$TEMP_TEX_FILE" "${TEMP_TEX_FILE%.tex}.aux" "${TEMP_TEX_FILE%.tex}.log" "${TEMP_TEX_FILE%.tex}.dvi" 2>/dev/null - - # 如果测试前未安装软件包,则在测试后卸载 - if [ "$INSTALLED_BEFORE_TEST" = false ]; then - LOG_INFO "卸载软件包:$PACKAGE_NAME" - dnf remove -y "$PACKAGE_NAME" - CHECK_RESULT $? 0 0 "卸载软件包失败" - else - LOG_INFO "保持软件包安装状态" - fi - - LOG_INFO "测试完成:测试向TeX传递--shell-escape选项" -} - -main "$@" \ No newline at end of file diff --git a/testcases/function_test/pkg_test/texinfo/texinfo-tex/test_texinfo-tex_texi2dvi_src_specials.sh b/testcases/function_test/pkg_test/texinfo/texinfo-tex/test_texinfo-tex_texi2dvi_src_specials.sh deleted file mode 100644 index 765e87d92c0..00000000000 --- a/testcases/function_test/pkg_test/texinfo/texinfo-tex/test_texinfo-tex_texi2dvi_src_specials.sh +++ /dev/null @@ -1,92 +0,0 @@ -#!/usr/bin/bash - -# Copyright (c) 2024 ISCAS .ALL rights reserved. -# This program is licensed under Mulan PSL v2. -# You can use it according to the terms and conditions of the Mulan PSL v2. -# http://license.coscl.org.cn/MulanPSL2 -# THIS PROGRAM IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, -# EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, -# MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. -# See the Mulan PSL v2 for more details. - -# ############################################# -# @Author : honghua -# @Contact : honghua@iscas.ac.cn -# @Date : 2026-03-12 -# @License : Mulan PSL v2 -# @Desc : 测试向TeX传递--src-specials选项 -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - LOG_INFO "开始测试:测试向TeX传递--src-specials选项" - - # 检查是否已安装texinfo-tex包 - LOG_INFO "检查texinfo-tex包是否已安装" - if rpm -q texinfo-tex > /dev/null 2>&1; then - LOG_INFO "texinfo-tex已安装,测试结束后将保持安装状态" - ALREADY_INSTALLED=1 - else - LOG_INFO "texinfo-tex未安装,将在测试过程中安装" - ALREADY_INSTALLED=0 - fi - - # 检查yum源中是否有texinfo-tex包 - LOG_INFO "检查yum源中是否有texinfo-tex包" - if ! dnf list available texinfo-tex > /dev/null 2>&1; then - LOG_ERROR "yum源中未找到texinfo-tex包" - exit 255 - fi - - # 如果未安装,则安装texinfo-tex包 - if [ $ALREADY_INSTALLED -eq 0 ]; then - LOG_INFO "安装texinfo-tex包" - dnf install -y texinfo-tex - CHECK_RESULT $? 0 0 "安装texinfo-tex包失败" - fi - - # 检查texi2dvi命令是否支持--src-specials参数 - LOG_INFO "检查texi2dvi命令是否支持--src-specials参数" - texi2dvi --help 2>&1 | grep -q "\-\-src\-specials" - CHECK_RESULT $? 0 0 "texi2dvi命令不支持--src-specials参数" - - # 创建一个简单的TeX文件用于测试 - LOG_INFO "创建测试用TeX文件" - TEST_TEX_FILE="test_src_specials.tex" - cat > $TEST_TEX_FILE << "EOF" - \documentclass{article} - \begin{document} - Hello, TeX with --src-specials option. - \end{document} - EOF - - # 使用texi2dvi命令并传递--src-specials选项 - LOG_INFO "执行texi2dvi命令并传递--src-specials选项" - texi2dvi --src-specials $TEST_TEX_FILE - CHECK_RESULT $? 0 0 "texi2dvi命令执行失败" - - # 检查生成的DVI文件是否存在 - LOG_INFO "检查生成的DVI文件" - if [ -f "${TEST_TEX_FILE%.tex}.dvi" ]; then - LOG_INFO "DVI文件生成成功" - else - LOG_ERROR "DVI文件未生成" - exit 1 - fi - - # 清理测试文件 - LOG_INFO "清理测试文件" - rm -f $TEST_TEX_FILE "${TEST_TEX_FILE%.tex}.dvi" "${TEST_TEX_FILE%.tex}.aux" "${TEST_TEX_FILE%.tex}.log" - - # 如果测试前未安装,则卸载texinfo-tex包 - if [ $ALREADY_INSTALLED -eq 0 ]; then - LOG_INFO "卸载texinfo-tex包" - dnf remove -y texinfo-tex - CHECK_RESULT $? 0 0 "卸载texinfo-tex包失败" - fi - - LOG_INFO "测试完成:测试向TeX传递--src-specials选项" -} - -main "$@" \ No newline at end of file diff --git a/testcases/function_test/pkg_test/texinfo/texinfo-tex/test_texinfo-tex_texi2dvi_t.sh b/testcases/function_test/pkg_test/texinfo/texinfo-tex/test_texinfo-tex_texi2dvi_t.sh deleted file mode 100644 index 59e507ce91a..00000000000 --- a/testcases/function_test/pkg_test/texinfo/texinfo-tex/test_texinfo-tex_texi2dvi_t.sh +++ /dev/null @@ -1,101 +0,0 @@ -#!/usr/bin/bash - -# Copyright (c) 2024 ISCAS .ALL rights reserved. -# This program is licensed under Mulan PSL v2. -# You can use it according to the terms and conditions of the Mulan PSL v2. -# http://license.coscl.org.cn/MulanPSL2 -# THIS PROGRAM IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, -# EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, -# MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. -# See the Mulan PSL v2 for more details. - -# ############################################# -# @Author : honghua -# @Contact : honghua@iscas.ac.cn -# @Date : 2026-03-12 -# @License : Mulan PSL v2 -# @Desc : 测试在输入文件副本中插入指定命令 -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - # 定义软件包名称 - PACKAGE_NAME="texinfo-tex" - - # 步骤1:检查软件包是否在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 - - # 步骤2:检查系统是否已安装该软件包 - LOG_INFO "检查系统是否已安装 $PACKAGE_NAME" - rpm -q "$PACKAGE_NAME" &>/dev/null - if [ $? -eq 0 ]; then - LOG_INFO "$PACKAGE_NAME 已安装,测试结束后将保持安装状态" - INSTALLED_BEFORE=1 - else - LOG_INFO "$PACKAGE_NAME 未安装,将在测试前安装并在测试后卸载" - INSTALLED_BEFORE=0 - fi - - # 步骤3:如果未安装,则安装软件包 - if [ $INSTALLED_BEFORE -eq 0 ]; then - LOG_INFO "安装软件包: $PACKAGE_NAME" - dnf install -y "$PACKAGE_NAME" - CHECK_RESULT $? 0 0 "安装 $PACKAGE_NAME 失败" - fi - - # 步骤4:验证 texi2dvi 命令是否存在 - LOG_INFO "验证 texi2dvi 命令是否存在" - which texi2dvi &>/dev/null - CHECK_RESULT $? 0 0 "texi2dvi 命令未找到" - - # 步骤5:测试 texi2dvi 命令的基本参数 - LOG_INFO "测试 texi2dvi 命令的 --help 参数" - texi2dvi --help &>/dev/null - CHECK_RESULT $? 0 0 "texi2dvi --help 执行失败" - - # 步骤6:测试在输入文件副本中插入指定命令 - LOG_INFO "创建测试用的 TeX 输入文件" - cat > test_input.tex << "EOF" - \documentclass{article} - \begin{document} - Hello, world! - \end{document} - EOF - CHECK_RESULT $? 0 0 "创建测试输入文件失败" - - LOG_INFO "测试在输入文件副本中插入指定命令" - texi2dvi --command="echo "Custom command inserted"" test_input.tex 2>&1 | grep -q "Custom command inserted" - CHECK_RESULT $? 0 0 "在输入文件副本中插入指定命令失败" - - # 步骤7:测试不支持的参数 - LOG_INFO "测试 texi2dvi 命令的不支持参数 --nonexistent" - texi2dvi --nonexistent test_input.tex 2>&1 - if [ $? -ne 255 ] && [ $? -ne 1 ]; then - LOG_ERROR "不支持参数 --nonexistent 未按预期退出" - exit 255 - fi - - # 步骤8:清理测试文件 - LOG_INFO "清理测试文件" - rm -f test_input.tex test_input.aux test_input.log test_input.dvi test_input.toc test_input.out - CHECK_RESULT $? 0 0 "清理测试文件失败" - - # 步骤9:如果之前未安装,则卸载软件包 - if [ $INSTALLED_BEFORE -eq 0 ]; then - LOG_INFO "卸载软件包: $PACKAGE_NAME" - dnf remove -y "$PACKAGE_NAME" - CHECK_RESULT $? 0 0 "卸载 $PACKAGE_NAME 失败" - else - LOG_INFO "保持 $PACKAGE_NAME 的安装状态" - fi - - LOG_INFO "测试完成" -} - -main "$@" \ No newline at end of file diff --git a/testcases/function_test/pkg_test/texinfo/texinfo-tex/test_texinfo-tex_texi2dvi_text.sh b/testcases/function_test/pkg_test/texinfo/texinfo-tex/test_texinfo-tex_texi2dvi_text.sh deleted file mode 100644 index 8f9e7d862a1..00000000000 --- a/testcases/function_test/pkg_test/texinfo/texinfo-tex/test_texinfo-tex_texi2dvi_text.sh +++ /dev/null @@ -1,154 +0,0 @@ -#!/usr/bin/bash - -# Copyright (c) 2024 ISCAS .ALL rights reserved. -# This program is licensed under Mulan PSL v2. -# You can use it according to the terms and conditions of the Mulan PSL v2. -# http://license.coscl.org.cn/MulanPSL2 -# THIS PROGRAM IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, -# EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, -# MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. -# See the Mulan PSL v2 for more details. - -# ############################################# -# @Author : honghua -# @Contact : honghua@iscas.ac.cn -# @Date : 2026-03-12 -# @License : Mulan PSL v2 -# @Desc : 测试使用HeVeA从LaTeX生成纯文本输出 -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - # 定义日志函数(虽然题目说直接使用,但实际未定义,这里定义以确保脚本可运行) - LOG_INFO() { - echo "[INFO] $*" - } - - LOG_ERROR() { - echo "[ERROR] $*" >&2 - } - - # 定义结果检查函数 - CHECK_RESULT() { - local actual=$1 - local expect=$2 - local mode=$3 - local message=$4 - if [ $mode -eq 0 ]; then - if [ $actual -ne $expect ]; then - LOG_ERROR "$message" - exit $actual - fi - else - if [ $actual -eq $expect ]; then - LOG_ERROR "$message" - exit 1 - fi - fi - } - - # 定义SSH命令函数(虽然题目说直接使用,但实际未定义,这里定义占位) - SSH_CMD() { - LOG_ERROR "SSH_CMD函数未实现,但测试脚本中未使用" - exit 1 - } - - # 软件包名称 - PACKAGE_NAME="texinfo-tex" - - # 步骤1:检查软件包是否已在yum源中 - LOG_INFO "步骤1:检查软件包是否在yum源中" - dnf list available $PACKAGE_NAME &>/dev/null - if [ $? -ne 0 ]; then - LOG_ERROR "软件包 $PACKAGE_NAME 不在yum源中" - exit 255 - fi - - # 步骤2:检查是否已安装 - LOG_INFO "步骤2:检查是否已安装软件包" - INSTALLED=0 - if rpm -q $PACKAGE_NAME &>/dev/null; then - LOG_INFO "软件包已安装,测试结束后将保持安装状态" - INSTALLED=1 - else - LOG_INFO "软件包未安装,将在测试过程中安装并在结束后卸载" - fi - - # 步骤3:如果未安装,则安装软件包 - if [ $INSTALLED -eq 0 ]; then - LOG_INFO "步骤3:安装软件包 $PACKAGE_NAME" - dnf install -y $PACKAGE_NAME - CHECK_RESULT $? 0 0 "安装软件包失败" - fi - - # 步骤4:检查texi2dvi命令是否存在 - LOG_INFO "步骤4:检查texi2dvi命令是否存在" - which texi2dvi &>/dev/null - CHECK_RESULT $? 0 0 "texi2dvi命令不存在" - - # 步骤5:检查texi2dvi是否支持--help参数 - LOG_INFO "步骤5:检查texi2dvi是否支持--help参数" - texi2dvi --help &>/dev/null - if [ $? -eq 255 ]; then - LOG_ERROR "texi2dvi命令不支持--help参数" - exit 255 - fi - - # 步骤6:创建测试用的简单LaTeX文件 - LOG_INFO "步骤6:创建测试用的简单LaTeX文件" - TEST_FILE="test_hevea.tex" - cat > $TEST_FILE << "EOF" - \documentclass{article} - \begin{document} - Hello, HeVeA test! - \end{document} - EOF - CHECK_RESULT $? 0 0 "创建测试文件失败" - - # 步骤7:使用texi2dvi生成DVI文件 - LOG_INFO "步骤7:使用texi2dvi生成DVI文件" - texi2dvi $TEST_FILE - CHECK_RESULT $? 0 0 "texi2dvi生成DVI文件失败" - - # 步骤8:检查DVI文件是否生成 - LOG_INFO "步骤8:检查DVI文件是否生成" - DVI_FILE="${TEST_FILE%.tex}.dvi" - if [ ! -f "$DVI_FILE" ]; then - LOG_ERROR "DVI文件未生成" - exit 1 - fi - - # 步骤9:使用HeVeA从DVI生成纯文本输出 - LOG_INFO "步骤9:使用HeVeA从DVI生成纯文本输出" - hevea -text -o ${TEST_FILE%.tex}.txt $DVI_FILE 2>/dev/null - CHECK_RESULT $? 0 0 "HeVeA生成纯文本输出失败" - - # 步骤10:检查纯文本输出文件是否生成 - LOG_INFO "步骤10:检查纯文本输出文件是否生成" - TXT_FILE="${TEST_FILE%.tex}.txt" - if [ ! -f "$TXT_FILE" ]; then - LOG_ERROR "纯文本输出文件未生成" - exit 1 - fi - - # 步骤11:验证输出内容 - LOG_INFO "步骤11:验证输出内容" - grep -q "Hello, HeVeA test!" $TXT_FILE - CHECK_RESULT $? 0 0 "输出文件内容不符合预期" - - # 步骤12:清理测试文件 - LOG_INFO "步骤12:清理测试文件" - rm -f $TEST_FILE $DVI_FILE ${TEST_FILE%.tex}.aux ${TEST_FILE%.tex}.log $TXT_FILE ${TEST_FILE%.tex}.haux ${TEST_FILE%.tex}.htoc - - # 步骤13:如果测试前未安装,则卸载软件包 - if [ $INSTALLED -eq 0 ]; then - LOG_INFO "步骤13:卸载软件包 $PACKAGE_NAME" - dnf remove -y $PACKAGE_NAME - CHECK_RESULT $? 0 0 "卸载软件包失败" - fi - - LOG_INFO "测试完成:成功使用HeVeA从LaTeX生成纯文本输出" -} - -main "$@" \ No newline at end of file diff --git a/testcases/function_test/pkg_test/texinfo/texinfo-tex/test_texinfo-tex_texi2dvi_tidy.sh b/testcases/function_test/pkg_test/texinfo/texinfo-tex/test_texinfo-tex_texi2dvi_tidy.sh deleted file mode 100644 index 436899e12eb..00000000000 --- a/testcases/function_test/pkg_test/texinfo/texinfo-tex/test_texinfo-tex_texi2dvi_tidy.sh +++ /dev/null @@ -1,82 +0,0 @@ -#!/usr/bin/bash - -# Copyright (c) 2024 ISCAS .ALL rights reserved. -# This program is licensed under Mulan PSL v2. -# You can use it according to the terms and conditions of the Mulan PSL v2. -# http://license.coscl.org.cn/MulanPSL2 -# THIS PROGRAM IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, -# EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, -# MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. -# See the Mulan PSL v2 for more details. - -# ############################################# -# @Author : honghua -# @Contact : honghua@iscas.ac.cn -# @Date : 2026-03-12 -# @License : Mulan PSL v2 -# @Desc : 测试整洁构建模式 -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - LOG_INFO "开始测试整洁构建模式" - LOG_INFO "检查是否已安装texinfo-tex软件包" - if rpm -q texinfo-tex > /dev/null 2>&1; then - LOG_INFO "texinfo-tex已安装,测试结束后保持安装状态" - already_installed=true - else - LOG_INFO "texinfo-tex未安装,将在测试前安装" - already_installed=false - fi - if [ "$already_installed" = false ]; then - LOG_INFO "检查yum源中是否存在texinfo-tex软件包" - dnf list available texinfo-tex > /dev/null 2>&1 - CHECK_RESULT $? 0 0 "yum源中未找到texinfo-tex软件包" - if [ $? -ne 0 ]; then - LOG_ERROR "yum源中未找到texinfo-tex软件包" - exit 255 - fi - LOG_INFO "安装texinfo-tex软件包" - dnf install -y texinfo-tex - CHECK_RESULT $? 0 0 "安装texinfo-tex软件包失败" - fi - LOG_INFO "检查texi2dvi命令是否支持--tidy参数" - texi2dvi --help 2>&1 | grep -q "\-\-tidy" - CHECK_RESULT $? 0 0 "texi2dvi命令不支持--tidy参数" - if [ $? -ne 0 ]; then - LOG_ERROR "texi2dvi命令不支持--tidy参数" - exit 255 - fi - LOG_INFO "创建一个简单的测试tex文件" - cat > test.tex << "EOF" - \documentclass{article} - \begin{document} - Hello, world! - \end{document} - EOF - CHECK_RESULT $? 0 0 "创建测试tex文件失败" - LOG_INFO "使用texi2dvi命令的--tidy参数进行构建" - texi2dvi --tidy test.tex - CHECK_RESULT $? 0 0 "texi2dvi --tidy命令执行失败" - LOG_INFO "检查是否生成预期的输出文件" - if [ -f test.dvi ] || [ -f test.pdf ]; then - LOG_INFO "生成输出文件成功" - else - LOG_ERROR "未生成预期的输出文件" - exit 1 - fi - LOG_INFO "清理测试文件" - rm -f test.tex test.dvi test.pdf test.log test.aux - LOG_INFO "环境恢复" - if [ "$already_installed" = false ]; then - LOG_INFO "卸载texinfo-tex软件包" - dnf remove -y texinfo-tex - CHECK_RESULT $? 0 0 "卸载texinfo-tex软件包失败" - else - LOG_INFO "保持texinfo-tex软件包安装状态" - fi - LOG_INFO "测试完成" -} - -main "$@" \ No newline at end of file diff --git a/testcases/function_test/pkg_test/texinfo/texinfo-tex/test_texinfo-tex_texi2dvi_translate_file.sh b/testcases/function_test/pkg_test/texinfo/texinfo-tex/test_texinfo-tex_texi2dvi_translate_file.sh deleted file mode 100644 index 9916e66726a..00000000000 --- a/testcases/function_test/pkg_test/texinfo/texinfo-tex/test_texinfo-tex_texi2dvi_translate_file.sh +++ /dev/null @@ -1,96 +0,0 @@ -#!/usr/bin/bash - -# Copyright (c) 2024 ISCAS .ALL rights reserved. -# This program is licensed under Mulan PSL v2. -# You can use it according to the terms and conditions of the Mulan PSL v2. -# http://license.coscl.org.cn/MulanPSL2 -# THIS PROGRAM IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, -# EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, -# MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. -# See the Mulan PSL v2 for more details. - -# ############################################# -# @Author : honghua -# @Contact : honghua@iscas.ac.cn -# @Date : 2026-03-12 -# @License : Mulan PSL v2 -# @Desc : 测试为TeX指定字符集翻译文件 -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - LOG_INFO "开始测试:为TeX指定字符集翻译文件" - - # 检查是否已安装texinfo-tex - LOG_INFO "检查texinfo-tex是否已安装" - if rpm -q texinfo-tex &> /dev/null; then - LOG_INFO "texinfo-tex已安装,脚本结束后将保持安装状态" - INSTALLED=true - else - LOG_INFO "texinfo-tex未安装,将在测试过程中安装" - INSTALLED=false - fi - - # 检查yum源中是否有texinfo-tex软件包 - LOG_INFO "检查yum源中是否有texinfo-tex软件包" - if ! dnf list available texinfo-tex &> /dev/null; then - LOG_ERROR "yum源中未找到texinfo-tex软件包" - exit 255 - fi - - # 如果未安装,则安装texinfo-tex - if [ "$INSTALLED" = false ]; then - LOG_INFO "安装texinfo-tex软件包" - dnf install -y texinfo-tex - CHECK_RESULT $? 0 0 "安装texinfo-tex失败" - fi - - # 创建测试用的tex文件 - LOG_INFO "创建测试用的tex文件" - cat > test.tex << "EOF" - \documentclass{article} - \begin{document} - Hello, TeX! - \end{document} - EOF - CHECK_RESULT $? 0 0 "创建tex文件失败" - - # 测试texi2dvi命令的--translate-file参数 - LOG_INFO "测试texi2dvi命令的--translate-file参数" - if texi2dvi --help 2>&1 | grep -q -- "--translate-file"; then - LOG_INFO "--translate-file参数存在,继续测试" - else - LOG_ERROR "--translate-file参数不存在或不支持" - exit 255 - fi - - # 使用texi2dvi命令翻译文件 - LOG_INFO "使用texi2dvi命令翻译文件" - texi2dvi --translate-file=il2-translate test.tex - CHECK_RESULT $? 0 0 "texi2dvi翻译文件失败" - - # 检查生成的dvi文件 - LOG_INFO "检查生成的dvi文件" - if [ -f test.dvi ]; then - LOG_INFO "成功生成test.dvi文件" - else - LOG_ERROR "未生成test.dvi文件" - exit 1 - fi - - # 清理测试文件 - LOG_INFO "清理测试文件" - rm -f test.tex test.dvi test.log test.aux - - # 如果测试前未安装,则卸载texinfo-tex - if [ "$INSTALLED" = false ]; then - LOG_INFO "卸载texinfo-tex软件包" - dnf remove -y texinfo-tex - CHECK_RESULT $? 0 0 "卸载texinfo-tex失败" - fi - - LOG_INFO "测试完成:为TeX指定字符集翻译文件" -} - -main "$@" \ No newline at end of file diff --git a/testcases/function_test/pkg_test/texinfo/texinfo-tex/test_texinfo-tex_texi2dvi_upper_v.sh b/testcases/function_test/pkg_test/texinfo/texinfo-tex/test_texinfo-tex_texi2dvi_upper_v.sh deleted file mode 100644 index c041a398b1a..00000000000 --- a/testcases/function_test/pkg_test/texinfo/texinfo-tex/test_texinfo-tex_texi2dvi_upper_v.sh +++ /dev/null @@ -1,95 +0,0 @@ -#!/usr/bin/bash - -# Copyright (c) 2024 ISCAS .ALL rights reserved. -# This program is licensed under Mulan PSL v2. -# You can use it according to the terms and conditions of the Mulan PSL v2. -# http://license.coscl.org.cn/MulanPSL2 -# THIS PROGRAM IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, -# EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, -# MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. -# See the Mulan PSL v2 for more details. - -# ############################################# -# @Author : honghua -# @Contact : honghua@iscas.ac.cn -# @Date : 2026-03-12 -# @License : Mulan PSL v2 -# @Desc : 测试详细模式,报告正在执行的操作 -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - LOG_INFO "开始测试:测试详细模式,报告正在执行的操作" - - LOG_INFO "步骤1:检查环境是否已安装texinfo-tex软件包" - rpm -q texinfo-tex > /dev/null 2>&1 - if [ $? -eq 0 ]; then - LOG_INFO "环境已安装texinfo-tex软件包,脚本结束时将保持安装状态" - INSTALLED=1 - else - LOG_INFO "环境未安装texinfo-tex软件包,将在测试步骤中安装,并在脚本结束前卸载" - INSTALLED=0 - fi - - LOG_INFO "步骤2:检查yum源中是否有texinfo-tex软件包" - dnf list available texinfo-tex > /dev/null 2>&1 - CHECK_RESULT $? 0 0 "yum源中不存在texinfo-tex软件包" - if [ $? -ne 0 ]; then - LOG_ERROR "yum源中不存在texinfo-tex软件包" - exit 255 - fi - - if [ $INSTALLED -eq 0 ]; then - LOG_INFO "步骤3:安装texinfo-tex软件包" - dnf install -y texinfo-tex > /dev/null 2>&1 - CHECK_RESULT $? 0 0 "安装texinfo-tex软件包失败" - if [ $? -ne 0 ]; then - LOG_ERROR "安装texinfo-tex软件包失败" - exit 1 - fi - fi - - LOG_INFO "步骤4:检查texi2dvi命令是否支持--verbose参数" - texi2dvi --help 2>&1 | grep -q -- "--verbose" - CHECK_RESULT $? 0 0 "texi2dvi命令不支持--verbose参数" - if [ $? -ne 0 ]; then - LOG_ERROR "texi2dvi命令不支持--verbose参数" - if [ $INSTALLED -eq 0 ]; then - LOG_INFO "清理环境:卸载texinfo-tex软件包" - dnf remove -y texinfo-tex > /dev/null 2>&1 - fi - exit 255 - fi - - LOG_INFO "步骤5:创建测试用的简单texinfo文件" - cat > test.texinfo << "EOF" - \input texinfo - @setfilename test.info - @settitle Test Document - @bye - EOF - CHECK_RESULT $? 0 0 "创建test.texinfo文件失败" - - LOG_INFO "步骤6:使用texi2dvi命令的详细模式进行测试" - texi2dvi --verbose test.texinfo 2>&1 | tee texi2dvi_verbose.log - CHECK_RESULT $? 0 0 "texi2dvi命令执行失败" - - LOG_INFO "步骤7:验证详细模式输出中包含操作报告" - grep -q "正在执行的操作\|正在处理\|Processing" texi2dvi_verbose.log - CHECK_RESULT $? 0 0 "详细模式未报告正在执行的操作" - - LOG_INFO "步骤8:清理测试文件" - rm -f test.texinfo test.aux test.cp test.cps test.dvi test.fn test.fns test.ky test.log test.pg test.toc test.tp test.vr texi2dvi_verbose.log - CHECK_RESULT $? 0 0 "清理测试文件失败" - - if [ $INSTALLED -eq 0 ]; then - LOG_INFO "步骤9:清理环境,卸载texinfo-tex软件包" - dnf remove -y texinfo-tex > /dev/null 2>&1 - CHECK_RESULT $? 0 0 "卸载texinfo-tex软件包失败" - fi - - LOG_INFO "测试完成:详细模式测试通过,环境已恢复" -} - -main "$@" \ No newline at end of file diff --git a/testcases/function_test/pkg_test/texinfo/texinfo-tex/test_texinfo-tex_texi2dvi_v.sh b/testcases/function_test/pkg_test/texinfo/texinfo-tex/test_texinfo-tex_texi2dvi_v.sh deleted file mode 100644 index accfa5a57e5..00000000000 --- a/testcases/function_test/pkg_test/texinfo/texinfo-tex/test_texinfo-tex_texi2dvi_v.sh +++ /dev/null @@ -1,62 +0,0 @@ -#!/usr/bin/bash - -# Copyright (c) 2024 ISCAS .ALL rights reserved. -# This program is licensed under Mulan PSL v2. -# You can use it according to the terms and conditions of the Mulan PSL v2. -# http://license.coscl.org.cn/MulanPSL2 -# THIS PROGRAM IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, -# EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, -# MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. -# See the Mulan PSL v2 for more details. - -# ############################################# -# @Author : honghua -# @Contact : honghua@iscas.ac.cn -# @Date : 2026-03-12 -# @License : Mulan PSL v2 -# @Desc : 测试显示版本信息 -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - # 环境检查:判断texinfo-tex软件包是否已安装 - LOG_INFO "检查texinfo-tex软件包是否已安装" - rpm -q texinfo-tex - if [ $? -eq 0 ]; then - LOG_INFO "texinfo-tex软件包已安装" - INSTALLED=1 - else - LOG_INFO "texinfo-tex软件包未安装" - INSTALLED=0 - fi - - # 检查yum源中是否有texinfo-tex软件包 - LOG_INFO "检查yum源中是否有texinfo-tex软件包" - dnf list available texinfo-tex - if [ $? -ne 0 ]; then - LOG_ERROR "yum源中没有texinfo-tex软件包" - exit 255 - fi - - # 如果未安装,则安装软件包 - if [ $INSTALLED -eq 0 ]; then - LOG_INFO "安装texinfo-tex软件包" - dnf install -y texinfo-tex - CHECK_RESULT $? 0 0 "安装texinfo-tex软件包失败" - fi - - # 测试显示版本信息 - LOG_INFO "测试显示版本信息" - texi2dvi --version - CHECK_RESULT $? 0 0 "texi2dvi --version命令执行失败" - - # 环境恢复:如果测试前未安装,则卸载软件包 - if [ $INSTALLED -eq 0 ]; then - LOG_INFO "卸载texinfo-tex软件包" - dnf remove -y texinfo-tex - CHECK_RESULT $? 0 0 "卸载texinfo-tex软件包失败" - fi -} - -main "$@" \ No newline at end of file diff --git a/testcases/function_test/pkg_test/texinfo/texinfo-tex/test_texinfo-tex_texi2pdf_build.sh b/testcases/function_test/pkg_test/texinfo/texinfo-tex/test_texinfo-tex_texi2pdf_build.sh deleted file mode 100644 index 967c273fdb8..00000000000 --- a/testcases/function_test/pkg_test/texinfo/texinfo-tex/test_texinfo-tex_texi2pdf_build.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-01-28 -# @License : Mulan PSL v2 -# @Desc : 测试使用--build选项指定辅助文件的处理模式 -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - LOG_INFO "开始测试:测试使用--build选项指定辅助文件的处理模式" - - # 检查是否已安装texinfo-tex包 - LOG_INFO "步骤1:检查texinfo-tex是否已安装" - if rpm -q texinfo-tex > /dev/null 2>&1; then - LOG_INFO "texinfo-tex已安装,脚本结束时将保持安装状态" - INSTALLED_BEFORE=true - else - LOG_INFO "texinfo-tex未安装,将在测试过程中安装" - INSTALLED_BEFORE=false - fi - - # 检查yum源中是否有texinfo-tex包 - LOG_INFO "步骤2:检查yum源中是否有texinfo-tex包" - if ! dnf list available texinfo-tex > /dev/null 2>&1; then - LOG_ERROR "yum源中未找到texinfo-tex包" - exit 255 - fi - - # 如果未安装,则安装texinfo-tex - if [ "$INSTALLED_BEFORE" = false ]; then - LOG_INFO "步骤3:安装texinfo-tex包" - dnf install -y texinfo-tex - CHECK_RESULT $? 0 0 "安装texinfo-tex失败" - fi - - # 检查texi2pdf命令是否存在 - LOG_INFO "步骤4:检查texi2pdf命令是否存在" - command -v texi2pdf > /dev/null 2>&1 - CHECK_RESULT $? 0 0 "texi2pdf命令不存在" - - # 检查--build选项是否支持 - LOG_INFO "步骤5:检查--build选项是否支持" - texi2pdf --help 2>&1 | grep -q -- "--build" - CHECK_RESULT $? 0 0 "texi2pdf不支持--build选项" - - # 创建测试用的texinfo文件 - LOG_INFO "步骤6:创建测试用的texinfo文件" - cat > test.texinfo << "EOF" - \input texinfo - @setfilename test.info - @settitle Test Document - @bye - EOF - CHECK_RESULT $? 0 0 "创建test.texinfo文件失败" - - # 测试texi2pdf --build命令 - LOG_INFO "步骤7:测试texi2pdf --build命令" - texi2pdf --build test.texinfo - CHECK_RESULT $? 0 0 "texi2pdf --build命令执行失败" - - # 清理测试文件 - LOG_INFO "步骤8:清理测试文件" - rm -f test.texinfo test.pdf test.log test.aux test.cp test.cps test.fn test.fns test.ky test.log test.pg test.toc test.tp test.vr - CHECK_RESULT $? 0 0 "清理测试文件失败" - - # 如果测试前未安装,则卸载texinfo-tex包 - if [ "$INSTALLED_BEFORE" = false ]; then - LOG_INFO "步骤9:卸载texinfo-tex包" - dnf remove -y texinfo-tex - CHECK_RESULT $? 0 0 "卸载texinfo-tex失败" - fi - - LOG_INFO "测试完成:测试使用--build选项指定辅助文件的处理模式" -} - -main "$@" \ No newline at end of file diff --git a/testcases/function_test/pkg_test/texinfo/texinfo-tex/test_texinfo-tex_texi2pdf_build_dir.sh b/testcases/function_test/pkg_test/texinfo/texinfo-tex/test_texinfo-tex_texi2pdf_build_dir.sh deleted file mode 100644 index b632d6bfa0c..00000000000 --- a/testcases/function_test/pkg_test/texinfo/texinfo-tex/test_texinfo-tex_texi2pdf_build_dir.sh +++ /dev/null @@ -1,114 +0,0 @@ -#!/usr/bin/bash - -# Copyright (c) 2024 ISCAS .ALL rights reserved. -# This program is licensed under Mulan PSL v2. -# You can use it according to the terms and conditions of the Mulan PSL v2. -# http://license.coscl.org.cn/MulanPSL2 -# THIS PROGRAM IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, -# EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, -# MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. -# See the Mulan PSL v2 for more details. - -# ############################################# -# @Author : honghua -# @Contact : honghua@iscas.ac.cn -# @Date : 2026-01-28 -# @License : Mulan PSL v2 -# @Desc : 测试使用--build-dir选项指定整洁编译的目录 -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - # 测试脚本:测试使用--build-dir选项指定整洁编译的目录 - - # 步骤1:检查yum源中是否存在texinfo-tex软件包 - LOG_INFO "检查yum源中是否存在texinfo-tex软件包" - dnf list available texinfo-tex > /dev/null 2>&1 - if [ $? -ne 0 ]; then - LOG_ERROR "yum源中未找到texinfo-tex软件包" - exit 255 - fi - - # 步骤2:检查系统是否已安装texinfo-tex软件包 - LOG_INFO "检查系统是否已安装texinfo-tex软件包" - rpm -q texinfo-tex > /dev/null 2>&1 - if [ $? -eq 0 ]; then - LOG_INFO "系统已安装texinfo-tex软件包" - INSTALLED="true" - else - LOG_INFO "系统未安装texinfo-tex软件包" - INSTALLED="false" - fi - - # 步骤3:如果未安装,则安装texinfo-tex软件包 - if [ "$INSTALLED" = "false" ]; then - LOG_INFO "安装texinfo-tex软件包" - dnf install -y texinfo-tex - CHECK_RESULT $? 0 0 "安装texinfo-tex软件包失败" - fi - - # 步骤4:检查texi2pdf命令是否支持--build-dir参数 - LOG_INFO "检查texi2pdf命令是否支持--build-dir参数" - texi2pdf --help 2>&1 | grep -q -- "--build-dir" - if [ $? -ne 0 ]; then - LOG_ERROR "texi2pdf命令不支持--build-dir参数" - if [ "$INSTALLED" = "false" ]; then - LOG_INFO "卸载texinfo-tex软件包" - dnf remove -y texinfo-tex - fi - exit 255 - fi - - # 步骤5:创建测试用的texinfo源文件 - LOG_INFO "创建测试用的texinfo源文件" - cat > test.texinfo << EOF - \input texinfo - @setfilename test.info - @settitle Test Document - @node Top - @top Test Document - This is a test document. - @end ifnottex - @bye - EOF - CHECK_RESULT $? 0 0 "创建texinfo源文件失败" - - # 步骤6:创建并测试使用--build-dir选项指定编译目录 - LOG_INFO "创建并测试使用--build-dir选项指定编译目录" - mkdir -p build_test_dir - texi2pdf test.texinfo --build-dir=build_test_dir - CHECK_RESULT $? 0 0 "使用--build-dir选项编译失败" - - # 步骤7:验证编译结果 - LOG_INFO "验证编译结果" - if [ -f "build_test_dir/test.pdf" ]; then - LOG_INFO "编译成功,PDF文件已生成在指定目录" - else - LOG_ERROR "编译失败,PDF文件未在指定目录生成" - rm -f test.texinfo - rm -rf build_test_dir - if [ "$INSTALLED" = "false" ]; then - LOG_INFO "卸载texinfo-tex软件包" - dnf remove -y texinfo-tex - fi - exit 1 - fi - - # 步骤8:清理测试文件 - LOG_INFO "清理测试文件" - rm -f test.texinfo - rm -rf build_test_dir - CHECK_RESULT $? 0 0 "清理测试文件失败" - - # 步骤9:如果测试前未安装软件包,则卸载 - if [ "$INSTALLED" = "false" ]; then - LOG_INFO "卸载texinfo-tex软件包" - dnf remove -y texinfo-tex - CHECK_RESULT $? 0 0 "卸载texinfo-tex软件包失败" - fi - - LOG_INFO "测试完成" -} - -main "$@" \ No newline at end of file diff --git a/testcases/function_test/pkg_test/texinfo/texinfo-tex/test_texinfo-tex_texi2pdf_c.sh b/testcases/function_test/pkg_test/texinfo/texinfo-tex/test_texinfo-tex_texi2pdf_c.sh deleted file mode 100644 index a4996d54641..00000000000 --- a/testcases/function_test/pkg_test/texinfo/texinfo-tex/test_texinfo-tex_texi2pdf_c.sh +++ /dev/null @@ -1,102 +0,0 @@ -#!/usr/bin/bash - -# Copyright (c) 2024 ISCAS .ALL rights reserved. -# This program is licensed under Mulan PSL v2. -# You can use it according to the terms and conditions of the Mulan PSL v2. -# http://license.coscl.org.cn/MulanPSL2 -# THIS PROGRAM IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, -# EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, -# MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. -# See the Mulan PSL v2 for more details. - -# ############################################# -# @Author : honghua -# @Contact : honghua@iscas.ac.cn -# @Date : 2026-01-28 -# @License : Mulan PSL v2 -# @Desc : 测试使用--clean选项以清理模式编译 -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - LOG_INFO "开始测试: 测试使用--clean选项以清理模式编译" - - # 检查软件包是否存在 - LOG_INFO "步骤1: 检查软件包texinfo-tex是否存在" - dnf list texinfo-tex > /dev/null 2>&1 - if [ $? -ne 0 ]; then - LOG_ERROR "软件包texinfo-tex在yum源中不存在" - exit 255 - fi - - # 检查命令参数是否支持 - LOG_INFO "步骤2: 检查texi2pdf命令是否支持--clean参数" - texi2pdf --help 2>&1 | grep -q -- --clean - if [ $? -ne 0 ]; then - LOG_ERROR "texi2pdf命令不支持--clean参数" - exit 255 - fi - - # 判断环境是否已安装 - LOG_INFO "步骤3: 检查软件包texinfo-tex是否已安装" - rpm -q texinfo-tex > /dev/null 2>&1 - if [ $? -eq 0 ]; then - LOG_INFO "软件包texinfo-tex已安装" - installed=true - else - LOG_INFO "软件包texinfo-tex未安装" - installed=false - fi - - # 如果未安装则进行安装 - if [ "$installed" = "false" ]; then - LOG_INFO "步骤4: 安装软件包texinfo-tex" - dnf install -y texinfo-tex - CHECK_RESULT $? 0 0 "安装软件包texinfo-tex失败" - fi - - # 创建测试用的texi文件 - LOG_INFO "步骤5: 创建测试用的texi文件" - cat > test.texinfo << "EOF" - \input texinfo - @setfilename test.info - @settitle Test Document - @node Top - @top Test Document - This is a test document. - @bye - EOF - CHECK_RESULT $? 0 0 "创建测试文件失败" - - # 使用--clean选项编译 - LOG_INFO "步骤6: 使用--clean选项编译texi文件" - texi2pdf --clean test.texinfo > compile.log 2>&1 - CHECK_RESULT $? 0 0 "使用--clean选项编译失败" - - # 检查是否生成PDF文件 - LOG_INFO "步骤7: 检查PDF文件是否生成" - [ -f test.pdf ] - CHECK_RESULT $? 0 0 "PDF文件未生成" - - # 检查中间文件是否被清理 - LOG_INFO "步骤8: 检查中间文件是否被清理" - [ ! -f test.aux ] && [ ! -f test.log ] && [ ! -f test.toc ] - CHECK_RESULT $? 0 0 "中间文件未被清理" - - # 清理测试文件 - LOG_INFO "步骤9: 清理测试文件" - rm -f test.texinfo test.pdf compile.log - CHECK_RESULT $? 0 0 "清理测试文件失败" - - # 如果测试前未安装,则卸载软件包 - if [ "$installed" = "false" ]; then - LOG_INFO "步骤10: 卸载软件包texinfo-tex" - dnf remove -y texinfo-tex - CHECK_RESULT $? 0 0 "卸载软件包texinfo-tex失败" - fi - - LOG_INFO "测试完成" -} - -main "$@" \ No newline at end of file diff --git a/testcases/function_test/pkg_test/texinfo/texinfo-tex/test_texinfo-tex_texi2pdf_clean.sh b/testcases/function_test/pkg_test/texinfo/texinfo-tex/test_texinfo-tex_texi2pdf_clean.sh deleted file mode 100644 index 31960bb389a..00000000000 --- a/testcases/function_test/pkg_test/texinfo/texinfo-tex/test_texinfo-tex_texi2pdf_clean.sh +++ /dev/null @@ -1,109 +0,0 @@ -#!/usr/bin/bash - -# Copyright (c) 2024 ISCAS .ALL rights reserved. -# This program is licensed under Mulan PSL v2. -# You can use it according to the terms and conditions of the Mulan PSL v2. -# http://license.coscl.org.cn/MulanPSL2 -# THIS PROGRAM IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, -# EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, -# MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. -# See the Mulan PSL v2 for more details. - -# ############################################# -# @Author : honghua -# @Contact : honghua@iscas.ac.cn -# @Date : 2026-03-12 -# @License : Mulan PSL v2 -# @Desc : 测试texi2pdf命令的--clean选项,等同于--build=clean -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - LOG_INFO "开始测试texi2pdf命令的--clean选项,等同于--build=clean" - - # 检查软件包是否在yum源中 - LOG_INFO "检查texinfo-tex软件包是否在yum源中" - if ! dnf list texinfo-tex &>/dev/null; then - LOG_ERROR "texinfo-tex软件包不在yum源中" - exit 255 - fi - - # 检查软件包是否已安装 - LOG_INFO "检查texinfo-tex软件包是否已安装" - if rpm -q texinfo-tex &>/dev/null; then - LOG_INFO "texinfo-tex软件包已安装,脚本结束后保持安装状态" - INSTALLED=true - else - LOG_INFO "texinfo-tex软件包未安装,开始安装" - dnf install -y texinfo-tex - CHECK_RESULT $? 0 0 "安装texinfo-tex失败" - INSTALLED=false - fi - - # 检查texi2pdf命令的--clean参数是否存在 - LOG_INFO "检查texi2pdf命令的--clean参数是否存在" - texi2pdf --help 2>&1 | grep -q -- --clean - CHECK_RESULT $? 0 0 "texi2pdf命令不支持--clean参数" - - # 检查texi2pdf命令的--build参数是否存在 - LOG_INFO "检查texi2pdf命令的--build参数是否存在" - texi2pdf --help 2>&1 | grep -q -- --build - CHECK_RESULT $? 0 0 "texi2pdf命令不支持--build参数" - - # 创建测试用的texinfo文件 - LOG_INFO "创建测试用的texinfo文件" - cat > test.texinfo << "EOF" - \input texinfo - @setfilename test.info - @settitle Test Document - @bye - EOF - CHECK_RESULT $? 0 0 "创建test.texinfo文件失败" - - # 测试texi2pdf --clean选项 - LOG_INFO "测试texi2pdf --clean选项" - texi2pdf --clean test.texinfo - CHECK_RESULT $? 0 0 "texi2pdf --clean执行失败" - - # 检查是否生成了clean相关的中间文件 - LOG_INFO "检查是否生成了clean相关的中间文件" - if ls test.aux test.cp test.fn test.ky test.log test.pg test.toc test.tp test.vr &>/dev/null; then - LOG_ERROR "texi2pdf --clean未正确清理中间文件" - exit 1 - else - LOG_INFO "texi2pdf --clean正确清理了中间文件" - fi - - # 测试texi2pdf --build=clean选项 - LOG_INFO "测试texi2pdf --build=clean选项" - texi2pdf --build=clean test.texinfo - CHECK_RESULT $? 0 0 "texi2pdf --build=clean执行失败" - - # 检查是否生成了clean相关的中间文件 - LOG_INFO "检查是否生成了clean相关的中间文件" - if ls test.aux test.cp test.fn test.ky test.log test.pg test.toc test.tp test.vr &>/dev/null; then - LOG_ERROR "texi2pdf --build=clean未正确清理中间文件" - exit 1 - else - LOG_INFO "texi2pdf --build=clean正确清理了中间文件" - fi - - # 清理测试文件 - LOG_INFO "清理测试文件" - rm -f test.texinfo test.pdf - CHECK_RESULT $? 0 0 "清理测试文件失败" - - # 如果之前未安装,则卸载软件包 - if [ "$INSTALLED" = false ]; then - LOG_INFO "卸载texinfo-tex软件包" - dnf remove -y texinfo-tex - CHECK_RESULT $? 0 0 "卸载texinfo-tex失败" - else - LOG_INFO "保持texinfo-tex软件包安装状态" - fi - - LOG_INFO "测试完成" -} - -main "$@" \ No newline at end of file diff --git a/testcases/function_test/pkg_test/texinfo/texinfo-tex/test_texinfo-tex_texi2pdf_command.sh b/testcases/function_test/pkg_test/texinfo/texinfo-tex/test_texinfo-tex_texi2pdf_command.sh deleted file mode 100644 index fff192e2f04..00000000000 --- a/testcases/function_test/pkg_test/texinfo/texinfo-tex/test_texinfo-tex_texi2pdf_command.sh +++ /dev/null @@ -1,98 +0,0 @@ -#!/usr/bin/bash - -# Copyright (c) 2024 ISCAS .ALL rights reserved. -# This program is licensed under Mulan PSL v2. -# You can use it according to the terms and conditions of the Mulan PSL v2. -# http://license.coscl.org.cn/MulanPSL2 -# THIS PROGRAM IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, -# EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, -# MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. -# See the Mulan PSL v2 for more details. - -# ############################################# -# @Author : honghua -# @Contact : honghua@iscas.ac.cn -# @Date : 2026-03-12 -# @License : Mulan PSL v2 -# @Desc : 测试texi2pdf命令的--command选项,在输入文件副本中插入命令 -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - # 检查是否已经安装texinfo-tex软件包 - LOG_INFO "检查texinfo-tex软件包是否已安装" - rpm -q texinfo-tex - if [ $? -eq 0 ]; then - LOG_INFO "texinfo-tex软件包已安装,脚本结束后将保持安装状态" - INSTALLED="true" - else - LOG_INFO "texinfo-tex软件包未安装,将在测试步骤中安装" - INSTALLED="false" - fi - - # 检查yum源中是否有texinfo-tex软件包 - LOG_INFO "检查yum源中是否有texinfo-tex软件包" - dnf list available texinfo-tex 2>&1 | grep -q "texinfo-tex" - if [ $? -ne 0 ]; then - LOG_ERROR "yum源中未找到texinfo-tex软件包" - exit 255 - fi - - # 如果未安装,则安装软件包 - if [ "$INSTALLED" = "false" ]; then - LOG_INFO "安装texinfo-tex软件包" - dnf install -y texinfo-tex - CHECK_RESULT $? 0 0 "安装texinfo-tex软件包失败" - fi - - # 准备测试文件 - LOG_INFO "准备测试用的.texinfo文件" - cat > test_input.texinfo << "EOF" - \input texinfo - @setfilename test.info - @settitle Test Document - @node Top - @top Test Document - This is a test document. - @bye - EOF - CHECK_RESULT $? 0 0 "创建测试输入文件失败" - - # 测试texi2pdf命令的--command选项 - LOG_INFO "测试texi2pdf命令的--command选项,在输入文件副本中插入命令" - texi2pdf --command="\pdfcompresslevel=0" test_input.texinfo 2>&1 - CHECK_RESULT $? 0 0 "texi2pdf命令执行失败,--command选项可能不支持" - - # 检查生成的PDF文件 - LOG_INFO "检查是否成功生成PDF文件" - if [ -f "test_input.pdf" ]; then - LOG_INFO "成功生成PDF文件:test_input.pdf" - # 可选:检查PDF文件内容是否包含插入的命令 - # 这里简单检查文件是否存在且非空 - [ -s "test_input.pdf" ] - CHECK_RESULT $? 0 0 "生成的PDF文件为空" - else - LOG_ERROR "未生成PDF文件" - exit 1 - fi - - # 清理测试文件 - LOG_INFO "清理测试生成的临时文件" - rm -f test_input.texinfo test_input.pdf test_input.aux test_input.log test_input.toc test_input.cp test_input.fn test_input.ky test_input.pg test_input.tp test_input.vr test_input.op test_input.tr test_input.mn 2>/dev/null - CHECK_RESULT $? 0 0 "清理临时文件失败" - - # 如果测试前未安装,则卸载软件包 - if [ "$INSTALLED" = "false" ]; then - LOG_INFO "卸载texinfo-tex软件包" - dnf remove -y texinfo-tex - CHECK_RESULT $? 0 0 "卸载texinfo-tex软件包失败" - LOG_INFO "环境已恢复到测试前状态" - else - LOG_INFO "保持texinfo-tex软件包安装状态" - fi - - LOG_INFO "测试脚本执行完毕" -} - -main "$@" \ No newline at end of file diff --git a/testcases/function_test/pkg_test/texinfo/texinfo-tex/test_texinfo-tex_texi2pdf_dvi.sh b/testcases/function_test/pkg_test/texinfo/texinfo-tex/test_texinfo-tex_texi2pdf_dvi.sh deleted file mode 100644 index 0d7e4cc4474..00000000000 --- a/testcases/function_test/pkg_test/texinfo/texinfo-tex/test_texinfo-tex_texi2pdf_dvi.sh +++ /dev/null @@ -1,98 +0,0 @@ -#!/usr/bin/bash - -# Copyright (c) 2024 ISCAS .ALL rights reserved. -# This program is licensed under Mulan PSL v2. -# You can use it according to the terms and conditions of the Mulan PSL v2. -# http://license.coscl.org.cn/MulanPSL2 -# THIS PROGRAM IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, -# EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, -# MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. -# See the Mulan PSL v2 for more details. - -# ############################################# -# @Author : honghua -# @Contact : honghua@iscas.ac.cn -# @Date : 2026-01-28 -# @License : Mulan PSL v2 -# @Desc : 测试使用--dvi选项指定输出DVI格式 -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - set -e - - LOG_INFO "开始测试:使用--dvi选项指定输出DVI格式" - - # 检查软件包是否在yum源中 - LOG_INFO "步骤1:检查texinfo-tex软件包是否在yum源中" - if ! dnf list texinfo-tex &>/dev/null; then - LOG_ERROR "texinfo-tex软件包不在yum源中" - exit 255 - fi - - # 检查环境是否已安装 - LOG_INFO "步骤2:检查环境是否已安装texinfo-tex" - if rpm -q texinfo-tex &>/dev/null; then - LOG_INFO "环境已安装texinfo-tex,测试后保持安装状态" - INSTALLED_BEFORE=true - else - LOG_INFO "环境未安装texinfo-tex,将进行安装" - INSTALLED_BEFORE=false - fi - - # 如果未安装,则安装软件包 - if [ "$INSTALLED_BEFORE" = false ]; then - LOG_INFO "步骤3:安装texinfo-tex软件包" - dnf install -y texinfo-tex - CHECK_RESULT $? 0 0 "安装texinfo-tex失败" - fi - - # 检查texi2pdf命令是否支持--dvi参数 - LOG_INFO "步骤4:检查texi2pdf命令是否支持--dvi参数" - if ! texi2pdf --help 2>&1 | grep -q -- "--dvi"; then - LOG_ERROR "texi2pdf命令不支持--dvi参数" - exit 255 - fi - - # 创建一个简单的测试texinfo文件 - LOG_INFO "步骤5:创建测试texinfo文件" - TEST_TEXI="test.texinfo" - cat > "$TEST_TEXI" <&1 | grep -q -- "--dvipdf" - if [ $? -ne 0 ]; then - LOG_ERROR "texi2pdf命令不支持--dvipdf选项" - exit 255 - fi - - # 创建一个简单的texinfo源文件用于测试 - LOG_INFO "创建测试用的texinfo源文件" - cat > test.texinfo << "EOF" - \input texinfo - @setfilename test.info - @settitle Test Document - @bye - EOF - CHECK_RESULT $? 0 0 "创建texinfo源文件失败" - - # 使用texi2pdf的--dvipdf选项通过DVI生成PDF - LOG_INFO "使用texi2pdf的--dvipdf选项通过DVI生成PDF" - texi2pdf --dvipdf test.texinfo - CHECK_RESULT $? 0 0 "使用--dvipdf选项通过DVI生成PDF失败" - - # 检查是否成功生成PDF文件 - LOG_INFO "检查是否成功生成PDF文件" - [ -f test.pdf ] - CHECK_RESULT $? 0 0 "未成功生成PDF文件" - - # 清理测试文件 - LOG_INFO "清理测试文件" - rm -f test.texinfo test.pdf test.aux test.cp test.cps test.fn test.ky test.log test.pg test.toc test.tp test.vr test.dvi - CHECK_RESULT $? 0 0 "清理测试文件失败" - - # 如果测试前未安装texinfo-tex,则在测试结束后卸载 - if [ "$INSTALLED" = false ]; then - LOG_INFO "卸载texinfo-tex软件包" - dnf remove -y texinfo-tex - CHECK_RESULT $? 0 0 "卸载texinfo-tex失败" - fi - - LOG_INFO "测试完成" -} - -main "$@" \ No newline at end of file diff --git a/testcases/function_test/pkg_test/texinfo/texinfo-tex/test_texinfo-tex_texi2pdf_expand.sh b/testcases/function_test/pkg_test/texinfo/texinfo-tex/test_texinfo-tex_texi2pdf_expand.sh deleted file mode 100644 index bf227d686da..00000000000 --- a/testcases/function_test/pkg_test/texinfo/texinfo-tex/test_texinfo-tex_texi2pdf_expand.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-12 -# @License : Mulan PSL v2 -# @Desc : 测试texi2pdf命令的--expand选项,使用makeinfo进行宏展开 -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - LOG_INFO "开始测试texi2pdf命令的--expand选项" - - # 检查是否已安装texinfo-tex软件包 - LOG_INFO "检查texinfo-tex软件包是否已安装" - if dnf list installed texinfo-tex &>/dev/null; then - LOG_INFO "texinfo-tex已安装,测试结束后保持安装状态" - INSTALLED=true - else - LOG_INFO "texinfo-tex未安装,将在测试结束后卸载" - INSTALLED=false - fi - - # 检查yum源中是否有texinfo-tex软件包 - LOG_INFO "检查yum源中是否有texinfo-tex软件包" - if ! dnf list available texinfo-tex &>/dev/null; then - LOG_ERROR "yum源中未找到texinfo-tex软件包" - exit 255 - fi - - # 如果未安装,则安装软件包 - if [ "$INSTALLED" = false ]; then - LOG_INFO "安装texinfo-tex软件包" - dnf install -y texinfo-tex - CHECK_RESULT $? 0 0 "安装texinfo-tex软件包失败" - fi - - # 检查texi2pdf命令是否支持--expand选项 - LOG_INFO "检查texi2pdf命令是否支持--expand选项" - if ! texi2pdf --help 2>&1 | grep -q "\-\-expand"; then - LOG_ERROR "texi2pdf命令不支持--expand选项" - exit 255 - fi - - # 创建一个简单的texinfo测试文件 - LOG_INFO "创建测试用的texinfo文件" - cat > test.texinfo << "EOF" - \input texinfo - @setfilename test.info - @settitle Test Document - @node Top - @top Test Document - This is a test document. - @bye - EOF - CHECK_RESULT $? 0 0 "创建texinfo测试文件失败" - - # 使用texi2pdf命令的--expand选项进行宏展开 - LOG_INFO "使用texi2pdf命令的--expand选项进行宏展开" - texi2pdf --expand test.texinfo - CHECK_RESULT $? 0 0 "texi2pdf命令执行失败" - - # 检查是否生成了预期的输出文件 - LOG_INFO "检查是否生成了PDF文件" - if [ -f test.pdf ]; then - LOG_INFO "成功生成PDF文件" - else - LOG_ERROR "未生成PDF文件" - exit 1 - fi - - # 清理测试文件 - LOG_INFO "清理测试文件" - rm -f test.texinfo test.pdf test.log test.aux test.cp test.cps test.fn test.fns test.ky test.log test.pg test.toc test.tp test.vr test.vrs - - # 如果测试前未安装软件包,则卸载 - if [ "$INSTALLED" = false ]; then - LOG_INFO "卸载texinfo-tex软件包" - dnf remove -y texinfo-tex - CHECK_RESULT $? 0 0 "卸载texinfo-tex软件包失败" - fi - - LOG_INFO "测试完成" -} - -main "$@" \ No newline at end of file diff --git a/testcases/function_test/pkg_test/texinfo/texinfo-tex/test_texinfo-tex_texi2pdf_help.sh b/testcases/function_test/pkg_test/texinfo/texinfo-tex/test_texinfo-tex_texi2pdf_help.sh deleted file mode 100644 index 36e2aa68526..00000000000 --- a/testcases/function_test/pkg_test/texinfo/texinfo-tex/test_texinfo-tex_texi2pdf_help.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-12 -# @License : Mulan PSL v2 -# @Desc : 测试texi2pdf命令的--help选项,查看帮助信息 -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - # 定义软件包名称和命令 - PACKAGE_NAME="texinfo-tex" - COMMAND="texi2pdf" - OPTION="--help" - - # 步骤1:检查yum源中是否存在软件包 - LOG_INFO "步骤1:检查yum源中是否存在软件包${PACKAGE_NAME}" - dnf list available ${PACKAGE_NAME} &> /dev/null - if [ $? -ne 0 ]; then - LOG_ERROR "软件包${PACKAGE_NAME}在yum源中不存在" - exit 255 - fi - - # 步骤2:检查软件包是否已经安装 - LOG_INFO "步骤2:检查软件包${PACKAGE_NAME}是否已经安装" - rpm -q ${PACKAGE_NAME} &> /dev/null - if [ $? -eq 0 ]; then - INSTALLED="true" - LOG_INFO "软件包${PACKAGE_NAME}已经安装" - else - INSTALLED="false" - LOG_INFO "软件包${PACKAGE_NAME}未安装" - fi - - # 步骤3:如果未安装,则安装软件包 - if [ "${INSTALLED}" = "false" ]; then - LOG_INFO "步骤3:安装软件包${PACKAGE_NAME}" - dnf install -y ${PACKAGE_NAME} &> /dev/null - CHECK_RESULT $? 0 0 "安装软件包${PACKAGE_NAME}失败" - fi - - # 步骤4:检查texi2pdf命令是否支持--help选项 - LOG_INFO "步骤4:检查texi2pdf命令是否支持--help选项" - ${COMMAND} ${OPTION} &> /dev/null - if [ $? -eq 255 ]; then - LOG_ERROR "texi2pdf命令不支持--help选项" - exit 255 - fi - - # 步骤5:执行texi2pdf --help命令并检查帮助信息 - LOG_INFO "步骤5:执行texi2pdf --help命令并检查帮助信息" - ${COMMAND} ${OPTION} | grep -q "Usage:" - CHECK_RESULT $? 0 0 "texi2pdf --help命令执行失败或帮助信息不正确" - - # 步骤6:环境恢复 - LOG_INFO "步骤6:环境恢复" - if [ "${INSTALLED}" = "false" ]; then - LOG_INFO "卸载软件包${PACKAGE_NAME}" - dnf remove -y ${PACKAGE_NAME} &> /dev/null - CHECK_RESULT $? 0 0 "卸载软件包${PACKAGE_NAME}失败" - else - LOG_INFO "保持软件包${PACKAGE_NAME}的安装状态" - fi - - LOG_INFO "测试脚本执行完成" -} - -main "$@" \ No newline at end of file diff --git a/testcases/function_test/pkg_test/texinfo/texinfo-tex/test_texinfo-tex_texi2pdf_html.sh b/testcases/function_test/pkg_test/texinfo/texinfo-tex/test_texinfo-tex_texi2pdf_html.sh deleted file mode 100644 index aa1197173c3..00000000000 --- a/testcases/function_test/pkg_test/texinfo/texinfo-tex/test_texinfo-tex_texi2pdf_html.sh +++ /dev/null @@ -1,101 +0,0 @@ -#!/usr/bin/bash - -# Copyright (c) 2024 ISCAS .ALL rights reserved. -# This program is licensed under Mulan PSL v2. -# You can use it according to the terms and conditions of the Mulan PSL v2. -# http://license.coscl.org.cn/MulanPSL2 -# THIS PROGRAM IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, -# EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, -# MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. -# See the Mulan PSL v2 for more details. - -# ############################################# -# @Author : honghua -# @Contact : honghua@iscas.ac.cn -# @Date : 2026-01-28 -# @License : Mulan PSL v2 -# @Desc : 测试使用--html选项通过HeVeA生成HTML -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - # 判断是否已安装texinfo-tex软件包 - LOG_INFO "检查是否已安装texinfo-tex软件包" - if dnf list installed texinfo-tex &>/dev/null; then - LOG_INFO "texinfo-tex已安装,测试结束后保持安装状态" - INSTALLED=true - else - LOG_INFO "texinfo-tex未安装,将在测试过程中安装" - INSTALLED=false - fi - - # 检查yum源中是否有texinfo-tex软件包 - LOG_INFO "检查yum源中是否有texinfo-tex软件包" - if ! dnf list available texinfo-tex &>/dev/null; then - LOG_ERROR "yum源中未找到texinfo-tex软件包" - exit 255 - fi - - # 如果未安装,则安装软件包 - if [ "$INSTALLED" = false ]; then - LOG_INFO "安装texinfo-tex软件包" - dnf install -y texinfo-tex - CHECK_RESULT $? 0 0 "安装texinfo-tex失败" - fi - - # 检查texi2pdf命令是否存在 - LOG_INFO "检查texi2pdf命令是否存在" - if ! command -v texi2pdf &>/dev/null; then - LOG_ERROR "texi2pdf命令不存在" - exit 255 - fi - - # 检查texi2pdf是否支持--html选项 - LOG_INFO "检查texi2pdf是否支持--html选项" - if ! texi2pdf --help 2>&1 | grep -q "\-\-html"; then - LOG_ERROR "texi2pdf不支持--html选项" - exit 255 - fi - - # 创建测试用的简单TeX文件 - LOG_INFO "创建测试用的简单TeX文件" - cat > test.tex << "EOF" - \documentclass{article} - \begin{document} - Hello, World! - \end{document} - EOF - CHECK_RESULT $? 0 0 "创建测试文件失败" - - # 测试使用--html选项通过HeVeA生成HTML - LOG_INFO "测试使用--html选项通过HeVeA生成HTML" - texi2pdf --html test.tex - CHECK_RESULT $? 0 0 "texi2pdf --html命令执行失败" - - # 检查生成的HTML文件是否存在 - LOG_INFO "检查生成的HTML文件是否存在" - if [ -f test.html ]; then - LOG_INFO "成功生成HTML文件:test.html" - CHECK_RESULT 0 0 0 "HTML文件生成成功" - else - LOG_ERROR "未生成HTML文件" - CHECK_RESULT 1 0 0 "HTML文件生成失败" - fi - - # 清理测试文件 - LOG_INFO "清理测试文件" - rm -f test.tex test.html test.aux test.log test.out - CHECK_RESULT $? 0 0 "清理测试文件失败" - - # 如果测试前未安装,则卸载软件包 - if [ "$INSTALLED" = false ]; then - LOG_INFO "卸载texinfo-tex软件包" - dnf remove -y texinfo-tex - CHECK_RESULT $? 0 0 "卸载texinfo-tex失败" - fi - - LOG_INFO "测试完成" -} - -main "$@" \ No newline at end of file diff --git a/testcases/function_test/pkg_test/texinfo/texinfo-tex/test_texinfo-tex_texi2pdf_info.sh b/testcases/function_test/pkg_test/texinfo/texinfo-tex/test_texinfo-tex_texi2pdf_info.sh deleted file mode 100644 index 81cb90421d7..00000000000 --- a/testcases/function_test/pkg_test/texinfo/texinfo-tex/test_texinfo-tex_texi2pdf_info.sh +++ /dev/null @@ -1,166 +0,0 @@ -#!/usr/bin/bash - -# Copyright (c) 2024 ISCAS .ALL rights reserved. -# This program is licensed under Mulan PSL v2. -# You can use it according to the terms and conditions of the Mulan PSL v2. -# http://license.coscl.org.cn/MulanPSL2 -# THIS PROGRAM IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, -# EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, -# MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. -# See the Mulan PSL v2 for more details. - -# ############################################# -# @Author : honghua -# @Contact : honghua@iscas.ac.cn -# @Date : 2026-01-28 -# @License : Mulan PSL v2 -# @Desc : 测试使用--info选项通过HeVeA生成Info -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - # 定义测试变量 - PACKAGE_NAME="texinfo-tex" - TEST_FILE="test_input.texi" - INFO_FILE="test_input.info" - - # 清理函数 - cleanup() { - LOG_INFO "清理测试环境" - if [ -f "$TEST_FILE" ]; then - rm -f "$TEST_FILE" - fi - if [ -f "$INFO_FILE" ]; then - rm -f "$INFO_FILE" - fi - } - - # 创建测试输入文件 - create_test_input() { - LOG_INFO "创建测试输入文件" - cat > "$TEST_FILE" << EOF - \input texinfo - @setfilename test_input.info - @settitle Test Document - @node Top - @top Test Document - This is a test document. - @bye - EOF - CHECK_RESULT $? 0 0 "创建测试输入文件失败" - } - - # 检查软件包是否可用 - check_package_available() { - LOG_INFO "检查软件包是否在yum源中" - dnf list available "$PACKAGE_NAME" &>/dev/null - if [ $? -ne 0 ]; then - LOG_ERROR "软件包 $PACKAGE_NAME 不在yum源中" - exit 255 - fi - } - - # 检查命令参数 - check_command_option() { - LOG_INFO "检查texi2pdf命令是否支持--info参数" - texi2pdf --help 2>&1 | grep -q "\-\-info" - if [ $? -ne 0 ]; then - LOG_ERROR "texi2pdf命令不支持--info参数" - exit 255 - fi - } - - # 检查是否已安装 - check_installed() { - LOG_INFO "检查软件包是否已安装" - rpm -q "$PACKAGE_NAME" &>/dev/null - return $? - } - - # 安装软件包 - install_package() { - LOG_INFO "安装软件包" - dnf install -y "$PACKAGE_NAME" - CHECK_RESULT $? 0 0 "安装软件包失败" - } - - # 卸载软件包 - uninstall_package() { - LOG_INFO "卸载软件包" - dnf remove -y "$PACKAGE_NAME" - CHECK_RESULT $? 0 0 "卸载软件包失败" - } - - # 主测试函数 - main_test() { - LOG_INFO "开始测试--info选项通过HeVeA生成Info" - - # 检查软件包是否可用 - check_package_available - - # 检查命令参数 - check_command_option - - # 记录初始安装状态 - check_installed - ORIGINAL_INSTALLED=$? - - # 如果未安装,则安装 - if [ $ORIGINAL_INSTALLED -ne 0 ]; then - install_package - NEED_CLEANUP=1 - else - LOG_INFO "软件包已安装,保持原状" - NEED_CLEANUP=0 - fi - - # 创建测试输入文件 - create_test_input - - # 执行测试命令 - LOG_INFO "执行texi2pdf --info命令" - texi2pdf --info "$TEST_FILE" 2>&1 - CHECK_RESULT $? 0 0 "texi2pdf --info命令执行失败" - - # 检查生成的info文件 - LOG_INFO "检查生成的info文件" - if [ -f "$INFO_FILE" ]; then - LOG_INFO "成功生成info文件: $INFO_FILE" - # 检查info文件格式 - file "$INFO_FILE" | grep -q "Info" - CHECK_RESULT $? 0 0 "生成的info文件格式不正确" - else - LOG_ERROR "未生成info文件" - CHECK_RESULT 1 0 0 "未生成info文件" - fi - } - - # 环境恢复 - restore_environment() { - LOG_INFO "恢复测试环境" - - # 清理测试文件 - cleanup - - # 如果测试前未安装,则卸载软件包 - if [ "$NEED_CLEANUP" = "1" ]; then - uninstall_package - fi - - LOG_INFO "环境恢复完成" - } - - # 设置错误处理 - trap "LOG_ERROR "测试被中断"; restore_environment; exit 1" INT TERM - - # 执行主测试 - main_test - - # 恢复环境 - restore_environment - - LOG_INFO "测试完成" -} - -main "$@" \ No newline at end of file diff --git a/testcases/function_test/pkg_test/texinfo/texinfo-tex/test_texinfo-tex_texi2pdf_l.sh b/testcases/function_test/pkg_test/texinfo/texinfo-tex/test_texinfo-tex_texi2pdf_l.sh deleted file mode 100644 index 83cd65d9737..00000000000 --- a/testcases/function_test/pkg_test/texinfo/texinfo-tex/test_texinfo-tex_texi2pdf_l.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-01-28 -# @License : Mulan PSL v2 -# @Desc : 测试使用--language选项指定输入文件的语言 -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - # 检查是否已经安装texinfo-tex和texi2pdf - LOG_INFO "检查是否已安装texinfo-tex和texi2pdf" - if dnf list installed texinfo-tex &>/dev/null && dnf list installed texi2pdf &>/dev/null; then - LOG_INFO "texinfo-tex和texi2pdf已安装,测试结束后将保持安装状态" - INSTALLED=true - else - LOG_INFO "texinfo-tex和texi2pdf未安装,将在测试前安装" - INSTALLED=false - fi - - # 检查yum源中是否有texinfo-tex软件包 - LOG_INFO "检查yum源中是否有texinfo-tex软件包" - if ! dnf list available texinfo-tex &>/dev/null; then - LOG_ERROR "yum源中不存在texinfo-tex软件包" - exit 255 - fi - - # 检查yum源中是否有texi2pdf软件包 - LOG_INFO "检查yum源中是否有texi2pdf软件包" - if ! dnf list available texi2pdf &>/dev/null; then - LOG_ERROR "yum源中不存在texi2pdf软件包" - exit 255 - fi - - # 如果未安装,则安装软件包 - if [ "$INSTALLED" = false ]; then - LOG_INFO "安装texinfo-tex和texi2pdf软件包" - dnf install -y texinfo-tex texi2pdf - CHECK_RESULT $? 0 0 "安装texinfo-tex和texi2pdf失败" - fi - - # 创建测试用的.texinfo文件 - LOG_INFO "创建测试用的.texinfo文件" - cat > test_language.texinfo << "EOF" - \input texinfo - @setfilename test_language.info - @settitle Test Language Option - @bye - EOF - CHECK_RESULT $? 0 0 "创建test_language.texinfo文件失败" - - # 测试texi2pdf命令是否支持--language选项 - LOG_INFO "检查texi2pdf命令是否支持--language选项" - if ! texi2pdf --help 2>&1 | grep -q -- --language; then - LOG_ERROR "texi2pdf命令不支持--language选项" - # 清理测试文件 - rm -f test_language.texinfo test_language.info test_language.pdf - # 如果测试前未安装,则卸载软件包 - if [ "$INSTALLED" = false ]; then - LOG_INFO "卸载texinfo-tex和texi2pdf软件包" - dnf remove -y texinfo-tex texi2pdf - fi - exit 255 - fi - - # 使用--language选项指定语言并执行texi2pdf - LOG_INFO "使用--language选项指定语言并执行texi2pdf" - texi2pdf --language=english test_language.texinfo - CHECK_RESULT $? 0 0 "texi2pdf使用--language选项执行失败" - - # 验证生成的PDF文件是否存在 - LOG_INFO "验证生成的PDF文件是否存在" - if [ -f test_language.pdf ]; then - LOG_INFO "PDF文件生成成功" - else - LOG_ERROR "PDF文件生成失败" - CHECK_RESULT 1 0 1 "PDF文件生成失败" - fi - - # 清理测试文件 - LOG_INFO "清理测试文件" - rm -f test_language.texinfo test_language.info test_language.pdf - CHECK_RESULT $? 0 0 "清理测试文件失败" - - # 如果测试前未安装,则卸载软件包 - if [ "$INSTALLED" = false ]; then - LOG_INFO "卸载texinfo-tex和texi2pdf软件包" - dnf remove -y texinfo-tex texi2pdf - CHECK_RESULT $? 0 0 "卸载texinfo-tex和texi2pdf失败" - fi - - LOG_INFO "测试完成" -} - -main "$@" \ No newline at end of file diff --git a/testcases/function_test/pkg_test/texinfo/texinfo-tex/test_texinfo-tex_texi2pdf_language.sh b/testcases/function_test/pkg_test/texinfo/texinfo-tex/test_texinfo-tex_texi2pdf_language.sh deleted file mode 100644 index 584dd177636..00000000000 --- a/testcases/function_test/pkg_test/texinfo/texinfo-tex/test_texinfo-tex_texi2pdf_language.sh +++ /dev/null @@ -1,146 +0,0 @@ -#!/usr/bin/bash - -# Copyright (c) 2024 ISCAS .ALL rights reserved. -# This program is licensed under Mulan PSL v2. -# You can use it according to the terms and conditions of the Mulan PSL v2. -# http://license.coscl.org.cn/MulanPSL2 -# THIS PROGRAM IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, -# EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, -# MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. -# See the Mulan PSL v2 for more details. - -# ############################################# -# @Author : honghua -# @Contact : honghua@iscas.ac.cn -# @Date : 2026-03-12 -# @License : Mulan PSL v2 -# @Desc : 测试texi2pdf命令的--language选项,指定输入文件语言 -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - # 定义日志函数(虽然题目说不需要定义,但实际使用时需要定义) - LOG_INFO() { - echo "[INFO] $1" - } - - LOG_ERROR() { - echo "[ERROR] $1" - } - - # 定义检查结果函数(虽然题目说不需要定义,但实际使用时需要定义) - CHECK_RESULT() { - local actual=$1 - local expected=$2 - local error_code=$3 - local message=$4 - - if [ $actual -eq $expected ]; then - LOG_INFO "$message 检查通过" - return 0 - else - LOG_ERROR "$message 检查失败" - exit $error_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" - } - - # 测试脚本开始 - LOG_INFO "开始测试texi2pdf命令的--language选项" - - # 检查软件包是否已安装 - LOG_INFO "检查texinfo-tex软件包是否已安装" - if rpm -q texinfo-tex > /dev/null 2>&1; then - LOG_INFO "texinfo-tex软件包已安装" - INSTALLED_BEFORE_TEST=true - else - LOG_INFO "texinfo-tex软件包未安装" - INSTALLED_BEFORE_TEST=false - fi - - # 检查yum源中是否有该软件包 - LOG_INFO "检查yum源中是否有texinfo-tex软件包" - if dnf list available texinfo-tex > /dev/null 2>&1; then - LOG_INFO "yum源中存在texinfo-tex软件包" - else - LOG_ERROR "yum源中不存在texinfo-tex软件包" - exit 255 - fi - - # 如果未安装,则安装软件包 - if [ "$INSTALLED_BEFORE_TEST" = "false" ]; then - LOG_INFO "安装texinfo-tex软件包" - dnf install -y texinfo-tex - CHECK_RESULT $? 0 0 "安装texinfo-tex软件包" - fi - - # 检查texi2pdf命令是否支持--language参数 - LOG_INFO "检查texi2pdf命令是否支持--language参数" - texi2pdf --help | grep -q "\-\-language" - CHECK_RESULT $? 0 255 "检查texi2pdf命令是否支持--language参数" - - # 创建测试用的texinfo文件 - LOG_INFO "创建测试用的texinfo文件" - cat > test_language.texinfo << "EOF" - \input texinfo - @setfilename test_language.info - @settitle Test Language - @end ifinfo - @titlepage - @title Test Language - @end titlepage - @bye - EOF - CHECK_RESULT $? 0 0 "创建测试用的texinfo文件" - - # 测试texi2pdf命令的--language选项 - LOG_INFO "测试texi2pdf命令的--language选项,指定语言为English" - texi2pdf --language=English test_language.texinfo - CHECK_RESULT $? 0 0 "使用--language=English参数执行texi2pdf命令" - - # 检查生成的PDF文件 - LOG_INFO "检查生成的PDF文件" - if [ -f test_language.pdf ]; then - LOG_INFO "成功生成PDF文件" - else - LOG_ERROR "未生成PDF文件" - exit 1 - fi - - # 测试不支持的language参数 - LOG_INFO "测试texi2pdf命令的--language选项,指定不存在的语言" - texi2pdf --language=NonexistentLanguage test_language.texinfo 2>/dev/null - if [ $? -eq 255 ]; then - LOG_INFO "不存在的language参数处理正确" - else - LOG_ERROR "不存在的language参数处理不正确" - exit 1 - fi - - # 清理测试文件 - LOG_INFO "清理测试文件" - rm -f test_language.texinfo test_language.pdf test_language.aux test_language.log test_language.toc - CHECK_RESULT $? 0 0 "清理测试文件" - - # 恢复环境:如果测试前未安装,则卸载软件包 - if [ "$INSTALLED_BEFORE_TEST" = "false" ]; then - LOG_INFO "卸载texinfo-tex软件包" - dnf remove -y texinfo-tex - CHECK_RESULT $? 0 0 "卸载texinfo-tex软件包" - fi - - LOG_INFO "测试完成,环境已恢复" -} - -main "$@" \ No newline at end of file diff --git a/testcases/function_test/pkg_test/texinfo/texinfo-tex/test_texinfo-tex_texi2pdf_max_iterations.sh b/testcases/function_test/pkg_test/texinfo/texinfo-tex/test_texinfo-tex_texi2pdf_max_iterations.sh deleted file mode 100644 index 0b32d650189..00000000000 --- a/testcases/function_test/pkg_test/texinfo/texinfo-tex/test_texinfo-tex_texi2pdf_max_iterations.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-01-28 -# @License : Mulan PSL v2 -# @Desc : 测试使用--max-iterations选项限制最大处理迭代次数 -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - # 判断是否已安装texinfo-tex - LOG_INFO "检查texinfo-tex软件包是否已安装" - rpm -q texinfo-tex > /dev/null 2>&1 - if [ $? -eq 0 ]; then - LOG_INFO "texinfo-tex软件包已安装,测试结束后保持安装状态" - INSTALLED=1 - else - LOG_INFO "texinfo-tex软件包未安装,将在测试前安装并在测试后卸载" - INSTALLED=0 - fi - - # 检查yum源中是否有texinfo-tex软件包 - LOG_INFO "检查yum源中是否有texinfo-tex软件包" - dnf list available texinfo-tex > /dev/null 2>&1 - CHECK_RESULT $? 0 0 "yum源中未找到texinfo-tex软件包" - if [ $? -ne 0 ]; then - LOG_ERROR "yum源中未找到texinfo-tex软件包" - exit 255 - fi - - # 如果未安装,则安装软件包 - if [ $INSTALLED -eq 0 ]; then - LOG_INFO "安装texinfo-tex软件包" - dnf install -y texinfo-tex > /dev/null 2>&1 - CHECK_RESULT $? 0 0 "安装texinfo-tex软件包失败" - fi - - # 检查texi2pdf命令是否支持--max-iterations选项 - LOG_INFO "检查texi2pdf命令是否支持--max-iterations选项" - texi2pdf --help 2>&1 | grep -q "\-\-max\-iterations" - CHECK_RESULT $? 0 0 "texi2pdf命令不支持--max-iterations选项" - if [ $? -ne 0 ]; then - LOG_ERROR "texi2pdf命令不支持--max-iterations选项" - # 清理环境 - if [ $INSTALLED -eq 0 ]; then - LOG_INFO "卸载texinfo-tex软件包" - dnf remove -y texinfo-tex > /dev/null 2>&1 - fi - exit 255 - fi - - # 创建一个简单的texinfo测试文件 - LOG_INFO "创建测试用的texinfo文件" - cat > test.texi << EOF - \input texinfo - @setfilename test.info - @settitle Test Document - @bye - EOF - - # 测试使用--max-iterations选项 - LOG_INFO "测试使用--max-iterations选项限制最大处理迭代次数" - texi2pdf --max-iterations=5 test.texi > /dev/null 2>&1 - CHECK_RESULT $? 0 0 "使用--max-iterations选项执行texi2pdf命令失败" - - # 清理测试文件 - LOG_INFO "清理测试文件" - rm -f test.texi test.pdf test.log test.aux test.cp test.cps test.fn test.ky test.pg test.tp test.vr test.toc test.info - - # 如果测试前未安装,则卸载软件包 - if [ $INSTALLED -eq 0 ]; then - LOG_INFO "卸载texinfo-tex软件包" - dnf remove -y texinfo-tex > /dev/null 2>&1 - CHECK_RESULT $? 0 0 "卸载texinfo-tex软件包失败" - fi - - LOG_INFO "测试完成,环境已恢复" -} - -main "$@" \ No newline at end of file diff --git a/testcases/function_test/pkg_test/texinfo/texinfo-tex/test_texinfo-tex_texi2pdf_mostly_clean.sh b/testcases/function_test/pkg_test/texinfo/texinfo-tex/test_texinfo-tex_texi2pdf_mostly_clean.sh deleted file mode 100644 index d835d2b68d4..00000000000 --- a/testcases/function_test/pkg_test/texinfo/texinfo-tex/test_texinfo-tex_texi2pdf_mostly_clean.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-01-28 -# @License : Mulan PSL v2 -# @Desc : 测试使用--mostly-clean选项清除之前的辅助文件 -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - LOG_INFO "开始测试--mostly-clean选项清除之前的辅助文件" - - # 检查texi2pdf命令是否可用 - LOG_INFO "检查texi2pdf命令是否可用" - if ! command -v texi2pdf &> /dev/null; then - LOG_INFO "texi2pdf命令未安装,开始安装texinfo-tex软件包" - - # 检查yum源中是否有texinfo-tex软件包 - LOG_INFO "检查yum源中是否有texinfo-tex软件包" - if ! dnf list available texinfo-tex &> /dev/null; then - LOG_ERROR "yum源中没有找到texinfo-tex软件包" - exit 255 - fi - - # 安装texinfo-tex软件包 - LOG_INFO "安装texinfo-tex软件包" - dnf install -y texinfo-tex - CHECK_RESULT $? 0 0 "安装texinfo-tex软件包失败" - - INSTALLED_FLAG=1 - else - LOG_INFO "texi2pdf命令已安装" - INSTALLED_FLAG=0 - fi - - # 创建测试用的.tex文件 - LOG_INFO "创建测试用的.tex文件" - cat > test.tex << "EOF" - \documentclass{article} - \begin{document} - Hello, world! - \end{document} - EOF - CHECK_RESULT $? 0 0 "创建.tex文件失败" - - # 使用texi2pdf命令处理.tex文件 - LOG_INFO "使用texi2pdf命令处理.tex文件" - texi2pdf test.tex - CHECK_RESULT $? 0 0 "texi2pdf命令执行失败" - - # 检查生成的辅助文件 - LOG_INFO "检查生成的辅助文件" - if [ -f test.aux ] || [ -f test.log ] || [ -f test.toc ]; then - LOG_INFO "辅助文件已生成" - else - LOG_ERROR "未找到预期的辅助文件" - exit 1 - fi - - # 测试--mostly-clean选项 - LOG_INFO "测试--mostly-clean选项" - if texi2pdf --help | grep -q "mostly-clean"; then - texi2pdf --mostly-clean test.tex - CHECK_RESULT $? 0 0 "--mostly-clean选项执行失败" - - # 检查辅助文件是否被清除 - LOG_INFO "检查辅助文件是否被清除" - if [ -f test.aux ] || [ -f test.log ] || [ -f test.toc ]; then - LOG_ERROR "辅助文件未被清除" - exit 1 - else - LOG_INFO "辅助文件已被成功清除" - fi - else - LOG_ERROR "texi2pdf命令不支持--mostly-clean选项" - exit 255 - fi - - # 清理测试文件 - LOG_INFO "清理测试文件" - rm -f test.tex test.pdf - CHECK_RESULT $? 0 0 "清理测试文件失败" - - # 恢复环境 - LOG_INFO "恢复环境" - if [ $INSTALLED_FLAG -eq 1 ]; then - LOG_INFO "卸载texinfo-tex软件包" - dnf remove -y texinfo-tex - CHECK_RESULT $? 0 0 "卸载texinfo-tex软件包失败" - fi - - LOG_INFO "测试完成" -} - -main "$@" \ No newline at end of file diff --git a/testcases/function_test/pkg_test/texinfo/texinfo-tex/test_texinfo-tex_texi2pdf_no_line_error.sh b/testcases/function_test/pkg_test/texinfo/texinfo-tex/test_texinfo-tex_texi2pdf_no_line_error.sh deleted file mode 100644 index 3e2246951e2..00000000000 --- a/testcases/function_test/pkg_test/texinfo/texinfo-tex/test_texinfo-tex_texi2pdf_no_line_error.sh +++ /dev/null @@ -1,95 +0,0 @@ -#!/usr/bin/bash - -# Copyright (c) 2024 ISCAS .ALL rights reserved. -# This program is licensed under Mulan PSL v2. -# You can use it according to the terms and conditions of the Mulan PSL v2. -# http://license.coscl.org.cn/MulanPSL2 -# THIS PROGRAM IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, -# EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, -# MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. -# See the Mulan PSL v2 for more details. - -# ############################################# -# @Author : honghua -# @Contact : honghua@iscas.ac.cn -# @Date : 2026-01-28 -# @License : Mulan PSL v2 -# @Desc : 测试使用--no-line-error选项禁止传递--file-line-error给TeX -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - # 检查是否已经安装了texinfo-tex - LOG_INFO "检查是否已安装texinfo-tex软件包" - rpm -q texinfo-tex - if [ $? -eq 0 ]; then - LOG_INFO "texinfo-tex已安装,脚本结束后将保持安装状态" - INSTALLED=1 - else - LOG_INFO "texinfo-tex未安装,将在测试步骤中安装" - INSTALLED=0 - fi - - # 检查yum源中是否有texinfo-tex软件包 - LOG_INFO "检查yum源中是否有texinfo-tex软件包" - dnf list available texinfo-tex > /dev/null 2>&1 - if [ $? -ne 0 ]; then - LOG_ERROR "yum源中未找到texinfo-tex软件包" - exit 255 - fi - - # 如果未安装,则安装texinfo-tex - if [ $INSTALLED -eq 0 ]; then - LOG_INFO "开始安装texinfo-tex软件包" - dnf install -y texinfo-tex - CHECK_RESULT $? 0 0 "安装texinfo-tex失败" - fi - - # 创建测试用的texi文件 - LOG_INFO "创建测试用的texi文件" - cat > test.texi << "EOF" - \input texinfo - @setfilename test.info - @settitle Test Document - @node Top - @top Test Document - This is a test document. - @bye - EOF - CHECK_RESULT $? 0 0 "创建texi文件失败" - - # 测试texi2pdf命令是否支持--no-line-error选项 - LOG_INFO "检查texi2pdf命令是否支持--no-line-error选项" - texi2pdf --help 2>&1 | grep -q -- "--no-line-error" - if [ $? -ne 0 ]; then - LOG_ERROR "texi2pdf命令不支持--no-line-error选项" - exit 255 - fi - - # 使用--no-line-error选项运行texi2pdf - LOG_INFO "使用--no-line-error选项运行texi2pdf命令" - texi2pdf --no-line-error test.texi > /dev/null 2>&1 - CHECK_RESULT $? 0 0 "texi2pdf命令执行失败" - - # 检查生成的PDF文件是否存在 - LOG_INFO "检查生成的PDF文件是否存在" - [ -f test.pdf ] - CHECK_RESULT $? 0 0 "未生成PDF文件" - - # 清理测试文件 - LOG_INFO "清理测试文件" - rm -f test.texi test.pdf test.aux test.cp test.cps test.fn test.ky test.log test.op test.pg test.toc test.tp test.vr - CHECK_RESULT $? 0 0 "清理测试文件失败" - - # 如果测试前未安装,则卸载texinfo-tex - if [ $INSTALLED -eq 0 ]; then - LOG_INFO "卸载texinfo-tex软件包" - dnf remove -y texinfo-tex - CHECK_RESULT $? 0 0 "卸载texinfo-tex失败" - fi - - LOG_INFO "测试完成" -} - -main "$@" \ No newline at end of file diff --git a/testcases/function_test/pkg_test/texinfo/texinfo-tex/test_texinfo-tex_texi2pdf_output.sh b/testcases/function_test/pkg_test/texinfo/texinfo-tex/test_texinfo-tex_texi2pdf_output.sh deleted file mode 100644 index 3411a2749c5..00000000000 --- a/testcases/function_test/pkg_test/texinfo/texinfo-tex/test_texinfo-tex_texi2pdf_output.sh +++ /dev/null @@ -1,95 +0,0 @@ -#!/usr/bin/bash - -# Copyright (c) 2024 ISCAS .ALL rights reserved. -# This program is licensed under Mulan PSL v2. -# You can use it according to the terms and conditions of the Mulan PSL v2. -# http://license.coscl.org.cn/MulanPSL2 -# THIS PROGRAM IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, -# EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, -# MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. -# See the Mulan PSL v2 for more details. - -# ############################################# -# @Author : honghua -# @Contact : honghua@iscas.ac.cn -# @Date : 2026-03-12 -# @License : Mulan PSL v2 -# @Desc : 测试texi2pdf命令的--output选项,指定输出文件 -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - LOG_INFO "开始测试texi2pdf命令的--output选项,指定输出文件" - - # 检查软件包是否在yum源中 - LOG_INFO "检查yum源中是否存在texinfo-tex软件包" - if ! dnf list available texinfo-tex 2>/dev/null | grep -q texinfo-tex; then - LOG_ERROR "yum源中不存在texinfo-tex软件包" - exit 255 - fi - - # 检查环境是否已安装texinfo-tex - LOG_INFO "检查环境是否已安装texinfo-tex软件包" - if rpm -q texinfo-tex &>/dev/null; then - LOG_INFO "环境已安装texinfo-tex软件包,测试结束后将保持安装状态" - INSTALLED=true - else - LOG_INFO "环境未安装texinfo-tex软件包,将进行安装" - INSTALLED=false - fi - - # 如果未安装,则安装软件包 - if [ "$INSTALLED" = false ]; then - LOG_INFO "安装texinfo-tex软件包" - dnf install -y texinfo-tex - CHECK_RESULT $? 0 0 "安装texinfo-tex软件包失败" - fi - - # 检查texi2pdf命令是否支持--output选项 - LOG_INFO "检查texi2pdf命令是否支持--output选项" - texi2pdf --help 2>&1 | grep -q -- --output - CHECK_RESULT $? 0 0 "texi2pdf命令不支持--output选项" - - # 创建测试用的texinfo源文件 - LOG_INFO "创建测试用的texinfo源文件" - cat > test.texinfo << "EOF" - \input texinfo - @setfilename test.info - @settitle Test Document - @node Top - @top Test Document - This is a test document. - @bye - EOF - CHECK_RESULT $? 0 0 "创建texinfo源文件失败" - - # 测试texi2pdf命令的--output选项 - LOG_INFO "测试texi2pdf命令的--output选项,指定输出文件为output.pdf" - texi2pdf --output=output.pdf test.texinfo - CHECK_RESULT $? 0 0 "texi2pdf命令执行失败" - - # 检查输出文件是否生成 - LOG_INFO "检查输出文件output.pdf是否生成" - if [ -f output.pdf ]; then - LOG_INFO "输出文件output.pdf生成成功" - else - LOG_ERROR "输出文件output.pdf未生成" - exit 1 - fi - - # 清理测试文件 - LOG_INFO "清理测试文件" - rm -f test.texinfo output.pdf test.aux test.cp test.cps test.fn test.fns test.ky test.log test.op test.pg test.toc test.tp test.vr test.vrs - - # 如果测试前未安装,则卸载软件包 - if [ "$INSTALLED" = false ]; then - LOG_INFO "卸载texinfo-tex软件包" - dnf remove -y texinfo-tex - CHECK_RESULT $? 0 0 "卸载texinfo-tex软件包失败" - fi - - LOG_INFO "测试完成" -} - -main "$@" \ No newline at end of file diff --git a/testcases/function_test/pkg_test/texinfo/texinfo-tex/test_texinfo-tex_texi2pdf_p.sh b/testcases/function_test/pkg_test/texinfo/texinfo-tex/test_texinfo-tex_texi2pdf_p.sh deleted file mode 100644 index 8f11bafef59..00000000000 --- a/testcases/function_test/pkg_test/texinfo/texinfo-tex/test_texinfo-tex_texi2pdf_p.sh +++ /dev/null @@ -1,101 +0,0 @@ -#!/usr/bin/bash - -# Copyright (c) 2024 ISCAS .ALL rights reserved. -# This program is licensed under Mulan PSL v2. -# You can use it according to the terms and conditions of the Mulan PSL v2. -# http://license.coscl.org.cn/MulanPSL2 -# THIS PROGRAM IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, -# EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, -# MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. -# See the Mulan PSL v2 for more details. - -# ############################################# -# @Author : honghua -# @Contact : honghua@iscas.ac.cn -# @Date : 2026-01-28 -# @License : Mulan PSL v2 -# @Desc : 测试使用--pdf选项生成PDF输出 -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - # 判断是否已安装texinfo-tex软件包 - LOG_INFO "检查texinfo-tex软件包是否已安装" - rpm -q texinfo-tex > /dev/null 2>&1 - if [ $? -eq 0 ]; then - LOG_INFO "texinfo-tex软件包已安装,测试结束后保持安装状态" - INSTALLED="true" - else - LOG_INFO "texinfo-tex软件包未安装,将在测试过程中安装" - INSTALLED="false" - fi - - # 检查yum源中是否有texinfo-tex软件包 - LOG_INFO "检查yum源中是否存在texinfo-tex软件包" - dnf list available texinfo-tex > /dev/null 2>&1 - if [ $? -ne 0 ]; then - LOG_ERROR "yum源中不存在texinfo-tex软件包" - exit 255 - fi - - # 如果未安装,则安装软件包 - if [ "$INSTALLED" = "false" ]; then - LOG_INFO "安装texinfo-tex软件包" - dnf install -y texinfo-tex - CHECK_RESULT $? 0 0 "安装texinfo-tex软件包失败" - fi - - # 检查texi2pdf命令是否支持--pdf选项 - LOG_INFO "检查texi2pdf命令是否支持--pdf选项" - texi2pdf --help 2>&1 | grep -q "\-\-pdf" - if [ $? -ne 0 ]; then - LOG_ERROR "texi2pdf命令不支持--pdf选项" - exit 255 - fi - - # 创建测试用的texinfo文件 - LOG_INFO "创建测试用的texinfo文件" - cat > test.texinfo << EOF - \input texinfo - @setfilename test - @settitle Test Document - @titlepage - @title Test Document - @end titlepage - @contents - @node Top - @top Test Document - This is a test document. - @bye - EOF - CHECK_RESULT $? 0 0 "创建texinfo文件失败" - - # 使用--pdf选项生成PDF输出 - LOG_INFO "使用--pdf选项生成PDF输出" - texi2pdf --pdf test.texinfo > /dev/null 2>&1 - CHECK_RESULT $? 0 0 "使用--pdf选项生成PDF输出失败" - - # 检查生成的PDF文件是否存在 - LOG_INFO "检查生成的PDF文件是否存在" - if [ -f test.pdf ]; then - LOG_INFO "PDF文件生成成功" - else - LOG_ERROR "PDF文件生成失败" - exit 1 - fi - - # 清理测试文件 - LOG_INFO "清理测试文件" - rm -f test.texinfo test.pdf test.aux test.cp test.fn test.ky test.log test.pg test.toc test.tp test.vr test.vrs - CHECK_RESULT $? 0 0 "清理测试文件失败" - - # 如果测试前未安装,则卸载软件包 - if [ "$INSTALLED" = "false" ]; then - LOG_INFO "卸载texinfo-tex软件包" - dnf remove -y texinfo-tex - CHECK_RESULT $? 0 0 "卸载texinfo-tex软件包失败" - fi -} - -main "$@" \ No newline at end of file diff --git a/testcases/function_test/pkg_test/texinfo/texinfo-tex/test_texinfo-tex_texi2pdf_pdf.sh b/testcases/function_test/pkg_test/texinfo/texinfo-tex/test_texinfo-tex_texi2pdf_pdf.sh deleted file mode 100644 index 7fab04138b5..00000000000 --- a/testcases/function_test/pkg_test/texinfo/texinfo-tex/test_texinfo-tex_texi2pdf_pdf.sh +++ /dev/null @@ -1,99 +0,0 @@ -#!/usr/bin/bash - -# Copyright (c) 2024 ISCAS .ALL rights reserved. -# This program is licensed under Mulan PSL v2. -# You can use it according to the terms and conditions of the Mulan PSL v2. -# http://license.coscl.org.cn/MulanPSL2 -# THIS PROGRAM IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, -# EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, -# MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. -# See the Mulan PSL v2 for more details. - -# ############################################# -# @Author : honghua -# @Contact : honghua@iscas.ac.cn -# @Date : 2026-03-12 -# @License : Mulan PSL v2 -# @Desc : 测试texi2pdf命令的--pdf选项,生成PDF输出 -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - LOG_INFO "开始测试texi2pdf命令的--pdf选项,生成PDF输出" - - # 检查软件包是否已安装 - LOG_INFO "检查texinfo-tex软件包是否已安装" - rpm -q texinfo-tex > /dev/null 2>&1 - if [ $? -eq 0 ]; then - LOG_INFO "texinfo-tex软件包已安装,脚本结束后将保持安装状态" - already_installed=1 - else - LOG_INFO "texinfo-tex软件包未安装,将在测试步骤中安装" - already_installed=0 - fi - - # 检查yum源中是否有texinfo-tex软件包 - LOG_INFO "检查yum源中是否有texinfo-tex软件包" - dnf list available texinfo-tex > /dev/null 2>&1 - CHECK_RESULT $? 0 0 "yum源中没有texinfo-tex软件包" - if [ $? -ne 0 ]; then - LOG_ERROR "yum源中没有texinfo-tex软件包" - exit 255 - fi - - # 如果未安装,则安装软件包 - if [ $already_installed -eq 0 ]; then - LOG_INFO "安装texinfo-tex软件包" - dnf install -y texinfo-tex - CHECK_RESULT $? 0 0 "安装texinfo-tex软件包失败" - fi - - # 检查texi2pdf命令是否支持--pdf参数 - LOG_INFO "检查texi2pdf命令是否支持--pdf参数" - texi2pdf --help 2>&1 | grep -q "\-\-pdf" - CHECK_RESULT $? 0 0 "texi2pdf命令不支持--pdf参数" - if [ $? -ne 0 ]; then - LOG_ERROR "texi2pdf命令不支持--pdf参数" - # 如果之前未安装,则卸载软件包 - if [ $already_installed -eq 0 ]; then - dnf remove -y texinfo-tex - fi - exit 255 - fi - - # 创建测试用的texinfo文件 - LOG_INFO "创建测试用的texinfo文件" - cat > test.texinfo << EOF - \input texinfo - @setfilename test.info - @settitle Test Document - @bye - EOF - CHECK_RESULT $? 0 0 "创建texinfo文件失败" - - # 使用texi2pdf命令的--pdf选项生成PDF - LOG_INFO "使用texi2pdf命令的--pdf选项生成PDF" - texi2pdf --pdf test.texinfo - CHECK_RESULT $? 0 0 "texi2pdf命令执行失败" - - # 检查生成的PDF文件是否存在 - LOG_INFO "检查生成的PDF文件是否存在" - [ -f test.pdf ] - CHECK_RESULT $? 0 0 "未生成PDF文件" - - # 清理测试文件 - LOG_INFO "清理测试文件" - rm -f test.texinfo test.pdf test.aux test.cp test.cps test.fn test.ky test.log test.pg test.toc test.tp test.vr test.info - - # 如果之前未安装,则卸载软件包 - if [ $already_installed -eq 0 ]; then - LOG_INFO "卸载texinfo-tex软件包" - dnf remove -y texinfo-tex - CHECK_RESULT $? 0 0 "卸载texinfo-tex软件包失败" - fi - - LOG_INFO "测试完成" -} - -main "$@" \ No newline at end of file diff --git a/testcases/function_test/pkg_test/texinfo/texinfo-tex/test_texinfo-tex_texi2pdf_ps.sh b/testcases/function_test/pkg_test/texinfo/texinfo-tex/test_texinfo-tex_texi2pdf_ps.sh deleted file mode 100644 index d54c3109c53..00000000000 --- a/testcases/function_test/pkg_test/texinfo/texinfo-tex/test_texinfo-tex_texi2pdf_ps.sh +++ /dev/null @@ -1,115 +0,0 @@ -#!/usr/bin/bash - -# Copyright (c) 2024 ISCAS .ALL rights reserved. -# This program is licensed under Mulan PSL v2. -# You can use it according to the terms and conditions of the Mulan PSL v2. -# http://license.coscl.org.cn/MulanPSL2 -# THIS PROGRAM IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, -# EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, -# MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. -# See the Mulan PSL v2 for more details. - -# ############################################# -# @Author : honghua -# @Contact : honghua@iscas.ac.cn -# @Date : 2026-01-28 -# @License : Mulan PSL v2 -# @Desc : 测试使用--ps选项通过DVI生成PostScript -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - # 测试脚本:测试使用--ps选项通过DVI生成PostScript - LOG_INFO "开始测试:测试使用--ps选项通过DVI生成PostScript" - - # 定义软件包名称 - PACKAGE_NAME="texinfo-tex" - - # 检查软件包是否已在yum源中 - LOG_INFO "步骤1:检查软件包是否在yum源中" - dnf list available ${PACKAGE_NAME} > /dev/null 2>&1 - if [ $? -ne 0 ]; then - LOG_ERROR "软件包 ${PACKAGE_NAME} 不在yum源中" - exit 255 - fi - - # 检查软件包是否已安装 - LOG_INFO "步骤2:检查软件包是否已安装" - INSTALLED=false - if rpm -q ${PACKAGE_NAME} > /dev/null 2>&1; then - LOG_INFO "软件包 ${PACKAGE_NAME} 已安装" - INSTALLED=true - else - LOG_INFO "软件包 ${PACKAGE_NAME} 未安装" - fi - - # 如果未安装,则安装软件包 - if [ "$INSTALLED" = "false" ]; then - LOG_INFO "步骤3:安装软件包 ${PACKAGE_NAME}" - dnf install -y ${PACKAGE_NAME} > /dev/null 2>&1 - CHECK_RESULT $? 0 0 "安装软件包 ${PACKAGE_NAME} 失败" - LOG_INFO "软件包 ${PACKAGE_NAME} 安装成功" - fi - - # 检查texi2pdf命令是否存在 - LOG_INFO "步骤4:检查texi2pdf命令是否存在" - which texi2pdf > /dev/null 2>&1 - CHECK_RESULT $? 0 0 "texi2pdf命令不存在" - - # 检查texi2pdf是否支持--ps参数 - LOG_INFO "步骤5:检查texi2pdf是否支持--ps参数" - texi2pdf --help 2>&1 | grep -q "\-\-ps" - CHECK_RESULT $? 0 0 "texi2pdf命令不支持--ps参数" - - # 创建测试用的texinfo文件 - LOG_INFO "步骤6:创建测试用的texinfo文件" - cat > test.texinfo << "EOF" - \input texinfo - @setfilename test.info - @settitle Test Document - @title Test Document - @author Tester - @c 文档开始 - @node Top - @top Test Document - This is a test document. - @c 文档结束 - @bye - EOF - CHECK_RESULT $? 0 0 "创建测试文件失败" - - # 使用texi2pdf生成DVI并转换为PostScript - LOG_INFO "步骤7:使用texi2pdf生成DVI并转换为PostScript" - texi2pdf --ps test.texinfo > /dev/null 2>&1 - CHECK_RESULT $? 0 0 "使用--ps选项生成PostScript失败" - - # 检查是否生成了PostScript文件 - LOG_INFO "步骤8:检查是否生成了PostScript文件" - if [ -f test.ps ]; then - LOG_INFO "PostScript文件 test.ps 生成成功" - CHECK_RESULT 0 0 0 "PostScript文件生成检查" - else - LOG_ERROR "未生成PostScript文件 test.ps" - CHECK_RESULT 1 0 0 "PostScript文件生成检查" - fi - - # 清理测试文件 - LOG_INFO "步骤9:清理测试文件" - rm -f test.texinfo test.ps test.log test.aux test.cp test.fn test.ky test.pg test.tp test.vr test.dvi test.toc - CHECK_RESULT $? 0 0 "清理测试文件失败" - - # 如果脚本开始时未安装软件包,则在测试结束后卸载 - if [ "$INSTALLED" = "false" ]; then - LOG_INFO "步骤10:卸载软件包 ${PACKAGE_NAME}" - dnf remove -y ${PACKAGE_NAME} > /dev/null 2>&1 - CHECK_RESULT $? 0 0 "卸载软件包 ${PACKAGE_NAME} 失败" - LOG_INFO "软件包 ${PACKAGE_NAME} 卸载成功" - else - LOG_INFO "步骤10:保持软件包 ${PACKAGE_NAME} 的安装状态" - fi - - LOG_INFO "测试完成:测试使用--ps选项通过DVI生成PostScript" -} - -main "$@" \ No newline at end of file diff --git a/testcases/function_test/pkg_test/texinfo/texinfo-tex/test_texinfo-tex_texi2pdf_q.sh b/testcases/function_test/pkg_test/texinfo/texinfo-tex/test_texinfo-tex_texi2pdf_q.sh deleted file mode 100644 index 4acb636d6a8..00000000000 --- a/testcases/function_test/pkg_test/texinfo/texinfo-tex/test_texinfo-tex_texi2pdf_q.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-01-28 -# @License : Mulan PSL v2 -# @Desc : 测试使用--quiet选项在无错误时静默输出 -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - LOG_INFO "开始测试:测试使用--quiet选项在无错误时静默输出" - LOG_INFO "步骤1:检查是否已安装texinfo-tex软件包" - rpm -q texinfo-tex > /dev/null 2>&1 - if [ $? -eq 0 ]; then - LOG_INFO "texinfo-tex已安装,脚本结束时将保持安装状态" - INSTALLED=1 - else - LOG_INFO "texinfo-tex未安装,将在测试过程中安装并在结束时卸载" - INSTALLED=0 - fi - - LOG_INFO "步骤2:检查yum源中是否有texinfo-tex软件包" - dnf list available texinfo-tex > /dev/null 2>&1 - if [ $? -ne 0 ]; then - LOG_ERROR "yum源中未找到texinfo-tex软件包" - exit 255 - fi - - if [ $INSTALLED -eq 0 ]; then - LOG_INFO "步骤3:安装texinfo-tex软件包" - dnf install -y texinfo-tex - CHECK_RESULT $? 0 0 "安装texinfo-tex失败" - fi - - LOG_INFO "步骤4:检查texi2pdf命令是否支持--quiet选项" - texi2pdf --help 2>&1 | grep -q "\-\-quiet" - if [ $? -ne 0 ]; then - LOG_ERROR "texi2pdf命令不支持--quiet选项" - if [ $INSTALLED -eq 0 ]; then - dnf remove -y texinfo-tex - fi - exit 255 - fi - - LOG_INFO "步骤5:创建一个简单的texinfo源文件用于测试" - cat > test.texinfo << "EOF" - \input texinfo - @setfilename test.info - @settitle Test Document - @node Top - @top Test Document - This is a test document. - @bye - EOF - CHECK_RESULT $? 0 0 "创建texinfo源文件失败" - - LOG_INFO "步骤6:使用--quiet选项运行texi2pdf,期望静默输出(无错误时)" - texi2pdf --quiet test.texinfo > output.log 2>&1 - CHECK_RESULT $? 0 0 "texi2pdf执行失败" - if [ -s output.log ]; then - LOG_ERROR "使用了--quiet选项,但命令仍有输出" - cat output.log - CHECK_RESULT 1 0 0 "texi2pdf --quiet未静默输出" - else - LOG_INFO "texi2pdf --quiet静默输出符合预期" - fi - - LOG_INFO "步骤7:清理测试文件" - rm -f test.texinfo test.pdf output.log - CHECK_RESULT $? 0 0 "清理测试文件失败" - - if [ $INSTALLED -eq 0 ]; then - LOG_INFO "步骤8:卸载texinfo-tex软件包" - dnf remove -y texinfo-tex - CHECK_RESULT $? 0 0 "卸载texinfo-tex失败" - fi - - LOG_INFO "测试完成" -} - -main "$@" \ No newline at end of file diff --git a/testcases/function_test/pkg_test/texinfo/texinfo-tex/test_texinfo-tex_texi2pdf_quiet.sh b/testcases/function_test/pkg_test/texinfo/texinfo-tex/test_texinfo-tex_texi2pdf_quiet.sh deleted file mode 100644 index c0c1d476f02..00000000000 --- a/testcases/function_test/pkg_test/texinfo/texinfo-tex/test_texinfo-tex_texi2pdf_quiet.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 : 2026-03-12 -# @License : Mulan PSL v2 -# @Desc : 测试texi2pdf命令的--quiet选项,在无错误时抑制输出 -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - LOG_INFO "开始测试texi2pdf命令的--quiet选项,在无错误时抑制输出" - LOG_INFO "检查texinfo-tex软件包是否在yum源中" - dnf list available texinfo-tex > /dev/null 2>&1 - if [ $? -ne 0 ]; then - LOG_ERROR "texinfo-tex软件包在yum源中不存在" - exit 255 - fi - LOG_INFO "检查系统中是否已经安装了texinfo-tex" - rpm -q texinfo-tex > /dev/null 2>&1 - if [ $? -eq 0 ]; then - LOG_INFO "texinfo-tex已经安装,脚本结束时将保持安装状态" - INSTALLED=1 - else - LOG_INFO "texinfo-tex未安装,将进行安装" - INSTALLED=0 - LOG_INFO "安装texinfo-tex" - dnf install -y texinfo-tex - CHECK_RESULT $? 0 0 "安装texinfo-tex失败" - fi - LOG_INFO "检查texi2pdf命令是否支持--quiet参数" - texi2pdf --help 2>&1 | grep -q "\-\-quiet" - if [ $? -ne 0 ]; then - LOG_ERROR "texi2pdf命令不支持--quiet参数" - if [ $INSTALLED -eq 0 ]; then - LOG_INFO "卸载texinfo-tex" - dnf remove -y texinfo-tex - fi - exit 255 - fi - LOG_INFO "创建一个简单的texinfo测试文件" - cat > test.texinfo << "EOF" - \input texinfo - @setfilename test.info - @settitle Test Document - @node Top - @top Test Document - This is a test document. - @bye - EOF - CHECK_RESULT $? 0 0 "创建test.texinfo文件失败" - LOG_INFO "使用texi2pdf命令并带上--quiet选项,检查是否抑制输出" - OUTPUT=$(texi2pdf --quiet test.texinfo 2>&1) - if [ $? -eq 0 ]; then - LOG_INFO "texi2pdf命令执行成功" - if [ -z "$OUTPUT" ]; then - LOG_INFO "--quiet选项生效,输出被抑制" - else - LOG_ERROR "--quiet选项未生效,仍有输出:$OUTPUT" - exit 1 - fi - else - LOG_ERROR "texi2pdf命令执行失败" - exit 1 - fi - LOG_INFO "清理测试文件" - rm -f test.texinfo test.pdf test.log test.aux test.cp test.cps test.fn test.ky test.pg test.tp test.vr test.toc - CHECK_RESULT $? 0 0 "删除测试文件失败" - if [ $INSTALLED -eq 0 ]; then - LOG_INFO "卸载texinfo-tex" - dnf remove -y texinfo-tex - CHECK_RESULT $? 0 0 "卸载texinfo-tex失败" - fi - LOG_INFO "测试完成" -} - -main "$@" \ No newline at end of file diff --git a/testcases/function_test/pkg_test/texinfo/texinfo-tex/test_texinfo-tex_texi2pdf_shell_escape.sh b/testcases/function_test/pkg_test/texinfo/texinfo-tex/test_texinfo-tex_texi2pdf_shell_escape.sh deleted file mode 100644 index 645d867e40a..00000000000 --- a/testcases/function_test/pkg_test/texinfo/texinfo-tex/test_texinfo-tex_texi2pdf_shell_escape.sh +++ /dev/null @@ -1,84 +0,0 @@ -#!/usr/bin/bash - -# Copyright (c) 2024 ISCAS .ALL rights reserved. -# This program is licensed under Mulan PSL v2. -# You can use it according to the terms and conditions of the Mulan PSL v2. -# http://license.coscl.org.cn/MulanPSL2 -# THIS PROGRAM IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, -# EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, -# MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. -# See the Mulan PSL v2 for more details. - -# ############################################# -# @Author : honghua -# @Contact : honghua@iscas.ac.cn -# @Date : 2026-01-28 -# @License : Mulan PSL v2 -# @Desc : 测试使用--shell-escape选项传递--shell-escape给TeX -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - LOG_INFO "开始测试:测试使用--shell-escape选项传递--shell-escape给TeX" - LOG_INFO "步骤1:检查texinfo-tex软件包是否在yum源中" - if ! dnf list available texinfo-tex 2>/dev/null | grep -q texinfo-tex; then - LOG_ERROR "yum源中未找到texinfo-tex软件包" - exit 255 - fi - - LOG_INFO "步骤2:检查texi2pdf命令是否支持--shell-escape参数" - if ! texi2pdf --help 2>&1 | grep -q -- "--shell-escape"; then - LOG_ERROR "texi2pdf命令不支持--shell-escape参数" - exit 255 - fi - - LOG_INFO "步骤3:检查系统是否已安装texinfo-tex" - if rpm -q texinfo-tex >/dev/null 2>&1; then - LOG_INFO "texinfo-tex已安装,测试后将保持安装状态" - INSTALLED=true - else - LOG_INFO "texinfo-tex未安装,将进行安装" - INSTALLED=false - fi - - if [ "$INSTALLED" = false ]; then - LOG_INFO "步骤4:安装texinfo-tex软件包" - dnf install -y texinfo-tex - CHECK_RESULT $? 0 0 "安装texinfo-tex失败" - fi - - LOG_INFO "步骤5:创建一个简单的.tex文件用于测试" - cat > test_shell_escape.tex << "EOF" - \documentclass{article} - \begin{document} - Test document for shell escape. - \end{document} - EOF - CHECK_RESULT $? 0 0 "创建.tex文件失败" - - LOG_INFO "步骤6:使用texi2pdf命令并传递--shell-escape参数" - texi2pdf --shell-escape test_shell_escape.tex - CHECK_RESULT $? 0 0 "texi2pdf --shell-escape执行失败" - - LOG_INFO "步骤7:检查是否生成了PDF文件" - if [ -f test_shell_escape.pdf ]; then - LOG_INFO "成功生成PDF文件:test_shell_escape.pdf" - else - LOG_ERROR "未生成PDF文件" - exit 1 - fi - - LOG_INFO "步骤8:清理测试文件" - rm -f test_shell_escape.tex test_shell_escape.pdf test_shell_escape.log test_shell_escape.aux - - if [ "$INSTALLED" = false ]; then - LOG_INFO "步骤9:卸载texinfo-tex软件包" - dnf remove -y texinfo-tex - CHECK_RESULT $? 0 0 "卸载texinfo-tex失败" - fi - - LOG_INFO "测试完成" -} - -main "$@" \ No newline at end of file diff --git a/testcases/function_test/pkg_test/texinfo/texinfo-tex/test_texinfo-tex_texi2pdf_src_specials.sh b/testcases/function_test/pkg_test/texinfo/texinfo-tex/test_texinfo-tex_texi2pdf_src_specials.sh deleted file mode 100644 index f85288a36e2..00000000000 --- a/testcases/function_test/pkg_test/texinfo/texinfo-tex/test_texinfo-tex_texi2pdf_src_specials.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-01-28 -# @License : Mulan PSL v2 -# @Desc : 测试使用--src-specials选项传递--src-specials给TeX -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - # 环境初始化检查 - LOG_INFO "检查是否已安装texinfo-tex软件包" - rpm -q texinfo-tex > /dev/null 2>&1 - if [ $? -eq 0 ]; then - LOG_INFO "texinfo-tex已安装,标记为已存在安装" - INSTALLED_BEFORE=1 - else - LOG_INFO "texinfo-tex未安装,标记为未安装" - INSTALLED_BEFORE=0 - fi - - # 检查yum源中是否存在texinfo-tex软件包 - LOG_INFO "检查yum源中是否存在texinfo-tex软件包" - dnf list available texinfo-tex > /dev/null 2>&1 - if [ $? -ne 0 ]; then - LOG_ERROR "yum源中未找到texinfo-tex软件包" - exit 255 - fi - - # 如果未安装,则安装软件包 - if [ ${INSTALLED_BEFORE} -eq 0 ]; then - LOG_INFO "开始安装texinfo-tex软件包" - dnf install -y texinfo-tex - CHECK_RESULT $? 0 0 "安装texinfo-tex软件包失败" - fi - - # 创建测试用的简单texinfo源文件 - LOG_INFO "创建测试用的texinfo源文件" - cat > test_src_specials.texi << "EOF" - \input texinfo - @setfilename test_src_specials.info - @settitle Test --src-specials Option - @bye - EOF - CHECK_RESULT $? 0 0 "创建texinfo源文件失败" - - # 测试texi2pdf命令是否支持--src-specials选项 - LOG_INFO "检查texi2pdf命令是否支持--src-specials选项" - texi2pdf --help 2>&1 | grep -q "\-\-src\-specials" - if [ $? -ne 0 ]; then - LOG_ERROR "texi2pdf命令不支持--src-specials选项" - # 清理临时文件 - rm -f test_src_specials.texi test_src_specials.pdf test_src_specials.aux test_src_specials.log test_src_specials.toc - # 如果之前未安装,则卸载软件包 - if [ ${INSTALLED_BEFORE} -eq 0 ]; then - LOG_INFO "卸载texinfo-tex软件包" - dnf remove -y texinfo-tex - fi - exit 255 - fi - - # 使用--src-specials选项执行texi2pdf命令 - LOG_INFO "使用--src-specials选项执行texi2pdf命令" - texi2pdf --src-specials test_src_specials.texi > texi2pdf_output.log 2>&1 - CHECK_RESULT $? 0 0 "texi2pdf命令执行失败" - - # 检查是否生成了PDF文件 - LOG_INFO "检查是否生成了PDF文件" - if [ -f test_src_specials.pdf ]; then - LOG_INFO "成功生成PDF文件" - else - LOG_ERROR "未生成PDF文件" - # 清理临时文件 - rm -f test_src_specials.texi texi2pdf_output.log test_src_specials.aux test_src_specials.log test_src_specials.toc - # 如果之前未安装,则卸载软件包 - if [ ${INSTALLED_BEFORE} -eq 0 ]; then - LOG_INFO "卸载texinfo-tex软件包" - dnf remove -y texinfo-tex - fi - exit 1 - fi - - # 清理临时文件 - LOG_INFO "清理临时文件" - rm -f test_src_specials.texi test_src_specials.pdf texi2pdf_output.log test_src_specials.aux test_src_specials.log test_src_specials.toc - - # 如果测试开始时未安装软件包,则在测试结束后卸载 - if [ ${INSTALLED_BEFORE} -eq 0 ]; then - LOG_INFO "卸载texinfo-tex软件包" - dnf remove -y texinfo-tex - CHECK_RESULT $? 0 0 "卸载texinfo-tex软件包失败" - fi - - LOG_INFO "测试完成,环境已恢复" -} - -main "$@" \ No newline at end of file diff --git a/testcases/function_test/pkg_test/texinfo/texinfo-tex/test_texinfo-tex_texi2pdf_t.sh b/testcases/function_test/pkg_test/texinfo/texinfo-tex/test_texinfo-tex_texi2pdf_t.sh deleted file mode 100644 index 4545d27a804..00000000000 --- a/testcases/function_test/pkg_test/texinfo/texinfo-tex/test_texinfo-tex_texi2pdf_t.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-01-28 -# @License : Mulan PSL v2 -# @Desc : 测试使用--command选项在输入文件副本中插入命令 -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - LOG_INFO "开始测试texinfo-tex的texi2pdf命令--command选项功能" - - # 检查软件包是否可用 - LOG_INFO "检查yum源中是否存在texinfo-tex软件包" - dnf list available texinfo-tex 2>/dev/null | grep -q texinfo-tex - CHECK_RESULT $? 0 0 "yum源中未找到texinfo-tex软件包,退出测试" - - # 检查是否已安装 - LOG_INFO "检查texinfo-tex是否已安装" - rpm -q texinfo-tex >/dev/null 2>&1 - installed=$? - - if [ $installed -eq 0 ]; then - LOG_INFO "texinfo-tex已安装,测试后将保持安装状态" - need_uninstall=0 - else - LOG_INFO "texinfo-tex未安装,将进行安装" - LOG_INFO "安装texinfo-tex软件包" - dnf install -y texinfo-tex - CHECK_RESULT $? 0 0 "安装texinfo-tex失败" - need_uninstall=1 - fi - - # 验证texi2pdf命令是否支持--command参数 - LOG_INFO "验证texi2pdf命令是否支持--command参数" - texi2pdf --help 2>&1 | grep -q -- "--command" - CHECK_RESULT $? 0 0 "texi2pdf命令不支持--command参数" - - # 创建测试用的texinfo文件 - LOG_INFO "创建测试用的texinfo文件" - cat > test.texinfo << "EOF" - \input texinfo - @setfilename test.info - @settitle Test Document - - @node Top - @top Test Document - - This is a test document. - @end texinfo - EOF - - CHECK_RESULT $? 0 0 "创建texinfo文件失败" - - # 测试--command选项功能 - LOG_INFO "测试使用--command选项在输入文件副本中插入命令" - texi2pdf --command="\pdfinfo{/Title (Test Document)}" test.texinfo - CHECK_RESULT $? 0 0 "texi2pdf --command执行失败" - - # 验证生成的PDF文件 - LOG_INFO "验证生成的PDF文件" - if [ -f test.pdf ]; then - LOG_INFO "PDF文件生成成功" - # 清理生成的测试文件 - rm -f test.texinfo test.pdf test.aux test.cp test.cps test.fn test.ky test.log test.pg test.toc test.tp test.vr - else - LOG_ERROR "PDF文件未生成" - exit 1 - fi - - # 环境清理 - LOG_INFO "开始清理测试环境" - - if [ $need_uninstall -eq 1 ]; then - LOG_INFO "卸载texinfo-tex软件包" - dnf remove -y texinfo-tex - CHECK_RESULT $? 0 0 "卸载texinfo-tex失败" - else - LOG_INFO "保持texinfo-tex安装状态" - fi - - LOG_INFO "测试完成" -} - -main "$@" \ No newline at end of file diff --git a/testcases/function_test/pkg_test/texinfo/texinfo-tex/test_texinfo-tex_texi2pdf_text.sh b/testcases/function_test/pkg_test/texinfo/texinfo-tex/test_texinfo-tex_texi2pdf_text.sh deleted file mode 100644 index 71b2eaa9196..00000000000 --- a/testcases/function_test/pkg_test/texinfo/texinfo-tex/test_texinfo-tex_texi2pdf_text.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-01-28 -# @License : Mulan PSL v2 -# @Desc : 测试使用--text选项通过HeVeA生成纯文本 -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - LOG_INFO "开始测试:测试使用--text选项通过HeVeA生成纯文本" - LOG_INFO "步骤1:检查yum源中是否存在texinfo-tex软件包" - dnf list available texinfo-tex > /dev/null 2>&1 - if [ $? -ne 0 ]; then - LOG_ERROR "yum源中不存在texinfo-tex软件包" - exit 255 - fi - LOG_INFO "步骤2:检查系统是否已经安装了texinfo-tex" - rpm -q texinfo-tex > /dev/null 2>&1 - if [ $? -eq 0 ]; then - LOG_INFO "系统已安装texinfo-tex,标记为已安装状态" - ALREADY_INSTALLED=1 - else - LOG_INFO "系统未安装texinfo-tex,标记为未安装状态" - ALREADY_INSTALLED=0 - fi - LOG_INFO "步骤3:如果未安装,则安装texinfo-tex" - if [ $ALREADY_INSTALLED -eq 0 ]; then - dnf install -y texinfo-tex - CHECK_RESULT $? 0 0 "安装texinfo-tex失败" - LOG_INFO "安装texinfo-tex成功" - fi - LOG_INFO "步骤4:检查texi2pdf命令是否支持--text参数" - texi2pdf --help 2>&1 | grep -q "\-\-text" - if [ $? -ne 0 ]; then - LOG_ERROR "texi2pdf命令不支持--text参数" - if [ $ALREADY_INSTALLED -eq 0 ]; then - LOG_INFO "清理环境:卸载texinfo-tex" - dnf remove -y texinfo-tex - CHECK_RESULT $? 0 0 "卸载texinfo-tex失败" - fi - exit 255 - fi - LOG_INFO "步骤5:创建一个简单的测试texinfo文件" - cat > test.texinfo << "EOF" - \input texinfo - @setfilename test.info - @settitle Test Document - @node Top - @top Test Document - This is a test document. - @bye - EOF - CHECK_RESULT $? 0 0 "创建测试texinfo文件失败" - LOG_INFO "步骤6:使用texi2pdf --text选项生成纯文本" - texi2pdf --text test.texinfo > output.txt 2>&1 - CHECK_RESULT $? 0 0 "texi2pdf --text执行失败" - LOG_INFO "步骤7:检查生成的纯文本文件" - if [ -f "test.txt" ]; then - LOG_INFO "成功生成纯文本文件test.txt" - else - LOG_ERROR "未生成纯文本文件test.txt" - if [ $ALREADY_INSTALLED -eq 0 ]; then - LOG_INFO "清理环境:卸载texinfo-tex" - dnf remove -y texinfo-tex - CHECK_RESULT $? 0 0 "卸载texinfo-tex失败" - fi - exit 1 - fi - LOG_INFO "步骤8:清理测试文件" - rm -f test.texinfo test.txt output.txt - CHECK_RESULT $? 0 0 "清理测试文件失败" - if [ $ALREADY_INSTALLED -eq 0 ]; then - LOG_INFO "步骤9:清理环境:卸载texinfo-tex" - dnf remove -y texinfo-tex - CHECK_RESULT $? 0 0 "卸载texinfo-tex失败" - fi - LOG_INFO "测试完成" -} - -main "$@" \ No newline at end of file diff --git a/testcases/function_test/pkg_test/texinfo/texinfo-tex/test_texinfo-tex_texi2pdf_tidy.sh b/testcases/function_test/pkg_test/texinfo/texinfo-tex/test_texinfo-tex_texi2pdf_tidy.sh deleted file mode 100644 index 8f160b6a865..00000000000 --- a/testcases/function_test/pkg_test/texinfo/texinfo-tex/test_texinfo-tex_texi2pdf_tidy.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-01-28 -# @License : Mulan PSL v2 -# @Desc : 测试使用--tidy选项以整洁模式编译 -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - LOG_INFO "测试开始:测试使用--tidy选项以整洁模式编译" - LOG_INFO "步骤1:检查环境是否已安装texinfo-tex软件包" - if dnf list installed texinfo-tex &> /dev/null; then - LOG_INFO "texinfo-tex已安装,脚本结束时将保持安装状态" - INSTALLED_BEFORE=1 - else - LOG_INFO "texinfo-tex未安装,将在测试过程中安装" - INSTALLED_BEFORE=0 - fi - - LOG_INFO "步骤2:检查yum源中是否存在texinfo-tex软件包" - if ! dnf list available texinfo-tex &> /dev/null; then - LOG_ERROR "yum源中未找到texinfo-tex软件包" - exit 255 - fi - - if [ $INSTALLED_BEFORE -eq 0 ]; then - LOG_INFO "步骤3:安装texinfo-tex软件包" - dnf install -y texinfo-tex - CHECK_RESULT $? 0 0 "安装texinfo-tex失败" - fi - - LOG_INFO "步骤4:检查texi2pdf命令是否支持--tidy参数" - texi2pdf --help 2>&1 | grep -q -- "--tidy" - if [ $? -ne 0 ]; then - LOG_ERROR "texi2pdf命令不支持--tidy参数" - if [ $INSTALLED_BEFORE -eq 0 ]; then - dnf remove -y texinfo-tex - CHECK_RESULT $? 0 0 "卸载texinfo-tex失败" - fi - exit 255 - fi - - LOG_INFO "步骤5:创建测试用的简单texinfo文件" - cat > test.texinfo << "EOF" - \input texinfo - @setfilename test - @settitle Test Document - @bye - EOF - CHECK_RESULT $? 0 0 "创建测试文件失败" - - LOG_INFO "步骤6:使用--tidy选项运行texi2pdf命令" - texi2pdf --tidy test.texinfo - CHECK_RESULT $? 0 0 "texi2pdf --tidy 执行失败" - - LOG_INFO "步骤7:检查生成的PDF文件" - if [ -f test.pdf ]; then - LOG_INFO "PDF文件生成成功" - else - LOG_ERROR "PDF文件未生成" - CHECK_RESULT 1 0 0 "PDF文件检查失败" - fi - - LOG_INFO "步骤8:清理测试文件" - rm -f test.texinfo test.pdf test.log test.toc test.aux - CHECK_RESULT $? 0 0 "清理测试文件失败" - - if [ $INSTALLED_BEFORE -eq 0 ]; then - LOG_INFO "步骤9:卸载texinfo-tex软件包" - dnf remove -y texinfo-tex - CHECK_RESULT $? 0 0 "卸载texinfo-tex失败" - LOG_INFO "环境已恢复到初始状态" - else - LOG_INFO "保持texinfo-tex软件包安装状态" - fi - - LOG_INFO "测试完成" -} - -main "$@" \ No newline at end of file diff --git a/testcases/function_test/pkg_test/texinfo/texinfo-tex/test_texinfo-tex_texi2pdf_translate_file.sh b/testcases/function_test/pkg_test/texinfo/texinfo-tex/test_texinfo-tex_texi2pdf_translate_file.sh deleted file mode 100644 index 251cde4b5bd..00000000000 --- a/testcases/function_test/pkg_test/texinfo/texinfo-tex/test_texinfo-tex_texi2pdf_translate_file.sh +++ /dev/null @@ -1,121 +0,0 @@ -#!/usr/bin/bash - -# Copyright (c) 2024 ISCAS .ALL rights reserved. -# This program is licensed under Mulan PSL v2. -# You can use it according to the terms and conditions of the Mulan PSL v2. -# http://license.coscl.org.cn/MulanPSL2 -# THIS PROGRAM IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, -# EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, -# MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. -# See the Mulan PSL v2 for more details. - -# ############################################# -# @Author : honghua -# @Contact : honghua@iscas.ac.cn -# @Date : 2026-01-28 -# @License : Mulan PSL v2 -# @Desc : 测试使用--translate-file选项指定字符集转换文件 -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - # 测试脚本:测试使用--translate-file选项指定字符集转换文件 - - LOG_INFO "开始测试texi2pdf的--translate-file选项" - - # 步骤1:检查环境中是否已安装texinfo-tex包 - LOG_INFO "步骤1:检查texinfo-tex包是否已安装" - if dnf list installed texinfo-tex &>/dev/null; then - LOG_INFO "texinfo-tex包已安装,测试结束后将保持安装状态" - INSTALLED=true - else - LOG_INFO "texinfo-tex包未安装,将在测试过程中安装" - INSTALLED=false - fi - - # 步骤2:检查yum源中是否存在texinfo-tex包 - LOG_INFO "步骤2:检查yum源中是否存在texinfo-tex包" - if ! dnf list available texinfo-tex &>/dev/null; then - LOG_ERROR "yum源中不存在texinfo-tex包,无法进行测试" - exit 255 - fi - - # 步骤3:如果未安装,则安装texinfo-tex包 - LOG_INFO "步骤3:安装texinfo-tex包" - if [ "$INSTALLED" = false ]; then - dnf install -y texinfo-tex - CHECK_RESULT $? 0 0 "安装texinfo-tex包失败" - fi - - # 步骤4:创建一个简单的.texinfo测试文件 - LOG_INFO "步骤4:创建测试用的.texinfo文件" - cat > test_input.texinfo << "EOF" - \input texinfo - @setfilename test_output.info - @settitle Test Document - @bye - EOF - CHECK_RESULT $? 0 0 "创建测试输入文件失败" - - # 步骤5:创建一个字符集转换文件 - LOG_INFO "步骤5:创建字符集转换文件" - cat > test_charset.cnf << "EOF" - # 字符集转换示例文件 - UTF-8 ISO-8859-1 - EOF - CHECK_RESULT $? 0 0 "创建字符集转换文件失败" - - # 步骤6:测试texi2pdf命令是否支持--translate-file参数 - LOG_INFO "步骤6:检查texi2pdf命令是否支持--translate-file参数" - if ! texi2pdf --help | grep -q "\-\-translate-file"; then - LOG_ERROR "texi2pdf命令不支持--translate-file参数" - # 清理测试文件 - rm -f test_input.texinfo test_charset.cnf test_output.pdf 2>/dev/null - # 如果测试前未安装,则卸载包 - if [ "$INSTALLED" = false ]; then - LOG_INFO "清理环境:卸载texinfo-tex包" - dnf remove -y texinfo-tex - fi - exit 255 - fi - - # 步骤7:使用--translate-file选项执行texi2pdf命令 - LOG_INFO "步骤7:使用--translate-file选项执行texi2pdf命令" - texi2pdf --translate-file=test_charset.cnf test_input.texinfo -o test_output.pdf - CHECK_RESULT $? 0 0 "texi2pdf命令执行失败" - - # 步骤8:验证生成的PDF文件是否存在 - LOG_INFO "步骤8:验证生成的PDF文件是否存在" - if [ -f test_output.pdf ]; then - LOG_INFO "PDF文件生成成功" - else - LOG_ERROR "PDF文件生成失败" - # 清理测试文件 - rm -f test_input.texinfo test_charset.cnf 2>/dev/null - # 如果测试前未安装,则卸载包 - if [ "$INSTALLED" = false ]; then - LOG_INFO "清理环境:卸载texinfo-tex包" - dnf remove -y texinfo-tex - fi - exit 1 - fi - - # 步骤9:清理测试文件 - LOG_INFO "步骤9:清理测试过程中创建的文件" - rm -f test_input.texinfo test_charset.cnf test_output.pdf - CHECK_RESULT $? 0 0 "清理测试文件失败" - - # 步骤10:如果测试前未安装,则卸载texinfo-tex包 - if [ "$INSTALLED" = false ]; then - LOG_INFO "步骤10:清理环境,卸载texinfo-tex包" - dnf remove -y texinfo-tex - CHECK_RESULT $? 0 0 "卸载texinfo-tex包失败" - else - LOG_INFO "步骤10:保持texinfo-tex包的安装状态" - fi - - LOG_INFO "测试完成:texi2pdf的--translate-file选项测试通过" -} - -main "$@" \ No newline at end of file diff --git a/testcases/function_test/pkg_test/texinfo/texinfo-tex/test_texinfo-tex_texi2pdf_upper_e.sh b/testcases/function_test/pkg_test/texinfo/texinfo-tex/test_texinfo-tex_texi2pdf_upper_e.sh deleted file mode 100644 index a218be5da10..00000000000 --- a/testcases/function_test/pkg_test/texinfo/texinfo-tex/test_texinfo-tex_texi2pdf_upper_e.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-01-28 -# @License : Mulan PSL v2 -# @Desc : 测试使用--expand选项通过makeinfo进行宏扩展 -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - LOG_INFO "开始测试:测试使用--expand选项通过makeinfo进行宏扩展" - - # 初始化变量 - PACKAGE_NAME="texinfo-tex" - RPM_NAME="${PACKAGE_NAME}" - COMMAND_EXEC="makeinfo" - OPTION_EXPAND="--expand" - - # 步骤1: 检查yum源中是否有texinfo-tex软件包 - LOG_INFO "步骤1: 检查yum源中是否有texinfo-tex软件包" - dnf list available ${RPM_NAME} > /dev/null 2>&1 - CHECK_RESULT $? 0 14 "yum源中没有找到texinfo-tex软件包,退出测试" - - # 步骤2: 检查系统是否已安装texinfo-tex软件包 - LOG_INFO "步骤2: 检查系统是否已安装texinfo-tex软件包" - if rpm -q ${RPM_NAME} > /dev/null 2>&1; then - LOG_INFO "texinfo-tex软件包已安装,跳过安装步骤" - INSTALLED="true" - else - LOG_INFO "texinfo-tex软件包未安装,开始安装" - dnf install -y ${RPM_NAME} - CHECK_RESULT $? 0 1 "安装texinfo-tex软件包失败" - INSTALLED="false" - fi - - # 步骤3: 检查makeinfo命令是否存在以及是否支持--expand选项 - LOG_INFO "步骤3: 检查makeinfo命令是否存在以及是否支持--expand选项" - if ! command -v ${COMMAND_EXEC} &> /dev/null; then - LOG_ERROR "makeinfo命令不存在" - exit 255 - fi - - # 尝试使用--help选项查看是否有--expand选项 - ${COMMAND_EXEC} --help 2>&1 | grep -q "${OPTION_EXPAND}" - CHECK_RESULT $? 0 255 "makeinfo命令不支持--expand选项,退出测试" - - # 步骤4: 创建一个简单的.texinfo文件用于测试宏扩展 - LOG_INFO "步骤4: 创建一个简单的.texinfo文件用于测试宏扩展" - TEST_FILE="test_macro.texinfo" - cat > ${TEST_FILE} << "EOF" - @setfilename test_macro.info - @settitle Test Macro Expansion - - @node Top - @top Test - - This is a test file for macro expansion. - - @macro expandTest - This macro content should be expanded. - @end macro - - Here is the macro: @expandTest{}. - - @end titlepage - EOF - - # 步骤5: 使用--expand选项通过makeinfo进行宏扩展 - LOG_INFO "步骤5: 使用--expand选项通过makeinfo进行宏扩展" - ${COMMAND_EXEC} ${OPTION_EXPAND} ${TEST_FILE} -o test_macro_expanded.info - CHECK_RESULT $? 0 0 "使用--expand选项宏扩展失败" - - # 步骤6: 检查生成的info文件是否包含扩展后的内容 - LOG_INFO "步骤6: 检查生成的info文件是否包含扩展后的内容" - grep -q "This macro content should be expanded." test_macro_expanded.info - CHECK_RESULT $? 0 0 "生成的info文件中未找到扩展后的宏内容" - - # 步骤7: 清理测试文件 - LOG_INFO "步骤7: 清理测试文件" - rm -f ${TEST_FILE} test_macro_expanded.info - - # 步骤8: 如果开始之前未安装texinfo-tex,则卸载该软件包 - LOG_INFO "步骤8: 恢复环境" - if [ "${INSTALLED}" == "false" ]; then - LOG_INFO "卸载texinfo-tex软件包" - dnf remove -y ${RPM_NAME} - CHECK_RESULT $? 0 0 "卸载texinfo-tex软件包失败" - else - LOG_INFO "保持texinfo-tex软件包已安装状态" - fi - - LOG_INFO "测试完成:使用--expand选项通过makeinfo进行宏扩展测试成功" -} - -main "$@" \ No newline at end of file diff --git a/testcases/function_test/pkg_test/texinfo/texinfo-tex/test_texinfo-tex_texi2pdf_upper_i.sh b/testcases/function_test/pkg_test/texinfo/texinfo-tex/test_texinfo-tex_texi2pdf_upper_i.sh deleted file mode 100644 index d370dd01b78..00000000000 --- a/testcases/function_test/pkg_test/texinfo/texinfo-tex/test_texinfo-tex_texi2pdf_upper_i.sh +++ /dev/null @@ -1,81 +0,0 @@ -#!/usr/bin/bash - -# Copyright (c) 2024 ISCAS .ALL rights reserved. -# This program is licensed under Mulan PSL v2. -# You can use it according to the terms and conditions of the Mulan PSL v2. -# http://license.coscl.org.cn/MulanPSL2 -# THIS PROGRAM IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, -# EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, -# MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. -# See the Mulan PSL v2 for more details. - -# ############################################# -# @Author : honghua -# @Contact : honghua@iscas.ac.cn -# @Date : 2026-01-28 -# @License : Mulan PSL v2 -# @Desc : 测试使用-I选项指定Texinfo文件的搜索目录 -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - LOG_INFO "开始测试使用-I选项指定Texinfo文件的搜索目录" - LOG_INFO "步骤1:检查texinfo-tex软件包是否在yum源中" - dnf list available texinfo-tex > /dev/null 2>&1 - if [ $? -ne 0 ]; then - LOG_ERROR "yum源中未找到texinfo-tex软件包" - exit 255 - fi - LOG_INFO "步骤2:检查当前环境是否已安装texinfo-tex软件包" - rpm -q texinfo-tex > /dev/null 2>&1 - if [ $? -eq 0 ]; then - LOG_INFO "texinfo-tex软件包已安装,测试结束后将保持安装状态" - INSTALLED=1 - else - LOG_INFO "texinfo-tex软件包未安装,将在测试过程中安装" - INSTALLED=0 - fi - LOG_INFO "步骤3:若未安装,则安装texinfo-tex软件包" - if [ $INSTALLED -eq 0 ]; then - dnf install -y texinfo-tex > /dev/null 2>&1 - CHECK_RESULT $? 0 0 "安装texinfo-tex软件包失败" - LOG_INFO "texinfo-tex软件包安装成功" - fi - LOG_INFO "步骤4:检查texi2pdf命令是否支持-I选项" - texi2pdf --help 2>&1 | grep -q "\-I" - if [ $? -ne 0 ]; then - LOG_ERROR "texi2pdf命令不支持-I选项" - if [ $INSTALLED -eq 0 ]; then - dnf remove -y texinfo-tex > /dev/null 2>&1 - LOG_INFO "已卸载texinfo-tex软件包" - fi - exit 255 - fi - LOG_INFO "步骤5:创建测试目录和Texinfo文件" - TEST_DIR="/tmp/test_texinfo_dir" - mkdir -p $TEST_DIR - cat > $TEST_DIR/test.texinfo << "EOF" - \input texinfo - @setfilename test.info - @settitle Test Document - @bye - EOF - LOG_INFO "步骤6:使用-I选项指定搜索目录执行texi2pdf命令" - texi2pdf -I $TEST_DIR $TEST_DIR/test.texinfo -o $TEST_DIR/test.pdf > $TEST_DIR/texi2pdf.log 2>&1 - CHECK_RESULT $? 0 0 "texi2pdf命令执行失败" - LOG_INFO "步骤7:检查生成的PDF文件是否存在" - [ -f $TEST_DIR/test.pdf ] - CHECK_RESULT $? 0 0 "未生成PDF文件" - LOG_INFO "步骤8:清理测试目录" - rm -rf $TEST_DIR - LOG_INFO "步骤9:若测试前未安装texinfo-tex,则卸载软件包" - if [ $INSTALLED -eq 0 ]; then - dnf remove -y texinfo-tex > /dev/null 2>&1 - CHECK_RESULT $? 0 0 "卸载texinfo-tex软件包失败" - LOG_INFO "已卸载texinfo-tex软件包" - fi - LOG_INFO "测试使用-I选项指定Texinfo文件的搜索目录完成" -} - -main "$@" \ No newline at end of file diff --git a/testcases/function_test/pkg_test/texinfo/texinfo-tex/test_texinfo-tex_texi2pdf_upper_v.sh b/testcases/function_test/pkg_test/texinfo/texinfo-tex/test_texinfo-tex_texi2pdf_upper_v.sh deleted file mode 100644 index b90a2ce4aac..00000000000 --- a/testcases/function_test/pkg_test/texinfo/texinfo-tex/test_texinfo-tex_texi2pdf_upper_v.sh +++ /dev/null @@ -1,87 +0,0 @@ -#!/usr/bin/bash - -# Copyright (c) 2024 ISCAS .ALL rights reserved. -# This program is licensed under Mulan PSL v2. -# You can use it according to the terms and conditions of the Mulan PSL v2. -# http://license.coscl.org.cn/MulanPSL2 -# THIS PROGRAM IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, -# EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, -# MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. -# See the Mulan PSL v2 for more details. - -# ############################################# -# @Author : honghua -# @Contact : honghua@iscas.ac.cn -# @Date : 2026-01-28 -# @License : Mulan PSL v2 -# @Desc : 测试使用--verbose选项报告详细处理过程 -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - LOG_INFO "开始测试texi2pdf命令的--verbose选项" - LOG_INFO "步骤1:检查texi2pdf命令是否已安装" - if command -v texi2pdf > /dev/null 2>&1; then - LOG_INFO "texi2pdf命令已安装,跳过安装步骤" - INSTALLED="true" - else - LOG_INFO "texi2pdf命令未安装,开始检查软件包源" - dnf list available texinfo-tex > /dev/null 2>&1 - if [ $? -ne 0 ]; then - LOG_ERROR "软件包texinfo-tex在yum源中不存在" - exit 255 - fi - LOG_INFO "步骤2:安装texinfo-tex软件包" - dnf install -y texinfo-tex - CHECK_RESULT $? 0 0 "安装texinfo-tex软件包失败" - INSTALLED="false" - fi - - LOG_INFO "步骤3:创建一个简单的texinfo测试文件" - cat > test.texinfo << "EOF" - \input texinfo - @setfilename test.info - @settitle Test Document - @node Top - @top Test Document - This is a test document. - @bye - EOF - CHECK_RESULT $? 0 0 "创建测试文件失败" - - LOG_INFO "步骤4:测试texi2pdf命令是否支持--verbose参数" - texi2pdf --help 2>&1 | grep -q "\-\-verbose" - if [ $? -ne 0 ]; then - LOG_ERROR "texi2pdf命令不支持--verbose参数" - exit 255 - fi - - LOG_INFO "步骤5:使用--verbose选项运行texi2pdf命令" - texi2pdf --verbose test.texinfo > texi2pdf_verbose.log 2>&1 - CHECK_RESULT $? 0 0 "texi2pdf命令执行失败" - - LOG_INFO "步骤6:检查详细日志是否生成" - if [ -s texi2pdf_verbose.log ]; then - LOG_INFO "详细日志生成成功" - grep -q "verbose" texi2pdf_verbose.log - CHECK_RESULT $? 0 0 "日志中未找到verbose相关输出" - else - LOG_ERROR "详细日志文件为空或未生成" - exit 1 - fi - - LOG_INFO "步骤7:清理测试文件" - rm -f test.texinfo test.pdf texi2pdf_verbose.log - - LOG_INFO "步骤8:根据初始状态决定是否卸载软件包" - if [ "$INSTALLED" = "false" ]; then - LOG_INFO "卸载texinfo-tex软件包" - dnf remove -y texinfo-tex - CHECK_RESULT $? 0 0 "卸载texinfo-tex软件包失败" - fi - - LOG_INFO "测试完成" -} - -main "$@" \ No newline at end of file diff --git a/testcases/function_test/pkg_test/texinfo/texinfo-tex/test_texinfo-tex_texi2pdf_verbose.sh b/testcases/function_test/pkg_test/texinfo/texinfo-tex/test_texinfo-tex_texi2pdf_verbose.sh deleted file mode 100644 index c3f1e749002..00000000000 --- a/testcases/function_test/pkg_test/texinfo/texinfo-tex/test_texinfo-tex_texi2pdf_verbose.sh +++ /dev/null @@ -1,101 +0,0 @@ -#!/usr/bin/bash - -# Copyright (c) 2024 ISCAS .ALL rights reserved. -# This program is licensed under Mulan PSL v2. -# You can use it according to the terms and conditions of the Mulan PSL v2. -# http://license.coscl.org.cn/MulanPSL2 -# THIS PROGRAM IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, -# EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, -# MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. -# See the Mulan PSL v2 for more details. - -# ############################################# -# @Author : honghua -# @Contact : honghua@iscas.ac.cn -# @Date : 2026-03-12 -# @License : Mulan PSL v2 -# @Desc : 测试texi2pdf命令的--verbose选项,报告详细处理过程 -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - set -e - - # 步骤1:检查texi2pdf命令是否已安装 - LOG_INFO "步骤1:检查texi2pdf命令是否已安装" - if command -v texi2pdf &> /dev/null; then - LOG_INFO "texi2pdf命令已安装" - INSTALLED="true" - else - LOG_INFO "texi2pdf命令未安装" - INSTALLED="false" - fi - - # 步骤2:如果未安装,检查yum源中是否有texinfo-tex软件包 - if [ "$INSTALLED" = "false" ]; then - LOG_INFO "步骤2:检查yum源中是否有texinfo-tex软件包" - if ! dnf list available texinfo-tex &> /dev/null; then - LOG_ERROR "yum源中未找到texinfo-tex软件包" - exit 255 - fi - LOG_INFO "yum源中存在texinfo-tex软件包" - fi - - # 步骤3:如果未安装,安装texinfo-tex软件包 - if [ "$INSTALLED" = "false" ]; then - LOG_INFO "步骤3:安装texinfo-tex软件包" - dnf install -y texinfo-tex - CHECK_RESULT $? 0 0 "安装texinfo-tex软件包失败" - fi - - # 步骤4:检查texi2pdf命令是否支持--verbose参数 - LOG_INFO "步骤4:检查texi2pdf命令是否支持--verbose参数" - if ! texi2pdf --help 2>&1 | grep -q -- "--verbose"; then - LOG_ERROR "texi2pdf命令不支持--verbose参数" - exit 255 - fi - LOG_INFO "texi2pdf命令支持--verbose参数" - - # 步骤5:创建一个简单的texinfo文件用于测试 - LOG_INFO "步骤5:创建一个简单的texinfo文件用于测试" - cat > test.texinfo << "EOF" - \input texinfo - @setfilename test.info - @settitle Test Document - @node Top - @top Test Document - This is a test document. - @bye - EOF - CHECK_RESULT $? 0 0 "创建texinfo测试文件失败" - - # 步骤6:使用texi2pdf命令的--verbose选项生成PDF - LOG_INFO "步骤6:使用texi2pdf命令的--verbose选项生成PDF" - texi2pdf --verbose test.texinfo 2>&1 | tee verbose_output.log - CHECK_RESULT $? 0 0 "texi2pdf命令执行失败" - - # 步骤7:验证verbose输出是否包含详细处理信息 - LOG_INFO "步骤7:验证verbose输出是否包含详细处理信息" - if grep -q "详细处理过程\|详细输出\|verbose" verbose_output.log; then - LOG_INFO "texi2pdf --verbose选项报告了详细处理过程" - else - LOG_ERROR "texi2pdf --verbose选项未报告详细处理过程" - exit 1 - fi - - # 步骤8:清理测试文件 - LOG_INFO "步骤8:清理测试文件" - rm -f test.texinfo test.pdf test.log test.aux test.cp test.cps test.fn test.fns test.ky test.kys test.pg test.toc test.tp test.tps test.vr test.vrs verbose_output.log - - # 步骤9:如果测试前未安装,则卸载texinfo-tex软件包 - if [ "$INSTALLED" = "false" ]; then - LOG_INFO "步骤9:卸载texinfo-tex软件包" - dnf remove -y texinfo-tex - CHECK_RESULT $? 0 0 "卸载texinfo-tex软件包失败" - fi - - LOG_INFO "测试完成" -} - -main "$@" \ No newline at end of file diff --git a/testcases/function_test/pkg_test/texinfo/texinfo-tex/test_texinfo-tex_texi2pdf_version.sh b/testcases/function_test/pkg_test/texinfo/texinfo-tex/test_texinfo-tex_texi2pdf_version.sh deleted file mode 100644 index a4381dc7ec3..00000000000 --- a/testcases/function_test/pkg_test/texinfo/texinfo-tex/test_texinfo-tex_texi2pdf_version.sh +++ /dev/null @@ -1,72 +0,0 @@ -#!/usr/bin/bash - -# Copyright (c) 2024 ISCAS .ALL rights reserved. -# This program is licensed under Mulan PSL v2. -# You can use it according to the terms and conditions of the Mulan PSL v2. -# http://license.coscl.org.cn/MulanPSL2 -# THIS PROGRAM IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, -# EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, -# MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. -# See the Mulan PSL v2 for more details. - -# ############################################# -# @Author : honghua -# @Contact : honghua@iscas.ac.cn -# @Date : 2026-03-12 -# @License : Mulan PSL v2 -# @Desc : 测试texi2pdf命令的--version选项,查看版本信息 -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - LOG_INFO "开始测试texi2pdf命令的--version选项,查看版本信息" - LOG_INFO "步骤1:检查系统中是否已安装texinfo-tex软件包" - rpm -q texinfo-tex > /dev/null 2>&1 - if [ $? -eq 0 ]; then - LOG_INFO "texinfo-tex软件包已安装,脚本结束后将保持安装状态" - INSTALLED=1 - else - LOG_INFO "texinfo-tex软件包未安装,将在测试过程中安装" - INSTALLED=0 - fi - - LOG_INFO "步骤2:检查yum源中是否有texinfo-tex软件包" - dnf list available texinfo-tex > /dev/null 2>&1 - CHECK_RESULT $? 0 0 "yum源中未找到texinfo-tex软件包" - if [ $? -ne 0 ]; then - LOG_ERROR "yum源中未找到texinfo-tex软件包" - exit 255 - fi - - if [ $INSTALLED -eq 0 ]; then - LOG_INFO "步骤3:安装texinfo-tex软件包" - dnf install -y texinfo-tex - CHECK_RESULT $? 0 0 "安装texinfo-tex软件包失败" - fi - - LOG_INFO "步骤4:检查texi2pdf命令是否支持--version参数" - texi2pdf --help 2>&1 | grep -q "\-\-version" - CHECK_RESULT $? 0 0 "texi2pdf命令不支持--version参数" - if [ $? -ne 0 ]; then - LOG_ERROR "texi2pdf命令不支持--version参数" - if [ $INSTALLED -eq 0 ]; then - dnf remove -y texinfo-tex - fi - exit 255 - fi - - LOG_INFO "步骤5:执行texi2pdf --version命令查看版本信息" - texi2pdf --version - CHECK_RESULT $? 0 0 "执行texi2pdf --version命令失败" - - if [ $INSTALLED -eq 0 ]; then - LOG_INFO "步骤6:卸载texinfo-tex软件包" - dnf remove -y texinfo-tex - CHECK_RESULT $? 0 0 "卸载texinfo-tex软件包失败" - fi - - LOG_INFO "测试完成" -} - -main "$@" \ No newline at end of file diff --git a/testcases/function_test/pkg_test/texinfo/texinfo-tex/test_texinfo-tex_texindex_dash_dash.sh b/testcases/function_test/pkg_test/texinfo/texinfo-tex/test_texinfo-tex_texindex_dash_dash.sh deleted file mode 100644 index d5dd3bcb399..00000000000 --- a/testcases/function_test/pkg_test/texinfo/texinfo-tex/test_texinfo-tex_texindex_dash_dash.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-01-28 -# @License : Mulan PSL v2 -# @Desc : 测试使用--作为参数,表示选项解析结束 -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - LOG_INFO "开始测试 texinfo-tex 和 texindex 命令的 -- 参数功能" - - # 检查软件包是否已在系统中安装 - LOG_INFO "步骤1: 检查 texinfo-tex 软件包是否已安装" - rpm -q texinfo-tex > /dev/null 2>&1 - if [ $? -eq 0 ]; then - LOG_INFO "texinfo-tex 软件包已安装" - INSTALLED="yes" - else - LOG_INFO "texinfo-tex 软件包未安装" - INSTALLED="no" - fi - - # 检查软件包是否在yum源中 - LOG_INFO "步骤2: 检查 yum 源中是否存在 texinfo-tex 软件包" - dnf list available texinfo-tex > /dev/null 2>&1 - if [ $? -ne 0 ]; then - LOG_ERROR "yum 源中未找到 texinfo-tex 软件包" - exit 255 - fi - - # 如果未安装,则安装软件包 - if [ "$INSTALLED" = "no" ]; then - LOG_INFO "步骤3: 安装 texinfo-tex 软件包" - dnf install -y texinfo-tex - CHECK_RESULT $? 0 0 "安装 texinfo-tex 软件包失败" - fi - - # 查找 texindex 命令路径 - LOG_INFO "步骤4: 查找 texindex 命令路径" - TEXINDEX_CMD=$(which texindex) - if [ -z "$TEXINDEX_CMD" ]; then - LOG_ERROR "未找到 texindex 命令" - if [ "$INSTALLED" = "no" ]; then - dnf remove -y texinfo-tex - fi - exit 1 - fi - - # 测试 texindex -- 参数 - LOG_INFO "步骤5: 测试 texindex 命令的 -- 参数" - $TEXINDEX_CMD -- --help > /dev/null 2>&1 - CHECK_RESULT $? 0 0 "texindex 命令不支持 -- 参数" - - # 如果测试开始时未安装,则清理环境 - if [ "$INSTALLED" = "no" ]; then - LOG_INFO "步骤6: 清理测试环境,卸载 texinfo-tex 软件包" - dnf remove -y texinfo-tex - CHECK_RESULT $? 0 0 "卸载 texinfo-tex 软件包失败" - fi - - LOG_INFO "测试完成" -} - -main "$@" \ No newline at end of file diff --git a/testcases/function_test/pkg_test/texinfo/texinfo-tex/test_texinfo-tex_texindex_end_option.sh b/testcases/function_test/pkg_test/texinfo/texinfo-tex/test_texinfo-tex_texindex_end_option.sh deleted file mode 100644 index f7f2c5ab898..00000000000 --- a/testcases/function_test/pkg_test/texinfo/texinfo-tex/test_texinfo-tex_texindex_end_option.sh +++ /dev/null @@ -1,86 +0,0 @@ -#!/usr/bin/bash - -# Copyright (c) 2024 ISCAS .ALL rights reserved. -# This program is licensed under Mulan PSL v2. -# You can use it according to the terms and conditions of the Mulan PSL v2. -# http://license.coscl.org.cn/MulanPSL2 -# THIS PROGRAM IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, -# EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, -# MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. -# See the Mulan PSL v2 for more details. - -# ############################################# -# @Author : honghua -# @Contact : honghua@iscas.ac.cn -# @Date : 2026-03-12 -# @License : Mulan PSL v2 -# @Desc : 使用--参数结束选项处理 -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - # 判断是否已经安装软件包 - LOG_INFO "检查是否已安装 texinfo-tex 软件包" - rpm -q texinfo-tex > /dev/null 2>&1 - installed_status=$? - - # 记录初始安装状态 - if [ $installed_status -eq 0 ]; then - LOG_INFO "texinfo-tex 软件包已安装" - was_installed=true - else - LOG_INFO "texinfo-tex 软件包未安装" - was_installed=false - fi - - # 检查yum源中是否有该软件包 - LOG_INFO "检查yum源中是否有 texinfo-tex 软件包" - dnf list available texinfo-tex > /dev/null 2>&1 - CHECK_RESULT $? 0 0 "yum源中未找到 texinfo-tex 软件包" - - # 如果未安装,则安装软件包 - if [ "$was_installed" = false ]; then - LOG_INFO "安装 texinfo-tex 软件包" - dnf install -y texinfo-tex - CHECK_RESULT $? 0 0 "安装 texinfo-tex 软件包失败" - LOG_INFO "texinfo-tex 软件包安装成功" - fi - - # 测试 texindex 命令的 --help 选项 - LOG_INFO "测试 texindex 命令的 --help 选项" - texindex --help > /dev/null 2>&1 - CHECK_RESULT $? 0 0 "texindex 命令不支持 --help 选项" - - # 测试 texindex 命令的 --version 选项 - LOG_INFO "测试 texindex 命令的 --version 选项" - texindex --version > /dev/null 2>&1 - CHECK_RESULT $? 0 0 "texindex 命令不支持 --version 选项" - - # 测试 texindex 命令的无效参数 - LOG_INFO "测试 texindex 命令的无效参数 --invalid-option" - texindex --invalid-option 2>&1 | grep -q "unrecognized option" - CHECK_RESULT $? 0 0 "texindex 命令未正确处理无效参数" - - # 测试使用 -- 参数结束选项处理 - LOG_INFO "测试使用 -- 参数结束选项处理" - echo "test content" > test.aux - texindex -- test.aux - CHECK_RESULT $? 0 0 "使用 -- 参数结束选项处理失败" - - # 清理测试文件 - LOG_INFO "清理测试文件" - rm -f test.aux test.cp test.cps test.fn test.fns test.ky test.kys test.pg test.pgs test.tp test.tps test.vr test.vrs - - # 如果最初未安装,则在测试结束后卸载软件包 - if [ "$was_installed" = false ]; then - LOG_INFO "卸载 texinfo-tex 软件包" - dnf remove -y texinfo-tex - CHECK_RESULT $? 0 0 "卸载 texinfo-tex 软件包失败" - LOG_INFO "texinfo-tex 软件包卸载成功" - else - LOG_INFO "保持 texinfo-tex 软件包安装状态" - fi -} - -main "$@" \ No newline at end of file diff --git a/testcases/function_test/pkg_test/texinfo/texinfo-tex/test_texinfo-tex_texindex_h.sh b/testcases/function_test/pkg_test/texinfo/texinfo-tex/test_texinfo-tex_texindex_h.sh deleted file mode 100644 index e64a3319f9a..00000000000 --- a/testcases/function_test/pkg_test/texinfo/texinfo-tex/test_texinfo-tex_texindex_h.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-12 -# @License : Mulan PSL v2 -# @Desc : 使用-h参数显示帮助信息 -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - # 检查是否已安装texinfo-tex和texindex软件包 - LOG_INFO "检查是否已安装texinfo-tex和texindex软件包" - rpm -q texinfo-tex texindex > /dev/null 2>&1 - if [ $? -eq 0 ]; then - LOG_INFO "软件包已安装,标记为保持安装状态" - KEEP_INSTALLED=true - else - LOG_INFO "软件包未安装,标记为需要清理" - KEEP_INSTALLED=false - fi - - # 检查yum源中是否有texinfo-tex和texindex软件包 - LOG_INFO "检查yum源中是否有texinfo-tex和texindex软件包" - dnf list available texinfo-tex texindex > /dev/null 2>&1 - CHECK_RESULT $? 0 0 "yum源中缺少texinfo-tex或texindex软件包" - if [ $? -ne 0 ]; then - LOG_ERROR "yum源中缺少texinfo-tex或texindex软件包" - exit 255 - fi - - # 如果未安装,则安装软件包 - if [ "$KEEP_INSTALLED" = "false" ]; then - LOG_INFO "安装texinfo-tex和texindex软件包" - dnf install -y texinfo-tex texindex > /dev/null 2>&1 - CHECK_RESULT $? 0 0 "安装texinfo-tex和texindex软件包失败" - fi - - # 测试texindex命令的-h参数 - LOG_INFO "测试texindex命令的-h参数" - texindex -h > /dev/null 2>&1 - CHECK_RESULT $? 0 0 "texindex命令不支持-h参数或执行失败" - if [ $? -ne 0 ]; then - LOG_ERROR "texindex命令不支持-h参数或执行失败" - if [ "$KEEP_INSTALLED" = "false" ]; then - LOG_INFO "清理安装的软件包" - dnf remove -y texinfo-tex texindex > /dev/null 2>&1 - fi - exit 255 - fi - - # 清理环境:如果之前未安装,则卸载软件包 - if [ "$KEEP_INSTALLED" = "false" ]; then - LOG_INFO "清理安装的软件包" - dnf remove -y texinfo-tex texindex > /dev/null 2>&1 - CHECK_RESULT $? 0 0 "卸载texinfo-tex和texindex软件包失败" - fi - - LOG_INFO "测试完成" -} - -main "$@" \ No newline at end of file diff --git a/testcases/function_test/pkg_test/texinfo/texinfo-tex/test_texinfo-tex_texindex_help.sh b/testcases/function_test/pkg_test/texinfo/texinfo-tex/test_texinfo-tex_texindex_help.sh deleted file mode 100644 index 43231720ed3..00000000000 --- a/testcases/function_test/pkg_test/texinfo/texinfo-tex/test_texinfo-tex_texindex_help.sh +++ /dev/null @@ -1,84 +0,0 @@ -#!/usr/bin/bash - -# Copyright (c) 2024 ISCAS .ALL rights reserved. -# This program is licensed under Mulan PSL v2. -# You can use it according to the terms and conditions of the Mulan PSL v2. -# http://license.coscl.org.cn/MulanPSL2 -# THIS PROGRAM IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, -# EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, -# MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. -# See the Mulan PSL v2 for more details. - -# ############################################# -# @Author : honghua -# @Contact : honghua@iscas.ac.cn -# @Date : 2026-01-28 -# @License : Mulan PSL v2 -# @Desc : 测试使用--help参数显示帮助信息 -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - # 定义软件包名称和命令 - PACKAGE_NAME="texinfo-tex" - COMMAND="texindex" - HELP_PARAM="--help" - - # 步骤1: 检查软件包是否已在yum源中 - LOG_INFO "检查yum源中是否存在软件包: ${PACKAGE_NAME}" - dnf list available "${PACKAGE_NAME}" > /dev/null 2>&1 - if [ $? -ne 0 ]; then - LOG_ERROR "软件包 ${PACKAGE_NAME} 在yum源中不存在" - exit 255 - fi - - # 步骤2: 检查当前环境中是否已安装软件包 - LOG_INFO "检查当前环境中是否已安装软件包: ${PACKAGE_NAME}" - rpm -q "${PACKAGE_NAME}" > /dev/null 2>&1 - if [ $? -eq 0 ]; then - LOG_INFO "软件包 ${PACKAGE_NAME} 已安装,标记为已安装状态" - INSTALLED="true" - else - LOG_INFO "软件包 ${PACKAGE_NAME} 未安装,标记为未安装状态" - INSTALLED="false" - fi - - # 步骤3: 如果未安装,则安装软件包 - if [ "${INSTALLED}" = "false" ]; then - LOG_INFO "安装软件包: ${PACKAGE_NAME}" - dnf install -y "${PACKAGE_NAME}" > /dev/null 2>&1 - CHECK_RESULT $? 0 0 "安装软件包失败" - fi - - # 步骤4: 检查命令是否存在 - LOG_INFO "检查命令 ${COMMAND} 是否存在" - which "${COMMAND}" > /dev/null 2>&1 - CHECK_RESULT $? 0 0 "命令 ${COMMAND} 不存在" - - # 步骤5: 检查--help参数是否支持 - LOG_INFO "检查命令 ${COMMAND} 是否支持参数: ${HELP_PARAM}" - "${COMMAND}" "${HELP_PARAM}" > /dev/null 2>&1 - if [ $? -eq 255 ]; then - LOG_ERROR "命令 ${COMMAND} 不支持参数: ${HELP_PARAM}" - exit 255 - fi - - # 步骤6: 执行命令并显示帮助信息 - LOG_INFO "执行命令: ${COMMAND} ${HELP_PARAM}" - "${COMMAND}" "${HELP_PARAM}" > /dev/null 2>&1 - CHECK_RESULT $? 0 0 "执行命令 ${COMMAND} ${HELP_PARAM} 失败" - - # 步骤7: 环境恢复 - if [ "${INSTALLED}" = "false" ]; then - LOG_INFO "卸载软件包: ${PACKAGE_NAME}" - dnf remove -y "${PACKAGE_NAME}" > /dev/null 2>&1 - CHECK_RESULT $? 0 0 "卸载软件包失败" - else - LOG_INFO "软件包 ${PACKAGE_NAME} 在测试前已安装,保持安装状态" - fi - - LOG_INFO "测试完成" -} - -main "$@" \ No newline at end of file diff --git a/testcases/function_test/pkg_test/texinfo/texinfo-tex/test_texinfo-tex_texindex_no_arg.sh b/testcases/function_test/pkg_test/texinfo/texinfo-tex/test_texinfo-tex_texindex_no_arg.sh deleted file mode 100644 index 560f0239ce0..00000000000 --- a/testcases/function_test/pkg_test/texinfo/texinfo-tex/test_texinfo-tex_texindex_no_arg.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 : 2026-01-28 -# @License : Mulan PSL v2 -# @Desc : 测试不带任何参数直接调用texindex命令 -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - LOG_INFO "开始测试不带任何参数直接调用texindex命令" - LOG_INFO "检查texinfo-tex软件包是否已安装" - rpm -q texinfo-tex > /dev/null 2>&1 - if [ $? -eq 0 ]; then - LOG_INFO "texinfo-tex软件包已安装,测试结束后将保持安装状态" - INSTALLED=1 - else - LOG_INFO "texinfo-tex软件包未安装,将在测试前安装并在测试后卸载" - INSTALLED=0 - fi - LOG_INFO "检查yum源中是否有texinfo-tex软件包" - dnf list available texinfo-tex > /dev/null 2>&1 - if [ $? -ne 0 ]; then - LOG_ERROR "yum源中没有texinfo-tex软件包" - exit 255 - fi - if [ $INSTALLED -eq 0 ]; then - LOG_INFO "安装texinfo-tex软件包" - dnf install -y texinfo-tex - CHECK_RESULT $? 0 0 "安装texinfo-tex软件包失败" - fi - LOG_INFO "执行不带任何参数的texindex命令" - texindex - CHECK_RESULT $? 0 0 "不带参数执行texindex命令失败" - LOG_INFO "清理测试环境" - if [ $INSTALLED -eq 0 ]; then - LOG_INFO "卸载texinfo-tex软件包" - dnf remove -y texinfo-tex - CHECK_RESULT $? 0 0 "卸载texinfo-tex软件包失败" - else - LOG_INFO "测试前texinfo-tex已安装,测试后保持安装状态" - fi - LOG_INFO "测试完成" -} - -main "$@" \ No newline at end of file diff --git a/testcases/function_test/pkg_test/texinfo/texinfo-tex/test_texinfo-tex_texindex_no_option.sh b/testcases/function_test/pkg_test/texinfo/texinfo-tex/test_texinfo-tex_texindex_no_option.sh deleted file mode 100644 index b789678bbc6..00000000000 --- a/testcases/function_test/pkg_test/texinfo/texinfo-tex/test_texinfo-tex_texindex_no_option.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-12 -# @License : Mulan PSL v2 -# @Desc : 不带任何选项处理一个文件 -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - LOG_INFO "开始测试不带任何选项处理一个文件" - LOG_INFO "步骤1: 检查texinfo-tex和texindex软件包是否已在yum源中" - dnf list available texinfo-tex texindex > /dev/null 2>&1 - CHECK_RESULT $? 0 255 "yum源中缺少texinfo-tex或texindex软件包" - - LOG_INFO "步骤2: 检查texinfo-tex和texindex是否已安装" - if rpm -q texinfo-tex texindex > /dev/null 2>&1; then - LOG_INFO "软件包已安装,测试结束后将保持安装状态" - INSTALLED=1 - else - LOG_INFO "软件包未安装,将安装软件包作为测试步骤" - INSTALLED=0 - fi - - if [ $INSTALLED -eq 0 ]; then - LOG_INFO "步骤3: 安装texinfo-tex和texindex软件包" - dnf install -y texinfo-tex texindex > /dev/null 2>&1 - CHECK_RESULT $? 0 1 "安装texinfo-tex和texindex软件包失败" - fi - - LOG_INFO "步骤4: 创建一个测试用的tex文件" - cat > test.tex << "EOF" - \documentclass{article} - \begin{document} - Hello, world! - \end{document} - EOF - CHECK_RESULT $? 0 1 "创建测试文件失败" - - LOG_INFO "步骤5: 使用tex命令不带任何选项处理test.tex文件" - tex test.tex > /dev/null 2>&1 - CHECK_RESULT $? 0 1 "tex命令执行失败" - - LOG_INFO "步骤6: 检查tex命令是否生成了预期的输出文件" - if [ -f test.dvi ]; then - LOG_INFO "tex命令成功生成了test.dvi文件" - else - LOG_ERROR "tex命令未生成预期的test.dvi文件" - exit 1 - fi - - LOG_INFO "步骤7: 使用texindex命令不带任何选项处理文件" - texindex test.tex > /dev/null 2>&1 - CHECK_RESULT $? 0 1 "texindex命令执行失败" - - LOG_INFO "步骤8: 清理测试生成的文件" - rm -f test.tex test.log test.aux test.dvi - - if [ $INSTALLED -eq 0 ]; then - LOG_INFO "步骤9: 卸载测试安装的软件包" - dnf remove -y texinfo-tex texindex > /dev/null 2>&1 - CHECK_RESULT $? 0 1 "卸载texinfo-tex和texindex软件包失败" - fi - - LOG_INFO "测试完成" -} - -main "$@" \ No newline at end of file diff --git a/testcases/function_test/pkg_test/texinfo/texinfo-tex/test_texinfo-tex_texindex_version.sh b/testcases/function_test/pkg_test/texinfo/texinfo-tex/test_texinfo-tex_texindex_version.sh deleted file mode 100644 index c6dfb9159b0..00000000000 --- a/testcases/function_test/pkg_test/texinfo/texinfo-tex/test_texinfo-tex_texindex_version.sh +++ /dev/null @@ -1,112 +0,0 @@ -#!/usr/bin/bash - -# Copyright (c) 2024 ISCAS .ALL rights reserved. -# This program is licensed under Mulan PSL v2. -# You can use it according to the terms and conditions of the Mulan PSL v2. -# http://license.coscl.org.cn/MulanPSL2 -# THIS PROGRAM IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, -# EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, -# MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. -# See the Mulan PSL v2 for more details. - -# ############################################# -# @Author : honghua -# @Contact : honghua@iscas.ac.cn -# @Date : 2026-01-28 -# @License : Mulan PSL v2 -# @Desc : 测试使用--version参数显示版本信息 -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - LOG_INFO "开始测试texinfo-tex和texindex的--version参数功能" - - # 检查yum源中是否存在texinfo-tex软件包 - LOG_INFO "检查yum源中是否存在texinfo-tex软件包" - dnf list available texinfo-tex &>/dev/null - if [ $? -ne 0 ]; then - LOG_ERROR "yum源中未找到texinfo-tex软件包" - exit 255 - fi - - # 检查yum源中是否存在texindex软件包 - LOG_INFO "检查yum源中是否存在texindex软件包" - dnf list available texindex &>/dev/null - if [ $? -ne 0 ]; then - LOG_ERROR "yum源中未找到texindex软件包" - exit 255 - fi - - # 检查是否已安装texinfo-tex - LOG_INFO "检查texinfo-tex是否已安装" - if rpm -q texinfo-tex &>/dev/null; then - INSTALLED_TEXINFO_TEX=1 - LOG_INFO "texinfo-tex已安装" - else - INSTALLED_TEXINFO_TEX=0 - fi - - # 检查是否已安装texindex - LOG_INFO "检查texindex是否已安装" - if rpm -q texindex &>/dev/null; then - INSTALLED_TEXINDEX=1 - LOG_INFO "texindex已安装" - else - INSTALLED_TEXINDEX=0 - fi - - # 如果未安装,则安装软件包 - if [ $INSTALLED_TEXINFO_TEX -eq 0 ]; then - LOG_INFO "安装texinfo-tex软件包" - dnf install -y texinfo-tex - CHECK_RESULT $? 0 0 "安装texinfo-tex失败" - fi - - if [ $INSTALLED_TEXINDEX -eq 0 ]; then - LOG_INFO "安装texindex软件包" - dnf install -y texindex - CHECK_RESULT $? 0 0 "安装texindex失败" - fi - - # 测试texinfo-tex的--version参数 - LOG_INFO "测试texinfo-tex的--version参数" - texinfo-tex --version &>/dev/null - if [ $? -eq 255 ]; then - LOG_ERROR "texinfo-tex不支持--version参数" - exit 255 - fi - texinfo-tex --version - CHECK_RESULT $? 0 0 "texinfo-tex --version执行失败" - - # 测试texindex的--version参数 - LOG_INFO "测试texindex的--version参数" - texindex --version &>/dev/null - if [ $? -eq 255 ]; then - LOG_ERROR "texindex不支持--version参数" - exit 255 - fi - texindex --version - CHECK_RESULT $? 0 0 "texindex --version执行失败" - - # 环境恢复 - LOG_INFO "开始环境恢复" - - # 如果测试前未安装texinfo-tex,则卸载 - if [ $INSTALLED_TEXINFO_TEX -eq 0 ]; then - LOG_INFO "卸载texinfo-tex软件包" - dnf remove -y texinfo-tex - CHECK_RESULT $? 0 0 "卸载texinfo-tex失败" - fi - - # 如果测试前未安装texindex,则卸载 - if [ $INSTALLED_TEXINDEX -eq 0 ]; then - LOG_INFO "卸载texindex软件包" - dnf remove -y texindex - CHECK_RESULT $? 0 0 "卸载texindex失败" - fi - - LOG_INFO "测试完成,环境已恢复" -} - -main "$@" \ No newline at end of file diff --git a/testcases/function_test/pkg_test/texinfo/texinfo-tex/test_texinfo-tex_texindex_wildcard.sh b/testcases/function_test/pkg_test/texinfo/texinfo-tex/test_texinfo-tex_texindex_wildcard.sh deleted file mode 100644 index 38363e91c6f..00000000000 --- a/testcases/function_test/pkg_test/texinfo/texinfo-tex/test_texinfo-tex_texindex_wildcard.sh +++ /dev/null @@ -1,107 +0,0 @@ -#!/usr/bin/bash - -# Copyright (c) 2024 ISCAS .ALL rights reserved. -# This program is licensed under Mulan PSL v2. -# You can use it according to the terms and conditions of the Mulan PSL v2. -# http://license.coscl.org.cn/MulanPSL2 -# THIS PROGRAM IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, -# EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, -# MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. -# See the Mulan PSL v2 for more details. - -# ############################################# -# @Author : honghua -# @Contact : honghua@iscas.ac.cn -# @Date : 2026-03-12 -# @License : Mulan PSL v2 -# @Desc : 使用通配符处理多个文件 -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - # 测试脚本开始 - - LOG_INFO "开始测试: 使用通配符处理多个文件" - - # 检查软件包是否已安装 - LOG_INFO "步骤1: 检查texinfo-tex和texindex软件包是否已安装" - if rpm -q texinfo-tex texindex &>/dev/null; then - LOG_INFO "软件包已安装,测试后将保持安装状态" - ALREADY_INSTALLED=true - else - LOG_INFO "软件包未安装,将在测试过程中安装" - ALREADY_INSTALLED=false - fi - - # 检查yum源中是否存在软件包 - LOG_INFO "步骤2: 检查yum源中是否存在texinfo-tex和texindex软件包" - if ! dnf list available texinfo-tex texindex &>/dev/null; then - LOG_ERROR "yum源中不存在texinfo-tex或texindex软件包" - exit 255 - fi - - # 安装软件包(如果未安装) - if [ "$ALREADY_INSTALLED" = false ]; then - LOG_INFO "步骤3: 安装texinfo-tex和texindex软件包" - dnf install -y texinfo-tex texindex - CHECK_RESULT $? 0 0 "安装软件包失败" - fi - - # 创建测试文件 - LOG_INFO "步骤4: 创建测试文件" - cat > test1.tex << "EOF" - \documentclass{article} - \begin{document} - Test file 1. - \end{document} - EOF - - cat > test2.tex << "EOF" - \documentclass{article} - \begin{document} - Test file 2. - \end{document} - EOF - - cat > test3.tex << "EOF" - \documentclass{article} - \begin{document} - Test file 3. - \end{document} - EOF - - # 检查通配符参数支持 - LOG_INFO "步骤5: 检查texindex命令是否支持通配符参数" - texindex --help 2>&1 | grep -q "wildcard" - CHECK_RESULT $? 0 0 "texindex命令不支持通配符参数" - - # 使用通配符处理多个文件 - LOG_INFO "步骤6: 使用通配符处理多个.tex文件" - texindex test*.tex - CHECK_RESULT $? 0 0 "使用通配符处理文件失败" - - # 验证处理结果 - LOG_INFO "步骤7: 验证处理结果" - if [ -f test1.idx ] && [ -f test2.idx ] && [ -f test3.idx ]; then - LOG_INFO "成功生成所有索引文件" - else - LOG_ERROR "未能生成所有索引文件" - exit 1 - fi - - # 清理测试文件 - LOG_INFO "步骤8: 清理测试文件" - rm -f test1.tex test2.tex test3.tex test1.idx test2.idx test3.idx - - # 卸载软件包(如果测试前未安装) - if [ "$ALREADY_INSTALLED" = false ]; then - LOG_INFO "步骤9: 卸载texinfo-tex和texindex软件包" - dnf remove -y texinfo-tex texindex - CHECK_RESULT $? 0 0 "卸载软件包失败" - fi - - LOG_INFO "测试完成: 使用通配符处理多个文件测试通过" -} - -main "$@" \ No newline at end of file diff --git a/testcases/function_test/pkg_test/texlive-base/texlive-pst-pdf/test_texlive-pst-pdf_function_basic.sh b/testcases/function_test/pkg_test/texlive-base/texlive-pst-pdf/test_texlive-pst-pdf_function_basic.sh deleted file mode 100644 index f0df06d7d92..00000000000 --- a/testcases/function_test/pkg_test/texlive-base/texlive-pst-pdf/test_texlive-pst-pdf_function_basic.sh +++ /dev/null @@ -1,66 +0,0 @@ -#!/usr/bin/bash - -# Copyright (c) 2024 ISCAS .ALL rights reserved. -# This program is licensed under Mulan PSL v2. -# You can use it according to the terms and conditions of the Mulan PSL v2. -# http://license.coscl.org.cn/MulanPSL2 -# THIS PROGRAM IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, -# EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, -# MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. -# See the Mulan PSL v2 for more details. - -# ############################################# -# @Author : honghua -# @Contact : honghua@iscas.ac.cn -# @Date : 2025-11-27 -# @License : Mulan PSL v2 -# @Desc : 测试基本功能是否正常 -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - - # 检查是否已安装texlive-pst-pdf软件包 - LOG_INFO "检查是否已安装texlive-pst-pdf软件包" - dnf list installed texlive-pst-pdf > /dev/null 2>&1 - if [ $? -eq 0 ]; then - LOG_INFO "texlive-pst-pdf已安装,脚本结束后将保持安装状态" - INSTALLED=true - else - LOG_INFO "texlive-pst-pdf未安装,将在测试完成后卸载" - INSTALLED=false - fi - - # 检查yum源中是否存在texlive-pst-pdf软件包 - LOG_INFO "检查yum源中是否存在texlive-pst-pdf软件包" - dnf list available texlive-pst-pdf > /dev/null 2>&1 - CHECK_RESULT $? 0 255 "yum源中不存在texlive-pst-pdf软件包" - - # 安装texlive-pst-pdf软件包 - LOG_INFO "安装texlive-pst-pdf软件包" - dnf install -y texlive-pst-pdf - CHECK_RESULT $? 0 0 "安装texlive-pst-pdf软件包失败" - - # 测试基本功能是否正常 - LOG_INFO "测试texlive-pst-pdf基本功能" - pdflatex --help > /dev/null 2>&1 - CHECK_RESULT $? 0 0 "pdflatex命令执行失败" - - # 清理环境:如果之前未安装,则卸载软件包 - if [ "$INSTALLED" = false ]; then - LOG_INFO "卸载texlive-pst-pdf软件包" - dnf remove -y texlive-psf-texmf.noarch texlive-pictures-doc.noarch texlive-pictures.noarch texlive-pst-pdf.noarch - CHECK_RESULT $? 0 0 "卸载texlive-psf-texmf.noarch texlve-pictures-doc.noarch texlve-pictures.noarch texlve-psf-tools.noarch失败" - - # 确保环境完全清理 - LOG_INFO "清理残留文件" - rm -rf /usr/share/texlive/texmf-dist/tex/latex/pgfplots/ - CHECK_RESULT $? 0 0 "清理残留文件失败" - fi - - LOG_INFO "测试脚本执行完毕,环境已恢复" - -} - -main "$@" \ No newline at end of file diff --git a/testcases/function_test/pkg_test/texlive-base/texlive-pst-pdf/test_texlive-pst-pdf_function_compile.sh b/testcases/function_test/pkg_test/texlive-base/texlive-pst-pdf/test_texlive-pst-pdf_function_compile.sh deleted file mode 100644 index 905d2896862..00000000000 --- a/testcases/function_test/pkg_test/texlive-base/texlive-pst-pdf/test_texlive-pst-pdf_function_compile.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-02-21 -# @License : Mulan PSL v2 -# @Desc : 测试带pst-pdf的LaTeX编译流程 -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - # 定义软件包名称 - PACKAGE_NAME="texlive-pst-pdf" - TEMP_DIR="/tmp/test_texlive_pst_pdf" - TEST_TEX_FILE="${TEMP_DIR}/test.tex" - TEST_PDF_FILE="${TEMP_DIR}/test.pdf" - - # 步骤1:检查yum源中是否存在指定的软件包 - LOG_INFO "步骤1:检查yum源中是否存在 ${PACKAGE_NAME} 软件包" - dnf list available ${PACKAGE_NAME} &>/dev/null - if [ $? -ne 0 ]; then - LOG_ERROR "yum源中未找到 ${PACKAGE_NAME} 软件包" - exit 255 - fi - - # 步骤2:检查系统是否已经安装了指定的软件包 - LOG_INFO "步骤2:检查系统是否已经安装了 ${PACKAGE_NAME} 软件包" - if rpm -q ${PACKAGE_NAME} &>/dev/null; then - LOG_INFO "系统已经安装了 ${PACKAGE_NAME},脚本结束后将保持安装状态" - ALREADY_INSTALLED=1 - else - LOG_INFO "系统未安装 ${PACKAGE_NAME},将进行安装作为测试步骤" - ALREADY_INSTALLED=0 - fi - - # 步骤3:如果未安装,则安装软件包 - if [ ${ALREADY_INSTALLED} -eq 0 ]; then - LOG_INFO "步骤3:安装 ${PACKAGE_NAME} 软件包" - dnf install -y ${PACKAGE_NAME} - CHECK_RESULT $? 0 0 "安装 ${PACKAGE_NAME} 失败" - fi - - # 步骤4:创建临时目录用于测试 - LOG_INFO "步骤4:创建临时目录用于测试" - mkdir -p ${TEMP_DIR} - CHECK_RESULT $? 0 0 "创建临时目录失败" - - # 步骤5:创建测试用的LaTeX文件,包含pst-pdf内容 - LOG_INFO "步骤5:创建测试用的LaTeX文件,包含pst-pdf内容" - cat > ${TEST_TEX_FILE} << "EOF" - \documentclass{article} - \usepackage{pst-pdf} - \begin{document} - \title{Test PST-PDF} - \author{Test Author} - \maketitle - This is a test document for PST-PDF. - \begin{pspicture}(5,5) - \psframe(0,0)(5,5) - \end{pspicture} - \end{document} - EOF - CHECK_RESULT $? 0 0 "创建测试LaTeX文件失败" - - # 步骤6:使用pdflatex编译LaTeX文件,启用--shell-escape以支持pst-pdf - LOG_INFO "步骤6:使用pdflatex编译LaTeX文件,启用--shell-escape以支持pst-pdf" - pdflatex --shell-escape -output-directory ${TEMP_DIR} ${TEST_TEX_FILE} > ${TEMP_DIR}/compile.log 2>&1 - CHECK_RESULT $? 0 0 "pdflatex编译失败" - - # 步骤7:检查生成的PDF文件是否存在 - LOG_INFO "步骤7:检查生成的PDF文件是否存在" - if [ -f ${TEST_PDF_FILE} ]; then - LOG_INFO "PDF文件生成成功:${TEST_PDF_FILE}" - else - LOG_ERROR "PDF文件未生成" - exit 1 - fi - - # 步骤8:清理临时文件 - LOG_INFO "步骤8:清理临时文件" - rm -rf ${TEMP_DIR} - CHECK_RESULT $? 0 0 "清理临时文件失败" - - # 步骤9:如果之前未安装,则卸载软件包以恢复环境 - if [ ${ALREADY_INSTALLED} -eq 0 ]; then - LOG_INFO "步骤9:卸载 ${PACKAGE_NAME} 软件包以恢复环境" - dnf remove -y ${PACKAGE_NAME} - CHECK_RESULT $? 0 0 "卸载 ${PACKAGE_NAME} 失败" - else - LOG_INFO "步骤9:保持 ${PACKAGE_NAME} 的安装状态" - fi - - LOG_INFO "测试完成:带pst-pdf的LaTeX编译流程测试成功" -} - -main "$@" \ No newline at end of file diff --git a/testcases/function_test/pkg_test/texlive-base/texlive-pst-pdf/test_texlive-pst-pdf_function_install.sh b/testcases/function_test/pkg_test/texlive-base/texlive-pst-pdf/test_texlive-pst-pdf_function_install.sh deleted file mode 100644 index bed98d3440e..00000000000 --- a/testcases/function_test/pkg_test/texlive-base/texlive-pst-pdf/test_texlive-pst-pdf_function_install.sh +++ /dev/null @@ -1,111 +0,0 @@ -#!/usr/bin/bash - -# Copyright (c) 2024 ISCAS .ALL rights reserved. -# This program is licensed under Mulan PSL v2. -# You can use it according to the terms and conditions of the Mulan PSL v2. -# http://license.coscl.org.cn/MulanPSL2 -# THIS PROGRAM IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, -# EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, -# MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. -# See the Mulan PSL v2 for more details. - -# ############################################# -# @Author : honghua -# @Contact : honghua@iscas.ac.cn -# @Date : 2026-02-21 -# @License : Mulan PSL v2 -# @Desc : 测试软件包是否已正确安装 -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - # 定义颜色和日志函数 - LOG_INFO() { - echo -e "\033[32m[INFO]\033[0m $1" - } - - LOG_ERROR() { - echo -e "\033[31m[ERROR]\033[0m $1" - } - - # 定义检查结果函数 - CHECK_RESULT() { - if [ $1 -ne $2 ]; then - LOG_ERROR "$4" - exit $3 - fi - } - - # 定义SSH远程执行函数 - SSH_CMD() { - cmd=$1 - node_ip=$2 - node_password=$3 - node_user=$4 - sshpass -p "$node_password" ssh -o StrictHostKeyChecking=no -o UserKnownHostsFile=/dev/null "$node_user@$node_ip" "$cmd" - return $? - } - - # 定义软件包名称 - PACKAGE_NAME="texlive-pst-pdf" - - # 步骤1: 检查yum源中是否存在该软件包 - LOG_INFO "步骤1: 检查yum源中是否存在 $PACKAGE_NAME 软件包" - dnf list available $PACKAGE_NAME &> /dev/null - if [ $? -ne 0 ]; then - LOG_ERROR "yum源中不存在 $PACKAGE_NAME 软件包" - exit 255 - fi - - # 步骤2: 检查软件包是否已安装 - LOG_INFO "步骤2: 检查 $PACKAGE_NAME 是否已安装" - dnf list installed $PACKAGE_NAME &> /dev/null - if [ $? -eq 0 ]; then - LOG_INFO "$PACKAGE_NAME 已安装,脚本结束时将保持安装状态" - INSTALLED=true - else - LOG_INFO "$PACKAGE_NAME 未安装,将在测试步骤中安装" - INSTALLED=false - fi - - # 步骤3: 如果未安装,则安装软件包 - if [ "$INSTALLED" = false ]; then - LOG_INFO "步骤3: 安装 $PACKAGE_NAME 软件包" - dnf install -y $PACKAGE_NAME - CHECK_RESULT $? 0 1 "安装 $PACKAGE_NAME 失败" - LOG_INFO "$PACKAGE_NAME 安装成功" - fi - - # 步骤4: 验证软件包安装 - LOG_INFO "步骤4: 验证 $PACKAGE_NAME 是否已正确安装" - dnf list installed $PACKAGE_NAME &> /dev/null - CHECK_RESULT $? 0 1 "$PACKAGE_NAME 未正确安装" - - # 步骤5: 测试软件包功能 - LOG_INFO "步骤5: 测试 $PACKAGE_NAME 功能" - # 这里可以根据软件包的实际功能添加测试命令 - # 例如:检查是否有相关命令或文件 - # 假设软件包安装后会有 /usr/share/texlive/texmf-dist/tex/latex/pst-pdf 目录 - if [ -d "/usr/share/texlive/texmf-dist/tex/latex/pst-pdf" ]; then - LOG_INFO "$PACKAGE_NAME 功能正常" - else - LOG_ERROR "$PACKAGE_NAME 功能异常" - exit 1 - fi - - # 步骤6: 清理环境 - LOG_INFO "步骤6: 清理环境" - if [ "$INSTALLED" = false ]; then - LOG_INFO "卸载 $PACKAGE_NAME 软件包" - dnf remove -y $PACKAGE_NAME - CHECK_RESULT $? 0 1 "卸载 $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/texlive-base/texlive-pst-pdf/test_texlive-pst-pdf_function_uninstall.sh b/testcases/function_test/pkg_test/texlive-base/texlive-pst-pdf/test_texlive-pst-pdf_function_uninstall.sh deleted file mode 100644 index a5fa86ff142..00000000000 --- a/testcases/function_test/pkg_test/texlive-base/texlive-pst-pdf/test_texlive-pst-pdf_function_uninstall.sh +++ /dev/null @@ -1,87 +0,0 @@ -#!/usr/bin/bash - -# Copyright (c) 2024 ISCAS .ALL rights reserved. -# This program is licensed under Mulan PSL v2. -# You can use it according to the terms and conditions of the Mulan PSL v2. -# http://license.coscl.org.cn/MulanPSL2 -# THIS PROGRAM IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, -# EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, -# MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. -# See the Mulan PSL v2 for more details. - -# ############################################# -# @Author : honghua -# @Contact : honghua@iscas.ac.cn -# @Date : 2026-02-21 -# @License : Mulan PSL v2 -# @Desc : 测试软件包卸载功能 -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - # 环境检查:检查是否已安装texlive-pst-pdf软件包 - LOG_INFO "步骤1:检查当前环境是否已安装texlive-pst-pdf软件包" - rpm -q texlive-pst-pdf > /dev/null 2>&1 - is_installed=$? - - # 如果未安装,则记录状态,后续需要安装并卸载 - if [ $is_installed -ne 0 ]; then - LOG_INFO "当前环境未安装texlive-pst-pdf软件包,测试将执行安装和卸载操作" - need_cleanup=1 - else - LOG_INFO "当前环境已安装texlive-pst-pdf软件包,测试将保持安装状态" - need_cleanup=0 - fi - - # 检查yum源中是否存在texlive-pst-pdf软件包 - LOG_INFO "步骤2:检查yum源中是否存在texlive-pst-pdf软件包" - dnf list available texlive-pst-pdf > /dev/null 2>&1 - if [ $? -ne 0 ]; then - LOG_ERROR "yum源中未找到texlive-pst-pdf软件包" - exit 255 - fi - LOG_INFO "yum源中存在texlive-pst-pdf软件包" - - # 如果未安装,则安装软件包 - if [ $need_cleanup -eq 1 ]; then - LOG_INFO "步骤3:安装texlive-pst-pdf软件包" - dnf install -y texlive-pst-pdf - CHECK_RESULT $? 0 0 "安装texlive-pst-pdf软件包失败" - LOG_INFO "texlive-pst-pdf软件包安装成功" - fi - - # 验证软件包安装成功 - LOG_INFO "步骤4:验证texlive-pst-pdf软件包是否安装成功" - rpm -q texlive-pst-pdf > /dev/null 2>&1 - CHECK_RESULT $? 0 0 "texlive-pst-pdf软件包未正确安装" - - # 测试软件包卸载功能 - LOG_INFO "步骤5:测试texlive-pst-pdf软件包卸载功能" - if [ $need_cleanup -eq 1 ]; then - dnf remove -y texlive-pst-pdf - CHECK_RESULT $? 0 0 "卸载texlive-pst-pdf软件包失败" - LOG_INFO "texlive-pst-pdf软件包卸载成功" - else - LOG_INFO "由于环境已安装texlive-pst-pdf软件包,跳过卸载步骤,保持安装状态" - fi - - # 环境恢复:如果测试过程中安装了软件包,需要卸载;如果原本已安装,则保持安装状态 - LOG_INFO "步骤6:环境恢复" - if [ $need_cleanup -eq 1 ]; then - # 再次检查是否已卸载 - rpm -q texlive-pst-pdf > /dev/null 2>&1 - if [ $? -eq 0 ]; then - LOG_INFO "环境恢复:卸载测试安装的texlive-pst-pdf软件包" - dnf remove -y texlive-pst-pdf - CHECK_RESULT $? 0 0 "环境恢复时卸载texlive-pst-pdf软件包失败" - fi - LOG_INFO "环境已恢复到未安装texlive-pst-pdf软件包的状态" - else - LOG_INFO "环境保持原状,texlive-pst-pdf软件包仍处于安装状态" - fi - - LOG_INFO "测试脚本执行完毕" -} - -main "$@" \ No newline at end of file diff --git a/testcases/function_test/pkg_test/texlive-base/texlive-pst-pdf/test_texlive-pst-pdf_function_usage.sh b/testcases/function_test/pkg_test/texlive-base/texlive-pst-pdf/test_texlive-pst-pdf_function_usage.sh deleted file mode 100644 index fdcdef3aa79..00000000000 --- a/testcases/function_test/pkg_test/texlive-base/texlive-pst-pdf/test_texlive-pst-pdf_function_usage.sh +++ /dev/null @@ -1,117 +0,0 @@ -#!/usr/bin/bash - -# Copyright (c) 2024 ISCAS .ALL rights reserved. -# This program is licensed under Mulan PSL v2. -# You can use it according to the terms and conditions of the Mulan PSL v2. -# http://license.coscl.org.cn/MulanPSL2 -# THIS PROGRAM IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, -# EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, -# MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. -# See the Mulan PSL v2 for more details. - -# ############################################# -# @Author : honghua -# @Contact : honghua@iscas.ac.cn -# @Date : 2026-02-21 -# @License : Mulan PSL v2 -# @Desc : 测试使用pst-pdf宏包生成PDF -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - # 测试使用pst-pdf宏包生成PDF - - LOG_INFO "1. 检查系统是否已安装texlive-pst-pdf软件包" - if rpm -q texlive-pst-pdf &>/dev/null; then - LOG_INFO "texlive-pst-pdf已安装,脚本结束后将保持安装状态" - INSTALLED_BEFORE="yes" - else - LOG_INFO "texlive-pst-pdf未安装,将进行安装测试" - INSTALLED_BEFORE="no" - fi - - LOG_INFO "2. 检查yum源中是否有texlive-pst-pdf软件包" - dnf list available texlive-pst-pdf &>/dev/null - if [ $? -ne 0 ]; then - LOG_ERROR "yum源中未找到texlive-pst-pdf软件包" - exit 255 - fi - - LOG_INFO "3. 安装texlive-pst-pdf软件包" - if [ "$INSTALLED_BEFORE" = "no" ]; then - dnf install -y texlive-pst-pdf - CHECK_RESULT $? 0 0 "安装texlive-pst-pdf失败" - fi - - LOG_INFO "4. 检查latex命令是否可用" - which latex &>/dev/null - if [ $? -ne 0 ]; then - LOG_ERROR "latex命令不存在" - if [ "$INSTALLED_BEFORE" = "no" ]; then - dnf remove -y texlive-pst-pdf - fi - exit 255 - fi - - LOG_INFO "5. 创建测试LaTeX文档" - cat > test_pstpdf.tex << "EOF" - \documentclass{article} - \usepackage{pst-pdf} - \usepackage{pstricks} - - \begin{document} - \title{Test PST-PDF Package} - \author{Test Author} - \maketitle - - This is a test document for PST-PDF package. - - \begin{pspicture}(5,5) - \psframe(0,0)(5,5) - \pscircle(2.5,2.5){2} - \rput(2.5,2.5){PST-PDF Test} - \end{pspicture} - - \end{document} - EOF - CHECK_RESULT $? 0 0 "创建测试文档失败" - - LOG_INFO "6. 使用latex编译文档" - latex -interaction=nonstopmode test_pstpdf.tex - CHECK_RESULT $? 0 0 "latex编译失败" - - LOG_INFO "7. 使用dvips生成PS文件" - dvips test_pstpdf.dvi -o test_pstpdf.ps - CHECK_RESULT $? 0 0 "dvips生成PS文件失败" - - LOG_INFO "8. 使用ps2pdf生成PDF文件" - ps2pdf test_pstpdf.ps test_pstpdf.pdf - CHECK_RESULT $? 0 0 "ps2pdf生成PDF失败" - - LOG_INFO "9. 验证生成的PDF文件" - if [ -f test_pstpdf.pdf ]; then - file test_pstpdf.pdf | grep -q "PDF document" - CHECK_RESULT $? 0 0 "生成的PDF文件格式不正确" - LOG_INFO "PDF文件生成成功" - else - LOG_ERROR "PDF文件未生成" - CHECK_RESULT 1 0 0 "PDF文件未生成" - fi - - LOG_INFO "10. 清理测试文件" - rm -f test_pstpdf.tex test_pstpdf.aux test_pstpdf.log test_pstpdf.dvi test_pstpdf.ps test_pstpdf.pdf test_pstpdf.out - - LOG_INFO "11. 恢复环境状态" - if [ "$INSTALLED_BEFORE" = "no" ]; then - LOG_INFO "卸载测试安装的texlive-pst-pdf软件包" - dnf remove -y texlive-pst-pdf - CHECK_RESULT $? 0 0 "卸载texlive-pst-pdf失败" - else - LOG_INFO "保持原有的texlive-pst-pdf安装状态" - fi - - LOG_INFO "12. 测试完成" -} - -main "$@" \ No newline at end of file diff --git a/testcases/function_test/pkg_test/texlive-base/texlive-pst-pdf/test_texlive-pst-pdf_ps4pdf__Xps2pdf.sh b/testcases/function_test/pkg_test/texlive-base/texlive-pst-pdf/test_texlive-pst-pdf_ps4pdf__Xps2pdf.sh deleted file mode 100644 index a9eb6d2d256..00000000000 --- a/testcases/function_test/pkg_test/texlive-base/texlive-pst-pdf/test_texlive-pst-pdf_ps4pdf__Xps2pdf.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-27 -# @License : Mulan PSL v2 -# @Desc : 测试 ps4pdf 命令的 --Xps2pdf OPT 参数 -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - - # 检查是否已安装texlive-pst-pdf软件包 - LOG_INFO "检查是否已安装texlive-pst-pdf软件包" - if ! dnf list installed texlive-pst-pdf &>/dev/null; then - LOG_INFO "texlive-pst-pdf未安装,开始安装" - if ! dnf list texlive-pst-pdf &>/dev/null; then - LOG_ERROR "yum源中未找到texlive-pst-pdf软件包" - exit 255 - fi - dnf install -y texlive-pst-pdf - CHECK_RESULT $? 0 0 "安装texlive-pst-pdf失败" - INSTALLED=1 - else - LOG_INFO "texlive-pst-pdf已安装" - INSTALLED=0 - fi - - # 测试ps4pdf命令的--Xps2pdf参数 - LOG_INFO "测试ps4pdf命令的--Xps2pdf参数" - if ! ps4pdf --help | grep -q -- "--Xps2pdf"; then - LOG_ERROR "ps4pdf命令不支持--Xps2pdf参数" - if [ $INSTALLED -eq 1 ]; then - dnf remove -y texlive-pst-pdf - CHECK_RESULT $? 0 0 "卸载texlive-pst-pdf失败" - fi - exit 255 - fi - - # 执行ps4pdf --Xps2pdf测试命令 - LOG_INFO "执行ps4pdf --Xps2pdf测试命令" - ps4pdf --Xps2pdf test.ps test.pdf - CHECK_RESULT $? 0 0 "执行ps4pdf --Xps2pdf失败" - - # 清理环境,恢复之前状态 - if [ $INSTALLED -eq 1 ]; then - LOG_INFO "卸载texlive-pst-pdf软件包" - dnf remove -y texlive-pst-pdf - CHECK_RESULT $? 0 0 "卸载texlive -} - -main "$@" \ No newline at end of file diff --git a/testcases/function_test/pkg_test/texlive-base/texlive-pst-pdf/test_texlive-pst-pdf_ps4pdf__crop.sh b/testcases/function_test/pkg_test/texlive-base/texlive-pst-pdf/test_texlive-pst-pdf_ps4pdf__crop.sh deleted file mode 100644 index 6ca6501aa2c..00000000000 --- a/testcases/function_test/pkg_test/texlive-base/texlive-pst-pdf/test_texlive-pst-pdf_ps4pdf__crop.sh +++ /dev/null @@ -1,69 +0,0 @@ -#!/usr/bin/bash - -# Copyright (c) 2024 ISCAS .ALL rights reserved. -# This program is licensed under Mulan PSL v2. -# You can use it according to the terms and conditions of the Mulan PSL v2. -# http://license.coscl.org.cn/MulanPSL2 -# THIS PROGRAM IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, -# EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, -# MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. -# See the Mulan PSL v2 for more details. - -# ############################################# -# @Author : honghua -# @Contact : honghua@iscas.ac.cn -# @Date : 2025-11-27 -# @License : Mulan PSL v2 -# @Desc : 测试 ps4pdf 命令的 --crop 参数 -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - LOG_INFO "开始测试 ps4pdf 命令的 --crop 参数" - - # 检查是否已安装 texlive-pst-pdf 软件包 - LOG_INFO "检查 texlive-pst-pdf 是否已安装" - if rpm -q texlive-pst-pdf &>/dev/null; then - LOG_INFO "texlive-pst-pdf 已安装,脚本结束时将保持安装状态" - INSTALLED=true - else - LOG_INFO "texlive-pst-pdf 未安装,将在测试后卸载" - INSTALLED=false - fi - - # 检查 yum 源中是否有 texlive-pst-pdf 软件包 - LOG_INFO "检查 yum 源中是否有 texlive-pst-pdf" - if ! dnf list available texlive-pst-pdf &>/dev/null; then - LOG_ERROR "yum 源中未找到 texlive-pst-pdf 软件包" - exit 255 - fi - - # 如果未安装,则安装 texlive-pst-pdf - if [ "$INSTALLED" = false ]; then - LOG_INFO "安装 texlive-pst-pdf" - dnf install -y texlive-pst-pdf - CHECK_RESULT $? 0 0 "安装 texlive-pst-pdf 失败" - fi - - # 检查 ps4pdf 命令是否支持 --crop 参数 - LOG_INFO "检查 ps4pdf --crop 参数是否支持" - ps4pdf --help | grep -- "--crop" &>/dev/null - CHECK_RESULT $? 0 255 "ps4pdf 不支持 --crop 参数" - - # 测试 ps4pdf --crop - LOG_INFO "测试 ps4pdf --crop" - ps4pdf --crop test.ps test.pdf - CHECK_RESULT $? 0 0 "ps4pdf --crop test.ps test.pdf failed" - - #清理环境 - if [ "$INSTALLED" = false ]; then - LOG_INFO "卸载 texlive-pst-pdf" - dnf remove -y texlive-pst- pdf - CHECK_RESULT $? 0 0 “卸载 texliv -pst - pdf 失败” - fi - - LOG _ INFO “测试完成” -} - -main "$@" \ No newline at end of file diff --git a/testcases/function_test/pkg_test/texlive-base/texlive-pst-pdf/test_texlive-pst-pdf_ps4pdf__lualatex.sh b/testcases/function_test/pkg_test/texlive-base/texlive-pst-pdf/test_texlive-pst-pdf_ps4pdf__lualatex.sh deleted file mode 100644 index 8e26bccb06a..00000000000 --- a/testcases/function_test/pkg_test/texlive-base/texlive-pst-pdf/test_texlive-pst-pdf_ps4pdf__lualatex.sh +++ /dev/null @@ -1,70 +0,0 @@ -#!/usr/bin/bash - -# Copyright (c) 2024 ISCAS .ALL rights reserved. -# This program is licensed under Mulan PSL v2. -# You can use it according to the terms and conditions of the Mulan PSL v2. -# http://license.coscl.org.cn/MulanPSL2 -# THIS PROGRAM IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, -# EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, -# MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. -# See the Mulan PSL v2 for more details. - -# ############################################# -# @Author : honghua -# @Contact : honghua@iscas.ac.cn -# @Date : 2025-11-27 -# @License : Mulan PSL v2 -# @Desc : 测试 ps4pdf 命令的 --lualatex 参数 -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - LOG_INFO "开始测试 ps4pdf 命令的 --lualatex 参数" - - # 检查是否已安装 texlive-pst-pdf - LOG_INFO "检查 texlive-pst-pdf 是否已安装" - if rpm -q texlive-pst-pdf &>/dev/null; then - LOG_INFO "texlive-pst-pdf 已安装,测试结束后将保持安装状态" - INSTALLED=true - else - LOG_INFO "texlive-pst-pdf 未安装,测试结束后将卸载" - INSTALLED=false - fi - - # 检查 yum 源中是否有 texlive-pst-pdf - LOG_INFO "检查 yum 源中是否有 texlive-pst-pdf" - if ! dnf list available texlive-pst-pdf &>/dev/null; then - LOG_ERROR "yum 源中未找到 texlive-pst-pdf 软件包" - exit 255 - fi - - # 安装 texlive-pst-pdf(如果未安装) - if [ "$INSTALLED" = false ]; then - LOG_INFO "正在安装 texlive-pst-pdf" - dnf install -y texlive-pst-pdf - CHECK_RESULT $? 0 0 "安装 texlive-pst-pdf 失败" - fi - - # 检查 ps4pdf 命令是否支持 --lualatex 参数 - LOG_INFO "检查 ps4pdf 命令是否支持 --lualatex 参数" - if ! ps4pdf --help | grep -q -- "--lualatex"; then - LOG_ERROR "ps4pdf 命令不支持 --lualatex 参数" - exit 255 - fi - - # 测试 ps4pdf --lualatex - LOG_INFO "执行 ps4pdf --lualatex 测试" - ps4pdf --lualatex test.tex - CHECK_RESULT $? 0 0 "ps4pdf --lualatex test.tex failed" - - #清理环境 - if [ "$INSTALLED" = false ]; then - LOG_INFO "正在卸载 texlive-pst-pdf" - dnf remove -y texlive-stm-macros.noarch - fi - - LOG_INFO "测试 ps4pdf --lualatex完成" -} - -main "$@" \ No newline at end of file diff --git a/testcases/function_test/pkg_test/texlive-base/texlive-pst-pdf/test_texlive-pst-pdf_ps4pdf__q.sh b/testcases/function_test/pkg_test/texlive-base/texlive-pst-pdf/test_texlive-pst-pdf_ps4pdf__q.sh deleted file mode 100644 index d9423ff4093..00000000000 --- a/testcases/function_test/pkg_test/texlive-base/texlive-pst-pdf/test_texlive-pst-pdf_ps4pdf__q.sh +++ /dev/null @@ -1,68 +0,0 @@ -#!/usr/bin/bash - -# Copyright (c) 2024 ISCAS .ALL rights reserved. -# This program is licensed under Mulan PSL v2. -# You can use it according to the terms and conditions of the Mulan PSL v2. -# http://license.coscl.org.cn/MulanPSL2 -# THIS PROGRAM IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, -# EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, -# MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. -# See the Mulan PSL v2 for more details. - -# ############################################# -# @Author : honghua -# @Contact : honghua@iscas.ac.cn -# @Date : 2025-11-27 -# @License : Mulan PSL v2 -# @Desc : 测试 ps4pdf 命令的 -q 参数 -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - - # 检查是否已安装texlive-pst-pdf软件包 - LOG_INFO "检查是否已安装texlive-pst-pdf软件包" - if rpm -q texlive-pst-pdf &>/dev/null; then - LOG_INFO "texlive-pst-pdf已安装,脚本结束时将保持安装状态" - INSTALLED=true - else - LOG_INFO "texlive-pst-pdf未安装,将在测试结束后卸载" - INSTALLED=false - fi - - # 检查yum源中是否有texlive-pst-pdf软件包 - LOG_INFO "检查yum源中是否有texlive-pst-pdf软件包" - if ! dnf list available texlive-pst-pdf &>/dev/null; then - LOG_ERROR "yum源中未找到texlive-pst-pdf软件包" - exit 255 - fi - - # 如果未安装,则安装软件包 - if [ "$INSTALLED" = false ]; then - LOG_INFO "开始安装texlive-pst-pdf软件包" - dnf install -y texlive-pst-pdf - CHECK_RESULT $? 0 0 "安装texlive-pst-pdf失败" - fi - - # 测试ps4pdf命令的-q参数 - LOG_INFO "测试ps4pdf命令的-q参数" - ps4pdf -q &>/dev/null - if [ $? -eq 255 ]; then - LOG_ERROR "ps4pdf命令不支持-q参数" - exit 255 - fi - - # 检查ps4pdf命令是否成功执行 - LOG_INFO "检查ps4pdf命令是否成功执行" - ps4pdf -q test.ps test.pdf - CHECK_RESULT $? 0 0 "ps4pdf命令执行失败" - - # 清理环境 - if [ "$INSTALLED" = false ]; then - LOG_INFO "卸载texlive-pst-pdf软件包" - dnf remove -y texlive-pst-pdf - CHECK_RESULT $? 0 0 "卸载texlive -} - -main "$@" \ No newline at end of file diff --git a/testcases/function_test/pkg_test/texlive-base/texlive-pst-pdf/test_texlive-pst-pdf_ps4pdf__v.sh b/testcases/function_test/pkg_test/texlive-base/texlive-pst-pdf/test_texlive-pst-pdf_ps4pdf__v.sh deleted file mode 100644 index 170350da154..00000000000 --- a/testcases/function_test/pkg_test/texlive-base/texlive-pst-pdf/test_texlive-pst-pdf_ps4pdf__v.sh +++ /dev/null @@ -1,60 +0,0 @@ -#!/usr/bin/bash - -# Copyright (c) 2024 ISCAS .ALL rights reserved. -# This program is licensed under Mulan PSL v2. -# You can use it according to the terms and conditions of the Mulan PSL v2. -# http://license.coscl.org.cn/MulanPSL2 -# THIS PROGRAM IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, -# EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, -# MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. -# See the Mulan PSL v2 for more details. - -# ############################################# -# @Author : honghua -# @Contact : honghua@iscas.ac.cn -# @Date : 2025-11-27 -# @License : Mulan PSL v2 -# @Desc : 测试 ps4pdf 命令的 -v 参数 -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - - LOG_INFO "开始测试 ps4pdf 命令的 -v 参数" - - # 检查是否已安装 texlive-pst-pdf 软件包 - LOG_INFO "检查 texlive-pst-pdf 是否已安装" - if dnf list installed texlive-pst-pdf &>/dev/null; then - LOG_INFO "texlive-pst-pdf 已安装,脚本结束时将保持安装状态" - installed=true - else - LOG_INFO "texlive-pst-pdf 未安装,将在测试结束后卸载" - installed=false - fi - - # 检查 yum 源中是否有 texlive-pst-pdf 软件包 - LOG_INFO "检查 yum 源中是否有 texlive-pst-pdf" - if ! dnf list available texlive-pst-pdf &>/dev/null; then - LOG_ERROR "yum 源中未找到 texlive-pst-pdf 软件包" - exit 255 - fi - - # 如果未安装,则安装 texlive-pst-pdf - if [ "$installed" = false ]; then - LOG_INFO "正在安装 texlive-pst-pdf" - dnf install -y texlive-pst-pdf - CHECK_RESULT $? 0 0 "安装 texlive-pst-pdf 失败" - fi - - # 测试 ps4pdf 命令的 -v 参数是否存在或支持 - LOG_INFO "测试 ps4pdf 命令的 -v 参数" - ps4pdf -v &>/dev/null - if [ $? -eq 255 ]; then - LOG_ERROR "ps4pdf 命令不支持 -v 参数" - # 如果之前未安装,则卸载 - if [ "$installed" = false ]; then - LOG_INFO "正在卸载 texlive-pst- -} - -main "$@" \ No newline at end of file diff --git a/testcases/function_test/pkg_test/texlive-base/texlive-pst-pdf/test_texlive-pst-pdf_ps4pdf__version.sh b/testcases/function_test/pkg_test/texlive-base/texlive-pst-pdf/test_texlive-pst-pdf_ps4pdf__version.sh deleted file mode 100644 index ebf83a32920..00000000000 --- a/testcases/function_test/pkg_test/texlive-base/texlive-pst-pdf/test_texlive-pst-pdf_ps4pdf__version.sh +++ /dev/null @@ -1,67 +0,0 @@ -#!/usr/bin/bash - -# Copyright (c) 2024 ISCAS .ALL rights reserved. -# This program is licensed under Mulan PSL v2. -# You can use it according to the terms and conditions of the Mulan PSL v2. -# http://license.coscl.org.cn/MulanPSL2 -# THIS PROGRAM IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, -# EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, -# MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. -# See the Mulan PSL v2 for more details. - -# ############################################# -# @Author : honghua -# @Contact : honghua@iscas.ac.cn -# @Date : 2025-11-27 -# @License : Mulan PSL v2 -# @Desc : 测试 ps4pdf 命令的 --version 参数 -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - - # 检查是否已安装texlive-pst-pdf软件包 - LOG_INFO "检查是否已安装texlive-pst-pdf软件包" - rpm -q texlive-pst-pdf > /dev/null 2>&1 - if [ $? -eq 0 ]; then - LOG_INFO "texlive-pst-pdf已安装,脚本结束时将保持安装状态" - installed=true - else - LOG_INFO "texlive-pst-pdf未安装,将在测试结束后卸载" - installed=false - fi - - # 检查yum源中是否有texlive-pst-pdf软件包 - LOG_INFO "检查yum源中是否有texlive-pst-pdf软件包" - dnf list available texlive-pst-pdf > /dev/null 2>&1 - if [ $? -ne 0 ]; then - LOG_ERROR "yum源中未找到texlive-pst-pdf软件包" - exit 255 - fi - - # 安装texlive-pst-pdf软件包 - if ! $installed; then - LOG_INFO "正在安装texlive-pst-pdf软件包" - dnf install -y texlive-pst-pdf > /dev/null 2>&1 - CHECK_RESULT $? 0 0 "安装texlive-pst-pdf失败" - fi - - # 测试ps4pdf命令的--version参数 - LOG_INFO "测试ps4pdf命令的--version参数" - ps4pdf --version > /dev/null 2>&1 - CHECK_RESULT $? 0 0 "ps4pdf命令不支持--version参数" - - # 清理环境:如果脚本开始时未安装texlive-pst-pdf,则卸载 - if ! $installed; then - LOG_INFO "正在卸载texlive-pst-pdf软件包" - dnf remove -y texlive-psd-psf > /dev/null 2>&1 - CHECK_RESULT $? 0 0 “卸载texlve- psd- ps f失败” - fi - - LOG_INFO “测试完成” - exit 0 - -} - -main "$@" \ No newline at end of file diff --git a/testcases/function_test/pkg_test/texlive-base/texlive-pst-pdf/test_texlive-pst-pdf_ps4pdf__xelatex.sh b/testcases/function_test/pkg_test/texlive-base/texlive-pst-pdf/test_texlive-pst-pdf_ps4pdf__xelatex.sh deleted file mode 100644 index 3acf1a1a09e..00000000000 --- a/testcases/function_test/pkg_test/texlive-base/texlive-pst-pdf/test_texlive-pst-pdf_ps4pdf__xelatex.sh +++ /dev/null @@ -1,67 +0,0 @@ -#!/usr/bin/bash - -# Copyright (c) 2024 ISCAS .ALL rights reserved. -# This program is licensed under Mulan PSL v2. -# You can use it according to the terms and conditions of the Mulan PSL v2. -# http://license.coscl.org.cn/MulanPSL2 -# THIS PROGRAM IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, -# EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, -# MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. -# See the Mulan PSL v2 for more details. - -# ############################################# -# @Author : honghua -# @Contact : honghua@iscas.ac.cn -# @Date : 2025-11-27 -# @License : Mulan PSL v2 -# @Desc : 测试 ps4pdf 命令的 --xelatex 参数 -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - LOG_INFO "开始测试 ps4pdf 命令的 --xelatex 参数" - - # 检查是否已安装 texlive-pst-pdf 软件包 - LOG_INFO "检查 texlive-pst-pdf 是否已安装" - if dnf list installed texlive-pst-pdf &>/dev/null; then - LOG_INFO "texlive-pst-pdf 已安装" - installed=true - else - LOG_INFO "texlive-pst-pdf 未安装" - installed=false - fi - - # 检查 yum 源中是否有 texlive-pst-pdf 软件包 - LOG_INFO "检查 yum 源中是否有 texlive-pst-pdf" - if ! dnf list available texlive-pst-pdf &>/dev/null; then - LOG_ERROR "yum 源中未找到 texlive-pst-pdf 软件包" - exit 255 - fi - - # 如果未安装,则安装 texlive-pst-pdf - if [ "$installed" = false ]; then - LOG_INFO "开始安装 texlive-pst-pdf" - dnf install -y texlive-pst-pdf - CHECK_RESULT $? 0 0 "安装 texlive-pst-pdf 失败" - fi - - # 检查 ps4pdf 命令是否支持 --xelatex 参数 - LOG_INFO "检查 ps4pdf --xelatex 参数是否支持" - if ! ps4pdf --help | grep -q -- "--xelatex"; then - LOG_ERROR "ps4pdf 命令不支持 --xelatex 参数" - exit 255 - fi - - # 执行 ps4pdf --xelatex 命令测试 - LOG_INFO "执行 ps4pdf --xelatex 测试" - ps4pdf --xelatex test.tex - CHECK_RESULT $? 0 0 "ps4pdf --xelatex test.tex执行失败" - - # 清理环境:如果最初未安装,则卸载 texlive-pst-pdf - if [ "$installed" = false ]; then - LOG_INFO "清理环境:卸载 texlive-pst-pdf" - dnf remove -y texlive -} - -main "$@" \ No newline at end of file diff --git a/testcases/function_test/pkg_test/texlive-split-a/texlive-apptools/test_texlive-apptools_function_basic.sh b/testcases/function_test/pkg_test/texlive-split-a/texlive-apptools/test_texlive-apptools_function_basic.sh deleted file mode 100644 index 30947560abf..00000000000 --- a/testcases/function_test/pkg_test/texlive-split-a/texlive-apptools/test_texlive-apptools_function_basic.sh +++ /dev/null @@ -1,65 +0,0 @@ -#!/usr/bin/bash - -# Copyright (c) 2024 ISCAS .ALL rights reserved. -# This program is licensed under Mulan PSL v2. -# You can use it according to the terms and conditions of the Mulan PSL v2. -# http://license.coscl.org.cn/MulanPSL2 -# THIS PROGRAM IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, -# EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, -# MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. -# See the Mulan PSL v2 for more details. - -# ############################################# -# @Author : honghua -# @Contact : honghua@iscas.ac.cn -# @Date : 2025-11-25 -# @License : Mulan PSL v2 -# @Desc : Test basic functionality of texlive-apptools -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - - # 检查texlive-apptools是否已安装 - LOG_INFO "检查texlive-apptools是否已安装" - if dnf list installed texlive-apptools &> /dev/null; then - LOG_INFO "texlive-apptools已安装,跳过安装步骤" - INSTALLED=true - else - LOG_INFO "texlive-apptools未安装,准备安装" - INSTALLED=false - fi - - # 检查yum源中是否有texlive-apptools软件包 - LOG_INFO "检查yum源中是否有texlive-apptools软件包" - if ! dnf list available texlive-apptools &> /dev/null; then - LOG_ERROR "yum源中未找到texlive-apptools软件包" - exit 255 - fi - - # 如果未安装,则安装texlive-apptools - if [ "$INSTALLED" = false ]; then - LOG_INFO "开始安装texlive-apptools" - dnf install -y texlive-apptools - CHECK_RESULT $? 0 0 "安装texlive-apptools失败" - fi - - # 测试基本功能 - LOG_INFO "测试texlive-apptools基本功能" - command_to_test="some_texlive_command" # 替换为实际命令 - $command_to_test - CHECK_RESULT $? 0 0 "$command_to_test执行失败" - - # 清理环境:如果脚本开始时未安装,则卸载软件包 - if [ "$INSTALLED" = false ]; then - LOG_INFO "卸载texlive-apptools" - dnf remove -y texlive-apptools - CHECK_RESULT $? 0 0 "卸载texlive-apptools失败" - fi - - LOG_INFO "测试完成,环境已恢复" - -} - -main "$@" \ No newline at end of file diff --git a/testcases/function_test/pkg_test/texlive-split-a/texlive-apptools/test_texlive-apptools_function_basic_cmd.sh b/testcases/function_test/pkg_test/texlive-split-a/texlive-apptools/test_texlive-apptools_function_basic_cmd.sh deleted file mode 100644 index 34b483f6c12..00000000000 --- a/testcases/function_test/pkg_test/texlive-split-a/texlive-apptools/test_texlive-apptools_function_basic_cmd.sh +++ /dev/null @@ -1,129 +0,0 @@ -#!/usr/bin/bash - -# Copyright (c) 2024 ISCAS .ALL rights reserved. -# This program is licensed under Mulan PSL v2. -# You can use it according to the terms and conditions of the Mulan PSL v2. -# http://license.coscl.org.cn/MulanPSL2 -# THIS PROGRAM IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, -# EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, -# MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. -# See the Mulan PSL v2 for more details. - -# ############################################# -# @Author : honghua -# @Contact : honghua@iscas.ac.cn -# @Date : 2026-02-19 -# @License : Mulan PSL v2 -# @Desc : Test execution of basic provided commands -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - # 测试脚本:测试TeX Live应用工具基本命令功能 - - LOG_INFO "开始测试TeX Live应用工具基本命令执行功能" - - # 环境检查:检查是否已安装texlive-apptools - LOG_INFO "步骤1:检查texlive-apptools是否已安装" - if dnf list installed texlive-apptools &>/dev/null; then - LOG_INFO "texlive-apptools已安装,标记为已存在" - PACKAGE_INSTALLED="true" - else - LOG_INFO "texlive-apptools未安装,标记为未安装" - PACKAGE_INSTALLED="false" - fi - - # 检查yum源中是否有texlive-apptools包 - LOG_INFO "步骤2:检查yum源中是否有texlive-apptools包" - if ! dnf list available texlive-apptools &>/dev/null; then - LOG_ERROR "yum源中未找到texlive-apptools包" - exit 255 - fi - - # 如果未安装,则安装软件包 - if [ "$PACKAGE_INSTALLED" = "false" ]; then - LOG_INFO "步骤3:安装texlive-apptools软件包" - dnf install -y texlive-apptools - CHECK_RESULT $? 0 0 "安装texlive-apptools失败" - fi - - # 测试基本命令执行 - LOG_INFO "步骤4:测试基本命令执行" - - # 测试texcount命令 - LOG_INFO "步骤4.1:测试texcount命令" - texcount --version &>/dev/null - CHECK_RESULT $? 0 0 "texcount命令执行失败" - - # 测试texdef命令 - LOG_INFO "步骤4.2:测试texdef命令" - texdef --version &>/dev/null - CHECK_RESULT $? 0 0 "texdef命令执行失败" - - # 测试latex2man命令 - LOG_INFO "步骤4.3:测试latex2man命令" - latex2man --version &>/dev/null - CHECK_RESULT $? 0 0 "latex2man命令执行失败" - - # 测试latexdiff命令 - LOG_INFO "步骤4.4:测试latexdiff命令" - latexdiff --version &>/dev/null - CHECK_RESULT $? 0 0 "latexdiff命令执行失败" - - # 测试latexpand命令 - LOG_INFO "步骤4.5:测试latexpand命令" - latexpand --version &>/dev/null - CHECK_RESULT $? 0 0 "latexpand命令执行失败" - - # 测试参数不存在的情况 - LOG_INFO "步骤5:测试不存在的参数" - texcount --nonexistent-param &>/dev/null - if [ $? -ne 255 ] && [ $? -ne 1 ]; then - LOG_ERROR "参数检查失败,应返回255或1" - exit 255 - fi - - # 测试不支持的参数 - LOG_INFO "步骤6:测试不支持的参数" - texdef --unsupported-option &>/dev/null - if [ $? -ne 255 ] && [ $? -ne 1 ]; then - LOG_ERROR "参数检查失败,应返回255或1" - exit 255 - fi - - # 创建测试文件用于命令测试 - LOG_INFO "步骤7:创建测试文件用于命令测试" - TEST_FILE="/tmp/test_texlive.tex" - cat > "$TEST_FILE" << "EOF" - \documentclass{article} - \begin{document} - Hello, TeX Live! - \end{document} - EOF - CHECK_RESULT $? 0 0 "创建测试文件失败" - - # 测试实际命令功能 - LOG_INFO "步骤8:测试texcount对文件计数功能" - texcount "$TEST_FILE" &>/dev/null - CHECK_RESULT $? 0 0 "texcount文件计数失败" - - # 清理测试文件 - LOG_INFO "步骤9:清理测试文件" - rm -f "$TEST_FILE" - CHECK_RESULT $? 0 0 "清理测试文件失败" - - # 环境恢复 - LOG_INFO "步骤10:环境恢复" - if [ "$PACKAGE_INSTALLED" = "false" ]; then - LOG_INFO "卸载测试安装的texlive-apptools" - dnf remove -y texlive-apptools - CHECK_RESULT $? 0 0 "卸载texlive-apptools失败" - else - LOG_INFO "保持texlive-apptools安装状态" - fi - - LOG_INFO "测试完成:TeX Live应用工具基本命令执行功能测试通过" -} - -main "$@" \ No newline at end of file diff --git a/testcases/function_test/pkg_test/texlive-split-a/texlive-apptools/test_texlive-apptools_function_help.sh b/testcases/function_test/pkg_test/texlive-split-a/texlive-apptools/test_texlive-apptools_function_help.sh deleted file mode 100644 index cf97e59bc0a..00000000000 --- a/testcases/function_test/pkg_test/texlive-split-a/texlive-apptools/test_texlive-apptools_function_help.sh +++ /dev/null @@ -1,75 +0,0 @@ -#!/usr/bin/bash - -# Copyright (c) 2024 ISCAS .ALL rights reserved. -# This program is licensed under Mulan PSL v2. -# You can use it according to the terms and conditions of the Mulan PSL v2. -# http://license.coscl.org.cn/MulanPSL2 -# THIS PROGRAM IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, -# EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, -# MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. -# See the Mulan PSL v2 for more details. - -# ############################################# -# @Author : honghua -# @Contact : honghua@iscas.ac.cn -# @Date : 2026-02-19 -# @License : Mulan PSL v2 -# @Desc : Test displaying help or usage information -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - LOG_INFO "开始测试:显示帮助或使用信息" - LOG_INFO "步骤1:检查系统中是否已安装texlive-apptools软件包" - if rpm -q texlive-apptools &> /dev/null; then - LOG_INFO "texlive-apptools已安装,测试后保持安装状态" - INSTALLED=1 - else - LOG_INFO "texlive-apptools未安装,将在测试过程中安装" - INSTALLED=0 - fi - - LOG_INFO "步骤2:检查yum源中是否有texlive-apptools软件包" - if dnf list available texlive-apptools &> /dev/null; then - LOG_INFO "yum源中存在texlive-apptools软件包" - else - LOG_ERROR "yum源中不存在texlive-apptools软件包" - exit 255 - fi - - if [ $INSTALLED -eq 0 ]; then - LOG_INFO "步骤3:安装texlive-apptools软件包" - dnf install -y texlive-apptools - CHECK_RESULT $? 0 0 "安装texlive-apptools失败" - fi - - LOG_INFO "步骤4:测试texlive-apptools的help参数" - texlive-apptools --help - CHECK_RESULT $? 0 0 "texlive-apptools --help执行失败" - - LOG_INFO "步骤5:测试texlive-apptools的-h参数" - texlive-apptools -h - CHECK_RESULT $? 0 0 "texlive-apptools -h执行失败" - - LOG_INFO "步骤6:测试不支持的参数" - texlive-apptools --invalid-param 2>/dev/null - if [ $? -eq 255 ]; then - LOG_ERROR "不支持的参数导致退出码255" - exit 255 - fi - CHECK_RESULT $? 1 0 "无效参数未按预期失败" - - LOG_INFO "步骤7:环境恢复" - if [ $INSTALLED -eq 0 ]; then - LOG_INFO "卸载测试安装的texlive-apptools软件包" - dnf remove -y texlive-apptools - CHECK_RESULT $? 0 0 "卸载texlive-apptools失败" - else - LOG_INFO "保持texlive-apptools安装状态" - fi - - LOG_INFO "测试完成" -} - -main "$@" \ No newline at end of file diff --git a/testcases/function_test/pkg_test/texlive-split-a/texlive-apptools/test_texlive-apptools_function_install.sh b/testcases/function_test/pkg_test/texlive-split-a/texlive-apptools/test_texlive-apptools_function_install.sh deleted file mode 100644 index 99beeccff5d..00000000000 --- a/testcases/function_test/pkg_test/texlive-split-a/texlive-apptools/test_texlive-apptools_function_install.sh +++ /dev/null @@ -1,145 +0,0 @@ -#!/usr/bin/bash - -# Copyright (c) 2024 ISCAS .ALL rights reserved. -# This program is licensed under Mulan PSL v2. -# You can use it according to the terms and conditions of the Mulan PSL v2. -# http://license.coscl.org.cn/MulanPSL2 -# THIS PROGRAM IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, -# EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, -# MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. -# See the Mulan PSL v2 for more details. - -# ############################################# -# @Author : honghua -# @Contact : honghua@iscas.ac.cn -# @Date : 2026-02-19 -# @License : Mulan PSL v2 -# @Desc : Test installation of texlive-apptools package -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - # 设置环境变量和常量 - TEST_PKG="texlive-apptools" - LOG_FILE="/tmp/test_texlive_apptools.log" - - # 清理日志文件 - > "$LOG_FILE" - - # 函数:检查包是否在yum源中 - check_package_in_repo() { - LOG_INFO "检查yum源中是否存在 $TEST_PKG 软件包" - dnf list available "$TEST_PKG" &>/dev/null - if [ $? -ne 0 ]; then - LOG_ERROR "yum源中不存在 $TEST_PKG 软件包" - exit 255 - fi - LOG_INFO "yum源中存在 $TEST_PKG 软件包" - } - - # 函数:检查命令参数 - check_command_parameters() { - LOG_INFO "检查命令参数是否支持" - # 这里可以根据实际需要检查特定命令的参数 - # 示例:检查dnf命令是否支持install参数 - dnf --help | grep -q "install" - if [ $? -ne 0 ]; then - LOG_ERROR "dnf命令不支持install参数" - exit 255 - fi - LOG_INFO "命令参数检查通过" - } - - # 函数:检查是否已安装 - check_installed() { - LOG_INFO "检查 $TEST_PKG 是否已安装" - rpm -q "$TEST_PKG" &>/dev/null - return $? - } - - # 函数:安装软件包 - install_package() { - LOG_INFO "开始安装 $TEST_PKG" - dnf install -y "$TEST_PKG" - CHECK_RESULT $? 0 0 "安装 $TEST_PKG 失败" - LOG_INFO "安装 $TEST_PKG 成功" - } - - # 函数:卸载软件包 - uninstall_package() { - LOG_INFO "开始卸载 $TEST_PKG" - dnf remove -y "$TEST_PKG" - CHECK_RESULT $? 0 0 "卸载 $TEST_PKG 失败" - LOG_INFO "卸载 $TEST_PKG 成功" - } - - # 函数:测试软件包功能 - test_package_function() { - LOG_INFO "测试 $TEST_PKG 基本功能" - # 这里可以根据实际需要添加功能测试 - # 示例:检查texlive-apptools相关命令是否存在 - which texdoc &>/dev/null - CHECK_RESULT $? 0 0 "texdoc命令不存在" - LOG_INFO "$TEST_PKG 基本功能测试通过" - } - - # 主测试流程 - main() { - LOG_INFO "开始测试:Test installation of texlive-apptools package" - - # 步骤1:检查yum源中是否存在该软件包 - check_package_in_repo - - # 步骤2:检查命令参数 - check_command_parameters - - # 步骤3:检查是否已安装 - local was_installed=false - if check_installed; then - LOG_INFO "$TEST_PKG 已经安装" - was_installed=true - else - LOG_INFO "$TEST_PKG 未安装" - was_installed=false - fi - - # 步骤4:如果未安装,则安装软件包 - if ! $was_installed; then - install_package - fi - - # 步骤5:测试软件包功能 - test_package_function - - # 步骤6:环境清理 - LOG_INFO "开始环境清理" - if ! $was_installed; then - uninstall_package - # 验证卸载是否成功 - check_installed - CHECK_RESULT $? 1 0 "卸载后验证失败" - LOG_INFO "环境清理完成:已卸载 $TEST_PKG" - else - LOG_INFO "环境清理:保持 $TEST_PKG 安装状态" - fi - - LOG_INFO "测试完成:Test installation of texlive-apptools package" - } - - # 异常处理 - trap "LOG_ERROR "测试脚本执行异常"; exit 1" ERR - - # 执行主函数 - main - - # 记录最终状态 - if [ $? -eq 0 ]; then - LOG_INFO "测试脚本执行成功" - else - LOG_ERROR "测试脚本执行失败" - exit 1 - fi -} - -main "$@" \ No newline at end of file diff --git a/testcases/function_test/pkg_test/texlive-split-a/texlive-apptools/test_texlive-apptools_function_uninstall.sh b/testcases/function_test/pkg_test/texlive-split-a/texlive-apptools/test_texlive-apptools_function_uninstall.sh deleted file mode 100644 index 4a1e52d3158..00000000000 --- a/testcases/function_test/pkg_test/texlive-split-a/texlive-apptools/test_texlive-apptools_function_uninstall.sh +++ /dev/null @@ -1,82 +0,0 @@ -#!/usr/bin/bash - -# Copyright (c) 2024 ISCAS .ALL rights reserved. -# This program is licensed under Mulan PSL v2. -# You can use it according to the terms and conditions of the Mulan PSL v2. -# http://license.coscl.org.cn/MulanPSL2 -# THIS PROGRAM IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, -# EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, -# MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. -# See the Mulan PSL v2 for more details. - -# ############################################# -# @Author : honghua -# @Contact : honghua@iscas.ac.cn -# @Date : 2026-02-19 -# @License : Mulan PSL v2 -# @Desc : Test uninstallation of texlive-apptools package -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - set -e - - LOG_INFO "开始测试:卸载 texlive-apptools 软件包" - - LOG_INFO "步骤1:检查 yum 源中是否存在 texlive-apptools 软件包" - if ! dnf list available texlive-apptools &> /dev/null; then - LOG_ERROR "yum 源中未找到 texlive-apptools 软件包" - exit 255 - fi - LOG_INFO "yum 源中存在 texlive-apptools 软件包" - - LOG_INFO "步骤2:检查当前环境是否已安装 texlive-apptools" - if rpm -q texlive-apptools &> /dev/null; then - LOG_INFO "当前环境已安装 texlive-apptools,测试结束后将保持安装状态" - INSTALLED_BEFORE=true - else - LOG_INFO "当前环境未安装 texlive-apptools,将先安装再卸载" - INSTALLED_BEFORE=false - fi - - if [ "$INSTALLED_BEFORE" = "false" ]; then - LOG_INFO "步骤3:安装 texlive-apptools 软件包" - dnf install -y texlive-apptools - CHECK_RESULT $? 0 0 "安装 texlive-apptools 失败" - LOG_INFO "安装 texlive-apptools 成功" - fi - - LOG_INFO "步骤4:验证 texlive-apptools 命令是否可用" - if ! command -v tex &> /dev/null; then - LOG_ERROR "tex 命令不存在" - exit 255 - fi - LOG_INFO "tex 命令可用" - - LOG_INFO "步骤5:执行卸载 texlive-apptools 软件包" - dnf remove -y texlive-apptools - CHECK_RESULT $? 0 0 "卸载 texlive-apptools 失败" - LOG_INFO "卸载 texlive-apptools 成功" - - LOG_INFO "步骤6:验证 texlive-apptools 是否已卸载" - if rpm -q texlive-apptools &> /dev/null; then - LOG_ERROR "卸载后 texlive-apptools 仍然存在" - exit 1 - fi - LOG_INFO "验证通过,texlive-apptools 已卸载" - - LOG_INFO "步骤7:环境恢复" - if [ "$INSTALLED_BEFORE" = "false" ]; then - LOG_INFO "测试前未安装,无需恢复" - else - LOG_INFO "测试前已安装,重新安装 texlive-apptools" - dnf install -y texlive-apptools - CHECK_RESULT $? 0 0 "重新安装 texlive-apptools 失败" - LOG_INFO "重新安装 texlive-apptools 成功" - fi - - LOG_INFO "测试完成:卸载 texlive-apptools 软件包功能正常" -} - -main "$@" \ No newline at end of file diff --git a/testcases/function_test/pkg_test/texlive-split-a/texlive-apptools/test_texlive-apptools_function_version.sh b/testcases/function_test/pkg_test/texlive-split-a/texlive-apptools/test_texlive-apptools_function_version.sh deleted file mode 100644 index d37bcc0ad05..00000000000 --- a/testcases/function_test/pkg_test/texlive-split-a/texlive-apptools/test_texlive-apptools_function_version.sh +++ /dev/null @@ -1,62 +0,0 @@ -#!/usr/bin/bash - -# Copyright (c) 2024 ISCAS .ALL rights reserved. -# This program is licensed under Mulan PSL v2. -# You can use it according to the terms and conditions of the Mulan PSL v2. -# http://license.coscl.org.cn/MulanPSL2 -# THIS PROGRAM IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, -# EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, -# MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. -# See the Mulan PSL v2 for more details. - -# ############################################# -# @Author : honghua -# @Contact : honghua@iscas.ac.cn -# @Date : 2026-02-19 -# @License : Mulan PSL v2 -# @Desc : Test checking version of texlive-apptools -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - LOG_INFO "测试开始:检查 texlive-apptools 版本" - LOG_INFO "步骤1:检查是否已安装 texlive-apptools" - if dnf list installed texlive-apptools &>/dev/null; then - LOG_INFO "texlive-apptools 已安装,跳过安装步骤" - INSTALLED_BEFORE=true - else - LOG_INFO "texlive-apptools 未安装,将进行安装测试" - INSTALLED_BEFORE=false - fi - LOG_INFO "步骤2:检查 yum 源中是否有 texlive-apptools 软件包" - if ! dnf list available texlive-apptools &>/dev/null; then - LOG_ERROR "yum 源中未找到 texlive-apptools 软件包" - exit 255 - fi - if [ "$INSTALLED_BEFORE" = false ]; then - LOG_INFO "步骤3:安装 texlive-apptools 软件包" - dnf install -y texlive-apptools - CHECK_RESULT $? 0 0 "安装 texlive-apptools 失败" - fi - LOG_INFO "步骤4:检查 texlive-apptools 版本命令" - VERSION_CMD="texlive-apptools --version" - if ! command -v texlive-apptools &>/dev/null; then - LOG_ERROR "texlive-apptools 命令不存在" - exit 255 - fi - LOG_INFO "步骤5:执行版本检查命令" - $VERSION_CMD - CHECK_RESULT $? 0 0 "执行 texlive-apptools --version 失败" - LOG_INFO "步骤6:清理环境" - if [ "$INSTALLED_BEFORE" = false ]; then - LOG_INFO "卸载 texlive-apptools 软件包" - dnf remove -y texlive-apptools - CHECK_RESULT $? 0 0 "卸载 texlive-apptools 失败" - else - LOG_INFO "测试前已安装 texlive-apptools,保持安装状态" - fi - LOG_INFO "测试完成:检查 texlive-apptools 版本" -} - -main "$@" \ No newline at end of file diff --git a/testcases/function_test/pkg_test/texlive-split-d/texlive-canoniclayout/test_texlive-canoniclayout_function_usage.sh b/testcases/function_test/pkg_test/texlive-split-d/texlive-canoniclayout/test_texlive-canoniclayout_function_usage.sh deleted file mode 100644 index bd452a81dec..00000000000 --- a/testcases/function_test/pkg_test/texlive-split-d/texlive-canoniclayout/test_texlive-canoniclayout_function_usage.sh +++ /dev/null @@ -1,139 +0,0 @@ -#!/usr/bin/bash - -# Copyright (c) 2024 ISCAS .ALL rights reserved. -# This program is licensed under Mulan PSL v2. -# You can use it according to the terms and conditions of the Mulan PSL v2. -# http://license.coscl.org.cn/MulanPSL2 -# THIS PROGRAM IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, -# EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, -# MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. -# See the Mulan PSL v2 for more details. - -# ############################################# -# @Author : honghua -# @Contact : honghua@iscas.ac.cn -# @Date : 2026-03-13 -# @License : Mulan PSL v2 -# @Desc : Test basic package usage in TeX -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - # 测试TeX基本包使用功能 - - LOG_INFO "==========开始测试TeX基本包使用功能==========" - - # 检查环境是否已安装texlive-canoniclayout - LOG_INFO "步骤1:检查texlive-canoniclayout是否已安装" - if dnf list installed texlive-canoniclayout >/dev/null 2>&1; then - LOG_INFO "texlive-canoniclayout已安装,测试结束后保持安装状态" - already_installed=true - else - LOG_INFO "texlive-canoniclayout未安装,将在测试中安装" - already_installed=false - fi - - # 检查yum源中是否有texlive-canoniclayout软件包 - LOG_INFO "步骤2:检查yum源中是否有texlive-canoniclayout软件包" - if ! dnf list available texlive-canoniclayout >/dev/null 2>&1; then - LOG_ERROR "yum源中未找到texlive-canoniclayout软件包" - exit 255 - fi - - # 如果未安装,则安装软件包 - if [ "$already_installed" = false ]; then - LOG_INFO "步骤3:安装texlive-canoniclayout软件包" - dnf install -y texlive-canoniclayout - CHECK_RESULT $? 0 0 "安装texlive-canoniclayout失败" - fi - - # 测试tex命令基本功能 - LOG_INFO "步骤4:测试tex命令基本功能" - tex --version >/dev/null 2>&1 - CHECK_RESULT $? 0 0 "tex命令无法执行" - - # 测试latex命令基本功能 - LOG_INFO "步骤5:测试latex命令基本功能" - latex --version >/dev/null 2>&1 - CHECK_RESULT $? 0 0 "latex命令无法执行" - - # 测试pdflatex命令基本功能 - LOG_INFO "步骤6:测试pdflatex命令基本功能" - pdflatex --version >/dev/null 2>&1 - CHECK_RESULT $? 0 0 "pdflatex命令无法执行" - - # 测试bibtex命令基本功能 - LOG_INFO "步骤7:测试bibtex命令基本功能" - bibtex --version >/dev/null 2>&1 - CHECK_RESULT $? 0 0 "bibtex命令无法执行" - - # 测试makeindex命令基本功能 - LOG_INFO "步骤8:测试makeindex命令基本功能" - makeindex --version >/dev/null 2>&1 - CHECK_RESULT $? 0 0 "makeindex命令无法执行" - - # 测试dvips命令基本功能 - LOG_INFO "步骤9:测试dvips命令基本功能" - dvips --version >/dev/null 2>&1 - CHECK_RESULT $? 0 0 "dvips命令无法执行" - - # 测试ps2pdf命令基本功能 - LOG_INFO "步骤10:测试ps2pdf命令基本功能" - ps2pdf --version >/dev/null 2>&1 - CHECK_RESULT $? 0 0 "ps2pdf命令无法执行" - - # 测试不支持的命令参数 - LOG_INFO "步骤11:测试不支持的命令参数处理" - tex --nonexistent-option >/dev/null 2>&1 - if [ $? -eq 255 ]; then - LOG_ERROR "tex命令不支持指定的参数" - exit 255 - fi - - # 创建简单的TeX测试文件 - LOG_INFO "步骤12:创建简单的TeX测试文件" - TEST_FILE="test_tex.tex" - cat > "$TEST_FILE" << "EOF" - \documentclass{article} - \begin{document} - Hello, TeX World! - \end{document} - EOF - CHECK_RESULT $? 0 0 "创建TeX测试文件失败" - - # 编译TeX文件 - LOG_INFO "步骤13:编译TeX测试文件" - pdflatex -interaction=nonstopmode "$TEST_FILE" >/dev/null 2>&1 - CHECK_RESULT $? 0 0 "编译TeX文件失败" - - # 检查生成的PDF文件 - LOG_INFO "步骤14:检查生成的PDF文件" - if [ -f "test_tex.pdf" ]; then - LOG_INFO "成功生成PDF文件" - file test_tex.pdf | grep -q "PDF document" - CHECK_RESULT $? 0 0 "生成的PDF文件格式不正确" - else - LOG_ERROR "未生成PDF文件" - exit 1 - fi - - # 清理测试文件 - LOG_INFO "步骤15:清理测试生成的文件" - rm -f test_tex.aux test_tex.log test_tex.out test_tex.pdf "$TEST_FILE" - CHECK_RESULT $? 0 0 "清理测试文件失败" - - # 环境恢复 - LOG_INFO "步骤16:环境恢复" - if [ "$already_installed" = false ]; then - LOG_INFO "卸载测试安装的texlive-canoniclayout软件包" - dnf remove -y texlive-canoniclayout - CHECK_RESULT $? 0 0 "卸载texlive-canoniclayout失败" - else - LOG_INFO "保持texlive-canoniclayout安装状态" - fi - - LOG_INFO "==========TeX基本包使用功能测试完成==========" -} - -main "$@" \ No newline at end of file diff --git a/testcases/function_test/pkg_test/texlive-split-h/texlive-ecclesiastic/test_texlive-ecclesiastic_function_install.sh b/testcases/function_test/pkg_test/texlive-split-h/texlive-ecclesiastic/test_texlive-ecclesiastic_function_install.sh deleted file mode 100644 index f1d8923f6d5..00000000000 --- a/testcases/function_test/pkg_test/texlive-split-h/texlive-ecclesiastic/test_texlive-ecclesiastic_function_install.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-09-30 -# @License : Mulan PSL v2 -# @Desc : Test package installation -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - - # 检查texlive-ecclesiastic软件包是否已安装 - LOG_INFO "检查texlive-ecclesiastic软件包是否已安装" - rpm -q texlive-ecclesiastic - if [ $? -eq 0 ]; then - LOG_INFO "texlive-ecclesiastic已安装,跳过安装步骤" - installed=true - else - installed=false - fi - - # 检查yum源中是否存在texlive-ecclesiastic软件包 - LOG_INFO "检查yum源中是否存在texlive-ecclesiastic软件包" - dnf list available texlive-ecclesiastic > /dev/null 2>&1 - CHECK_RESULT $? 0 255 "yum源中不存在texlive-ecclesiastic软件包" - - # 安装texlive-ecclesiastic软件包 - if [ "$installed" = false ]; then - LOG_INFO "开始安装texlive-ecclesiastic软件包" - dnf install -y texlive-ecclesiastic - CHECK_RESULT $? 0 0 "安装texlive-ecclesiastic软件包失败" - fi - - # 测试texlive-ecclesiastic功能 - LOG_INFO "测试texlive-ecclesiastic功能" - command_to_test="some_tex_command" # 替换为实际需要测试的命令 - $command_to_test > /dev/null 2>&1 - CHECK_RESULT $? 0 255 "texlive-ecclesiastic功能测试失败" - - # 如果脚本开始时未安装,则在结束时卸载软件包 - if [ "$installed" = false ]; then - LOG_INFO "卸载texlive-ecclesiastic软件包" - dnf remove -y texlive-ecclesiastic - CHECK_RESULT $? 0 0 "卸载texlive-ecclesiastic软件包失败" - fi - - LOG_INFO "测试完成,环境已恢复" - -} - -main "$@" \ No newline at end of file diff --git a/testcases/function_test/pkg_test/texlive-split-n/texlive-ladder/test_texlive-ladder_function_basic.sh b/testcases/function_test/pkg_test/texlive-split-n/texlive-ladder/test_texlive-ladder_function_basic.sh deleted file mode 100644 index 4dbfa4f6490..00000000000 --- a/testcases/function_test/pkg_test/texlive-split-n/texlive-ladder/test_texlive-ladder_function_basic.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-10-01 -# @License : Mulan PSL v2 -# @Desc : Test basic command usage -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - LOG_INFO "开始测试:Test basic command usage" - - # 检查是否已安装texlive-ladder - LOG_INFO "检查是否已安装texlive-ladder" - dnf list installed texlive-ladder > /dev/null 2>&1 - if [ $? -eq 0 ]; then - LOG_INFO "texlive-ladder已安装,脚本结束后将保持安装状态" - INSTALLED=true - else - LOG_INFO "texlive-ladder未安装,将在测试结束后卸载" - INSTALLED=false - fi - - # 检查yum源中是否有texlive-ladder - LOG_INFO "检查yum源中是否有texlive-ladder" - dnf list available texlive-ladder > /dev/null 2>&1 - CHECK_RESULT $? 0 255 "yum源中未找到texlive-ladder软件包" - - # 安装texlive-ladder - if [ "$INSTALLED" = false ]; then - LOG_INFO "开始安装texlive-ladder" - dnf install -y texlive-ladder > /dev/null 2>&1 - CHECK_RESULT $? 0 0 "安装texlive-ladder失败" - fi - - # 测试基本命令用法 - LOG_INFO "测试基本命令用法" - texlive-ladder --help > /dev/null 2>&1 - CHECK_RESULT $? 0 255 "texlive-ladder命令不支持--help参数" - - # 清理环境 - if [ "$INSTALLED" = false ]; then - LOG_INFO "卸载texlive-ladder" - dnf remove -y texlive-ladder > /dev/null 2>&1 - CHECK_RESULT $? 0 0 "卸载texlive-ladder失败" - fi - - LOG_INFO "测试完成:Test basic command usage" -} - -main "$@" \ No newline at end of file diff --git a/testcases/function_test/pkg_test/texlive-split-n/texlive-ladder/test_texlive-ladder_function_install.sh b/testcases/function_test/pkg_test/texlive-split-n/texlive-ladder/test_texlive-ladder_function_install.sh deleted file mode 100644 index 8f3ebffd239..00000000000 --- a/testcases/function_test/pkg_test/texlive-split-n/texlive-ladder/test_texlive-ladder_function_install.sh +++ /dev/null @@ -1,64 +0,0 @@ -#!/usr/bin/bash - -# Copyright (c) 2024 ISCAS .ALL rights reserved. -# This program is licensed under Mulan PSL v2. -# You can use it according to the terms and conditions of the Mulan PSL v2. -# http://license.coscl.org.cn/MulanPSL2 -# THIS PROGRAM IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, -# EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, -# MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. -# See the Mulan PSL v2 for more details. - -# ############################################# -# @Author : honghua -# @Contact : honghua@iscas.ac.cn -# @Date : 2025-10-01 -# @License : Mulan PSL v2 -# @Desc : Test package installation -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - LOG_INFO "开始测试:Test package installation" - - # 检查是否已经安装texlive-ladder软件包 - LOG_INFO "检查是否已经安装texlive-ladder软件包" - dnf list installed texlive-ladder > /dev/null 2>&1 - if [ $? -eq 0 ]; then - LOG_INFO "texlive-ladder软件包已安装,测试将保持安装状态" - installed=true - else - LOG_INFO "texlive-ladder软件包未安装,测试将进行安装和卸载" - installed=false - fi - - # 检查yum源中是否有texlive-ladder软件包 - LOG_INFO "检查yum源中是否有texlive-ladder软件包" - dnf list available texlive-ladder > /dev/null 2>&1 - CHECK_RESULT $? 0 255 "yum源中不存在texlive-ladder软件包" - - # 安装texlive-ladder软件包 - if [ "$installed" = false ]; then - LOG_INFO "开始安装texlive-ladder软件包" - dnf install -y texlive-ladder > /dev/null 2>&1 - CHECK_RESULT $? 0 0 "安装texlive-ladder软件包失败" - LOG_INFO "texlive-ladder软件包安装成功" - fi - - # 测试texlive-ladder命令功能 - LOG_INFO "测试texlive-ladder命令功能" - texlive-ladder --version > /dev/null 2>&1 - CHECK_RESULT $? 0 255 "texlive-ladder命令参数不支持或不存在" - - # 清理环境,如果之前未安装则卸载 - if [ "$installed" = false ]; then - LOG_INFO "清理环境,卸载texlive-ladder软件包" - dnf remove -y texlive-ladder > /dev/null 2>&1 - CHECK_RESULT $? 0 0 "卸载texlive-ladder软件包失败" - fi - - LOG_INFO "测试完成:Test package installation" -} - -main "$@" \ No newline at end of file diff --git a/testcases/function_test/pkg_test/texlive-split-o/texlive-mceinleger/test_texlive-mceinleger_function_basic_usage.sh b/testcases/function_test/pkg_test/texlive-split-o/texlive-mceinleger/test_texlive-mceinleger_function_basic_usage.sh deleted file mode 100644 index badf27089a8..00000000000 --- a/testcases/function_test/pkg_test/texlive-split-o/texlive-mceinleger/test_texlive-mceinleger_function_basic_usage.sh +++ /dev/null @@ -1,95 +0,0 @@ -#!/usr/bin/bash - -# Copyright (c) 2024 ISCAS .ALL rights reserved. -# This program is licensed under Mulan PSL v2. -# You can use it according to the terms and conditions of the Mulan PSL v2. -# http://license.coscl.org.cn/MulanPSL2 -# THIS PROGRAM IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, -# EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, -# MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. -# See the Mulan PSL v2 for more details. - -# ############################################# -# @Author : honghua -# @Contact : honghua@iscas.ac.cn -# @Date : 2026-03-15 -# @License : Mulan PSL v2 -# @Desc : Test basic LaTeX document compilation using the package -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - LOG_INFO "开始测试LaTeX文档编译基本功能" - - # 检查是否已安装texlive-mceinleger - LOG_INFO "检查texlive-mceinleger是否已安装" - dnf list installed texlive-mceinleger > /dev/null 2>&1 - INSTALLED=$? - - if [ $INSTALLED -eq 0 ]; then - LOG_INFO "texlive-mceinleger已安装,测试完成后将保持安装状态" - NEED_CLEANUP=0 - else - LOG_INFO "texlive-mceinleger未安装,将进行安装测试" - NEED_CLEANUP=1 - fi - - # 检查yum源中是否有该软件包 - LOG_INFO "检查yum源中是否有texlive-mceinleger软件包" - dnf list available texlive-mceinleger > /dev/null 2>&1 - CHECK_RESULT $? 0 0 "yum源中不存在texlive-mceinleger软件包" - if [ $? -ne 0 ]; then - LOG_ERROR "yum源中不存在texlive-mceinleger软件包" - exit 255 - fi - - # 如果未安装,则安装软件包 - if [ $NEED_CLEANUP -eq 1 ]; then - LOG_INFO "安装texlive-mceinleger软件包" - dnf install -y texlive-mceinleger - CHECK_RESULT $? 0 0 "安装texlive-mceinleger失败" - fi - - # 创建测试LaTeX文档 - LOG_INFO "创建测试LaTeX文档" - cat > test_document.tex << "EOF" - \documentclass{article} - \begin{document} - Hello, LaTeX World! - \end{document} - EOF - CHECK_RESULT $? 0 0 "创建测试文档失败" - - # 使用pdflatex编译LaTeX文档 - LOG_INFO "使用pdflatex编译LaTeX文档" - pdflatex test_document.tex - CHECK_RESULT $? 0 0 "LaTeX文档编译失败" - - # 检查生成的PDF文件 - LOG_INFO "检查生成的PDF文件" - if [ -f test_document.pdf ]; then - LOG_INFO "PDF文件生成成功" - file test_document.pdf | grep -q "PDF document" - CHECK_RESULT $? 0 0 "生成的文件不是有效的PDF" - else - LOG_ERROR "未生成PDF文件" - exit 1 - fi - - # 清理测试文件 - LOG_INFO "清理测试文件" - rm -f test_document.tex test_document.aux test_document.log test_document.pdf - CHECK_RESULT $? 0 0 "清理测试文件失败" - - # 如果测试前未安装,则卸载软件包 - if [ $NEED_CLEANUP -eq 1 ]; then - LOG_INFO "卸载texlive-mceinleger软件包" - dnf remove -y texlive-mceinleger - CHECK_RESULT $? 0 0 "卸载texlive-mceinleger失败" - fi - - LOG_INFO "LaTeX文档编译基本功能测试完成" -} - -main "$@" \ No newline at end of file diff --git a/testcases/function_test/pkg_test/texlive-split-o/texlive-mceinleger/test_texlive-mceinleger_function_install.sh b/testcases/function_test/pkg_test/texlive-split-o/texlive-mceinleger/test_texlive-mceinleger_function_install.sh deleted file mode 100644 index 14bdc9e1594..00000000000 --- a/testcases/function_test/pkg_test/texlive-split-o/texlive-mceinleger/test_texlive-mceinleger_function_install.sh +++ /dev/null @@ -1,64 +0,0 @@ -#!/usr/bin/bash - -# Copyright (c) 2024 ISCAS .ALL rights reserved. -# This program is licensed under Mulan PSL v2. -# You can use it according to the terms and conditions of the Mulan PSL v2. -# http://license.coscl.org.cn/MulanPSL2 -# THIS PROGRAM IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, -# EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, -# MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. -# See the Mulan PSL v2 for more details. - -# ############################################# -# @Author : honghua -# @Contact : honghua@iscas.ac.cn -# @Date : 2025-11-26 -# @License : Mulan PSL v2 -# @Desc : Test installation of texlive-mceinleger -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - - # 检查是否已安装texlive-mceinleger - LOG_INFO "检查是否已安装texlive-mceinleger" - rpm -q texlive-mceinleger - if [ $? -eq 0 ]; then - LOG_INFO "texlive-mceinleger已安装,脚本结束后将保持安装状态" - INSTALLED=true - else - LOG_INFO "texlive-mceinleger未安装,将在测试后卸载" - INSTALLED=false - fi - - # 检查yum源中是否有texlive-mceinleger软件包 - LOG_INFO "检查yum源中是否有texlive-mceinleger软件包" - dnf list available texlive-mceinleger - if [ $? -ne 0 ]; then - LOG_ERROR "yum源中未找到texlive-mceinleger软件包" - exit 255 - fi - - # 安装texlive-mceinleger软件包 - LOG_INFO "开始安装texlive-mceinleger软件包" - dnf install -y texlive-mceinleger - CHECK_RESULT $? 0 0 "安装texlive-mceinleger失败" - - # 验证texlive-mceinleger功能 - LOG_INFO "验证texlive-mceinleger功能" - tex --version | grep -q "TeX Live" - CHECK_RESULT $? 0 0 "验证texlive-mceinleger功能失败" - - # 如果测试前未安装,则卸载软件包 - if [ "$INSTALLED" = false ]; then - LOG_INFO "卸载texlive-mceinleger软件包" - dnf remove -y texlive-mceinleger - CHECK_RESULT $? 0 0 "卸载texlive-mceinleger失败" - fi - - LOG_INFO "测试完成,环境已恢复" - -} - -main "$@" \ No newline at end of file diff --git a/testcases/function_test/pkg_test/texlive-split-o/texlive-mceinleger/test_texlive-mceinleger_function_package_removal.sh b/testcases/function_test/pkg_test/texlive-split-o/texlive-mceinleger/test_texlive-mceinleger_function_package_removal.sh deleted file mode 100644 index a9ecce75ef8..00000000000 --- a/testcases/function_test/pkg_test/texlive-split-o/texlive-mceinleger/test_texlive-mceinleger_function_package_removal.sh +++ /dev/null @@ -1,78 +0,0 @@ -#!/usr/bin/bash - -# Copyright (c) 2024 ISCAS .ALL rights reserved. -# This program is licensed under Mulan PSL v2. -# You can use it according to the terms and conditions of the Mulan PSL v2. -# http://license.coscl.org.cn/MulanPSL2 -# THIS PROGRAM IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, -# EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, -# MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. -# See the Mulan PSL v2 for more details. - -# ############################################# -# @Author : honghua -# @Contact : honghua@iscas.ac.cn -# @Date : 2026-03-15 -# @License : Mulan PSL v2 -# @Desc : Test removal/uninstallation of texlive-mceinleger -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - PACKAGE_NAME="texlive-mceinleger" - LOG_INFO "开始测试卸载功能:Test removal/uninstallation of texlive-mceinleger" - - 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 "步骤2: 检查当前环境是否已安装该软件包" - rpm -q ${PACKAGE_NAME} &>/dev/null - INSTALLED=$? - - if [ ${INSTALLED} -eq 0 ]; then - LOG_INFO "软件包 ${PACKAGE_NAME} 已安装,测试结束后将保持安装状态" - NEED_CLEANUP=0 - else - LOG_INFO "软件包 ${PACKAGE_NAME} 未安装,将安装作为测试步骤" - LOG_INFO "步骤3: 安装软件包 ${PACKAGE_NAME}" - dnf install -y ${PACKAGE_NAME} - CHECK_RESULT $? 0 0 "安装软件包 ${PACKAGE_NAME} 失败" - NEED_CLEANUP=1 - fi - - LOG_INFO "步骤4: 验证软件包已正确安装" - rpm -q ${PACKAGE_NAME} - CHECK_RESULT $? 0 0 "软件包 ${PACKAGE_NAME} 未正确安装" - - LOG_INFO "步骤5: 执行卸载操作" - dnf remove -y ${PACKAGE_NAME} - CHECK_RESULT $? 0 0 "卸载软件包 ${PACKAGE_NAME} 失败" - - LOG_INFO "步骤6: 验证软件包已卸载" - rpm -q ${PACKAGE_NAME} - if [ $? -eq 0 ]; then - LOG_ERROR "软件包 ${PACKAGE_NAME} 卸载失败" - exit 1 - else - LOG_INFO "软件包 ${PACKAGE_NAME} 已成功卸载" - fi - - LOG_INFO "步骤7: 环境恢复" - if [ ${NEED_CLEANUP} -eq 1 ]; then - LOG_INFO "测试前未安装,无需恢复安装状态" - else - LOG_INFO "恢复原始安装状态:重新安装软件包 ${PACKAGE_NAME}" - dnf install -y ${PACKAGE_NAME} - CHECK_RESULT $? 0 0 "恢复安装软件包 ${PACKAGE_NAME} 失败" - LOG_INFO "环境已恢复到测试前的安装状态" - fi - - LOG_INFO "测试完成:Test removal/uninstallation of texlive-mceinleger" -} - -main "$@" \ No newline at end of file diff --git a/testcases/function_test/pkg_test/texlive-split-o/texlive-mceinleger/test_texlive-mceinleger_function_verify_content.sh b/testcases/function_test/pkg_test/texlive-split-o/texlive-mceinleger/test_texlive-mceinleger_function_verify_content.sh deleted file mode 100644 index 88dd5f27a5b..00000000000 --- a/testcases/function_test/pkg_test/texlive-split-o/texlive-mceinleger/test_texlive-mceinleger_function_verify_content.sh +++ /dev/null @@ -1,100 +0,0 @@ -#!/usr/bin/bash - -# Copyright (c) 2024 ISCAS .ALL rights reserved. -# This program is licensed under Mulan PSL v2. -# You can use it according to the terms and conditions of the Mulan PSL v2. -# http://license.coscl.org.cn/MulanPSL2 -# THIS PROGRAM IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, -# EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, -# MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. -# See the Mulan PSL v2 for more details. - -# ############################################# -# @Author : honghua -# @Contact : honghua@iscas.ac.cn -# @Date : 2026-03-15 -# @License : Mulan PSL v2 -# @Desc : Verify the package provides expected LaTeX files -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - # 定义日志函数 - LOG_INFO() { - echo "INFO: $1" - } - - LOG_ERROR() { - echo "ERROR: $1" >&2 - } - - # 定义检查结果函数(模拟) - CHECK_RESULT() { - if [ "$1" -ne "$2" ]; then - LOG_ERROR "$4" - exit "$3" - fi - } - - # 定义SSH命令函数(模拟) - SSH_CMD() { - # 这里只是模拟,实际应根据具体实现调整 - sshpass -p "$3" ssh "$4"@"$2" "$1" - } - - # 定义软件包名称 - PACKAGE_NAME="texlive-mceinleger" - - # 步骤1:检查yum源中是否存在指定的软件包 - LOG_INFO "检查yum源中是否存在软件包:$PACKAGE_NAME" - if ! dnf list available "$PACKAGE_NAME" &>/dev/null; then - LOG_ERROR "软件包 $PACKAGE_NAME 在yum源中不存在" - exit 255 - fi - - # 步骤2:检查当前环境是否已经安装该软件包 - LOG_INFO "检查当前环境是否已经安装软件包:$PACKAGE_NAME" - if rpm -q "$PACKAGE_NAME" &>/dev/null; then - LOG_INFO "软件包 $PACKAGE_NAME 已经安装,脚本结束后将保持安装状态" - INSTALLED=true - else - LOG_INFO "软件包 $PACKAGE_NAME 未安装,将在测试步骤中安装" - INSTALLED=false - fi - - # 步骤3:如果未安装,则安装软件包 - if [ "$INSTALLED" = false ]; then - LOG_INFO "安装软件包:$PACKAGE_NAME" - dnf install -y "$PACKAGE_NAME" - CHECK_RESULT $? 0 255 "安装软件包 $PACKAGE_NAME 失败" - fi - - # 步骤4:验证软件包提供的LaTeX文件是否符合预期 - LOG_INFO "验证软件包提供的LaTeX文件是否符合预期" - # 假设预期的文件列表 - EXPECTED_FILES=( - "/usr/share/texlive/texmf-dist/tex/latex/mceinleger/mceinleger.sty" - "/usr/share/texlive/texmf-dist/doc/latex/mceinleger/mceinleger.pdf" - ) - - for file in "${EXPECTED_FILES[@]}"; do - if [ -f "$file" ]; then - LOG_INFO "文件 $file 存在" - else - LOG_ERROR "文件 $file 不存在" - exit 1 - fi - done - - # 步骤5:如果测试过程中安装了软件包,则在脚本结束前卸载 - if [ "$INSTALLED" = false ]; then - LOG_INFO "卸载软件包:$PACKAGE_NAME" - dnf remove -y "$PACKAGE_NAME" - CHECK_RESULT $? 0 1 "卸载软件包 $PACKAGE_NAME 失败" - fi - - LOG_INFO "测试完成,环境已恢复到初始状态" -} - -main "$@" \ No newline at end of file diff --git a/testcases/function_test/pkg_test/texlive-split-v/texlive-steinmetz-doc/test_texlive-steinmetz-doc_function_uninstall.sh b/testcases/function_test/pkg_test/texlive-split-v/texlive-steinmetz-doc/test_texlive-steinmetz-doc_function_uninstall.sh deleted file mode 100644 index 9f6bb29c18a..00000000000 --- a/testcases/function_test/pkg_test/texlive-split-v/texlive-steinmetz-doc/test_texlive-steinmetz-doc_function_uninstall.sh +++ /dev/null @@ -1,122 +0,0 @@ -#!/usr/bin/bash - -# Copyright (c) 2024 ISCAS .ALL rights reserved. -# This program is licensed under Mulan PSL v2. -# You can use it according to the terms and conditions of the Mulan PSL v2. -# http://license.coscl.org.cn/MulanPSL2 -# THIS PROGRAM IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, -# EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-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 : Test package removal -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - # 检查是否以root用户运行 - if [[ $EUID -ne 0 ]]; then - LOG_ERROR "请以root用户运行此脚本" - exit 1 - fi - - # 定义软件包名称 - PACKAGE_NAME="texlive-steinmetz-doc" - - LOG_INFO "=== 开始测试软件包卸载功能 ===" - - # 步骤1:检查yum源中是否存在该软件包 - LOG_INFO "步骤1:检查yum源中是否存在${PACKAGE_NAME}软件包" - dnf list available ${PACKAGE_NAME} > /dev/null 2>&1 - if [ $? -ne 0 ]; then - LOG_ERROR "软件包${PACKAGE_NAME}在yum源中不存在" - exit 255 - fi - LOG_INFO "软件包${PACKAGE_NAME}在yum源中存在" - - # 步骤2:检查当前环境是否已安装该软件包 - LOG_INFO "步骤2:检查当前环境是否已安装${PACKAGE_NAME}软件包" - rpm -q ${PACKAGE_NAME} > /dev/null 2>&1 - INSTALLED=$? - - # 记录初始安装状态 - INITIAL_INSTALL_STATE=$INSTALLED - if [ $INSTALLED -eq 0 ]; then - LOG_INFO "软件包${PACKAGE_NAME}已安装" - NEED_UNINSTALL=false - else - LOG_INFO "软件包${PACKAGE_NAME}未安装" - NEED_UNINSTALL=true - fi - - # 步骤3:如果未安装,则安装软件包作为测试前提 - if [ $NEED_UNINSTALL = true ]; then - LOG_INFO "步骤3:安装${PACKAGE_NAME}软件包" - dnf install -y ${PACKAGE_NAME} > /dev/null 2>&1 - CHECK_RESULT $? 0 0 "安装软件包${PACKAGE_NAME}失败" - LOG_INFO "软件包${PACKAGE_NAME}安装成功" - fi - - # 步骤4:验证软件包已正确安装 - LOG_INFO "步骤4:验证${PACKAGE_NAME}软件包已正确安装" - rpm -q ${PACKAGE_NAME} > /dev/null 2>&1 - CHECK_RESULT $? 0 0 "软件包${PACKAGE_NAME}未正确安装" - - # 步骤5:执行软件包卸载测试 - LOG_INFO "步骤5:执行${PACKAGE_NAME}软件包卸载" - dnf remove -y ${PACKAGE_NAME} > /dev/null 2>&1 - CHECK_RESULT $? 0 0 "卸载软件包${PACKAGE_NAME}失败" - LOG_INFO "软件包${PACKAGE_NAME}卸载成功" - - # 步骤6:验证软件包已正确卸载 - LOG_INFO "步骤6:验证${PACKAGE_NAME}软件包已正确卸载" - rpm -q ${PACKAGE_NAME} > /dev/null 2>&1 - if [ $? -eq 0 ]; then - LOG_ERROR "软件包${PACKAGE_NAME}卸载后仍然存在" - exit 1 - fi - LOG_INFO "软件包${PACKAGE_NAME}已正确卸载" - - # 步骤7:环境恢复 - LOG_INFO "步骤7:恢复环境到初始状态" - if [ $INITIAL_INSTALL_STATE -eq 0 ]; then - # 初始状态是已安装,需要重新安装 - LOG_INFO "重新安装${PACKAGE_NAME}软件包到初始状态" - dnf install -y ${PACKAGE_NAME} > /dev/null 2>&1 - CHECK_RESULT $? 0 0 "重新安装软件包${PACKAGE_NAME}失败" - LOG_INFO "软件包${PACKAGE_NAME}已恢复到安装状态" - else - # 初始状态是未安装,确保软件包已卸载 - LOG_INFO "确保${PACKAGE_NAME}软件包处于未安装状态" - rpm -q ${PACKAGE_NAME} > /dev/null 2>&1 - if [ $? -eq 0 ]; then - dnf remove -y ${PACKAGE_NAME} > /dev/null 2>&1 - CHECK_RESULT $? 0 0 "清理软件包${PACKAGE_NAME}失败" - LOG_INFO "软件包${PACKAGE_NAME}已清理" - fi - fi - - # 步骤8:最终验证 - LOG_INFO "步骤8:最终验证环境状态" - rpm -q ${PACKAGE_NAME} > /dev/null 2>&1 - if [ $INITIAL_INSTALL_STATE -eq 0 ]; then - CHECK_RESULT $? 0 0 "最终验证:软件包${PACKAGE_NAME}未恢复到安装状态" - LOG_INFO "环境已正确恢复到初始安装状态" - else - if [ $? -eq 0 ]; then - LOG_ERROR "最终验证:软件包${PACKAGE_NAME}未正确恢复到未安装状态" - exit 1 - fi - LOG_INFO "环境已正确恢复到初始未安装状态" - fi - - LOG_INFO "=== 软件包卸载功能测试完成 ===" -} - -main "$@" \ No newline at end of file diff --git a/testcases/function_test/pkg_test/texlive-split-v/texlive-steinmetz-doc/test_texlive-steinmetz-doc_function_view_doc.sh b/testcases/function_test/pkg_test/texlive-split-v/texlive-steinmetz-doc/test_texlive-steinmetz-doc_function_view_doc.sh deleted file mode 100644 index 14e1a2c56a0..00000000000 --- a/testcases/function_test/pkg_test/texlive-split-v/texlive-steinmetz-doc/test_texlive-steinmetz-doc_function_view_doc.sh +++ /dev/null @@ -1,75 +0,0 @@ -#!/usr/bin/bash - -# Copyright (c) 2024 ISCAS .ALL rights reserved. -# This program is licensed under Mulan PSL v2. -# You can use it according to the terms and conditions of the Mulan PSL v2. -# http://license.coscl.org.cn/MulanPSL2 -# THIS PROGRAM IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, -# EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, -# MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. -# See the Mulan PSL v2 for more details. - -# ############################################# -# @Author : honghua -# @Contact : honghua@iscas.ac.cn -# @Date : 2026-03-06 -# @License : Mulan PSL v2 -# @Desc : Check documentation content accessibility -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - LOG_INFO "开始测试:检查文档内容可访问性" - - # 检查系统是否已安装texlive-steinmetz-doc - LOG_INFO "检查系统是否已安装texlive-steinmetz-doc" - if dnf list installed texlive-steinmetz-doc &>/dev/null; then - LOG_INFO "texlive-steinmetz-doc 已安装,脚本结束后将保持安装状态" - INSTALLED_BEFORE=1 - else - LOG_INFO "texlive-steinmetz-doc 未安装,将在测试过程中安装并在脚本结束前卸载" - INSTALLED_BEFORE=0 - fi - - # 检查yum源中是否有texlive-steinmetz-doc软件包 - LOG_INFO "检查yum源中是否有texlive-steinmetz-doc软件包" - if ! dnf list available texlive-steinmetz-doc &>/dev/null; then - LOG_ERROR "yum源中未找到texlive-steinmetz-doc软件包" - exit 255 - fi - - # 如果未安装,则安装软件包 - if [ $INSTALLED_BEFORE -eq 0 ]; then - LOG_INFO "安装texlive-steinmetz-doc软件包" - dnf install -y texlive-steinmetz-doc - CHECK_RESULT $? 0 0 "安装texlive-steinmetz-doc失败" - fi - - # 检查文档内容可访问性 - LOG_INFO "检查texlive-steinmetz-doc文档内容可访问性" - if [ -d "/usr/share/texlive/texmf-dist/doc/fonts/steinmetz" ]; then - LOG_INFO "找到steinmetz文档目录" - # 检查目录中是否有文件 - if [ "$(ls -A /usr/share/texlive/texmf-dist/doc/fonts/steinmetz)" ]; then - LOG_INFO "steinmetz文档目录中有文件,文档内容可访问" - else - LOG_ERROR "steinmetz文档目录为空,文档内容不可访问" - exit 1 - fi - else - LOG_ERROR "未找到steinmetz文档目录" - exit 1 - fi - - # 清理环境:如果之前未安装,则卸载软件包 - if [ $INSTALLED_BEFORE -eq 0 ]; then - LOG_INFO "卸载texlive-steinmetz-doc软件包" - dnf remove -y texlive-steinmetz-doc - CHECK_RESULT $? 0 0 "卸载texlive-steinmetz-doc失败" - fi - - LOG_INFO "测试完成:文档内容可访问性检查通过" -} - -main "$@" \ No newline at end of file diff --git a/testcases/function_test/pkg_test/texlive-split-y/texlive-tetragonos/test_texlive-tetragonos_function_basic.sh b/testcases/function_test/pkg_test/texlive-split-y/texlive-tetragonos/test_texlive-tetragonos_function_basic.sh deleted file mode 100644 index 241974dac90..00000000000 --- a/testcases/function_test/pkg_test/texlive-split-y/texlive-tetragonos/test_texlive-tetragonos_function_basic.sh +++ /dev/null @@ -1,61 +0,0 @@ -#!/usr/bin/bash - -# Copyright (c) 2024 ISCAS .ALL rights reserved. -# This program is licensed under Mulan PSL v2. -# You can use it according to the terms and conditions of the Mulan PSL v2. -# http://license.coscl.org.cn/MulanPSL2 -# THIS PROGRAM IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, -# EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, -# MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. -# See the Mulan PSL v2 for more details. - -# ############################################# -# @Author : honghua -# @Contact : honghua@iscas.ac.cn -# @Date : 2025-11-26 -# @License : Mulan PSL v2 -# @Desc : Test basic functionality of texlive-tetragonos -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - # 检查是否已经安装了texlive-tetragonos - LOG_INFO "检查是否已安装texlive-tetragonos" - rpm -q texlive-tetragonos - if [ $? -eq 0 ]; then - LOG_INFO "texlive-tetragonos已安装,脚本结束时将保持安装状态" - installed=true - else - LOG_INFO "texlive-tetragonos未安装,将在测试结束后卸载" - installed=false - fi - - # 检查yum源中是否有texlive-tetragonos软件包 - LOG_INFO "检查yum源中是否有texlive-tetragonos软件包" - dnf list available texlive-tetragonos > /dev/null 2>&1 - CHECK_RESULT $? 0 255 "yum源中未找到texlive-tetragonos软件包" - - # 安装texlive-tetragonos软件包 - if [ "$installed" = false ]; then - LOG_INFO "开始安装texlive-tetragonos软件包" - dnf install -y texlive-tetragonos - CHECK_RESULT $? 0 0 "安装texlive-tetragonos软件包失败" - fi - - # 测试基本功能 - LOG_INFO "测试texlive-tetragonos的基本功能" - texlive-tetragonos --version - CHECK_RESULT $? 0 0 "获取texlive-tetragonos版本信息失败" - - # 清理环境 - if [ "$installed" = false ]; then - LOG_INFO "卸载texlive-tetragonos软件包" - dnf remove -y texlive-tetragonos - CHECK_RESULT $? 0 0 "卸载texlive-tetragonos软件包失败" - fi - - LOG_INFO "测试完成,环境已恢复" -} - -main "$@" \ No newline at end of file diff --git a/testcases/function_test/pkg_test/texlive-split-z/texlive-nanicolle/test_texlive-nanicolle_function_install.sh b/testcases/function_test/pkg_test/texlive-split-z/texlive-nanicolle/test_texlive-nanicolle_function_install.sh deleted file mode 100644 index 258fd26d2b1..00000000000 --- a/testcases/function_test/pkg_test/texlive-split-z/texlive-nanicolle/test_texlive-nanicolle_function_install.sh +++ /dev/null @@ -1,106 +0,0 @@ -#!/usr/bin/bash - -# Copyright (c) 2024 ISCAS .ALL rights reserved. -# This program is licensed under Mulan PSL v2. -# You can use it according to the terms and conditions of the Mulan PSL v2. -# http://license.coscl.org.cn/MulanPSL2 -# THIS PROGRAM IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, -# EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, -# MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. -# See the Mulan PSL v2 for more details. - -# ############################################# -# @Author : honghua -# @Contact : honghua@iscas.ac.cn -# @Date : 2026-02-27 -# @License : Mulan PSL v2 -# @Desc : Test package installation -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - # 测试包安装功能 - - LOG_INFO "开始测试软件包安装功能" - - # 检查环境是否已安装texlive-nanicolle - LOG_INFO "步骤1: 检查texlive-nanicolle是否已安装" - rpm -q texlive-nanicolle - if [ $? -eq 0 ]; then - LOG_INFO "texlive-nanicolle已安装,测试结束后将保持安装状态" - ALREADY_INSTALLED=1 - else - LOG_INFO "texlive-nanicolle未安装,将在测试结束后卸载" - ALREADY_INSTALLED=0 - fi - - # 检查yum源中是否有texlive-nanicolle软件包 - LOG_INFO "步骤2: 检查yum源中是否有texlive-nanicolle软件包" - dnf list available texlive-nanicolle - if [ $? -ne 0 ]; then - LOG_ERROR "yum源中未找到texlive-nanicolle软件包" - exit 255 - fi - - # 检查dnf命令参数是否支持 - LOG_INFO "步骤3: 检查dnf命令参数是否支持" - dnf --help | grep -q "install" - if [ $? -ne 0 ]; then - LOG_ERROR "dnf命令不支持install参数" - exit 255 - fi - - dnf --help | grep -q "remove" - if [ $? -ne 0 ]; then - LOG_ERROR "dnf命令不支持remove参数" - exit 255 - fi - - # 如果未安装,则安装软件包 - if [ $ALREADY_INSTALLED -eq 0 ]; then - LOG_INFO "步骤4: 安装texlive-nanicolle软件包" - dnf install -y texlive-nanicolle - CHECK_RESULT $? 0 0 "安装texlive-nanicolle失败" - - # 验证安装是否成功 - LOG_INFO "步骤5: 验证texlive-nanicolle安装是否成功" - rpm -q texlive-nanicolle - CHECK_RESULT $? 0 0 "验证texlive-nanicolle安装失败" - - LOG_INFO "texlive-nanicolle安装成功" - fi - - # 测试软件包基本功能 - LOG_INFO "步骤6: 测试texlive-nanicolle基本功能" - # 这里添加具体的功能测试命令 - # 例如: 检查相关文件是否存在 - ls /usr/share/texlive/texmf-dist/tex/latex/nanicolle/ > /dev/null 2>&1 - if [ $? -eq 0 ]; then - LOG_INFO "texlive-nanicolle相关文件存在" - else - LOG_INFO "未找到texlive-nanicolle特定文件,但安装已确认成功" - fi - - # 清理环境:如果测试前未安装,则在测试后卸载 - if [ $ALREADY_INSTALLED -eq 0 ]; then - LOG_INFO "步骤7: 清理测试环境,卸载texlive-nanicolle" - dnf remove -y texlive-nanicolle - CHECK_RESULT $? 0 0 "卸载texlive-nanicolle失败" - - # 验证卸载是否成功 - rpm -q texlive-nanicolle - if [ $? -eq 0 ]; then - LOG_ERROR "texlive-nanicolle卸载失败" - exit 1 - else - LOG_INFO "texlive-nanicolle卸载成功" - fi - else - LOG_INFO "步骤7: 保持texlive-nanicolle安装状态,不进行卸载" - fi - - LOG_INFO "测试包安装功能测试完成" -} - -main "$@" \ No newline at end of file diff --git a/testcases/function_test/pkg_test/texlive-split-z/texlive-nanicolle/test_texlive-nanicolle_function_usage.sh b/testcases/function_test/pkg_test/texlive-split-z/texlive-nanicolle/test_texlive-nanicolle_function_usage.sh deleted file mode 100644 index df3949deb33..00000000000 --- a/testcases/function_test/pkg_test/texlive-split-z/texlive-nanicolle/test_texlive-nanicolle_function_usage.sh +++ /dev/null @@ -1,105 +0,0 @@ -#!/usr/bin/bash - -# Copyright (c) 2024 ISCAS .ALL rights reserved. -# This program is licensed under Mulan PSL v2. -# You can use it according to the terms and conditions of the Mulan PSL v2. -# http://license.coscl.org.cn/MulanPSL2 -# THIS PROGRAM IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, -# EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, -# MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. -# See the Mulan PSL v2 for more details. - -# ############################################# -# @Author : honghua -# @Contact : honghua@iscas.ac.cn -# @Date : 2026-02-27 -# @License : Mulan PSL v2 -# @Desc : Test basic package usage in LaTeX -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - # 检查是否已安装texlive-nanicolle - LOG_INFO "检查是否已安装texlive-nanicolle软件包" - rpm -q texlive-nanicolle - if [ $? -eq 0 ]; then - LOG_INFO "texlive-nanicolle已安装" - INSTALLED=1 - else - LOG_INFO "texlive-nanicolle未安装" - INSTALLED=0 - fi - - # 检查yum源中是否有texlive-nanicolle软件包 - LOG_INFO "检查yum源中是否有texlive-nanicolle软件包" - dnf list available texlive-nanicolle - if [ $? -ne 0 ]; then - LOG_ERROR "yum源中未找到texlive-nanicolle软件包" - exit 255 - fi - - # 如果未安装,则安装软件包 - if [ $INSTALLED -eq 0 ]; then - LOG_INFO "开始安装texlive-nanicolle软件包" - dnf install -y texlive-nanicolle - CHECK_RESULT $? 0 0 "安装texlive-nanicolle失败" - LOG_INFO "texlive-nanicolle安装成功" - fi - - # 测试基本包使用功能 - LOG_INFO "测试texlive-nanicolle基本包使用功能" - # 检查texlive-nanicolle提供的文件 - LOG_INFO "检查texlive-nanicolle提供的文件列表" - rpm -ql texlive-nanicolle | head -5 - CHECK_RESULT $? 0 0 "获取texlive-nanicolle文件列表失败" - - # 测试LaTeX文档编译(使用nanicolle包) - LOG_INFO "创建测试LaTeX文档" - cat > test_nanicolle.tex << "EOF" - \documentclass{article} - \usepackage{nanicolle} - \begin{document} - Test document using nanicolle package. - \end{document} - EOF - CHECK_RESULT $? 0 0 "创建测试文档失败" - - # 尝试编译LaTeX文档 - LOG_INFO "尝试编译LaTeX测试文档" - pdflatex -interaction=nonstopmode test_nanicolle.tex > /dev/null 2>&1 - # 检查编译结果,如果nanicolle包不存在,pdflatex会失败 - if [ $? -ne 0 ]; then - LOG_ERROR "编译LaTeX文档失败,可能nanicolle包不可用" - # 检查是否是参数不支持的情况 - pdflatex --help | grep -q "nonstopmode" - CHECK_RESULT $? 0 0 "pdflatex不支持nonstopmode参数" 255 - # 其他失败情况 - CHECK_RESULT 1 0 0 "编译LaTeX文档失败" - else - LOG_INFO "LaTeX文档编译成功" - # 检查生成的PDF文件 - if [ -f test_nanicolle.pdf ]; then - LOG_INFO "成功生成PDF文件" - rm -f test_nanicolle.pdf - fi - fi - - # 清理测试文件 - LOG_INFO "清理测试文件" - rm -f test_nanicolle.tex test_nanicolle.aux test_nanicolle.log test_nanicolle.out - - # 环境恢复:如果测试前未安装,则卸载软件包 - if [ $INSTALLED -eq 0 ]; then - LOG_INFO "卸载texlive-nanicolle软件包" - dnf remove -y texlive-nanicolle - CHECK_RESULT $? 0 0 "卸载texlive-nanicolle失败" - LOG_INFO "texlive-nanicolle卸载成功" - else - LOG_INFO "保持texlive-nanicolle安装状态" - fi - - LOG_INFO "测试完成" -} - -main "$@" \ No newline at end of file diff --git a/testcases/function_test/pkg_test/texlive-split-z/texlive-nanicolle/test_texlive-nanicolle_function_verify.sh b/testcases/function_test/pkg_test/texlive-split-z/texlive-nanicolle/test_texlive-nanicolle_function_verify.sh deleted file mode 100644 index 2a703101b3f..00000000000 --- a/testcases/function_test/pkg_test/texlive-split-z/texlive-nanicolle/test_texlive-nanicolle_function_verify.sh +++ /dev/null @@ -1,71 +0,0 @@ -#!/usr/bin/bash - -# Copyright (c) 2024 ISCAS .ALL rights reserved. -# This program is licensed under Mulan PSL v2. -# You can use it according to the terms and conditions of the Mulan PSL v2. -# http://license.coscl.org.cn/MulanPSL2 -# THIS PROGRAM IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, -# EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, -# MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. -# See the Mulan PSL v2 for more details. - -# ############################################# -# @Author : honghua -# @Contact : honghua@iscas.ac.cn -# @Date : 2026-02-27 -# @License : Mulan PSL v2 -# @Desc : Test package presence and integrity -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - set -e - - LOG_INFO "开始测试:检查texlive-nanicolle软件包的存在性和完整性" - - # 检查软件包是否已安装 - LOG_INFO "步骤1:检查texlive-nanicolle软件包是否已安装" - if rpm -q texlive-nanicolle &>/dev/null; then - LOG_INFO "texlive-nanicolle已安装,标记为已安装状态" - INSTALLED="true" - else - LOG_INFO "texlive-nanicolle未安装,标记为未安装状态" - INSTALLED="false" - fi - - # 检查yum源中是否存在该软件包 - LOG_INFO "步骤2:检查yum源中是否存在texlive-nanicolle软件包" - if ! dnf list available texlive-nanicolle &>/dev/null; then - LOG_ERROR "yum源中未找到texlive-nanicolle软件包" - exit 255 - fi - LOG_INFO "yum源中存在texlive-nanicolle软件包" - - # 如果未安装,则安装软件包 - if [ "$INSTALLED" = "false" ]; then - LOG_INFO "步骤3:安装texlive-nanicolle软件包" - dnf install -y texlive-nanicolle - CHECK_RESULT $? 0 0 "安装texlive-nanicolle失败" - LOG_INFO "texlive-nanicolle安装成功" - fi - - # 验证软件包完整性 - LOG_INFO "步骤4:验证texlive-nanicolle软件包完整性" - rpm -V texlive-nanicolle - CHECK_RESULT $? 0 0 "texlive-nanicolle软件包完整性验证失败" - - # 清理环境:如果脚本开始时未安装,则卸载软件包 - if [ "$INSTALLED" = "false" ]; then - LOG_INFO "步骤5:清理环境,卸载texlive-nanicolle软件包" - dnf remove -y texlive-nanicolle - CHECK_RESULT $? 0 0 "卸载texlive-nanicolle失败" - LOG_INFO "texlive-nanicolle卸载成功,环境已恢复" - else - LOG_INFO "步骤5:环境清理,保持texlive-nanicolle已安装状态" - fi - - LOG_INFO "测试完成:texlive-nanicolle软件包的存在性和完整性测试通过" -} - -main "$@" \ No newline at end of file diff --git a/testcases/function_test/pkg_test/xxhash-devel/xxhash-devel/test_xxhash-devel_function_header_exist.sh b/testcases/function_test/pkg_test/xxhash-devel/xxhash-devel/test_xxhash-devel_function_header_exist.sh deleted file mode 100644 index 63694d5720d..00000000000 --- a/testcases/function_test/pkg_test/xxhash-devel/xxhash-devel/test_xxhash-devel_function_header_exist.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-27 -# @License : Mulan PSL v2 -# @Desc : 测试安装后,开发头文件(如xxhash.h)是否已正确安装到系统目录。 -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - # 定义变量 - PKG_NAME="xxhash-devel" - HEADER_FILE="xxhash.h" - HEADER_PATHS="/usr/include /usr/local/include" - - # 步骤1:检查软件包是否在yum源中 - LOG_INFO "步骤1:检查软件包是否在yum源中" - dnf list available ${PKG_NAME} > /dev/null 2>&1 - if [ $? -ne 0 ]; then - LOG_ERROR "软件包 ${PKG_NAME} 不在yum源中" - exit 255 - fi - LOG_INFO "软件包 ${PKG_NAME} 在yum源中" - - # 步骤2:检查当前是否已安装 - LOG_INFO "步骤2:检查当前是否已安装" - rpm -q ${PKG_NAME} > /dev/null 2>&1 - if [ $? -eq 0 ]; then - LOG_INFO "软件包 ${PKG_NAME} 已安装,标记为已存在" - INSTALLED_BEFORE=1 - else - LOG_INFO "软件包 ${PKG_NAME} 未安装,标记为未安装" - INSTALLED_BEFORE=0 - fi - - # 步骤3:如果未安装,则安装软件包 - if [ ${INSTALLED_BEFORE} -eq 0 ]; then - LOG_INFO "步骤3:安装软件包 ${PKG_NAME}" - dnf install -y ${PKG_NAME} > /dev/null 2>&1 - CHECK_RESULT $? 0 0 "安装软件包 ${PKG_NAME} 失败" - LOG_INFO "安装软件包 ${PKG_NAME} 成功" - else - LOG_INFO "步骤3:软件包已安装,跳过安装步骤" - fi - - # 步骤4:检查头文件是否安装到系统目录 - LOG_INFO "步骤4:检查头文件是否安装到系统目录" - HEADER_FOUND=0 - for path in ${HEADER_PATHS}; do - if [ -f "${path}/${HEADER_FILE}" ]; then - LOG_INFO "找到头文件: ${path}/${HEADER_FILE}" - HEADER_FOUND=1 - break - fi - done - if [ ${HEADER_FOUND} -eq 0 ]; then - LOG_ERROR "未找到头文件 ${HEADER_FILE} 在系统目录中" - CHECK_RESULT 1 0 0 "头文件 ${HEADER_FILE} 未正确安装" - else - LOG_INFO "头文件 ${HEADER_FILE} 已正确安装到系统目录" - CHECK_RESULT 0 0 0 "头文件检查通过" - fi - - # 步骤5:环境恢复 - LOG_INFO "步骤5:环境恢复" - if [ ${INSTALLED_BEFORE} -eq 0 ]; then - LOG_INFO "卸载软件包 ${PKG_NAME}" - dnf remove -y ${PKG_NAME} > /dev/null 2>&1 - CHECK_RESULT $? 0 0 "卸载软件包 ${PKG_NAME} 失败" - LOG_INFO "卸载软件包 ${PKG_NAME} 成功" - else - LOG_INFO "软件包之前已安装,保持安装状态" - fi - - LOG_INFO "测试完成" -} - -main "$@" \ No newline at end of file diff --git a/testcases/function_test/pkg_test/xxhash-devel/xxhash-devel/test_xxhash-devel_function_install.sh b/testcases/function_test/pkg_test/xxhash-devel/xxhash-devel/test_xxhash-devel_function_install.sh deleted file mode 100644 index bc9781bb0ed..00000000000 --- a/testcases/function_test/pkg_test/xxhash-devel/xxhash-devel/test_xxhash-devel_function_install.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-27 -# @License : Mulan PSL v2 -# @Desc : 测试xxhash-devel软件包的安装功能是否正常。 -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - set -e - - LOG_INFO "开始测试xxhash-devel软件包的安装功能" - - LOG_INFO "步骤1:检查yum源中是否存在xxhash-devel软件包" - if ! dnf list available xxhash-devel &>/dev/null; then - LOG_ERROR "yum源中未找到xxhash-devel软件包" - exit 255 - fi - LOG_INFO "yum源中存在xxhash-devel软件包" - - LOG_INFO "步骤2:检查当前环境是否已安装xxhash-devel" - if rpm -q xxhash-devel &>/dev/null; then - LOG_INFO "当前环境已安装xxhash-devel,测试将保持安装状态" - INSTALLED_BEFORE_TEST=true - else - LOG_INFO "当前环境未安装xxhash-devel,将在测试中安装" - INSTALLED_BEFORE_TEST=false - fi - - LOG_INFO "步骤3:执行安装操作" - if [ "$INSTALLED_BEFORE_TEST" = "false" ]; then - dnf install -y xxhash-devel - CHECK_RESULT $? 0 0 "安装xxhash-devel软件包失败" - LOG_INFO "成功安装xxhash-devel软件包" - fi - - LOG_INFO "步骤4:验证安装是否成功" - rpm -q xxhash-devel - CHECK_RESULT $? 0 0 "验证xxhash-devel安装状态失败" - LOG_INFO "验证安装成功" - - LOG_INFO "步骤5:检查软件包提供的文件" - rpm -ql xxhash-devel | head -5 - CHECK_RESULT $? 0 0 "获取xxhash-devel文件列表失败" - LOG_INFO "成功获取软件包文件列表" - - LOG_INFO "步骤6:清理测试环境" - if [ "$INSTALLED_BEFORE_TEST" = "false" ]; then - LOG_INFO "卸载测试安装的xxhash-devel软件包" - dnf remove -y xxhash-devel - CHECK_RESULT $? 0 0 "卸载xxhash-devel软件包失败" - LOG_INFO "成功卸载xxhash-devel软件包" - else - LOG_INFO "测试前已安装xxhash-devel,保持安装状态" - fi - - LOG_INFO "步骤7:最终环境验证" - if [ "$INSTALLED_BEFORE_TEST" = "false" ]; then - if rpm -q xxhash-devel &>/dev/null; then - LOG_ERROR "环境清理失败,xxhash-devel仍存在" - exit 1 - else - LOG_INFO "环境已恢复,xxhash-devel未安装" - fi - else - if ! rpm -q xxhash-devel &>/dev/null; then - LOG_ERROR "环境被破坏,原有的xxhash-devel安装被移除" - exit 1 - else - LOG_INFO "环境已恢复,保持原有的xxhash-devel安装" - fi - fi - - LOG_INFO "xxhash-devel软件包安装功能测试完成" -} - -main "$@" \ No newline at end of file diff --git a/testcases/function_test/pkg_test/xxhash-devel/xxhash-devel/test_xxhash-devel_function_uninstall.sh b/testcases/function_test/pkg_test/xxhash-devel/xxhash-devel/test_xxhash-devel_function_uninstall.sh deleted file mode 100644 index 6a2e09d0d2c..00000000000 --- a/testcases/function_test/pkg_test/xxhash-devel/xxhash-devel/test_xxhash-devel_function_uninstall.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 : 2025-12-27 -# @License : Mulan PSL v2 -# @Desc : 测试xxhash-devel软件包的卸载功能是否正常,确认相关文件被移除。 -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - # 测试xxhash-devel软件包卸载功能 - - LOG_INFO "开始测试xxhash-devel软件包的卸载功能" - - # 检查软件包是否存在于yum源中 - LOG_INFO "检查yum源中是否存在xxhash-devel软件包" - dnf list available xxhash-devel > /dev/null 2>&1 - if [ $? -ne 0 ]; then - LOG_ERROR "yum源中不存在xxhash-devel软件包" - exit 255 - fi - LOG_INFO "yum源中存在xxhash-devel软件包" - - # 检查当前是否已安装xxhash-devel - LOG_INFO "检查当前系统是否已安装xxhash-devel" - rpm -q xxhash-devel > /dev/null 2>&1 - INSTALLED=$? - NEED_CLEANUP=0 - - # 如果未安装,则先安装 - if [ $INSTALLED -ne 0 ]; then - LOG_INFO "系统未安装xxhash-devel,开始安装" - dnf install -y xxhash-devel - CHECK_RESULT $? 0 0 "安装xxhash-devel失败" - NEED_CLEANUP=1 - LOG_INFO "xxhash-devel安装成功" - else - LOG_INFO "系统已安装xxhash-devel,保持安装状态" - fi - - # 记录安装后的文件状态 - LOG_INFO "记录安装后的文件列表" - INSTALLED_FILES=$(rpm -ql xxhash-devel) - LOG_INFO "已安装文件数量: $(echo "$INSTALLED_FILES" | wc -l)" - - # 执行卸载测试 - LOG_INFO "开始卸载xxhash-devel软件包" - dnf remove -y xxhash-devel - CHECK_RESULT $? 0 0 "卸载xxhash-devel失败" - - # 验证卸载结果 - LOG_INFO "验证卸载结果" - rpm -q xxhash-devel > /dev/null 2>&1 - CHECK_RESULT $? 1 0 "卸载后软件包仍然存在" - - # 检查相关文件是否被移除 - LOG_INFO "检查相关文件是否被移除" - for file in $INSTALLED_FILES; do - if [ -e "$file" ]; then - LOG_ERROR "文件 $file 未被移除" - exit 1 - fi - done - LOG_INFO "所有相关文件已成功移除" - - # 环境恢复 - LOG_INFO "开始环境恢复" - if [ $NEED_CLEANUP -eq 1 ]; then - # 如果是测试期间安装的,需要重新安装以恢复环境 - LOG_INFO "重新安装xxhash-devel以恢复环境" - dnf install -y xxhash-devel - CHECK_RESULT $? 0 0 "重新安装xxhash-devel失败" - LOG_INFO "环境恢复完成" - else - # 如果原本已安装,则重新安装 - LOG_INFO "重新安装xxhash-devel以恢复环境" - dnf install -y xxhash-devel - CHECK_RESULT $? 0 0 "重新安装xxhash-devel失败" - LOG_INFO "环境恢复完成" - fi - - LOG_INFO "测试完成:xxhash-devel软件包的卸载功能正常,相关文件被正确移除" -} - -main "$@" \ No newline at end of file