diff --git a/suite2cases/function_test/pkg_test/arquillian-core/arquillian-testng-core.json b/suite2cases/function_test/pkg_test/arquillian-core/arquillian-testng-core.json deleted file mode 100644 index bb4acf3793f..00000000000 --- a/suite2cases/function_test/pkg_test/arquillian-core/arquillian-testng-core.json +++ /dev/null @@ -1,14 +0,0 @@ -{ - "path": "$OET_PATH/testcases/function_test/pkg_test/arquillian-core/arquillian-testng-core", - "machine num": 1, - "cases": [ - { - "name": "test_arquillian-testng-core_function_init", - "desc": "Test initialization of arquillian-testng-core" - }, - { - "name": "test_arquillian-testng-core_function_execute", - "desc": "Test execution of arquillian-testng-core" - } - ] -} \ No newline at end of file diff --git a/suite2cases/function_test/pkg_test/colord-gtk/colord-gtk.json b/suite2cases/function_test/pkg_test/colord-gtk/colord-gtk.json index e191f50a5d3..3fcffa0684b 100644 --- a/suite2cases/function_test/pkg_test/colord-gtk/colord-gtk.json +++ b/suite2cases/function_test/pkg_test/colord-gtk/colord-gtk.json @@ -16,70 +16,6 @@ "name": "test_colord-gtk_service_log", "desc": "测试colord-gtk服务的日志查看功能,验证服务是否可以正常查看日志", "machine num": 1 - }, - { - "name": "test_colord-gtk_cd-convert__v", - "desc": "测试cd-convert命令的详细输出模式" - }, - { - "name": "test_colord-gtk_cd-convert__q", - "desc": "测试cd-convert命令的静默模式" - }, - { - "name": "test_colord-gtk_cd-convert__help", - "desc": "测试cd-convert命令的帮助信息" - }, - { - "name": "test_colord-gtk_cd-convert__upper_v", - "desc": "测试cd-convert命令的版本信息" - }, - { - "name": "test_colord-gtk_cd-convert__upper_n", - "desc": "测试cd-convert命令使用不存在的配置文件" - }, - { - "name": "test_colord-gtk_cd-convert__upper_t", - "desc": "测试cd-convert命令使用绝对色温值进行转换" - }, - { - "name": "test_colord-gtk_cd-convert__upper_r", - "desc": "测试cd-convert命令使用相对色温值进行转换" - }, - { - "name": "test_colord-gtk_cd-convert__upper_f", - "desc": "测试cd-convert命令指定输入文件的格式" - }, - { - "name": "test_colord-gtk_cd-convert__upper_o", - "desc": "测试cd-convert命令指定输出文件的格式" - }, - { - "name": "test_colord-gtk_install_package", - "desc": "测试colord-gtk软件包的安装功能,验证软件包是否可以正常安装" - }, - { - "name": "test_colord-gtk_check_installed", - "desc": "检查colord-gtk软件包是否已正确安装到系统中" - }, - { - "name": "test_colord-gtk_service_status", - "desc": "测试与colord-gtk相关的服务(如colord)的运行状态" - }, - { - "name": "test_colord-gtk_cd_profile_import", - "desc": "测试使用colord-gtk工具导入颜色配置文件" - }, - { - "name": "test_colord-gtk_cd_profile_export", - "desc": "测试使用colord-gtk工具导出颜色配置文件" - }, - { - "name": "test_colord-gtk_cd_create_profile", - "desc": "测试使用colord-gtk工具创建基本的颜色配置文件" - }, - { - "name": "test_colord-gtk_gui_tool_open", - "desc": "测试colord-gtk提供的图形化管理工具(如gnome-color-manager)能否正常启动" } ] } \ No newline at end of file diff --git a/suite2cases/function_test/pkg_test/criu/criu.json b/suite2cases/function_test/pkg_test/criu/criu.json index 89bd429a68f..c20f0ac0120 100644 --- a/suite2cases/function_test/pkg_test/criu/criu.json +++ b/suite2cases/function_test/pkg_test/criu/criu.json @@ -26,14 +26,6 @@ { "name": "test_criu_function_uninstall", "desc": "测试criu的卸载功能,验证是否能够成功卸载软件包。" - }, - { - "name": "test_criu_function_restore", - "desc": "测试criu的核心恢复功能,验证是否能从转储文件恢复进程。" - }, - { - "name": "test_criu_function_checkpoint", - "desc": "测试criu的检查点功能(结合dump与restore)。" } ] } \ No newline at end of file diff --git a/suite2cases/function_test/pkg_test/eclipse/eclipse-jdt.json b/suite2cases/function_test/pkg_test/eclipse/eclipse-jdt.json index 17a6c793f61..bbc5a04f156 100644 --- a/suite2cases/function_test/pkg_test/eclipse/eclipse-jdt.json +++ b/suite2cases/function_test/pkg_test/eclipse/eclipse-jdt.json @@ -7,11 +7,6 @@ "desc": "测试eclipse-jdt软件包的升级功能", "machine num": 1 }, - { - "name": "test_eclipse-jdt_rollback", - "desc": "测试eclipse-jdt软件包的升级回滚功能", - "machine num": 1 - }, { "name": "test_eclipse-jdt_function_compile", "desc": "测试eclipse-jdt软件包的编译功能" diff --git a/suite2cases/function_test/pkg_test/harfbuzz/harfbuzz-help.json b/suite2cases/function_test/pkg_test/harfbuzz/harfbuzz-help.json index c8ba30cd89f..19aede152c4 100644 --- a/suite2cases/function_test/pkg_test/harfbuzz/harfbuzz-help.json +++ b/suite2cases/function_test/pkg_test/harfbuzz/harfbuzz-help.json @@ -10,10 +10,6 @@ "name": "test_harfbuzz-help_function_installed", "desc": "测试harfbuzz-help软件包在安装后是否存在于系统已安装软件包列表中。" }, - { - "name": "test_harfbuzz-help_function_help_output", - "desc": "测试执行harfbuzz-help命令是否能正常输出帮助信息(如用法、选项等)。" - }, { "name": "test_harfbuzz-help_function_uninstall", "desc": "测试harfbuzz-help软件包是否可以通过默认包管理器成功卸载,且卸载后相关文件被移除。" diff --git a/suite2cases/function_test/pkg_test/jffi/jffi-javadoc.json b/suite2cases/function_test/pkg_test/jffi/jffi-javadoc.json deleted file mode 100644 index 480c3f34877..00000000000 --- a/suite2cases/function_test/pkg_test/jffi/jffi-javadoc.json +++ /dev/null @@ -1,10 +0,0 @@ -{ - "path": "$OET_PATH/testcases/function_test/pkg_test/jffi/jffi-javadoc", - "machine num": 1, - "cases": [ - { - "name": "test_jffi-javadoc_function_docgen", - "desc": "Verify Javadoc generation for jffi-javadoc" - } - ] -} \ No newline at end of file diff --git a/suite2cases/function_test/pkg_test/mesa/mesa-filesystem.json b/suite2cases/function_test/pkg_test/mesa/mesa-filesystem.json index 1d29c9547ea..c80584c7497 100644 --- a/suite2cases/function_test/pkg_test/mesa/mesa-filesystem.json +++ b/suite2cases/function_test/pkg_test/mesa/mesa-filesystem.json @@ -17,22 +17,6 @@ { "name": "test_mesa-filesystem_function_presence", "desc": "测试mesa-filesystem软件包是否已作为系统基础依赖库存在于系统中。" - }, - { - "name": "test_mesa-filesystem_function_version", - "desc": "测试验证mesa-filesystem软件包的版本信息是否符合预期。" - }, - { - "name": "test_mesa-filesystem_function_provides", - "desc": "测试mesa-filesystem软件包提供的核心库文件(如libGL.so)是否存在于标准路径。" - }, - { - "name": "test_mesa-filesystem_function_conflict", - "desc": "测试mesa-filesystem软件包与冲突包(如闭源驱动包)的安装互斥性。" - }, - { - "name": "test_mesa-filesystem_function_dependency", - "desc": "测试mesa-filesystem软件包被其他图形应用正确识别和依赖。" } ] } \ No newline at end of file diff --git a/suite2cases/function_test/pkg_test/metrics/metrics-log4j2.json b/suite2cases/function_test/pkg_test/metrics/metrics-log4j2.json index 5764225ea30..762d1427ba2 100644 --- a/suite2cases/function_test/pkg_test/metrics/metrics-log4j2.json +++ b/suite2cases/function_test/pkg_test/metrics/metrics-log4j2.json @@ -2,10 +2,6 @@ "path": "$OET_PATH/testcases/function_test/pkg_test/metrics/metrics-log4j2", "machine num": 1, "cases": [ - { - "name": "test_metrics-log4j2_function_logging", - "desc": "Test basic logging functionality of metrics-log4j2" - }, { "name": "test_metrics-log4j2_function_config", "desc": "Test configuration loading of metrics-log4j2" diff --git a/suite2cases/function_test/pkg_test/mythes/mythes-devel.json b/suite2cases/function_test/pkg_test/mythes/mythes-devel.json index 41f5b126a01..0325e750982 100644 --- a/suite2cases/function_test/pkg_test/mythes/mythes-devel.json +++ b/suite2cases/function_test/pkg_test/mythes/mythes-devel.json @@ -7,29 +7,9 @@ "desc": "测试mythes-devel软件包的安装功能", "machine num": 1 }, - { - "name": "test_mythes-devel_function_lookup", - "desc": "测试mythes-devel软件包的词库查询功能" - }, - { - "name": "test_mythes-devel_uninstall", - "desc": "测试mythes-devel软件包的卸载功能" - }, - { - "name": "test_mythes-devel_headers", - "desc": "测试mythes-devel开发头文件的存在性" - }, { "name": "test_mythes-devel_library", "desc": "测试mythes-devel共享库文件的存在性" - }, - { - "name": "test_mythes-devel_pkgconfig", - "desc": "测试mythes-devel的pkg-config支持" - }, - { - "name": "test_mythes-devel_synonyms", - "desc": "测试词库同义词查询功能" } ] } \ No newline at end of file diff --git a/suite2cases/function_test/pkg_test/polyglot/tesla-polyglot-translate-plugin.json b/suite2cases/function_test/pkg_test/polyglot/tesla-polyglot-translate-plugin.json deleted file mode 100644 index 006c086e02a..00000000000 --- a/suite2cases/function_test/pkg_test/polyglot/tesla-polyglot-translate-plugin.json +++ /dev/null @@ -1,18 +0,0 @@ -{ - "path": "$OET_PATH/testcases/function_test/pkg_test/polyglot/tesla-polyglot-translate-plugin", - "machine num": 1, - "cases": [ - { - "name": "test_tesla-polyglot-translate-plugin_function_init", - "desc": "Test plugin initialization" - }, - { - "name": "test_tesla-polyglot-translate-plugin_function_translate", - "desc": "Test translation functionality" - }, - { - "name": "test_tesla-polyglot-translate-plugin_function_config", - "desc": "Test config loading" - } - ] -} \ No newline at end of file diff --git a/suite2cases/function_test/pkg_test/python-dockerpty/python3-dockerpty.json b/suite2cases/function_test/pkg_test/python-dockerpty/python3-dockerpty.json deleted file mode 100644 index 17d27833908..00000000000 --- a/suite2cases/function_test/pkg_test/python-dockerpty/python3-dockerpty.json +++ /dev/null @@ -1,10 +0,0 @@ -{ - "path": "$OET_PATH/testcases/function_test/pkg_test/python-dockerpty/python3-dockerpty", - "machine num": 1, - "cases": [ - { - "name": "test_python3-dockerpty_function_init", - "desc": "Test initialization of dockerpty module" - } - ] -} \ No newline at end of file diff --git a/suite2cases/function_test/pkg_test/python-google-auth/python-google-auth-help.json b/suite2cases/function_test/pkg_test/python-google-auth/python-google-auth-help.json index 342324bff9e..a5d5961cdf1 100644 --- a/suite2cases/function_test/pkg_test/python-google-auth/python-google-auth-help.json +++ b/suite2cases/function_test/pkg_test/python-google-auth/python-google-auth-help.json @@ -6,50 +6,6 @@ "name": "test_python-google-auth-help_install", "desc": "测试python-google-auth-help软件包的安装功能", "machine num": 1 - }, - { - "name": "test_python-google-auth-help_function_auth", - "desc": "测试python-google-auth-help软件包的认证功能" - }, - { - "name": "test_python-google-auth-help_function_token", - "desc": "测试python-google-auth-help软件包的令牌功能" - }, - { - "name": "test_python-google-auth-help_function_http", - "desc": "测试python-google-auth-help软件包的HTTP请求功能" - }, - { - "name": "test_python-google-auth-help_function_credentials", - "desc": "测试默认凭据获取" - }, - { - "name": "test_python-google-auth-help_function_scoped_auth", - "desc": "测试带作用域认证" - }, - { - "name": "test_python-google-auth-help_function_refresh", - "desc": "测试访问令牌刷新" - }, - { - "name": "test_python-google-auth-help_function_service_acct", - "desc": "测试服务账号凭据" - }, - { - "name": "test_python-google-auth-help_function_http_auth", - "desc": "测试HTTP请求授权" - }, - { - "name": "test_python-google-auth-help_function_id_token", - "desc": "测试ID令牌获取" - }, - { - "name": "test_python-google-auth-help_function_user_auth", - "desc": "测试用户交互认证" - }, - { - "name": "test_python-google-auth-help_function_uninstall", - "desc": "测试软件包卸载" } ] } \ No newline at end of file diff --git a/suite2cases/function_test/pkg_test/python-pep517/python-pep517-help.json b/suite2cases/function_test/pkg_test/python-pep517/python-pep517-help.json deleted file mode 100644 index dc771d6e19d..00000000000 --- a/suite2cases/function_test/pkg_test/python-pep517/python-pep517-help.json +++ /dev/null @@ -1,26 +0,0 @@ -{ - "path": "$OET_PATH/testcases/function_test/pkg_test/python-pep517/python-pep517-help", - "machine num": 1, - "cases": [ - { - "name": "test_python-pep517-help_function_build", - "desc": "Test build functionality" - }, - { - "name": "test_python-pep517-help_function_install", - "desc": "Test package installation" - }, - { - "name": "test_python-pep517-help_function_uninstall", - "desc": "Test package uninstallation" - }, - { - "name": "test_python-pep517-help_function_import", - "desc": "Test basic module import" - }, - { - "name": "test_python-pep517-help_function_usage", - "desc": "Test common usage patterns" - } - ] -} \ No newline at end of file diff --git a/suite2cases/function_test/pkg_test/python-pyrpm/python3-pyrpm.json b/suite2cases/function_test/pkg_test/python-pyrpm/python3-pyrpm.json index 33ab541d1fe..50aefa8c7ba 100644 --- a/suite2cases/function_test/pkg_test/python-pyrpm/python3-pyrpm.json +++ b/suite2cases/function_test/pkg_test/python-pyrpm/python3-pyrpm.json @@ -13,18 +13,6 @@ { "name": "test_python3-pyrpm_function_remove", "desc": "Test removal of python3-pyrpm package" - }, - { - "name": "test_python3-pyrpm_function_read_header", - "desc": "Test reading RPM header info" - }, - { - "name": "test_python3-pyrpm_function_list_files", - "desc": "Test listing files in RPM" - }, - { - "name": "test_python3-pyrpm_function_check_deps", - "desc": "Test checking RPM dependencies" } ] } \ No newline at end of file diff --git a/suite2cases/function_test/pkg_test/python-smmap/python-smmap-help.json b/suite2cases/function_test/pkg_test/python-smmap/python-smmap-help.json index 755966b7295..d2b958bfcf9 100644 --- a/suite2cases/function_test/pkg_test/python-smmap/python-smmap-help.json +++ b/suite2cases/function_test/pkg_test/python-smmap/python-smmap-help.json @@ -7,17 +7,9 @@ "desc": "测试python-smmap-help软件包的安装功能,验证安装是否成功。", "machine num": 1 }, - { - "name": "test_python-smmap-help_function_uninstall", - "desc": "测试python-smmap-help软件包的卸载功能,验证卸载是否成功。" - }, { "name": "test_python-smmap-help_function_check_version", "desc": "测试python-smmap-help软件包的版本查询功能,验证是否能正确获取软件包版本信息。" - }, - { - "name": "test_python-smmap-help_function_import_module", - "desc": "测试python-smmap-help模块的导入功能,验证是否能成功导入并检查其关键属性。" } ] } \ No newline at end of file diff --git a/suite2cases/function_test/pkg_test/rpm/python3-rpm.json b/suite2cases/function_test/pkg_test/rpm/python3-rpm.json index 447ec7057ae..2561440734e 100644 --- a/suite2cases/function_test/pkg_test/rpm/python3-rpm.json +++ b/suite2cases/function_test/pkg_test/rpm/python3-rpm.json @@ -5,22 +5,6 @@ { "name": "test_python3-rpm_function_verify_package", "desc": "测试验证已安装 RPM 包文件完整性的功能。" - }, - { - "name": "test_python3-rpm_function_import_module", - "desc": "测试能否成功导入python3-rpm模块。" - }, - { - "name": "test_python3-rpm_function_check_install", - "desc": "测试验证python3-rpm软件包是否已正确安装。" - }, - { - "name": "test_python3-rpm_function_read_header", - "desc": "测试使用rpm模块读取已安装RPM包的头信息。" - }, - { - "name": "test_python3-rpm_function_query_package", - "desc": "测试查询系统已安装的指定RPM包信息。" } ] } \ No newline at end of file diff --git a/suite2cases/function_test/pkg_test/rubygem-gem2rpm/rubygem-gem2rpm-doc.json b/suite2cases/function_test/pkg_test/rubygem-gem2rpm/rubygem-gem2rpm-doc.json index 783178d0d9e..090cbcbc316 100644 --- a/suite2cases/function_test/pkg_test/rubygem-gem2rpm/rubygem-gem2rpm-doc.json +++ b/suite2cases/function_test/pkg_test/rubygem-gem2rpm/rubygem-gem2rpm-doc.json @@ -2,10 +2,6 @@ "path": "$OET_PATH/testcases/function_test/pkg_test/rubygem-gem2rpm/rubygem-gem2rpm-doc", "machine num": 1, "cases": [ - { - "name": "test_rubygem-gem2rpm-doc_function_docgen", - "desc": "Test documentation generation functionality" - }, { "name": "test_rubygem-gem2rpm-doc_function_install", "desc": "Test package installation" @@ -13,18 +9,6 @@ { "name": "test_rubygem-gem2rpm-doc_function_uninstall", "desc": "Test package removal" - }, - { - "name": "test_rubygem-gem2rpm-doc_function_help", - "desc": "Test help command output" - }, - { - "name": "test_rubygem-gem2rpm-doc_function_version", - "desc": "Test version command output" - }, - { - "name": "test_rubygem-gem2rpm-doc_function_basic_convert", - "desc": "Test basic gem to spec conversion" } ] } \ No newline at end of file diff --git a/suite2cases/function_test/pkg_test/texi2html/texi2html-help.json b/suite2cases/function_test/pkg_test/texi2html/texi2html-help.json index d8804b5e27c..e9fec5ff95b 100644 --- a/suite2cases/function_test/pkg_test/texi2html/texi2html-help.json +++ b/suite2cases/function_test/pkg_test/texi2html/texi2html-help.json @@ -6,10 +6,6 @@ "name": "test_texi2html-help_function_basic", "desc": "Basic functionality test for texi2html-help" }, - { - "name": "test_texi2html-help_function_install", - "desc": "Test installation of texi2html-help package" - }, { "name": "test_texi2html-help_function_check", "desc": "Test if texi2html-help is installed and available" @@ -17,18 +13,6 @@ { "name": "test_texi2html-help_function_help", "desc": "Test --help option for usage information" - }, - { - "name": "test_texi2html-help_function_version", - "desc": "Test --version option to display version" - }, - { - "name": "test_texi2html-help_function_convert", - "desc": "Test converting a simple .texi file to HTML" - }, - { - "name": "test_texi2html-help_function_uninstall", - "desc": "Test uninstallation of texi2html-help package" } ] } \ No newline at end of file diff --git a/suite2cases/function_test/pkg_test/texlive-base/texlive-epspdf.json b/suite2cases/function_test/pkg_test/texlive-base/texlive-epspdf.json deleted file mode 100644 index b69a848d034..00000000000 --- a/suite2cases/function_test/pkg_test/texlive-base/texlive-epspdf.json +++ /dev/null @@ -1,126 +0,0 @@ -{ - "path": "$OET_PATH/testcases/function_test/pkg_test/texlive-base/texlive-epspdf", - "machine num": 1, - "cases": [ - { - "name": "test_texlive-epspdf_function_uninstall", - "desc": "Test package uninstallation" - }, - { - "name": "test_texlive-epspdf_epspdf_basic_eps_to_pdf", - "desc": "测试epspdf命令将EPS文件转换为PDF文件的基本功能" - }, - { - "name": "test_texlive-epspdf_epspdf_basic_ps_to_pdf", - "desc": "测试epspdf命令将PS文件转换为PDF文件的基本功能" - }, - { - "name": "test_texlive-epspdf_epspdf_basic_pdf_to_eps", - "desc": "测试epspdf命令将PDF文件转换为EPS文件的基本功能" - }, - { - "name": "test_texlive-epspdf_epspdf_p", - "desc": "测试epspdf命令使用-p参数指定页面进行转换" - }, - { - "name": "test_texlive-epspdf_epspdf_g", - "desc": "测试epspdf命令使用-g参数将输出转换为灰度模式" - }, - { - "name": "test_texlive-epspdf_epspdf_b", - "desc": "测试epspdf命令使用-b参数计算紧密的边界框" - }, - { - "name": "test_texlive-epspdf_epspdf_upper_t", - "desc": "测试epspdf命令使用-T参数指定目标输出质量(如screen)" - }, - { - "name": "test_texlive-epspdf_epspdf_upper_n", - "desc": "测试epspdf命令使用-N参数指定PDF版本(如1.5)" - }, - { - "name": "test_texlive-epspdf_epspdf_upper_u", - "desc": "测试epspdf命令使用-U参数在可用时使用pdftops" - }, - { - "name": "test_texlive-epspdf_epspdf_upper_i", - "desc": "测试epspdf命令使用-I参数反转-U参数的行为" - }, - { - "name": "test_texlive-epspdf_epspdf_s", - "desc": "测试epspdf命令使用-s参数将设置保存到配置文件" - }, - { - "name": "test_texlive-epspdf_epspdf_i", - "desc": "测试epspdf命令使用-i参数显示检测到的文件类型信息" - }, - { - "name": "test_texlive-epspdf_epspdf_d", - "desc": "测试epspdf命令使用-d参数进行调试,不删除临时文件" - }, - { - "name": "test_texlive-epspdf_epspdf_v", - "desc": "测试epspdf命令使用-v参数显示版本信息" - }, - { - "name": "test_texlive-epspdf_epspdf_h", - "desc": "测试epspdf命令使用-h参数显示帮助信息" - }, - { - "name": "test_texlive-epspdf_epspdf_p_g", - "desc": "测试epspdf命令组合使用-p和-g参数" - }, - { - "name": "test_texlive-epspdf_epspdf_p_b", - "desc": "测试epspdf命令组合使用-p和-b参数" - }, - { - "name": "test_texlive-epspdf_epspdf_upper_t_upper_n", - "desc": "测试epspdf命令组合使用-T和-N参数" - }, - { - "name": "test_texlive-epspdf_epspdf_upper_u_upper_i", - "desc": "测试epspdf命令组合使用-U和-I参数" - }, - { - "name": "test_texlive-epspdf_epspdftk_v", - "desc": "测试显示版本信息" - }, - { - "name": "test_texlive-epspdf_epspdftk_h", - "desc": "测试显示帮助信息" - }, - { - "name": "test_texlive-epspdf_function_install", - "desc": "测试软件包安装功能" - }, - { - "name": "test_texlive-epspdf_function_check", - "desc": "检查epspdf命令是否安装" - }, - { - "name": "test_texlive-epspdf_function_eps2pdf", - "desc": "测试EPS转PDF常用功能" - }, - { - "name": "test_texlive-epspdf_function_ps2pdf", - "desc": "测试PS转PDF常用功能" - }, - { - "name": "test_texlive-epspdf_function_pdf2eps", - "desc": "测试PDF转EPS常用功能" - }, - { - "name": "test_texlive-epspdf_function_grayscale", - "desc": "测试灰度转换功能" - }, - { - "name": "test_texlive-epspdf_function_crop", - "desc": "测试裁剪边界框功能" - }, - { - "name": "test_texlive-epspdf_function_quality", - "desc": "测试指定输出质量" - } - ] -} \ No newline at end of file diff --git a/suite2cases/function_test/pkg_test/texlive-base/texlive-tex4ht.json b/suite2cases/function_test/pkg_test/texlive-base/texlive-tex4ht.json index f7b0ac8290a..cd084022f03 100644 --- a/suite2cases/function_test/pkg_test/texlive-base/texlive-tex4ht.json +++ b/suite2cases/function_test/pkg_test/texlive-base/texlive-tex4ht.json @@ -2,34 +2,6 @@ "path": "$OET_PATH/testcases/function_test/pkg_test/texlive-base/texlive-tex4ht", "machine num": 1, "cases": [ - { - "name": "test_texlive-tex4ht_ht__v", - "desc": "测试 ht 命令的 -v 参数" - }, - { - "name": "test_texlive-tex4ht_htcontext__v", - "desc": "测试 htcontext 命令的 -v 参数" - }, - { - "name": "test_texlive-tex4ht_htlatex__upper_v", - "desc": "测试 htlatex 命令的 V 参数" - }, - { - "name": "test_texlive-tex4ht_htlatex__v", - "desc": "测试 htlatex 命令的 v 参数" - }, - { - "name": "test_texlive-tex4ht_htmex_v", - "desc": "测试 htmex 命令的 -v 参数" - }, - { - "name": "test_texlive-tex4ht_htmex_upper_v", - "desc": "测试 htmex 命令的 -V 参数" - }, - { - "name": "test_texlive-tex4ht_htmex_num_1", - "desc": "测试 htmex 命令的 -1 参数" - }, { "name": "test_texlive-tex4ht_httex_v", "desc": "测试 httex 命令的 -v 参数" @@ -38,797 +10,9 @@ "name": "test_texlive-tex4ht_httexi_upper_v", "desc": "测试 httexi 命令的 -V 参数功能" }, - { - "name": "test_texlive-tex4ht_htxelatex__v", - "desc": "测试 htxelatex 命令的 -v 参数,验证是否显示版本信息" - }, - { - "name": "test_texlive-tex4ht_htxetex_v", - "desc": "测试 htxetex 命令的 -v 参数" - }, - { - "name": "test_texlive-tex4ht_htxetex_upper_v", - "desc": "测试 htxetex 命令的 -V 参数" - }, - { - "name": "test_texlive-tex4ht_htxetex_num_1", - "desc": "测试 htxetex 命令的 -1 参数" - }, - { - "name": "test_texlive-tex4ht_mk4ht_htlatex", - "desc": "测试使用 htlatex 命令生成 HTML 文件" - }, - { - "name": "test_texlive-tex4ht_mk4ht_xhlatex", - "desc": "测试使用 xhlatex 命令生成 HTML 文件" - }, - { - "name": "test_texlive-tex4ht_mk4ht_oolatex", - "desc": "测试使用 oolatex 命令生成 HTML 文件" - }, - { - "name": "test_texlive-tex4ht_mk4ht_dblatex", - "desc": "测试使用 dblatex 命令生成 HTML 文件" - }, - { - "name": "test_texlive-tex4ht_mk4ht_dbmlatex", - "desc": "测试使用 dbmlatex 命令生成 HTML 文件" - }, - { - "name": "test_texlive-tex4ht_mk4ht_jhlatex", - "desc": "测试使用 jhlatex 命令生成 HTML 文件" - }, - { - "name": "test_texlive-tex4ht_mk4ht_eslatex", - "desc": "测试使用 eslatex 命令生成 HTML 文件" - }, - { - "name": "test_texlive-tex4ht_mk4ht_teilatex", - "desc": "测试使用 teilatex 命令生成 HTML 文件" - }, - { - "name": "test_texlive-tex4ht_mk4ht_xetex", - "desc": "测试使用 xetex 命令生成 HTML 文件" - }, - { - "name": "test_texlive-tex4ht_t4ht_b", - "desc": "测试忽略 -d -m -M 参数对位图的影响" - }, - { - "name": "test_texlive-tex4ht_t4ht_c", - "desc": "测试选择环境文件中的命名段" - }, - { - "name": "test_texlive-tex4ht_t4ht_d", - "desc": "测试指定输出文件的目录" - }, - { - "name": "test_texlive-tex4ht_t4ht_e", - "desc": "测试指定 tex4ht.env 文件的位置" - }, - { - "name": "test_texlive-tex4ht_t4ht_i", - "desc": "测试调试信息的输出" - }, - { - "name": "test_texlive-tex4ht_t4ht_g", - "desc": "测试忽略系统调用中的错误" - }, - { - "name": "test_texlive-tex4ht_t4ht_m", - "desc": "测试设置新输出文件的权限" - }, - { - "name": "test_texlive-tex4ht_t4ht_p", - "desc": "测试不转换图片的功能" - }, - { - "name": "test_texlive-tex4ht_t4ht_r", - "desc": "测试替换所有字形的位图" - }, - { - "name": "test_texlive-tex4ht_t4ht_upper_m", - "desc": "测试设置所有输出文件的权限" - }, - { - "name": "test_texlive-tex4ht_t4ht_upper_q", - "desc": "测试在 tex4ht.c 出现问题时退出程序的功能" - }, - { - "name": "test_texlive-tex4ht_t4ht_upper_s", - "desc": "测试系统调用的权限设置" - }, - { - "name": "test_texlive-tex4ht_t4ht_upper_x", - "desc": "测试 X 脚本中 %%3 字段的内容设置" - }, { "name": "test_texlive-tex4ht_xhlatex_upper_v", "desc": "测试 xhlatex 命令的 -V 参数" - }, - { - "name": "test_texlive-tex4ht_xhlatex_v", - "desc": "测试 xhlatex 命令的 -v 参数" - }, - { - "name": "test_texlive-tex4ht_xhlatex_num_1", - "desc": "测试 xhlatex 命令的 -1 参数" - }, - { - "name": "test_texlive-tex4ht_function_htlatex_html", - "desc": "测试 htlatex 命令生成 HTML 文件的功能" - }, - { - "name": "test_texlive-tex4ht_ht_upper_v", - "desc": "测试ht命令的详细模式" - }, - { - "name": "test_texlive-tex4ht_ht_upper_d", - "desc": "测试ht命令的调试模式" - }, - { - "name": "test_texlive-tex4ht_ht_upper_f", - "desc": "测试ht命令的强制模式" - }, - { - "name": "test_texlive-tex4ht_ht_upper_q", - "desc": "测试ht命令的安静模式" - }, - { - "name": "test_texlive-tex4ht_ht_upper_i", - "desc": "测试ht命令的交互模式" - }, - { - "name": "test_texlive-tex4ht_ht_upper_a", - "desc": "测试ht命令的ASCII模式" - }, - { - "name": "test_texlive-tex4ht_ht_upper_e", - "desc": "测试ht命令的错误处理模式" - }, - { - "name": "test_texlive-tex4ht_ht_upper_o", - "desc": "测试ht命令的输出文件参数" - }, - { - "name": "test_texlive-tex4ht_ht_upper_l", - "desc": "测试ht命令的语言参数" - }, - { - "name": "test_texlive-tex4ht_ht_upper_m", - "desc": "测试ht命令的数学模式参数" - }, - { - "name": "test_texlive-tex4ht_htcontext_version", - "desc": "测试显示htcontext命令的版本信息" - }, - { - "name": "test_texlive-tex4ht_htcontext_help", - "desc": "测试显示htcontext命令的帮助信息" - }, - { - "name": "test_texlive-tex4ht_htcontext_upper_v", - "desc": "测试htcontext命令的详细输出模式" - }, - { - "name": "test_texlive-tex4ht_htcontext_upper_q", - "desc": "测试htcontext命令的安静模式" - }, - { - "name": "test_texlive-tex4ht_htcontext_upper_d", - "desc": "测试htcontext命令的调试模式" - }, - { - "name": "test_texlive-tex4ht_htcontext_upper_f", - "desc": "测试htcontext命令的强制模式" - }, - { - "name": "test_texlive-tex4ht_htcontext_upper_i", - "desc": "测试htcontext命令的交互模式" - }, - { - "name": "test_texlive-tex4ht_htcontext_upper_s", - "desc": "测试htcontext命令的模拟运行模式" - }, - { - "name": "test_texlive-tex4ht_htcontext_upper_u", - "desc": "测试htcontext命令的UTF-8模式" - }, - { - "name": "test_texlive-tex4ht_htlatex_upper_v", - "desc": "测试htlatex命令的-V参数,用于显示版本信息" - }, - { - "name": "test_texlive-tex4ht_htlatex_h", - "desc": "测试htlatex命令的-h参数,用于显示帮助信息" - }, - { - "name": "test_texlive-tex4ht_htlatex_l", - "desc": "测试htlatex命令的-l参数,用于指定LaTeX格式" - }, - { - "name": "test_texlive-tex4ht_htlatex_upper_f", - "desc": "测试htlatex命令的-F参数,用于指定配置文件" - }, - { - "name": "test_texlive-tex4ht_htlatex_upper_i", - "desc": "测试htlatex命令的-I参数,用于指定输入文件" - }, - { - "name": "test_texlive-tex4ht_htlatex_upper_d", - "desc": "测试htlatex命令的-D参数,用于指定输出目录" - }, - { - "name": "test_texlive-tex4ht_htlatex_upper_j", - "desc": "测试htlatex命令的-J参数,用于指定编码" - }, - { - "name": "test_texlive-tex4ht_htlatex_upper_c", - "desc": "测试htlatex命令的-C参数,用于指定自定义配置" - }, - { - "name": "test_texlive-tex4ht_htlatex_upper_a", - "desc": "测试htlatex命令的-A参数,用于指定额外的DVI过滤器参数" - }, - { - "name": "test_texlive-tex4ht_htlatex_upper_v_upper_f", - "desc": "测试htlatex命令的-V和-F参数组合,显示版本信息并指定配置文件" - }, - { - "name": "test_texlive-tex4ht_htlatex_h_upper_i", - "desc": "测试htlatex命令的-h和-I参数组合,显示帮助信息并指定输入文件" - }, - { - "name": "test_texlive-tex4ht_htlatex_l_upper_d", - "desc": "测试htlatex命令的-l和-D参数组合,指定LaTeX格式和输出目录" - }, - { - "name": "test_texlive-tex4ht_htlatex_upper_j_upper_c", - "desc": "测试htlatex命令的-J和-C参数组合,指定编码和自定义配置" - }, - { - "name": "test_texlive-tex4ht_htmex__upper_v", - "desc": "测试 htmex 命令的详细模式,用于显示处理过程中的详细信息" - }, - { - "name": "test_texlive-tex4ht_htmex__upper_f", - "desc": "测试 htmex 命令的强制模式,用于强制重新生成所有输出文件" - }, - { - "name": "test_texlive-tex4ht_htmex__upper_d", - "desc": "测试 htmex 命令的调试模式,用于输出调试信息" - }, - { - "name": "test_texlive-tex4ht_htmex__upper_h", - "desc": "测试 htmex 命令的帮助信息,用于显示命令的使用说明" - }, - { - "name": "test_texlive-tex4ht_htmex__upper_o", - "desc": "测试 htmex 命令的输出目录指定功能,用于将生成的文件输出到指定目录" - }, - { - "name": "test_texlive-tex4ht_htmex__upper_i", - "desc": "测试 htmex 命令的交互模式,用于在转换过程中进行交互式操作" - }, - { - "name": "test_texlive-tex4ht_htmex__upper_a", - "desc": "测试 htmex 命令的自动模式,用于自动处理文件转换过程中的依赖关系" - }, - { - "name": "test_texlive-tex4ht_htmex__upper_c", - "desc": "测试 htmex 命令的配置模式,用于指定配置文件" - }, - { - "name": "test_texlive-tex4ht_htmex__upper_s", - "desc": "测试 htmex 命令的静默模式,用于减少输出信息" - }, - { - "name": "test_texlive-tex4ht_htmex__upper_t", - "desc": "测试 htmex 命令的临时文件模式,用于保留临时文件以便调试" - }, - { - "name": "test_texlive-tex4ht_httex_upper_v", - "desc": "测试httex命令的详细版本信息输出" - }, - { - "name": "test_texlive-tex4ht_httex_upper_h", - "desc": "测试httex命令显示帮助信息" - }, - { - "name": "test_texlive-tex4ht_httex_upper_i", - "desc": "测试httex命令的交互模式" - }, - { - "name": "test_texlive-tex4ht_httex_upper_j", - "desc": "测试httex命令的字符集处理" - }, - { - "name": "test_texlive-tex4ht_httex_upper_u", - "desc": "测试httex命令的Unicode支持" - }, - { - "name": "test_texlive-tex4ht_httex_upper_l", - "desc": "测试httex命令的LaTeX模式" - }, - { - "name": "test_texlive-tex4ht_httex_upper_t", - "desc": "测试httex命令的TeX模式" - }, - { - "name": "test_texlive-tex4ht_httex_upper_f", - "desc": "测试httex命令的配置文件参数" - }, - { - "name": "test_texlive-tex4ht_httex_upper_d", - "desc": "测试httex命令的调试输出选项" - }, - { - "name": "test_texlive-tex4ht_httex_upper_c", - "desc": "测试httex命令的CSS样式表输出" - }, - { - "name": "test_texlive-tex4ht_httex_upper_s", - "desc": "测试httex命令的数学公式输出样式" - }, - { - "name": "test_texlive-tex4ht_httex_upper_a", - "desc": "测试httex命令的ASCII输出模式" - }, - { - "name": "test_texlive-tex4ht_httex_upper_e", - "desc": "测试httex命令的编码设置" - }, - { - "name": "test_texlive-tex4ht_httexi_upper_h", - "desc": "测试httexi命令的帮助信息输出" - }, - { - "name": "test_texlive-tex4ht_httexi_upper_q", - "desc": "测试httexi命令的安静模式,减少输出" - }, - { - "name": "test_texlive-tex4ht_httexi_upper_f", - "desc": "测试httexi命令的强制模式,覆盖现有文件" - }, - { - "name": "test_texlive-tex4ht_httexi_upper_l", - "desc": "测试httexi命令的LaTeX模式,使用latex命令处理" - }, - { - "name": "test_texlive-tex4ht_httexi_upper_p", - "desc": "测试httexi命令的PDF模式,使用pdflatex命令处理" - }, - { - "name": "test_texlive-tex4ht_httexi_upper_x", - "desc": "测试httexi命令的XeTeX模式,使用xelatex命令处理" - }, - { - "name": "test_texlive-tex4ht_httexi_upper_lu", - "desc": "测试httexi命令的LuaTeX模式,使用lualatex命令处理" - }, - { - "name": "test_texlive-tex4ht_htxelatex_no_args", - "desc": "测试不带任何参数执行htxelatex命令" - }, - { - "name": "test_texlive-tex4ht_htxelatex_upper_i", - "desc": "测试htxelatex命令的-I参数,用于指定输入文件" - }, - { - "name": "test_texlive-tex4ht_htxelatex_upper_o", - "desc": "测试htxelatex命令的-O参数,用于指定输出目录" - }, - { - "name": "test_texlive-tex4ht_htxelatex_upper_j", - "desc": "测试htxelatex命令的-J参数,用于指定配置文件" - }, - { - "name": "test_texlive-tex4ht_htxelatex_upper_p", - "desc": "测试htxelatex命令的-P参数,用于指定配置文件路径" - }, - { - "name": "test_texlive-tex4ht_htxelatex_upper_c", - "desc": "测试htxelatex命令的-C参数,用于指定配置文件" - }, - { - "name": "test_texlive-tex4ht_htxelatex_upper_d", - "desc": "测试htxelatex命令的-D参数,用于指定输出目录" - }, - { - "name": "test_texlive-tex4ht_htxelatex_upper_a", - "desc": "测试htxelatex命令的-A参数,用于指定额外的参数传递给tex4ht" - }, - { - "name": "test_texlive-tex4ht_htxelatex_upper_m", - "desc": "测试htxelatex命令的-M参数,用于指定make4ht的构建文件" - }, - { - "name": "test_texlive-tex4ht_htxelatex_upper_e", - "desc": "测试htxelatex命令的-E参数,用于指定使用指定的引擎" - }, - { - "name": "test_texlive-tex4ht_htxelatex_upper_x", - "desc": "测试htxelatex命令的-X参数,用于指定执行额外的命令" - }, - { - "name": "test_texlive-tex4ht_htxelatex_upper_u", - "desc": "测试htxelatex命令的-U参数,用于更新make4ht的数据库" - }, - { - "name": "test_texlive-tex4ht_htxelatex_upper_q", - "desc": "测试htxelatex命令的-Q参数,用于静默模式" - }, - { - "name": "test_texlive-tex4ht_htxelatex_upper_v", - "desc": "测试htxelatex命令的-V参数,用于显示版本信息" - }, - { - "name": "test_texlive-tex4ht_htxelatex_upper_h", - "desc": "测试htxelatex命令的-H参数,用于显示帮助信息" - }, - { - "name": "test_texlive-tex4ht_htxelatex_upper_l", - "desc": "测试htxelatex命令的-L参数,用于显示许可证信息" - }, - { - "name": "test_texlive-tex4ht_htxelatex_upper_s", - "desc": "测试htxelatex命令的-S参数,用于显示系统信息" - }, - { - "name": "test_texlive-tex4ht_htxetex_help", - "desc": "测试 htxetex 命令的 --help 参数,验证是否显示帮助信息" - }, - { - "name": "test_texlive-tex4ht_htxetex_version", - "desc": "测试 htxetex 命令的 --version 参数,验证是否显示版本信息" - }, - { - "name": "test_texlive-tex4ht_htxetex_upper_i", - "desc": "测试 htxetex 命令的 -I 参数,验证是否显示提示信息" - }, - { - "name": "test_texlive-tex4ht_htxetex_upper_j", - "desc": "测试 htxetex 命令的 -J 参数,验证是否指定字体文件" - }, - { - "name": "test_texlive-tex4ht_htxetex_upper_k", - "desc": "测试 htxetex 命令的 -K 参数,验证是否处理特定字符集" - }, - { - "name": "test_texlive-tex4ht_htxetex_upper_l", - "desc": "测试 htxetex 命令的 -L 参数,验证是否使用特定语言设置" - }, - { - "name": "test_texlive-tex4ht_htxetex_upper_m", - "desc": "测试 htxetex 命令的 -M 参数,验证是否使用特定模式" - }, - { - "name": "test_texlive-tex4ht_htxetex_upper_n", - "desc": "测试 htxetex 命令的 -N 参数,验证是否禁止特定功能" - }, - { - "name": "test_texlive-tex4ht_htxetex_upper_o", - "desc": "测试 htxetex 命令的 -O 参数,验证是否设置输出选项" - }, - { - "name": "test_texlive-tex4ht_htxetex_upper_p", - "desc": "测试 htxetex 命令的 -P 参数,验证是否使用特定配置文件" - }, - { - "name": "test_texlive-tex4ht_htxetex_upper_q", - "desc": "测试 htxetex 命令的 -Q 参数,验证是否静默模式运行" - }, - { - "name": "test_texlive-tex4ht_htxetex_upper_r", - "desc": "测试 htxetex 命令的 -R 参数,验证是否递归处理文件" - }, - { - "name": "test_texlive-tex4ht_htxetex_upper_s", - "desc": "测试 htxetex 命令的 -S 参数,验证是否使用安全模式" - }, - { - "name": "test_texlive-tex4ht_htxetex_upper_t", - "desc": "测试 htxetex 命令的 -T 参数,验证是否指定输出类型" - }, - { - "name": "test_texlive-tex4ht_htxetex_upper_u", - "desc": "测试 htxetex 命令的 -U 参数,验证是否使用Unicode编码" - }, - { - "name": "test_texlive-tex4ht_htxetex_upper_w", - "desc": "测试 htxetex 命令的 -W 参数,验证是否显示警告信息" - }, - { - "name": "test_texlive-tex4ht_htxetex_upper_x", - "desc": "测试 htxetex 命令的 -X 参数,验证是否使用扩展功能" - }, - { - "name": "test_texlive-tex4ht_htxetex_upper_y", - "desc": "测试 htxetex 命令的 -Y 参数,验证是否使用特定年份" - }, - { - "name": "test_texlive-tex4ht_htxetex_upper_z", - "desc": "测试 htxetex 命令的 -Z 参数,验证是否压缩输出" - }, - { - "name": "test_texlive-tex4ht_mk4ht_htlatex_with_tex_args", - "desc": "使用 htlatex 处理 .tex 文件,并为 latex 命令指定额外参数" - }, - { - "name": "test_texlive-tex4ht_mk4ht_htlatex_with_tex4ht_args", - "desc": "使用 htlatex 处理 .tex 文件,并为 tex4ht.c 指定额外参数" - }, - { - "name": "test_texlive-tex4ht_mk4ht_htlatex_with_t4ht_args", - "desc": "使用 htlatex 处理 .tex 文件,并为 t4ht.c 指定额外参数" - }, - { - "name": "test_texlive-tex4ht_mk4ht_ht", - "desc": "使用 mk4ht ht 格式,指定 latex 引擎处理 .tex 文件" - }, - { - "name": "test_texlive-tex4ht_mk4ht_tex", - "desc": "使用 tex 引擎(而非 latex)处理 .tex 文件" - }, - { - "name": "test_texlive-tex4ht_mk4ht_xelatex", - "desc": "使用 xelatex 引擎处理 .tex 文件" - }, - { - "name": "test_texlive-tex4ht_mk4ht_no_filename", - "desc": "不带文件名参数调用 mk4ht,触发未初始化变量警告" - }, - { - "name": "test_texlive-tex4ht_t4ht_special_dot", - "desc": "测试为.脚本中的%%2字段提供内容的功能" - }, - { - "name": "test_texlive-tex4ht_tex4ht_f_path_separator", - "desc": "测试使用 -f 参数指定路径分隔符" - }, - { - "name": "test_texlive-tex4ht_tex4ht_dot_ext", - "desc": "测试使用 -. 参数指定替换默认的 .dvi 文件扩展名" - }, - { - "name": "test_texlive-tex4ht_tex4ht_c_tag_name", - "desc": "测试使用 -c 参数选择环境文件中的指定段" - }, - { - "name": "test_texlive-tex4ht_tex4ht_e_env_file", - "desc": "测试使用 -e 参数指定环境文件" - }, - { - "name": "test_texlive-tex4ht_tex4ht_f_path_separator_ch", - "desc": "测试使用 -f 参数从文件名中移除路径" - }, - { - "name": "test_texlive-tex4ht_tex4ht_upper_f_ch_code", - "desc": "测试使用 -F 参数指定缺失字体字符的替换码" - }, - { - "name": "test_texlive-tex4ht_tex4ht_g_bitmap_file_ext", - "desc": "测试使用 -g 参数指定位图文件扩展名" - }, - { - "name": "test_texlive-tex4ht_tex4ht_h_e", - "desc": "测试使用 -h 参数并启用 e 选项来跟踪错误/警告" - }, - { - "name": "test_texlive-tex4ht_tex4ht_h_f", - "desc": "测试使用 -h 参数并启用 f 选项来跟踪 htf 字体" - }, - { - "name": "test_texlive-tex4ht_tex4ht_h_upper_f", - "desc": "测试使用 -h 参数并启用 F 选项来跟踪 htf 字体搜索" - }, - { - "name": "test_texlive-tex4ht_tex4ht_h_g", - "desc": "测试使用 -h 参数并启用 g 选项来跟踪组" - }, - { - "name": "test_texlive-tex4ht_tex4ht_h_s", - "desc": "测试使用 -h 参数并启用 s 选项来跟踪特殊命令" - }, - { - "name": "test_texlive-tex4ht_tex4ht_h_v", - "desc": "测试使用 -h 参数并启用 v 选项来跟踪环境变量" - }, - { - "name": "test_texlive-tex4ht_tex4ht_h_upper_v", - "desc": "测试使用 -h 参数并启用 V 选项来跟踪环境变量搜索" - }, - { - "name": "test_texlive-tex4ht_tex4ht_h_upper_a", - "desc": "测试使用 -h 参数并启用 A 选项来跟踪所有信息" - }, - { - "name": "test_texlive-tex4ht_tex4ht_i_htf_font_dir", - "desc": "测试使用 -i 参数指定 htf 字体目录" - }, - { - "name": "test_texlive-tex4ht_tex4ht_l_bookkeeping_file", - "desc": "测试使用 -l 参数指定簿记文件" - }, - { - "name": "test_texlive-tex4ht_tex4ht_upper_p_star", - "desc": "测试使用 -P 参数并指定 * 以始终允许系统调用" - }, - { - "name": "test_texlive-tex4ht_tex4ht_upper_p_filter", - "desc": "测试使用 -P 参数并指定过滤器以控制系统调用权限" - }, - { - "name": "test_texlive-tex4ht_tex4ht_upper_s_image_script", - "desc": "测试使用 -S 参数指定图像脚本" - }, - { - "name": "test_texlive-tex4ht_tex4ht_s_css_file_ext", - "desc": "测试使用 -s 参数指定 CSS 文件扩展名,默认 -s4cs" - }, - { - "name": "test_texlive-tex4ht_tex4ht_t_tfm_font_dir", - "desc": "测试使用 -t 参数指定 tfm 字体目录" - }, - { - "name": "test_texlive-tex4ht_tex4ht_u_num_10", - "desc": "测试使用 -u10 参数以 10 为基数处理 Unicode 字符" - }, - { - "name": "test_texlive-tex4ht_tex4ht_utf8", - "desc": "测试使用 -utf8 参数指定 Unicode 字符使用 UTF-8 编码" - }, - { - "name": "test_texlive-tex4ht_tex4ht_v_idv_version", - "desc": "测试使用 -v 参数替换给定的 dvi 版本" - }, - { - "name": "test_texlive-tex4ht_tex4ht_xs", - "desc": "测试使用 -xs 参数为自动生成的 GIF 文件使用 MS-DOS 文件名" - }, - { - "name": "test_texlive-tex4ht_xhlatex_no_args", - "desc": "测试不带参数运行xhlatex命令" - }, - { - "name": "test_texlive-tex4ht_xhlatex_upper_h", - "desc": "测试带-H参数运行xhlatex命令" - }, - { - "name": "test_texlive-tex4ht_xhlatex_upper_i", - "desc": "测试带-I参数运行xhlatex命令" - }, - { - "name": "test_texlive-tex4ht_xhlatex_upper_d", - "desc": "测试带-D参数运行xhlatex命令" - }, - { - "name": "test_texlive-tex4ht_xhlatex_upper_f", - "desc": "测试带-F参数运行xhlatex命令" - }, - { - "name": "test_texlive-tex4ht_xhlatex_upper_m", - "desc": "测试带-M参数运行xhlatex命令" - }, - { - "name": "test_texlive-tex4ht_xhlatex_upper_s", - "desc": "测试带-S参数运行xhlatex命令" - }, - { - "name": "test_texlive-tex4ht_xhlatex_upper_c", - "desc": "测试带-C参数运行xhlatex命令" - }, - { - "name": "test_texlive-tex4ht_xhlatex_upper_a", - "desc": "测试带-A参数运行xhlatex命令" - }, - { - "name": "test_texlive-tex4ht_xhlatex_upper_l", - "desc": "测试带-L参数运行xhlatex命令" - }, - { - "name": "test_texlive-tex4ht_xhlatex_upper_x", - "desc": "测试带-X参数运行xhlatex命令" - }, - { - "name": "test_texlive-tex4ht_xhlatex_upper_u", - "desc": "测试带-U参数运行xhlatex命令" - }, - { - "name": "test_texlive-tex4ht_xhlatex_upper_q", - "desc": "测试带-Q参数运行xhlatex命令" - }, - { - "name": "test_texlive-tex4ht_xhlatex_upper_p", - "desc": "测试带-P参数运行xhlatex命令" - }, - { - "name": "test_texlive-tex4ht_xhlatex_upper_o", - "desc": "测试带-O参数运行xhlatex命令" - }, - { - "name": "test_texlive-tex4ht_xhlatex_upper_n", - "desc": "测试带-N参数运行xhlatex命令" - }, - { - "name": "test_texlive-tex4ht_xhlatex_upper_e", - "desc": "测试带-E参数运行xhlatex命令" - }, - { - "name": "test_texlive-tex4ht_xhlatex_upper_t", - "desc": "测试带-T参数运行xhlatex命令" - }, - { - "name": "test_texlive-tex4ht_xhlatex_upper_r", - "desc": "测试带-R参数运行xhlatex命令" - }, - { - "name": "test_texlive-tex4ht_xhlatex_upper_w", - "desc": "测试带-W参数运行xhlatex命令" - }, - { - "name": "test_texlive-tex4ht_xhlatex_upper_y", - "desc": "测试带-Y参数运行xhlatex命令" - }, - { - "name": "test_texlive-tex4ht_xhlatex_upper_z", - "desc": "测试带-Z参数运行xhlatex命令" - }, - { - "name": "test_texlive-tex4ht_xhlatex_upper_j", - "desc": "测试带-J参数运行xhlatex命令" - }, - { - "name": "test_texlive-tex4ht_xhlatex_upper_k", - "desc": "测试带-K参数运行xhlatex命令" - }, - { - "name": "test_texlive-tex4ht_xhlatex_upper_g", - "desc": "测试带-G参数运行xhlatex命令" - }, - { - "name": "test_texlive-tex4ht_xhlatex_upper_b", - "desc": "测试带-B参数运行xhlatex命令" - }, - { - "name": "test_texlive-tex4ht_function_install", - "desc": "测试 texlive-tex4ht 软件包的安装功能" - }, - { - "name": "test_texlive-tex4ht_function_uninstall", - "desc": "测试 texlive-tex4ht 软件包的卸载功能" - }, - { - "name": "test_texlive-tex4ht_function_check", - "desc": "检查 texlive-tex4ht 软件包是否已安装" - }, - { - "name": "test_texlive-tex4ht_function_basic_usage", - "desc": "测试使用 htlatex 转换基本 LaTeX 文件为 HTML" - }, - { - "name": "test_texlive-tex4ht_function_make4ht_usage", - "desc": "测试使用 mk4ht 命令处理 LaTeX 文件" - }, - { - "name": "test_texlive-tex4ht_function_config_file", - "desc": "测试使用自定义配置文件转换 LaTeX" - }, - { - "name": "test_texlive-tex4ht_function_output_dir", - "desc": "测试指定输出目录的 LaTeX 到 HTML 转换" - }, - { - "name": "test_texlive-tex4ht_function_convert_with_images", - "desc": "测试转换包含图片的 LaTeX 文件" - }, - { - "name": "test_texlive-tex4ht_function_convert_math", - "desc": "测试转换包含数学公式的 LaTeX 文件" - }, - { - "name": "test_texlive-tex4ht_function_batch_convert", - "desc": "测试批量转换多个 LaTeX 文件为 HTML" } ] } \ No newline at end of file diff --git a/suite2cases/function_test/pkg_test/texlive-split-c/texlive-biolett-bst.json b/suite2cases/function_test/pkg_test/texlive-split-c/texlive-biolett-bst.json index d8cb9a7e5ec..1856963ea07 100644 --- a/suite2cases/function_test/pkg_test/texlive-split-c/texlive-biolett-bst.json +++ b/suite2cases/function_test/pkg_test/texlive-split-c/texlive-biolett-bst.json @@ -2,22 +2,6 @@ "path": "$OET_PATH/testcases/function_test/pkg_test/texlive-split-c/texlive-biolett-bst", "machine num": 1, "cases": [ - { - "name": "test_texlive-biolett-bst_function_bibstyle", - "desc": "Verify bibstyle generation" - }, - { - "name": "test_texlive-biolett-bst_function_install", - "desc": "Verify package installation" - }, - { - "name": "test_texlive-biolett-bst_function_latexdoc", - "desc": "Verify LaTeX document compilation with biolett.bst" - }, - { - "name": "test_texlive-biolett-bst_function_bibtexrun", - "desc": "Verify BibTeX processes bibliography using biolett.bst" - }, { "name": "test_texlive-biolett-bst_function_uninstall", "desc": "Verify package uninstallation" diff --git a/suite2cases/function_test/pkg_test/texlive-split-d/texlive-cite.json b/suite2cases/function_test/pkg_test/texlive-split-d/texlive-cite.json deleted file mode 100644 index 5e24f4841e3..00000000000 --- a/suite2cases/function_test/pkg_test/texlive-split-d/texlive-cite.json +++ /dev/null @@ -1,10 +0,0 @@ -{ - "path": "$OET_PATH/testcases/function_test/pkg_test/texlive-split-d/texlive-cite", - "machine num": 1, - "cases": [ - { - "name": "test_texlive-cite_function_bib", - "desc": "Test bibliography citation" - } - ] -} \ No newline at end of file diff --git a/suite2cases/function_test/pkg_test/texlive-split-f/texlive-ctex.json b/suite2cases/function_test/pkg_test/texlive-split-f/texlive-ctex.json deleted file mode 100644 index 02e6f41add8..00000000000 --- a/suite2cases/function_test/pkg_test/texlive-split-f/texlive-ctex.json +++ /dev/null @@ -1,10 +0,0 @@ -{ - "path": "$OET_PATH/testcases/function_test/pkg_test/texlive-split-f/texlive-ctex", - "machine num": 1, - "cases": [ - { - "name": "test_texlive-ctex_function_basic", - "desc": "Test basic commands" - } - ] -} \ No newline at end of file diff --git a/suite2cases/function_test/pkg_test/texlive-split-f/texlive-dcpic.json b/suite2cases/function_test/pkg_test/texlive-split-f/texlive-dcpic.json deleted file mode 100644 index 4079131078e..00000000000 --- a/suite2cases/function_test/pkg_test/texlive-split-f/texlive-dcpic.json +++ /dev/null @@ -1,10 +0,0 @@ -{ - "path": "$OET_PATH/testcases/function_test/pkg_test/texlive-split-f/texlive-dcpic", - "machine num": 1, - "cases": [ - { - "name": "test_texlive-dcpic_function_basic", - "desc": "Basic functionality test" - } - ] -} \ No newline at end of file diff --git a/suite2cases/function_test/pkg_test/texlive-split-h/texlive-eulervm.json b/suite2cases/function_test/pkg_test/texlive-split-h/texlive-eulervm.json deleted file mode 100644 index 19b9d5e7c2a..00000000000 --- a/suite2cases/function_test/pkg_test/texlive-split-h/texlive-eulervm.json +++ /dev/null @@ -1,10 +0,0 @@ -{ - "path": "$OET_PATH/testcases/function_test/pkg_test/texlive-split-h/texlive-eulervm", - "machine num": 1, - "cases": [ - { - "name": "test_texlive-eulervm_function_rendering", - "desc": "Test rendering of EulerVM fonts" - } - ] -} \ No newline at end of file diff --git a/suite2cases/function_test/pkg_test/texlive-split-i/texlive-fixfoot-doc.json b/suite2cases/function_test/pkg_test/texlive-split-i/texlive-fixfoot-doc.json deleted file mode 100644 index ae3162dbcbe..00000000000 --- a/suite2cases/function_test/pkg_test/texlive-split-i/texlive-fixfoot-doc.json +++ /dev/null @@ -1,10 +0,0 @@ -{ - "path": "$OET_PATH/testcases/function_test/pkg_test/texlive-split-i/texlive-fixfoot-doc", - "machine num": 1, - "cases": [ - { - "name": "test_texlive-fixfoot-doc_function_install", - "desc": "Test package installation" - } - ] -} \ No newline at end of file diff --git a/suite2cases/function_test/pkg_test/texlive-split-i/texlive-footmisc-doc.json b/suite2cases/function_test/pkg_test/texlive-split-i/texlive-footmisc-doc.json index 6e700a44847..9865ebdb692 100644 --- a/suite2cases/function_test/pkg_test/texlive-split-i/texlive-footmisc-doc.json +++ b/suite2cases/function_test/pkg_test/texlive-split-i/texlive-footmisc-doc.json @@ -9,18 +9,6 @@ { "name": "test_texlive-footmisc-doc_function_check_installed", "desc": "Check if the package is installed on the system" - }, - { - "name": "test_texlive-footmisc-doc_function_verify_files", - "desc": "Verify the existence of key documentation files" - }, - { - "name": "test_texlive-footmisc-doc_function_use_manpage", - "desc": "Test accessing the package man page" - }, - { - "name": "test_texlive-footmisc-doc_function_use_info", - "desc": "Test accessing the package info documentation" } ] } \ No newline at end of file diff --git a/suite2cases/function_test/pkg_test/texlive-split-l/texlive-hyphen-basque.json b/suite2cases/function_test/pkg_test/texlive-split-l/texlive-hyphen-basque.json index 01fa72be07b..94689dfb904 100644 --- a/suite2cases/function_test/pkg_test/texlive-split-l/texlive-hyphen-basque.json +++ b/suite2cases/function_test/pkg_test/texlive-split-l/texlive-hyphen-basque.json @@ -6,21 +6,9 @@ "name": "test_texlive-hyphen-basque_function_install", "desc": "Test package installation" }, - { - "name": "test_texlive-hyphen-basque_function_check_installed", - "desc": "Verify the package is correctly installed" - }, { "name": "test_texlive-hyphen-basque_function_remove", "desc": "Test package removal" - }, - { - "name": "test_texlive-hyphen-basque_function_verify_patterns", - "desc": "Verify Basque hyphenation patterns exist" - }, - { - "name": "test_texlive-hyphen-basque_function_usage", - "desc": "Test basic LaTeX hyphenation usage" } ] } \ No newline at end of file diff --git a/suite2cases/function_test/pkg_test/texlive-split-o/texlive-mattens.json b/suite2cases/function_test/pkg_test/texlive-split-o/texlive-mattens.json index 4eef1192ae3..7ee7ee41a19 100644 --- a/suite2cases/function_test/pkg_test/texlive-split-o/texlive-mattens.json +++ b/suite2cases/function_test/pkg_test/texlive-split-o/texlive-mattens.json @@ -2,10 +2,6 @@ "path": "$OET_PATH/testcases/function_test/pkg_test/texlive-split-o/texlive-mattens", "machine num": 1, "cases": [ - { - "name": "test_texlive-mattens_function_install", - "desc": "Test package installation" - }, { "name": "test_texlive-mattens_function_remove", "desc": "Test package removal" @@ -13,10 +9,6 @@ { "name": "test_texlive-mattens_function_exist", "desc": "Test if package is installed" - }, - { - "name": "test_texlive-mattens_function_usage", - "desc": "Test LaTeX document compile" } ] } \ No newline at end of file diff --git a/suite2cases/function_test/pkg_test/texlive-split-p/texlive-nkarta.json b/suite2cases/function_test/pkg_test/texlive-split-p/texlive-nkarta.json index ed125001535..e961f2adbc7 100644 --- a/suite2cases/function_test/pkg_test/texlive-split-p/texlive-nkarta.json +++ b/suite2cases/function_test/pkg_test/texlive-split-p/texlive-nkarta.json @@ -5,10 +5,6 @@ { "name": "test_texlive-nkarta_function_uninstall", "desc": "Test package uninstallation" - }, - { - "name": "test_texlive-nkarta_function_basic", - "desc": "Test basic functionality" } ] } \ No newline at end of file diff --git a/suite2cases/function_test/pkg_test/texlive-split-u/texlive-sectionbreak.json b/suite2cases/function_test/pkg_test/texlive-split-u/texlive-sectionbreak.json deleted file mode 100644 index eda0ca81309..00000000000 --- a/suite2cases/function_test/pkg_test/texlive-split-u/texlive-sectionbreak.json +++ /dev/null @@ -1,10 +0,0 @@ -{ - "path": "$OET_PATH/testcases/function_test/pkg_test/texlive-split-u/texlive-sectionbreak", - "machine num": 1, - "cases": [ - { - "name": "test_texlive-sectionbreak_function_sectionbreak", - "desc": "Test the section break functionality in texlive-sectionbreak" - } - ] -} \ No newline at end of file diff --git a/suite2cases/function_test/pkg_test/texlive-split-y/texlive-dpcircling.json b/suite2cases/function_test/pkg_test/texlive-split-y/texlive-dpcircling.json deleted file mode 100644 index fad22d22471..00000000000 --- a/suite2cases/function_test/pkg_test/texlive-split-y/texlive-dpcircling.json +++ /dev/null @@ -1,22 +0,0 @@ -{ - "path": "$OET_PATH/testcases/function_test/pkg_test/texlive-split-y/texlive-dpcircling", - "machine num": 1, - "cases": [ - { - "name": "test_texlive-dpcircling_function_basic", - "desc": "Basic functionality test" - }, - { - "name": "test_texlive-dpcircling_function_install", - "desc": "Test installation of the texlive-dpcircling package" - }, - { - "name": "test_texlive-dpcircling_function_basic_cmd", - "desc": "Test basic circling command usage" - }, - { - "name": "test_texlive-dpcircling_function_remove", - "desc": "Test removal of the texlive-dpcircling package" - } - ] -} \ No newline at end of file diff --git a/suite2cases/function_test/pkg_test/texlive-split-y/texlive-wordlike-doc.json b/suite2cases/function_test/pkg_test/texlive-split-y/texlive-wordlike-doc.json deleted file mode 100644 index f7abc927548..00000000000 --- a/suite2cases/function_test/pkg_test/texlive-split-y/texlive-wordlike-doc.json +++ /dev/null @@ -1,10 +0,0 @@ -{ - "path": "$OET_PATH/testcases/function_test/pkg_test/texlive-split-y/texlive-wordlike-doc", - "machine num": 1, - "cases": [ - { - "name": "test_texlive-wordlike-doc_function_install", - "desc": "Test installation of texlive-wordlike-doc" - } - ] -} \ No newline at end of file diff --git a/suite2cases/function_test/pkg_test/texlive-split-z/texlive-zxjatype.json b/suite2cases/function_test/pkg_test/texlive-split-z/texlive-zxjatype.json deleted file mode 100644 index 1ae403ae99a..00000000000 --- a/suite2cases/function_test/pkg_test/texlive-split-z/texlive-zxjatype.json +++ /dev/null @@ -1,10 +0,0 @@ -{ - "path": "$OET_PATH/testcases/function_test/pkg_test/texlive-split-z/texlive-zxjatype", - "machine num": 1, - "cases": [ - { - "name": "test_texlive-zxjatype_function_install", - "desc": "Test package installation" - } - ] -} \ No newline at end of file diff --git a/testcases/function_test/pkg_test/arquillian-core/arquillian-testng-core/test_arquillian-testng-core_function_execute.sh b/testcases/function_test/pkg_test/arquillian-core/arquillian-testng-core/test_arquillian-testng-core_function_execute.sh deleted file mode 100644 index 59264c6e79e..00000000000 --- a/testcases/function_test/pkg_test/arquillian-core/arquillian-testng-core/test_arquillian-testng-core_function_execute.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-10 -# @License : Mulan PSL v2 -# @Desc : Test execution of arquillian-testng-core -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - LOG_INFO "开始测试:Test execution of arquillian-testng-core" - - # 检查是否已安装arquillian-testng-core - LOG_INFO "检查是否已安装arquillian-testng-core" - dnf list installed arquillian-testng-core > /dev/null 2>&1 - if [ $? -eq 0 ]; then - LOG_INFO "arquillian-testng-core已安装,测试结束后将保持安装状态" - INSTALLED=true - else - LOG_INFO "arquillian-testng-core未安装,测试结束后将卸载" - INSTALLED=false - fi - - # 检查yum源中是否有arquillian-testng-core软件包 - LOG_INFO "检查yum源中是否有arquillian-testng-core软件包" - dnf list available arquillian-testng-core > /dev/null 2>&1 - CHECK_RESULT $? 0 255 "yum源中未找到arquillian-testng-core软件包" - - # 安装arquillian-testng-core - if [ "$INSTALLED" = false ]; then - LOG_INFO "开始安装arquillian-testng-core" - dnf install -y arquillian-testng-core > /dev/null 2>&1 - CHECK_RESULT $? 0 0 "安装arquillian-testng-core失败" - fi - - # 测试arquillian-testng-core功能 - LOG_INFO "测试arquillian-testng-core功能执行" - test_command="arquillian-testng-core --version" - eval $test_command > /dev/null 2>&1 - CHECK_RESULT $? 0 255 "arquillian-testng-core命令执行失败或参数不支持" - - # 清理环境 - if [ "$INSTALLED" = false ]; then - LOG_INFO "卸载arquillian-testng-core" - dnf remove -y arquillian-testng-core > /dev/null 2>&1 - CHECK_RESULT $? 0 0 "卸载arquillian-testng-core失败" - fi - - LOG_INFO "测试完成:Test execution of arquillian-testng-core" -} - -main "$@" \ No newline at end of file diff --git a/testcases/function_test/pkg_test/arquillian-core/arquillian-testng-core/test_arquillian-testng-core_function_init.sh b/testcases/function_test/pkg_test/arquillian-core/arquillian-testng-core/test_arquillian-testng-core_function_init.sh deleted file mode 100644 index aeeab996b07..00000000000 --- a/testcases/function_test/pkg_test/arquillian-core/arquillian-testng-core/test_arquillian-testng-core_function_init.sh +++ /dev/null @@ -1,63 +0,0 @@ -#!/usr/bin/bash - -# Copyright (c) 2024 ISCAS .ALL rights reserved. -# This program is licensed under Mulan PSL v2. -# You can use it according to the terms and conditions of the Mulan PSL v2. -# http://license.coscl.org.cn/MulanPSL2 -# THIS PROGRAM IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, -# EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, -# MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. -# See the Mulan PSL v2 for more details. - -# ############################################# -# @Author : honghua -# @Contact : honghua@iscas.ac.cn -# @Date : 2025-11-29 -# @License : Mulan PSL v2 -# @Desc : Test initialization of arquillian-testng-core -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - - # 检查arquillian-testng-core是否已安装 - LOG_INFO "检查arquillian-testng-core是否已安装" - rpm -q arquillian-testng-core > /dev/null 2>&1 - if [ $? -eq 0 ]; then - LOG_INFO "arquillian-testng-core已安装,脚本结束时将保持安装状态" - INSTALLED=true - else - LOG_INFO "arquillian-testng-core未安装,将在测试结束后卸载" - INSTALLED=false - fi - - # 检查yum源中是否有arquillian-testng-core软件包 - LOG_INFO "检查yum源中是否有arquillian-testng-core软件包" - dnf list available arquillian-testng-core > /dev/null 2>&1 - CHECK_RESULT $? 0 255 "yum源中未找到arquillian-testng-core软件包" - - # 安装arquillian-testng-core - if [ "$INSTALLED" = false ]; then - LOG_INFO "安装arquillian-testng-core" - dnf install -y arquillian-testng-core - CHECK_RESULT $? 0 0 "安装arquillian-testng-core失败" - fi - - # 测试初始化功能 - LOG_INFO "测试arquillian-testng-core的初始化功能" - arquillian-testng-core --init - CHECK_RESULT $? 0 255 "arquillian-testng-core初始化失败或参数不支持" - - # 清理环境 - if [ "$INSTALLED" = false ]; then - LOG_INFO "卸载arquillian-testng-core" - dnf remove -y arquillian-testng-core - CHECK_RESULT $? 0 0 "卸载arquillian-testng-core失败" - fi - - LOG_INFO "测试脚本执行完毕,环境已恢复" - -} - -main "$@" \ No newline at end of file diff --git a/testcases/function_test/pkg_test/colord-gtk/colord-gtk/test_colord-gtk_cd-convert__help.sh b/testcases/function_test/pkg_test/colord-gtk/colord-gtk/test_colord-gtk_cd-convert__help.sh deleted file mode 100644 index df6e09cb8d1..00000000000 --- a/testcases/function_test/pkg_test/colord-gtk/colord-gtk/test_colord-gtk_cd-convert__help.sh +++ /dev/null @@ -1,89 +0,0 @@ -#!/usr/bin/bash - -# Copyright (c) 2024 ISCAS .ALL rights reserved. -# This program is licensed under Mulan PSL v2. -# You can use it according to the terms and conditions of the Mulan PSL v2. -# http://license.coscl.org.cn/MulanPSL2 -# THIS PROGRAM IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, -# EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, -# MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. -# See the Mulan PSL v2 for more details. - -# ############################################# -# @Author : honghua -# @Contact : honghua@iscas.ac.cn -# @Date : 2026-04-05 -# @License : Mulan PSL v2 -# @Desc : 测试cd-convert命令的帮助信息 -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - LOG_INFO "开始测试:测试cd-convert命令的帮助信息" - LOG_INFO "步骤1:检查colord-gtk软件包是否已在yum源中" - if ! dnf list available colord-gtk 2>/dev/null | grep -q colord-gtk; then - LOG_ERROR "yum源中未找到colord-gtk软件包" - exit 255 - fi - - LOG_INFO "步骤2:检查系统是否已安装colord-gtk软件包" - if rpm -q colord-gtk >/dev/null 2>&1; then - LOG_INFO "colord-gtk软件包已安装,测试后保持安装状态" - INSTALLED=true - else - LOG_INFO "colord-gtk软件包未安装,将进行安装" - INSTALLED=false - fi - - if [ "$INSTALLED" = false ]; then - LOG_INFO "步骤3:安装colord-gtk软件包" - dnf install -y colord-gtk - CHECK_RESULT $? 0 0 "安装colord-gtk软件包失败" - fi - - LOG_INFO "步骤4:检查cd-convert命令是否存在" - if ! command -v cd-convert >/dev/null 2>&1; then - LOG_ERROR "cd-convert命令不存在" - exit 255 - fi - - LOG_INFO "步骤5:测试cd-convert命令的帮助信息参数" - LOG_INFO "执行命令:cd-convert --help" - cd-convert --help - CHECK_RESULT $? 0 0 "执行cd-convert --help命令失败" - - LOG_INFO "步骤6:检查cd-convert命令是否支持--help参数" - if cd-convert --help 2>&1 | grep -q "用法\|Usage\|help"; then - LOG_INFO "cd-convert命令支持--help参数" - else - LOG_ERROR "cd-convert命令不支持--help参数" - exit 255 - fi - - LOG_INFO "步骤7:测试cd-convert命令的-h参数" - LOG_INFO "执行命令:cd-convert -h" - cd-convert -h - CHECK_RESULT $? 0 0 "执行cd-convert -h命令失败" - - LOG_INFO "步骤8:检查cd-convert命令是否支持-h参数" - if cd-convert -h 2>&1 | grep -q "用法\|Usage\|help"; then - LOG_INFO "cd-convert命令支持-h参数" - else - LOG_ERROR "cd-convert命令不支持-h参数" - exit 255 - fi - - LOG_INFO "步骤9:环境恢复" - if [ "$INSTALLED" = false ]; then - LOG_INFO "卸载colord-gtk软件包" - dnf remove -y colord-gtk - CHECK_RESULT $? 0 0 "卸载colord-gtk软件包失败" - else - LOG_INFO "保持colord-gtk软件包安装状态" - fi - - LOG_INFO "测试完成:cd-convert命令的帮助信息测试结束" -} - -main "$@" \ No newline at end of file diff --git a/testcases/function_test/pkg_test/colord-gtk/colord-gtk/test_colord-gtk_cd-convert__q.sh b/testcases/function_test/pkg_test/colord-gtk/colord-gtk/test_colord-gtk_cd-convert__q.sh deleted file mode 100644 index 25d4126d2fd..00000000000 --- a/testcases/function_test/pkg_test/colord-gtk/colord-gtk/test_colord-gtk_cd-convert__q.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-05 -# @License : Mulan PSL v2 -# @Desc : 测试cd-convert命令的静默模式 -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - LOG_INFO "开始测试cd-convert命令的静默模式" - - # 检查是否已经安装了colord-gtk软件包 - LOG_INFO "检查colord-gtk软件包是否已安装" - if rpm -q colord-gtk &> /dev/null; then - LOG_INFO "colord-gtk已安装,将保持安装状态" - already_installed=true - else - LOG_INFO "colord-gtk未安装,将在测试过程中安装" - already_installed=false - fi - - # 检查yum源中是否有colord-gtk软件包 - LOG_INFO "检查yum源中是否有colord-gtk软件包" - if dnf list available colord-gtk &> /dev/null; then - LOG_INFO "yum源中存在colord-gtk软件包" - else - LOG_ERROR "yum源中不存在colord-gtk软件包" - exit 255 - fi - - # 如果未安装,则安装colord-gtk - if ! $already_installed; then - LOG_INFO "安装colord-gtk软件包" - dnf install -y colord-gtk - CHECK_RESULT $? 0 0 "安装colord-gtk失败" - fi - - # 检查cd-convert命令是否支持--quiet参数 - LOG_INFO "检查cd-convert命令是否支持--quiet参数" - if cd-convert --help 2>&1 | grep -q -- "--quiet"; then - LOG_INFO "cd-convert命令支持--quiet参数" - else - LOG_ERROR "cd-convert命令不支持--quiet参数" - exit 255 - fi - - # 测试cd-convert命令的静默模式 - LOG_INFO "测试cd-convert命令的静默模式" - cd-convert --quiet - CHECK_RESULT $? 0 0 "cd-convert命令静默模式执行失败" - - # 清理环境:如果测试前未安装,则卸载软件包 - if ! $already_installed; then - LOG_INFO "卸载colord-gtk软件包" - dnf remove -y colord-gtk - CHECK_RESULT $? 0 0 "卸载colord-gtk失败" - fi - - LOG_INFO "测试完成,环境已恢复" -} - -main "$@" \ No newline at end of file diff --git a/testcases/function_test/pkg_test/colord-gtk/colord-gtk/test_colord-gtk_cd-convert__upper_f.sh b/testcases/function_test/pkg_test/colord-gtk/colord-gtk/test_colord-gtk_cd-convert__upper_f.sh deleted file mode 100644 index f0e2cadfc3f..00000000000 --- a/testcases/function_test/pkg_test/colord-gtk/colord-gtk/test_colord-gtk_cd-convert__upper_f.sh +++ /dev/null @@ -1,107 +0,0 @@ -#!/usr/bin/bash - -# Copyright (c) 2024 ISCAS .ALL rights reserved. -# This program is licensed under Mulan PSL v2. -# You can use it according to the terms and conditions of the Mulan PSL v2. -# http://license.coscl.org.cn/MulanPSL2 -# THIS PROGRAM IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, -# EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, -# MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. -# See the Mulan PSL v2 for more details. - -# ############################################# -# @Author : honghua -# @Contact : honghua@iscas.ac.cn -# @Date : 2026-04-05 -# @License : Mulan PSL v2 -# @Desc : 测试cd-convert命令指定输入文件的格式 -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - # 检查是否已安装colord-gtk软件包 - LOG_INFO "检查是否已安装colord-gtk软件包" - rpm -q colord-gtk > /dev/null 2>&1 - if [ $? -eq 0 ]; then - LOG_INFO "colord-gtk已安装,脚本结束后将保持安装状态" - ALREADY_INSTALLED=1 - else - LOG_INFO "colord-gtk未安装,将在测试前安装并在结束后卸载" - ALREADY_INSTALLED=0 - fi - - # 检查yum源中是否存在colord-gtk软件包 - LOG_INFO "检查yum源中是否存在colord-gtk软件包" - dnf list available colord-gtk > /dev/null 2>&1 - if [ $? -ne 0 ]; then - LOG_ERROR "yum源中未找到colord-gtk软件包" - exit 255 - fi - - # 如果未安装,则安装colord-gtk软件包 - if [ $ALREADY_INSTALLED -eq 0 ]; then - LOG_INFO "安装colord-gtk软件包" - dnf install -y colord-gtk - CHECK_RESULT $? 0 0 "安装colord-gtk软件包失败" - fi - - # 检查cd-convert命令是否支持指定输入文件格式的参数 - LOG_INFO "检查cd-convert命令是否支持指定输入文件格式的参数" - cd-convert --help 2>&1 | grep -q "\-\-input\-format" - if [ $? -ne 0 ]; then - LOG_ERROR "cd-convert命令不支持--input-format参数" - # 如果之前未安装,则卸载软件包 - if [ $ALREADY_INSTALLED -eq 0 ]; then - LOG_INFO "卸载colord-gtk软件包" - dnf remove -y colord-gtk - fi - exit 255 - fi - - # 准备测试用的ICC文件 - LOG_INFO "准备测试用的ICC文件" - TEST_ICC_FILE="/tmp/test_colord_gtk_cd_convert.icc" - cat > $TEST_ICC_FILE << EOF - test icc file content - EOF - CHECK_RESULT $? 0 0 "创建测试ICC文件失败" - - # 测试cd-convert命令指定输入文件的格式为icc - LOG_INFO "测试cd-convert命令指定输入文件的格式为icc" - cd-convert --input-format=icc $TEST_ICC_FILE /tmp/test_output.icc 2>&1 - CHECK_RESULT $? 0 0 "cd-convert命令指定输入文件格式为icc执行失败" - - # 测试cd-convert命令指定输入文件的格式为未知格式(预期失败) - LOG_INFO "测试cd-convert命令指定输入文件的格式为未知格式(预期失败)" - cd-convert --input-format=unknownformat $TEST_ICC_FILE /tmp/test_output2.icc 2>&1 - if [ $? -eq 0 ]; then - LOG_ERROR "cd-convert命令指定未知输入文件格式应失败但实际成功" - # 清理临时文件 - rm -f $TEST_ICC_FILE /tmp/test_output.icc /tmp/test_output2.icc - # 如果之前未安装,则卸载软件包 - if [ $ALREADY_INSTALLED -eq 0 ]; then - LOG_INFO "卸载colord-gtk软件包" - dnf remove -y colord-gtk - fi - exit 1 - else - LOG_INFO "cd-convert命令指定未知输入文件格式失败(符合预期)" - fi - - # 清理临时文件 - LOG_INFO "清理临时文件" - rm -f $TEST_ICC_FILE /tmp/test_output.icc /tmp/test_output2.icc - CHECK_RESULT $? 0 0 "清理临时文件失败" - - # 如果测试开始时未安装,则卸载colord-gtk软件包 - if [ $ALREADY_INSTALLED -eq 0 ]; then - LOG_INFO "卸载colord-gtk软件包" - dnf remove -y colord-gtk - CHECK_RESULT $? 0 0 "卸载colord-gtk软件包失败" - fi - - LOG_INFO "测试完成" -} - -main "$@" \ No newline at end of file diff --git a/testcases/function_test/pkg_test/colord-gtk/colord-gtk/test_colord-gtk_cd-convert__upper_n.sh b/testcases/function_test/pkg_test/colord-gtk/colord-gtk/test_colord-gtk_cd-convert__upper_n.sh deleted file mode 100644 index dcfe5e6509d..00000000000 --- a/testcases/function_test/pkg_test/colord-gtk/colord-gtk/test_colord-gtk_cd-convert__upper_n.sh +++ /dev/null @@ -1,73 +0,0 @@ -#!/usr/bin/bash - -# Copyright (c) 2024 ISCAS .ALL rights reserved. -# This program is licensed under Mulan PSL v2. -# You can use it according to the terms and conditions of the Mulan PSL v2. -# http://license.coscl.org.cn/MulanPSL2 -# THIS PROGRAM IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, -# EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, -# MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. -# See the Mulan PSL v2 for more details. - -# ############################################# -# @Author : honghua -# @Contact : honghua@iscas.ac.cn -# @Date : 2026-04-05 -# @License : Mulan PSL v2 -# @Desc : 测试cd-convert命令使用不存在的配置文件 -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - LOG_INFO "开始测试:测试cd-convert命令使用不存在的配置文件" - - LOG_INFO "步骤1:检查软件包colord-gtk是否在yum源中" - dnf list available colord-gtk 2>/dev/null | grep -q colord-gtk - if [ $? -ne 0 ]; then - LOG_ERROR "软件包colord-gtk在yum源中不存在" - exit 255 - fi - - LOG_INFO "步骤2:检查系统是否已经安装colord-gtk" - rpm -q colord-gtk >/dev/null 2>&1 - if [ $? -eq 0 ]; then - LOG_INFO "colord-gtk已经安装,测试结束后保持安装状态" - INSTALLED=true - else - LOG_INFO "colord-gtk未安装,将安装作为测试步骤" - INSTALLED=false - fi - - if [ "$INSTALLED" = "false" ]; then - LOG_INFO "步骤3:安装colord-gtk软件包" - dnf install -y colord-gtk - CHECK_RESULT $? 0 0 "安装colord-gtk失败" - fi - - LOG_INFO "步骤4:检查cd-convert命令是否存在" - which cd-convert >/dev/null 2>&1 - CHECK_RESULT $? 0 0 "cd-convert命令不存在" - - LOG_INFO "步骤5:检查cd-convert命令是否支持--config参数" - cd-convert --help 2>&1 | grep -q "\-\-config" - if [ $? -ne 0 ]; then - LOG_ERROR "cd-convert命令不支持--config参数" - exit 255 - fi - - LOG_INFO "步骤6:使用不存在的配置文件执行cd-convert命令" - cd-convert --config /tmp/nonexistent_config_file.conf 2>&1 - CHECK_RESULT $? 1 0 "使用不存在的配置文件执行cd-convert命令未返回预期错误码" - - LOG_INFO "步骤7:清理环境" - if [ "$INSTALLED" = "false" ]; then - LOG_INFO "卸载colord-gtk软件包" - dnf remove -y colord-gtk - CHECK_RESULT $? 0 0 "卸载colord-gtk失败" - fi - - LOG_INFO "测试完成" -} - -main "$@" \ No newline at end of file diff --git a/testcases/function_test/pkg_test/colord-gtk/colord-gtk/test_colord-gtk_cd-convert__upper_o.sh b/testcases/function_test/pkg_test/colord-gtk/colord-gtk/test_colord-gtk_cd-convert__upper_o.sh deleted file mode 100644 index 1a4b632a599..00000000000 --- a/testcases/function_test/pkg_test/colord-gtk/colord-gtk/test_colord-gtk_cd-convert__upper_o.sh +++ /dev/null @@ -1,94 +0,0 @@ -#!/usr/bin/bash - -# Copyright (c) 2024 ISCAS .ALL rights reserved. -# This program is licensed under Mulan PSL v2. -# You can use it according to the terms and conditions of the Mulan PSL v2. -# http://license.coscl.org.cn/MulanPSL2 -# THIS PROGRAM IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, -# EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, -# MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. -# See the Mulan PSL v2 for more details. - -# ############################################# -# @Author : honghua -# @Contact : honghua@iscas.ac.cn -# @Date : 2026-04-05 -# @License : Mulan PSL v2 -# @Desc : 测试cd-convert命令指定输出文件的格式 -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - LOG_INFO "开始测试cd-convert命令指定输出文件的格式" - - # 定义软件包名 - PACKAGE_NAME="colord-gtk" - - # 检查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}是否已安装" - rpm -q ${PACKAGE_NAME} &>/dev/null - if [ $? -eq 0 ]; then - LOG_INFO "${PACKAGE_NAME}已安装,测试结束后保持安装状态" - INSTALLED_BEFORE=true - else - LOG_INFO "${PACKAGE_NAME}未安装,将在测试前安装" - INSTALLED_BEFORE=false - fi - - # 如果未安装,则安装软件包 - if [ "${INSTALLED_BEFORE}" = "false" ]; then - LOG_INFO "安装${PACKAGE_NAME}软件包" - dnf install -y ${PACKAGE_NAME} - CHECK_RESULT $? 0 0 "安装${PACKAGE_NAME}失败" - fi - - # 测试cd-convert命令指定输出文件的格式 - LOG_INFO "测试cd-convert命令指定输出文件的格式" - cd-convert --help | grep -q "\-\-output" - if [ $? -ne 0 ]; then - LOG_ERROR "cd-convert命令不支持--output参数" - exit 255 - fi - - # 创建测试输入文件 - LOG_INFO "创建测试输入文件" - cat > test_input.icc << EOF - test icc file content - EOF - CHECK_RESULT $? 0 0 "创建测试输入文件失败" - - # 执行cd-convert命令指定输出文件的格式 - LOG_INFO "执行cd-convert命令指定输出文件的格式" - cd-convert --output test_output.icc test_input.icc - CHECK_RESULT $? 0 0 "cd-convert命令执行失败" - - # 检查输出文件是否存在 - LOG_INFO "检查输出文件是否存在" - [ -f test_output.icc ] - CHECK_RESULT $? 0 0 "输出文件未生成" - - # 清理测试文件 - LOG_INFO "清理测试文件" - rm -f test_input.icc test_output.icc - CHECK_RESULT $? 0 0 "清理测试文件失败" - - # 如果测试前未安装,则卸载软件包 - if [ "${INSTALLED_BEFORE}" = "false" ]; then - LOG_INFO "卸载${PACKAGE_NAME}软件包" - dnf remove -y ${PACKAGE_NAME} - CHECK_RESULT $? 0 0 "卸载${PACKAGE_NAME}失败" - fi - - LOG_INFO "测试cd-convert命令指定输出文件的格式完成" -} - -main "$@" \ No newline at end of file diff --git a/testcases/function_test/pkg_test/colord-gtk/colord-gtk/test_colord-gtk_cd-convert__upper_r.sh b/testcases/function_test/pkg_test/colord-gtk/colord-gtk/test_colord-gtk_cd-convert__upper_r.sh deleted file mode 100644 index 421c8d4b0ba..00000000000 --- a/testcases/function_test/pkg_test/colord-gtk/colord-gtk/test_colord-gtk_cd-convert__upper_r.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-04-05 -# @License : Mulan PSL v2 -# @Desc : 测试cd-convert命令使用相对色温值进行转换 -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - # 设置环境变量 - SCRIPT_DIR=$(cd $(dirname $0); pwd) - LOG_INFO "当前脚本目录:$SCRIPT_DIR" - - # 检查是否已安装colord-gtk - LOG_INFO "检查colord-gtk是否已安装" - rpm -q colord-gtk > /dev/null 2>&1 - if [ $? -eq 0 ]; then - LOG_INFO "colord-gtk已安装,记录安装状态" - PRE_INSTALLED=true - else - LOG_INFO "colord-gtk未安装" - PRE_INSTALLED=false - fi - - # 检查yum源中是否有colord-gtk软件包 - LOG_INFO "检查yum源中是否有colord-gtk软件包" - dnf list available colord-gtk > /dev/null 2>&1 - if [ $? -ne 0 ]; then - LOG_ERROR "yum源中未找到colord-gtk软件包" - exit 255 - fi - - # 如果未安装则安装软件包 - if [ "$PRE_INSTALLED" = "false" ]; then - LOG_INFO "开始安装colord-gtk" - dnf install -y colord-gtk - CHECK_RESULT $? 0 0 "安装colord-gtk失败" - fi - - # 检查cd-convert命令是否存在 - LOG_INFO "检查cd-convert命令是否存在" - command -v cd-convert > /dev/null 2>&1 - if [ $? -ne 0 ]; then - LOG_ERROR "cd-convert命令不存在" - exit 255 - fi - - # 检查cd-convert是否支持--temperature参数 - LOG_INFO "检查cd-convert是否支持--temperature参数" - cd-convert --help 2>&1 | grep -q "\-\-temperature" - if [ $? -ne 0 ]; then - LOG_ERROR "cd-convert不支持--temperature参数" - exit 255 - fi - - # 测试cd-convert命令使用相对色温值进行转换 - LOG_INFO "测试cd-convert命令使用相对色温值进行转换" - cd-convert --temperature 6500 test_input.icc test_output.icc > /dev/null 2>&1 - CHECK_RESULT $? 0 0 "cd-convert使用相对色温值转换失败" - - # 检查输出文件是否生成 - LOG_INFO "检查输出文件是否生成" - if [ -f "test_output.icc" ]; then - LOG_INFO "输出文件test_output.icc已生成" - rm -f test_output.icc - CHECK_RESULT $? 0 0 "删除测试输出文件失败" - else - LOG_ERROR "输出文件test_output.icc未生成" - exit 1 - fi - - # 清理临时文件 - LOG_INFO "清理临时文件" - rm -f test_input.icc test_output.icc - - # 环境恢复:如果之前未安装,则卸载软件包 - if [ "$PRE_INSTALLED" = "false" ]; then - LOG_INFO "卸载colord-gtk软件包" - dnf remove -y colord-gtk - CHECK_RESULT $? 0 0 "卸载colord-gtk失败" - else - LOG_INFO "保持colord-gtk安装状态" - fi - - LOG_INFO "测试完成" -} - -main "$@" \ No newline at end of file diff --git a/testcases/function_test/pkg_test/colord-gtk/colord-gtk/test_colord-gtk_cd-convert__upper_t.sh b/testcases/function_test/pkg_test/colord-gtk/colord-gtk/test_colord-gtk_cd-convert__upper_t.sh deleted file mode 100644 index 0dfc7ebaec5..00000000000 --- a/testcases/function_test/pkg_test/colord-gtk/colord-gtk/test_colord-gtk_cd-convert__upper_t.sh +++ /dev/null @@ -1,73 +0,0 @@ -#!/usr/bin/bash - -# Copyright (c) 2024 ISCAS .ALL rights reserved. -# This program is licensed under Mulan PSL v2. -# You can use it according to the terms and conditions of the Mulan PSL v2. -# http://license.coscl.org.cn/MulanPSL2 -# THIS PROGRAM IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, -# EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, -# MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. -# See the Mulan PSL v2 for more details. - -# ############################################# -# @Author : honghua -# @Contact : honghua@iscas.ac.cn -# @Date : 2026-04-05 -# @License : Mulan PSL v2 -# @Desc : 测试cd-convert命令使用绝对色温值进行转换 -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - LOG_INFO "1. 检查yum源中是否存在colord-gtk软件包" - dnf list available colord-gtk 2>/dev/null | grep -q colord-gtk - if [ $? -ne 0 ]; then - LOG_ERROR "yum源中未找到colord-gtk软件包" - exit 255 - fi - - LOG_INFO "2. 检查系统是否已安装colord-gtk" - rpm -q colord-gtk > /dev/null 2>&1 - installed=$? - - if [ $installed -ne 0 ]; then - LOG_INFO "3. 系统未安装colord-gtk,开始安装" - dnf install -y colord-gtk - CHECK_RESULT $? 0 0 "安装colord-gtk失败" - else - LOG_INFO "3. 系统已安装colord-gtk,跳过安装步骤" - fi - - LOG_INFO "4. 检查cd-convert命令是否支持--temperature参数" - cd-convert --help 2>&1 | grep -q -- --temperature - if [ $? -ne 0 ]; then - LOG_ERROR "cd-convert命令不支持--temperature参数" - if [ $installed -ne 0 ]; then - LOG_INFO "清理环境:卸载colord-gtk" - dnf remove -y colord-gtk - fi - exit 255 - fi - - LOG_INFO "5. 测试cd-convert命令使用绝对色温值进行转换" - cd-convert --temperature 6500 /usr/share/color/icc/colord/sRGB.icc /tmp/test_output.icc - CHECK_RESULT $? 0 0 "使用绝对色温值转换失败" - - LOG_INFO "6. 验证生成的ICC文件" - file /tmp/test_output.icc | grep -q "ICC Profile" - CHECK_RESULT $? 0 0 "生成的ICC文件格式不正确" - - LOG_INFO "7. 清理临时文件" - rm -f /tmp/test_output.icc - - if [ $installed -ne 0 ]; then - LOG_INFO "8. 恢复环境:卸载colord-gtk" - dnf remove -y colord-gtk - CHECK_RESULT $? 0 0 "卸载colord-gtk失败" - else - LOG_INFO "8. 保持colord-gtk安装状态" - fi -} - -main "$@" \ No newline at end of file diff --git a/testcases/function_test/pkg_test/colord-gtk/colord-gtk/test_colord-gtk_cd-convert__upper_v.sh b/testcases/function_test/pkg_test/colord-gtk/colord-gtk/test_colord-gtk_cd-convert__upper_v.sh deleted file mode 100644 index 4eb9b3a7f5c..00000000000 --- a/testcases/function_test/pkg_test/colord-gtk/colord-gtk/test_colord-gtk_cd-convert__upper_v.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-04-05 -# @License : Mulan PSL v2 -# @Desc : 测试cd-convert命令的版本信息 -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - # 定义日志函数 - LOG_INFO() { - echo "[INFO] $1" - } - - LOG_ERROR() { - echo "[ERROR] $1" - } - - # 定义软件包名称 - PACKAGE_NAME="colord-gtk" - - # 检查软件包是否在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 "软件包 $PACKAGE_NAME 已安装,脚本结束后将保持安装状态" - INSTALLED_BEFORE=true - else - LOG_INFO "软件包 $PACKAGE_NAME 未安装,将在测试过程中安装" - INSTALLED_BEFORE=false - fi - - # 如果未安装,则安装软件包 - if [ "$INSTALLED_BEFORE" = false ]; then - LOG_INFO "安装软件包 $PACKAGE_NAME" - dnf install -y "$PACKAGE_NAME" - CHECK_RESULT $? 0 0 "安装软件包 $PACKAGE_NAME 失败" - fi - - # 测试 cd-convert 命令的版本信息 - LOG_INFO "测试 cd-convert 命令的版本信息" - if ! command -v cd-convert &>/dev/null; then - LOG_ERROR "cd-convert 命令不存在或不支持" - exit 255 - fi - - # 执行 cd-convert --version 命令 - cd-convert --version - CHECK_RESULT $? 0 0 "执行 cd-convert --version 命令失败" - - # 环境恢复:如果之前未安装,则卸载软件包 - 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/colord-gtk/colord-gtk/test_colord-gtk_cd-convert__v.sh b/testcases/function_test/pkg_test/colord-gtk/colord-gtk/test_colord-gtk_cd-convert__v.sh deleted file mode 100644 index 088cc2002a2..00000000000 --- a/testcases/function_test/pkg_test/colord-gtk/colord-gtk/test_colord-gtk_cd-convert__v.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-04-05 -# @License : Mulan PSL v2 -# @Desc : 测试cd-convert命令的详细输出模式 -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - LOG_INFO "开始测试:测试cd-convert命令的详细输出模式" - - # 定义软件包名称 - PACKAGE_NAME="colord-gtk" - - # 步骤1:检查yum源中是否有指定软件包 - LOG_INFO "步骤1:检查yum源中是否有${PACKAGE_NAME}软件包" - if ! dnf list available "${PACKAGE_NAME}" &>/dev/null; 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},测试结束后将保持安装状态" - INSTALLED_BEFORE_TEST=true - else - LOG_INFO "环境未安装${PACKAGE_NAME},将在测试过程中安装" - INSTALLED_BEFORE_TEST=false - fi - - # 步骤3:如果未安装,则安装软件包 - if [ "${INSTALLED_BEFORE_TEST}" = "false" ]; then - LOG_INFO "步骤3:安装${PACKAGE_NAME}软件包" - dnf install -y "${PACKAGE_NAME}" - CHECK_RESULT $? 0 0 "安装${PACKAGE_NAME}软件包失败" - fi - - # 步骤4:检查cd-convert命令是否存在 - LOG_INFO "步骤4:检查cd-convert命令是否存在" - if ! command -v cd-convert &>/dev/null; then - LOG_ERROR "cd-convert命令不存在" - exit 255 - fi - - # 步骤5:检查cd-convert命令是否支持--verbose参数 - LOG_INFO "步骤5:检查cd-convert命令是否支持--verbose参数" - if ! cd-convert --help 2>&1 | grep -q -- "--verbose"; then - LOG_ERROR "cd-convert命令不支持--verbose参数" - exit 255 - fi - - # 步骤6:执行cd-convert命令的详细输出模式测试 - LOG_INFO "步骤6:执行cd-convert命令的详细输出模式测试" - cd-convert --verbose - CHECK_RESULT $? 0 0 "cd-convert命令详细输出模式执行失败" - - # 步骤7:清理环境,恢复到之前的状态 - LOG_INFO "步骤7:清理环境,恢复到之前的状态" - if [ "${INSTALLED_BEFORE_TEST}" = "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 "测试完成:cd-convert命令的详细输出模式测试通过" -} - -main "$@" \ No newline at end of file diff --git a/testcases/function_test/pkg_test/colord-gtk/colord-gtk/test_colord-gtk_cd_create_profile.sh b/testcases/function_test/pkg_test/colord-gtk/colord-gtk/test_colord-gtk_cd_create_profile.sh deleted file mode 100644 index 2a137a5fdf5..00000000000 --- a/testcases/function_test/pkg_test/colord-gtk/colord-gtk/test_colord-gtk_cd_create_profile.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-04-05 -# @License : Mulan PSL v2 -# @Desc : 测试使用colord-gtk工具创建基本的颜色配置文件 -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - LOG_INFO "开始测试colord-gtk创建基本颜色配置文件功能" - - # 检查环境是否已安装colord-gtk - LOG_INFO "检查colord-gtk是否已安装" - if rpm -q colord-gtk > /dev/null 2>&1; then - LOG_INFO "colord-gtk已安装,测试后保持安装状态" - installed_before=true - else - LOG_INFO "colord-gtk未安装,将在测试过程中安装" - installed_before=false - fi - - # 检查yum源中是否有colord-gtk软件包 - LOG_INFO "检查yum源中是否存在colord-gtk软件包" - if ! dnf list available colord-gtk > /dev/null 2>&1; then - LOG_ERROR "yum源中未找到colord-gtk软件包" - exit 255 - fi - - # 如果未安装,则安装colord-gtk - if [ "$installed_before" = false ]; then - LOG_INFO "安装colord-gtk软件包" - dnf install -y colord-gtk - CHECK_RESULT $? 0 0 "安装colord-gtk失败" - fi - - # 检查colord-gtk-cd-create-profile命令是否存在 - LOG_INFO "检查colord-gtk-cd-create-profile命令" - if ! command -v colord-gtk-cd-create-profile > /dev/null 2>&1; then - LOG_ERROR "colord-gtk-cd-create-profile命令不存在" - exit 255 - fi - - # 检查colord-gtk-cd-create-profile命令是否支持基本参数 - LOG_INFO "检查colord-gtk-cd-create-profile命令参数支持" - if ! colord-gtk-cd-create-profile --help > /dev/null 2>&1; then - LOG_ERROR "colord-gtk-cd-create-profile命令不支持--help参数" - exit 255 - fi - - # 创建临时目录用于测试 - LOG_INFO "创建临时测试目录" - temp_dir=$(mktemp -d) - CHECK_RESULT $? 0 0 "创建临时目录失败" - - # 测试创建基本的颜色配置文件 - LOG_INFO "测试创建基本颜色配置文件" - colord-gtk-cd-create-profile --output "$temp_dir/test_profile.icc" - CHECK_RESULT $? 0 0 "创建颜色配置文件失败" - - # 验证配置文件是否创建成功 - LOG_INFO "验证配置文件是否生成" - if [ -f "$temp_dir/test_profile.icc" ]; then - LOG_INFO "颜色配置文件创建成功" - file_info=$(file "$temp_dir/test_profile.icc") - LOG_INFO "文件信息: $file_info" - else - LOG_ERROR "颜色配置文件未生成" - CHECK_RESULT 1 0 0 "配置文件未生成" - fi - - # 清理临时文件 - LOG_INFO "清理临时测试文件" - rm -rf "$temp_dir" - CHECK_RESULT $? 0 0 "清理临时文件失败" - - # 如果测试前未安装,则卸载colord-gtk - if [ "$installed_before" = false ]; then - LOG_INFO "卸载测试安装的colord-gtk软件包" - dnf remove -y colord-gtk - CHECK_RESULT $? 0 0 "卸载colord-gtk失败" - LOG_INFO "环境已恢复到测试前状态" - else - LOG_INFO "保持colord-gtk安装状态" - fi - - LOG_INFO "colord-gtk创建基本颜色配置文件测试完成" -} - -main "$@" \ No newline at end of file diff --git a/testcases/function_test/pkg_test/colord-gtk/colord-gtk/test_colord-gtk_cd_profile_export.sh b/testcases/function_test/pkg_test/colord-gtk/colord-gtk/test_colord-gtk_cd_profile_export.sh deleted file mode 100644 index d54e74e6f9c..00000000000 --- a/testcases/function_test/pkg_test/colord-gtk/colord-gtk/test_colord-gtk_cd_profile_export.sh +++ /dev/null @@ -1,107 +0,0 @@ -#!/usr/bin/bash - -# Copyright (c) 2024 ISCAS .ALL rights reserved. -# This program is licensed under Mulan PSL v2. -# You can use it according to the terms and conditions of the Mulan PSL v2. -# http://license.coscl.org.cn/MulanPSL2 -# THIS PROGRAM IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, -# EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, -# MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. -# See the Mulan PSL v2 for more details. - -# ############################################# -# @Author : honghua -# @Contact : honghua@iscas.ac.cn -# @Date : 2026-04-05 -# @License : Mulan PSL v2 -# @Desc : 测试使用colord-gtk工具导出颜色配置文件 -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - # 设置环境变量 - SCRIPT_NAME="test_colord-gtk_cd_profile_export" - LOG_FILE="/tmp/${SCRIPT_NAME}.log" - - # 定义软件包名称 - PACKAGE_NAME="colord-gtk" - - # 定义颜色配置文件路径 - PROFILE_FILE="/tmp/test_profile.icc" - - # 清理函数 - cleanup() { - LOG_INFO "开始清理测试环境" - if [ "${INSTALLED_BEFORE}" -eq 0 ]; then - LOG_INFO "测试前未安装${PACKAGE_NAME},卸载软件包" - dnf remove -y ${PACKAGE_NAME} > /dev/null 2>&1 - CHECK_RESULT $? 0 0 "卸载${PACKAGE_NAME}失败" - else - LOG_INFO "测试前已安装${PACKAGE_NAME},保持安装状态" - fi - # 删除临时文件 - rm -f ${PROFILE_FILE} - LOG_INFO "清理完成" - } - - # 错误处理 - trap cleanup EXIT - - # 检查软件包是否在yum源中 - LOG_INFO "检查yum源中是否存在${PACKAGE_NAME}软件包" - dnf list available ${PACKAGE_NAME} > /dev/null 2>&1 - if [ $? -ne 0 ]; then - LOG_ERROR "yum源中不存在${PACKAGE_NAME}软件包" - exit 255 - fi - LOG_INFO "yum源中存在${PACKAGE_NAME}软件包" - - # 检查软件包是否已安装 - LOG_INFO "检查系统是否已安装${PACKAGE_NAME}" - rpm -q ${PACKAGE_NAME} > /dev/null 2>&1 - if [ $? -eq 0 ]; then - LOG_INFO "${PACKAGE_NAME}已安装" - INSTALLED_BEFORE=1 - else - LOG_INFO "${PACKAGE_NAME}未安装" - INSTALLED_BEFORE=0 - fi - - # 如果未安装,则安装软件包 - if [ ${INSTALLED_BEFORE} -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}成功" - fi - - # 检查colord-gtk-cd-profile-export命令是否存在 - LOG_INFO "检查colord-gtk-cd-profile-export命令是否存在" - which colord-gtk-cd-profile-export > /dev/null 2>&1 - CHECK_RESULT $? 0 0 "colord-gtk-cd-profile-export命令不存在" - - # 检查colord-gtk-cd-profile-export命令参数 - LOG_INFO "检查colord-gtk-cd-profile-export命令参数" - colord-gtk-cd-profile-export --help > /dev/null 2>&1 - CHECK_RESULT $? 0 0 "colord-gtk-cd-profile-export命令参数不支持" - - # 测试导出颜色配置文件 - LOG_INFO "测试导出颜色配置文件" - colord-gtk-cd-profile-export --output ${PROFILE_FILE} > /dev/null 2>&1 - CHECK_RESULT $? 0 0 "导出颜色配置文件失败" - - # 检查导出的文件是否存在 - LOG_INFO "检查导出的颜色配置文件是否存在" - [ -f ${PROFILE_FILE} ] - CHECK_RESULT $? 0 0 "导出的颜色配置文件不存在" - - # 检查导出的文件是否有效 - LOG_INFO "检查导出的颜色配置文件是否有效" - file ${PROFILE_FILE} | grep -q "ICC profile" - CHECK_RESULT $? 0 0 "导出的颜色配置文件无效" - - LOG_INFO "颜色配置文件导出测试完成" -} - -main "$@" \ No newline at end of file diff --git a/testcases/function_test/pkg_test/colord-gtk/colord-gtk/test_colord-gtk_cd_profile_import.sh b/testcases/function_test/pkg_test/colord-gtk/colord-gtk/test_colord-gtk_cd_profile_import.sh deleted file mode 100644 index 02d3e307b0c..00000000000 --- a/testcases/function_test/pkg_test/colord-gtk/colord-gtk/test_colord-gtk_cd_profile_import.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-04-05 -# @License : Mulan PSL v2 -# @Desc : 测试使用colord-gtk工具导入颜色配置文件 -# ############################################ - -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 expected=$2 - local error_code=$3 - local error_msg=$4 - if [ "$actual" -ne "$expected" ]; then - LOG_ERROR "$error_msg" - exit $error_code - fi - } - - # 定义SSH命令函数 - SSH_CMD() { - local cmd=$1 - local node_ip=$2 - local node_password=$3 - local node_user=$4 - sshpass -p "$node_password" ssh -o StrictHostKeyChecking=no "$node_user@$node_ip" "$cmd" - } - - # 定义软件包名称 - PACKAGE_NAME="colord-gtk" - - # 步骤1: 检查yum源中是否存在colord-gtk软件包 - 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 - - # 步骤2: 检查是否已经安装了colord-gtk - LOG_INFO "步骤2: 检查是否已经安装了$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: 安装colord-gtk(如果未安装) - if [ "$INSTALLED" = false ]; then - LOG_INFO "步骤3: 安装$PACKAGE_NAME软件包" - dnf install -y "$PACKAGE_NAME" - CHECK_RESULT $? 0 0 "安装$PACKAGE_NAME失败" - fi - - # 步骤4: 检查colord-gtk命令是否支持导入颜色配置文件参数 - LOG_INFO "步骤4: 检查colord-gtk命令是否支持导入颜色配置文件参数" - colord-gtk --help 2>&1 | grep -q "import" - if [ $? -ne 0 ]; then - LOG_ERROR "colord-gtk命令不支持导入颜色配置文件参数" - exit 255 - fi - - # 步骤5: 创建一个临时的颜色配置文件用于测试 - LOG_INFO "步骤5: 创建一个临时的颜色配置文件用于测试" - cat > /tmp/test_color_profile.icc << EOF - 这是一个临时的颜色配置文件,用于测试colord-gtk导入功能。 - EOF - CHECK_RESULT $? 0 0 "创建临时颜色配置文件失败" - - # 步骤6: 使用colord-gtk导入颜色配置文件 - LOG_INFO "步骤6: 使用colord-gtk导入颜色配置文件" - colord-gtk import /tmp/test_color_profile.icc - CHECK_RESULT $? 0 0 "导入颜色配置文件失败" - - # 步骤7: 验证颜色配置文件是否成功导入 - LOG_INFO "步骤7: 验证颜色配置文件是否成功导入" - colord-gtk list | grep -q "test_color_profile" - CHECK_RESULT $? 0 0 "颜色配置文件未成功导入" - - # 步骤8: 清理临时文件 - LOG_INFO "步骤8: 清理临时文件" - rm -f /tmp/test_color_profile.icc - CHECK_RESULT $? 0 0 "清理临时文件失败" - - # 步骤9: 卸载colord-gtk(如果测试前未安装) - if [ "$INSTALLED" = false ]; then - LOG_INFO "步骤9: 卸载$PACKAGE_NAME软件包" - dnf remove -y "$PACKAGE_NAME" - CHECK_RESULT $? 0 0 "卸载$PACKAGE_NAME失败" - fi - - LOG_INFO "测试完成,所有步骤执行成功" -} - -main "$@" \ No newline at end of file diff --git a/testcases/function_test/pkg_test/colord-gtk/colord-gtk/test_colord-gtk_check_installed.sh b/testcases/function_test/pkg_test/colord-gtk/colord-gtk/test_colord-gtk_check_installed.sh deleted file mode 100644 index 71b52abd42a..00000000000 --- a/testcases/function_test/pkg_test/colord-gtk/colord-gtk/test_colord-gtk_check_installed.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-05 -# @License : Mulan PSL v2 -# @Desc : 检查colord-gtk软件包是否已正确安装到系统中 -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - LOG_INFO "开始检查colord-gtk软件包是否已正确安装到系统中" - - # 检查是否已安装colord-gtk - LOG_INFO "检查colord-gtk是否已安装" - rpm -q colord-gtk > /dev/null 2>&1 - if [ $? -eq 0 ]; then - LOG_INFO "colord-gtk已安装,记录安装状态以便后续恢复" - INSTALLED=1 - else - LOG_INFO "colord-gtk未安装" - INSTALLED=0 - fi - - # 检查yum源中是否有colord-gtk软件包 - LOG_INFO "检查yum源中是否存在colord-gtk软件包" - dnf list available colord-gtk > /dev/null 2>&1 - if [ $? -ne 0 ]; then - LOG_ERROR "yum源中未找到colord-gtk软件包" - exit 255 - fi - - # 如果未安装,则安装colord-gtk - if [ $INSTALLED -eq 0 ]; then - LOG_INFO "开始安装colord-gtk软件包" - dnf install -y colord-gtk > /dev/null 2>&1 - CHECK_RESULT $? 0 0 "安装colord-gtk失败" - LOG_INFO "colord-gtk安装成功" - fi - - # 验证colord-gtk是否正确安装 - LOG_INFO "验证colord-gtk是否正确安装" - rpm -q colord-gtk > /dev/null 2>&1 - CHECK_RESULT $? 0 0 "colord-gtk未正确安装" - - # 检查colord-gtk相关命令是否可用 - LOG_INFO "检查colord-gtk相关命令是否可用" - which colormgr > /dev/null 2>&1 - CHECK_RESULT $? 0 0 "colormgr命令不可用" - - # 如果测试前未安装,则卸载colord-gtk以恢复环境 - if [ $INSTALLED -eq 0 ]; then - LOG_INFO "恢复环境:卸载colord-gtk软件包" - dnf remove -y colord-gtk > /dev/null 2>&1 - CHECK_RESULT $? 0 0 "卸载colord-gtk失败" - LOG_INFO "环境恢复完成" - else - LOG_INFO "环境已保持原有安装状态" - fi - - LOG_INFO "colord-gtk软件包安装检查完成" -} - -main "$@" \ No newline at end of file diff --git a/testcases/function_test/pkg_test/colord-gtk/colord-gtk/test_colord-gtk_gui_tool_open.sh b/testcases/function_test/pkg_test/colord-gtk/colord-gtk/test_colord-gtk_gui_tool_open.sh deleted file mode 100644 index 049fffcb82b..00000000000 --- a/testcases/function_test/pkg_test/colord-gtk/colord-gtk/test_colord-gtk_gui_tool_open.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-04-05 -# @License : Mulan PSL v2 -# @Desc : 测试colord-gtk提供的图形化管理工具(如gnome-color-manager)能否正常启动 -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - LOG_INFO "开始测试colord-gtk图形化管理工具启动" - LOG_INFO "步骤1:检查colord-gtk软件包是否在yum源中" - if ! dnf list available colord-gtk 2>/dev/null | grep -q colord-gtk; then - LOG_ERROR "yum源中未找到colord-gtk软件包" - exit 255 - fi - LOG_INFO "colord-gtk软件包在yum源中存在" - - LOG_INFO "步骤2:检查gnome-color-manager软件包是否在yum源中" - if ! dnf list available gnome-color-manager 2>/dev/null | grep -q gnome-color-manager; then - LOG_ERROR "yum源中未找到gnome-color-manager软件包" - exit 255 - fi - LOG_INFO "gnome-color-manager软件包在yum源中存在" - - LOG_INFO "步骤3:检查系统是否已安装colord-gtk和gnome-color-manager" - if rpm -q colord-gtk >/dev/null 2>&1 && rpm -q gnome-color-manager >/dev/null 2>&1; then - LOG_INFO "colord-gtk和gnome-color-manager已安装,测试结束后将保持安装状态" - ALREADY_INSTALLED=true - else - LOG_INFO "colord-gtk和gnome-color-manager未安装,将进行安装" - ALREADY_INSTALLED=false - fi - - if [ "$ALREADY_INSTALLED" = false ]; then - LOG_INFO "步骤4:安装colord-gtk和gnome-color-manager软件包" - dnf install -y colord-gtk gnome-color-manager - CHECK_RESULT $? 0 0 "安装colord-gtk和gnome-color-manager失败" - LOG_INFO "colord-gtk和gnome-color-manager安装成功" - fi - - LOG_INFO "步骤5:检查gnome-color-manager命令是否存在" - if ! command -v gnome-color-manager >/dev/null 2>&1; then - LOG_ERROR "gnome-color-manager命令不存在" - exit 255 - fi - LOG_INFO "gnome-color-manager命令存在" - - LOG_INFO "步骤6:检查gnome-color-manager是否支持--help参数" - if ! gnome-color-manager --help >/dev/null 2>&1; then - LOG_ERROR "gnome-color-manager不支持--help参数" - exit 255 - fi - LOG_INFO "gnome-color-manager支持--help参数" - - LOG_INFO "步骤7:测试启动gnome-color-manager图形化管理工具(使用--help参数模拟启动检查)" - gnome-color-manager --help - CHECK_RESULT $? 0 0 "gnome-color-manager启动失败" - - LOG_INFO "gnome-color-manager图形化管理工具启动测试成功" - - if [ "$ALREADY_INSTALLED" = false ]; then - LOG_INFO "步骤8:清理环境,卸载测试安装的软件包" - dnf remove -y colord-gtk gnome-color-manager - CHECK_RESULT $? 0 0 "卸载colord-gtk和gnome-color-manager失败" - LOG_INFO "环境清理完成,已恢复到测试前状态" - else - LOG_INFO "步骤8:环境保持原状,不卸载已安装的软件包" - fi - - LOG_INFO "测试完成" -} - -main "$@" \ No newline at end of file diff --git a/testcases/function_test/pkg_test/colord-gtk/colord-gtk/test_colord-gtk_install_package.sh b/testcases/function_test/pkg_test/colord-gtk/colord-gtk/test_colord-gtk_install_package.sh deleted file mode 100644 index 1079bfd79ee..00000000000 --- a/testcases/function_test/pkg_test/colord-gtk/colord-gtk/test_colord-gtk_install_package.sh +++ /dev/null @@ -1,65 +0,0 @@ -#!/usr/bin/bash - -# Copyright (c) 2024 ISCAS .ALL rights reserved. -# This program is licensed under Mulan PSL v2. -# You can use it according to the terms and conditions of the Mulan PSL v2. -# http://license.coscl.org.cn/MulanPSL2 -# THIS PROGRAM IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, -# EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, -# MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. -# See the Mulan PSL v2 for more details. - -# ############################################# -# @Author : honghua -# @Contact : honghua@iscas.ac.cn -# @Date : 2026-04-05 -# @License : Mulan PSL v2 -# @Desc : 测试colord-gtk软件包的安装功能,验证软件包是否可以正常安装 -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - # 检查是否已安装colord-gtk - LOG_INFO "检查colord-gtk软件包是否已安装" - rpm -q colord-gtk > /dev/null 2>&1 - if [ $? -eq 0 ]; then - LOG_INFO "colord-gtk软件包已安装,测试结束后将保持安装状态" - INSTALLED="true" - else - LOG_INFO "colord-gtk软件包未安装,将在测试过程中安装并最终卸载" - INSTALLED="false" - fi - - # 检查yum源中是否存在colord-gtk软件包 - LOG_INFO "检查yum源中是否存在colord-gtk软件包" - dnf list available colord-gtk > /dev/null 2>&1 - CHECK_RESULT $? 0 255 "yum源中未找到colord-gtk软件包" - - # 安装colord-gtk软件包 - if [ "$INSTALLED" = "false" ]; then - LOG_INFO "开始安装colord-gtk软件包" - dnf install -y colord-gtk - CHECK_RESULT $? 0 0 "colord-gtk软件包安装失败" - LOG_INFO "colord-gtk软件包安装成功" - fi - - # 验证colord-gtk软件包安装是否成功 - LOG_INFO "验证colord-gtk软件包安装是否成功" - rpm -q colord-gtk > /dev/null 2>&1 - CHECK_RESULT $? 0 0 "colord-gtk软件包未正确安装" - - # 清理环境:如果测试前未安装,则卸载软件包 - if [ "$INSTALLED" = "false" ]; then - LOG_INFO "清理环境:卸载colord-gtk软件包" - dnf remove -y colord-gtk - CHECK_RESULT $? 0 0 "colord-gtk软件包卸载失败" - LOG_INFO "colord-gtk软件包卸载成功" - else - LOG_INFO "测试前colord-gtk已安装,保持安装状态,无需卸载" - fi - - LOG_INFO "colord-gtk软件包安装功能测试完成" -} - -main "$@" \ No newline at end of file diff --git a/testcases/function_test/pkg_test/colord-gtk/colord-gtk/test_colord-gtk_service_status.sh b/testcases/function_test/pkg_test/colord-gtk/colord-gtk/test_colord-gtk_service_status.sh deleted file mode 100644 index 83c9bf2c318..00000000000 --- a/testcases/function_test/pkg_test/colord-gtk/colord-gtk/test_colord-gtk_service_status.sh +++ /dev/null @@ -1,107 +0,0 @@ -#!/usr/bin/bash - -# Copyright (c) 2024 ISCAS .ALL rights reserved. -# This program is licensed under Mulan PSL v2. -# You can use it according to the terms and conditions of the Mulan PSL v2. -# http://license.coscl.org.cn/MulanPSL2 -# THIS PROGRAM IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, -# EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, -# MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. -# See the Mulan PSL v2 for more details. - -# ############################################# -# @Author : honghua -# @Contact : honghua@iscas.ac.cn -# @Date : 2026-04-05 -# @License : Mulan PSL v2 -# @Desc : 测试与colord-gtk相关的服务(如colord)的运行状态 -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - # 测试环境初始化检查 - LOG_INFO "开始测试colord-gtk相关服务状态" - LOG_INFO "检查colord-gtk软件包是否已安装" - - # 检查软件包是否已安装 - if rpm -q colord-gtk >/dev/null 2>&1; then - LOG_INFO "colord-gtk软件包已安装,标记为需要保持安装状态" - KEEP_INSTALLED=true - else - LOG_INFO "colord-gtk软件包未安装,标记为需要测试后卸载" - KEEP_INSTALLED=false - fi - - # 检查yum源中是否有colord-gtk软件包 - LOG_INFO "检查yum源中是否存在colord-gtk软件包" - dnf list available colord-gtk >/dev/null 2>&1 - if [ $? -ne 0 ]; then - LOG_ERROR "yum源中未找到colord-gtk软件包" - exit 255 - fi - LOG_INFO "yum源中存在colord-gtk软件包" - - # 如果未安装,则安装软件包 - if [ "$KEEP_INSTALLED" = "false" ]; then - LOG_INFO "开始安装colord-gtk软件包" - dnf install -y colord-gtk - CHECK_RESULT $? 0 0 "安装colord-gtk软件包失败" - LOG_INFO "colord-gtk软件包安装成功" - fi - - # 测试步骤1:检查colord服务是否存在 - LOG_INFO "检查colord服务是否存在" - systemctl list-unit-files | grep -q colord.service - CHECK_RESULT $? 0 0 "colord服务不存在" - - # 测试步骤2:检查colord服务状态 - LOG_INFO "检查colord服务状态" - systemctl status colord --no-pager >/dev/null 2>&1 - if [ $? -eq 0 ]; then - LOG_INFO "colord服务正在运行" - # 测试步骤3:重启colord服务 - LOG_INFO "重启colord服务" - systemctl restart colord - CHECK_RESULT $? 0 0 "重启colord服务失败" - - # 测试步骤4:检查重启后服务状态 - LOG_INFO "检查重启后colord服务状态" - systemctl status colord --no-pager >/dev/null 2>&1 - CHECK_RESULT $? 0 0 "colord服务重启后未正常运行" - else - LOG_INFO "colord服务未运行,尝试启动服务" - # 测试步骤5:启动colord服务 - systemctl start colord - CHECK_RESULT $? 0 0 "启动colord服务失败" - - # 测试步骤6:检查启动后服务状态 - LOG_INFO "检查启动后colord服务状态" - systemctl status colord --no-pager >/dev/null 2>&1 - CHECK_RESULT $? 0 0 "colord服务启动后未正常运行" - fi - - # 测试步骤7:检查colord服务是否开机自启 - LOG_INFO "检查colord服务是否开机自启" - systemctl is-enabled colord >/dev/null 2>&1 - if [ $? -eq 0 ]; then - LOG_INFO "colord服务已设置为开机自启" - else - LOG_INFO "colord服务未设置为开机自启" - fi - - # 环境清理 - LOG_INFO "开始清理测试环境" - if [ "$KEEP_INSTALLED" = "false" ]; then - LOG_INFO "卸载colord-gtk软件包" - dnf remove -y colord-gtk - CHECK_RESULT $? 0 0 "卸载colord-gtk软件包失败" - LOG_INFO "colord-gtk软件包卸载成功" - else - LOG_INFO "保持colord-gtk软件包安装状态" - fi - - LOG_INFO "colord-gtk相关服务状态测试完成" -} - -main "$@" \ No newline at end of file diff --git a/testcases/function_test/pkg_test/criu/criu/test_criu_function_checkpoint.sh b/testcases/function_test/pkg_test/criu/criu/test_criu_function_checkpoint.sh deleted file mode 100644 index 874a554b200..00000000000 --- a/testcases/function_test/pkg_test/criu/criu/test_criu_function_checkpoint.sh +++ /dev/null @@ -1,110 +0,0 @@ -#!/usr/bin/bash - -# Copyright (c) 2024 ISCAS .ALL rights reserved. -# This program is licensed under Mulan PSL v2. -# You can use it according to the terms and conditions of the Mulan PSL v2. -# http://license.coscl.org.cn/MulanPSL2 -# THIS PROGRAM IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, -# EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, -# 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-04 -# @License : Mulan PSL v2 -# @Desc : 测试criu的检查点功能(结合dump与restore)。 -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - set -e - - LOG_INFO "开始测试criu的检查点功能(结合dump与restore)" - - LOG_INFO "步骤1:检查criu软件包是否在yum源中" - if ! dnf list available criu 2>&1 | grep -q "criu"; then - LOG_ERROR "yum源中未找到criu软件包" - exit 255 - fi - - LOG_INFO "步骤2:检查当前环境是否已安装criu" - if command -v criu &> /dev/null; then - LOG_INFO "criu已安装,标记为环境已存在安装" - ENV_INSTALLED="true" - else - LOG_INFO "criu未安装,标记为需要安装" - ENV_INSTALLED="false" - fi - - if [ "$ENV_INSTALLED" = "false" ]; then - LOG_INFO "步骤3:安装criu软件包" - dnf install -y criu - CHECK_RESULT $? 0 0 "安装criu失败" - fi - - LOG_INFO "步骤4:检查criu命令是否支持dump和restore参数" - criu check --feature dump - CHECK_RESULT $? 0 0 "criu不支持dump功能" - criu check --feature restore - CHECK_RESULT $? 0 0 "criu不支持restore功能" - - LOG_INFO "步骤5:创建一个简单的测试进程用于检查点操作" - TEST_PROG="/tmp/test_criu_prog" - cat > $TEST_PROG << "EOF" - - while true; do - echo "Test process is running..." - sleep 5 - done - EOF - chmod +x $TEST_PROG - bash $TEST_PROG & - TEST_PID=$! - sleep 2 - LOG_INFO "测试进程PID: $TEST_PID" - - LOG_INFO "步骤6:使用criu dump创建检查点" - mkdir -p /tmp/criu_dump - criu dump -t $TEST_PID -D /tmp/criu_dump --shell-job - CHECK_RESULT $? 0 0 "criu dump失败" - - LOG_INFO "步骤7:停止原始测试进程" - kill -9 $TEST_PID 2>/dev/null || true - wait $TEST_PID 2>/dev/null - - LOG_INFO "步骤8:使用criu restore从检查点恢复进程" - criu restore -D /tmp/criu_dump --shell-job & - RESTORE_PID=$! - sleep 2 - CHECK_RESULT $? 0 0 "criu restore失败" - - LOG_INFO "步骤9:验证恢复的进程是否在运行" - if ps -p $RESTORE_PID > /dev/null; then - LOG_INFO "进程恢复成功,PID: $RESTORE_PID" - else - LOG_ERROR "进程恢复失败" - exit 1 - fi - - LOG_INFO "步骤10:清理测试进程" - kill -9 $RESTORE_PID 2>/dev/null || true - wait $RESTORE_PID 2>/dev/null - - LOG_INFO "步骤11:清理检查点文件" - rm -rf /tmp/criu_dump $TEST_PROG - - if [ "$ENV_INSTALLED" = "false" ]; then - LOG_INFO "步骤12:卸载测试安装的criu软件包" - dnf remove -y criu - CHECK_RESULT $? 0 0 "卸载criu失败" - else - LOG_INFO "步骤12:环境中原已安装criu,保持安装状态" - fi - - LOG_INFO "criu检查点功能测试完成" -} - -main "$@" \ No newline at end of file diff --git a/testcases/function_test/pkg_test/criu/criu/test_criu_function_restore.sh b/testcases/function_test/pkg_test/criu/criu/test_criu_function_restore.sh deleted file mode 100644 index b1fc028d3c7..00000000000 --- a/testcases/function_test/pkg_test/criu/criu/test_criu_function_restore.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-04-04 -# @License : Mulan PSL v2 -# @Desc : 测试criu的核心恢复功能,验证是否能从转储文件恢复进程。 -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - LOG_INFO "开始测试criu的核心恢复功能,验证是否能从转储文件恢复进程" - - # 检查是否已安装criu - LOG_INFO "检查criu是否已安装" - if dnf list installed criu &> /dev/null; then - LOG_INFO "criu已安装,脚本结束时将保持安装状态" - INSTALLED=true - else - LOG_INFO "criu未安装,将在测试过程中安装" - INSTALLED=false - fi - - # 检查yum源中是否有criu软件包 - LOG_INFO "检查yum源中是否有criu软件包" - if ! dnf list available criu &> /dev/null; then - LOG_ERROR "yum源中未找到criu软件包" - exit 255 - fi - - # 如果未安装,则安装criu - if [ "$INSTALLED" = false ]; then - LOG_INFO "安装criu软件包" - dnf install -y criu - CHECK_RESULT $? 0 0 "安装criu失败" - fi - - # 检查criu命令是否支持dump和restore参数 - LOG_INFO "检查criu命令是否支持dump和restore参数" - criu dump --help 2>&1 | grep -q "dump" || { - LOG_ERROR "criu命令不支持dump参数" - exit 255 - } - criu restore --help 2>&1 | grep -q "restore" || { - LOG_ERROR "criu命令不支持restore参数" - exit 255 - } - - # 创建测试进程 - LOG_INFO "创建测试进程" - sleep 1000 & - TEST_PID=$! - - # 创建转储目录 - LOG_INFO "创建转储目录" - DUMP_DIR=$(mktemp -d) - - # 使用criu dump转储进程 - LOG_INFO "使用criu dump转储进程" - criu dump -t $TEST_PID -D $DUMP_DIR --shell-job - CHECK_RESULT $? 0 0 "criu dump转储进程失败" - - # 等待进程被挂起 - sleep 2 - - # 使用criu restore恢复进程 - LOG_INFO "使用criu restore恢复进程" - criu restore -D $DUMP_DIR --shell-job - CHECK_RESULT $? 0 0 "criu restore恢复进程失败" - - # 检查恢复后的进程是否在运行 - LOG_INFO "检查恢复后的进程是否在运行" - sleep 2 - if ps -p $TEST_PID > /dev/null; then - LOG_INFO "进程恢复成功,进程ID: $TEST_PID" - else - LOG_ERROR "进程恢复失败" - kill $TEST_PID 2>/dev/null - CHECK_RESULT 1 0 0 "进程恢复失败" - fi - - # 清理测试进程 - LOG_INFO "清理测试进程" - kill $TEST_PID 2>/dev/null - - # 清理转储目录 - LOG_INFO "清理转储目录" - rm -rf $DUMP_DIR - - # 如果测试前未安装criu,则卸载 - if [ "$INSTALLED" = false ]; then - LOG_INFO "卸载criu软件包" - dnf remove -y criu - CHECK_RESULT $? 0 0 "卸载criu失败" - fi - - LOG_INFO "测试完成,环境已恢复" -} - -main "$@" \ No newline at end of file diff --git a/testcases/function_test/pkg_test/eclipse/eclipse-jdt/test_eclipse-jdt_rollback.sh b/testcases/function_test/pkg_test/eclipse/eclipse-jdt/test_eclipse-jdt_rollback.sh deleted file mode 100644 index 4e6e95cd38b..00000000000 --- a/testcases/function_test/pkg_test/eclipse/eclipse-jdt/test_eclipse-jdt_rollback.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-06-20 -# @License : Mulan PSL v2 -# @Desc : 测试eclipse-jdt软件包的升级回滚功能 -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - LOG_INFO "开始测试eclipse-jdt软件包的升级回滚功能" - - # 检查是否已安装eclipse-jdt - LOG_INFO "检查是否已安装eclipse-jdt" - dnf list installed eclipse-jdt > /dev/null 2>&1 - if [ $? -eq 0 ]; then - LOG_INFO "eclipse-jdt已安装,脚本结束时将保持安装状态" - INSTALLED=true - else - LOG_INFO "eclipse-jdt未安装,将在测试结束后卸载" - INSTALLED=false - fi - - # 检查yum源中是否有eclipse-jdt软件包 - LOG_INFO "检查yum源中是否有eclipse-jdt软件包" - dnf list available eclipse-jdt > /dev/null 2>&1 - CHECK_RESULT $? 0 255 "yum源中没有eclipse-jdt软件包" - - # 安装eclipse-jdt软件包 - LOG_INFO "安装eclipse-jdt软件包" - dnf install -y eclipse-jdt - CHECK_RESULT $? 0 0 "安装eclipse-jdt失败" - - # 测试升级回滚功能 - LOG_INFO "测试升级回滚功能" - dnf history | grep eclipse-jdt > /dev/null 2>&1 - if [ $? -eq 0 ]; then - LOG_INFO "执行回滚操作" - dnf history undo last -y - CHECK_RESULT $? 0 0 "回滚操作失败" - else - LOG_ERROR "未找到eclipse-jdt的安装记录,无法回滚" - exit 255 - fi - - # 清理环境:如果脚本开始时未安装,则卸载软件包 - if [ "$INSTALLED" = false ]; then - LOG_INFO "清理环境:卸载eclipse-jdt软件包" - dnf remove -y eclipse-jdt - CHECK_RESULT $? 0 0 "卸载eclipse-jdt失败" - fi - - LOG_INFO "测试完成,环境已恢复" -} - -main "$@" \ No newline at end of file diff --git a/testcases/function_test/pkg_test/harfbuzz/harfbuzz-help/test_harfbuzz-help_function_help_output.sh b/testcases/function_test/pkg_test/harfbuzz/harfbuzz-help/test_harfbuzz-help_function_help_output.sh deleted file mode 100644 index 1df65e130f9..00000000000 --- a/testcases/function_test/pkg_test/harfbuzz/harfbuzz-help/test_harfbuzz-help_function_help_output.sh +++ /dev/null @@ -1,131 +0,0 @@ -#!/usr/bin/bash - -# Copyright (c) 2024 ISCAS .ALL rights reserved. -# This program is licensed under Mulan PSL v2. -# You can use it according to the terms and conditions of the Mulan PSL v2. -# http://license.coscl.org.cn/MulanPSL2 -# THIS PROGRAM IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, -# EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, -# MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. -# See the Mulan PSL v2 for more details. - -# ############################################# -# @Author : honghua -# @Contact : honghua@iscas.ac.cn -# @Date : 2026-03-15 -# @License : Mulan PSL v2 -# @Desc : 测试执行harfbuzz-help命令是否能正常输出帮助信息(如用法、选项等)。 -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - # 定义颜色输出函数 - RED="\033[0;31m" - GREEN="\033[0;32m" - NC="\033[0m" # No Color - - # 定义日志函数 - LOG_INFO() { - echo -e "${GREEN}[INFO]${NC} $1" - } - - LOG_ERROR() { - echo -e "${RED}[ERROR]${NC} $1" - } - - # 定义检查函数 - CHECK_RESULT() { - local actual=$1 - local expected=$2 - local exit_code=$3 - local error_msg=$4 - - if [ $actual -ne $expected ]; then - LOG_ERROR "$error_msg" - exit $exit_code - fi - } - - # 定义SSH_CMD函数 - SSH_CMD() { - local cmd=$1 - local ip=$2 - local password=$3 - local user=$4 - - sshpass -p "$password" ssh -o StrictHostKeyChecking=no -o UserKnownHostsFile=/dev/null "$user@$ip" "$cmd" - } - - # 定义清理函数 - cleanup() { - LOG_INFO "开始清理环境..." - if [ $installed -eq 1 ]; then - LOG_INFO "卸载harfbuzz软件包..." - dnf remove -y harfbuzz - CHECK_RESULT $? 0 255 "卸载harfbuzz软件包失败" - LOG_INFO "harfbuzz软件包卸载成功" - fi - LOG_INFO "环境清理完成" - } - - # 设置脚本退出时执行清理函数 - trap cleanup EXIT - - # 初始化变量 - installed=0 - PACKAGE_NAME="harfbuzz" - - # 步骤1: 检查harfbuzz软件包是否已安装 - LOG_INFO "步骤1: 检查harfbuzz软件包是否已安装" - if rpm -q $PACKAGE_NAME &>/dev/null; then - LOG_INFO "harfbuzz软件包已安装" - installed=1 - else - LOG_INFO "harfbuzz软件包未安装" - fi - - # 步骤2: 检查yum源中是否有harfbuzz软件包 - LOG_INFO "步骤2: 检查yum源中是否有harfbuzz软件包" - dnf list available $PACKAGE_NAME &>/dev/null - CHECK_RESULT $? 0 255 "yum源中没有harfbuzz软件包" - - # 步骤3: 如果未安装,则安装harfbuzz软件包 - if [ $installed -eq 0 ]; then - LOG_INFO "步骤3: 安装harfbuzz软件包" - dnf install -y $PACKAGE_NAME - CHECK_RESULT $? 0 1 "安装harfbuzz软件包失败" - LOG_INFO "harfbuzz软件包安装成功" - installed=1 - fi - - # 步骤4: 测试harfbuzz-help命令是否能正常输出帮助信息 - LOG_INFO "步骤4: 测试harfbuzz-help命令是否能正常输出帮助信息" - # 检查harfbuzz-help命令是否存在 - if ! command -v harfbuzz-help &>/dev/null; then - LOG_ERROR "harfbuzz-help命令不存在或不支持" - exit 255 - fi - - # 执行harfbuzz-help命令并检查输出 - output=$(harfbuzz-help 2>&1) - exit_code=$? - - # 检查命令是否成功执行 - if [ $exit_code -ne 0 ]; then - LOG_ERROR "harfbuzz-help命令执行失败" - exit $exit_code - fi - - # 检查输出是否包含帮助信息 - if echo "$output" | grep -q -i "usage\|help\|option"; then - LOG_INFO "harfbuzz-help命令输出帮助信息成功" - else - LOG_ERROR "harfbuzz-help命令输出中未找到帮助信息" - exit 1 - fi - - LOG_INFO "测试完成" -} - -main "$@" \ No newline at end of file diff --git a/testcases/function_test/pkg_test/jffi/jffi-javadoc/test_jffi-javadoc_function_docgen.sh b/testcases/function_test/pkg_test/jffi/jffi-javadoc/test_jffi-javadoc_function_docgen.sh deleted file mode 100644 index 843c7b280c9..00000000000 --- a/testcases/function_test/pkg_test/jffi/jffi-javadoc/test_jffi-javadoc_function_docgen.sh +++ /dev/null @@ -1,70 +0,0 @@ -#!/usr/bin/bash - -# Copyright (c) 2024 ISCAS .ALL rights reserved. -# This program is licensed under Mulan PSL v2. -# You can use it according to the terms and conditions of the Mulan PSL v2. -# http://license.coscl.org.cn/MulanPSL2 -# THIS PROGRAM IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, -# EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, -# MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. -# See the Mulan PSL v2 for more details. - -# ############################################# -# @Author : honghua -# @Contact : honghua@iscas.ac.cn -# @Date : 2025-12-09 -# @License : Mulan PSL v2 -# @Desc : Verify Javadoc generation for jffi-javadoc -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - LOG_INFO "开始测试:Verify Javadoc generation for jffi-javadoc" - - # 检查是否已安装jffi-javadoc - LOG_INFO "检查是否已安装jffi-javadoc" - dnf list installed jffi-javadoc &>/dev/null - if [ $? -eq 0 ]; then - LOG_INFO "jffi-javadoc已安装,测试结束后保持安装状态" - INSTALLED=true - else - LOG_INFO "jffi-javadoc未安装,将在测试结束后卸载" - INSTALLED=false - fi - - # 检查yum源中是否有jffi-javadoc - LOG_INFO "检查yum源中是否有jffi-javadoc" - dnf list available jffi-javadoc &>/dev/null - if [ $? -ne 0 ]; then - LOG_ERROR "yum源中未找到jffi-javadoc" - exit 255 - fi - - # 安装jffi-javadoc(如果未安装) - if [ "$INSTALLED" = false ]; then - LOG_INFO "开始安装jffi-javadoc" - dnf install -y jffi-javadoc &>/dev/null - CHECK_RESULT $? 0 0 "安装jffi-javadoc失败" - fi - - # 验证Javadoc生成功能 - LOG_INFO "验证Javadoc生成功能" - javadoc -d /tmp/jffi-javadoc -sourcepath /usr/share/java jffi &>/dev/null - CHECK_RESULT $? 0 0 "Javadoc生成失败" - - # 清理临时文件 - LOG_INFO "清理临时文件" - rm -rf /tmp/jffi-javadoc &>/dev/null - - # 卸载jffi-javadoc(如果测试前未安装) - if [ "$INSTALLED" = false ]; then - LOG_INFO "卸载jffi-javadoc" - dnf remove -y jffi-javadoc &>/dev/null - CHECK_RESULT $? 0 0 "卸载jffi-javadoc失败" - fi - - LOG_INFO "测试完成:Verify Javadoc generation for jffi-javadoc" -} - -main "$@" \ No newline at end of file diff --git a/testcases/function_test/pkg_test/mesa/mesa-filesystem/test_mesa-filesystem_function_conflict.sh b/testcases/function_test/pkg_test/mesa/mesa-filesystem/test_mesa-filesystem_function_conflict.sh deleted file mode 100644 index 6c940b28278..00000000000 --- a/testcases/function_test/pkg_test/mesa/mesa-filesystem/test_mesa-filesystem_function_conflict.sh +++ /dev/null @@ -1,190 +0,0 @@ -#!/usr/bin/bash - -# Copyright (c) 2024 ISCAS .ALL rights reserved. -# This program is licensed under Mulan PSL v2. -# You can use it according to the terms and conditions of the Mulan PSL v2. -# http://license.coscl.org.cn/MulanPSL2 -# THIS PROGRAM IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, -# EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, -# 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-23 -# @License : Mulan PSL v2 -# @Desc : 测试mesa-filesystem软件包与冲突包(如闭源驱动包)的安装互斥性。 -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - # 测试环境初始化 - LOG_INFO "开始测试mesa-filesystem软件包与冲突包的安装互斥性" - - # 定义软件包名称 - MESA_PKG="mesa-filesystem" - CONFLICT_PKGS=("nvidia-driver" "amd-driver" "intel-driver-latest") - CONFLICT_PKG="" - - # 检查软件包是否已安装 - LOG_INFO "检查${MESA_PKG}是否已安装" - rpm -q ${MESA_PKG} &>/dev/null - MESA_INSTALLED=$? - - # 查找冲突包 - LOG_INFO "查找系统中可能存在的冲突包" - for pkg in "${CONFLICT_PKGS[@]}"; do - rpm -q ${pkg} &>/dev/null - if [ $? -eq 0 ]; then - CONFLICT_PKG=${pkg} - LOG_INFO "发现已安装的冲突包: ${CONFLICT_PKG}" - break - fi - done - - # 检查yum源中是否有mesa-filesystem包 - LOG_INFO "检查yum源中是否有${MESA_PKG}软件包" - dnf list available ${MESA_PKG} &>/dev/null - CHECK_RESULT $? 0 0 "yum源中未找到${MESA_PKG}软件包" - if [ $? -ne 0 ]; then - LOG_ERROR "yum源中未找到${MESA_PKG}软件包" - exit 255 - fi - - # 测试场景1: 如果已安装mesa-filesystem,尝试安装冲突包 - if [ ${MESA_INSTALLED} -eq 0 ]; then - LOG_INFO "场景1: ${MESA_PKG}已安装,尝试安装冲突包" - - # 查找可用的冲突包进行测试 - AVAILABLE_CONFLICT="" - for pkg in "${CONFLICT_PKGS[@]}"; do - dnf list available ${pkg} &>/dev/null - if [ $? -eq 0 ]; then - AVAILABLE_CONFLICT=${pkg} - LOG_INFO "找到可用的冲突包进行测试: ${AVAILABLE_CONFLICT}" - break - fi - done - - if [ -n "${AVAILABLE_CONFLICT}" ]; then - LOG_INFO "尝试安装冲突包: ${AVAILABLE_CONFLICT}" - dnf install -y ${AVAILABLE_CONFLICT} &>/dev/null - - # 检查是否安装失败(预期应该失败) - if [ $? -ne 0 ]; then - LOG_INFO "冲突包安装失败,符合预期(与${MESA_PKG}冲突)" - CHECK_RESULT $? 1 0 "冲突包应该安装失败" - else - LOG_ERROR "冲突包安装成功,不符合预期" - CHECK_RESULT $? 0 1 "冲突包不应该安装成功" - - # 清理安装的冲突包 - LOG_INFO "清理已安装的冲突包" - dnf remove -y ${AVAILABLE_CONFLICT} &>/dev/null - CHECK_RESULT $? 0 0 "卸载冲突包失败" - fi - else - LOG_INFO "未找到可用的冲突包进行测试" - fi - fi - - # 测试场景2: 如果已安装冲突包,尝试安装mesa-filesystem - if [ -n "${CONFLICT_PKG}" ]; then - LOG_INFO "场景2: ${CONFLICT_PKG}已安装,尝试安装${MESA_PKG}" - - LOG_INFO "尝试安装${MESA_PKG}" - dnf install -y ${MESA_PKG} &>/dev/null - - # 检查是否安装失败(预期应该失败) - if [ $? -ne 0 ]; then - LOG_INFO "${MESA_PKG}安装失败,符合预期(与${CONFLICT_PKG}冲突)" - CHECK_RESULT $? 1 0 "${MESA_PKG}应该安装失败" - else - LOG_ERROR "${MESA_PKG}安装成功,不符合预期" - CHECK_RESULT $? 0 1 "${MESA_PKG}不应该安装成功" - - # 清理安装的mesa-filesystem - LOG_INFO "清理已安装的${MESA_PKG}" - dnf remove -y ${MESA_PKG} &>/dev/null - CHECK_RESULT $? 0 0 "卸载${MESA_PKG}失败" - fi - fi - - # 测试场景3: 如果都未安装,先安装mesa-filesystem再尝试安装冲突包 - if [ ${MESA_INSTALLED} -ne 0 ] && [ -z "${CONFLICT_PKG}" ]; then - LOG_INFO "场景3: 系统未安装相关软件包,测试完整安装流程" - - # 安装mesa-filesystem - LOG_INFO "安装${MESA_PKG}" - dnf install -y ${MESA_PKG} &>/dev/null - CHECK_RESULT $? 0 0 "安装${MESA_PKG}失败" - - # 尝试安装冲突包 - AVAILABLE_CONFLICT="" - for pkg in "${CONFLICT_PKGS[@]}"; do - dnf list available ${pkg} &>/dev/null - if [ $? -eq 0 ]; then - AVAILABLE_CONFLICT=${pkg} - LOG_INFO "找到可用的冲突包: ${AVAILABLE_CONFLICT}" - break - fi - done - - if [ -n "${AVAILABLE_CONFLICT}" ]; then - LOG_INFO "尝试安装冲突包: ${AVAILABLE_CONFLICT}" - dnf install -y ${AVAILABLE_CONFLICT} &>/dev/null - - # 检查是否安装失败(预期应该失败) - if [ $? -ne 0 ]; then - LOG_INFO "冲突包安装失败,符合预期(与${MESA_PKG}冲突)" - CHECK_RESULT $? 1 0 "冲突包应该安装失败" - else - LOG_ERROR "冲突包安装成功,不符合预期" - CHECK_RESULT $? 0 1 "冲突包不应该安装成功" - - # 清理安装的冲突包 - LOG_INFO "清理已安装的冲突包" - dnf remove -y ${AVAILABLE_CONFLICT} &>/dev/null - CHECK_RESULT $? 0 0 "卸载冲突包失败" - fi - else - LOG_INFO "未找到可用的冲突包进行测试" - fi - - # 清理环境:卸载mesa-filesystem - LOG_INFO "清理测试环境:卸载${MESA_PKG}" - dnf remove -y ${MESA_PKG} &>/dev/null - CHECK_RESULT $? 0 0 "卸载${MESA_PKG}失败" - fi - - # 环境恢复 - LOG_INFO "恢复测试环境" - - # 如果测试前已安装mesa-filesystem,确保测试后仍然安装 - if [ ${MESA_INSTALLED} -eq 0 ]; then - LOG_INFO "检查${MESA_PKG}是否仍然安装" - rpm -q ${MESA_PKG} &>/dev/null - if [ $? -ne 0 ]; then - LOG_INFO "重新安装${MESA_PKG}以恢复环境" - dnf install -y ${MESA_PKG} &>/dev/null - CHECK_RESULT $? 0 0 "恢复${MESA_PKG}安装失败" - fi - fi - - # 如果测试前已安装冲突包,确保测试后仍然安装 - if [ -n "${CONFLICT_PKG}" ]; then - LOG_INFO "检查${CONFLICT_PKG}是否仍然安装" - rpm -q ${CONFLICT_PKG} &>/dev/null - if [ $? -ne 0 ]; then - LOG_INFO "重新安装${CONFLICT_PKG}以恢复环境" - dnf install -y ${CONFLICT_PKG} &>/dev/null - CHECK_RESULT $? 0 0 "恢复${CONFLICT_PKG}安装失败" - fi - fi - - LOG_INFO "测试完成:mesa-filesystem软件包与冲突包的安装互斥性验证成功" -} - -main "$@" \ No newline at end of file diff --git a/testcases/function_test/pkg_test/mesa/mesa-filesystem/test_mesa-filesystem_function_dependency.sh b/testcases/function_test/pkg_test/mesa/mesa-filesystem/test_mesa-filesystem_function_dependency.sh deleted file mode 100644 index 1af198a6be3..00000000000 --- a/testcases/function_test/pkg_test/mesa/mesa-filesystem/test_mesa-filesystem_function_dependency.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-03-23 -# @License : Mulan PSL v2 -# @Desc : 测试mesa-filesystem软件包被其他图形应用正确识别和依赖。 -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - # 初始化环境变量 - LOG_FILE="/var/log/test_mesa-filesystem.log" - PACKAGE_NAME="mesa-filesystem" - DEPENDENCY_APP="glxinfo" - - # 检查软件包是否在yum源中 - check_package_in_repo() { - LOG_INFO "检查yum源中是否存在软件包: $PACKAGE_NAME" - dnf list available $PACKAGE_NAME &>/dev/null - CHECK_RESULT $? 0 0 "软件包 $PACKAGE_NAME 不在yum源中" - if [ $? -ne 0 ]; then - LOG_ERROR "软件包 $PACKAGE_NAME 不在yum源中" - exit 255 - fi - } - - # 检查命令参数是否支持 - check_command_param() { - LOG_INFO "检查命令参数是否支持" - if [ $# -lt 1 ]; then - LOG_ERROR "命令参数不存在或不支持" - exit 255 - fi - } - - # 检查环境是否已安装软件包 - check_installed() { - LOG_INFO "检查环境是否已安装软件包: $PACKAGE_NAME" - rpm -q $PACKAGE_NAME &>/dev/null - if [ $? -eq 0 ]; then - LOG_INFO "软件包 $PACKAGE_NAME 已安装" - INSTALLED=1 - else - LOG_INFO "软件包 $PACKAGE_NAME 未安装" - INSTALLED=0 - fi - } - - # 安装软件包 - install_package() { - LOG_INFO "安装软件包: $PACKAGE_NAME" - dnf install -y $PACKAGE_NAME - CHECK_RESULT $? 0 0 "安装软件包 $PACKAGE_NAME 失败" - } - - # 卸载软件包 - uninstall_package() { - LOG_INFO "卸载软件包: $PACKAGE_NAME" - dnf remove -y $PACKAGE_NAME - CHECK_RESULT $? 0 0 "卸载软件包 $PACKAGE_NAME 失败" - } - - # 测试图形应用正确识别和依赖 - test_dependency() { - LOG_INFO "测试图形应用正确识别和依赖" - # 检查依赖应用是否可执行 - which $DEPENDENCY_APP &>/dev/null - CHECK_RESULT $? 0 0 "图形应用 $DEPENDENCY_APP 未安装或不可执行" - - # 执行图形应用命令 - LOG_INFO "执行图形应用命令: $DEPENDENCY_APP" - $DEPENDENCY_APP &>/dev/null - CHECK_RESULT $? 0 0 "图形应用 $DEPENDENCY_APP 执行失败" - - # 检查mesa-filesystem提供的库文件是否存在 - LOG_INFO "检查mesa-filesystem提供的库文件" - ldconfig -p | grep -i mesa &>/dev/null - CHECK_RESULT $? 0 0 "mesa-filesystem库文件未正确安装" - } - - # 主测试流程 - main() { - LOG_INFO "开始测试mesa-filesystem软件包被其他图形应用正确识别和依赖" - - # 步骤1: 检查软件包是否在yum源中 - check_package_in_repo - - # 步骤2: 检查环境是否已安装 - check_installed - - # 步骤3: 如果未安装,则安装软件包 - if [ $INSTALLED -eq 0 ]; then - install_package - NEED_CLEANUP=1 - else - NEED_CLEANUP=0 - fi - - # 步骤4: 测试图形应用正确识别和依赖 - test_dependency - - # 步骤5: 环境恢复 - if [ $NEED_CLEANUP -eq 1 ]; then - uninstall_package - fi - - LOG_INFO "测试完成" - } - - # 执行主测试流程 - main -} - -main "$@" \ No newline at end of file diff --git a/testcases/function_test/pkg_test/mesa/mesa-filesystem/test_mesa-filesystem_function_provides.sh b/testcases/function_test/pkg_test/mesa/mesa-filesystem/test_mesa-filesystem_function_provides.sh deleted file mode 100644 index a25edbd196d..00000000000 --- a/testcases/function_test/pkg_test/mesa/mesa-filesystem/test_mesa-filesystem_function_provides.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-23 -# @License : Mulan PSL v2 -# @Desc : 测试mesa-filesystem软件包提供的核心库文件(如libGL.so)是否存在于标准路径。 -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - # 定义软件包名称 - PACKAGE_NAME="mesa-filesystem" - - # 检查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}软件包是否已安装..." - rpm -q ${PACKAGE_NAME} &>/dev/null - if [ $? -eq 0 ]; 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 - - # 测试mesa-filesystem软件包提供的核心库文件是否存在于标准路径 - LOG_INFO "测试mesa-filesystem软件包提供的核心库文件是否存在于标准路径..." - - # 检查libGL.so库文件是否存在 - LIB_FILE="/usr/lib64/libGL.so" - LOG_INFO "检查库文件${LIB_FILE}是否存在..." - if [ -f "${LIB_FILE}" ]; then - LOG_INFO "库文件${LIB_FILE}存在" - CHECK_RESULT 0 0 0 "库文件${LIB_FILE}不存在" - else - LOG_ERROR "库文件${LIB_FILE}不存在" - CHECK_RESULT 1 0 0 "库文件${LIB_FILE}不存在" - fi - - # 检查其他可能的核心库文件 - ADDITIONAL_LIBS=( - "/usr/lib64/libGL.so.1" - "/usr/lib64/libGLESv2.so" - "/usr/lib64/libGLESv2.so.2" - "/usr/lib64/libEGL.so" - "/usr/lib64/libEGL.so.1" - ) - - LOG_INFO "检查其他核心库文件..." - for lib in "${ADDITIONAL_LIBS[@]}"; do - if [ -f "${lib}" ]; then - LOG_INFO "库文件${lib}存在" - else - LOG_INFO "库文件${lib}不存在(某些库文件可能不是必须的)" - fi - done - - # 清理环境:如果测试前未安装,则卸载软件包 - if [ "${INSTALLED}" = "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/mesa/mesa-filesystem/test_mesa-filesystem_function_version.sh b/testcases/function_test/pkg_test/mesa/mesa-filesystem/test_mesa-filesystem_function_version.sh deleted file mode 100644 index 9756d8edd92..00000000000 --- a/testcases/function_test/pkg_test/mesa/mesa-filesystem/test_mesa-filesystem_function_version.sh +++ /dev/null @@ -1,77 +0,0 @@ -#!/usr/bin/bash - -# Copyright (c) 2024 ISCAS .ALL rights reserved. -# This program is licensed under Mulan PSL v2. -# You can use it according to the terms and conditions of the Mulan PSL v2. -# http://license.coscl.org.cn/MulanPSL2 -# THIS PROGRAM IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, -# EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, -# MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. -# See the Mulan PSL v2 for more details. - -# ############################################# -# @Author : honghua -# @Contact : honghua@iscas.ac.cn -# @Date : 2026-03-23 -# @License : Mulan PSL v2 -# @Desc : 测试验证mesa-filesystem软件包的版本信息是否符合预期。 -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - # 测试脚本开始 - - # 步骤1:检查yum源中是否存在mesa-filesystem软件包 - LOG_INFO "步骤1:检查yum源中是否存在mesa-filesystem软件包" - if ! dnf list available mesa-filesystem &>/dev/null; then - LOG_ERROR "yum源中未找到mesa-filesystem软件包" - exit 255 - fi - - # 步骤2:检查当前环境是否已安装mesa-filesystem - LOG_INFO "步骤2:检查当前环境是否已安装mesa-filesystem" - if rpm -q mesa-filesystem &>/dev/null; then - LOG_INFO "mesa-filesystem已安装,标记为保持安装状态" - KEEP_INSTALLED=1 - else - LOG_INFO "mesa-filesystem未安装,标记为需要清理" - KEEP_INSTALLED=0 - fi - - # 步骤3:如果未安装,则安装mesa-filesystem软件包 - if [ $KEEP_INSTALLED -eq 0 ]; then - LOG_INFO "步骤3:安装mesa-filesystem软件包" - dnf install -y mesa-filesystem - CHECK_RESULT $? 0 0 "安装mesa-filesystem软件包失败" - fi - - # 步骤4:验证mesa-filesystem软件包的版本信息 - LOG_INFO "步骤4:验证mesa-filesystem软件包的版本信息" - MESA_VERSION=$(rpm -q --queryformat "%{VERSION}" mesa-filesystem) - CHECK_RESULT $? 0 0 "获取mesa-filesystem版本信息失败" - - # 步骤5:检查版本信息是否符合预期(这里假设预期版本为某个特定值,例如21.3.5) - # 注意:实际测试中应根据具体需求调整预期版本 - EXPECTED_VERSION="21.3.5" - LOG_INFO "步骤5:检查版本信息是否符合预期(预期版本:$EXPECTED_VERSION)" - if [ "$MESA_VERSION" = "$EXPECTED_VERSION" ]; then - LOG_INFO "版本信息符合预期:$MESA_VERSION" - else - LOG_ERROR "版本信息不符合预期,实际版本:$MESA_VERSION,预期版本:$EXPECTED_VERSION" - exit 1 - fi - - # 步骤6:清理环境(如果之前未安装,则卸载软件包) - if [ $KEEP_INSTALLED -eq 0 ]; then - LOG_INFO "步骤6:清理环境,卸载mesa-filesystem软件包" - dnf remove -y mesa-filesystem - CHECK_RESULT $? 0 0 "卸载mesa-filesystem软件包失败" - else - LOG_INFO "步骤6:保持mesa-filesystem软件包安装状态,无需清理" - fi - - LOG_INFO "测试完成" -} - -main "$@" \ No newline at end of file diff --git a/testcases/function_test/pkg_test/metrics/metrics-log4j2/test_metrics-log4j2_function_logging.sh b/testcases/function_test/pkg_test/metrics/metrics-log4j2/test_metrics-log4j2_function_logging.sh deleted file mode 100644 index 124790f6eb9..00000000000 --- a/testcases/function_test/pkg_test/metrics/metrics-log4j2/test_metrics-log4j2_function_logging.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-30 -# @License : Mulan PSL v2 -# @Desc : Test basic logging functionality of metrics-log4j2 -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - - # 检查是否已经安装metrics-log4j2 - LOG_INFO "检查是否已经安装metrics-log4j2" - rpm -q metrics-log4j2 > /dev/null 2>&1 - if [ $? -eq 0 ]; then - LOG_INFO "metrics-log4j2已安装,脚本结束时将保持安装状态" - INSTALLED=1 - else - LOG_INFO "metrics-log4j2未安装,将在测试完成后卸载" - INSTALLED=0 - fi - - # 检查yum源中是否存在metrics-log4j2软件包 - LOG_INFO "检查yum源中是否存在metrics-log4j2软件包" - dnf list available metrics-log4j2 > /dev/null 2>&1 - if [ $? -ne 0 ]; then - LOG_ERROR "yum源中未找到metrics-log4j2软件包" - exit 255 - fi - - # 安装metrics-log4j2软件包(如果未安装) - if [ $INSTALLED -eq 0 ]; then - LOG_INFO "开始安装metrics-log4j2软件包" - dnf install -y metrics-log4j2 > /dev/null 2>&1 - CHECK_RESULT $? 0 0 "安装metrics-log4j2失败" - fi - - # 测试basic logging functionality of metrics-log4j2 - LOG_INFO "测试basic logging functionality of metrics-log4j2" - java -jar /usr/share/metrics-log4j2/example.jar > /dev/null 2>&1 - CHECK_RESULT $? 0 0 "执行metrics-log4j2示例失败" - - # 清理环境(如果最初未安装) - if [ $INSTALLED -eq 0 ]; then - LOG_INFO "卸载metrics-log4j2软件包" - dnf remove -y metrics-log4j2 > /dev/null 2>&1 - CHECK_RESULT $? 0 0 "卸载metrics-log4j2失败" - fi - - LOG_INFO "测试完成,环境已恢复" - -} - -main "$@" \ No newline at end of file diff --git a/testcases/function_test/pkg_test/mythes/mythes-devel/test_mythes-devel_function_lookup.sh b/testcases/function_test/pkg_test/mythes/mythes-devel/test_mythes-devel_function_lookup.sh deleted file mode 100644 index f75ffb71d26..00000000000 --- a/testcases/function_test/pkg_test/mythes/mythes-devel/test_mythes-devel_function_lookup.sh +++ /dev/null @@ -1,74 +0,0 @@ -#!/usr/bin/bash - -# Copyright (c) 2024 ISCAS .ALL rights reserved. -# This program is licensed under Mulan PSL v2. -# You can use it according to the terms and conditions of the Mulan PSL v2. -# http://license.coscl.org.cn/MulanPSL2 -# THIS PROGRAM IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, -# EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, -# MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. -# See the Mulan PSL v2 for more details. - -# ############################################# -# @Author : honghua -# @Contact : honghua@iscas.ac.cn -# @Date : 2025-12-05 -# @License : Mulan PSL v2 -# @Desc : 测试mythes-devel软件包的词库查询功能 -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - - LOG_INFO "开始测试mythes-devel软件包的词库查询功能" - - # 检查环境是否已安装mythes-devel - LOG_INFO "检查mythes-devel是否已安装" - if dnf list installed mythes-devel &>/dev/null; then - LOG_INFO "mythes-devel已安装,测试完成后将保持安装状态" - installed=true - else - LOG_INFO "mythes-devel未安装,将在测试完成后卸载" - installed=false - fi - - # 检查yum源中是否有mythes-devel软件包 - LOG_INFO "检查yum源中是否存在mythes-devel软件包" - if ! dnf list available mythes-devel &>/dev/null; then - LOG_ERROR "yum源中未找到mythes-devel软件包" - exit 255 - fi - - # 若未安装,则安装mythes-devel - if [ "$installed" = false ]; then - LOG_INFO "正在安装mythes-devel软件包" - dnf install -y mythes-devel - CHECK_RESULT $? 0 0 "安装mythes-devel失败" - fi - - # 测试词库查询功能 - LOG_INFO "测试词库查询功能" - lookup_output=$(lookup -d /usr/share/mythes th_en_US_v2 "test") - CHECK_RESULT $? 0 0 "词库查询命令执行失败" - - # 检查参数是否存在或不支持 - LOG_INFO "检查不支持的参数" - lookup -invalid-arg &>/dev/null - if [ $? -ne 255 ]; then - LOG_ERROR "不支持的参数未正确处理" - exit 255 - fi - - # 清理环境 - if [ "$installed" = false ]; then - LOG_INFO "正在卸载mythes-devel软件包" - dnf remove -y mythes-devel - CHECK_RESULT $? 0 0 "卸载mythes-devel失败" - fi - - LOG_INFO "测试完成,环境已恢复" - -} - -main "$@" \ No newline at end of file diff --git a/testcases/function_test/pkg_test/mythes/mythes-devel/test_mythes-devel_headers.sh b/testcases/function_test/pkg_test/mythes/mythes-devel/test_mythes-devel_headers.sh deleted file mode 100644 index ce5380e464b..00000000000 --- a/testcases/function_test/pkg_test/mythes/mythes-devel/test_mythes-devel_headers.sh +++ /dev/null @@ -1,110 +0,0 @@ -#!/usr/bin/bash - -# Copyright (c) 2024 ISCAS .ALL rights reserved. -# This program is licensed under Mulan PSL v2. -# You can use it according to the terms and conditions of the Mulan PSL v2. -# http://license.coscl.org.cn/MulanPSL2 -# THIS PROGRAM IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, -# EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, -# 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-03 -# @License : Mulan PSL v2 -# @Desc : 测试mythes-devel开发头文件的存在性 -# ############################################ - -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 expected=$2 - local exit_code=$3 - local message=$4 - - if [ $actual -ne $expected ]; then - LOG_ERROR "$message" - exit $exit_code - fi - } - - # 定义SSH_CMD函数(虽然题目说不需要定义,但实际使用时需要定义,这里按需定义) - SSH_CMD() { - local command=$1 - local node_ip=$2 - local node_password=$3 - local node_user=$4 - # 这里假设使用sshpass进行密码登录,实际使用时可能需要调整 - sshpass -p "$node_password" ssh -o StrictHostKeyChecking=no "$node_user@$node_ip" "$command" - } - - # 测试脚本主体 - LOG_INFO "开始测试mythes-devel开发头文件的存在性" - - # 检查yum源中是否有mythes-devel软件包 - LOG_INFO "检查yum源中是否有mythes-devel软件包" - dnf list available mythes-devel &>/dev/null - if [ $? -ne 0 ]; then - LOG_ERROR "yum源中未找到mythes-devel软件包" - exit 255 - fi - - # 检查是否已安装mythes-devel - LOG_INFO "检查是否已安装mythes-devel" - if rpm -q mythes-devel &>/dev/null; then - LOG_INFO "mythes-devel已安装,测试结束后将保持安装状态" - already_installed=true - else - LOG_INFO "mythes-devel未安装,将在测试过程中安装" - already_installed=false - fi - - # 如果未安装,则安装mythes-devel - if [ "$already_installed" = false ]; then - LOG_INFO "安装mythes-devel软件包" - dnf install -y mythes-devel - CHECK_RESULT $? 0 0 "安装mythes-devel失败" - fi - - # 测试开发头文件的存在性 - LOG_INFO "测试mythes-devel开发头文件的存在性" - header_file="/usr/include/mythes.h" - if [ -f "$header_file" ]; then - LOG_INFO "开发头文件 $header_file 存在" - else - LOG_ERROR "开发头文件 $header_file 不存在" - # 如果未安装,则卸载软件包 - if [ "$already_installed" = false ]; then - LOG_INFO "卸载mythes-devel软件包" - dnf remove -y mythes-devel - fi - exit 1 - fi - - # 清理环境:如果测试前未安装,则卸载软件包 - if [ "$already_installed" = false ]; then - LOG_INFO "测试完成,卸载mythes-devel软件包" - dnf remove -y mythes-devel - CHECK_RESULT $? 0 0 "卸载mythes-devel失败" - else - LOG_INFO "测试完成,保持mythes-devel安装状态" - fi - - LOG_INFO "测试脚本执行完毕" -} - -main "$@" \ No newline at end of file diff --git a/testcases/function_test/pkg_test/mythes/mythes-devel/test_mythes-devel_pkgconfig.sh b/testcases/function_test/pkg_test/mythes/mythes-devel/test_mythes-devel_pkgconfig.sh deleted file mode 100644 index bc36bdc2596..00000000000 --- a/testcases/function_test/pkg_test/mythes/mythes-devel/test_mythes-devel_pkgconfig.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 : 2026-04-03 -# @License : Mulan PSL v2 -# @Desc : 测试mythes-devel的pkg-config支持 -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - LOG_INFO "开始测试mythes-devel的pkg-config支持" - - LOG_INFO "步骤1:检查mythes-devel软件包是否在yum源中" - dnf list available mythes-devel > /dev/null 2>&1 - if [ $? -ne 0 ]; then - LOG_ERROR "yum源中未找到mythes-devel软件包" - exit 255 - fi - - LOG_INFO "步骤2:检查当前环境是否已安装mythes-devel" - rpm -q mythes-devel > /dev/null 2>&1 - if [ $? -eq 0 ]; then - LOG_INFO "mythes-devel已安装,测试完成后将保持安装状态" - INSTALLED=1 - else - LOG_INFO "mythes-devel未安装,将在测试前安装" - INSTALLED=0 - fi - - if [ $INSTALLED -eq 0 ]; then - LOG_INFO "步骤3:安装mythes-devel软件包" - dnf install -y mythes-devel - CHECK_RESULT $? 0 0 "安装mythes-devel失败" - fi - - LOG_INFO "步骤4:检查pkg-config是否支持mythes-devel" - pkg-config --exists mythes - CHECK_RESULT $? 0 0 "pkg-config不支持mythes-devel" - - LOG_INFO "步骤5:获取mythes-devel的pkg-config信息" - pkg-config --cflags mythes > /dev/null 2>&1 - CHECK_RESULT $? 0 0 "获取mythes-devel的cflags失败" - pkg-config --libs mythes > /dev/null 2>&1 - CHECK_RESULT $? 0 0 "获取mythes-devel的libs失败" - - LOG_INFO "步骤6:清理环境" - if [ $INSTALLED -eq 0 ]; then - LOG_INFO "卸载mythes-devel软件包" - dnf remove -y mythes-devel - CHECK_RESULT $? 0 0 "卸载mythes-devel失败" - else - LOG_INFO "mythes-devel在测试前已安装,保持安装状态" - fi - - LOG_INFO "mythes-devel的pkg-config支持测试完成" -} - -main "$@" \ No newline at end of file diff --git a/testcases/function_test/pkg_test/mythes/mythes-devel/test_mythes-devel_synonyms.sh b/testcases/function_test/pkg_test/mythes/mythes-devel/test_mythes-devel_synonyms.sh deleted file mode 100644 index 46b26e09978..00000000000 --- a/testcases/function_test/pkg_test/mythes/mythes-devel/test_mythes-devel_synonyms.sh +++ /dev/null @@ -1,108 +0,0 @@ -#!/usr/bin/bash - -# Copyright (c) 2024 ISCAS .ALL rights reserved. -# This program is licensed under Mulan PSL v2. -# You can use it according to the terms and conditions of the Mulan PSL v2. -# http://license.coscl.org.cn/MulanPSL2 -# THIS PROGRAM IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, -# EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, -# MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. -# See the Mulan PSL v2 for more details. - -# ############################################# -# @Author : honghua -# @Contact : honghua@iscas.ac.cn -# @Date : 2026-04-03 -# @License : Mulan PSL v2 -# @Desc : 测试词库同义词查询功能 -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - set -e - - LOG_INFO "开始测试词库同义词查询功能" - - LOG_INFO "检查系统中是否已安装mythes-devel软件包" - if rpm -q mythes-devel > /dev/null 2>&1; then - LOG_INFO "检测到mythes-devel已安装,测试结束后将保持安装状态" - already_installed=true - else - LOG_INFO "未检测到mythes-devel安装" - already_installed=false - fi - - LOG_INFO "检查yum源中是否存在mythes-devel软件包" - if ! dnf list available mythes-devel > /dev/null 2>&1; then - LOG_ERROR "yum源中未找到mythes-devel软件包" - exit 255 - fi - - if [ "$already_installed" = false ]; then - LOG_INFO "开始安装mythes-devel软件包" - dnf install -y mythes-devel - CHECK_RESULT $? 0 0 "安装mythes-devel失败" - LOG_INFO "mythes-devel软件包安装成功" - fi - - LOG_INFO "验证mythes-devel提供的同义词查询命令是否存在" - command -v mythes > /dev/null 2>&1 - CHECK_RESULT $? 0 0 "未找到mythes命令" - - LOG_INFO "测试mythes命令的基本参数支持" - mythes --help > /dev/null 2>&1 - CHECK_RESULT $? 0 0 "mythes命令不支持--help参数" - - LOG_INFO "准备测试词库文件" - TEST_DICT="/usr/share/mythes/th_en_US_v2.idx" - if [ ! -f "$TEST_DICT" ]; then - LOG_ERROR "未找到默认测试词库文件: $TEST_DICT" - exit 1 - fi - - LOG_INFO "测试查询单词"hello"的同义词" - result=$(mythes "$TEST_DICT" hello 2>/dev/null | head -5) - if [ -n "$result" ]; then - LOG_INFO "查询到同义词: $result" - CHECK_RESULT 0 0 0 "成功查询到同义词" - else - LOG_ERROR "未查询到单词"hello"的同义词" - CHECK_RESULT 1 0 0 "同义词查询失败" - fi - - LOG_INFO "测试查询不存在的单词" - result=$(mythes "$TEST_DICT" nonexistentword 2>/dev/null) - if [ -z "$result" ]; then - LOG_INFO "对不存在的单词返回空结果,符合预期" - CHECK_RESULT 0 0 0 "对不存在单词处理正常" - else - LOG_ERROR "对不存在的单词返回非空结果" - CHECK_RESULT 1 0 0 "对不存在单词处理异常" - fi - - LOG_INFO "测试无效参数处理" - mythes --invalid-option 2>/dev/null - if [ $? -eq 255 ] || [ $? -eq 1 ]; then - LOG_INFO "无效参数被正确处理" - CHECK_RESULT 0 0 0 "参数校验功能正常" - else - LOG_ERROR "无效参数未被正确处理" - exit 255 - fi - - LOG_INFO "测试词库同义词查询功能完成" - - if [ "$already_installed" = false ]; then - LOG_INFO "清理测试环境,卸载mythes-devel软件包" - dnf remove -y mythes-devel - CHECK_RESULT $? 0 0 "卸载mythes-devel失败" - LOG_INFO "环境已恢复到测试前状态" - else - LOG_INFO "保持mythes-devel软件包安装状态" - fi - - LOG_INFO "词库同义词查询功能测试完成" -} - -main "$@" \ No newline at end of file diff --git a/testcases/function_test/pkg_test/mythes/mythes-devel/test_mythes-devel_uninstall.sh b/testcases/function_test/pkg_test/mythes/mythes-devel/test_mythes-devel_uninstall.sh deleted file mode 100644 index 87af7617adb..00000000000 --- a/testcases/function_test/pkg_test/mythes/mythes-devel/test_mythes-devel_uninstall.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-04-03 -# @License : Mulan PSL v2 -# @Desc : 测试mythes-devel软件包的卸载功能 -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - # 检查是否已安装mythes-devel软件包 - LOG_INFO "检查mythes-devel软件包是否已安装" - rpm -q mythes-devel - if [ $? -eq 0 ]; then - LOG_INFO "mythes-devel软件包已安装,脚本结束后将保持安装状态" - INSTALLED_BEFORE=1 - else - LOG_INFO "mythes-devel软件包未安装,将在测试过程中安装" - INSTALLED_BEFORE=0 - fi - - # 检查yum源中是否有mythes-devel软件包 - LOG_INFO "检查yum源中是否有mythes-devel软件包" - dnf list available mythes-devel 2>/dev/null | grep -q "mythes-devel" - if [ $? -ne 0 ]; then - LOG_ERROR "yum源中未找到mythes-devel软件包" - exit 255 - fi - - # 如果未安装,则先安装软件包 - if [ $INSTALLED_BEFORE -eq 0 ]; then - LOG_INFO "安装mythes-devel软件包" - dnf install -y mythes-devel - CHECK_RESULT $? 0 0 "安装mythes-devel软件包失败" - fi - - # 验证软件包安装成功 - LOG_INFO "验证mythes-devel软件包安装成功" - rpm -q mythes-devel - CHECK_RESULT $? 0 0 "mythes-devel软件包未正确安装" - - # 测试卸载功能 - LOG_INFO "测试卸载mythes-devel软件包" - dnf remove -y mythes-devel - CHECK_RESULT $? 0 0 "卸载mythes-devel软件包失败" - - # 验证软件包已卸载 - LOG_INFO "验证mythes-devel软件包已卸载" - rpm -q mythes-devel - if [ $? -eq 0 ]; then - LOG_ERROR "mythes-devel软件包卸载后仍然存在" - exit 1 - else - LOG_INFO "mythes-devel软件包已成功卸载" - fi - - # 环境恢复:如果之前未安装,则保持未安装状态;如果之前已安装,则重新安装 - if [ $INSTALLED_BEFORE -eq 0 ]; then - LOG_INFO "测试完成,保持环境未安装mythes-devel状态" - else - LOG_INFO "恢复环境,重新安装mythes-devel软件包" - dnf install -y mythes-devel - CHECK_RESULT $? 0 0 "重新安装mythes-devel软件包失败" - LOG_INFO "环境已恢复,mythes-devel软件包已重新安装" - fi -} - -main "$@" \ No newline at end of file diff --git a/testcases/function_test/pkg_test/polyglot/tesla-polyglot-translate-plugin/test_tesla-polyglot-translate-plugin_function_init.sh b/testcases/function_test/pkg_test/polyglot/tesla-polyglot-translate-plugin/test_tesla-polyglot-translate-plugin_function_init.sh deleted file mode 100644 index b47c658d58b..00000000000 --- a/testcases/function_test/pkg_test/polyglot/tesla-polyglot-translate-plugin/test_tesla-polyglot-translate-plugin_function_init.sh +++ /dev/null @@ -1,70 +0,0 @@ -#!/usr/bin/bash - -# Copyright (c) 2024 ISCAS .ALL rights reserved. -# This program is licensed under Mulan PSL v2. -# You can use it according to the terms and conditions of the Mulan PSL v2. -# http://license.coscl.org.cn/MulanPSL2 -# THIS PROGRAM IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, -# EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, -# MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. -# See the Mulan PSL v2 for more details. - -# ############################################# -# @Author : honghua -# @Contact : honghua@iscas.ac.cn -# @Date : 2025-12-09 -# @License : Mulan PSL v2 -# @Desc : Test plugin initialization -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - - LOG_INFO "开始测试插件初始化功能" - - # 检查是否已安装软件包 - LOG_INFO "检查软件包是否已安装" - dnf list installed tesla-polyglot-translate-plugin &>/dev/null - if [ $? -eq 0 ]; then - LOG_INFO "软件包已安装,测试结束后将保持安装状态" - INSTALLED=1 - else - LOG_INFO "软件包未安装,将在测试结束后卸载" - INSTALLED=0 - fi - - # 检查yum源中是否有该软件包 - LOG_INFO "检查yum源中是否有tesla-polyglot-translate-plugin软件包" - dnf list available tesla-polyglot-translate-plugin &>/dev/null - CHECK_RESULT $? 0 255 "yum源中未找到tesla-polyglot-translate-plugin软件包" - - # 安装软件包 - if [ $INSTALLED -eq 0 ]; then - LOG_INFO "开始安装tesla-polyglot-translate-plugin软件包" - dnf install -y tesla-polyglot-translate-plugin &>/dev/null - CHECK_RESULT $? 0 0 "安装tesla-polyglot-translate-plugin软件包失败" - fi - - # 测试插件初始化命令参数支持情况 - LOG_INFO "测试插件初始化命令参数支持情况" - tesla-polyglot-translate-plugin --init &>/dev/null - CHECK_RESULT $? 0 255 "插件初始化命令参数不支持或不存在" - - # 执行插件初始化命令并检查结果 - LOG_INFO "执行插件初始化命令" - tesla-polyglot-translate-plugin init &>/dev/null - CHECK_RESULT $? 0 1 "插件初始化失败" - - # 清理环境:如果之前未安装则卸载软件包 - if [ $INSTALLED -eq 0 ]; then - LOG_INFO "卸载tesla-polyglot-translate-plugin软件包" - dnf remove -y tesla-polyglot-translate-plugin &>/dev/null - CHECK_RESULT $? 0 0 "卸载tesla-polyglot-translate-plugin软件包失败" - fi - - LOG_INFO "测试插件初始化功能完成" - -} - -main "$@" \ No newline at end of file diff --git a/testcases/function_test/pkg_test/python-dockerpty/python3-dockerpty/test_python3-dockerpty_function_init.sh b/testcases/function_test/pkg_test/python-dockerpty/python3-dockerpty/test_python3-dockerpty_function_init.sh deleted file mode 100644 index fb438cffec9..00000000000 --- a/testcases/function_test/pkg_test/python-dockerpty/python3-dockerpty/test_python3-dockerpty_function_init.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-10 -# @License : Mulan PSL v2 -# @Desc : Test initialization of dockerpty module -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - LOG_INFO "开始测试:Test initialization of dockerpty module" - - # 检查yum源中是否存在python3-dockerpty软件包 - LOG_INFO "检查yum源中是否存在python3-dockerpty软件包" - dnf list available python3-dockerpty &>/dev/null - if [ $? -ne 0 ]; then - LOG_ERROR "yum源中不存在python3-dockerpty软件包" - exit 255 - fi - - # 检查是否已安装python3-dockerpty - LOG_INFO "检查是否已安装python3-dockerpty" - rpm -q python3-dockerpty &>/dev/null - if [ $? -eq 0 ]; then - installed=true - LOG_INFO "python3-dockerpty已安装,脚本结束后保持安装状态" - else - installed=false - LOG_INFO "python3-dockerpty未安装,将在脚本结束前卸载" - fi - - # 安装python3-dockerpty(如果未安装) - if [ "$installed" = false ]; then - LOG_INFO "安装python3-dockerpty" - dnf install -y python3-dockerpty - CHECK_RESULT $? 0 0 "安装python3-dockerpty失败" - fi - - # 测试dockerpty模块初始化功能 - LOG_INFO "测试dockerpty模块初始化功能" - python3 -c "import dockerpty; dockerpty.init()" &>/dev/null - CHECK_RESULT $? 0 0 "dockerpty模块初始化失败" - - # 清理环境(如果最初未安装) - if [ "$installed" = false ]; then - LOG_INFO "卸载python3-dockerpty" - dnf remove -y python3-dockerpty - CHECK_RESULT $? 0 0 "卸载python3-dockerpty失败" - fi - - LOG_INFO "测试完成:Test initialization of dockerpty module" -} - -main "$@" \ No newline at end of file diff --git a/testcases/function_test/pkg_test/python-google-auth/python-google-auth-help/test_python-google-auth-help_function_auth.sh b/testcases/function_test/pkg_test/python-google-auth/python-google-auth-help/test_python-google-auth-help_function_auth.sh deleted file mode 100644 index 4ebc89eaddc..00000000000 --- a/testcases/function_test/pkg_test/python-google-auth/python-google-auth-help/test_python-google-auth-help_function_auth.sh +++ /dev/null @@ -1,70 +0,0 @@ -#!/usr/bin/bash - -# Copyright (c) 2024 ISCAS .ALL rights reserved. -# This program is licensed under Mulan PSL v2. -# You can use it according to the terms and conditions of the Mulan PSL v2. -# http://license.coscl.org.cn/MulanPSL2 -# THIS PROGRAM IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, -# EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, -# MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. -# See the Mulan PSL v2 for more details. - -# ############################################# -# @Author : honghua -# @Contact : honghua@iscas.ac.cn -# @Date : 2025-12-02 -# @License : Mulan PSL v2 -# @Desc : 测试python-google-auth-help软件包的认证功能 -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - - # 测试python-google-auth-help软件包的认证功能 - - LOG_INFO "开始测试python-google-auth-help软件包的认证功能" - - # 检查yum源中是否存在python-google-auth-help软件包 - LOG_INFO "检查yum源中是否存在python-google-auth-help软件包" - dnf list available python-google-auth-help > /dev/null 2>&1 - if [ $? -ne 0 ]; then - LOG_ERROR "yum源中不存在python-google-auth-help软件包" - exit 255 - fi - - # 检查是否已安装python-google-auth-help - LOG_INFO "检查是否已安装python-google-auth-help" - rpm -q python-google-auth-help > /dev/null 2>&1 - if [ $? -eq 0 ]; then - LOG_INFO "python-google-auth-help已安装,测试结束后保持安装状态" - installed=true - else - LOG_INFO "python-google-auth-help未安装,将在测试结束后卸载" - installed=false - fi - - # 安装python-google-auth-help(如果未安装) - if [ "$installed" = false ]; then - LOG_INFO "安装python-google-auth-help" - dnf install -y python-google-auth-help - CHECK_RESULT $? 0 0 "安装python-google-auth-help失败" - fi - - # 测试认证功能 - LOG_INFO "测试python-google-auth-help的认证功能" - python3 -c "from google.auth import help; help.auth()" > /dev/null 2>&1 - CHECK_RESULT $? 0 0 "python-google-auth-help认证功能测试失败" - - # 卸载python-google-auth-help(如果之前未安装) - if [ "$installed" = false ]; then - LOG_INFO "卸载python-google-auth-help" - dnf remove -y python-google-auth-help - CHECK_RESULT $? 0 0 "卸载python-google-auth-help失败" - fi - - LOG_INFO "测试完成,环境已恢复" - -} - -main "$@" \ No newline at end of file diff --git a/testcases/function_test/pkg_test/python-google-auth/python-google-auth-help/test_python-google-auth-help_function_credentials.sh b/testcases/function_test/pkg_test/python-google-auth/python-google-auth-help/test_python-google-auth-help_function_credentials.sh deleted file mode 100644 index 9fc6379cdcc..00000000000 --- a/testcases/function_test/pkg_test/python-google-auth/python-google-auth-help/test_python-google-auth-help_function_credentials.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-02-24 -# @License : Mulan PSL v2 -# @Desc : 测试默认凭据获取 -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - LOG_INFO "开始测试:测试默认凭据获取" - - # 检查是否已安装python3-google-auth-help-function-credentials - LOG_INFO "检查python3-google-auth-help-function-credentials是否已安装" - rpm -q python3-google-auth-help-function-credentials &>/dev/null - if [ $? -eq 0 ]; then - LOG_INFO "python3-google-auth-help-function-credentials已安装,测试后将保持安装状态" - INSTALLED=true - else - LOG_INFO "python3-google-auth-help-function-credentials未安装,将进行安装测试" - INSTALLED=false - fi - - # 检查yum源中是否存在该软件包 - LOG_INFO "检查yum源中是否存在python3-google-auth-help-function-credentials" - dnf list available python3-google-auth-help-function-credentials &>/dev/null - CHECK_RESULT $? 0 0 "yum源中未找到python3-google-auth-help-function-credentials软件包" - if [ $? -ne 0 ]; then - LOG_ERROR "yum源中未找到python3-google-auth-help-function-credentials软件包" - exit 255 - fi - - # 如果未安装,则安装软件包 - if [ "$INSTALLED" = false ]; then - LOG_INFO "安装python3-google-auth-help-function-credentials" - dnf install -y python3-google-auth-help-function-credentials - CHECK_RESULT $? 0 0 "安装python3-google-auth-help-function-credentials失败" - fi - - # 测试默认凭据获取功能 - LOG_INFO "测试默认凭据获取功能" - python3 -c "from google.auth import default; credentials, project = default(); print("默认凭据获取成功")" &>/dev/null - CHECK_RESULT $? 0 0 "默认凭据获取失败" - - # 如果测试前未安装,则卸载软件包 - if [ "$INSTALLED" = false ]; then - LOG_INFO "卸载python3-google-auth-help-function-credentials" - dnf remove -y python3-google-auth-help-function-credentials - CHECK_RESULT $? 0 0 "卸载python3-google-auth-help-function-credentials失败" - fi - - LOG_INFO "测试完成:测试默认凭据获取" -} - -main "$@" \ No newline at end of file diff --git a/testcases/function_test/pkg_test/python-google-auth/python-google-auth-help/test_python-google-auth-help_function_http.sh b/testcases/function_test/pkg_test/python-google-auth/python-google-auth-help/test_python-google-auth-help_function_http.sh deleted file mode 100644 index a165b182979..00000000000 --- a/testcases/function_test/pkg_test/python-google-auth/python-google-auth-help/test_python-google-auth-help_function_http.sh +++ /dev/null @@ -1,82 +0,0 @@ -#!/usr/bin/bash - -# Copyright (c) 2024 ISCAS .ALL rights reserved. -# This program is licensed under Mulan PSL v2. -# You can use it according to the terms and conditions of the Mulan PSL v2. -# http://license.coscl.org.cn/MulanPSL2 -# THIS PROGRAM IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, -# EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, -# MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. -# See the Mulan PSL v2 for more details. - -# ############################################# -# @Author : honghua -# @Contact : honghua@iscas.ac.cn -# @Date : 2025-12-02 -# @License : Mulan PSL v2 -# @Desc : 测试python-google-auth-help软件包的HTTP请求功能 -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - - # 检查python-google-auth-help软件包是否已安装 - LOG_INFO "检查python-google-auth-help软件包是否已安装" - if dnf list installed python-google-auth-help &>/dev/null; then - LOG_INFO "python-google-auth-help软件包已安装,测试结束后保持安装状态" - INSTALLED=true - else - LOG_INFO "python-google-auth-help软件包未安装,测试结束后将卸载" - INSTALLED=false - fi - - # 检查yum源中是否有python-google-auth-help软件包 - LOG_INFO "检查yum源中是否有python-google-auth-help软件包" - if ! dnf list available python-google-auth-help &>/dev/null; then - LOG_ERROR "yum源中未找到python-google-auth-help软件包" - exit 255 - fi - - # 如果未安装,则安装软件包 - if [ "$INSTALLED" = false ]; then - LOG_INFO "开始安装python-google-auth-help软件包" - dnf install -y python-google-auth-help - CHECK_RESULT $? 0 0 "安装python-google-auth-help软件包失败" - fi - - # 测试HTTP请求功能 - LOG_INFO "测试python-google-auth-help软件包的HTTP请求功能" - python3 -c " - import google.auth.transport.requests - import google.auth.exceptions - try: - request = google.auth.transport.requests.Request() - response = request.urlopen("http://example.com") - print("HTTP请求成功") - except google.auth.exceptions.TransportError as e: - print(f"HTTP请求失败: {e}") - " > /tmp/http_test_result.txt - - CHECK_RESULT $? 0 0 "执行HTTP请求测试失败" - - # 检查HTTP请求结果 - LOG_INFO "检查HTTP请求结果" - grep -q "HTTP请求成功" /tmp/http_test_result.txt - CHECK_RESULT $? 0 0 "HTTP请求未返回预期结果" - - # 清理临时文件 - rm -f /tmp/http_test_result.txt - - # 如果测试前未安装,则卸载软件包以恢复环境 - if [ "$INSTALLED" = false ]; then - LOG_INFO "卸载python-google-auth-help软件包以恢复环境" - dnf remove -y python-google-auth-help - CHECK_RESULT $? 0 0 "卸载python-google-auth-help软件包失败" - fi - - LOG_INFO "测试完成,环境已恢复" - -} - -main "$@" \ No newline at end of file diff --git a/testcases/function_test/pkg_test/python-google-auth/python-google-auth-help/test_python-google-auth-help_function_http_auth.sh b/testcases/function_test/pkg_test/python-google-auth/python-google-auth-help/test_python-google-auth-help_function_http_auth.sh deleted file mode 100644 index feda25296c4..00000000000 --- a/testcases/function_test/pkg_test/python-google-auth/python-google-auth-help/test_python-google-auth-help_function_http_auth.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-02-24 -# @License : Mulan PSL v2 -# @Desc : 测试HTTP请求授权 -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - # 环境检查:判断是否已安装python3-google-auth - LOG_INFO "检查python3-google-auth是否已安装" - rpm -q python3-google-auth > /dev/null 2>&1 - is_installed=$? - - # 定义软件包名称 - PACKAGE_NAME="python3-google-auth" - - # 检查yum源中是否存在该软件包 - LOG_INFO "检查yum源中是否存在软件包:$PACKAGE_NAME" - dnf list available $PACKAGE_NAME > /dev/null 2>&1 - if [ $? -ne 0 ]; then - LOG_ERROR "yum源中未找到软件包:$PACKAGE_NAME" - exit 255 - fi - - # 如果未安装,则进行安装 - if [ $is_installed -ne 0 ]; then - LOG_INFO "安装软件包:$PACKAGE_NAME" - dnf install -y $PACKAGE_NAME - CHECK_RESULT $? 0 0 "安装$PACKAGE_NAME失败" - fi - - # 测试HTTP请求授权功能 - LOG_INFO "测试HTTP请求授权功能" - python3 -c " - import google.auth.transport.requests - import google.oauth2.id_token - - # 模拟HTTP请求授权 - try: - request = google.auth.transport.requests.Request() - # 这里仅测试导入和基本对象创建,实际授权需要有效凭证 - LOG_INFO("google.auth模块导入成功,基本对象创建正常") - except Exception as e: - LOG_ERROR(f"HTTP请求授权测试失败: {e}") - raise - " - CHECK_RESULT $? 0 0 "HTTP请求授权测试失败" - - # 环境恢复:如果之前未安装,则卸载软件包 - if [ $is_installed -ne 0 ]; 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/python-google-auth/python-google-auth-help/test_python-google-auth-help_function_id_token.sh b/testcases/function_test/pkg_test/python-google-auth/python-google-auth-help/test_python-google-auth-help_function_id_token.sh deleted file mode 100644 index 1d65408dbfd..00000000000 --- a/testcases/function_test/pkg_test/python-google-auth/python-google-auth-help/test_python-google-auth-help_function_id_token.sh +++ /dev/null @@ -1,148 +0,0 @@ -#!/usr/bin/bash - -# Copyright (c) 2024 ISCAS .ALL rights reserved. -# This program is licensed under Mulan PSL v2. -# You can use it according to the terms and conditions of the Mulan PSL v2. -# http://license.coscl.org.cn/MulanPSL2 -# THIS PROGRAM IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, -# EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, -# 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-24 -# @License : Mulan PSL v2 -# @Desc : 测试ID令牌获取 -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - # 测试ID令牌获取 - - # 检查是否已安装python3-google-auth - LOG_INFO "检查是否已安装python3-google-auth" - rpm -q python3-google-auth >/dev/null 2>&1 - if [ $? -eq 0 ]; then - LOG_INFO "检测到python3-google-auth已安装,测试后保持安装状态" - already_installed=1 - else - LOG_INFO "检测到python3-google-auth未安装,将在测试后卸载" - already_installed=0 - fi - - # 检查yum源中是否有python3-google-auth包 - LOG_INFO "检查yum源中是否有python3-google-auth包" - dnf list available python3-google-auth >/dev/null 2>&1 - CHECK_RESULT $? 0 255 "yum源中未找到python3-google-auth包" - - # 安装python3-google-auth - if [ $already_installed -eq 0 ]; then - LOG_INFO "安装python3-google-auth" - dnf install -y python3-google-auth - CHECK_RESULT $? 0 0 "安装python3-google-auth失败" - fi - - # 检查google-auth库是否可用 - LOG_INFO "检查google-auth库是否可用" - python3 -c "import google.auth; print("google.auth导入成功")" 2>&1 - CHECK_RESULT $? 0 0 "google.auth库导入失败" - - # 测试获取ID令牌的帮助函数 - LOG_INFO "测试获取ID令牌的帮助函数" - python3 -c " - import google.auth - from google.auth.transport import requests - try: - # 尝试导入ID令牌相关模块 - from google.auth import id_token - from google.auth.transport.requests import Request - print("ID令牌模块导入成功") - - # 测试获取默认凭据 - credentials, project = google.auth.default() - print(f"默认凭据获取成功,项目ID: {project}") - - # 测试ID令牌获取函数(模拟场景) - # 注意:实际获取ID令牌需要有效的服务账号凭据 - print("ID令牌获取功能测试通过") - except Exception as e: - print(f"ID令牌测试失败: {e}") - exit(1) - " 2>&1 - CHECK_RESULT $? 0 0 "ID令牌获取功能测试失败" - - # 测试ID令牌获取命令参数 - LOG_INFO "测试ID令牌获取命令参数" - python3 -c " - import argparse - import sys - - # 模拟命令行参数解析 - parser = argparse.ArgumentParser(description="测试ID令牌获取") - parser.add_argument("--audience", help="目标受众") - parser.add_argument("--credentials", help="凭据文件路径") - - # 测试有效参数 - test_args = ["--audience", "https://example.com"] - try: - args = parser.parse_args(test_args) - print(f"参数解析成功: audience={args.audience}") - except SystemExit: - print("参数解析失败") - sys.exit(1) - " 2>&1 - CHECK_RESULT $? 0 0 "ID令牌命令参数测试失败" - - # 测试无效参数处理 - LOG_INFO "测试无效参数处理" - python3 -c " - import argparse - import sys - - parser = argparse.ArgumentParser(description="测试ID令牌获取") - parser.add_argument("--audience", help="目标受众") - - # 测试无效参数 - test_args = ["--invalid-param", "value"] - try: - args = parser.parse_args(test_args) - print("无效参数未正确处理") - sys.exit(1) - except SystemExit as e: - if e.code == 2: # argparse在遇到无效参数时退出码为2 - print("无效参数正确处理") - sys.exit(0) - else: - print(f"意外退出码: {e.code}") - sys.exit(1) - " 2>&1 - if [ $? -ne 0 ]; then - LOG_ERROR "无效参数处理测试失败" - exit 255 - fi - - # 清理环境:如果测试前未安装,则卸载软件包 - if [ $already_installed -eq 0 ]; then - LOG_INFO "清理测试环境,卸载python3-google-auth" - dnf remove -y python3-google-auth - CHECK_RESULT $? 0 0 "卸载python3-google-auth失败" - - # 验证卸载是否成功 - rpm -q python3-google-auth >/dev/null 2>&1 - if [ $? -eq 0 ]; then - LOG_ERROR "python3-google-auth卸载失败" - exit 1 - else - LOG_INFO "python3-google-auth已成功卸载" - fi - else - LOG_INFO "保持python3-google-auth安装状态" - fi - - LOG_INFO "ID令牌获取功能测试完成" -} - -main "$@" \ No newline at end of file diff --git a/testcases/function_test/pkg_test/python-google-auth/python-google-auth-help/test_python-google-auth-help_function_refresh.sh b/testcases/function_test/pkg_test/python-google-auth/python-google-auth-help/test_python-google-auth-help_function_refresh.sh deleted file mode 100644 index 98d731b5474..00000000000 --- a/testcases/function_test/pkg_test/python-google-auth/python-google-auth-help/test_python-google-auth-help_function_refresh.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-24 -# @License : Mulan PSL v2 -# @Desc : 测试访问令牌刷新 -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - LOG_INFO "开始测试:访问令牌刷新" - - # 检查yum源中是否存在python3-google-auth包 - LOG_INFO "检查yum源中是否存在python3-google-auth软件包" - dnf list available python3-google-auth 2>/dev/null | grep -q python3-google-auth - CHECK_RESULT $? 0 0 "yum源中未找到python3-google-auth软件包" - - # 检查当前环境是否已安装python3-google-auth - LOG_INFO "检查当前环境是否已安装python3-google-auth" - rpm -q python3-google-auth > /dev/null 2>&1 - installed=$? - - if [ $installed -ne 0 ]; then - LOG_INFO "环境未安装python3-google-auth,开始安装" - dnf install -y python3-google-auth - CHECK_RESULT $? 0 0 "安装python3-google-auth失败" - need_cleanup=1 - else - LOG_INFO "环境已安装python3-google-auth" - need_cleanup=0 - fi - - # 测试访问令牌刷新功能 - LOG_INFO "测试访问令牌刷新功能" - python3 -c " - from google.auth.transport.requests import Request - from google.oauth2.credentials import Credentials - import json - - # 创建模拟的凭据数据 - token_data = { - "token": "dummy_token", - "refresh_token": "dummy_refresh_token", - "token_uri": "https://oauth2.googleapis.com/token", - "client_id": "dummy_client_id", - "client_secret": "dummy_client_secret", - "scopes": ["https://www.googleapis.com/auth/cloud-platform"] - } - - # 创建凭据对象 - creds = Credentials.from_authorized_user_info(token_data) - - # 测试刷新方法 - try: - # 尝试刷新令牌(由于是模拟数据,预期会失败) - creds.refresh(Request()) - print("令牌刷新测试完成") - except Exception as e: - print(f"令牌刷新测试完成(预期失败):{type(e).__name__}") - " - CHECK_RESULT $? 0 0 "访问令牌刷新测试执行失败" - - # 清理环境 - if [ $need_cleanup -eq 1 ]; then - LOG_INFO "清理测试环境,卸载python3-google-auth" - dnf remove -y python3-google-auth - CHECK_RESULT $? 0 0 "卸载python3-google-auth失败" - fi - - LOG_INFO "测试完成:访问令牌刷新" -} - -main "$@" \ No newline at end of file diff --git a/testcases/function_test/pkg_test/python-google-auth/python-google-auth-help/test_python-google-auth-help_function_scoped_auth.sh b/testcases/function_test/pkg_test/python-google-auth/python-google-auth-help/test_python-google-auth-help_function_scoped_auth.sh deleted file mode 100644 index 34312ff7f9d..00000000000 --- a/testcases/function_test/pkg_test/python-google-auth/python-google-auth-help/test_python-google-auth-help_function_scoped_auth.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-24 -# @License : Mulan PSL v2 -# @Desc : 测试带作用域认证 -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - LOG_INFO "测试开始:测试带作用域认证" - - # 定义软件包名称 - PACKAGE_NAME="python3-google-auth" - - # 检查软件包是否已在系统中安装 - LOG_INFO "检查软件包是否已安装" - if dnf list installed "$PACKAGE_NAME" &>/dev/null; then - LOG_INFO "软件包已安装,脚本结束后将保持安装状态" - ALREADY_INSTALLED=true - else - LOG_INFO "软件包未安装,将在测试步骤中安装" - ALREADY_INSTALLED=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 [ "$ALREADY_INSTALLED" = false ]; then - LOG_INFO "安装软件包:$PACKAGE_NAME" - dnf install -y "$PACKAGE_NAME" - CHECK_RESULT $? 0 0 "安装软件包失败" - fi - - # 测试带作用域认证的命令 - LOG_INFO "测试带作用域认证的命令" - # 假设测试命令为google-auth-test,参数为--scope - TEST_COMMAND="google-auth-test" - SCOPE_PARAM="--scope" - LOG_INFO "执行命令:$TEST_COMMAND $SCOPE_PARAM" - - # 检查命令是否存在 - if ! command -v "$TEST_COMMAND" &>/dev/null; then - LOG_ERROR "命令 $TEST_COMMAND 不存在" - exit 255 - fi - - # 检查参数是否支持 - if ! "$TEST_COMMAND" --help 2>&1 | grep -q "$SCOPE_PARAM"; then - LOG_ERROR "命令 $TEST_COMMAND 不支持参数 $SCOPE_PARAM" - exit 255 - fi - - # 执行命令 - "$TEST_COMMAND" "$SCOPE_PARAM" - CHECK_RESULT $? 0 0 "带作用域认证命令执行失败" - - # 清理环境:如果脚本开始时未安装,则卸载软件包 - if [ "$ALREADY_INSTALLED" = false ]; then - LOG_INFO "卸载软件包:$PACKAGE_NAME" - dnf remove -y "$PACKAGE_NAME" - CHECK_RESULT $? 0 0 "卸载软件包失败" - fi - - LOG_INFO "测试结束:测试带作用域认证完成" -} - -main "$@" \ No newline at end of file diff --git a/testcases/function_test/pkg_test/python-google-auth/python-google-auth-help/test_python-google-auth-help_function_service_acct.sh b/testcases/function_test/pkg_test/python-google-auth/python-google-auth-help/test_python-google-auth-help_function_service_acct.sh deleted file mode 100644 index 6b23075fd4a..00000000000 --- a/testcases/function_test/pkg_test/python-google-auth/python-google-auth-help/test_python-google-auth-help_function_service_acct.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-24 -# @License : Mulan PSL v2 -# @Desc : 测试服务账号凭据 -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - # 测试脚本:测试服务账号凭据 - - # 定义软件包名称 - PACKAGE_NAME="python3-google-auth-help-function-service-acct" - - # 步骤1:检查软件包是否已在YUM源中 - LOG_INFO "步骤1:检查软件包是否在YUM源中" - dnf list available "$PACKAGE_NAME" &> /dev/null - if [ $? -ne 0 ]; then - LOG_ERROR "软件包 $PACKAGE_NAME 不在YUM源中" - exit 255 - fi - - # 步骤2:检查当前环境是否已安装软件包 - LOG_INFO "步骤2:检查当前环境是否已安装软件包" - INSTALLED=false - if rpm -q "$PACKAGE_NAME" &> /dev/null; then - LOG_INFO "软件包 $PACKAGE_NAME 已安装" - INSTALLED=true - else - LOG_INFO "软件包 $PACKAGE_NAME 未安装" - fi - - # 步骤3:如果未安装,则安装软件包 - if [ "$INSTALLED" = "false" ]; then - LOG_INFO "步骤3:安装软件包 $PACKAGE_NAME" - dnf install -y "$PACKAGE_NAME" - CHECK_RESULT $? 0 0 "安装软件包失败" - fi - - # 步骤4:验证软件包安装成功 - LOG_INFO "步骤4:验证软件包安装成功" - rpm -q "$PACKAGE_NAME" - CHECK_RESULT $? 0 0 "验证软件包安装失败" - - # 步骤5:测试服务账号凭据功能 - LOG_INFO "步骤5:测试服务账号凭据功能" - # 假设测试命令为 "google-auth-help-function-service-acct --test" - # 如果命令不存在或不支持参数,则退出 - if ! command -v google-auth-help-function-service-acct &> /dev/null; then - LOG_ERROR "命令 google-auth-help-function-service-acct 不存在" - exit 255 - fi - - # 测试命令执行 - google-auth-help-function-service-acct --test - CHECK_RESULT $? 0 0 "测试服务账号凭据功能失败" - - # 步骤6:测试命令参数验证 - LOG_INFO "步骤6:测试命令参数验证" - # 测试不支持参数的情况 - google-auth-help-function-service-acct --invalid-param 2>&1 | grep -q "unrecognized option" - CHECK_RESULT $? 0 0 "命令参数验证失败,应检测到无效参数" - - # 步骤7:清理环境 - LOG_INFO "步骤7:清理环境" - if [ "$INSTALLED" = "false" ]; then - LOG_INFO "卸载软件包 $PACKAGE_NAME" - dnf remove -y "$PACKAGE_NAME" - 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/python-google-auth/python-google-auth-help/test_python-google-auth-help_function_token.sh b/testcases/function_test/pkg_test/python-google-auth/python-google-auth-help/test_python-google-auth-help_function_token.sh deleted file mode 100644 index de056ca3136..00000000000 --- a/testcases/function_test/pkg_test/python-google-auth/python-google-auth-help/test_python-google-auth-help_function_token.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-02 -# @License : Mulan PSL v2 -# @Desc : 测试python-google-auth-help软件包的令牌功能 -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - - # 步骤1: 检查是否已安装python-google-auth-help软件包 - LOG_INFO "检查是否已安装python-google-auth-help软件包" - if dnf list installed python-google-auth-help &>/dev/null; then - LOG_INFO "python-google-auth-help已安装,脚本结束后将保持安装状态" - installed=true - else - LOG_INFO "python-google-auth-help未安装,将在脚本结束后卸载" - installed=false - fi - - # 步骤2: 检查yum源中是否有python-google-auth-help软件包 - LOG_INFO "检查yum源中是否有python-google-auth-help软件包" - if ! dnf list available python-google-auth-help &>/dev/null; then - LOG_ERROR "yum源中未找到python-google-auth-help软件包" - exit 255 - fi - - # 步骤3: 安装python-google-auth-help软件包(如果未安装) - if [ "$installed" = false ]; then - LOG_INFO "开始安装python-google-auth-help软件包" - dnf install -y python-google-auth-help - CHECK_RESULT $? 0 0 "安装python-google-auth-help失败" - fi - - # 步骤4: 测试令牌功能 - LOG_INFO "测试python-google-auth-help的令牌功能" - python3 -c "from google.auth import help; help.token()" &>/dev/null - CHECK_RESULT $? 0 0 "令牌功能测试失败" - - # 步骤5: 清理环境(如果最初未安装) - if [ "$installed" = false ]; then - LOG_INFO "卸载python-google-auth-help软件包" - dnf remove -y python-google-auth-help - CHECK_RESULT $? 0 0 "卸载python-google-auth-help失败" - fi - - LOG_INFO "测试脚本执行完毕,环境已恢复" - -} - -main "$@" \ No newline at end of file diff --git a/testcases/function_test/pkg_test/python-google-auth/python-google-auth-help/test_python-google-auth-help_function_uninstall.sh b/testcases/function_test/pkg_test/python-google-auth/python-google-auth-help/test_python-google-auth-help_function_uninstall.sh deleted file mode 100644 index 4d35fb81ce0..00000000000 --- a/testcases/function_test/pkg_test/python-google-auth/python-google-auth-help/test_python-google-auth-help_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-24 -# @License : Mulan PSL v2 -# @Desc : 测试软件包卸载 -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - # 测试python-google-auth-help_function的卸载功能 - - LOG_INFO "1. 检查测试环境是否已安装python-google-auth-help_function" - dnf list installed python-google-auth-help_function >/dev/null 2>&1 - is_installed=$? - - LOG_INFO "2. 检查yum源中是否有python-google-auth-help_function软件包" - dnf list available python-google-auth-help_function >/dev/null 2>&1 - if [ $? -ne 0 ]; then - LOG_ERROR "yum源中没有找到python-google-auth-help_function软件包" - exit 255 - fi - - # 记录初始状态,用于脚本结束时的环境恢复 - initial_installed=$is_installed - - if [ $is_installed -eq 0 ]; then - LOG_INFO "3. 环境已安装python-google-auth-help_function,跳过安装步骤" - test_package_name="python-google-auth-help_function" - else - LOG_INFO "3. 环境未安装python-google-auth-help_function,开始安装" - dnf install -y python-google-auth-help_function - CHECK_RESULT $? 0 0 "安装python-google-auth-help_function失败" - test_package_name="python-google-auth-help_function" - fi - - LOG_INFO "4. 验证python-google-auth-help_function已正确安装" - dnf list installed python-google-auth-help_function >/dev/null 2>&1 - CHECK_RESULT $? 0 0 "python-google-auth-help_function未正确安装" - - LOG_INFO "5. 执行软件包卸载测试" - LOG_INFO "5.1 尝试卸载python-google-auth-help_function" - dnf remove -y python-google-auth-help_function - CHECK_RESULT $? 0 0 "卸载python-google-auth-help_function失败" - - LOG_INFO "5.2 验证python-google-auth-help_function已被卸载" - dnf list installed python-google-auth-help_function >/dev/null 2>&1 - CHECK_RESULT $? 1 0 "python-google-auth-help_function卸载后仍存在" - - LOG_INFO "6. 环境恢复:根据初始状态决定是否重新安装" - if [ $initial_installed -eq 0 ]; then - LOG_INFO "6.1 初始环境已安装,重新安装python-google-auth-help_function" - dnf install -y python-google-auth-help_function - CHECK_RESULT $? 0 0 "重新安装python-google-auth-help_function失败" - - LOG_INFO "6.2 验证重新安装成功" - dnf list installed python-google-auth-help_function >/dev/null 2>&1 - CHECK_RESULT $? 0 0 "重新安装后python-google-auth-help_function不存在" - else - LOG_INFO "6.1 初始环境未安装,保持卸载状态,无需恢复" - fi - - LOG_INFO "7. 测试完成:python-google-auth-help_function卸载功能测试通过" -} - -main "$@" \ No newline at end of file diff --git a/testcases/function_test/pkg_test/python-google-auth/python-google-auth-help/test_python-google-auth-help_function_user_auth.sh b/testcases/function_test/pkg_test/python-google-auth/python-google-auth-help/test_python-google-auth-help_function_user_auth.sh deleted file mode 100644 index af1f252c559..00000000000 --- a/testcases/function_test/pkg_test/python-google-auth/python-google-auth-help/test_python-google-auth-help_function_user_auth.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-02-24 -# @License : Mulan PSL v2 -# @Desc : 测试用户交互认证 -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - # 定义软件包名称和命令 - PACKAGE_NAME="python3-google-auth" - COMMAND="google-auth" - PARAM="--help" - - # 检查软件包是否在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 - - # 检查环境是否已安装软件包 - 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 - - # 如果未安装,则安装软件包 - if [ "$INSTALLED" = false ]; then - LOG_INFO "安装软件包:$PACKAGE_NAME" - dnf install -y $PACKAGE_NAME - CHECK_RESULT $? 0 0 "安装软件包 $PACKAGE_NAME 失败" - fi - - # 检查命令是否存在 - LOG_INFO "检查命令是否存在:$COMMAND" - which $COMMAND > /dev/null 2>&1 - if [ $? -ne 0 ]; then - LOG_ERROR "命令 $COMMAND 不存在" - if [ "$INSTALLED" = false ]; then - LOG_INFO "卸载软件包:$PACKAGE_NAME" - dnf remove -y $PACKAGE_NAME - fi - exit 255 - fi - - # 检查参数是否支持 - LOG_INFO "检查命令 $COMMAND 是否支持参数 $PARAM" - $COMMAND $PARAM > /dev/null 2>&1 - if [ $? -eq 255 ]; then - LOG_ERROR "命令 $COMMAND 不支持参数 $PARAM" - if [ "$INSTALLED" = false ]; then - LOG_INFO "卸载软件包:$PACKAGE_NAME" - dnf remove -y $PACKAGE_NAME - fi - exit 255 - fi - - # 执行测试命令 - LOG_INFO "执行测试命令:$COMMAND $PARAM" - $COMMAND $PARAM - CHECK_RESULT $? 0 0 "执行命令 $COMMAND $PARAM 失败" - - # 清理环境 - LOG_INFO "清理测试环境" - if [ "$INSTALLED" = false ]; then - LOG_INFO "卸载软件包:$PACKAGE_NAME" - dnf remove -y $PACKAGE_NAME - CHECK_RESULT $? 0 0 "卸载软件包 $PACKAGE_NAME 失败" - else - LOG_INFO "保持软件包 $PACKAGE_NAME 的安装状态" - fi - - LOG_INFO "测试用户交互认证完成" -} - -main "$@" \ No newline at end of file diff --git a/testcases/function_test/pkg_test/python-pep517/python-pep517-help/test_python-pep517-help_function_build.sh b/testcases/function_test/pkg_test/python-pep517/python-pep517-help/test_python-pep517-help_function_build.sh deleted file mode 100644 index 2cf96b9988a..00000000000 --- a/testcases/function_test/pkg_test/python-pep517/python-pep517-help/test_python-pep517-help_function_build.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-11 -# @License : Mulan PSL v2 -# @Desc : Test build functionality -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - # 测试脚本:test_python-pep517-help_function_build - - LOG_INFO "开始测试:Test build functionality" - - # 检查是否已安装python-pep517 - if ! dnf list installed python-pep517 &>/dev/null; then - LOG_INFO "环境未安装python-pep517,将进行安装" - INSTALLED=false - else - LOG_INFO "环境已安装python-pep517,跳过安装步骤" - INSTALLED=true - fi - - # 检查yum源中是否存在python-pep517 - if ! dnf list available python-pep517 &>/dev/null; then - LOG_ERROR "yum源中未找到python-pep517软件包" - exit 255 - fi - - # 如果未安装,则安装软件包 - if [ "$INSTALLED" = false ]; then - LOG_INFO "正在安装python-pep517" - dnf install -y python-pep517 - CHECK_RESULT $? 0 0 "安装python-pep517失败" - fi - - # 测试build功能 - LOG_INFO "测试build功能" - python -m pep517.build --help &>/dev/null - CHECK_RESULT $? 0 0 "build功能测试失败" - - # 如果之前未安装,则在测试完成后卸载软件包 - if [ "$INSTALLED" = false ]; then - LOG_INFO "卸载python-pep517" - dnf remove -y python-pep517 - CHECK_RESULT $? 0 0 "卸载python-pep517失败" - fi - - LOG_INFO "测试完成:Test build functionality" -} - -main "$@" \ No newline at end of file diff --git a/testcases/function_test/pkg_test/python-pep517/python-pep517-help/test_python-pep517-help_function_import.sh b/testcases/function_test/pkg_test/python-pep517/python-pep517-help/test_python-pep517-help_function_import.sh deleted file mode 100644 index 4b7861a9968..00000000000 --- a/testcases/function_test/pkg_test/python-pep517/python-pep517-help/test_python-pep517-help_function_import.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-26 -# @License : Mulan PSL v2 -# @Desc : Test basic module import -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - set -e - - LOG_INFO "开始测试: Test basic module import" - - LOG_INFO "步骤1: 检查环境是否已安装python3-pep517-help-function-import软件包" - if dnf list installed python3-pep517-help-function-import &>/dev/null; then - LOG_INFO "软件包已安装,将在测试后保持安装状态" - INSTALLED_BEFORE=true - else - LOG_INFO "软件包未安装,将在测试后卸载" - INSTALLED_BEFORE=false - fi - - LOG_INFO "步骤2: 检查yum源中是否存在python3-pep517-help-function-import软件包" - if ! dnf list available python3-pep517-help-function-import &>/dev/null; then - LOG_ERROR "yum源中未找到python3-pep517-help-function-import软件包" - exit 255 - fi - - if [ "$INSTALLED_BEFORE" = false ]; then - LOG_INFO "步骤3: 安装python3-pep517-help-function-import软件包" - dnf install -y python3-pep517-help-function-import - CHECK_RESULT $? 0 0 "安装软件包失败" - fi - - LOG_INFO "步骤4: 验证软件包基本功能 - 检查模块是否可以导入" - python3 -c "import pep517; print("Module import successful")" - CHECK_RESULT $? 0 0 "导入pep517模块失败" - - LOG_INFO "步骤5: 验证软件包提供的命令行工具" - if ! command -v pep517 &>/dev/null; then - LOG_ERROR "未找到pep517命令" - CHECK_RESULT 1 0 0 "pep517命令不存在" - fi - - LOG_INFO "步骤6: 测试pep517命令的基本帮助功能" - pep517 --help - CHECK_RESULT $? 0 0 "pep517 --help命令执行失败" - - LOG_INFO "步骤7: 测试不支持的参数" - pep517 --invalid-parameter 2>/dev/null - if [ $? -ne 255 ]; then - LOG_ERROR "不支持的参数未返回正确的退出码" - exit 255 - fi - - LOG_INFO "步骤8: 清理测试环境" - if [ "$INSTALLED_BEFORE" = false ]; then - LOG_INFO "卸载测试安装的软件包" - dnf remove -y python3-pep517-help-function-import - CHECK_RESULT $? 0 0 "卸载软件包失败" - else - LOG_INFO "保持原有安装状态" - fi - - LOG_INFO "测试完成: Test basic module import" -} - -main "$@" \ No newline at end of file diff --git a/testcases/function_test/pkg_test/python-pep517/python-pep517-help/test_python-pep517-help_function_install.sh b/testcases/function_test/pkg_test/python-pep517/python-pep517-help/test_python-pep517-help_function_install.sh deleted file mode 100644 index ea13ec4123e..00000000000 --- a/testcases/function_test/pkg_test/python-pep517/python-pep517-help/test_python-pep517-help_function_install.sh +++ /dev/null @@ -1,68 +0,0 @@ -#!/usr/bin/bash - -# Copyright (c) 2024 ISCAS .ALL rights reserved. -# This program is licensed under Mulan PSL v2. -# You can use it according to the terms and conditions of the Mulan PSL v2. -# http://license.coscl.org.cn/MulanPSL2 -# THIS PROGRAM IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, -# EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, -# MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. -# See the Mulan PSL v2 for more details. - -# ############################################# -# @Author : honghua -# @Contact : honghua@iscas.ac.cn -# @Date : 2026-03-26 -# @License : Mulan PSL v2 -# @Desc : Test package installation -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - LOG_INFO "开始测试:Test package installation" - - # 检查是否已安装python3-pep517-help-function - LOG_INFO "检查python3-pep517-help-function是否已安装" - if rpm -q python3-pep517-help-function &>/dev/null; then - LOG_INFO "python3-pep517-help-function已安装,测试结束后将保持安装状态" - INSTALLED_BEFORE=true - else - LOG_INFO "python3-pep517-help-function未安装,将进行安装测试" - INSTALLED_BEFORE=false - fi - - # 检查yum源中是否有该软件包 - LOG_INFO "检查yum源中是否有python3-pep517-help-function软件包" - if ! dnf list available python3-pep517-help-function &>/dev/null; then - LOG_ERROR "yum源中未找到python3-pep517-help-function软件包" - exit 255 - fi - - # 安装软件包(如果未安装) - if [ "$INSTALLED_BEFORE" = false ]; then - LOG_INFO "开始安装python3-pep517-help-function" - dnf install -y python3-pep517-help-function - CHECK_RESULT $? 0 0 "安装python3-pep517-help-function失败" - LOG_INFO "python3-pep517-help-function安装成功" - fi - - # 验证软件包功能 - LOG_INFO "验证python3-pep517-help-function功能" - python3 -c "import pep517; print(pep517.__version__)" &>/dev/null - CHECK_RESULT $? 0 0 "python3-pep517-help-function功能验证失败" - - # 清理环境:如果之前未安装,则卸载软件包 - if [ "$INSTALLED_BEFORE" = false ]; then - LOG_INFO "清理环境:卸载python3-pep517-help-function" - dnf remove -y python3-pep517-help-function - CHECK_RESULT $? 0 0 "卸载python3-pep517-help-function失败" - LOG_INFO "环境清理完成" - else - LOG_INFO "测试前已安装,保持安装状态,无需清理" - fi - - LOG_INFO "测试完成:Test package installation" -} - -main "$@" \ No newline at end of file diff --git a/testcases/function_test/pkg_test/python-pep517/python-pep517-help/test_python-pep517-help_function_uninstall.sh b/testcases/function_test/pkg_test/python-pep517/python-pep517-help/test_python-pep517-help_function_uninstall.sh deleted file mode 100644 index 6fb25b2b6cd..00000000000 --- a/testcases/function_test/pkg_test/python-pep517/python-pep517-help/test_python-pep517-help_function_uninstall.sh +++ /dev/null @@ -1,65 +0,0 @@ -#!/usr/bin/bash - -# Copyright (c) 2024 ISCAS .ALL rights reserved. -# This program is licensed under Mulan PSL v2. -# You can use it according to the terms and conditions of the Mulan PSL v2. -# http://license.coscl.org.cn/MulanPSL2 -# THIS PROGRAM IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, -# EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, -# MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. -# See the Mulan PSL v2 for more details. - -# ############################################# -# @Author : honghua -# @Contact : honghua@iscas.ac.cn -# @Date : 2026-03-26 -# @License : Mulan PSL v2 -# @Desc : Test package uninstallation -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - LOG_INFO "测试包卸载功能" - LOG_INFO "步骤1: 检查环境是否已安装python-pep517-help-function" - if dnf list installed python-pep517-help-function &>/dev/null; then - LOG_INFO "python-pep517-help-function 已安装" - INSTALLED_BEFORE_TEST=true - else - LOG_INFO "python-pep517-help-function 未安装" - INSTALLED_BEFORE_TEST=false - fi - LOG_INFO "步骤2: 检查yum源中是否存在python-pep517-help-function" - if ! dnf list available python-pep517-help-function &>/dev/null; then - LOG_ERROR "yum源中未找到python-pep517-help-function软件包" - exit 255 - fi - LOG_INFO "步骤3: 测试卸载功能" - if [ "$INSTALLED_BEFORE_TEST" = false ]; then - LOG_INFO "执行安装操作作为测试步骤" - dnf install -y python-pep517-help-function - CHECK_RESULT $? 0 0 "安装python-pep517-help-function失败" - fi - LOG_INFO "执行卸载操作" - dnf remove -y python-pep517-help-function - CHECK_RESULT $? 0 0 "卸载python-pep517-help-function失败" - LOG_INFO "验证卸载是否成功" - if dnf list installed python-pep517-help-function &>/dev/null; then - LOG_ERROR "卸载后python-pep517-help-function仍然存在" - exit 1 - else - LOG_INFO "卸载验证成功" - fi - LOG_INFO "步骤4: 环境恢复" - if [ "$INSTALLED_BEFORE_TEST" = true ]; then - LOG_INFO "恢复原始安装状态" - dnf install -y python-pep517-help-function - CHECK_RESULT $? 0 0 "重新安装python-pep517-help-function失败" - LOG_INFO "环境已恢复到测试前状态" - else - LOG_INFO "原始状态为未安装,无需恢复" - fi - LOG_INFO "测试完成" -} - -main "$@" \ No newline at end of file diff --git a/testcases/function_test/pkg_test/python-pep517/python-pep517-help/test_python-pep517-help_function_usage.sh b/testcases/function_test/pkg_test/python-pep517/python-pep517-help/test_python-pep517-help_function_usage.sh deleted file mode 100644 index 05511d0407e..00000000000 --- a/testcases/function_test/pkg_test/python-pep517/python-pep517-help/test_python-pep517-help_function_usage.sh +++ /dev/null @@ -1,97 +0,0 @@ -#!/usr/bin/bash - -# Copyright (c) 2024 ISCAS .ALL rights reserved. -# This program is licensed under Mulan PSL v2. -# You can use it according to the terms and conditions of the Mulan PSL v2. -# http://license.coscl.org.cn/MulanPSL2 -# THIS PROGRAM IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, -# EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, -# MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. -# See the Mulan PSL v2 for more details. - -# ############################################# -# @Author : honghua -# @Contact : honghua@iscas.ac.cn -# @Date : 2026-03-26 -# @License : Mulan PSL v2 -# @Desc : Test common usage patterns -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - # 测试脚本:test_python-pep517-help_function_usage - # 测试用例:Test common usage patterns - - # 定义变量 - PACKAGE_NAME="python-pep517" - COMMAND="python -m pep517" - - # 步骤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 - INSTALLED=$? - if [ ${INSTALLED} -eq 0 ]; then - LOG_INFO "软件包 ${PACKAGE_NAME} 已安装,脚本结束时将保持安装状态" - NEED_CLEANUP=0 - else - LOG_INFO "软件包 ${PACKAGE_NAME} 未安装,将作为测试步骤安装" - NEED_CLEANUP=1 - fi - - # 步骤3:安装软件包(如果未安装) - if [ ${NEED_CLEANUP} -eq 1 ]; then - LOG_INFO "步骤3:安装软件包 ${PACKAGE_NAME}" - dnf install -y ${PACKAGE_NAME} &>/dev/null - CHECK_RESULT $? 0 0 "安装软件包 ${PACKAGE_NAME} 失败" - fi - - # 步骤4:测试命令基本帮助功能 - LOG_INFO "步骤4:测试 ${COMMAND} 基本帮助功能" - ${COMMAND} --help &>/dev/null - CHECK_RESULT $? 0 0 "执行 ${COMMAND} --help 失败" - - # 步骤5:测试不支持的参数 - LOG_INFO "步骤5:测试 ${COMMAND} 不支持参数的情况" - ${COMMAND} --invalid-parameter &>/dev/null - if [ $? -ne 255 ] && [ $? -ne 1 ]; then - LOG_ERROR "不支持参数检查失败" - exit 255 - fi - - # 步骤6:测试具体子命令帮助 - LOG_INFO "步骤6:测试 ${COMMAND} build --help 功能" - ${COMMAND} build --help &>/dev/null - CHECK_RESULT $? 0 0 "执行 ${COMMAND} build --help 失败" - - # 步骤7:测试在第二个服务器上执行命令(如果定义了相关变量) - if [ -n "${NODE2_IPV4}" ] && [ -n "${NODE2_PASSWORD}" ] && [ -n "${NODE2_USER}" ]; then - LOG_INFO "步骤7:在第二个服务器上测试 ${COMMAND} --help" - SSH_CMD "${COMMAND} --help" ${NODE2_IPV4} ${NODE2_PASSWORD} ${NODE2_USER} - CHECK_RESULT $? 0 0 "在第二个服务器上执行 ${COMMAND} --help 失败" - else - LOG_INFO "步骤7:跳过第二个服务器测试(未定义节点变量)" - fi - - # 步骤8:清理环境(如果测试过程中安装了软件包) - if [ ${NEED_CLEANUP} -eq 1 ]; then - LOG_INFO "步骤8:卸载测试安装的软件包 ${PACKAGE_NAME}" - dnf remove -y ${PACKAGE_NAME} &>/dev/null - CHECK_RESULT $? 0 0 "卸载软件包 ${PACKAGE_NAME} 失败" - LOG_INFO "环境已恢复到测试前状态" - else - LOG_INFO "步骤8:保持软件包 ${PACKAGE_NAME} 安装状态" - fi - - LOG_INFO "测试完成" -} - -main "$@" \ No newline at end of file diff --git a/testcases/function_test/pkg_test/python-pyrpm/python3-pyrpm/test_python3-pyrpm_function_check_deps.sh b/testcases/function_test/pkg_test/python-pyrpm/python3-pyrpm/test_python3-pyrpm_function_check_deps.sh deleted file mode 100644 index 3d6b47f5f62..00000000000 --- a/testcases/function_test/pkg_test/python-pyrpm/python3-pyrpm/test_python3-pyrpm_function_check_deps.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-26 -# @License : Mulan PSL v2 -# @Desc : Test checking RPM dependencies -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - LOG_INFO "开始测试:Test checking RPM dependencies" - - # 检查是否已安装python3-pyrpm包 - LOG_INFO "步骤1:检查python3-pyrpm是否已安装" - if rpm -q python3-pyrpm > /dev/null 2>&1; then - LOG_INFO "python3-pyrpm已安装,测试结束后将保持安装状态" - INSTALLED_BEFORE=true - else - LOG_INFO "python3-pyrpm未安装,测试结束后将卸载" - INSTALLED_BEFORE=false - fi - - # 检查yum源中是否有python3-pyrpm包 - LOG_INFO "步骤2:检查yum源中是否有python3-pyrpm包" - if ! dnf list available python3-pyrpm > /dev/null 2>&1; then - LOG_ERROR "yum源中未找到python3-pyrpm包" - exit 255 - fi - - # 如果未安装,则安装python3-pyrpm - if [ "$INSTALLED_BEFORE" = false ]; then - LOG_INFO "步骤3:安装python3-pyrpm包" - dnf install -y python3-pyrpm - CHECK_RESULT $? 0 0 "安装python3-pyrpm失败" - fi - - # 检查rpm命令的依赖检查功能 - LOG_INFO "步骤4:检查rpm命令的依赖检查功能" - # 假设我们要检查python3-pyrpm包的依赖 - if ! rpm -q --requires python3-pyrpm > /dev/null 2>&1; then - LOG_ERROR "rpm命令不支持--requires参数或包不存在" - exit 255 - fi - - # 执行依赖检查 - LOG_INFO "步骤5:执行依赖检查" - rpm -q --requires python3-pyrpm - CHECK_RESULT $? 0 0 "依赖检查失败" - - # 清理环境:如果测试前未安装,则卸载python3-pyrpm - if [ "$INSTALLED_BEFORE" = false ]; then - LOG_INFO "步骤6:清理环境,卸载python3-pyrpm" - dnf remove -y python3-pyrpm - CHECK_RESULT $? 0 0 "卸载python3-pyrpm失败" - fi - - LOG_INFO "测试完成:Test checking RPM dependencies" -} - -main "$@" \ No newline at end of file diff --git a/testcases/function_test/pkg_test/python-pyrpm/python3-pyrpm/test_python3-pyrpm_function_list_files.sh b/testcases/function_test/pkg_test/python-pyrpm/python3-pyrpm/test_python3-pyrpm_function_list_files.sh deleted file mode 100644 index 474dfdd108d..00000000000 --- a/testcases/function_test/pkg_test/python-pyrpm/python3-pyrpm/test_python3-pyrpm_function_list_files.sh +++ /dev/null @@ -1,85 +0,0 @@ -#!/usr/bin/bash - -# Copyright (c) 2024 ISCAS .ALL rights reserved. -# This program is licensed under Mulan PSL v2. -# You can use it according to the terms and conditions of the Mulan PSL v2. -# http://license.coscl.org.cn/MulanPSL2 -# THIS PROGRAM IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, -# EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, -# MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. -# See the Mulan PSL v2 for more details. - -# ############################################# -# @Author : honghua -# @Contact : honghua@iscas.ac.cn -# @Date : 2026-03-26 -# @License : Mulan PSL v2 -# @Desc : Test listing files in RPM -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - # 定义软件包名称和命令 - PACKAGE_NAME="python3-pyrpm" - COMMAND="pyrpm" - SUBCOMMAND="-l" - - # 步骤1: 检查yum源中是否存在指定的软件包 - LOG_INFO "检查yum源中是否存在软件包 $PACKAGE_NAME" - dnf list available "$PACKAGE_NAME" &> /dev/null - if [ $? -ne 0 ]; then - LOG_ERROR "yum源中未找到软件包 $PACKAGE_name" - exit 255 - fi - - # 步骤2: 检查环境中是否已安装软件包 - LOG_INFO "检查环境中是否已安装软件包 $PACKAGE_NAME" - if rpm -q "$PACKAGE_NAME" &> /dev/null; then - LOG_INFO "软件包 $PACKAGE_NAME 已安装,标记为已存在" - PACKAGE_PRE_INSTALLED=true - else - LOG_INFO "软件包 $PACKAGE_NAME 未安装,标记为未存在" - PACKAGE_PRE_INSTALLED=false - fi - - # 步骤3: 如果未安装,则安装软件包 - if [ "$PACKAGE_PRE_INSTALLED" = false ]; then - LOG_INFO "开始安装软件包 $PACKAGE_NAME" - dnf install -y "$PACKAGE_NAME" - CHECK_RESULT $? 0 0 "安装软件包 $PACKAGE_NAME 失败" - fi - - # 步骤4: 检查命令是否支持指定的参数 - LOG_INFO "检查命令 $COMMAND 是否支持参数 $SUBCOMMAND" - $COMMAND --help 2>&1 | grep -q "$SUBCOMMAND" - if [ $? -ne 0 ]; then - LOG_ERROR "命令 $COMMAND 不支持参数 $SUBCOMMAND" - exit 255 - fi - - # 步骤5: 执行测试命令,列出RPM包中的文件 - LOG_INFO "执行测试命令: $COMMAND $SUBCOMMAND " - # 使用一个示例RPM包进行测试,例如使用当前已安装的RPM包 - EXAMPLE_RPM=$(rpm -q "$PACKAGE_NAME") - if [ -z "$EXAMPLE_RPM" ]; then - LOG_ERROR "未找到示例RPM包" - exit 1 - fi - - $COMMAND $SUBCOMMAND "$EXAMPLE_RPM" - CHECK_RESULT $? 0 0 "执行命令 $COMMAND $SUBCOMMAND 失败" - - # 步骤6: 清理环境,恢复到之前的状态 - if [ "$PACKAGE_PRE_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/python-pyrpm/python3-pyrpm/test_python3-pyrpm_function_read_header.sh b/testcases/function_test/pkg_test/python-pyrpm/python3-pyrpm/test_python3-pyrpm_function_read_header.sh deleted file mode 100644 index 178d7f62850..00000000000 --- a/testcases/function_test/pkg_test/python-pyrpm/python3-pyrpm/test_python3-pyrpm_function_read_header.sh +++ /dev/null @@ -1,83 +0,0 @@ -#!/usr/bin/bash - -# Copyright (c) 2024 ISCAS .ALL rights reserved. -# This program is licensed under Mulan PSL v2. -# You can use it according to the terms and conditions of the Mulan PSL v2. -# http://license.coscl.org.cn/MulanPSL2 -# THIS PROGRAM IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, -# EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, -# MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. -# See the Mulan PSL v2 for more details. - -# ############################################# -# @Author : honghua -# @Contact : honghua@iscas.ac.cn -# @Date : 2026-03-26 -# @License : Mulan PSL v2 -# @Desc : Test reading RPM header info -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - LOG_INFO "开始测试:Test reading RPM header info" - - LOG_INFO "检查是否已安装 python3-pyrpm" - if rpm -q python3-pyrpm &>/dev/null; then - LOG_INFO "python3-pyrpm 已安装,测试完成后保持安装状态" - INSTALLED=1 - else - LOG_INFO "python3-pyrpm 未安装,将在测试中安装" - INSTALLED=0 - fi - - LOG_INFO "检查 yum 源中是否有 python3-pyrpm 软件包" - if ! dnf list available python3-pyrpm &>/dev/null; then - LOG_ERROR "yum 源中未找到 python3-pyrpm 软件包" - exit 255 - fi - - if [ $INSTALLED -eq 0 ]; then - LOG_INFO "安装 python3-pyrpm" - dnf install -y python3-pyrpm - CHECK_RESULT $? 0 0 "安装 python3-pyrpm 失败" - fi - - LOG_INFO "测试读取 RPM 头信息功能" - python3 -c "import pyrpm; print(pyrpm.__version__)" &>/dev/null - CHECK_RESULT $? 0 0 "python3-pyrpm 基本功能测试失败" - - LOG_INFO "测试读取指定 RPM 文件的头信息" - TEST_RPM="/usr/lib/rpm/rpm-oem-macros" - if [ -f "$TEST_RPM" ]; then - python3 -c " - import pyrpm - rpm = pyrpm.RPM("$TEST_RPM") - print(rpm.header["name"]) - " &>/dev/null - CHECK_RESULT $? 0 0 "读取 RPM 头信息失败" - else - LOG_INFO "未找到测试 RPM 文件,跳过具体头信息读取测试" - fi - - LOG_INFO "测试不支持的参数情况" - python3 -c "import pyrpm; rpm = pyrpm.RPM()" &>/dev/null - if [ $? -eq 255 ]; then - LOG_INFO "不支持的参数正确处理" - else - LOG_ERROR "不支持的参数未正确处理" - exit 255 - fi - - if [ $INSTALLED -eq 0 ]; then - LOG_INFO "清理环境:卸载 python3-pyrpm" - dnf remove -y python3-pyrpm - CHECK_RESULT $? 0 0 "卸载 python3-pyrpm 失败" - else - LOG_INFO "测试完成,保持 python3-pyrpm 安装状态" - fi - - LOG_INFO "测试完成:Test reading RPM header info" -} - -main "$@" \ No newline at end of file diff --git a/testcases/function_test/pkg_test/python-smmap/python-smmap-help/test_python-smmap-help_function_import_module.sh b/testcases/function_test/pkg_test/python-smmap/python-smmap-help/test_python-smmap-help_function_import_module.sh deleted file mode 100644 index 5cb360a704f..00000000000 --- a/testcases/function_test/pkg_test/python-smmap/python-smmap-help/test_python-smmap-help_function_import_module.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-04 -# @License : Mulan PSL v2 -# @Desc : 测试python-smmap-help模块的导入功能,验证是否能成功导入并检查其关键属性。 -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - # 定义颜色变量(可选,便于日志阅读) - RED="\033[0;31m" - GREEN="\033[0;32m" - YELLOW="\033[1;33m" - NC="\033[0m" # No Color - - # 定义软件包名称和模块名称 - PACKAGE_NAME="python3-smmap" - MODULE_NAME="smmap" - PYTHON_CMD="python3" - - # 步骤1:检查yum源中是否存在指定的软件包 - LOG_INFO "步骤1:检查yum源中是否存在软件包 ${PACKAGE_NAME}" - dnf list available ${PACKAGE_NAME} &> /dev/null - if [ $? -ne 0 ]; then - LOG_ERROR "yum源中未找到软件包 ${PACKAGE_NAME}" - exit 255 - fi - LOG_INFO "软件包 ${PACKAGE_NAME} 在yum源中存在" - - # 步骤2:检查当前环境是否已安装指定软件包 - LOG_INFO "步骤2:检查当前环境是否已安装软件包 ${PACKAGE_NAME}" - rpm -q ${PACKAGE_NAME} &> /dev/null - if [ $? -eq 0 ]; then - LOG_INFO "软件包 ${PACKAGE_NAME} 已安装,标记为已安装状态" - INSTALLED="true" - else - LOG_INFO "软件包 ${PACKAGE_NAME} 未安装,标记为未安装状态" - INSTALLED="false" - fi - - # 步骤3:如果未安装,则安装软件包 - if [ "${INSTALLED}" == "false" ]; then - LOG_INFO "步骤3:安装软件包 ${PACKAGE_NAME}" - dnf install -y ${PACKAGE_NAME} - CHECK_RESULT $? 0 0 "安装软件包 ${PACKAGE_NAME} 失败" - LOG_INFO "软件包 ${PACKAGE_NAME} 安装成功" - fi - - # 步骤4:验证python-smmap-help模块的导入功能 - LOG_INFO "步骤4:验证python-smmap-help模块的导入功能" - ${PYTHON_CMD} -c "import ${MODULE_NAME}; print(dir(${MODULE_NAME}))" &> /dev/null - CHECK_RESULT $? 0 0 "导入模块 ${MODULE_NAME} 失败" - LOG_INFO "模块 ${MODULE_NAME} 导入成功" - - # 步骤5:检查模块的关键属性 - LOG_INFO "步骤5:检查模块 ${MODULE_NAME} 的关键属性" - ${PYTHON_CMD} -c " - import ${MODULE_NAME} - attrs = dir(${MODULE_NAME}) - expected_attrs = ["SizedStringIO", "StaticWindowMap", "WindowCursor"] - for attr in expected_attrs: - if attr not in attrs: - print("属性 {} 不存在".format(attr)) - exit(1) - print("所有关键属性都存在") - " - CHECK_RESULT $? 0 0 "模块 ${MODULE_NAME} 的关键属性检查失败" - LOG_INFO "模块 ${MODULE_NAME} 的关键属性检查成功" - - # 步骤6:环境恢复 - LOG_INFO "步骤6:环境恢复" - if [ "${INSTALLED}" == "false" ]; then - LOG_INFO "卸载测试安装的软件包 ${PACKAGE_NAME}" - dnf remove -y ${PACKAGE_NAME} - CHECK_RESULT $? 0 0 "卸载软件包 ${PACKAGE_NAME} 失败" - LOG_INFO "软件包 ${PACKAGE_NAME} 卸载成功,环境已恢复" - else - LOG_INFO "软件包 ${PACKAGE_NAME} 为原有安装,保持安装状态" - fi - - LOG_INFO "测试脚本执行完毕" -} - -main "$@" \ No newline at end of file diff --git a/testcases/function_test/pkg_test/python-smmap/python-smmap-help/test_python-smmap-help_function_uninstall.sh b/testcases/function_test/pkg_test/python-smmap/python-smmap-help/test_python-smmap-help_function_uninstall.sh deleted file mode 100644 index fe047904437..00000000000 --- a/testcases/function_test/pkg_test/python-smmap/python-smmap-help/test_python-smmap-help_function_uninstall.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-04 -# @License : Mulan PSL v2 -# @Desc : 测试python-smmap-help软件包的卸载功能,验证卸载是否成功。 -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - set -e - - LOG_INFO "开始测试python-smmap-help软件包的卸载功能" - - # 检查软件包是否在yum源中 - LOG_INFO "检查python-smmap-help软件包是否在yum源中" - dnf list available python-smmap-help > /dev/null 2>&1 - if [ $? -ne 0 ]; then - LOG_ERROR "yum源中未找到python-smmap-help软件包" - exit 255 - fi - - # 检查软件包是否已经安装 - LOG_INFO "检查python-smmap-help软件包是否已经安装" - rpm -q python-smmap-help > /dev/null 2>&1 - if [ $? -eq 0 ]; then - LOG_INFO "python-smmap-help软件包已经安装,测试结束后将保持安装状态" - INSTALLED_BEFORE=true - else - LOG_INFO "python-smmap-help软件包未安装,将进行安装作为测试步骤" - INSTALLED_BEFORE=false - fi - - # 如果未安装,则安装软件包 - if [ "$INSTALLED_BEFORE" = false ]; then - LOG_INFO "安装python-smmap-help软件包" - dnf install -y python-smmap-help - CHECK_RESULT $? 0 0 "安装python-smmap-help软件包失败" - fi - - # 验证软件包安装成功 - LOG_INFO "验证python-smmap-help软件包安装成功" - rpm -q python-smmap-help - CHECK_RESULT $? 0 0 "python-smmap-help软件包未正确安装" - - # 执行卸载测试 - LOG_INFO "执行python-smmap-help软件包卸载" - dnf remove -y python-smmap-help - CHECK_RESULT $? 0 0 "卸载python-smmap-help软件包失败" - - # 验证软件包已卸载 - LOG_INFO "验证python-smmap-help软件包已卸载" - rpm -q python-smmap-help > /dev/null 2>&1 - if [ $? -eq 0 ]; then - LOG_ERROR "python-smmap-help软件包卸载失败" - exit 1 - else - LOG_INFO "python-smmap-help软件包卸载成功" - fi - - # 环境恢复 - LOG_INFO "开始环境恢复" - if [ "$INSTALLED_BEFORE" = true ]; then - LOG_INFO "恢复python-smmap-help软件包安装状态" - dnf install -y python-smmap-help - CHECK_RESULT $? 0 0 "恢复python-smmap-help软件包安装状态失败" - else - LOG_INFO "无需恢复,原始状态为未安装" - fi - - LOG_INFO "测试完成,环境已恢复" -} - -main "$@" \ No newline at end of file diff --git a/testcases/function_test/pkg_test/rpm/python3-rpm/test_python3-rpm_function_check_install.sh b/testcases/function_test/pkg_test/rpm/python3-rpm/test_python3-rpm_function_check_install.sh deleted file mode 100644 index 059ae8a1169..00000000000 --- a/testcases/function_test/pkg_test/rpm/python3-rpm/test_python3-rpm_function_check_install.sh +++ /dev/null @@ -1,74 +0,0 @@ -#!/usr/bin/bash - -# Copyright (c) 2024 ISCAS .ALL rights reserved. -# This program is licensed under Mulan PSL v2. -# You can use it according to the terms and conditions of the Mulan PSL v2. -# http://license.coscl.org.cn/MulanPSL2 -# THIS PROGRAM IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, -# EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, -# MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. -# See the Mulan PSL v2 for more details. - -# ############################################# -# @Author : honghua -# @Contact : honghua@iscas.ac.cn -# @Date : 2026-03-15 -# @License : Mulan PSL v2 -# @Desc : 测试验证python3-rpm软件包是否已正确安装。 -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - LOG_INFO "开始测试验证python3-rpm软件包是否已正确安装。" - - # 检查yum源中是否存在python3-rpm软件包 - LOG_INFO "检查yum源中是否存在python3-rpm软件包。" - dnf list available python3-rpm > /dev/null 2>&1 - if [ $? -ne 0 ]; then - LOG_ERROR "yum源中未找到python3-rpm软件包。" - exit 255 - fi - - # 检查是否已安装python3-rpm - LOG_INFO "检查当前环境是否已安装python3-rpm软件包。" - rpm -q python3-rpm > /dev/null 2>&1 - if [ $? -eq 0 ]; then - LOG_INFO "python3-rpm软件包已安装,标记为已安装状态。" - INSTALLED=true - else - LOG_INFO "python3-rpm软件包未安装,标记为未安装状态。" - INSTALLED=false - fi - - # 如果未安装,则安装python3-rpm - if [ "$INSTALLED" = false ]; then - LOG_INFO "开始安装python3-rpm软件包。" - dnf install -y python3-rpm - CHECK_RESULT $? 0 0 "安装python3-rpm软件包失败。" - fi - - # 验证python3-rpm软件包是否正确安装 - LOG_INFO "验证python3-rpm软件包是否正确安装。" - rpm -q python3-rpm > /dev/null 2>&1 - CHECK_RESULT $? 0 0 "python3-rpm软件包未正确安装。" - - # 测试python3-rpm的基本功能 - LOG_INFO "测试python3-rpm的基本功能,检查是否支持--version参数。" - python3 -c "import rpm; print(rpm.__version__)" > /dev/null 2>&1 - CHECK_RESULT $? 0 0 "python3-rpm模块无法正常导入。" - - # 如果测试前未安装,则在测试后卸载python3-rpm - if [ "$INSTALLED" = false ]; then - LOG_INFO "测试完成,开始卸载python3-rpm软件包。" - dnf remove -y python3-rpm - CHECK_RESULT $? 0 0 "卸载python3-rpm软件包失败。" - LOG_INFO "已卸载python3-rpm软件包,环境已恢复。" - else - LOG_INFO "测试完成,保持python3-rpm软件包安装状态。" - fi - - LOG_INFO "测试验证python3-rpm软件包是否已正确安装完成。" -} - -main "$@" \ No newline at end of file diff --git a/testcases/function_test/pkg_test/rpm/python3-rpm/test_python3-rpm_function_import_module.sh b/testcases/function_test/pkg_test/rpm/python3-rpm/test_python3-rpm_function_import_module.sh deleted file mode 100644 index d4513b24a1e..00000000000 --- a/testcases/function_test/pkg_test/rpm/python3-rpm/test_python3-rpm_function_import_module.sh +++ /dev/null @@ -1,77 +0,0 @@ -#!/usr/bin/bash - -# Copyright (c) 2024 ISCAS .ALL rights reserved. -# This program is licensed under Mulan PSL v2. -# You can use it according to the terms and conditions of the Mulan PSL v2. -# http://license.coscl.org.cn/MulanPSL2 -# THIS PROGRAM IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, -# EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, -# MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. -# See the Mulan PSL v2 for more details. - -# ############################################# -# @Author : honghua -# @Contact : honghua@iscas.ac.cn -# @Date : 2026-03-15 -# @License : Mulan PSL v2 -# @Desc : 测试能否成功导入python3-rpm模块。 -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - # 测试脚本:测试能否成功导入python3-rpm模块 - - LOG_INFO "步骤1:检查python3-rpm软件包是否在yum源中" - dnf list available python3-rpm 2>/dev/null | grep -q python3-rpm - if [ $? -ne 0 ]; then - LOG_ERROR "python3-rpm软件包不在yum源中" - exit 255 - fi - LOG_INFO "python3-rpm软件包在yum源中" - - LOG_INFO "步骤2:检查当前是否已安装python3-rpm" - rpm -q python3-rpm >/dev/null 2>&1 - is_installed=$? - - if [ $is_installed -eq 0 ]; then - LOG_INFO "python3-rpm已安装,测试后将保持安装状态" - need_uninstall=0 - else - LOG_INFO "python3-rpm未安装,将进行安装测试" - need_uninstall=1 - - LOG_INFO "步骤3:安装python3-rpm软件包" - dnf install -y python3-rpm - CHECK_RESULT $? 0 0 "安装python3-rpm失败" - LOG_INFO "python3-rpm安装成功" - fi - - LOG_INFO "步骤4:测试导入python3-rpm模块" - python3 -c "import rpm" - CHECK_RESULT $? 0 0 "导入python3-rpm模块失败" - LOG_INFO "成功导入python3-rpm模块" - - LOG_INFO "步骤5:验证模块基本功能" - python3 -c " - import rpm - ts = rpm.TransactionSet() - print("RPM事务集创建成功") - " - CHECK_RESULT $? 0 0 "python3-rpm模块功能测试失败" - LOG_INFO "python3-rpm模块功能正常" - - LOG_INFO "步骤6:清理测试环境" - if [ $need_uninstall -eq 1 ]; then - LOG_INFO "卸载测试安装的python3-rpm软件包" - dnf remove -y python3-rpm - CHECK_RESULT $? 0 0 "卸载python3-rpm失败" - LOG_INFO "python3-rpm卸载成功,环境已恢复" - else - LOG_INFO "保持python3-rpm安装状态" - fi - - LOG_INFO "测试完成:python3-rpm模块导入和基本功能测试成功" -} - -main "$@" \ No newline at end of file diff --git a/testcases/function_test/pkg_test/rpm/python3-rpm/test_python3-rpm_function_query_package.sh b/testcases/function_test/pkg_test/rpm/python3-rpm/test_python3-rpm_function_query_package.sh deleted file mode 100644 index 16fe26f0dbc..00000000000 --- a/testcases/function_test/pkg_test/rpm/python3-rpm/test_python3-rpm_function_query_package.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 : 测试查询系统已安装的指定RPM包信息。 -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - LOG_INFO "测试查询系统已安装的指定RPM包信息" - LOG_INFO "步骤1:检查是否已安装python3-rpm包" - rpm -q python3-rpm > /dev/null 2>&1 - if [ $? -eq 0 ]; then - LOG_INFO "python3-rpm已安装,记录安装状态" - INSTALLED=1 - else - LOG_INFO "python3-rpm未安装,记录未安装状态" - INSTALLED=0 - fi - - LOG_INFO "步骤2:检查yum源中是否存在python3-rpm包" - dnf list available python3-rpm > /dev/null 2>&1 - if [ $? -ne 0 ]; then - LOG_ERROR "yum源中不存在python3-rpm包" - exit 255 - fi - - if [ $INSTALLED -eq 0 ]; then - LOG_INFO "步骤3:安装python3-rpm包" - dnf install -y python3-rpm - CHECK_RESULT $? 0 0 "安装python3-rpm包失败" - fi - - LOG_INFO "步骤4:测试查询python3-rpm包信息" - rpm -qi python3-rpm > /dev/null 2>&1 - CHECK_RESULT $? 0 0 "查询python3-rpm包信息失败" - - LOG_INFO "步骤5:测试使用query参数查询包信息" - rpm -q python3-rpm --queryformat="%{NAME}\n" | grep -q "^python3-rpm$" - CHECK_RESULT $? 0 0 "使用query参数查询包信息失败" - - LOG_INFO "步骤6:测试不支持的参数" - rpm -qi python3-rpm --invalid-param > /dev/null 2>&1 - if [ $? -ne 255 ] && [ $? -ne 1 ]; then - LOG_ERROR "不支持的参数未正确处理" - exit 255 - fi - - if [ $INSTALLED -eq 0 ]; then - LOG_INFO "步骤7:清理环境,卸载python3-rpm包" - dnf remove -y python3-rpm - CHECK_RESULT $? 0 0 "卸载python3-rpm包失败" - else - LOG_INFO "步骤7:保持环境,不卸载python3-rpm包" - fi - - LOG_INFO "测试完成" -} - -main "$@" \ No newline at end of file diff --git a/testcases/function_test/pkg_test/rpm/python3-rpm/test_python3-rpm_function_read_header.sh b/testcases/function_test/pkg_test/rpm/python3-rpm/test_python3-rpm_function_read_header.sh deleted file mode 100644 index 7523e28978a..00000000000 --- a/testcases/function_test/pkg_test/rpm/python3-rpm/test_python3-rpm_function_read_header.sh +++ /dev/null @@ -1,69 +0,0 @@ -#!/usr/bin/bash - -# Copyright (c) 2024 ISCAS .ALL rights reserved. -# This program is licensed under Mulan PSL v2. -# You can use it according to the terms and conditions of the Mulan PSL v2. -# http://license.coscl.org.cn/MulanPSL2 -# THIS PROGRAM IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, -# EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, -# MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. -# See the Mulan PSL v2 for more details. - -# ############################################# -# @Author : honghua -# @Contact : honghua@iscas.ac.cn -# @Date : 2026-03-15 -# @License : Mulan PSL v2 -# @Desc : 测试使用rpm模块读取已安装RPM包的头信息。 -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - # 检查是否已经安装python3-rpm包 - LOG_INFO "检查是否已经安装python3-rpm包" - rpm -q python3-rpm > /dev/null 2>&1 - if [ $? -eq 0 ]; then - already_installed=true - LOG_INFO "python3-rpm已经安装" - else - already_installed=false - LOG_INFO "python3-rpm未安装" - fi - - # 检查yum源中是否有python3-rpm包 - LOG_INFO "检查yum源中是否有python3-rpm包" - dnf list available python3-rpm > /dev/null 2>&1 - if [ $? -ne 0 ]; then - LOG_ERROR "yum源中没有python3-rpm包" - exit 255 - fi - - # 如果未安装,则安装python3-rpm包 - if [ "$already_installed" = false ]; then - LOG_INFO "开始安装python3-rpm包" - dnf install -y python3-rpm - CHECK_RESULT $? 0 0 "安装python3-rpm包失败" - fi - - # 测试使用rpm模块读取已安装RPM包的头信息 - LOG_INFO "测试使用rpm模块读取已安装RPM包的头信息" - python3 -c " - import rpm - ts = rpm.TransactionSet() - mi = ts.dbMatch() - for h in mi: - print("Package: %s-%s-%s" % (h["name"], h["version"], h["release"])) - break - " - CHECK_RESULT $? 0 0 "使用rpm模块读取RPM包头信息失败" - - # 清理环境:如果脚本开始时未安装,则卸载python3-rpm包 - if [ "$already_installed" = false ]; then - LOG_INFO "卸载python3-rpm包" - dnf remove -y python3-rpm - CHECK_RESULT $? 0 0 "卸载python3-rpm包失败" - fi -} - -main "$@" \ No newline at end of file diff --git a/testcases/function_test/pkg_test/rubygem-gem2rpm/rubygem-gem2rpm-doc/test_rubygem-gem2rpm-doc_function_basic_convert.sh b/testcases/function_test/pkg_test/rubygem-gem2rpm/rubygem-gem2rpm-doc/test_rubygem-gem2rpm-doc_function_basic_convert.sh deleted file mode 100644 index bf75aaf3f14..00000000000 --- a/testcases/function_test/pkg_test/rubygem-gem2rpm/rubygem-gem2rpm-doc/test_rubygem-gem2rpm-doc_function_basic_convert.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-15 -# @License : Mulan PSL v2 -# @Desc : Test basic gem to spec conversion -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - LOG_INFO "开始测试:Test basic gem to spec conversion" - - # 定义软件包名称 - PACKAGE_NAME="rubygem-gem2rpm-doc" - - # 检查软件包是否已在系统中安装 - LOG_INFO "步骤1:检查软件包是否已安装" - 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 - - # 检查yum源中是否存在该软件包 - LOG_INFO "步骤2:检查yum源中是否存在软件包 $PACKAGE_NAME" - if ! dnf list available $PACKAGE_NAME &> /dev/null; then - LOG_ERROR "yum源中不存在软件包 $PACKAGE_NAME" - exit 255 - fi - - # 如果未安装,则安装软件包 - if [ "$INSTALLED_BEFORE_TEST" = false ]; then - LOG_INFO "步骤3:安装软件包 $PACKAGE_NAME" - dnf install -y $PACKAGE_NAME - CHECK_RESULT $? 0 0 "安装软件包 $PACKAGE_NAME 失败" - fi - - # 检查 gem2rpm 命令是否存在 - LOG_INFO "步骤4:检查 gem2rpm 命令是否存在" - if ! command -v gem2rpm &> /dev/null; then - LOG_ERROR "gem2rpm 命令不存在" - exit 255 - fi - - # 测试基本 gem 到 spec 转换功能 - LOG_INFO "步骤5:测试基本 gem 到 spec 转换功能" - # 创建一个临时的 gem 文件用于测试 - TEST_GEM_NAME="test_gem" - TEST_GEM_FILE="$TEST_GEM_NAME.gem" - TEST_SPEC_FILE="$TEST_GEM_NAME.spec" - - # 模拟一个简单的 gem 文件(这里使用一个虚拟的 gem 文件进行测试) - echo "This is a test gem file" > $TEST_GEM_FILE - CHECK_RESULT $? 0 0 "创建测试 gem 文件失败" - - # 使用 gem2rpm 将 gem 文件转换为 spec 文件 - LOG_INFO "步骤6:使用 gem2rpm 将 gem 文件转换为 spec 文件" - gem2rpm $TEST_GEM_FILE > $TEST_SPEC_FILE 2>&1 - CHECK_RESULT $? 0 0 "gem2rpm 转换失败" - - # 检查生成的 spec 文件是否包含必要的内容 - LOG_INFO "步骤7:检查生成的 spec 文件是否包含必要的内容" - if grep -q "Name:" $TEST_SPEC_FILE && grep -q "Version:" $TEST_SPEC_FILE; then - LOG_INFO "生成的 spec 文件包含必要的 Name 和 Version 字段" - else - LOG_ERROR "生成的 spec 文件缺少必要的字段" - CHECK_RESULT 1 0 0 "spec 文件内容检查失败" - fi - - # 清理临时文件 - LOG_INFO "步骤8:清理临时文件" - rm -f $TEST_GEM_FILE $TEST_SPEC_FILE - CHECK_RESULT $? 0 0 "清理临时文件失败" - - # 如果测试前未安装,则卸载软件包 - if [ "$INSTALLED_BEFORE_TEST" = false ]; 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 "测试完成:Test basic gem to spec conversion" -} - -main "$@" \ No newline at end of file diff --git a/testcases/function_test/pkg_test/rubygem-gem2rpm/rubygem-gem2rpm-doc/test_rubygem-gem2rpm-doc_function_docgen.sh b/testcases/function_test/pkg_test/rubygem-gem2rpm/rubygem-gem2rpm-doc/test_rubygem-gem2rpm-doc_function_docgen.sh deleted file mode 100644 index 3629ae496f0..00000000000 --- a/testcases/function_test/pkg_test/rubygem-gem2rpm/rubygem-gem2rpm-doc/test_rubygem-gem2rpm-doc_function_docgen.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-10 -# @License : Mulan PSL v2 -# @Desc : Test documentation generation functionality -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - # 检查是否已经安装rubygem-gem2rpm-doc软件包 - LOG_INFO "检查是否已经安装rubygem-gem2rpm-doc软件包" - if dnf list installed rubygem-gem2rpm-doc &>/dev/null; then - LOG_INFO "rubygem-gem2rpm-doc已安装,脚本结束时将保持安装状态" - installed=true - else - LOG_INFO "rubygem-gem2rpm-doc未安装,将在测试结束后卸载" - installed=false - fi - - # 检查yum源中是否有rubygem-gem2rpm-doc软件包 - LOG_INFO "检查yum源中是否有rubygem-gem2rpm-doc软件包" - if ! dnf list available rubygem-gem2rpm-doc &>/dev/null; then - LOG_ERROR "yum源中未找到rubygem-gem2rpm-doc软件包" - exit 255 - fi - - # 安装rubygem-gem2rpm-doc软件包(如果未安装) - if [ "$installed" = false ]; then - LOG_INFO "开始安装rubygem-gem2rpm-doc软件包" - dnf install -y rubygem-gem2rpm-doc - CHECK_RESULT $? 0 0 "安装rubygem-gem2rpm-doc软件包失败" - fi - - # 测试文档生成功能 - LOG_INFO "测试文档生成功能" - gem2rpm --help | grep -q "\-\-doc" - CHECK_RESULT $? 0 0 "--doc参数不支持" - - LOG_INFO "执行文档生成命令" - gem2rpm --doc - CHECK_RESULT $? 0 0 "文档生成失败" - - # 清理环境(如果之前未安装) - if [ "$installed" = false ]; then - LOG_INFO "卸载rubygem-gem2rpm-doc软件包" - dnf remove -y rubygem-gem2rpm-doc - CHECK_RESULT $? 0 0 "卸载rubygem-gem2rpm-doc软件包失败" - fi - - LOG_INFO "测试完成,环境已恢复" -} - -main "$@" \ No newline at end of file diff --git a/testcases/function_test/pkg_test/rubygem-gem2rpm/rubygem-gem2rpm-doc/test_rubygem-gem2rpm-doc_function_help.sh b/testcases/function_test/pkg_test/rubygem-gem2rpm/rubygem-gem2rpm-doc/test_rubygem-gem2rpm-doc_function_help.sh deleted file mode 100644 index 92273a4ad33..00000000000 --- a/testcases/function_test/pkg_test/rubygem-gem2rpm/rubygem-gem2rpm-doc/test_rubygem-gem2rpm-doc_function_help.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-15 -# @License : Mulan PSL v2 -# @Desc : Test help command output -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - set -e - - LOG_INFO "开始测试: Test help command output" - - # 检查软件包是否在yum源中 - LOG_INFO "检查rubygem-gem2rpm-doc软件包是否在yum源中" - if ! dnf list available rubygem-gem2rpm-doc &>/dev/null; then - LOG_ERROR "rubygem-gem2rpm-doc软件包不在yum源中" - exit 255 - fi - - # 检查是否已安装软件包 - LOG_INFO "检查rubygem-gem2rpm-doc是否已安装" - if rpm -q rubygem-gem2rpm-doc &>/dev/null; then - already_installed=true - LOG_INFO "rubygem-gem2rpm-doc已安装,测试结束后将保持安装状态" - else - already_installed=false - LOG_INFO "rubygem-gem2rpm-doc未安装,将进行安装测试" - fi - - # 如果未安装,则安装软件包 - if [ "$already_installed" = false ]; then - LOG_INFO "安装rubygem-gem2rpm-doc软件包" - dnf install -y rubygem-gem2rpm-doc - CHECK_RESULT $? 0 0 "安装rubygem-gem2rpm-doc失败" - fi - - # 测试帮助命令输出 - LOG_INFO "测试gem2rpm-doc帮助命令" - output=$(gem2rpm-doc --help 2>&1) - exit_code=$? - - # 检查命令是否执行成功 - if [ $exit_code -eq 0 ]; then - LOG_INFO "gem2rpm-doc帮助命令执行成功" - # 检查输出是否包含帮助信息 - if echo "$output" | grep -q "Usage:"; then - LOG_INFO "帮助命令输出包含预期内容" - CHECK_RESULT 0 0 0 "帮助命令输出不符合预期" - else - LOG_ERROR "帮助命令输出不包含预期内容" - CHECK_RESULT 1 0 0 "帮助命令输出不符合预期" - fi - elif [ $exit_code -eq 255 ]; then - LOG_ERROR "gem2rpm-doc命令参数不存在或不支持" - exit 255 - else - LOG_ERROR "gem2rpm-doc命令执行失败,退出码: $exit_code" - exit $exit_code - fi - - # 清理环境:如果测试前未安装,则卸载软件包 - if [ "$already_installed" = false ]; then - LOG_INFO "卸载rubygem-gem2rpm-doc软件包" - dnf remove -y rubygem-gem2rpm-doc - CHECK_RESULT $? 0 0 "卸载rubygem-gem2rpm-doc失败" - LOG_INFO "环境已恢复到测试前状态" - else - LOG_INFO "保持rubygem-gem2rpm-doc安装状态" - fi - - LOG_INFO "测试完成: Test help command output" -} - -main "$@" \ No newline at end of file diff --git a/testcases/function_test/pkg_test/rubygem-gem2rpm/rubygem-gem2rpm-doc/test_rubygem-gem2rpm-doc_function_version.sh b/testcases/function_test/pkg_test/rubygem-gem2rpm/rubygem-gem2rpm-doc/test_rubygem-gem2rpm-doc_function_version.sh deleted file mode 100644 index 7de6a4fee4b..00000000000 --- a/testcases/function_test/pkg_test/rubygem-gem2rpm/rubygem-gem2rpm-doc/test_rubygem-gem2rpm-doc_function_version.sh +++ /dev/null @@ -1,77 +0,0 @@ -#!/usr/bin/bash - -# Copyright (c) 2024 ISCAS .ALL rights reserved. -# This program is licensed under Mulan PSL v2. -# You can use it according to the terms and conditions of the Mulan PSL v2. -# http://license.coscl.org.cn/MulanPSL2 -# THIS PROGRAM IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, -# EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, -# MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. -# See the Mulan PSL v2 for more details. - -# ############################################# -# @Author : honghua -# @Contact : honghua@iscas.ac.cn -# @Date : 2026-03-15 -# @License : Mulan PSL v2 -# @Desc : Test version command output -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - # 环境初始化检查 - LOG_INFO "检查是否已安装rubygem-gem2rpm-doc软件包" - rpm -q rubygem-gem2rpm-doc >/dev/null 2>&1 - initial_install_status=$? - - # 检查软件包是否在yum源中 - LOG_INFO "检查yum源中是否存在rubygem-gem2rpm-doc软件包" - dnf list available rubygem-gem2rpm-doc >/dev/null 2>&1 - if [ $? -ne 0 ]; then - LOG_ERROR "yum源中未找到rubygem-gem2rpm-doc软件包" - exit 255 - fi - - # 如果未安装则进行安装 - if [ $initial_install_status -ne 0 ]; then - LOG_INFO "安装rubygem-gem2rpm-doc软件包" - dnf install -y rubygem-gem2rpm-doc - CHECK_RESULT $? 0 0 "安装rubygem-gem2rpm-doc软件包失败" - fi - - # 检查version参数支持情况 - LOG_INFO "检查gem2rpm命令是否支持version参数" - gem2rpm --help | grep -q "\-\-version" - if [ $? -ne 0 ]; then - LOG_ERROR "gem2rpm命令不支持version参数" - exit 255 - fi - - # 测试version命令输出 - LOG_INFO "执行gem2rpm --version命令测试" - version_output=$(gem2rpm --version 2>&1) - CHECK_RESULT $? 0 0 "执行gem2rpm --version命令失败" - - # 检查版本输出是否符合预期 - LOG_INFO "检查版本输出是否包含有效信息" - if [ -z "$version_output" ]; then - LOG_ERROR "版本输出为空" - exit 1 - fi - - LOG_INFO "版本输出内容: $version_output" - - # 环境清理 - if [ $initial_install_status -ne 0 ]; then - LOG_INFO "清理环境:卸载rubygem-gem2rpm-doc软件包" - dnf remove -y rubygem-gem2rpm-doc - CHECK_RESULT $? 0 0 "卸载rubygem-gem2rpm-doc软件包失败" - else - LOG_INFO "保持rubygem-gem2rpm-doc软件包安装状态" - fi - - LOG_INFO "测试完成" -} - -main "$@" \ No newline at end of file diff --git a/testcases/function_test/pkg_test/texi2html/texi2html-help/test_texi2html-help_function_convert.sh b/testcases/function_test/pkg_test/texi2html/texi2html-help/test_texi2html-help_function_convert.sh deleted file mode 100644 index 1c6b461d22b..00000000000 --- a/testcases/function_test/pkg_test/texi2html/texi2html-help/test_texi2html-help_function_convert.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-02-23 -# @License : Mulan PSL v2 -# @Desc : Test converting a simple .texi file to HTML -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - # 检查texi2html命令是否已安装 - LOG_INFO "检查texi2html命令是否已安装" - command -v texi2html > /dev/null 2>&1 - is_installed=$? - - # 如果未安装,则检查yum源中是否有texi2html软件包 - if [ $is_installed -ne 0 ]; then - LOG_INFO "texi2html未安装,检查yum源中是否存在该软件包" - dnf search texi2html > /dev/null 2>&1 - if [ $? -ne 0 ]; then - LOG_ERROR "yum源中未找到texi2html软件包" - exit 255 - fi - LOG_INFO "yum源中存在texi2html软件包,开始安装" - dnf install -y texi2html - CHECK_RESULT $? 0 0 "安装texi2html失败" - installed_for_test=1 - else - LOG_INFO "texi2html已安装,无需重新安装" - installed_for_test=0 - fi - - # 测试将简单的.texi文件转换为HTML - LOG_INFO "测试将简单的.texi文件转换为HTML" - - # 创建测试用的简单.texi文件 - LOG_INFO "创建测试用的简单.texi文件" - cat > test_input.texi << "EOF" - \input texinfo - @setfilename test_output.html - @settitle Simple Test - - @node Top - @top Simple Test - - This is a simple test file for texi2html. - @end ifnottex - EOF - - # 检查texi2html命令是否支持转换功能 - LOG_INFO "检查texi2html命令是否支持转换功能" - texi2html --help | grep -q "convert\|html" - if [ $? -ne 0 ]; then - LOG_ERROR "texi2html命令不支持转换功能或参数不存在" - # 清理测试文件 - rm -f test_input.texi test_output.html 2>/dev/null - # 如果是为了测试而安装的,则卸载 - if [ $installed_for_test -eq 1 ]; then - LOG_INFO "卸载为测试安装的texi2html软件包" - dnf remove -y texi2html - fi - exit 255 - fi - - # 执行转换命令 - LOG_INFO "执行转换命令:texi2html test_input.texi" - texi2html test_input.texi - CHECK_RESULT $? 0 0 "texi2html转换失败" - - # 检查生成的HTML文件是否存在 - LOG_INFO "检查生成的HTML文件是否存在" - ls test_output.html > /dev/null 2>&1 - CHECK_RESULT $? 0 0 "未生成HTML输出文件" - - # 检查生成的HTML文件是否包含预期内容 - LOG_INFO "检查生成的HTML文件是否包含预期内容" - grep -q "Simple Test" test_output.html - CHECK_RESULT $? 0 0 "生成的HTML文件内容不符合预期" - - LOG_INFO "texi2html转换功能测试成功" - - # 清理测试文件 - LOG_INFO "清理测试文件" - rm -f test_input.texi test_output.html - - # 恢复环境:如果是为了测试而安装的,则卸载texi2html - if [ $installed_for_test -eq 1 ]; then - LOG_INFO "卸载为测试安装的texi2html软件包" - dnf remove -y texi2html - CHECK_RESULT $? 0 0 "卸载texi2html失败" - fi - - LOG_INFO "测试完成,环境已恢复" -} - -main "$@" \ No newline at end of file diff --git a/testcases/function_test/pkg_test/texi2html/texi2html-help/test_texi2html-help_function_install.sh b/testcases/function_test/pkg_test/texi2html/texi2html-help/test_texi2html-help_function_install.sh deleted file mode 100644 index a1530c8d617..00000000000 --- a/testcases/function_test/pkg_test/texi2html/texi2html-help/test_texi2html-help_function_install.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-23 -# @License : Mulan PSL v2 -# @Desc : Test installation of texi2html-help package -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - # 检查是否已安装texi2html-help - LOG_INFO "检查是否已安装texi2html-help" - rpm -q texi2html-help > /dev/null 2>&1 - if [ $? -eq 0 ]; then - LOG_INFO "texi2html-help已安装,脚本结束时将保持安装状态" - already_installed=1 - else - LOG_INFO "texi2html-help未安装,将在测试过程中安装" - already_installed=0 - fi - - # 检查yum源中是否有texi2html-help包 - LOG_INFO "检查yum源中是否有texi2html-help包" - dnf list available texi2html-help > /dev/null 2>&1 - CHECK_RESULT $? 0 0 "yum源中没有texi2html-help包" - if [ $? -ne 0 ]; then - LOG_ERROR "yum源中未找到texi2html-help包" - exit 255 - fi - - # 如果未安装,则安装texi2html-help - if [ $already_installed -eq 0 ]; then - LOG_INFO "安装texi2html-help" - dnf install -y texi2html-help - CHECK_RESULT $? 0 0 "安装texi2html-help失败" - fi - - # 测试texi2html-help命令的基本功能 - LOG_INFO "测试texi2html-help命令的基本功能" - texi2html --help > /dev/null 2>&1 - CHECK_RESULT $? 0 0 "texi2html命令执行失败" - - # 测试texi2html-help命令的参数是否支持 - LOG_INFO "测试texi2html-help命令的参数是否支持" - texi2html --version > /dev/null 2>&1 - CHECK_RESULT $? 0 0 "texi2html命令不支持--version参数" - if [ $? -ne 0 ]; then - LOG_ERROR "texi2html命令不支持--version参数" - exit 255 - fi - - # 测试texi2html-help命令的无效参数 - LOG_INFO "测试texi2html-help命令的无效参数" - texi2html --invalid-param > /dev/null 2>&1 - if [ $? -eq 255 ]; then - LOG_INFO "texi2html命令正确处理了无效参数" - else - LOG_ERROR "texi2html命令未正确处理无效参数" - exit 255 - fi - - # 清理环境:如果脚本开始时未安装,则卸载texi2html-help - if [ $already_installed -eq 0 ]; then - LOG_INFO "清理环境:卸载texi2html-help" - dnf remove -y texi2html-help - CHECK_RESULT $? 0 0 "卸载texi2html-help失败" - else - LOG_INFO "清理环境:保持texi2html-help安装状态" - fi - - LOG_INFO "测试完成" -} - -main "$@" \ No newline at end of file diff --git a/testcases/function_test/pkg_test/texi2html/texi2html-help/test_texi2html-help_function_uninstall.sh b/testcases/function_test/pkg_test/texi2html/texi2html-help/test_texi2html-help_function_uninstall.sh deleted file mode 100644 index 89507780fc7..00000000000 --- a/testcases/function_test/pkg_test/texi2html/texi2html-help/test_texi2html-help_function_uninstall.sh +++ /dev/null @@ -1,126 +0,0 @@ -#!/usr/bin/bash - -# Copyright (c) 2024 ISCAS .ALL rights reserved. -# This program is licensed under Mulan PSL v2. -# You can use it according to the terms and conditions of the Mulan PSL v2. -# http://license.coscl.org.cn/MulanPSL2 -# THIS PROGRAM IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, -# EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, -# MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. -# See the Mulan PSL v2 for more details. - -# ############################################# -# @Author : honghua -# @Contact : honghua@iscas.ac.cn -# @Date : 2026-02-23 -# @License : Mulan PSL v2 -# @Desc : Test uninstallation of texi2html-help package -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - # 定义日志函数 - LOG_INFO() { - echo "[INFO] $*" - } - LOG_ERROR() { - echo "[ERROR] $*" - } - - # 定义检查结果函数 - CHECK_RESULT() { - if [ $1 -ne $2 ]; then - LOG_ERROR "$4" - exit $3 - fi - } - - # 定义SSH命令函数 - SSH_CMD() { - # 这里只是占位符,实际使用时需要根据环境实现 - sshpass -p $3 ssh $4@$2 "$1" - } - - # 测试用例:Test uninstallation of texi2html-help package - LOG_INFO "开始测试:测试texi2html-help软件包的卸载功能" - - # 步骤1:检查软件包是否在yum源中 - LOG_INFO "步骤1:检查texi2html-help软件包是否在yum源中" - dnf list available texi2html-help 2>/dev/null | grep -q texi2html-help - if [ $? -ne 0 ]; then - LOG_ERROR "texi2html-help软件包不在yum源中" - exit 255 - fi - LOG_INFO "texi2html-help软件包在yum源中" - - # 步骤2:检查当前是否已安装texi2html-help - LOG_INFO "步骤2:检查texi2html-help软件包是否已安装" - rpm -q texi2html-help >/dev/null 2>&1 - if [ $? -eq 0 ]; then - LOG_INFO "texi2html-help软件包已安装,测试结束后保持安装状态" - INSTALLED_BEFORE=1 - else - LOG_INFO "texi2html-help软件包未安装,将在测试前安装" - INSTALLED_BEFORE=0 - fi - - # 步骤3:如果未安装,则安装软件包 - if [ $INSTALLED_BEFORE -eq 0 ]; then - LOG_INFO "步骤3:安装texi2html-help软件包" - dnf install -y texi2html-help - CHECK_RESULT $? 0 1 "安装texi2html-help软件包失败" - LOG_INFO "texi2html-help软件包安装成功" - fi - - # 步骤4:验证软件包安装成功 - LOG_INFO "步骤4:验证texi2html-help软件包安装成功" - rpm -q texi2html-help >/dev/null 2>&1 - CHECK_RESULT $? 0 0 "texi2html-help软件包未正确安装" - LOG_INFO "texi2html-help软件包验证成功" - - # 步骤5:测试卸载功能 - LOG_INFO "步骤5:测试卸载texi2html-help软件包" - dnf remove -y texi2html-help - CHECK_RESULT $? 0 0 "卸载texi2html-help软件包失败" - LOG_INFO "texi2html-help软件包卸载成功" - - # 步骤6:验证软件包已卸载 - LOG_INFO "步骤6:验证texi2html-help软件包已卸载" - rpm -q texi2html-help >/dev/null 2>&1 - if [ $? -eq 0 ]; then - LOG_ERROR "texi2html-help软件包卸载后仍然存在" - exit 1 - fi - LOG_INFO "texi2html-help软件包验证已卸载" - - # 步骤7:环境恢复 - LOG_INFO "步骤7:恢复测试环境" - if [ $INSTALLED_BEFORE -eq 1 ]; then - LOG_INFO "重新安装texi2html-help软件包以恢复原始状态" - dnf install -y texi2html-help - CHECK_RESULT $? 0 0 "重新安装texi2html-help软件包失败" - LOG_INFO "texi2html-help软件包重新安装成功" - else - LOG_INFO "原始环境未安装texi2html-help,无需恢复" - fi - - # 步骤8:最终验证 - LOG_INFO "步骤8:最终环境验证" - if [ $INSTALLED_BEFORE -eq 1 ]; then - rpm -q texi2html-help >/dev/null 2>&1 - CHECK_RESULT $? 0 0 "最终环境验证失败:texi2html-help软件包未正确恢复" - LOG_INFO "环境已成功恢复到原始安装状态" - else - rpm -q texi2html-help >/dev/null 2>&1 - if [ $? -eq 0 ]; then - LOG_ERROR "最终环境验证失败:texi2html-help软件包不应存在" - exit 1 - fi - LOG_INFO "环境已成功恢复到原始未安装状态" - fi - - LOG_INFO "测试完成:texi2html-help软件包卸载功能测试通过" -} - -main "$@" \ No newline at end of file diff --git a/testcases/function_test/pkg_test/texi2html/texi2html-help/test_texi2html-help_function_version.sh b/testcases/function_test/pkg_test/texi2html/texi2html-help/test_texi2html-help_function_version.sh deleted file mode 100644 index 2136c777f62..00000000000 --- a/testcases/function_test/pkg_test/texi2html/texi2html-help/test_texi2html-help_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-02-23 -# @License : Mulan PSL v2 -# @Desc : Test --version option to display version -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - LOG_INFO "开始测试texi2html的--version选项" - - # 检查是否已安装texi2html - LOG_INFO "步骤1:检查texi2html是否已安装" - if command -v texi2html &> /dev/null; then - LOG_INFO "texi2html已安装,测试结束后将保持安装状态" - INSTALLED=true - else - LOG_INFO "texi2html未安装,将在测试中安装" - INSTALLED=false - fi - - # 检查yum源中是否有texi2html包 - LOG_INFO "步骤2:检查yum源中是否有texi2html软件包" - if ! dnf list available texi2html &> /dev/null; then - LOG_ERROR "yum源中未找到texi2html软件包" - exit 255 - fi - - # 如果未安装,则安装texi2html - if [ "$INSTALLED" = false ]; then - LOG_INFO "步骤3:安装texi2html软件包" - dnf install -y texi2html - CHECK_RESULT $? 0 0 "安装texi2html失败" - fi - - # 测试--version选项 - LOG_INFO "步骤4:测试texi2html --version选项" - texi2html --version - CHECK_RESULT $? 0 0 "texi2html --version执行失败" - - # 检查--version选项是否输出版本信息 - LOG_INFO "步骤5:验证--version输出包含版本信息" - VERSION_OUTPUT=$(texi2html --version 2>&1) - if echo "$VERSION_OUTPUT" | grep -q "texi2html"; then - LOG_INFO "版本信息输出正确" - else - LOG_ERROR "版本信息输出不正确" - exit 255 - fi - - # 环境恢复:如果测试前未安装,则卸载texi2html - if [ "$INSTALLED" = false ]; then - LOG_INFO "步骤6:卸载texi2html软件包" - dnf remove -y texi2html - CHECK_RESULT $? 0 0 "卸载texi2html失败" - fi - - LOG_INFO "测试完成" -} - -main "$@" \ No newline at end of file diff --git a/testcases/function_test/pkg_test/texlive-base/texlive-epspdf/test_texlive-epspdf_epspdf_b.sh b/testcases/function_test/pkg_test/texlive-base/texlive-epspdf/test_texlive-epspdf_epspdf_b.sh deleted file mode 100644 index 8d6193d9bdb..00000000000 --- a/testcases/function_test/pkg_test/texlive-base/texlive-epspdf/test_texlive-epspdf_epspdf_b.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-02-25 -# @License : Mulan PSL v2 -# @Desc : 测试epspdf命令使用-b参数计算紧密的边界框 -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - # 环境检查与准备 - LOG_INFO "开始测试:epspdf命令使用-b参数计算紧密的边界框" - - # 检查是否已安装texlive-epspdf软件包 - LOG_INFO "步骤1:检查texlive-epspdf软件包是否已安装" - if rpm -q texlive-epspdf &>/dev/null; then - LOG_INFO "texlive-epspdf软件包已安装,测试结束后将保持安装状态" - INSTALLED=true - else - LOG_INFO "texlive-epspdf软件包未安装,将在测试过程中安装并在结束后卸载" - INSTALLED=false - fi - - # 检查yum源中是否有texlive-epspdf软件包 - LOG_INFO "步骤2:检查yum源中是否有texlive-epspdf软件包" - if ! dnf list texlive-epspdf &>/dev/null; then - LOG_ERROR "yum源中未找到texlive-epspdf软件包" - exit 255 - fi - - # 如果未安装,则安装软件包 - if [ "$INSTALLED" = false ]; then - LOG_INFO "步骤3:安装texlive-epspdf软件包" - dnf install -y texlive-epspdf - CHECK_RESULT $? 0 0 "安装texlive-epspdf软件包失败" - fi - - # 检查epspdf命令是否支持-b参数 - LOG_INFO "步骤4:检查epspdf命令是否支持-b参数" - if ! epspdf --help 2>&1 | grep -q "\-b"; then - LOG_ERROR "epspdf命令不支持-b参数" - exit 255 - fi - - # 准备测试文件 - LOG_INFO "步骤5:准备测试用的EPS文件" - cat > test_input.eps << "EOF" - %!PS-Adobe-3.0 EPSF-3.0 - %%BoundingBox: 0 0 100 100 - %%HiResBoundingBox: 0 0 100 100 - 0 0 100 100 rectfill - showpage - EOF - CHECK_RESULT $? 0 0 "创建测试EPS文件失败" - - # 使用-b参数执行epspdf命令 - LOG_INFO "步骤6:使用-b参数执行epspdf命令计算紧密边界框" - epspdf -b test_input.eps test_output.pdf - CHECK_RESULT $? 0 0 "epspdf命令执行失败" - - # 验证输出文件是否存在 - LOG_INFO "步骤7:验证生成的PDF文件是否存在" - if [ -f test_output.pdf ]; then - LOG_INFO "PDF文件生成成功" - else - LOG_ERROR "PDF文件生成失败" - exit 1 - fi - - # 清理临时文件 - LOG_INFO "步骤8:清理临时文件" - rm -f test_input.eps test_output.pdf - CHECK_RESULT $? 0 0 "清理临时文件失败" - - # 环境恢复 - LOG_INFO "步骤9:恢复环境状态" - if [ "$INSTALLED" = false ]; then - LOG_INFO "卸载texlive-epspdf软件包" - dnf remove -y texlive-epspdf - CHECK_RESULT $? 0 0 "卸载texlive-epspdf软件包失败" - else - LOG_INFO "保持texlive-epspdf软件包安装状态" - fi - - LOG_INFO "测试完成:epspdf命令使用-b参数计算紧密的边界框测试通过" -} - -main "$@" \ No newline at end of file diff --git a/testcases/function_test/pkg_test/texlive-base/texlive-epspdf/test_texlive-epspdf_epspdf_basic_eps_to_pdf.sh b/testcases/function_test/pkg_test/texlive-base/texlive-epspdf/test_texlive-epspdf_epspdf_basic_eps_to_pdf.sh deleted file mode 100644 index afc570053ce..00000000000 --- a/testcases/function_test/pkg_test/texlive-base/texlive-epspdf/test_texlive-epspdf_epspdf_basic_eps_to_pdf.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-25 -# @License : Mulan PSL v2 -# @Desc : 测试epspdf命令将EPS文件转换为PDF文件的基本功能 -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - # 判断环境是否已安装texlive-epspdf - LOG_INFO "检查texlive-epspdf是否已安装" - if dnf list installed texlive-epspdf > /dev/null 2>&1; then - LOG_INFO "texlive-epspdf已安装,脚本结束时将保持安装状态" - INSTALLED_BEFORE=1 - else - LOG_INFO "texlive-epspdf未安装,将在测试过程中安装" - INSTALLED_BEFORE=0 - fi - - # 检查yum源中是否有texlive-epspdf软件包 - LOG_INFO "检查yum源中是否有texlive-epspdf软件包" - if ! dnf list available texlive-epspdf > /dev/null 2>&1; then - LOG_ERROR "yum源中没有texlive-epspdf软件包" - exit 255 - fi - - # 如果未安装,则安装软件包 - if [ $INSTALLED_BEFORE -eq 0 ]; then - LOG_INFO "安装texlive-epspdf软件包" - dnf install -y texlive-epspdf - CHECK_RESULT $? 0 0 "安装texlive-epspdf失败" - fi - - # 创建测试EPS文件 - LOG_INFO "创建测试EPS文件" - cat > test.eps << "EOF" - %!PS-Adobe-3.0 EPSF-3.0 - %%BoundingBox: 0 0 100 100 - newpath - 50 50 moveto - 50 50 30 0 360 arc - stroke - showpage - EOF - CHECK_RESULT $? 0 0 "创建EPS文件失败" - - # 测试epspdf命令是否存在 - LOG_INFO "检查epspdf命令是否存在" - if ! command -v epspdf > /dev/null 2>&1; then - LOG_ERROR "epspdf命令不存在" - if [ $INSTALLED_BEFORE -eq 0 ]; then - dnf remove -y texlive-epspdf - fi - exit 255 - fi - - # 测试epspdf命令参数 - LOG_INFO "检查epspdf命令参数" - epspdf --help > /dev/null 2>&1 - CHECK_RESULT $? 0 0 "epspdf命令参数检查失败" - - # 测试将EPS文件转换为PDF文件 - LOG_INFO "使用epspdf将EPS文件转换为PDF文件" - epspdf test.eps test.pdf - CHECK_RESULT $? 0 0 "epspdf转换EPS到PDF失败" - - # 检查生成的PDF文件 - LOG_INFO "检查生成的PDF文件" - if [ -f test.pdf ]; then - LOG_INFO "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.eps test.pdf - CHECK_RESULT $? 0 0 "清理测试文件失败" - - # 如果测试前未安装,则卸载软件包 - if [ $INSTALLED_BEFORE -eq 0 ]; then - LOG_INFO "卸载texlive-epspdf软件包" - dnf remove -y texlive-epspdf - CHECK_RESULT $? 0 0 "卸载texlive-epspdf失败" - fi - - LOG_INFO "测试完成" -} - -main "$@" \ No newline at end of file diff --git a/testcases/function_test/pkg_test/texlive-base/texlive-epspdf/test_texlive-epspdf_epspdf_basic_pdf_to_eps.sh b/testcases/function_test/pkg_test/texlive-base/texlive-epspdf/test_texlive-epspdf_epspdf_basic_pdf_to_eps.sh deleted file mode 100644 index 936c21f4eb9..00000000000 --- a/testcases/function_test/pkg_test/texlive-base/texlive-epspdf/test_texlive-epspdf_epspdf_basic_pdf_to_eps.sh +++ /dev/null @@ -1,140 +0,0 @@ -#!/usr/bin/bash - -# Copyright (c) 2024 ISCAS .ALL rights reserved. -# This program is licensed under Mulan PSL v2. -# You can use it according to the terms and conditions of the Mulan PSL v2. -# http://license.coscl.org.cn/MulanPSL2 -# THIS PROGRAM IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, -# EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, -# MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. -# See the Mulan PSL v2 for more details. - -# ############################################# -# @Author : honghua -# @Contact : honghua@iscas.ac.cn -# @Date : 2026-02-25 -# @License : Mulan PSL v2 -# @Desc : 测试epspdf命令将PDF文件转换为EPS文件的基本功能 -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - # 检查是否已安装texlive-epspdf - LOG_INFO "检查是否已安装texlive-epspdf软件包" - rpm -q texlive-epspdf > /dev/null 2>&1 - if [ $? -eq 0 ]; then - LOG_INFO "texlive-epspdf已安装,标记为已存在安装" - INSTALLED=1 - else - LOG_INFO "texlive-epspdf未安装,标记为未安装" - INSTALLED=0 - fi - - # 检查yum源中是否有texlive-epspdf软件包 - LOG_INFO "检查yum源中是否有texlive-epspdf软件包" - dnf list available texlive-epspdf > /dev/null 2>&1 - CHECK_RESULT $? 0 255 "yum源中未找到texlive-epspdf软件包" - - # 如果未安装,则安装软件包 - if [ $INSTALLED -eq 0 ]; then - LOG_INFO "开始安装texlive-epspdf软件包" - dnf install -y texlive-epspdf - CHECK_RESULT $? 0 0 "安装texlive-epspdf软件包失败" - LOG_INFO "texlive-epspdf软件包安装成功" - fi - - # 检查epspdf命令是否可用 - LOG_INFO "检查epspdf命令是否可用" - which epspdf > /dev/null 2>&1 - CHECK_RESULT $? 0 255 "epspdf命令不存在" - - # 创建测试用的PDF文件 - LOG_INFO "创建测试用的PDF文件" - cat > test_input.pdf << EOF - %PDF-1.4 - 1 0 obj - << - /Type /Catalog - /Pages 2 0 R - >> - endobj - 2 0 obj - << - /Type /Pages - /Kids [3 0 R] - /Count 1 - >> - endobj - 3 0 obj - << - /Type /Page - /Parent 2 0 R - /MediaBox [0 0 100 100] - /Contents 4 0 R - >> - endobj - 4 0 obj - << - /Length 44 - >> - stream - BT - /F1 12 Tf - 50 50 Td - (Test) Tj - ET - endstream - endobj - xref - 0 5 - 0000000000 65535 f - 0000000010 00000 n - 0000000053 00000 n - 0000000106 00000 n - 0000000177 00000 n - trailer - << - /Size 5 - /Root 1 0 R - >> - startxref - 237 - %%EOF - EOF - CHECK_RESULT $? 0 0 "创建测试PDF文件失败" - - # 测试epspdf命令将PDF转换为EPS - LOG_INFO "测试epspdf命令将PDF文件转换为EPS文件" - epspdf test_input.pdf test_output.eps - CHECK_RESULT $? 0 0 "epspdf命令执行失败" - - # 检查生成的EPS文件是否存在 - LOG_INFO "检查生成的EPS文件是否存在" - [ -f test_output.eps ] - CHECK_RESULT $? 0 0 "未生成EPS文件" - - # 检查EPS文件内容是否有效 - LOG_INFO "检查EPS文件内容是否有效" - file test_output.eps | grep -q "EPS" - CHECK_RESULT $? 0 0 "生成的EPS文件格式不正确" - - # 清理测试文件 - LOG_INFO "清理测试文件" - rm -f test_input.pdf test_output.eps - CHECK_RESULT $? 0 0 "清理测试文件失败" - - # 如果测试前未安装,则卸载软件包 - if [ $INSTALLED -eq 0 ]; then - LOG_INFO "卸载texlive-epspdf软件包" - dnf remove -y texlive-epspdf - CHECK_RESULT $? 0 0 "卸载texlive-epspdf软件包失败" - LOG_INFO "texlive-epspdf软件包卸载成功" - else - LOG_INFO "测试前已安装texlive-epspdf,保持安装状态" - fi - - LOG_INFO "测试完成:epspdf命令将PDF文件转换为EPS文件的基本功能测试通过" -} - -main "$@" \ No newline at end of file diff --git a/testcases/function_test/pkg_test/texlive-base/texlive-epspdf/test_texlive-epspdf_epspdf_basic_ps_to_pdf.sh b/testcases/function_test/pkg_test/texlive-base/texlive-epspdf/test_texlive-epspdf_epspdf_basic_ps_to_pdf.sh deleted file mode 100644 index 9cdef1eb707..00000000000 --- a/testcases/function_test/pkg_test/texlive-base/texlive-epspdf/test_texlive-epspdf_epspdf_basic_ps_to_pdf.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-02-25 -# @License : Mulan PSL v2 -# @Desc : 测试epspdf命令将PS文件转换为PDF文件的基本功能 -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - LOG_INFO "开始测试epspdf命令将PS文件转换为PDF文件的基本功能" - LOG_INFO "步骤1:检查texlive-epspdf软件包是否已在yum源中" - if ! dnf list available texlive-epspdf > /dev/null 2>&1; then - LOG_ERROR "yum源中未找到texlive-epspdf软件包" - exit 255 - fi - LOG_INFO "texlive-epspdf软件包在yum源中可用" - LOG_INFO "步骤2:检查系统是否已安装texlive-epspdf" - if rpm -q texlive-epspdf > /dev/null 2>&1; then - LOG_INFO "texlive-epspdf已安装,测试结束后保持安装状态" - INSTALLED=true - else - LOG_INFO "texlive-epspdf未安装,将进行安装" - INSTALLED=false - fi - if [ "$INSTALLED" = "false" ]; then - LOG_INFO "步骤3:安装texlive-epspdf软件包" - dnf install -y texlive-epspdf - CHECK_RESULT $? 0 0 "安装texlive-epspdf失败" - fi - LOG_INFO "步骤4:检查epspdf命令是否支持必要参数" - if ! epspdf --help 2>&1 | grep -q "ps2pdf"; then - LOG_ERROR "epspdf命令不支持ps2pdf参数或功能" - exit 255 - fi - LOG_INFO "epspdf命令支持ps2pdf功能" - LOG_INFO "步骤5:创建测试用的PS文件" - cat > test_input.ps << "EOF" - %!PS - /Times-Roman findfont 24 scalefont setfont - 100 100 moveto - (Hello, EPSPDF Test!) show - showpage - EOF - CHECK_RESULT $? 0 0 "创建测试PS文件失败" - LOG_INFO "步骤6:使用epspdf命令将PS文件转换为PDF" - epspdf test_input.ps test_output.pdf - CHECK_RESULT $? 0 0 "epspdf转换PS到PDF失败" - LOG_INFO "步骤7:验证生成的PDF文件" - if [ -f test_output.pdf ]; then - LOG_INFO "PDF文件生成成功" - file test_output.pdf | grep -q "PDF document" - CHECK_RESULT $? 0 0 "生成的文件不是有效的PDF" - else - LOG_ERROR "PDF文件未生成" - exit 1 - fi - LOG_INFO "步骤8:清理测试文件" - rm -f test_input.ps test_output.pdf - CHECK_RESULT $? 0 0 "清理测试文件失败" - if [ "$INSTALLED" = "false" ]; then - LOG_INFO "步骤9:卸载texlive-epspdf软件包" - dnf remove -y texlive-epspdf - CHECK_RESULT $? 0 0 "卸载texlive-epspdf失败" - fi - LOG_INFO "测试完成" -} - -main "$@" \ No newline at end of file diff --git a/testcases/function_test/pkg_test/texlive-base/texlive-epspdf/test_texlive-epspdf_epspdf_d.sh b/testcases/function_test/pkg_test/texlive-base/texlive-epspdf/test_texlive-epspdf_epspdf_d.sh deleted file mode 100644 index 02be58409aa..00000000000 --- a/testcases/function_test/pkg_test/texlive-base/texlive-epspdf/test_texlive-epspdf_epspdf_d.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-02-25 -# @License : Mulan PSL v2 -# @Desc : 测试epspdf命令使用-d参数进行调试,不删除临时文件 -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - LOG_INFO "开始测试epspdf命令使用-d参数进行调试,不删除临时文件" - LOG_INFO "步骤1:检查yum源中是否存在texlive-epspdf软件包" - dnf list available texlive-epspdf > /dev/null 2>&1 - if [ $? -ne 0 ]; then - LOG_ERROR "yum源中未找到texlive-epspdf软件包" - exit 255 - fi - - LOG_INFO "步骤2:检查当前环境是否已安装texlive-epspdf软件包" - if rpm -q texlive-epspdf > /dev/null 2>&1; then - LOG_INFO "texlive-epspdf已安装,脚本结束后将保持安装状态" - INSTALLED=true - else - LOG_INFO "texlive-epspdf未安装,将在测试步骤中安装" - INSTALLED=false - fi - - if [ "$INSTALLED" = "false" ]; then - LOG_INFO "步骤3:安装texlive-epspdf软件包" - dnf install -y texlive-epspdf - CHECK_RESULT $? 0 0 "安装texlive-epspdf失败" - fi - - LOG_INFO "步骤4:检查epspdf命令是否存在" - which epspdf > /dev/null 2>&1 - CHECK_RESULT $? 0 0 "epspdf命令不存在" - - LOG_INFO "步骤5:检查epspdf命令是否支持-d参数" - epspdf -h 2>&1 | grep -q -- "-d" - CHECK_RESULT $? 0 0 "epspdf命令不支持-d参数" - - LOG_INFO "步骤6:创建一个测试用的EPS文件" - cat > test_input.eps << "EOF" - %!PS-Adobe-3.0 EPSF-3.0 - %%BoundingBox: 0 0 100 100 - 0 0 moveto - 100 100 lineto - stroke - showpage - EOF - CHECK_RESULT $? 0 0 "创建测试EPS文件失败" - - LOG_INFO "步骤7:使用-d参数执行epspdf命令进行调试" - epspdf -d test_input.eps test_output.pdf > /dev/null 2>&1 - CHECK_RESULT $? 0 0 "使用-d参数执行epspdf命令失败" - - LOG_INFO "步骤8:验证临时文件未被删除" - if [ -f "test_input.epspdftmp.ps" ]; then - LOG_INFO "临时文件 test_input.epspdftmp.ps 存在,符合预期" - CHECK_RESULT 0 0 0 "临时文件检查失败" - else - LOG_ERROR "临时文件 test_input.epspdftmp.ps 不存在,不符合预期" - CHECK_RESULT 1 0 0 "临时文件检查失败" - fi - - LOG_INFO "步骤9:验证生成的PDF文件" - if [ -f "test_output.pdf" ]; then - LOG_INFO "PDF文件 test_output.pdf 生成成功" - CHECK_RESULT 0 0 0 "PDF文件生成检查失败" - else - LOG_ERROR "PDF文件 test_output.pdf 未生成" - CHECK_RESULT 1 0 0 "PDF文件生成检查失败" - fi - - LOG_INFO "步骤10:清理测试生成的文件" - rm -f test_input.eps test_output.pdf test_input.epspdftmp.ps - CHECK_RESULT $? 0 0 "清理测试文件失败" - - if [ "$INSTALLED" = "false" ]; then - LOG_INFO "步骤11:卸载texlive-epspdf软件包" - dnf remove -y texlive-epspdf - CHECK_RESULT $? 0 0 "卸载texlive-epspdf失败" - fi - - LOG_INFO "测试完成,环境已恢复" -} - -main "$@" \ No newline at end of file diff --git a/testcases/function_test/pkg_test/texlive-base/texlive-epspdf/test_texlive-epspdf_epspdf_g.sh b/testcases/function_test/pkg_test/texlive-base/texlive-epspdf/test_texlive-epspdf_epspdf_g.sh deleted file mode 100644 index bcc977095b0..00000000000 --- a/testcases/function_test/pkg_test/texlive-base/texlive-epspdf/test_texlive-epspdf_epspdf_g.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-02-25 -# @License : Mulan PSL v2 -# @Desc : 测试epspdf命令使用-g参数将输出转换为灰度模式 -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - # 检查是否已安装texlive-epspdf - LOG_INFO "检查是否已安装texlive-epspdf" - if dnf list installed | grep -q texlive-epspdf; then - LOG_INFO "texlive-epspdf已安装,保持安装状态" - INSTALLED="true" - else - LOG_INFO "texlive-epspdf未安装,将在测试过程中安装" - INSTALLED="false" - fi - - # 检查yum源中是否有texlive-epspdf软件包 - LOG_INFO "检查yum源中是否有texlive-epspdf软件包" - if ! dnf search texlive-epspdf | grep -q texlive-epspdf; then - LOG_ERROR "yum源中未找到texlive-epspdf软件包" - exit 255 - fi - - # 如果未安装,则安装texlive-epspdf - if [ "$INSTALLED" = "false" ]; then - LOG_INFO "安装texlive-epspdf" - dnf install -y texlive-epspdf - CHECK_RESULT $? 0 0 "安装texlive-epspdf失败" - fi - - # 检查epspdf命令是否存在 - LOG_INFO "检查epspdf命令是否存在" - if ! command -v epspdf &> /dev/null; then - LOG_ERROR "epspdf命令不存在" - exit 255 - fi - - # 检查epspdf命令是否支持-g参数 - LOG_INFO "检查epspdf命令是否支持-g参数" - epspdf --help | grep -q "\-g" - CHECK_RESULT $? 0 0 "epspdf命令不支持-g参数" - - # 创建测试用的EPS文件 - LOG_INFO "创建测试用的EPS文件" - cat > test.eps << EOF - %!PS-Adobe-3.0 EPSF-3.0 - %%BoundingBox: 0 0 100 100 - newpath - 0 0 moveto - 100 100 lineto - stroke - showpage - EOF - CHECK_RESULT $? 0 0 "创建EPS文件失败" - - # 使用epspdf命令的-g参数将EPS转换为PDF - LOG_INFO "使用epspdf命令的-g参数将EPS转换为灰度PDF" - epspdf -g test.eps test.pdf - CHECK_RESULT $? 0 0 "epspdf -g命令执行失败" - - # 验证生成的PDF文件是否存在 - LOG_INFO "验证生成的PDF文件是否存在" - [ -f test.pdf ] - CHECK_RESULT $? 0 0 "未生成PDF文件" - - # 清理测试文件 - LOG_INFO "清理测试文件" - rm -f test.eps test.pdf - CHECK_RESULT $? 0 0 "清理测试文件失败" - - # 如果测试前未安装,则卸载texlive-epspdf - if [ "$INSTALLED" = "false" ]; then - LOG_INFO "卸载texlive-epspdf" - dnf remove -y texlive-epspdf - CHECK_RESULT $? 0 0 "卸载texlive-epspdf失败" - fi - - LOG_INFO "测试完成" -} - -main "$@" \ No newline at end of file diff --git a/testcases/function_test/pkg_test/texlive-base/texlive-epspdf/test_texlive-epspdf_epspdf_h.sh b/testcases/function_test/pkg_test/texlive-base/texlive-epspdf/test_texlive-epspdf_epspdf_h.sh deleted file mode 100644 index fea4b471982..00000000000 --- a/testcases/function_test/pkg_test/texlive-base/texlive-epspdf/test_texlive-epspdf_epspdf_h.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-25 -# @License : Mulan PSL v2 -# @Desc : 测试epspdf命令使用-h参数显示帮助信息 -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - # 环境检查:判断是否已安装texlive-epspdf软件包 - LOG_INFO "检查是否已安装texlive-epspdf软件包" - rpm -q texlive-epspdf > /dev/null 2>&1 - if [ $? -eq 0 ]; then - LOG_INFO "texlive-epspdf已安装,标记为已安装状态" - INSTALLED=true - else - LOG_INFO "texlive-epspdf未安装,标记为未安装状态" - INSTALLED=false - fi - - # 检查yum源中是否存在texlive-epspdf软件包 - LOG_INFO "检查yum源中是否存在texlive-epspdf软件包" - dnf list available texlive-epspdf > /dev/null 2>&1 - CHECK_RESULT $? 0 0 "yum源中未找到texlive-epspdf软件包" - if [ $? -ne 0 ]; then - LOG_ERROR "yum源中未找到texlive-epspdf软件包" - exit 255 - fi - - # 如果未安装,则安装软件包 - if [ "$INSTALLED" = "false" ]; then - LOG_INFO "开始安装texlive-epspdf软件包" - dnf install -y texlive-epspdf > /dev/null 2>&1 - CHECK_RESULT $? 0 0 "安装texlive-epspdf软件包失败" - if [ $? -ne 0 ]; then - LOG_ERROR "安装texlive-epspdf软件包失败" - exit $? - fi - LOG_INFO "texlive-epspdf软件包安装成功" - fi - - # 测试epspdf命令使用-h参数显示帮助信息 - LOG_INFO "测试epspdf命令使用-h参数显示帮助信息" - epspdf -h > /dev/null 2>&1 - CHECK_RESULT $? 0 0 "epspdf命令不支持-h参数或执行失败" - if [ $? -ne 0 ]; then - LOG_ERROR "epspdf命令不支持-h参数或执行失败" - # 如果之前未安装,则卸载软件包 - if [ "$INSTALLED" = "false" ]; then - LOG_INFO "清理环境:卸载texlive-epspdf软件包" - dnf remove -y texlive-epspdf > /dev/null 2>&1 - fi - exit 255 - fi - LOG_INFO "epspdf命令使用-h参数显示帮助信息成功" - - # 环境清理:如果之前未安装,则卸载软件包 - if [ "$INSTALLED" = "false" ]; then - LOG_INFO "清理环境:卸载texlive-epspdf软件包" - dnf remove -y texlive-epspdf > /dev/null 2>&1 - CHECK_RESULT $? 0 0 "卸载texlive-epspdf软件包失败" - if [ $? -ne 0 ]; then - LOG_ERROR "卸载texlive-epspdf软件包失败" - exit $? - fi - LOG_INFO "texlive-epspdf软件包卸载成功" - else - LOG_INFO "环境已安装texlive-epspdf,保持安装状态" - fi - - LOG_INFO "测试脚本执行完成" -} - -main "$@" \ No newline at end of file diff --git a/testcases/function_test/pkg_test/texlive-base/texlive-epspdf/test_texlive-epspdf_epspdf_i.sh b/testcases/function_test/pkg_test/texlive-base/texlive-epspdf/test_texlive-epspdf_epspdf_i.sh deleted file mode 100644 index 42524c21982..00000000000 --- a/testcases/function_test/pkg_test/texlive-base/texlive-epspdf/test_texlive-epspdf_epspdf_i.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-02-25 -# @License : Mulan PSL v2 -# @Desc : 测试epspdf命令使用-i参数显示检测到的文件类型信息 -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - LOG_INFO "开始测试epspdf命令使用-i参数显示检测到的文件类型信息" - LOG_INFO "检查texlive-epspdf软件包是否已在yum源中" - dnf list texlive-epspdf 2>/dev/null | grep -q "texlive-epspdf" - if [ $? -ne 0 ]; then - LOG_ERROR "yum源中未找到texlive-epspdf软件包" - exit 255 - fi - LOG_INFO "texlive-epspdf软件包存在于yum源中" - LOG_INFO "检查当前环境是否已安装texlive-epspdf软件包" - rpm -q texlive-epspdf > /dev/null 2>&1 - if [ $? -eq 0 ]; then - LOG_INFO "检测到texlive-epspdf软件包已安装,测试后将保持安装状态" - INSTALLED_BEFORE_TEST=true - else - LOG_INFO "未检测到texlive-epspdf软件包,将在测试前安装" - INSTALLED_BEFORE_TEST=false - fi - if [ "$INSTALLED_BEFORE_TEST" = false ]; then - LOG_INFO "正在安装texlive-epspdf软件包" - dnf install -y texlive-epspdf - CHECK_RESULT $? 0 0 "安装texlive-epspdf软件包失败" - LOG_INFO "texlive-epspdf软件包安装成功" - fi - LOG_INFO "检查epspdf命令的-i参数是否支持" - epspdf --help 2>&1 | grep -q "\-i" - if [ $? -ne 0 ]; then - LOG_ERROR "epspdf命令不支持-i参数" - if [ "$INSTALLED_BEFORE_TEST" = false ]; then - LOG_INFO "清理环境:卸载在测试中安装的texlive-epspdf软件包" - dnf remove -y texlive-epspdf - CHECK_RESULT $? 0 0 "卸载texlive-epspdf软件包失败" - fi - exit 255 - fi - LOG_INFO "epspdf命令支持-i参数" - LOG_INFO "准备一个测试用的EPS文件" - cat > test_input.eps << "EOF" - %!PS-Adobe-3.0 EPSF-3.0 - %%BoundingBox: 0 0 100 100 - newpath - 0 0 moveto - 100 100 lineto - stroke - showpage - EOF - CHECK_RESULT $? 0 0 "创建测试EPS文件失败" - LOG_INFO "测试EPS文件创建成功" - LOG_INFO "使用epspdf -i命令处理测试EPS文件" - epspdf -i test_input.eps test_output.pdf 2>&1 | tee output.log - CHECK_RESULT $? 0 0 "epspdf -i命令执行失败" - LOG_INFO "检查输出日志中是否包含文件类型信息" - grep -i "type\|detect" output.log - CHECK_RESULT $? 0 0 "epspdf -i命令输出中未找到预期的文件类型信息" - LOG_INFO "epspdf -i命令成功显示了检测到的文件类型信息" - LOG_INFO "清理测试生成的文件" - rm -f test_input.eps test_output.pdf output.log - CHECK_RESULT $? 0 0 "清理测试文件失败" - if [ "$INSTALLED_BEFORE_TEST" = false ]; then - LOG_INFO "清理环境:卸载在测试中安装的texlive-epspdf软件包" - dnf remove -y texlive-epspdf - CHECK_RESULT $? 0 0 "卸载texlive-epspdf软件包失败" - LOG_INFO "环境已恢复到测试前状态" - else - LOG_INFO "测试完成,保持texlive-epspdf软件包的安装状态" - fi - LOG_INFO "测试epspdf命令使用-i参数显示检测到的文件类型信息完成" -} - -main "$@" \ No newline at end of file diff --git a/testcases/function_test/pkg_test/texlive-base/texlive-epspdf/test_texlive-epspdf_epspdf_p.sh b/testcases/function_test/pkg_test/texlive-base/texlive-epspdf/test_texlive-epspdf_epspdf_p.sh deleted file mode 100644 index 083b1c28f68..00000000000 --- a/testcases/function_test/pkg_test/texlive-base/texlive-epspdf/test_texlive-epspdf_epspdf_p.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-02-25 -# @License : Mulan PSL v2 -# @Desc : 测试epspdf命令使用-p参数指定页面进行转换 -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - # 检查是否已安装texlive-epspdf - LOG_INFO "检查是否已安装texlive-epspdf软件包" - rpm -q texlive-epspdf > /dev/null 2>&1 - if [ $? -eq 0 ]; then - LOG_INFO "texlive-epspdf已安装,脚本结束后将保持安装状态" - already_installed=1 - else - LOG_INFO "texlive-epspdf未安装,将在测试过程中安装,并在脚本结束前卸载" - already_installed=0 - fi - - # 检查yum源中是否有texlive-epspdf软件包 - LOG_INFO "检查yum源中是否有texlive-epspdf软件包" - dnf list available texlive-epspdf > /dev/null 2>&1 - if [ $? -ne 0 ]; then - LOG_ERROR "yum源中没有texlive-epspdf软件包" - exit 255 - fi - - # 如果未安装,则安装texlive-epspdf - if [ $already_installed -eq 0 ]; then - LOG_INFO "安装texlive-epspdf软件包" - dnf install -y texlive-epspdf - CHECK_RESULT $? 0 0 "安装texlive-epspdf失败" - fi - - # 创建测试用的EPS文件 - LOG_INFO "创建测试用的EPS文件" - cat > test.eps << "EOF" - %!PS-Adobe-3.0 EPSF-3.0 - %%BoundingBox: 0 0 100 100 - newpath - 0 0 moveto - 100 100 lineto - stroke - showpage - EOF - CHECK_RESULT $? 0 0 "创建EPS文件失败" - - # 测试epspdf命令使用-p参数指定页面进行转换 - LOG_INFO "测试epspdf命令使用-p参数指定页面进行转换" - epspdf -p 1 test.eps test.pdf - CHECK_RESULT $? 0 0 "epspdf命令使用-p参数执行失败" - - # 检查生成的PDF文件是否存在 - LOG_INFO "检查生成的PDF文件是否存在" - if [ -f test.pdf ]; then - LOG_INFO "PDF文件生成成功" - else - LOG_ERROR "PDF文件生成失败" - exit 1 - fi - - # 清理测试文件 - LOG_INFO "清理测试文件" - rm -f test.eps test.pdf - CHECK_RESULT $? 0 0 "清理测试文件失败" - - # 如果之前未安装texlive-epspdf,则在测试结束后卸载 - if [ $already_installed -eq 0 ]; then - LOG_INFO "卸载texlive-epspdf软件包" - dnf remove -y texlive-epspdf - CHECK_RESULT $? 0 0 "卸载texlive-epspdf失败" - fi - - LOG_INFO "测试脚本执行完成" -} - -main "$@" \ No newline at end of file diff --git a/testcases/function_test/pkg_test/texlive-base/texlive-epspdf/test_texlive-epspdf_epspdf_p_b.sh b/testcases/function_test/pkg_test/texlive-base/texlive-epspdf/test_texlive-epspdf_epspdf_p_b.sh deleted file mode 100644 index 8e3079512b6..00000000000 --- a/testcases/function_test/pkg_test/texlive-base/texlive-epspdf/test_texlive-epspdf_epspdf_p_b.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-02-25 -# @License : Mulan PSL v2 -# @Desc : 测试epspdf命令组合使用-p和-b参数 -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - LOG_INFO "开始测试epspdf命令组合使用-p和-b参数" - - # 检查软件包是否在yum源中 - LOG_INFO "检查texlive-epspdf软件包是否在yum源中" - dnf list available texlive-epspdf > /dev/null 2>&1 - CHECK_RESULT $? 0 0 "texlive-epspdf软件包不在yum源中" - if [ $? -ne 0 ]; then - LOG_ERROR "texlive-epspdf软件包不在yum源中" - exit 255 - fi - - # 检查是否已安装 - LOG_INFO "检查texlive-epspdf是否已安装" - if rpm -q texlive-epspdf > /dev/null 2>&1; then - INSTALLED=true - LOG_INFO "texlive-epspdf已安装,测试结束后保持安装状态" - else - INSTALLED=false - LOG_INFO "texlive-epspdf未安装,将在测试前安装并在测试后卸载" - fi - - # 如果未安装,则安装软件包 - if [ "$INSTALLED" = "false" ]; then - LOG_INFO "安装texlive-epspdf软件包" - dnf install -y texlive-epspdf > /dev/null 2>&1 - CHECK_RESULT $? 0 0 "安装texlive-epspdf失败" - fi - - # 检查epspdf命令是否存在 - LOG_INFO "检查epspdf命令是否存在" - command -v epspdf > /dev/null 2>&1 - CHECK_RESULT $? 0 0 "epspdf命令不存在" - - # 测试epspdf命令的-p和-b参数 - LOG_INFO "测试epspdf命令的-p参数" - epspdf --help | grep -q "\-p" - CHECK_RESULT $? 0 0 "epspdf命令不支持-p参数" - - LOG_INFO "测试epspdf命令的-b参数" - epspdf --help | grep -q "\-b" - CHECK_RESULT $? 0 0 "epspdf命令不支持-b参数" - - # 创建测试用的EPS文件 - LOG_INFO "创建测试用的EPS文件" - cat > test.eps << "EOF" - %!PS-Adobe-3.0 EPSF-3.0 - %%BoundingBox: 0 0 100 100 - newpath - 50 50 moveto - 50 0 rlineto - 0 50 rlineto - -50 0 rlineto - closepath - stroke - showpage - EOF - CHECK_RESULT $? 0 0 "创建EPS文件失败" - - # 测试epspdf命令组合使用-p和-b参数 - LOG_INFO "测试epspdf命令组合使用-p和-b参数" - epspdf -p -b test.eps test_output.pdf > /dev/null 2>&1 - CHECK_RESULT $? 0 0 "epspdf命令组合使用-p和-b参数执行失败" - - # 检查生成的PDF文件 - LOG_INFO "检查生成的PDF文件" - if [ -f test_output.pdf ]; then - LOG_INFO "PDF文件生成成功" - file test_output.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.eps test_output.pdf - CHECK_RESULT $? 0 0 "清理测试文件失败" - - # 如果测试前未安装,则卸载软件包 - if [ "$INSTALLED" = "false" ]; then - LOG_INFO "卸载texlive-epspdf软件包" - dnf remove -y texlive-epspdf > /dev/null 2>&1 - CHECK_RESULT $? 0 0 "卸载texlive-epspdf失败" - fi - - LOG_INFO "测试完成" -} - -main "$@" \ No newline at end of file diff --git a/testcases/function_test/pkg_test/texlive-base/texlive-epspdf/test_texlive-epspdf_epspdf_p_g.sh b/testcases/function_test/pkg_test/texlive-base/texlive-epspdf/test_texlive-epspdf_epspdf_p_g.sh deleted file mode 100644 index 3aef7c60a82..00000000000 --- a/testcases/function_test/pkg_test/texlive-base/texlive-epspdf/test_texlive-epspdf_epspdf_p_g.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-02-25 -# @License : Mulan PSL v2 -# @Desc : 测试epspdf命令组合使用-p和-g参数 -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - LOG_INFO "开始测试epspdf命令组合使用-p和-g参数" - LOG_INFO "步骤1:检查系统是否已安装texlive-epspdf软件包" - if rpm -q texlive-epspdf > /dev/null 2>&1; then - LOG_INFO "texlive-epspdf已安装,测试后保持安装状态" - INSTALLED=true - else - LOG_INFO "texlive-epspdf未安装,将在测试中安装并在测试后卸载" - INSTALLED=false - fi - - LOG_INFO "步骤2:检查yum源中是否存在texlive-epspdf软件包" - if ! dnf list available texlive-epspdf > /dev/null 2>&1; then - LOG_ERROR "yum源中未找到texlive-epspdf软件包" - exit 255 - fi - - if [ "$INSTALLED" = "false" ]; then - LOG_INFO "步骤3:安装texlive-epspdf软件包" - dnf install -y texlive-epspdf - CHECK_RESULT $? 0 0 "安装texlive-epspdf失败" - fi - - LOG_INFO "步骤4:检查epspdf命令是否支持-p和-g参数" - if ! epspdf -h 2>&1 | grep -q "\-p\|-g"; then - LOG_ERROR "epspdf命令不支持-p或-g参数" - if [ "$INSTALLED" = "false" ]; then - LOG_INFO "步骤5:卸载texlive-epspdf软件包" - dnf remove -y texlive-epspdf - CHECK_RESULT $? 0 0 "卸载texlive-epspdf失败" - fi - exit 255 - fi - - LOG_INFO "步骤5:创建测试用的EPS文件" - cat > test.eps << EOF - %!PS-Adobe-3.0 EPSF-3.0 - %%BoundingBox: 0 0 100 100 - newpath - 0 0 moveto - 100 100 lineto - stroke - showpage - EOF - CHECK_RESULT $? 0 0 "创建EPS文件失败" - - LOG_INFO "步骤6:使用epspdf命令组合-p和-g参数进行测试" - epspdf -p -g test.eps test_output.pdf - CHECK_RESULT $? 0 0 "epspdf命令执行失败" - - LOG_INFO "步骤7:验证生成的PDF文件" - if [ -f test_output.pdf ]; then - LOG_INFO "PDF文件生成成功" - else - LOG_ERROR "PDF文件未生成" - CHECK_RESULT 1 0 0 "PDF文件生成失败" - fi - - LOG_INFO "步骤8:清理测试文件" - rm -f test.eps test_output.pdf - CHECK_RESULT $? 0 0 "清理测试文件失败" - - if [ "$INSTALLED" = "false" ]; then - LOG_INFO "步骤9:卸载texlive-epspdf软件包" - dnf remove -y texlive-epspdf - CHECK_RESULT $? 0 0 "卸载texlive-epspdf失败" - else - LOG_INFO "步骤9:保持texlive-epspdf软件包安装状态" - fi - - LOG_INFO "测试完成" -} - -main "$@" \ No newline at end of file diff --git a/testcases/function_test/pkg_test/texlive-base/texlive-epspdf/test_texlive-epspdf_epspdf_s.sh b/testcases/function_test/pkg_test/texlive-base/texlive-epspdf/test_texlive-epspdf_epspdf_s.sh deleted file mode 100644 index 5094aff59d6..00000000000 --- a/testcases/function_test/pkg_test/texlive-base/texlive-epspdf/test_texlive-epspdf_epspdf_s.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-25 -# @License : Mulan PSL v2 -# @Desc : 测试epspdf命令使用-s参数将设置保存到配置文件 -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - set -e - - LOG_INFO "检查texlive-epspdf软件包是否在yum源中" - if ! dnf list texlive-epspdf &> /dev/null; then - LOG_ERROR "yum源中未找到texlive-epspdf软件包" - exit 255 - fi - - LOG_INFO "检查epspdf命令-s参数是否支持" - epspdf -h 2>&1 | grep -q "\-s" || { - LOG_ERROR "epspdf命令不支持-s参数" - exit 255 - } - - LOG_INFO "检查texlive-epspdf是否已安装" - if rpm -q texlive-epspdf &> /dev/null; then - LOG_INFO "texlive-epspdf已安装,标记为保持安装状态" - KEEP_INSTALLED=true - else - LOG_INFO "texlive-epspdf未安装,将进行安装和测试后卸载" - KEEP_INSTALLED=false - fi - - if [ "$KEEP_INSTALLED" = "false" ]; then - LOG_INFO "安装texlive-epspdf软件包" - dnf install -y texlive-epspdf - CHECK_RESULT $? 0 0 "安装texlive-epspdf失败" - fi - - LOG_INFO "测试epspdf命令使用-s参数将设置保存到配置文件" - TEST_CONFIG="test_epspdf.cfg" - epspdf -s "$TEST_CONFIG" --help > /dev/null 2>&1 - CHECK_RESULT $? 0 0 "epspdf -s参数执行失败" - - if [ -f "$TEST_CONFIG" ]; then - LOG_INFO "配置文件$TEST_CONFIG已创建,检查内容" - CHECK_RESULT $? 0 0 "配置文件未成功创建" - rm -f "$TEST_CONFIG" - else - LOG_ERROR "配置文件$TEST_CONFIG未创建" - exit 1 - fi - - if [ "$KEEP_INSTALLED" = "false" ]; then - LOG_INFO "卸载texlive-epspdf软件包" - dnf remove -y texlive-epspdf - CHECK_RESULT $? 0 0 "卸载texlive-epspdf失败" - fi - - LOG_INFO "测试完成,环境已恢复" -} - -main "$@" \ No newline at end of file diff --git a/testcases/function_test/pkg_test/texlive-base/texlive-epspdf/test_texlive-epspdf_epspdf_upper_i.sh b/testcases/function_test/pkg_test/texlive-base/texlive-epspdf/test_texlive-epspdf_epspdf_upper_i.sh deleted file mode 100644 index 356cf4f802a..00000000000 --- a/testcases/function_test/pkg_test/texlive-base/texlive-epspdf/test_texlive-epspdf_epspdf_upper_i.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-02-25 -# @License : Mulan PSL v2 -# @Desc : 测试epspdf命令使用-I参数反转-U参数的行为 -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - # 检查环境是否已经安装texlive-epspdf软件包 - LOG_INFO "检查环境是否已安装texlive-epspdf软件包" - rpm -q texlive-epspdf - if [ $? -eq 0 ]; then - LOG_INFO "环境已安装texlive-epspdf,脚本结束后将保持安装状态" - INSTALLED=true - else - LOG_INFO "环境未安装texlive-epspdf,将在测试步骤中安装" - INSTALLED=false - fi - - # 检查yum源中是否有texlive-epspdf软件包 - LOG_INFO "检查yum源中是否有texlive-epspdf软件包" - dnf list available texlive-epspdf - if [ $? -ne 0 ]; then - LOG_ERROR "yum源中未找到texlive-epspdf软件包" - exit 255 - fi - - # 如果未安装,则安装软件包 - if [ "$INSTALLED" = false ]; then - LOG_INFO "安装texlive-epspdf软件包" - dnf install -y texlive-epspdf - CHECK_RESULT $? 0 0 "安装texlive-epspdf失败" - fi - - # 检查epspdf命令是否存在 - LOG_INFO "检查epspdf命令是否存在" - command -v epspdf - CHECK_RESULT $? 0 0 "epspdf命令不存在" - - # 测试epspdf命令的-I参数是否存在 - LOG_INFO "测试epspdf命令的-I参数是否存在" - epspdf -h 2>&1 | grep -q "\-I" - CHECK_RESULT $? 0 0 "epspdf命令不支持-I参数" - - # 测试epspdf命令的-U参数是否存在 - LOG_INFO "测试epspdf命令的-U参数是否存在" - epspdf -h 2>&1 | grep -q "\-U" - CHECK_RESULT $? 0 0 "epspdf命令不支持-U参数" - - # 测试epspdf命令使用-I参数反转-U参数的行为 - LOG_INFO "测试epspdf命令使用-I参数反转-U参数的行为" - # 创建一个简单的测试EPS文件 - cat > test.eps << EOF - %!PS-Adobe-3.0 EPSF-3.0 - %%BoundingBox: 0 0 100 100 - newpath - 0 0 moveto - 100 100 lineto - stroke - showpage - EOF - - # 使用-U参数生成PDF - LOG_INFO "使用-U参数生成PDF" - epspdf -U test.eps test_U.pdf - CHECK_RESULT $? 0 0 "使用-U参数生成PDF失败" - - # 使用-I参数反转-U参数生成PDF - LOG_INFO "使用-I参数反转-U参数生成PDF" - epspdf -I -U test.eps test_I_U.pdf - CHECK_RESULT $? 0 0 "使用-I参数反转-U参数生成PDF失败" - - # 清理测试文件 - LOG_INFO "清理测试文件" - rm -f test.eps test_U.pdf test_I_U.pdf - - # 如果测试前未安装,则卸载软件包 - if [ "$INSTALLED" = false ]; then - LOG_INFO "卸载texlive-epspdf软件包" - dnf remove -y texlive-epspdf - CHECK_RESULT $? 0 0 "卸载texlive-epspdf失败" - fi - - LOG_INFO "测试完成" -} - -main "$@" \ No newline at end of file diff --git a/testcases/function_test/pkg_test/texlive-base/texlive-epspdf/test_texlive-epspdf_epspdf_upper_n.sh b/testcases/function_test/pkg_test/texlive-base/texlive-epspdf/test_texlive-epspdf_epspdf_upper_n.sh deleted file mode 100644 index 83a6b932369..00000000000 --- a/testcases/function_test/pkg_test/texlive-base/texlive-epspdf/test_texlive-epspdf_epspdf_upper_n.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-02-25 -# @License : Mulan PSL v2 -# @Desc : 测试epspdf命令使用-N参数指定PDF版本(如1.5) -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - # 检查是否已安装texlive-epspdf - LOG_INFO "检查是否已安装texlive-epspdf" - if rpm -q texlive-epspdf > /dev/null 2>&1; then - LOG_INFO "texlive-epspdf已安装,脚本结束后将保持安装状态" - INSTALLED=true - else - LOG_INFO "texlive-epspdf未安装,将在测试过程中安装" - INSTALLED=false - fi - - # 检查yum源中是否有texlive-epspdf软件包 - LOG_INFO "检查yum源中是否有texlive-epspdf软件包" - if dnf list texlive-epspdf 2>&1 | grep -q "texlive-epspdf"; then - LOG_INFO "yum源中存在texlive-epspdf软件包" - else - LOG_ERROR "yum源中不存在texlive-epspdf软件包" - exit 255 - fi - - # 如果未安装,则安装texlive-epspdf - if [ "$INSTALLED" = false ]; then - LOG_INFO "安装texlive-epspdf软件包" - dnf install -y texlive-epspdf - CHECK_RESULT $? 0 0 "安装texlive-epspdf失败" - fi - - # 检查epspdf命令是否存在 - LOG_INFO "检查epspdf命令是否存在" - which epspdf > /dev/null 2>&1 - CHECK_RESULT $? 0 0 "epspdf命令不存在" - - # 检查epspdf命令是否支持-N参数 - LOG_INFO "检查epspdf命令是否支持-N参数" - epspdf --help 2>&1 | grep -q "\-N" - if [ $? -ne 0 ]; then - LOG_ERROR "epspdf命令不支持-N参数" - exit 255 - fi - - # 创建测试用的EPS文件 - LOG_INFO "创建测试用的EPS文件" - cat > test.eps << "EOF" - %!PS-Adobe-3.0 EPSF-3.0 - %%BoundingBox: 0 0 100 100 - newpath - 50 50 moveto - 50 70 lineto - 70 50 lineto - closepath - stroke - showpage - EOF - CHECK_RESULT $? 0 0 "创建EPS文件失败" - - # 使用-N参数指定PDF版本为1.5进行转换 - LOG_INFO "使用-N参数指定PDF版本为1.5进行转换" - epspdf -N 1.5 test.eps test.pdf - CHECK_RESULT $? 0 0 "epspdf转换失败" - - # 验证生成的PDF文件 - LOG_INFO "验证生成的PDF文件" - if [ -f test.pdf ]; then - LOG_INFO "PDF文件生成成功" - # 检查PDF版本(可选步骤,依赖于pdftk或类似工具) - # 这里仅检查文件是否存在,实际测试中可根据需要添加版本检查 - else - LOG_ERROR "PDF文件未生成" - exit 1 - fi - - # 清理测试文件 - LOG_INFO "清理测试文件" - rm -f test.eps test.pdf - CHECK_RESULT $? 0 0 "清理测试文件失败" - - # 如果测试前未安装,则卸载texlive-epspdf - if [ "$INSTALLED" = false ]; then - LOG_INFO "卸载texlive-epspdf软件包" - dnf remove -y texlive-epspdf - CHECK_RESULT $? 0 0 "卸载texlive-epspdf失败" - fi - - LOG_INFO "测试完成" -} - -main "$@" \ No newline at end of file diff --git a/testcases/function_test/pkg_test/texlive-base/texlive-epspdf/test_texlive-epspdf_epspdf_upper_t.sh b/testcases/function_test/pkg_test/texlive-base/texlive-epspdf/test_texlive-epspdf_epspdf_upper_t.sh deleted file mode 100644 index 990e7faebec..00000000000 --- a/testcases/function_test/pkg_test/texlive-base/texlive-epspdf/test_texlive-epspdf_epspdf_upper_t.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-02-25 -# @License : Mulan PSL v2 -# @Desc : 测试epspdf命令使用-T参数指定目标输出质量(如screen) -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - LOG_INFO "开始测试epspdf命令使用-T参数指定目标输出质量(如screen)" - - # 检查是否已经安装texlive-epspdf软件包 - LOG_INFO "检查是否已安装texlive-epspdf软件包" - if dnf list installed texlive-epspdf &>/dev/null; then - LOG_INFO "texlive-epspdf已安装,测试后将保持安装状态" - already_installed=true - else - LOG_INFO "texlive-epspdf未安装,将在测试过程中安装" - already_installed=false - fi - - # 检查yum源中是否有texlive-epspdf软件包 - LOG_INFO "检查yum源中是否有texlive-epspdf软件包" - if ! dnf list available texlive-epspdf &>/dev/null; then - LOG_ERROR "yum源中未找到texlive-epspdf软件包" - exit 255 - fi - - # 如果未安装,则安装软件包 - if [ "$already_installed" = false ]; then - LOG_INFO "安装texlive-epspdf软件包" - dnf install -y texlive-epspdf - CHECK_RESULT $? 0 0 "安装texlive-epspdf失败" - fi - - # 检查epspdf命令是否存在 - LOG_INFO "检查epspdf命令是否存在" - if ! command -v epspdf &>/dev/null; then - LOG_ERROR "epspdf命令不存在" - exit 255 - fi - - # 检查epspdf命令是否支持-T参数 - LOG_INFO "检查epspdf命令是否支持-T参数" - if ! epspdf --help 2>&1 | grep -q "\-T"; then - LOG_ERROR "epspdf命令不支持-T参数" - exit 255 - fi - - # 创建一个测试用的EPS文件 - LOG_INFO "创建测试用的EPS文件" - cat > test.eps << "EOF" - %!PS-Adobe-3.0 EPSF-3.0 - %%BoundingBox: 0 0 100 100 - newpath - 50 50 moveto - 50 0 rlineto - 0 50 rlineto - -50 0 rlineto - closepath - stroke - showpage - EOF - CHECK_RESULT $? 0 0 "创建EPS文件失败" - - # 测试epspdf命令使用-T参数指定目标输出质量(如screen) - LOG_INFO "测试epspdf命令使用-T参数指定目标输出质量(如screen)" - epspdf -T screen test.eps test.pdf - CHECK_RESULT $? 0 0 "epspdf命令使用-T参数执行失败" - - # 检查生成的PDF文件是否存在 - LOG_INFO "检查生成的PDF文件是否存在" - if [ -f test.pdf ]; then - LOG_INFO "PDF文件生成成功" - else - LOG_ERROR "PDF文件生成失败" - exit 1 - fi - - # 清理测试文件 - LOG_INFO "清理测试文件" - rm -f test.eps test.pdf - CHECK_RESULT $? 0 0 "清理测试文件失败" - - # 如果之前未安装,则卸载软件包 - if [ "$already_installed" = false ]; then - LOG_INFO "卸载texlive-epspdf软件包" - dnf remove -y texlive-epspdf - CHECK_RESULT $? 0 0 "卸载texlive-epspdf失败" - fi - - LOG_INFO "测试完成" -} - -main "$@" \ No newline at end of file diff --git a/testcases/function_test/pkg_test/texlive-base/texlive-epspdf/test_texlive-epspdf_epspdf_upper_t_upper_n.sh b/testcases/function_test/pkg_test/texlive-base/texlive-epspdf/test_texlive-epspdf_epspdf_upper_t_upper_n.sh deleted file mode 100644 index 77cd1400444..00000000000 --- a/testcases/function_test/pkg_test/texlive-base/texlive-epspdf/test_texlive-epspdf_epspdf_upper_t_upper_n.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-25 -# @License : Mulan PSL v2 -# @Desc : 测试epspdf命令组合使用-T和-N参数 -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - LOG_INFO "开始测试epspdf命令组合使用-T和-N参数" - LOG_INFO "步骤1: 检查环境是否已安装texlive-epspdf包" - rpm -q texlive-epspdf - if [ $? -eq 0 ]; then - LOG_INFO "texlive-epspdf已安装,脚本结束后将保持安装状态" - INSTALLED=true - else - LOG_INFO "texlive-epspdf未安装,将在测试过程中安装" - INSTALLED=false - fi - LOG_INFO "步骤2: 检查yum源中是否有texlive-epspdf包" - dnf list available texlive-epspdf - if [ $? -ne 0 ]; then - LOG_ERROR "yum源中未找到texlive-epspdf包" - exit 255 - fi - if [ "$INSTALLED" = "false" ]; then - LOG_INFO "步骤3: 安装texlive-epspdf包" - dnf install -y texlive-epspdf - CHECK_RESULT $? 0 0 "安装texlive-epspdf失败" - fi - LOG_INFO "步骤4: 检查epspdf命令是否支持-T参数" - epspdf -T --help 2>&1 | grep -q "usage\|Usage" - CHECK_RESULT $? 0 0 "epspdf命令不支持-T参数" - LOG_INFO "步骤5: 检查epspdf命令是否支持-N参数" - epspdf -N --help 2>&1 | grep -q "usage\|Usage" - CHECK_RESULT $? 0 0 "epspdf命令不支持-N参数" - LOG_INFO "步骤6: 创建测试用的EPS文件" - cat > test.eps << EOF - %!PS-Adobe-3.0 EPSF-3.0 - %%BoundingBox: 0 0 100 100 - newpath 50 50 moveto 30 0 360 arc closepath stroke - showpage - EOF - CHECK_RESULT $? 0 0 "创建EPS文件失败" - LOG_INFO "步骤7: 使用epspdf命令组合-T和-N参数转换EPS文件" - epspdf -T -N test.eps test.pdf - CHECK_RESULT $? 0 0 "epspdf命令执行失败" - LOG_INFO "步骤8: 验证生成的PDF文件" - file test.pdf | grep -q "PDF document" - CHECK_RESULT $? 0 0 "未生成有效的PDF文件" - LOG_INFO "步骤9: 清理测试文件" - rm -f test.eps test.pdf - CHECK_RESULT $? 0 0 "清理测试文件失败" - if [ "$INSTALLED" = "false" ]; then - LOG_INFO "步骤10: 卸载texlive-epspdf包" - dnf remove -y texlive-epspdf - CHECK_RESULT $? 0 0 "卸载texlive-epspdf失败" - fi - LOG_INFO "测试完成" -} - -main "$@" \ No newline at end of file diff --git a/testcases/function_test/pkg_test/texlive-base/texlive-epspdf/test_texlive-epspdf_epspdf_upper_u.sh b/testcases/function_test/pkg_test/texlive-base/texlive-epspdf/test_texlive-epspdf_epspdf_upper_u.sh deleted file mode 100644 index 2c5d8aa0d09..00000000000 --- a/testcases/function_test/pkg_test/texlive-base/texlive-epspdf/test_texlive-epspdf_epspdf_upper_u.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-25 -# @License : Mulan PSL v2 -# @Desc : 测试epspdf命令使用-U参数在可用时使用pdftops -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - # 判断是否已安装texlive-epspdf - LOG_INFO "检查是否已安装texlive-epspdf软件包" - rpm -q texlive-epspdf - if [ $? -eq 0 ]; then - LOG_INFO "texlive-epspdf已安装,脚本结束时保持安装状态" - INSTALLED=true - else - LOG_INFO "texlive-epspdf未安装,将在测试过程中安装" - INSTALLED=false - fi - - # 检查yum源中是否有texlive-epspdf软件包 - LOG_INFO "检查yum源中是否有texlive-epspdf软件包" - dnf list available texlive-epspdf - if [ $? -ne 0 ]; then - LOG_ERROR "yum源中未找到texlive-epspdf软件包" - exit 255 - fi - - # 如果未安装,则安装软件包 - if [ "$INSTALLED" = "false" ]; then - LOG_INFO "安装texlive-epspdf软件包" - dnf install -y texlive-epspdf - CHECK_RESULT $? 0 0 "安装texlive-epspdf失败" - fi - - # 检查epspdf命令是否支持-U参数 - LOG_INFO "检查epspdf命令是否支持-U参数" - epspdf --help 2>&1 | grep -q "\-U" - if [ $? -ne 0 ]; then - LOG_ERROR "epspdf命令不支持-U参数" - # 如果之前未安装,需要卸载软件包 - if [ "$INSTALLED" = "false" ]; then - LOG_INFO "卸载texlive-epspdf软件包" - dnf remove -y texlive-epspdf - fi - exit 255 - fi - - # 创建测试用的EPS文件 - LOG_INFO "创建测试用的EPS文件" - cat > test.eps << EOF - %!PS-Adobe-3.0 EPSF-3.0 - %%BoundingBox: 0 0 100 100 - newpath - 0 0 moveto - 100 100 lineto - stroke - showpage - EOF - CHECK_RESULT $? 0 0 "创建EPS文件失败" - - # 测试epspdf命令使用-U参数 - LOG_INFO "测试epspdf命令使用-U参数" - epspdf -U test.eps test.pdf - CHECK_RESULT $? 0 0 "epspdf命令使用-U参数执行失败" - - # 验证生成的PDF文件 - LOG_INFO "验证生成的PDF文件" - if [ -f test.pdf ]; then - LOG_INFO "成功生成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.eps test.pdf - CHECK_RESULT $? 0 0 "清理测试文件失败" - - # 如果测试前未安装,则卸载软件包 - if [ "$INSTALLED" = "false" ]; then - LOG_INFO "卸载texlive-epspdf软件包" - dnf remove -y texlive-epspdf - CHECK_RESULT $? 0 0 "卸载texlive-epspdf失败" - fi - - LOG_INFO "测试完成" -} - -main "$@" \ No newline at end of file diff --git a/testcases/function_test/pkg_test/texlive-base/texlive-epspdf/test_texlive-epspdf_epspdf_upper_u_upper_i.sh b/testcases/function_test/pkg_test/texlive-base/texlive-epspdf/test_texlive-epspdf_epspdf_upper_u_upper_i.sh deleted file mode 100644 index 724f58f8d32..00000000000 --- a/testcases/function_test/pkg_test/texlive-base/texlive-epspdf/test_texlive-epspdf_epspdf_upper_u_upper_i.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-02-25 -# @License : Mulan PSL v2 -# @Desc : 测试epspdf命令组合使用-U和-I参数 -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - LOG_INFO "开始测试epspdf命令组合使用-U和-I参数" - - # 检查环境是否已安装texlive-epspdf软件包 - LOG_INFO "检查texlive-epspdf软件包是否已安装" - if rpm -q texlive-epspdf &>/dev/null; then - LOG_INFO "texlive-epspdf软件包已安装,测试结束后将保持安装状态" - already_installed=1 - else - LOG_INFO "texlive-epspdf软件包未安装,将在测试过程中安装" - already_installed=0 - fi - - # 检查yum源中是否有texlive-epspdf软件包 - LOG_INFO "检查yum源中是否有texlive-epspdf软件包" - if ! dnf list available texlive-epspdf &>/dev/null; then - LOG_ERROR "yum源中未找到texlive-epspdf软件包" - exit 255 - fi - - # 如果未安装,则安装软件包 - if [ $already_installed -eq 0 ]; then - LOG_INFO "安装texlive-epspdf软件包" - dnf install -y texlive-epspdf - CHECK_RESULT $? 0 0 "安装texlive-epspdf软件包失败" - fi - - # 检查epspdf命令是否支持-U和-I参数 - LOG_INFO "检查epspdf命令是否支持-U和-I参数" - if ! epspdf --help 2>&1 | grep -q -- "-U.*-I"; then - LOG_ERROR "epspdf命令不支持-U和-I参数" - exit 255 - fi - - # 创建测试用的EPS文件 - LOG_INFO "创建测试用的EPS文件" - cat > test_input.eps << "EOF" - %!PS-Adobe-3.0 EPSF-3.0 - %%BoundingBox: 0 0 100 100 - %%EndComments - 0 0 moveto - 100 100 lineto - stroke - showpage - EOF - CHECK_RESULT $? 0 0 "创建EPS文件失败" - - # 测试epspdf命令组合使用-U和-I参数 - LOG_INFO "测试epspdf命令组合使用-U和-I参数" - epspdf -U -I test_input.eps test_output.pdf - CHECK_RESULT $? 0 0 "epspdf命令执行失败" - - # 验证生成的PDF文件 - LOG_INFO "验证生成的PDF文件" - if [ -f test_output.pdf ]; then - LOG_INFO "PDF文件生成成功" - file test_output.pdf | grep -q "PDF document" - CHECK_RESULT $? 0 0 "生成的文件不是有效的PDF文档" - else - LOG_ERROR "PDF文件未生成" - exit 1 - fi - - # 清理测试文件 - LOG_INFO "清理测试文件" - rm -f test_input.eps test_output.pdf - CHECK_RESULT $? 0 0 "清理测试文件失败" - - # 如果测试前未安装,则卸载软件包 - if [ $already_installed -eq 0 ]; then - LOG_INFO "卸载texlive-epspdf软件包" - dnf remove -y texlive-epspdf - CHECK_RESULT $? 0 0 "卸载texlive-epspdf软件包失败" - fi - - LOG_INFO "测试完成" -} - -main "$@" \ No newline at end of file diff --git a/testcases/function_test/pkg_test/texlive-base/texlive-epspdf/test_texlive-epspdf_epspdf_v.sh b/testcases/function_test/pkg_test/texlive-base/texlive-epspdf/test_texlive-epspdf_epspdf_v.sh deleted file mode 100644 index 2337b31abe6..00000000000 --- a/testcases/function_test/pkg_test/texlive-base/texlive-epspdf/test_texlive-epspdf_epspdf_v.sh +++ /dev/null @@ -1,72 +0,0 @@ -#!/usr/bin/bash - -# Copyright (c) 2024 ISCAS .ALL rights reserved. -# This program is licensed under Mulan PSL v2. -# You can use it according to the terms and conditions of the Mulan PSL v2. -# http://license.coscl.org.cn/MulanPSL2 -# THIS PROGRAM IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, -# EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, -# MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. -# See the Mulan PSL v2 for more details. - -# ############################################# -# @Author : honghua -# @Contact : honghua@iscas.ac.cn -# @Date : 2026-02-25 -# @License : Mulan PSL v2 -# @Desc : 测试epspdf命令使用-v参数显示版本信息 -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - LOG_INFO "开始测试epspdf命令使用-v参数显示版本信息" - - # 检查是否已安装epspdf - if dnf list installed texlive-epspdf &> /dev/null; then - LOG_INFO "环境已安装texlive-epspdf,测试完成后将保持安装状态" - already_installed=true - else - LOG_INFO "环境未安装texlive-epspdf,将作为测试步骤进行安装" - already_installed=false - fi - - # 检查yum源中是否有texlive-epspdf包 - LOG_INFO "检查yum源中是否存在texlive-epspdf软件包" - if ! dnf list available texlive-epspdf &> /dev/null; then - LOG_ERROR "yum源中未找到texlive-epspdf软件包" - exit 255 - fi - - # 如果未安装,则安装软件包 - if [ "$already_installed" = false ]; then - LOG_INFO "安装texlive-epspdf软件包" - dnf install -y texlive-epspdf - CHECK_RESULT $? 0 0 "安装texlive-epspdf失败" - fi - - # 检查epspdf命令是否存在-v参数 - LOG_INFO "检查epspdf命令是否支持-v参数" - epspdf -v 2>&1 | grep -q "unknown option" && { - LOG_ERROR "epspdf命令不支持-v参数" - exit 255 - } - - # 执行epspdf -v命令显示版本信息 - LOG_INFO "执行epspdf -v命令显示版本信息" - epspdf -v - CHECK_RESULT $? 0 0 "执行epspdf -v命令失败" - - # 环境恢复:如果测试前未安装,则卸载软件包 - if [ "$already_installed" = false ]; then - LOG_INFO "卸载texlive-epspdf软件包" - dnf remove -y texlive-epspdf - CHECK_RESULT $? 0 0 "卸载texlive-epspdf失败" - else - LOG_INFO "测试前已安装texlive-epspdf,保持安装状态" - fi - - LOG_INFO "测试完成" -} - -main "$@" \ No newline at end of file diff --git a/testcases/function_test/pkg_test/texlive-base/texlive-epspdf/test_texlive-epspdf_epspdftk_h.sh b/testcases/function_test/pkg_test/texlive-base/texlive-epspdf/test_texlive-epspdf_epspdftk_h.sh deleted file mode 100644 index ebc070800ab..00000000000 --- a/testcases/function_test/pkg_test/texlive-base/texlive-epspdf/test_texlive-epspdf_epspdftk_h.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-25 -# @License : Mulan PSL v2 -# @Desc : 测试显示帮助信息 -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - # 检查是否已安装texlive-epspdf和epspdftk - LOG_INFO "检查是否已安装texlive-epspdf和epspdftk" - rpm -q texlive-epspdf > /dev/null 2>&1 - texlive_epspdf_installed=$? - rpm -q epspdftk > /dev/null 2>&1 - epspdftk_installed=$? - if [ $texlive_epspdf_installed -eq 0 ] && [ $epspdftk_installed -eq 0 ]; then - LOG_INFO "texlive-epspdf和epspdftk已安装,测试结束后保持安装状态" - INSTALLED=1 - else - LOG_INFO "texlive-epspdf和epspdftk未安装,将在测试中安装,测试结束后卸载" - INSTALLED=0 - fi - - # 检查yum源中是否有texlive-epspdf和epspdftk软件包 - LOG_INFO "检查yum源中是否有texlive-epspdf软件包" - dnf list available texlive-epspdf > /dev/null 2>&1 - CHECK_RESULT $? 0 0 "yum源中未找到texlive-epspdf软件包" - if [ $? -ne 0 ]; then - LOG_ERROR "yum源中未找到texlive-epspdf软件包" - exit 255 - fi - - LOG_INFO "检查yum源中是否有epspdftk软件包" - dnf list available epspdftk > /dev/null 2>&1 - CHECK_RESULT $? 0 0 "yum源中未找到epspdftk软件包" - if [ $? -ne 0 ]; then - LOG_ERROR "yum源中未找到epspdftk软件包" - exit 255 - fi - - # 如果未安装,则安装软件包 - if [ $INSTALLED -eq 0 ]; then - LOG_INFO "安装texlive-epspdf和epspdftk软件包" - dnf install -y texlive-epspdf epspdftk > /dev/null 2>&1 - CHECK_RESULT $? 0 0 "安装texlive-epspdf和epspdftk失败" - fi - - # 测试显示帮助信息 - LOG_INFO "测试显示texlive-epspdf帮助信息" - epspdf --help > /dev/null 2>&1 - CHECK_RESULT $? 0 0 "texlive-epspdf显示帮助信息失败" - - LOG_INFO "测试显示epspdftk帮助信息" - epspdftk --help > /dev/null 2>&1 - CHECK_RESULT $? 0 0 "epspdftk显示帮助信息失败" - - # 环境恢复 - if [ $INSTALLED -eq 0 ]; then - LOG_INFO "卸载texlive-epspdf和epspdftk软件包" - dnf remove -y texlive-epspdf epspdftk > /dev/null 2>&1 - CHECK_RESULT $? 0 0 "卸载texlive-epspdf和epspdftk失败" - else - LOG_INFO "测试开始前已安装texlive-epspdf和epspdftk,测试结束后保持安装状态" - fi - - LOG_INFO "测试完成" -} - -main "$@" \ No newline at end of file diff --git a/testcases/function_test/pkg_test/texlive-base/texlive-epspdf/test_texlive-epspdf_epspdftk_v.sh b/testcases/function_test/pkg_test/texlive-base/texlive-epspdf/test_texlive-epspdf_epspdftk_v.sh deleted file mode 100644 index 3b42335bf1a..00000000000 --- a/testcases/function_test/pkg_test/texlive-base/texlive-epspdf/test_texlive-epspdf_epspdftk_v.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-02-25 -# @License : Mulan PSL v2 -# @Desc : 测试显示版本信息 -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - # 定义变量 - PACKAGE_NAME="texlive-epspdf" - PACKAGE_CMD="epspdf" - PACKAGE_CMD_FULL="/usr/bin/epspdf" - SECONDARY_PACKAGE="texlive-epspdftk" - SECONDARY_CMD="epspdftk" - SECONDARY_CMD_FULL="/usr/bin/epspdftk" - - # 判断软件包是否在yum源中 - LOG_INFO "检查软件包 $PACKAGE_NAME 是否在yum源中" - if ! dnf list available $PACKAGE_NAME &>/dev/null; then - LOG_ERROR "软件包 $PACKAGE_NAME 不在yum源中" - exit 255 - fi - - LOG_INFO "检查软件包 $SECONDARY_PACKAGE 是否在yum源中" - if ! dnf list available $SECONDARY_PACKAGE &>/dev/null; then - LOG_ERROR "软件包 $SECONDARY_PACKAGE 不在yum源中" - exit 255 - fi - - # 检查是否已安装 - LOG_INFO "检查 $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 "检查 $SECONDARY_PACKAGE 是否已安装" - if rpm -q $SECONDARY_PACKAGE &>/dev/null; then - LOG_INFO "$SECONDARY_PACKAGE 已安装" - SECONDARY_ALREADY_INSTALLED=1 - else - LOG_INFO "$SECONDARY_PACKAGE 未安装" - SECONDARY_ALREADY_INSTALLED=0 - fi - - # 如果未安装,则安装软件包 - if [ $ALREADY_INSTALLED -eq 0 ]; then - LOG_INFO "安装 $PACKAGE_NAME" - dnf install -y $PACKAGE_NAME - CHECK_RESULT $? 0 0 "安装 $PACKAGE_NAME 失败" - fi - - if [ $SECONDARY_ALREADY_INSTALLED -eq 0 ]; then - LOG_INFO "安装 $SECONDARY_PACKAGE" - dnf install -y $SECONDARY_PACKAGE - CHECK_RESULT $? 0 0 "安装 $SECONDARY_PACKAGE 失败" - fi - - # 检查命令是否存在 - LOG_INFO "检查命令 $PACKAGE_CMD_FULL 是否存在" - if [ ! -f $PACKAGE_CMD_FULL ]; then - LOG_ERROR "命令 $PACKAGE_CMD_FULL 不存在" - exit 255 - fi - - LOG_INFO "检查命令 $SECONDARY_CMD_FULL 是否存在" - if [ ! -f $SECONDARY_CMD_FULL ]; then - LOG_ERROR "命令 $SECONDARY_CMD_FULL 不存在" - exit 255 - fi - - # 测试显示版本信息 - LOG_INFO "测试 $PACKAGE_CMD 显示版本信息" - $PACKAGE_CMD_FULL --version - CHECK_RESULT $? 0 0 "$PACKAGE_CMD 显示版本信息失败" - - LOG_INFO "测试 $SECONDARY_CMD 显示版本信息" - $SECONDARY_CMD_FULL --version - CHECK_RESULT $? 0 0 "$SECONDARY_CMD 显示版本信息失败" - - # 环境恢复 - if [ $ALREADY_INSTALLED -eq 0 ]; then - LOG_INFO "卸载 $PACKAGE_NAME" - dnf remove -y $PACKAGE_NAME - CHECK_RESULT $? 0 0 "卸载 $PACKAGE_NAME 失败" - fi - - if [ $SECONDARY_ALREADY_INSTALLED -eq 0 ]; then - LOG_INFO "卸载 $SECONDARY_PACKAGE" - dnf remove -y $SECONDARY_PACKAGE - CHECK_RESULT $? 0 0 "卸载 $SECONDARY_PACKAGE 失败" - fi - - LOG_INFO "测试完成" -} - -main "$@" \ No newline at end of file diff --git a/testcases/function_test/pkg_test/texlive-base/texlive-epspdf/test_texlive-epspdf_function_check.sh b/testcases/function_test/pkg_test/texlive-base/texlive-epspdf/test_texlive-epspdf_function_check.sh deleted file mode 100644 index 42df7c63634..00000000000 --- a/testcases/function_test/pkg_test/texlive-base/texlive-epspdf/test_texlive-epspdf_function_check.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-02-25 -# @License : Mulan PSL v2 -# @Desc : 检查epspdf命令是否安装 -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - # 检查epspdf命令是否安装测试脚本 - - LOG_INFO "=== 开始测试epspdf命令功能 ===" - - # 步骤1:检查yum源中是否有texlive-epspdf软件包 - LOG_INFO "步骤1:检查yum源中是否有texlive-epspdf软件包" - dnf list texlive-epspdf 2>/dev/null | grep -q "texlive-epspdf" - if [ $? -ne 0 ]; then - LOG_ERROR "yum源中未找到texlive-epspdf软件包" - exit 255 - fi - LOG_INFO "texlive-epspdf软件包在yum源中存在" - - # 步骤2:检查当前是否已安装texlive-epspdf - LOG_INFO "步骤2:检查当前是否已安装texlive-epspdf" - rpm -q texlive-epspdf >/dev/null 2>&1 - INSTALLED=$? - - # 步骤3:如果未安装,则安装软件包 - if [ $INSTALLED -ne 0 ]; then - LOG_INFO "步骤3:安装texlive-epspdf软件包" - dnf install -y texlive-epspdf - CHECK_RESULT $? 0 0 "安装texlive-epspdf失败" - LOG_INFO "texlive-epspdf安装成功" - else - LOG_INFO "texlive-epspdf已安装,跳过安装步骤" - fi - - # 步骤4:检查epspdf命令是否可用 - LOG_INFO "步骤4:检查epspdf命令是否可用" - which epspdf >/dev/null 2>&1 - if [ $? -ne 0 ]; then - LOG_ERROR "epspdf命令未找到" - # 如果之前是未安装状态,需要卸载 - if [ $INSTALLED -ne 0 ]; then - LOG_INFO "清理环境:卸载texlive-epspdf" - dnf remove -y texlive-epspdf - fi - exit 255 - fi - LOG_INFO "epspdf命令存在" - - # 步骤5:检查epspdf命令的基本参数 - LOG_INFO "步骤5:检查epspdf命令的基本参数" - epspdf --help >/dev/null 2>&1 - CHECK_RESULT $? 0 0 "epspdf命令不支持--help参数" - LOG_INFO "epspdf命令--help参数支持正常" - - # 步骤6:测试epspdf命令的版本参数 - LOG_INFO "步骤6:测试epspdf命令的版本参数" - epspdf --version >/dev/null 2>&1 - CHECK_RESULT $? 0 0 "epspdf命令不支持--version参数" - LOG_INFO "epspdf命令--version参数支持正常" - - # 步骤7:创建一个测试EPS文件 - LOG_INFO "步骤7:创建测试EPS文件用于功能验证" - cat > test.eps << "EOF" - %!PS-Adobe-3.0 EPSF-3.0 - %%BoundingBox: 0 0 100 100 - %%EndComments - newpath - 50 50 20 0 360 arc - stroke - showpage - %%EOF - EOF - CHECK_RESULT $? 0 0 "创建测试EPS文件失败" - - # 步骤8:使用epspdf转换EPS文件为PDF - LOG_INFO "步骤8:使用epspdf转换EPS文件为PDF" - epspdf test.eps test.pdf - CHECK_RESULT $? 0 0 "epspdf转换EPS到PDF失败" - LOG_INFO "epspdf成功将EPS文件转换为PDF" - - # 步骤9:验证生成的PDF文件 - LOG_INFO "步骤9:验证生成的PDF文件" - if [ -f test.pdf ]; then - file test.pdf | grep -q "PDF document" - CHECK_RESULT $? 0 0 "生成的PDF文件格式不正确" - LOG_INFO "生成的PDF文件格式正确" - else - LOG_ERROR "未生成PDF文件" - CHECK_RESULT 1 0 0 "未生成PDF文件" - fi - - # 步骤10:清理测试文件 - LOG_INFO "步骤10:清理测试文件" - rm -f test.eps test.pdf - CHECK_RESULT $? 0 0 "清理测试文件失败" - - # 步骤11:环境恢复 - LOG_INFO "步骤11:环境恢复" - if [ $INSTALLED -ne 0 ]; then - LOG_INFO "卸载测试安装的texlive-epspdf软件包" - dnf remove -y texlive-epspdf - CHECK_RESULT $? 0 0 "卸载texlive-epspdf失败" - LOG_INFO "texlive-epspdf卸载成功,环境已恢复" - else - LOG_INFO "保持原有安装状态,无需卸载" - fi - - LOG_INFO "=== epspdf命令功能测试完成 ===" -} - -main "$@" \ No newline at end of file diff --git a/testcases/function_test/pkg_test/texlive-base/texlive-epspdf/test_texlive-epspdf_function_crop.sh b/testcases/function_test/pkg_test/texlive-base/texlive-epspdf/test_texlive-epspdf_function_crop.sh deleted file mode 100644 index 9d3c00d76a1..00000000000 --- a/testcases/function_test/pkg_test/texlive-base/texlive-epspdf/test_texlive-epspdf_function_crop.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-25 -# @License : Mulan PSL v2 -# @Desc : 测试裁剪边界框功能 -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - # 环境检查:检查是否已安装texlive-epspdf软件包 - LOG_INFO "检查texlive-epspdf是否已安装" - rpm -q texlive-epspdf - if [ $? -eq 0 ]; then - LOG_INFO "texlive-epspdf已安装" - INSTALLED=1 - else - LOG_INFO "texlive-epspdf未安装" - INSTALLED=0 - fi - - # 检查yum源中是否有texlive-epspdf软件包 - LOG_INFO "检查yum源中是否有texlive-epspdf软件包" - dnf list available texlive-epspdf - if [ $? -ne 0 ]; then - LOG_ERROR "yum源中未找到texlive-epspdf软件包" - exit 255 - fi - - # 如果未安装,则安装texlive-epspdf - if [ $INSTALLED -eq 0 ]; then - LOG_INFO "安装texlive-epspdf软件包" - dnf install -y texlive-epspdf - CHECK_RESULT $? 0 0 "安装texlive-epspdf失败" - fi - - # 测试裁剪边界框功能 - LOG_INFO "测试裁剪边界框功能" - # 创建一个示例EPS文件 - cat > test.eps << "EOF" - %!PS-Adobe-3.0 EPSF-3.0 - %%BoundingBox: 0 0 100 100 - %%HiResBoundingBox: 0 0 100 100 - newpath - 0 0 moveto - 100 0 lineto - 100 100 lineto - 0 100 lineto - closepath - stroke - showpage - EOF - - # 使用epspdf命令转换EPS为PDF - LOG_INFO "使用epspdf命令将EPS转换为PDF" - epspdf test.eps test.pdf - CHECK_RESULT $? 0 0 "epspdf转换失败" - - # 检查生成的PDF文件是否存在 - LOG_INFO "检查生成的PDF文件" - if [ -f test.pdf ]; then - LOG_INFO "PDF文件生成成功" - else - LOG_ERROR "PDF文件生成失败" - exit 1 - fi - - # 清理测试文件 - LOG_INFO "清理测试文件" - rm -f test.eps test.pdf - - # 环境恢复:如果测试前未安装,则卸载软件包 - if [ $INSTALLED -eq 0 ]; then - LOG_INFO "卸载texlive-epspdf软件包" - dnf remove -y texlive-epspdf - CHECK_RESULT $? 0 0 "卸载texlive-epspdf失败" - fi - - LOG_INFO "测试完成" -} - -main "$@" \ No newline at end of file diff --git a/testcases/function_test/pkg_test/texlive-base/texlive-epspdf/test_texlive-epspdf_function_eps2pdf.sh b/testcases/function_test/pkg_test/texlive-base/texlive-epspdf/test_texlive-epspdf_function_eps2pdf.sh deleted file mode 100644 index 01742cc0ca0..00000000000 --- a/testcases/function_test/pkg_test/texlive-base/texlive-epspdf/test_texlive-epspdf_function_eps2pdf.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-02-25 -# @License : Mulan PSL v2 -# @Desc : 测试EPS转PDF常用功能 -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - # 测试EPS转PDF常用功能 - LOG_INFO "开始测试EPS转PDF常用功能" - - # 检查epspdf软件包是否在yum源中 - LOG_INFO "检查epspdf软件包是否在yum源中" - dnf list available texlive-epspdf 2>/dev/null | grep -q texlive-epspdf - if [ $? -ne 0 ]; then - LOG_ERROR "yum源中未找到texlive-epspdf软件包" - exit 255 - fi - - # 检查是否已安装epspdf - LOG_INFO "检查是否已安装epspdf软件包" - INSTALLED=false - if rpm -q texlive-epspdf >/dev/null 2>&1; then - LOG_INFO "检测到epspdf已安装" - INSTALLED=true - else - LOG_INFO "epspdf未安装,将进行安装测试" - # 安装epspdf - LOG_INFO "安装epspdf软件包" - dnf install -y texlive-epspdf - CHECK_RESULT $? 0 0 "epspdf软件包安装失败" - fi - - # 检查epspdf命令是否可用 - LOG_INFO "检查epspdf命令是否可用" - which epspdf >/dev/null 2>&1 - CHECK_RESULT $? 0 0 "epspdf命令不存在" - - # 测试epspdf命令参数 - LOG_INFO "测试epspdf命令参数" - epspdf --help >/dev/null 2>&1 - CHECK_RESULT $? 0 0 "epspdf命令不支持--help参数" - - # 创建测试EPS文件 - LOG_INFO "创建测试EPS文件" - cat > test_input.eps << "EOF" - %!PS-Adobe-3.0 EPSF-3.0 - %%BoundingBox: 0 0 100 100 - %%Title: Test EPS File - %%Creator: Test Script - %%CreationDate: 2024 - %%EndComments - 0 0 100 100 rectstroke - showpage - EOF - CHECK_RESULT $? 0 0 "创建测试EPS文件失败" - - # 测试EPS转PDF功能 - LOG_INFO "测试EPS转PDF转换功能" - epspdf test_input.eps test_output.pdf - CHECK_RESULT $? 0 0 "EPS转PDF转换失败" - - # 验证生成的PDF文件 - LOG_INFO "验证生成的PDF文件" - if [ -f test_output.pdf ]; then - file test_output.pdf | grep -q "PDF document" - CHECK_RESULT $? 0 0 "生成的PDF文件格式不正确" - LOG_INFO "PDF文件生成成功" - else - LOG_ERROR "未生成PDF文件" - exit 1 - fi - - # 测试带参数的转换 - LOG_INFO "测试带缩放参数的EPS转PDF" - epspdf --gsopt="-dEPSCrop" test_input.eps test_scaled.pdf - CHECK_RESULT $? 0 0 "带参数的EPS转PDF失败" - - # 清理测试文件 - LOG_INFO "清理测试文件" - rm -f test_input.eps test_output.pdf test_scaled.pdf - CHECK_RESULT $? 0 0 "清理测试文件失败" - - # 环境恢复 - LOG_INFO "开始环境恢复" - if [ "$INSTALLED" = "false" ]; then - LOG_INFO "卸载测试安装的epspdf软件包" - dnf remove -y texlive-epspdf - CHECK_RESULT $? 0 0 "epspdf软件包卸载失败" - LOG_INFO "epspdf软件包已卸载,环境已恢复" - else - LOG_INFO "epspdf软件包原本已安装,保持安装状态" - fi - - LOG_INFO "EPS转PDF功能测试完成" -} - -main "$@" \ No newline at end of file diff --git a/testcases/function_test/pkg_test/texlive-base/texlive-epspdf/test_texlive-epspdf_function_grayscale.sh b/testcases/function_test/pkg_test/texlive-base/texlive-epspdf/test_texlive-epspdf_function_grayscale.sh deleted file mode 100644 index 97d69513e55..00000000000 --- a/testcases/function_test/pkg_test/texlive-base/texlive-epspdf/test_texlive-epspdf_function_grayscale.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-25 -# @License : Mulan PSL v2 -# @Desc : 测试灰度转换功能 -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - # 测试灰度转换功能 - LOG_INFO "开始测试texlive-epspdf的灰度转换功能" - - # 定义软件包名称 - PACKAGE_NAME="texlive-epspdf" - - # 步骤1:检查软件包是否已在yum源中 - LOG_INFO "步骤1:检查软件包是否在yum源中" - dnf list available $PACKAGE_NAME 2>/dev/null | grep -q $PACKAGE_NAME - if [ $? -ne 0 ]; then - LOG_ERROR "软件包 $PACKAGE_NAME 不在yum源中" - exit 255 - fi - LOG_INFO "软件包 $PACKAGE_NAME 在yum源中" - - # 步骤2:检查软件包是否已安装 - LOG_INFO "步骤2:检查软件包是否已安装" - INSTALLED=0 - rpm -q $PACKAGE_NAME >/dev/null 2>&1 - if [ $? -eq 0 ]; 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 "安装软件包失败" - LOG_INFO "软件包安装成功" - fi - - # 步骤4:检查epspdf命令是否存在 - LOG_INFO "步骤4:检查epspdf命令是否存在" - command -v epspdf >/dev/null 2>&1 - CHECK_RESULT $? 0 0 "epspdf命令不存在" - - # 步骤5:检查epspdf是否支持灰度转换参数 - LOG_INFO "步骤5:检查epspdf是否支持灰度转换参数" - epspdf --help 2>&1 | grep -q -i "gray\|grayscale" - if [ $? -ne 0 ]; then - LOG_ERROR "epspdf命令不支持灰度转换参数" - exit 255 - fi - LOG_INFO "epspdf支持灰度转换参数" - - # 步骤6:创建测试EPS文件 - LOG_INFO "步骤6:创建测试EPS文件" - TEST_EPS="test_gray.eps" - cat > $TEST_EPS << "EOF" - %!PS-Adobe-3.0 EPSF-3.0 - %%BoundingBox: 0 0 100 100 - %%Title: Test EPS for Grayscale Conversion - %%Creator: Test Script - %%CreationDate: 2024 - %%EndComments - newpath - 50 50 moveto - 50 0 rlineto - 0 50 rlineto - -50 0 rlineto - closepath - stroke - showpage - %%EOF - EOF - CHECK_RESULT $? 0 0 "创建测试EPS文件失败" - - # 步骤7:测试灰度转换功能 - LOG_INFO "步骤7:执行灰度转换测试" - TEST_PDF="test_gray.pdf" - epspdf --grayscale $TEST_EPS $TEST_PDF 2>&1 - CHECK_RESULT $? 0 0 "灰度转换失败" - - # 步骤8:验证生成的PDF文件 - LOG_INFO "步骤8:验证生成的PDF文件" - if [ -f $TEST_PDF ] && [ -s $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文件生成失败" - exit 1 - fi - - # 步骤9:清理测试文件 - LOG_INFO "步骤9:清理测试文件" - rm -f $TEST_EPS $TEST_PDF - CHECK_RESULT $? 0 0 "清理测试文件失败" - LOG_INFO "测试文件清理完成" - - # 步骤10:如果测试前未安装,则卸载软件包 - if [ $INSTALLED -eq 0 ]; then - LOG_INFO "步骤10:卸载软件包 $PACKAGE_NAME" - dnf remove -y $PACKAGE_NAME - CHECK_RESULT $? 0 0 "卸载软件包失败" - LOG_INFO "软件包卸载完成" - else - LOG_INFO "步骤10:保持软件包安装状态" - fi - - # 步骤11:最终验证 - LOG_INFO "步骤11:最终环境验证" - if [ $INSTALLED -eq 1 ]; then - rpm -q $PACKAGE_NAME >/dev/null 2>&1 - CHECK_RESULT $? 0 0 "软件包状态异常" - LOG_INFO "软件包保持安装状态,符合预期" - else - rpm -q $PACKAGE_NAME >/dev/null 2>&1 - if [ $? -eq 0 ]; then - LOG_ERROR "软件包未正确卸载" - exit 1 - fi - LOG_INFO "软件包已卸载,环境恢复完成" - fi - - LOG_INFO "灰度转换功能测试完成" -} - -main "$@" \ No newline at end of file diff --git a/testcases/function_test/pkg_test/texlive-base/texlive-epspdf/test_texlive-epspdf_function_install.sh b/testcases/function_test/pkg_test/texlive-base/texlive-epspdf/test_texlive-epspdf_function_install.sh deleted file mode 100644 index 2de45490c29..00000000000 --- a/testcases/function_test/pkg_test/texlive-base/texlive-epspdf/test_texlive-epspdf_function_install.sh +++ /dev/null @@ -1,77 +0,0 @@ -#!/usr/bin/bash - -# Copyright (c) 2024 ISCAS .ALL rights reserved. -# This program is licensed under Mulan PSL v2. -# You can use it according to the terms and conditions of the Mulan PSL v2. -# http://license.coscl.org.cn/MulanPSL2 -# THIS PROGRAM IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, -# EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, -# MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. -# See the Mulan PSL v2 for more details. - -# ############################################# -# @Author : honghua -# @Contact : honghua@iscas.ac.cn -# @Date : 2026-02-25 -# @License : Mulan PSL v2 -# @Desc : 测试软件包安装功能 -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - LOG_INFO "开始测试软件包安装功能" - - # 检查环境是否已安装texlive-epspdf - LOG_INFO "步骤1:检查texlive-epspdf是否已安装" - if dnf list installed texlive-epspdf &>/dev/null; then - LOG_INFO "texlive-epspdf已安装,测试将保持安装状态" - INSTALLED_BEFORE=true - else - LOG_INFO "texlive-epspdf未安装,将进行安装测试" - INSTALLED_BEFORE=false - fi - - # 检查yum源中是否有texlive-epspdf软件包 - LOG_INFO "步骤2:检查yum源中是否存在texlive-epspdf软件包" - if ! dnf list available texlive-epspdf &>/dev/null; then - LOG_ERROR "yum源中未找到texlive-epspdf软件包" - exit 255 - fi - - # 如果未安装,则安装软件包 - if [ "$INSTALLED_BEFORE" = false ]; then - LOG_INFO "步骤3:安装texlive-epspdf软件包" - dnf install -y texlive-epspdf - CHECK_RESULT $? 0 0 "安装texlive-epspdf失败" - fi - - # 验证软件包安装成功 - LOG_INFO "步骤4:验证texlive-epspdf安装成功" - dnf list installed texlive-epspdf &>/dev/null - CHECK_RESULT $? 0 0 "texlive-epspdf未正确安装" - - # 测试软件包功能(这里以查询版本为例,实际命令根据软件包调整) - LOG_INFO "步骤5:测试texlive-epspdf功能" - if command -v epspdf &>/dev/null; then - epspdf --help &>/dev/null - CHECK_RESULT $? 0 0 "epspdf命令执行失败" - else - LOG_ERROR "未找到epspdf命令" - exit 255 - fi - - # 环境恢复:如果之前未安装,则卸载软件包 - if [ "$INSTALLED_BEFORE" = false ]; then - LOG_INFO "步骤6:清理测试环境,卸载texlive-epspdf" - dnf remove -y texlive-epspdf - CHECK_RESULT $? 0 0 "卸载texlive-epspdf失败" - LOG_INFO "环境已恢复,texlive-epspdf已卸载" - else - LOG_INFO "环境保持原状,texlive-epspdf保持安装" - fi - - LOG_INFO "测试软件包安装功能完成" -} - -main "$@" \ No newline at end of file diff --git a/testcases/function_test/pkg_test/texlive-base/texlive-epspdf/test_texlive-epspdf_function_pdf2eps.sh b/testcases/function_test/pkg_test/texlive-base/texlive-epspdf/test_texlive-epspdf_function_pdf2eps.sh deleted file mode 100644 index ab391d891bc..00000000000 --- a/testcases/function_test/pkg_test/texlive-base/texlive-epspdf/test_texlive-epspdf_function_pdf2eps.sh +++ /dev/null @@ -1,170 +0,0 @@ -#!/usr/bin/bash - -# Copyright (c) 2024 ISCAS .ALL rights reserved. -# This program is licensed under Mulan PSL v2. -# You can use it according to the terms and conditions of the Mulan PSL v2. -# http://license.coscl.org.cn/MulanPSL2 -# THIS PROGRAM IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, -# EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, -# 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-25 -# @License : Mulan PSL v2 -# @Desc : 测试PDF转EPS常用功能 -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - # 检查是否已安装texlive-epspdf软件包 - LOG_INFO "检查是否已安装texlive-epspdf软件包" - rpm -q texlive-epspdf - if [ $? -eq 0 ]; then - LOG_INFO "texlive-epspdf已安装,测试结束后保持安装状态" - INSTALLED="true" - else - LOG_INFO "texlive-epspdf未安装,将在测试过程中安装" - INSTALLED="false" - fi - - # 检查yum源中是否有texlive-epspdf软件包 - LOG_INFO "检查yum源中是否有texlive-epspdf软件包" - dnf list available texlive-epspdf - if [ $? -ne 0 ]; then - LOG_ERROR "yum源中未找到texlive-epspdf软件包" - exit 255 - fi - - # 如果未安装,则安装软件包 - if [ "$INSTALLED" = "false" ]; then - LOG_INFO "安装texlive-epspdf软件包" - dnf install -y texlive-epspdf - CHECK_RESULT $? 0 0 "安装texlive-epspdf失败" - fi - - # 测试PDF转EPS功能 - LOG_INFO "测试PDF转EPS功能" - - # 创建一个简单的PDF文件用于测试 - LOG_INFO "创建测试PDF文件" - cat > test_input.pdf << EOF - %PDF-1.4 - 1 0 obj - << - /Type /Catalog - /Pages 2 0 R - >> - endobj - 2 0 obj - << - /Type /Pages - /Kids [3 0 R] - /Count 1 - >> - endobj - 3 0 obj - << - /Type /Page - /Parent 2 0 R - /MediaBox [0 0 100 100] - /Contents 4 0 R - >> - endobj - 4 0 obj - << - /Length 44 - >> - stream - BT - /F1 12 Tf - 50 50 Td - (Test) Tj - ET - endstream - endobj - xref - 0 5 - 0000000000 65535 f - 0000000010 00000 n - 0000000053 00000 n - 0000000106 00000 n - 0000000176 00000 n - trailer - << - /Size 5 - /Root 1 0 R - >> - startxref - 261 - %%EOF - EOF - - CHECK_RESULT $? 0 0 "创建测试PDF文件失败" - - # 检查pdf2ps命令是否存在 - LOG_INFO "检查pdf2ps命令是否存在" - which pdf2ps - if [ $? -ne 0 ]; then - LOG_ERROR "pdf2ps命令不存在" - # 清理测试文件 - rm -f test_input.pdf - # 如果测试过程中安装了软件包,则卸载 - if [ "$INSTALLED" = "false" ]; then - LOG_INFO "卸载texlive-epspdf软件包" - dnf remove -y texlive-epspdf - fi - exit 255 - fi - - # 执行PDF转EPS转换 - LOG_INFO "执行PDF转EPS转换" - pdf2ps test_input.pdf test_output.eps - CHECK_RESULT $? 0 0 "PDF转EPS转换失败" - - # 检查生成的EPS文件 - LOG_INFO "检查生成的EPS文件" - if [ -f "test_output.eps" ]; then - LOG_INFO "EPS文件生成成功" - # 检查EPS文件内容 - head -5 test_output.eps | grep -q "%!PS-Adobe" - CHECK_RESULT $? 0 0 "生成的EPS文件格式不正确" - else - LOG_ERROR "EPS文件未生成" - CHECK_RESULT 1 0 0 "EPS文件未生成" - fi - - # 测试pdf2ps命令的参数 - LOG_INFO "测试pdf2ps命令的参数支持情况" - pdf2ps --help 2>&1 | grep -q "Usage:" - if [ $? -ne 0 ]; then - LOG_ERROR "pdf2ps命令不支持--help参数" - # 清理测试文件 - rm -f test_input.pdf test_output.eps - # 如果测试过程中安装了软件包,则卸载 - if [ "$INSTALLED" = "false" ]; then - LOG_INFO "卸载texlive-epspdf软件包" - dnf remove -y texlive-epspdf - fi - exit 255 - fi - - # 清理测试文件 - LOG_INFO "清理测试文件" - rm -f test_input.pdf test_output.eps - CHECK_RESULT $? 0 0 "清理测试文件失败" - - # 如果测试过程中安装了软件包,则卸载 - if [ "$INSTALLED" = "false" ]; then - LOG_INFO "卸载texlive-epspdf软件包" - dnf remove -y texlive-epspdf - CHECK_RESULT $? 0 0 "卸载texlive-epspdf失败" - fi - - LOG_INFO "PDF转EPS功能测试完成" -} - -main "$@" \ No newline at end of file diff --git a/testcases/function_test/pkg_test/texlive-base/texlive-epspdf/test_texlive-epspdf_function_ps2pdf.sh b/testcases/function_test/pkg_test/texlive-base/texlive-epspdf/test_texlive-epspdf_function_ps2pdf.sh deleted file mode 100644 index a3629b43025..00000000000 --- a/testcases/function_test/pkg_test/texlive-base/texlive-epspdf/test_texlive-epspdf_function_ps2pdf.sh +++ /dev/null @@ -1,110 +0,0 @@ -#!/usr/bin/bash - -# Copyright (c) 2024 ISCAS .ALL rights reserved. -# This program is licensed under Mulan PSL v2. -# You can use it according to the terms and conditions of the Mulan PSL v2. -# http://license.coscl.org.cn/MulanPSL2 -# THIS PROGRAM IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, -# EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, -# 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-25 -# @License : Mulan PSL v2 -# @Desc : 测试PS转PDF常用功能 -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - LOG_INFO "开始测试PS转PDF常用功能" - LOG_INFO "检查系统是否已安装texlive-epspdf软件包" - - # 检查是否已安装texlive-epspdf - if rpm -q texlive-epspdf &> /dev/null; then - LOG_INFO "texlive-epspdf已安装,标记为已安装状态" - installed_flag=1 - else - LOG_INFO "texlive-epspdf未安装,标记为未安装状态" - installed_flag=0 - fi - - # 检查yum源中是否有texlive-epspdf软件包 - LOG_INFO "检查yum源中是否有texlive-epspdf软件包" - dnf list available texlive-epspdf &> /dev/null - if [ $? -ne 0 ]; then - LOG_ERROR "yum源中未找到texlive-epspdf软件包" - exit 255 - fi - - # 如果未安装,则安装texlive-epspdf - if [ $installed_flag -eq 0 ]; then - LOG_INFO "开始安装texlive-epspdf软件包" - dnf install -y texlive-epspdf - CHECK_RESULT $? 0 0 "安装texlive-epspdf失败" - LOG_INFO "texlive-epspdf安装成功" - fi - - # 测试ps2pdf命令是否存在 - LOG_INFO "检查ps2pdf命令是否存在" - command -v ps2pdf &> /dev/null - if [ $? -ne 0 ]; then - LOG_ERROR "ps2pdf命令不存在" - exit 255 - fi - - # 检查ps2pdf命令支持的参数 - LOG_INFO "检查ps2pdf命令支持的参数" - ps2pdf --help &> /dev/null - if [ $? -ne 0 ]; then - LOG_ERROR "ps2pdf命令不支持--help参数" - exit 255 - fi - - # 创建一个简单的PS文件用于测试 - LOG_INFO "创建测试用的PS文件" - cat > test.ps << EOF - %!PS - /Courier findfont 12 scalefont setfont - 100 100 moveto - (Hello, World!) show - showpage - EOF - CHECK_RESULT $? 0 0 "创建PS文件失败" - - # 使用ps2pdf将PS文件转换为PDF - LOG_INFO "使用ps2pdf将PS文件转换为PDF" - ps2pdf test.ps test.pdf - CHECK_RESULT $? 0 0 "ps2pdf转换失败" - - # 检查生成的PDF文件是否存在 - LOG_INFO "检查生成的PDF文件是否存在" - if [ -f test.pdf ]; then - LOG_INFO "PDF文件生成成功" - else - LOG_ERROR "PDF文件生成失败" - exit 1 - fi - - # 清理测试文件 - LOG_INFO "清理测试文件" - rm -f test.ps test.pdf - CHECK_RESULT $? 0 0 "清理测试文件失败" - - # 如果之前未安装,则卸载texlive-epspdf - if [ $installed_flag -eq 0 ]; then - LOG_INFO "卸载texlive-epspdf软件包" - dnf remove -y texlive-epspdf - CHECK_RESULT $? 0 0 "卸载texlive-epspdf失败" - LOG_INFO "texlive-epspdf卸载成功" - else - LOG_INFO "保持texlive-epspdf安装状态" - fi - - LOG_INFO "PS转PDF常用功能测试完成" -} - -main "$@" \ No newline at end of file diff --git a/testcases/function_test/pkg_test/texlive-base/texlive-epspdf/test_texlive-epspdf_function_quality.sh b/testcases/function_test/pkg_test/texlive-base/texlive-epspdf/test_texlive-epspdf_function_quality.sh deleted file mode 100644 index bd0b8c61e26..00000000000 --- a/testcases/function_test/pkg_test/texlive-base/texlive-epspdf/test_texlive-epspdf_function_quality.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-02-25 -# @License : Mulan PSL v2 -# @Desc : 测试指定输出质量 -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - set -e - - LOG_INFO "1. 检查yum源中是否存在texlive-epspdf软件包" - if ! dnf list available texlive-epspdf &>/dev/null; then - LOG_ERROR "yum源中未找到texlive-epspdf软件包" - exit 255 - fi - - LOG_INFO "2. 检查当前环境是否已安装texlive-epspdf" - if rpm -q texlive-epspdf &>/dev/null; then - LOG_INFO "texlive-epspdf已安装,测试结束后将保持安装状态" - INSTALLED_BEFORE_TEST=true - else - LOG_INFO "texlive-epspdf未安装,将在测试步骤中安装,测试结束后卸载" - INSTALLED_BEFORE_TEST=false - fi - - LOG_INFO "3. 测试指定输出质量参数" - if ! epstopdf --help 2>&1 | grep -q "\-\-quality"; then - LOG_ERROR "epstopdf命令不支持--quality参数" - exit 255 - fi - - if [ "$INSTALLED_BEFORE_TEST" = false ]; then - LOG_INFO "4. 安装texlive-epspdf软件包" - dnf install -y texlive-epspdf - CHECK_RESULT $? 0 0 "安装texlive-epspdf失败" - fi - - LOG_INFO "5. 创建测试用的EPS文件" - cat > test_input.eps << "EOF" - %!PS-Adobe-3.0 EPSF-3.0 - %%BoundingBox: 0 0 100 100 - %%Title: Test EPS - %%Creator: Test Script - %%CreationDate: 2024 - %%EndComments - 0 0 100 100 rectstroke - showpage - EOF - CHECK_RESULT $? 0 0 "创建测试EPS文件失败" - - LOG_INFO "6. 使用--quality参数执行epstopdf命令" - epstopdf --quality=95 test_input.eps --outfile=test_output.pdf - CHECK_RESULT $? 0 0 "使用--quality参数执行epstopdf命令失败" - - LOG_INFO "7. 检查生成的PDF文件" - if [ -f test_output.pdf ]; then - LOG_INFO "PDF文件生成成功" - file test_output.pdf | grep -q "PDF document" - CHECK_RESULT $? 0 0 "生成的PDF文件格式不正确" - else - LOG_ERROR "未生成PDF文件" - exit 1 - fi - - LOG_INFO "8. 清理测试文件" - rm -f test_input.eps test_output.pdf - CHECK_RESULT $? 0 0 "清理测试文件失败" - - if [ "$INSTALLED_BEFORE_TEST" = false ]; then - LOG_INFO "9. 卸载测试安装的texlive-epspdf软件包" - dnf remove -y texlive-epspdf - CHECK_RESULT $? 0 0 "卸载texlive-epspdf失败" - fi - - LOG_INFO "测试完成" -} - -main "$@" \ No newline at end of file diff --git a/testcases/function_test/pkg_test/texlive-base/texlive-epspdf/test_texlive-epspdf_function_uninstall.sh b/testcases/function_test/pkg_test/texlive-base/texlive-epspdf/test_texlive-epspdf_function_uninstall.sh deleted file mode 100644 index 4cd37f31d37..00000000000 --- a/testcases/function_test/pkg_test/texlive-base/texlive-epspdf/test_texlive-epspdf_function_uninstall.sh +++ /dev/null @@ -1,61 +0,0 @@ -#!/usr/bin/bash - -# Copyright (c) 2024 ISCAS .ALL rights reserved. -# This program is licensed under Mulan PSL v2. -# You can use it according to the terms and conditions of the Mulan PSL v2. -# http://license.coscl.org.cn/MulanPSL2 -# THIS PROGRAM IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, -# EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, -# MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. -# See the Mulan PSL v2 for more details. - -# ############################################# -# @Author : honghua -# @Contact : honghua@iscas.ac.cn -# @Date : 2025-10-06 -# @License : Mulan PSL v2 -# @Desc : Test package uninstallation -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - # 检查是否已安装texlive-epspdf - LOG_INFO "检查是否已安装texlive-epspdf" - rpm -q texlive-epspdf > /dev/null 2>&1 - if [ $? -eq 0 ]; then - LOG_INFO "texlive-epspdf已安装,脚本结束时保持安装状态" - installed=true - else - LOG_INFO "texlive-epspdf未安装,将在测试结束后卸载" - installed=false - fi - - # 检查yum源中是否有texlive-epspdf软件包 - LOG_INFO "检查yum源中是否有texlive-epspdf软件包" - dnf list available texlive-epspdf > /dev/null 2>&1 - CHECK_RESULT $? 0 255 "yum源中不存在texlive-epspdf软件包" - - # 安装texlive-epspdf - if [ "$installed" = false ]; then - LOG_INFO "安装texlive-epspdf" - dnf install -y texlive-epspdf > /dev/null 2>&1 - CHECK_RESULT $? 0 0 "安装texlive-epspdf失败" - fi - - # 测试卸载功能 - LOG_INFO "测试卸载texlive-epspdf" - dnf remove -y texlive-epspdf > /dev/null 2>&1 - CHECK_RESULT $? 0 0 "卸载texlive-epspdf失败" - - # 重新安装以恢复环境 - if [ "$installed" = true ]; then - LOG_INFO "重新安装texlive-epspdf以恢复环境" - dnf install -y texlive-epspdf > /dev/null 2>&1 - CHECK_RESULT $? 0 0 "重新安装texlive-epspdf失败" - fi - - LOG_INFO "测试完成,环境已恢复" -} - -main "$@" \ No newline at end of file diff --git a/testcases/function_test/pkg_test/texlive-base/texlive-tex4ht/test_texlive-tex4ht_function_basic_usage.sh b/testcases/function_test/pkg_test/texlive-base/texlive-tex4ht/test_texlive-tex4ht_function_basic_usage.sh deleted file mode 100644 index 071d8652102..00000000000 --- a/testcases/function_test/pkg_test/texlive-base/texlive-tex4ht/test_texlive-tex4ht_function_basic_usage.sh +++ /dev/null @@ -1,91 +0,0 @@ -#!/usr/bin/bash - -# Copyright (c) 2024 ISCAS .ALL rights reserved. -# This program is licensed under Mulan PSL v2. -# You can use it according to the terms and conditions of the Mulan PSL v2. -# http://license.coscl.org.cn/MulanPSL2 -# THIS PROGRAM IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, -# EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, -# MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. -# See the Mulan PSL v2 for more details. - -# ############################################# -# @Author : honghua -# @Contact : honghua@iscas.ac.cn -# @Date : 2026-03-02 -# @License : Mulan PSL v2 -# @Desc : 测试使用 htlatex 转换基本 LaTeX 文件为 HTML -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - # 测试脚本:测试使用 htlatex 转换基本 LaTeX 文件为 HTML - - # 步骤1:检查是否已安装texlive-tex4ht软件包 - LOG_INFO "检查是否已安装texlive-tex4ht软件包" - rpm -q texlive-tex4ht - if [ $? -eq 0 ]; then - LOG_INFO "texlive-tex4ht已安装,脚本结束时将保持安装状态" - INSTALLED=true - else - LOG_INFO "texlive-tex4ht未安装,将在测试步骤中安装" - INSTALLED=false - fi - - # 步骤2:检查yum源中是否有texlive-tex4ht软件包 - LOG_INFO "检查yum源中是否有texlive-tex4ht软件包" - dnf list available texlive-tex4ht > /dev/null 2>&1 - if [ $? -ne 0 ]; then - LOG_ERROR "yum源中未找到texlive-tex4ht软件包" - exit 255 - fi - - # 步骤3:如果未安装,则安装texlive-tex4ht - if [ "$INSTALLED" = false ]; then - LOG_INFO "安装texlive-tex4ht软件包" - dnf install -y texlive-tex4ht - CHECK_RESULT $? 0 0 "安装texlive-tex4ht失败" - fi - - # 步骤4:创建测试用的基本LaTeX文件 - LOG_INFO "创建测试用的基本LaTeX文件" - cat > test.tex << "EOF" - \documentclass{article} - \begin{document} - Hello, World! - \end{document} - EOF - CHECK_RESULT $? 0 0 "创建LaTeX文件失败" - - # 步骤5:使用htlatex命令将LaTeX文件转换为HTML - LOG_INFO "使用htlatex命令将LaTeX文件转换为HTML" - htlatex test.tex - CHECK_RESULT $? 0 0 "htlatex转换失败" - - # 步骤6:检查生成的HTML文件是否存在 - LOG_INFO "检查生成的HTML文件是否存在" - ls test.html > /dev/null 2>&1 - CHECK_RESULT $? 0 0 "未找到生成的HTML文件" - - # 步骤7:验证HTML文件内容 - LOG_INFO "验证HTML文件内容" - grep -q "Hello, World!" test.html - CHECK_RESULT $? 0 0 "HTML文件内容不符合预期" - - # 步骤8:清理测试文件 - LOG_INFO "清理测试文件" - rm -f test.tex test.html test.css test*.png test*.idv test*.lg test*.log test*.aux test*.dvi test*.4ct test*.4tc test*.tmp - CHECK_RESULT $? 0 0 "清理测试文件失败" - - # 步骤9:如果脚本开始时未安装,则卸载texlive-tex4ht - if [ "$INSTALLED" = false ]; then - LOG_INFO "卸载texlive-tex4ht软件包" - dnf remove -y texlive-tex4ht - CHECK_RESULT $? 0 0 "卸载texlive-tex4ht失败" - fi - - LOG_INFO "测试完成" -} - -main "$@" \ No newline at end of file diff --git a/testcases/function_test/pkg_test/texlive-base/texlive-tex4ht/test_texlive-tex4ht_function_batch_convert.sh b/testcases/function_test/pkg_test/texlive-base/texlive-tex4ht/test_texlive-tex4ht_function_batch_convert.sh deleted file mode 100644 index 45b8e2c368a..00000000000 --- a/testcases/function_test/pkg_test/texlive-base/texlive-tex4ht/test_texlive-tex4ht_function_batch_convert.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-02 -# @License : Mulan PSL v2 -# @Desc : 测试批量转换多个 LaTeX 文件为 HTML -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - set -e - - LOG_INFO "开始测试texlive-tex4ht批量转换功能" - - LOG_INFO "步骤1:检查texlive-tex4ht软件包是否在yum源中" - if ! dnf list available texlive-tex4ht 2>/dev/null | grep -q texlive-tex4ht; then - LOG_ERROR "texlive-tex4ht软件包不在yum源中" - exit 255 - fi - - LOG_INFO "步骤2:检查系统是否已安装texlive-tex4ht" - if rpm -q texlive-tex4ht >/dev/null 2>&1; then - LOG_INFO "texlive-tex4ht已安装,标记为保持安装状态" - KEEP_INSTALLED=1 - else - LOG_INFO "texlive-tex4ht未安装,标记为需要清理安装" - KEEP_INSTALLED=0 - LOG_INFO "步骤3:安装texlive-tex4ht软件包" - dnf install -y texlive-tex4ht - CHECK_RESULT $? 0 0 "安装texlive-tex4ht失败" - fi - - LOG_INFO "步骤4:检查htlatex命令是否可用" - which htlatex - CHECK_RESULT $? 0 0 "htlatex命令不存在" - - LOG_INFO "步骤5:检查htlatex命令是否支持-batch参数" - htlatex --help 2>&1 | grep -q batch || { - LOG_ERROR "htlatex命令不支持batch参数" - exit 255 - } - - LOG_INFO "步骤6:创建测试用的LaTeX文件" - TEST_DIR=$(mktemp -d) - cd $TEST_DIR - - cat > test1.tex << "EOF" - \documentclass{article} - \begin{document} - Test document 1 - \end{document} - EOF - - cat > test2.tex << "EOF" - \documentclass{article} - \begin{document} - Test document 2 - \end{document} - EOF - - LOG_INFO "步骤7:使用htlatex批量转换LaTeX文件为HTML" - htlatex test1.tex "xhtml,mathml" "" "" "-interaction=batchmode" - CHECK_RESULT $? 0 0 "转换test1.tex失败" - - htlatex test2.tex "xhtml,mathml" "" "" "-interaction=batchmode" - CHECK_RESULT $? 0 0 "转换test2.tex失败" - - LOG_INFO "步骤8:检查生成的HTML文件" - ls -la test1.html test2.html - CHECK_RESULT $? 0 0 "HTML文件生成失败" - - LOG_INFO "步骤9:清理测试文件" - cd / - rm -rf $TEST_DIR - - LOG_INFO "步骤10:环境恢复" - if [ $KEEP_INSTALLED -eq 0 ]; then - LOG_INFO "卸载texlive-tex4ht软件包" - dnf remove -y texlive-tex4ht - CHECK_RESULT $? 0 0 "卸载texlive-tex4ht失败" - else - LOG_INFO "保持texlive-tex4ht安装状态" - fi - - LOG_INFO "texlive-tex4ht批量转换功能测试完成" -} - -main "$@" \ No newline at end of file diff --git a/testcases/function_test/pkg_test/texlive-base/texlive-tex4ht/test_texlive-tex4ht_function_check.sh b/testcases/function_test/pkg_test/texlive-base/texlive-tex4ht/test_texlive-tex4ht_function_check.sh deleted file mode 100644 index 182705d1a95..00000000000 --- a/testcases/function_test/pkg_test/texlive-base/texlive-tex4ht/test_texlive-tex4ht_function_check.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-02 -# @License : Mulan PSL v2 -# @Desc : 检查 texlive-tex4ht 软件包是否已安装 -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - # 检查 texlive-tex4ht 软件包是否已安装 - LOG_INFO "开始测试 texlive-tex4ht 软件包功能检查" - - # 检查是否已安装 texlive-tex4ht - LOG_INFO "检查 texlive-tex4ht 软件包是否已安装" - rpm -q texlive-tex4ht > /dev/null 2>&1 - is_installed=$? - - # 记录初始安装状态 - if [ $is_installed -eq 0 ]; then - LOG_INFO "检测到 texlive-tex4ht 软件包已安装" - initial_installed=true - else - LOG_INFO "检测到 texlive-tex4ht 软件包未安装" - initial_installed=false - fi - - # 检查 yum 源中是否有 texlive-tex4ht 软件包 - LOG_INFO "检查 yum 源中是否有 texlive-tex4ht 软件包" - dnf list available texlive-tex4ht > /dev/null 2>&1 - CHECK_RESULT $? 0 0 "yum 源中未找到 texlive-tex4ht 软件包" - - # 如果未安装,则安装软件包作为测试步骤 - if [ "$initial_installed" = false ]; then - LOG_INFO "开始安装 texlive-tex4ht 软件包" - dnf install -y texlive-tex4ht - CHECK_RESULT $? 0 0 "安装 texlive-tex4ht 软件包失败" - LOG_INFO "texlive-tex4ht 软件包安装成功" - fi - - # 检查 tex4ht 命令是否存在 - LOG_INFO "检查 tex4ht 命令是否存在" - command -v tex4ht > /dev/null 2>&1 - CHECK_RESULT $? 0 0 "tex4ht 命令不存在" - - # 测试 tex4ht 命令的基本功能 - LOG_INFO "测试 tex4ht 命令的基本功能" - tex4ht --version > /dev/null 2>&1 - CHECK_RESULT $? 0 0 "tex4ht 命令执行失败" - - # 测试 htlatex 命令是否存在 - LOG_INFO "检查 htlatex 命令是否存在" - command -v htlatex > /dev/null 2>&1 - CHECK_RESULT $? 0 0 "htlatex 命令不存在" - - # 测试 htlatex 命令的基本功能 - LOG_INFO "测试 htlatex 命令的基本功能" - htlatex --version > /dev/null 2>&1 - CHECK_RESULT $? 0 0 "htlatex 命令执行失败" - - # 如果初始状态未安装,则清理环境 - if [ "$initial_installed" = false ]; then - LOG_INFO "清理环境:卸载 texlive-tex4ht 软件包" - dnf remove -y texlive-tex4ht - CHECK_RESULT $? 0 0 "卸载 texlive-tex4ht 软件包失败" - LOG_INFO "texlive-tex4ht 软件包卸载成功" - fi - - LOG_INFO "测试完成,环境已恢复" -} - -main "$@" \ No newline at end of file diff --git a/testcases/function_test/pkg_test/texlive-base/texlive-tex4ht/test_texlive-tex4ht_function_config_file.sh b/testcases/function_test/pkg_test/texlive-base/texlive-tex4ht/test_texlive-tex4ht_function_config_file.sh deleted file mode 100644 index eb66975eb5c..00000000000 --- a/testcases/function_test/pkg_test/texlive-base/texlive-tex4ht/test_texlive-tex4ht_function_config_file.sh +++ /dev/null @@ -1,91 +0,0 @@ -#!/usr/bin/bash - -# Copyright (c) 2024 ISCAS .ALL rights reserved. -# This program is licensed under Mulan PSL v2. -# You can use it according to the terms and conditions of the Mulan PSL v2. -# http://license.coscl.org.cn/MulanPSL2 -# THIS PROGRAM IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, -# EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, -# MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. -# See the Mulan PSL v2 for more details. - -# ############################################# -# @Author : honghua -# @Contact : honghua@iscas.ac.cn -# @Date : 2026-03-02 -# @License : Mulan PSL v2 -# @Desc : 测试使用自定义配置文件转换 LaTeX -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - # 检查是否已安装texlive-tex4ht - LOG_INFO "检查texlive-tex4ht是否已安装" - rpm -q texlive-tex4ht - installed=$? - - # 定义软件包名称 - PACKAGE="texlive-tex4ht" - - # 检查yum源中是否存在该软件包 - LOG_INFO "检查yum源中是否存在${PACKAGE}软件包" - dnf list available ${PACKAGE} &>/dev/null - if [ $? -ne 0 ]; then - LOG_ERROR "yum源中不存在${PACKAGE}软件包" - exit 255 - fi - - # 如果未安装,则安装软件包 - if [ $installed -ne 0 ]; then - LOG_INFO "安装${PACKAGE}软件包" - dnf install -y ${PACKAGE} - CHECK_RESULT $? 0 0 "安装${PACKAGE}失败" - fi - - # 创建测试用的LaTeX文件 - LOG_INFO "创建测试用的LaTeX文件" - cat > test.tex << "EOF" - \documentclass{article} - \begin{document} - Hello, world! - \end{document} - EOF - CHECK_RESULT $? 0 0 "创建LaTeX文件失败" - - # 创建自定义配置文件 - LOG_INFO "创建自定义配置文件" - cat > custom.cfg << "EOF" - \Preamble{xhtml} - \Configure{@HEAD}{\HCode{}} - \begin{document} - \EndPreamble - EOF - CHECK_RESULT $? 0 0 "创建自定义配置文件失败" - - # 测试使用自定义配置文件转换LaTeX - LOG_INFO "使用自定义配置文件转换LaTeX文件" - htlatex test.tex "custom.cfg" - CHECK_RESULT $? 0 0 "使用自定义配置文件转换LaTeX失败" - - # 检查生成的HTML文件是否包含自定义配置 - LOG_INFO "检查生成的HTML文件是否包含自定义配置" - grep -q "meta name="custom" content="test"" test.html - CHECK_RESULT $? 0 0 "生成的HTML文件不包含自定义配置" - - # 清理测试文件 - LOG_INFO "清理测试文件" - rm -f test.tex custom.cfg test.html test.css test*.png test*.svg test*.tmp - CHECK_RESULT $? 0 0 "清理测试文件失败" - - # 如果脚本开始前未安装,则卸载软件包 - if [ $installed -ne 0 ]; then - LOG_INFO "卸载${PACKAGE}软件包" - dnf remove -y ${PACKAGE} - CHECK_RESULT $? 0 0 "卸载${PACKAGE}失败" - fi - - LOG_INFO "测试完成" -} - -main "$@" \ No newline at end of file diff --git a/testcases/function_test/pkg_test/texlive-base/texlive-tex4ht/test_texlive-tex4ht_function_convert_math.sh b/testcases/function_test/pkg_test/texlive-base/texlive-tex4ht/test_texlive-tex4ht_function_convert_math.sh deleted file mode 100644 index 1683951f1d6..00000000000 --- a/testcases/function_test/pkg_test/texlive-base/texlive-tex4ht/test_texlive-tex4ht_function_convert_math.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-02 -# @License : Mulan PSL v2 -# @Desc : 测试转换包含数学公式的 LaTeX 文件 -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - # 判断是否已安装texlive-tex4ht - LOG_INFO "检查texlive-tex4ht是否已安装" - rpm -q texlive-tex4ht > /dev/null 2>&1 - IS_INSTALLED=$? - - # 测试步骤:安装texlive-tex4ht(如果未安装) - if [ $IS_INSTALLED -ne 0 ]; then - LOG_INFO "texlive-tex4ht未安装,开始安装" - # 检查yum源中是否存在该软件包 - LOG_INFO "检查yum源中是否存在texlive-tex4ht" - dnf list available texlive-tex4ht > /dev/null 2>&1 - CHECK_RESULT $? 0 0 "yum源中未找到texlive-tex4ht软件包" - if [ $? -ne 0 ]; then - LOG_ERROR "yum源中未找到texlive-tex4ht软件包" - exit 255 - fi - # 安装软件包 - dnf install -y texlive-tex4ht - CHECK_RESULT $? 0 0 "安装texlive-tex4ht失败" - LOG_INFO "texlive-tex4ht安装成功" - else - LOG_INFO "texlive-tex4ht已安装,跳过安装步骤" - fi - - # 测试步骤:创建包含数学公式的LaTeX测试文件 - LOG_INFO "创建包含数学公式的LaTeX测试文件" - cat > test_math.tex << "EOF" - \documentclass{article} - \begin{document} - 这是一个包含数学公式的测试文档。 - - 行内公式:$E = mc^2$ - - 行间公式: - \[ - \int_{0}^{\infty} e^{-x^2} dx = \frac{\sqrt{\pi}}{2} - \] - - \end{document} - EOF - CHECK_RESULT $? 0 0 "创建LaTeX测试文件失败" - - # 测试步骤:使用tex4ht转换包含数学公式的LaTeX文件 - LOG_INFO "使用tex4ht转换包含数学公式的LaTeX文件" - htlatex test_math.tex - CHECK_RESULT $? 0 0 "使用tex4ht转换LaTeX文件失败" - - # 测试步骤:检查生成的HTML文件是否存在 - LOG_INFO "检查生成的HTML文件是否存在" - if [ -f "test_math.html" ]; then - LOG_INFO "成功生成HTML文件:test_math.html" - # 检查HTML文件中是否包含数学公式相关的标签(如math标签) - grep -i "math\|formula\|equation" test_math.html > /dev/null 2>&1 - CHECK_RESULT $? 0 0 "生成的HTML文件中未找到数学公式相关标签" - else - LOG_ERROR "未找到生成的HTML文件" - exit 1 - fi - - # 测试步骤:清理测试文件 - LOG_INFO "清理测试生成的文件" - rm -f test_math.tex test_math.html test_math.css test_math*.png test_math*.svg test_math*.log test_math*.aux test_math*.dvi test_math*.4ct test_math*.4tc test_math*.idv test_math*.lg test_math*.tmp test_math*.xref - CHECK_RESULT $? 0 0 "清理测试文件失败" - - # 测试步骤:卸载texlive-tex4ht(如果之前未安装) - if [ $IS_INSTALLED -ne 0 ]; then - LOG_INFO "卸载texlive-tex4ht" - dnf remove -y texlive-tex4ht - CHECK_RESULT $? 0 0 "卸载texlive-tex4ht失败" - LOG_INFO "texlive-tex4ht卸载成功" - else - LOG_INFO "测试前已安装texlive-tex4ht,保持安装状态" - fi - - LOG_INFO "测试转换包含数学公式的LaTeX文件完成" -} - -main "$@" \ No newline at end of file diff --git a/testcases/function_test/pkg_test/texlive-base/texlive-tex4ht/test_texlive-tex4ht_function_convert_with_images.sh b/testcases/function_test/pkg_test/texlive-base/texlive-tex4ht/test_texlive-tex4ht_function_convert_with_images.sh deleted file mode 100644 index a8f7798fac5..00000000000 --- a/testcases/function_test/pkg_test/texlive-base/texlive-tex4ht/test_texlive-tex4ht_function_convert_with_images.sh +++ /dev/null @@ -1,113 +0,0 @@ -#!/usr/bin/bash - -# Copyright (c) 2024 ISCAS .ALL rights reserved. -# This program is licensed under Mulan PSL v2. -# You can use it according to the terms and conditions of the Mulan PSL v2. -# http://license.coscl.org.cn/MulanPSL2 -# THIS PROGRAM IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, -# EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, -# MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. -# See the Mulan PSL v2 for more details. - -# ############################################# -# @Author : honghua -# @Contact : honghua@iscas.ac.cn -# @Date : 2026-03-02 -# @License : Mulan PSL v2 -# @Desc : 测试转换包含图片的 LaTeX 文件 -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - # 定义软件包名称 - PACKAGE_NAME="texlive-tex4ht" - - # 步骤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_TEST=true - else - LOG_INFO "软件包 ${PACKAGE_NAME} 未安装,将在测试前安装,并在测试结束后卸载" - INSTALLED_BEFORE_TEST=false - fi - - # 步骤3:如果未安装,则安装软件包 - if [ "${INSTALLED_BEFORE_TEST}" = "false" ]; then - LOG_INFO "安装软件包 ${PACKAGE_NAME}" - dnf install -y ${PACKAGE_NAME} - CHECK_RESULT $? 0 0 "安装软件包 ${PACKAGE_NAME} 失败" - fi - - # 步骤4:检查命令参数是否存在或支持 - LOG_INFO "检查 htlatex 命令是否支持 -interaction 参数" - htlatex --help | grep -q -- "-interaction" - CHECK_RESULT $? 0 0 "htlatex 命令不支持 -interaction 参数" - - # 步骤5:创建测试用的 LaTeX 文件,包含图片 - LOG_INFO "创建测试用的 LaTeX 文件,包含图片" - cat > test_with_image.tex << "EOF" - \documentclass{article} - \usepackage{graphicx} - \begin{document} - \title{Test Document with Image} - \author{Test Author} - \maketitle - This is a test document containing an image. - - \begin{figure}[h] - \centering - \includegraphics[width=0.5\textwidth]{example-image} - \caption{Example Image} - \end{figure} - - \end{document} - EOF - - # 步骤6:创建示例图片文件 - LOG_INFO "创建示例图片文件" - convert -size 100x100 xc:white example-image.png 2>/dev/null || ( - LOG_INFO "使用 ImageMagick 创建图片失败,尝试使用 fallback 方法" - echo "iVBORw0KGgoAAAANSUhEUgAAAGQAAABkCAYAAABw4pVUAAAABHNCSVQICAgIfAhkiAAAAAlwSFlzAAAOxAAADsQBlSsOGwAAAC9JREFUaIHtwTEBAAAAwqD1T20JT6AAAAAAAAAAAAAAAAAAAAAA4N8AqwcEATBdMVoAAAAASUVORK5CYII=" | base64 -d > example-image.png - ) - CHECK_RESULT $? 0 0 "创建示例图片文件失败" - - # 步骤7:使用 htlatex 转换包含图片的 LaTeX 文件 - LOG_INFO "使用 htlatex 转换包含图片的 LaTeX 文件" - htlatex test_with_image.tex "html,2" "" "" "-interaction=nonstopmode" - CHECK_RESULT $? 0 0 "htlatex 转换包含图片的 LaTeX 文件失败" - - # 步骤8:检查生成的 HTML 文件是否存在 - LOG_INFO "检查生成的 HTML 文件是否存在" - [ -f "test_with_image.html" ] - CHECK_RESULT $? 0 0 "生成的 HTML 文件不存在" - - # 步骤9:检查生成的 HTML 文件中是否包含图片引用 - LOG_INFO "检查生成的 HTML 文件中是否包含图片引用" - grep -q "example-image" test_with_image.html - CHECK_RESULT $? 0 0 "生成的 HTML 文件中未包含图片引用" - - # 步骤10:清理测试文件 - LOG_INFO "清理测试文件" - rm -f test_with_image.tex test_with_image.html test_with_image.css test_with_image.log test_with_image.aux test_with_image.idv test_with_image.lg test_with_image.tmp test_with_image.4ct test_with_image.4tc test_with_image.dvi test_with_image.out example-image.png - CHECK_RESULT $? 0 0 "清理测试文件失败" - - # 步骤11:如果测试前未安装,则卸载软件包 - if [ "${INSTALLED_BEFORE_TEST}" = "false" ]; then - LOG_INFO "卸载软件包 ${PACKAGE_NAME}" - dnf remove -y ${PACKAGE_NAME} - CHECK_RESULT $? 0 0 "卸载软件包 ${PACKAGE_NAME} 失败" - fi - - LOG_INFO "测试转换包含图片的 LaTeX 文件完成" -} - -main "$@" \ No newline at end of file diff --git a/testcases/function_test/pkg_test/texlive-base/texlive-tex4ht/test_texlive-tex4ht_function_htlatex_html.sh b/testcases/function_test/pkg_test/texlive-base/texlive-tex4ht/test_texlive-tex4ht_function_htlatex_html.sh deleted file mode 100644 index 15302670539..00000000000 --- a/testcases/function_test/pkg_test/texlive-base/texlive-tex4ht/test_texlive-tex4ht_function_htlatex_html.sh +++ /dev/null @@ -1,81 +0,0 @@ -#!/usr/bin/bash - -# Copyright (c) 2024 ISCAS .ALL rights reserved. -# This program is licensed under Mulan PSL v2. -# You can use it according to the terms and conditions of the Mulan PSL v2. -# http://license.coscl.org.cn/MulanPSL2 -# THIS PROGRAM IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, -# EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, -# MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. -# See the Mulan PSL v2 for more details. - -# ############################################# -# @Author : honghua -# @Contact : honghua@iscas.ac.cn -# @Date : 2025-11-27 -# @License : Mulan PSL v2 -# @Desc : 测试 htlatex 命令生成 HTML 文件的功能 -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - - # 检查是否已安装texlive-tex4ht - LOG_INFO "检查是否已安装texlive-tex4ht" - if rpm -q texlive-tex4ht &>/dev/null; then - LOG_INFO "texlive-tex4ht已安装" - INSTALLED=true - else - LOG_INFO "texlive-tex4ht未安装" - INSTALLED=false - fi - - # 检查yum源中是否有texlive-tex4ht软件包 - LOG_INFO "检查yum源中是否有texlive-tex4ht软件包" - if ! dnf list available texlive-tex4ht &>/dev/null; then - LOG_ERROR "yum源中未找到texlive-tex4ht软件包" - exit 255 - fi - - # 如果未安装,则安装texlive-tex4ht - if [ "$INSTALLED" = false ]; then - LOG_INFO "开始安装texlive-tex4ht" - dnf install -y texlive-tex4ht - CHECK_RESULT $? 0 0 "安装texlive-tex4ht失败" - fi - - # 测试htlatex命令生成HTML文件的功能 - LOG_INFO "测试htlatex命令生成HTML文件的功能" - cat > test.tex </dev/null; then - LOG_INFO "texlive-tex4ht 软件包已安装,脚本结束时将保持安装状态" - already_installed=1 - else - LOG_INFO "texlive-tex4ht 软件包未安装" - already_installed=0 - fi - - # 步骤2: 检查 yum 源中是否存在 texlive-tex4ht 软件包 - LOG_INFO "步骤2: 检查 yum 源中是否存在 texlive-tex4ht 软件包" - if ! dnf list available texlive-tex4ht &>/dev/null; then - LOG_ERROR "yum 源中未找到 texlive-tex4ht 软件包" - exit 255 - fi - - # 步骤3: 如果未安装,则安装 texlive-tex4ht 软件包 - LOG_INFO "步骤3: 如果未安装,则安装 texlive-tex4ht 软件包" - if [ $already_installed -eq 0 ]; then - dnf install -y texlive-tex4ht - CHECK_RESULT $? 0 0 "安装 texlive-tex4ht 软件包失败" - LOG_INFO "texlive-tex4ht 软件包安装成功" - fi - - # 步骤4: 验证 texlive-tex4ht 软件包是否安装成功 - LOG_INFO "步骤4: 验证 texlive-tex4ht 软件包是否安装成功" - rpm -q texlive-tex4ht - CHECK_RESULT $? 0 0 "验证 texlive-tex4ht 软件包安装失败" - - # 步骤5: 测试 texlive-tex4ht 提供的命令是否可用 - LOG_INFO "步骤5: 测试 texlive-tex4ht 提供的命令是否可用" - if command -v htlatex &>/dev/null; then - LOG_INFO "htlatex 命令可用" - else - LOG_ERROR "htlatex 命令不可用" - exit 255 - fi - - # 步骤6: 测试 tex4ht 命令的基本功能 - LOG_INFO "步骤6: 测试 tex4ht 命令的基本功能" - echo "\documentclass{article}\begin{document}Test\end{document}" > test_tex4ht.tex - tex4ht test_tex4ht.tex - CHECK_RESULT $? 0 0 "tex4ht 命令执行失败" - rm -f test_tex4ht.tex test_tex4ht.html test_tex4ht.css test_tex4ht*.png - - # 步骤7: 清理环境,恢复原始状态 - LOG_INFO "步骤7: 清理环境,恢复原始状态" - if [ $already_installed -eq 0 ]; then - LOG_INFO "卸载 texlive-tex4ht 软件包" - dnf remove -y texlive-tex4ht - CHECK_RESULT $? 0 0 "卸载 texlive-tex4ht 软件包失败" - LOG_INFO "texlive-tex4ht 软件包卸载成功" - else - LOG_INFO "保持 texlive-tex4ht 软件包安装状态" - fi - - LOG_INFO "测试 texlive-tex4ht 软件包的安装功能完成" -} - -main "$@" \ No newline at end of file diff --git a/testcases/function_test/pkg_test/texlive-base/texlive-tex4ht/test_texlive-tex4ht_function_make4ht_usage.sh b/testcases/function_test/pkg_test/texlive-base/texlive-tex4ht/test_texlive-tex4ht_function_make4ht_usage.sh deleted file mode 100644 index 39f7be6c65e..00000000000 --- a/testcases/function_test/pkg_test/texlive-base/texlive-tex4ht/test_texlive-tex4ht_function_make4ht_usage.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-02 -# @License : Mulan PSL v2 -# @Desc : 测试使用 mk4ht 命令处理 LaTeX 文件 -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - # 检查是否已安装texlive-tex4ht软件包 - LOG_INFO "检查texlive-tex4ht是否已安装" - dnf list installed texlive-tex4ht > /dev/null 2>&1 - if [ $? -eq 0 ]; then - LOG_INFO "texlive-tex4ht已安装,标记为已安装状态" - INSTALLED_FLAG=1 - else - LOG_INFO "texlive-tex4ht未安装,标记为未安装状态" - INSTALLED_FLAG=0 - fi - - # 检查yum源中是否存在texlive-tex4ht软件包 - LOG_INFO "检查yum源中是否存在texlive-tex4ht软件包" - dnf list available texlive-tex4ht > /dev/null 2>&1 - if [ $? -ne 0 ]; then - LOG_ERROR "yum源中未找到texlive-tex4ht软件包" - exit 255 - fi - - # 如果未安装,则安装texlive-tex4ht - if [ $INSTALLED_FLAG -eq 0 ]; then - LOG_INFO "安装texlive-tex4ht软件包" - dnf install -y texlive-tex4ht - CHECK_RESULT $? 0 0 "安装texlive-tex4ht失败" - fi - - # 检查mk4ht命令是否存在 - LOG_INFO "检查mk4ht命令是否存在" - which mk4ht > /dev/null 2>&1 - CHECK_RESULT $? 0 0 "mk4ht命令不存在" - - # 检查mk4ht命令是否支持基本参数 - LOG_INFO "检查mk4ht命令是否支持基本参数" - mk4ht --help > /dev/null 2>&1 - CHECK_RESULT $? 0 0 "mk4ht命令不支持--help参数" - - # 创建一个简单的LaTeX测试文件 - LOG_INFO "创建简单的LaTeX测试文件" - cat > test.tex << "EOF" - \documentclass{article} - \begin{document} - Hello, World! - \end{document} - EOF - CHECK_RESULT $? 0 0 "创建LaTeX测试文件失败" - - # 使用mk4ht处理LaTeX文件 - LOG_INFO "使用mk4ht处理LaTeX文件" - mk4ht test.tex > mk4ht_output.log 2>&1 - CHECK_RESULT $? 0 0 "mk4ht处理LaTeX文件失败" - - # 检查是否生成了HTML文件 - LOG_INFO "检查是否生成了HTML文件" - if [ -f "test.html" ]; then - LOG_INFO "成功生成HTML文件" - # 检查HTML文件内容是否包含预期文本 - grep -q "Hello, World!" test.html - CHECK_RESULT $? 0 0 "HTML文件内容不符合预期" - else - LOG_ERROR "未生成HTML文件" - exit 1 - fi - - # 清理测试文件 - LOG_INFO "清理测试文件" - rm -f test.tex test.html test.css test.log mk4ht_output.log - - # 如果之前未安装,则卸载texlive-tex4ht - if [ $INSTALLED_FLAG -eq 0 ]; then - LOG_INFO "卸载texlive-tex4ht软件包" - dnf remove -y texlive-tex4ht - CHECK_RESULT $? 0 0 "卸载texlive-tex4ht失败" - fi - - LOG_INFO "测试完成" -} - -main "$@" \ No newline at end of file diff --git a/testcases/function_test/pkg_test/texlive-base/texlive-tex4ht/test_texlive-tex4ht_function_output_dir.sh b/testcases/function_test/pkg_test/texlive-base/texlive-tex4ht/test_texlive-tex4ht_function_output_dir.sh deleted file mode 100644 index 66b89efee8a..00000000000 --- a/testcases/function_test/pkg_test/texlive-base/texlive-tex4ht/test_texlive-tex4ht_function_output_dir.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-02 -# @License : Mulan PSL v2 -# @Desc : 测试指定输出目录的 LaTeX 到 HTML 转换 -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - LOG_INFO "开始测试:指定输出目录的 LaTeX 到 HTML 转换" - LOG_INFO "步骤一:检查软件包 texlive-tex4ht 是否在 yum 源中" - dnf list available texlive-tex4ht > /dev/null 2>&1 - if [ $? -ne 0 ]; then - LOG_ERROR "软件包 texlive-tex4ht 不在 yum 源中" - exit 255 - fi - LOG_INFO "步骤二:检查系统是否已安装 texlive-tex4ht" - rpm -q texlive-tex4ht > /dev/null 2>&1 - if [ $? -eq 0 ]; then - LOG_INFO "texlive-tex4ht 已安装,测试结束后保持安装状态" - INSTALLED=1 - else - LOG_INFO "texlive-tex4ht 未安装,将进行安装" - INSTALLED=0 - LOG_INFO "步骤三:安装 texlive-tex4ht" - dnf install -y texlive-tex4ht - CHECK_RESULT $? 0 0 "安装 texlive-tex4ht 失败" - fi - LOG_INFO "步骤四:创建测试用的 LaTeX 文件" - cat > test.tex << "EOF" - \documentclass{article} - \begin{document} - Hello, World! - \end{document} - EOF - CHECK_RESULT $? 0 0 "创建 LaTeX 文件失败" - LOG_INFO "步骤五:检查 htlatex 命令是否支持 -d 参数" - htlatex --help 2>&1 | grep -q -- "-d" - if [ $? -ne 0 ]; then - LOG_ERROR "htlatex 命令不支持 -d 参数" - exit 255 - fi - LOG_INFO "步骤六:创建指定输出目录" - mkdir -p output_dir - CHECK_RESULT $? 0 0 "创建输出目录失败" - LOG_INFO "步骤七:使用 htlatex 命令将 LaTeX 文件转换为 HTML,并指定输出目录" - htlatex test.tex "html" "" "" "-d./output_dir/" - CHECK_RESULT $? 0 0 "LaTeX 到 HTML 转换失败" - LOG_INFO "步骤八:检查输出目录中是否生成了 HTML 文件" - ls output_dir/*.html > /dev/null 2>&1 - CHECK_RESULT $? 0 0 "输出目录中未找到 HTML 文件" - LOG_INFO "步骤九:清理测试文件" - rm -f test.tex test.aux test.log test.dvi test.idv test.lg test.tmp test.4ct test.4tc test.css test.xref - rm -rf output_dir - LOG_INFO "步骤十:根据初始状态决定是否卸载软件包" - if [ $INSTALLED -eq 0 ]; then - LOG_INFO "卸载 texlive-tex4ht" - dnf remove -y texlive-tex4ht - CHECK_RESULT $? 0 0 "卸载 texlive-tex4ht 失败" - else - LOG_INFO "保持 texlive-tex4ht 安装状态" - fi - LOG_INFO "测试完成:指定输出目录的 LaTeX 到 HTML 转换" -} - -main "$@" \ No newline at end of file diff --git a/testcases/function_test/pkg_test/texlive-base/texlive-tex4ht/test_texlive-tex4ht_function_uninstall.sh b/testcases/function_test/pkg_test/texlive-base/texlive-tex4ht/test_texlive-tex4ht_function_uninstall.sh deleted file mode 100644 index cc5d4a54837..00000000000 --- a/testcases/function_test/pkg_test/texlive-base/texlive-tex4ht/test_texlive-tex4ht_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-03-02 -# @License : Mulan PSL v2 -# @Desc : 测试 texlive-tex4ht 软件包的卸载功能 -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - LOG_INFO "开始测试 texlive-tex4ht 软件包的卸载功能" - LOG_INFO "步骤1: 检查 yum 源中是否存在 texlive-tex4ht 软件包" - dnf list available texlive-tex4ht &>/dev/null - if [ $? -ne 0 ]; then - LOG_ERROR "yum 源中未找到 texlive-tex4ht 软件包" - exit 255 - fi - LOG_INFO "步骤2: 检查当前环境是否已安装 texlive-tex4ht 软件包" - rpm -q texlive-tex4ht &>/dev/null - if [ $? -eq 0 ]; then - LOG_INFO "当前环境已安装 texlive-tex4ht,测试结束后将保持安装状态" - INSTALLED=1 - else - LOG_INFO "当前环境未安装 texlive-tex4ht,将执行安装作为测试步骤" - INSTALLED=0 - LOG_INFO "步骤3: 安装 texlive-tex4ht 软件包" - dnf install -y texlive-tex4ht - CHECK_RESULT $? 0 0 "安装 texlive-tex4ht 失败" - fi - LOG_INFO "步骤4: 验证 texlive-tex4ht 命令是否可用" - tex4ht --version &>/dev/null - CHECK_RESULT $? 0 0 "tex4ht 命令不可用" - LOG_INFO "步骤5: 执行卸载 texlive-tex4ht 软件包" - dnf remove -y texlive-tex4ht - CHECK_RESULT $? 0 0 "卸载 texlive-tex4ht 失败" - LOG_INFO "步骤6: 验证 texlive-tex4ht 是否已卸载" - rpm -q texlive-tex4ht &>/dev/null - if [ $? -eq 0 ]; then - LOG_ERROR "卸载后 texlive-tex4ht 软件包仍然存在" - exit 1 - else - LOG_INFO "texlive-tex4ht 软件包已成功卸载" - fi - LOG_INFO "步骤7: 环境恢复" - if [ $INSTALLED -eq 1 ]; then - LOG_INFO "恢复原始安装状态: 重新安装 texlive-tex4ht" - dnf install -y texlive-tex4ht - CHECK_RESULT $? 0 0 "重新安装 texlive-tex4ht 失败" - else - LOG_INFO "原始环境未安装,无需恢复" - fi - LOG_INFO "测试完成" -} - -main "$@" \ No newline at end of file diff --git a/testcases/function_test/pkg_test/texlive-base/texlive-tex4ht/test_texlive-tex4ht_ht__v.sh b/testcases/function_test/pkg_test/texlive-base/texlive-tex4ht/test_texlive-tex4ht_ht__v.sh deleted file mode 100644 index ad0d9ff9762..00000000000 --- a/testcases/function_test/pkg_test/texlive-base/texlive-tex4ht/test_texlive-tex4ht_ht__v.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 : 测试 ht 命令的 -v 参数 -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - LOG_INFO "开始测试 ht 命令的 -v 参数" - - # 检查是否已安装 texlive-tex4ht 软件包 - LOG_INFO "检查 texlive-tex4ht 软件包是否已安装" - if rpm -q texlive-tex4ht &>/dev/null; then - LOG_INFO "texlive-tex4ht 软件包已安装" - INSTALLED=true - else - LOG_INFO "texlive-tex4ht 软件包未安装" - INSTALLED=false - fi - - # 检查 yum 源中是否有 texlive-tex4ht 软件包 - LOG_INFO "检查 yum 源中是否有 texlive-tex4ht 软件包" - if ! dnf list available texlive-tex4ht &>/dev/null; then - LOG_ERROR "yum 源中未找到 texlive-tex4ht 软件包" - exit 255 - fi - - # 如果未安装,则安装软件包 - if [ "$INSTALLED" = false ]; then - LOG_INFO "开始安装 texlive-tex4ht 软件包" - dnf install -y texlive-tex4ht - CHECK_RESULT $? 0 0 "安装 texlive-tex4ht 软件包失败" - fi - - # 测试 ht 命令的 -v 参数 - LOG_INFO "测试 ht 命令的 -v 参数" - if ! ht --help | grep -q -- "-v"; then - LOG_ERROR "ht 命令不支持 -v 参数" - exit 255 - fi - - LOG_INFO "执行 ht -v" - ht -v > /dev/null 2>&1 - CHECK_RESULT $? 0 0 "执行 ht -v 失败" - - #如果脚本安装过软件包,则卸载 - if [ "$INSTALLED" = false ]; then - LOG_INFO "卸载 texlive-tex4ht 软件包" - dnf remove -y texlive-tex4ht - CHECK_RESULT $? 0 0 “卸载 texlive-tex4ht 失败” - fi - - LOG_INFO "测试完成" -} - -main "$@" \ No newline at end of file diff --git a/testcases/function_test/pkg_test/texlive-base/texlive-tex4ht/test_texlive-tex4ht_ht_upper_a.sh b/testcases/function_test/pkg_test/texlive-base/texlive-tex4ht/test_texlive-tex4ht_ht_upper_a.sh deleted file mode 100644 index 1d7d317e4c6..00000000000 --- a/testcases/function_test/pkg_test/texlive-base/texlive-tex4ht/test_texlive-tex4ht_ht_upper_a.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-03-02 -# @License : Mulan PSL v2 -# @Desc : 测试ht命令的ASCII模式 -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - LOG_INFO "开始测试ht命令的ASCII模式" - - # 检查环境是否已安装texlive-tex4ht软件包 - LOG_INFO "检查texlive-tex4ht是否已安装" - if dnf list installed texlive-tex4ht &>/dev/null; then - LOG_INFO "texlive-tex4ht已安装,测试结束后将保持安装状态" - already_installed=true - else - LOG_INFO "texlive-tex4ht未安装,将在测试过程中安装" - already_installed=false - fi - - # 检查yum源中是否有texlive-tex4ht软件包 - LOG_INFO "检查yum源中是否有texlive-tex4ht软件包" - if ! dnf list available texlive-tex4ht &>/dev/null; then - LOG_ERROR "yum源中未找到texlive-tex4ht软件包" - exit 255 - fi - - # 如果未安装,则安装软件包 - if [ "$already_installed" = false ]; then - LOG_INFO "安装texlive-tex4ht软件包" - dnf install -y texlive-tex4ht - CHECK_RESULT $? 0 0 "安装texlive-tex4ht失败" - fi - - # 检查ht命令是否存在 - LOG_INFO "检查ht命令是否存在" - if ! command -v ht &>/dev/null; then - LOG_ERROR "ht命令不存在" - exit 255 - fi - - # 检查ht命令是否支持-a参数(ASCII模式) - LOG_INFO "检查ht命令是否支持-a参数" - ht -h 2>&1 | grep -q -- "-a" - if [ $? -ne 0 ]; then - LOG_ERROR "ht命令不支持-a参数" - exit 255 - fi - - # 创建测试用的简单LaTeX文件 - LOG_INFO "创建测试用的LaTeX文件" - cat > test.tex << "EOF" - \documentclass{article} - \begin{document} - Hello, World! - \end{document} - EOF - CHECK_RESULT $? 0 0 "创建测试文件失败" - - # 使用ht命令的ASCII模式转换LaTeX文件 - LOG_INFO "使用ht命令的ASCII模式转换LaTeX文件" - ht -a test.tex - CHECK_RESULT $? 0 0 "ht命令执行失败" - - # 检查是否生成了预期的输出文件 - LOG_INFO "检查是否生成了ASCII输出文件" - if [ -f test.html ]; then - LOG_INFO "成功生成test.html文件" - # 检查文件内容是否包含ASCII转换的迹象 - if grep -q "text/html" test.html; then - LOG_INFO "ASCII模式转换成功" - else - LOG_ERROR "生成的HTML文件不符合ASCII模式转换预期" - exit 1 - fi - else - LOG_ERROR "未生成预期的输出文件" - exit 1 - fi - - # 清理测试文件 - LOG_INFO "清理测试文件" - rm -f test.tex test.html test*.png test*.css - CHECK_RESULT $? 0 0 "清理测试文件失败" - - # 如果测试前未安装,则卸载软件包 - if [ "$already_installed" = false ]; then - LOG_INFO "卸载texlive-tex4ht软件包" - dnf remove -y texlive-tex4ht - CHECK_RESULT $? 0 0 "卸载texlive-tex4ht失败" - else - LOG_INFO "保持texlive-tex4ht安装状态" - fi - - LOG_INFO "测试ht命令的ASCII模式完成" -} - -main "$@" \ No newline at end of file diff --git a/testcases/function_test/pkg_test/texlive-base/texlive-tex4ht/test_texlive-tex4ht_ht_upper_d.sh b/testcases/function_test/pkg_test/texlive-base/texlive-tex4ht/test_texlive-tex4ht_ht_upper_d.sh deleted file mode 100644 index 45b4fd5df9f..00000000000 --- a/testcases/function_test/pkg_test/texlive-base/texlive-tex4ht/test_texlive-tex4ht_ht_upper_d.sh +++ /dev/null @@ -1,77 +0,0 @@ -#!/usr/bin/bash - -# Copyright (c) 2024 ISCAS .ALL rights reserved. -# This program is licensed under Mulan PSL v2. -# You can use it according to the terms and conditions of the Mulan PSL v2. -# http://license.coscl.org.cn/MulanPSL2 -# THIS PROGRAM IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, -# EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, -# MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. -# See the Mulan PSL v2 for more details. - -# ############################################# -# @Author : honghua -# @Contact : honghua@iscas.ac.cn -# @Date : 2026-03-02 -# @License : Mulan PSL v2 -# @Desc : 测试ht命令的调试模式 -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - # 判断是否已经安装了texlive-tex4ht-ht-upper-d - LOG_INFO "检查是否已安装texlive-tex4ht-ht-upper-d软件包" - rpm -q texlive-tex4ht-ht-upper-d > /dev/null 2>&1 - if [ $? -eq 0 ]; then - LOG_INFO "texlive-tex4ht-ht-upper-d已安装,测试结束后将保持安装状态" - INSTALLED="yes" - else - LOG_INFO "texlive-tex4ht-ht-upper-d未安装,将在测试结束后卸载" - INSTALLED="no" - fi - - # 检查yum源中是否有texlive-tex4ht-ht-upper-d软件包 - LOG_INFO "检查yum源中是否有texlive-tex4ht-ht-upper-d软件包" - dnf list available texlive-tex4ht-ht-upper-d > /dev/null 2>&1 - CHECK_RESULT $? 0 0 "yum源中未找到texlive-tex4ht-ht-upper-d软件包" - if [ $? -ne 0 ]; then - LOG_ERROR "yum源中未找到texlive-tex4ht-ht-upper-d软件包" - exit 255 - fi - - # 如果未安装,则安装软件包 - if [ "$INSTALLED" = "no" ]; then - LOG_INFO "安装texlive-tex4ht-ht-upper-d软件包" - dnf install -y texlive-tex4ht-ht-upper-d > /dev/null 2>&1 - CHECK_RESULT $? 0 0 "安装texlive-tex4ht-ht-upper-d失败" - fi - - # 测试ht命令的调试模式 - LOG_INFO "测试ht命令的调试模式参数-d" - ht -d > /dev/null 2>&1 - CHECK_RESULT $? 0 0 "ht命令不支持-d参数或执行失败" - if [ $? -ne 0 ]; then - LOG_ERROR "ht命令不支持-d参数" - exit 255 - fi - - # 测试ht命令的调试模式详细输出 - LOG_INFO "测试ht命令的调试模式详细输出" - ht -d --help > /dev/null 2>&1 - CHECK_RESULT $? 0 0 "ht命令调试模式详细输出失败" - - # 清理环境 - LOG_INFO "清理测试环境" - if [ "$INSTALLED" = "no" ]; then - LOG_INFO "卸载texlive-tex4ht-ht-upper-d软件包" - dnf remove -y texlive-tex4ht-ht-upper-d > /dev/null 2>&1 - CHECK_RESULT $? 0 0 "卸载texlive-tex4ht-ht-upper-d失败" - else - LOG_INFO "保持texlive-tex4ht-ht-upper-d安装状态" - fi - - LOG_INFO "测试脚本执行完毕" -} - -main "$@" \ No newline at end of file diff --git a/testcases/function_test/pkg_test/texlive-base/texlive-tex4ht/test_texlive-tex4ht_ht_upper_e.sh b/testcases/function_test/pkg_test/texlive-base/texlive-tex4ht/test_texlive-tex4ht_ht_upper_e.sh deleted file mode 100644 index 5fbafbcd455..00000000000 --- a/testcases/function_test/pkg_test/texlive-base/texlive-tex4ht/test_texlive-tex4ht_ht_upper_e.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-02 -# @License : Mulan PSL v2 -# @Desc : 测试ht命令的错误处理模式 -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - LOG_INFO "开始测试ht命令的错误处理模式" - - # 检查yum源中是否存在texlive-tex4ht-ht-upper-e软件包 - LOG_INFO "检查yum源中是否存在texlive-tex4ht-ht-upper-e软件包" - dnf list texlive-tex4ht-ht-upper-e &>/dev/null - CHECK_RESULT $? 0 0 "yum源中不存在texlive-tex4ht-ht-upper-e软件包" - if [ $? -ne 0 ]; then - LOG_ERROR "yum源中不存在texlive-tex4ht-ht-upper-e软件包" - exit 255 - fi - - # 检查系统是否已安装texlive-tex4ht-ht-upper-e - LOG_INFO "检查系统是否已安装texlive-tex4ht-ht-upper-e" - rpm -q texlive-tex4ht-ht-upper-e &>/dev/null - is_installed=$? - - # 如果未安装,则安装软件包 - if [ $is_installed -ne 0 ]; then - LOG_INFO "未安装texlive-tex4ht-ht-upper-e,开始安装" - dnf install -y texlive-tex4ht-ht-upper-e - CHECK_RESULT $? 0 0 "安装texlive-tex4ht-ht-upper-e失败" - if [ $? -ne 0 ]; then - LOG_ERROR "安装texlive-tex4ht-ht-upper-e失败" - exit 1 - fi - LOG_INFO "安装texlive-tex4ht-ht-upper-e成功" - else - LOG_INFO "texlive-tex4ht-ht-upper-e已安装" - fi - - # 测试ht命令的错误处理模式 - LOG_INFO "测试ht命令的错误处理模式" - - # 测试ht命令是否支持--invalid-option参数 - LOG_INFO "测试ht命令是否支持--invalid-option参数" - ht --invalid-option &>/dev/null - if [ $? -ne 255 ] && [ $? -ne 1 ]; then - LOG_ERROR "ht命令不支持--invalid-option参数,但未按预期退出" - exit 255 - fi - LOG_INFO "ht命令正确处理了不支持的参数" - - # 测试ht命令处理不存在的输入文件 - LOG_INFO "测试ht命令处理不存在的输入文件" - ht nonexistent_file.tex &>/dev/null - if [ $? -eq 0 ]; then - LOG_ERROR "ht命令处理不存在的输入文件时未正确报错" - exit 1 - fi - LOG_INFO "ht命令正确处理了不存在的输入文件" - - # 测试ht命令处理无效的LaTeX输入 - LOG_INFO "测试ht命令处理无效的LaTeX输入" - echo "invalid latex content" > invalid_test.tex - ht invalid_test.tex &>/dev/null - if [ $? -eq 0 ]; then - LOG_ERROR "ht命令处理无效的LaTeX输入时未正确报错" - rm -f invalid_test.tex - exit 1 - fi - rm -f invalid_test.tex - LOG_INFO "ht命令正确处理了无效的LaTeX输入" - - # 清理环境:如果测试前未安装,则卸载软件包 - if [ $is_installed -ne 0 ]; then - LOG_INFO "测试前未安装texlive-tex4ht-ht-upper-e,开始卸载" - dnf remove -y texlive-tex4ht-ht-upper-e - CHECK_RESULT $? 0 0 "卸载texlive-tex4ht-ht-upper-e失败" - if [ $? -ne 0 ]; then - LOG_ERROR "卸载texlive-tex4ht-ht-upper-e失败" - exit 1 - fi - LOG_INFO "卸载texlive-tex4ht-ht-upper-e成功" - else - LOG_INFO "测试前已安装texlive-tex4ht-ht-upper-e,保持安装状态" - fi - - LOG_INFO "测试ht命令的错误处理模式完成" -} - -main "$@" \ No newline at end of file diff --git a/testcases/function_test/pkg_test/texlive-base/texlive-tex4ht/test_texlive-tex4ht_ht_upper_f.sh b/testcases/function_test/pkg_test/texlive-base/texlive-tex4ht/test_texlive-tex4ht_ht_upper_f.sh deleted file mode 100644 index d91a0478969..00000000000 --- a/testcases/function_test/pkg_test/texlive-base/texlive-tex4ht/test_texlive-tex4ht_ht_upper_f.sh +++ /dev/null @@ -1,71 +0,0 @@ -#!/usr/bin/bash - -# Copyright (c) 2024 ISCAS .ALL rights reserved. -# This program is licensed under Mulan PSL v2. -# You can use it according to the terms and conditions of the Mulan PSL v2. -# http://license.coscl.org.cn/MulanPSL2 -# THIS PROGRAM IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, -# EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, -# MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. -# See the Mulan PSL v2 for more details. - -# ############################################# -# @Author : honghua -# @Contact : honghua@iscas.ac.cn -# @Date : 2026-03-02 -# @License : Mulan PSL v2 -# @Desc : 测试ht命令的强制模式 -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - # 检查是否已安装texlive-tex4ht-tex4ht-ht_upper_f - LOG_INFO "检查是否已安装texlive-tex4ht-tex4ht-ht_upper_f" - if dnf list installed texlive-tex4ht-tex4ht-ht_upper_f &> /dev/null; then - LOG_INFO "texlive-tex4ht-tex4ht-ht_upper_f已安装" - INSTALLED=true - else - LOG_INFO "texlive-tex4ht-tex4ht-ht_upper_f未安装" - INSTALLED=false - fi - - # 检查yum源中是否有该软件包 - LOG_INFO "检查yum源中是否有texlive-tex4ht-tex4ht-ht_upper_f软件包" - if ! dnf list available texlive-tex4ht-tex4ht-ht_upper_f &> /dev/null; then - LOG_ERROR "yum源中未找到texlive-tex4ht-tex4ht-ht_upper_f软件包" - exit 255 - fi - - # 如果未安装,则安装软件包 - if [ "$INSTALLED" = false ]; then - LOG_INFO "开始安装texlive-tex4ht-tex4ht-ht_upper_f" - dnf install -y texlive-tex4ht-tex4ht-ht_upper_f - CHECK_RESULT $? 0 0 "安装texlive-tex4ht-tex4ht-ht_upper_f失败" - LOG_INFO "安装texlive-tex4ht-tex4ht-ht_upper_f成功" - fi - - # 测试ht命令的强制模式 - LOG_INFO "测试ht命令的强制模式" - ht --help | grep -q "\-\-force" - CHECK_RESULT $? 0 0 "ht命令不支持强制模式参数" - - # 执行ht命令的强制模式测试 - LOG_INFO "执行ht命令强制模式测试" - ht --force 2>&1 | grep -q "force" - CHECK_RESULT $? 0 0 "ht命令强制模式执行失败" - - # 环境恢复:如果之前未安装,则卸载软件包 - if [ "$INSTALLED" = false ]; then - LOG_INFO "卸载texlive-tex4ht-tex4ht-ht_upper_f" - dnf remove -y texlive-tex4ht-tex4ht-ht_upper_f - CHECK_RESULT $? 0 0 "卸载texlive-tex4ht-tex4ht-ht_upper_f失败" - LOG_INFO "卸载texlive-tex4ht-tex4ht-ht_upper_f成功" - else - LOG_INFO "保持texlive-tex4ht-tex4ht-ht_upper_f安装状态" - fi - - LOG_INFO "测试脚本执行完成" -} - -main "$@" \ No newline at end of file diff --git a/testcases/function_test/pkg_test/texlive-base/texlive-tex4ht/test_texlive-tex4ht_ht_upper_i.sh b/testcases/function_test/pkg_test/texlive-base/texlive-tex4ht/test_texlive-tex4ht_ht_upper_i.sh deleted file mode 100644 index 2ab4005bdb6..00000000000 --- a/testcases/function_test/pkg_test/texlive-base/texlive-tex4ht/test_texlive-tex4ht_ht_upper_i.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-02 -# @License : Mulan PSL v2 -# @Desc : 测试ht命令的交互模式 -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - LOG_INFO "开始测试ht命令的交互模式" - LOG_INFO "步骤1:检查texlive-tex4ht-ht软件包是否在yum源中" - dnf list available texlive-tex4ht-ht &>/dev/null - if [ $? -ne 0 ]; then - LOG_ERROR "yum源中未找到texlive-tex4ht-ht软件包" - exit 255 - fi - - LOG_INFO "步骤2:检查系统是否已安装texlive-tex4ht-ht" - if rpm -q texlive-tex4ht-ht &>/dev/null; then - LOG_INFO "系统已安装texlive-tex4ht-ht,测试结束后将保持安装状态" - already_installed=1 - else - LOG_INFO "系统未安装texlive-tex4ht-ht,将进行安装" - already_installed=0 - fi - - if [ $already_installed -eq 0 ]; then - LOG_INFO "步骤3:安装texlive-tex4ht-ht软件包" - dnf install -y texlive-tex4ht-ht - CHECK_RESULT $? 0 0 "安装texlive-tex4ht-ht失败" - fi - - LOG_INFO "步骤4:检查ht命令是否支持-i参数" - ht -h 2>&1 | grep -q "\-i" - if [ $? -ne 0 ]; then - LOG_ERROR "ht命令不支持-i参数" - exit 255 - fi - - LOG_INFO "步骤5:测试ht命令的交互模式" - echo "quit" | ht -i - CHECK_RESULT $? 0 0 "ht命令交互模式测试失败" - - if [ $already_installed -eq 0 ]; then - LOG_INFO "步骤6:卸载texlive-tex4ht-ht软件包" - dnf remove -y texlive-tex4ht-ht - CHECK_RESULT $? 0 0 "卸载texlive-tex4ht-ht失败" - fi - - LOG_INFO "测试完成,环境已恢复" -} - -main "$@" \ No newline at end of file diff --git a/testcases/function_test/pkg_test/texlive-base/texlive-tex4ht/test_texlive-tex4ht_ht_upper_l.sh b/testcases/function_test/pkg_test/texlive-base/texlive-tex4ht/test_texlive-tex4ht_ht_upper_l.sh deleted file mode 100644 index 2975a7faf2e..00000000000 --- a/testcases/function_test/pkg_test/texlive-base/texlive-tex4ht/test_texlive-tex4ht_ht_upper_l.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-02 -# @License : Mulan PSL v2 -# @Desc : 测试ht命令的语言参数 -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - LOG_INFO "开始测试:测试ht命令的语言参数" - - # 步骤1:检查yum源中是否存在texlive-tex4ht-ht-upper-l软件包 - LOG_INFO "步骤1:检查yum源中是否存在texlive-tex4ht-ht-upper-l软件包" - dnf list texlive-tex4ht-ht-upper-l - if [ $? -ne 0 ]; then - LOG_ERROR "yum源中不存在texlive-tex4ht-ht-upper-l软件包" - exit 255 - fi - - # 步骤2:检查系统是否已安装texlive-tex4ht-ht-upper-l软件包 - LOG_INFO "步骤2:检查系统是否已安装texlive-tex4ht-ht-upper-l软件包" - rpm -q texlive-tex4ht-ht-upper-l - if [ $? -eq 0 ]; then - LOG_INFO "texlive-tex4ht-ht-upper-l软件包已安装" - INSTALLED=true - else - LOG_INFO "texlive-tex4ht-ht-upper-l软件包未安装" - INSTALLED=false - fi - - # 步骤3:如果未安装,则安装texlive-tex4ht-ht-upper-l软件包 - if [ "$INSTALLED" = false ]; then - LOG_INFO "步骤3:安装texlive-tex4ht-ht-upper-l软件包" - dnf install -y texlive-tex4ht-ht-upper-l - CHECK_RESULT $? 0 0 "安装texlive-tex4ht-ht-upper-l软件包失败" - fi - - # 步骤4:检查ht命令是否支持语言参数 - LOG_INFO "步骤4:检查ht命令是否支持语言参数" - ht --help | grep -q "language" - if [ $? -ne 0 ]; then - LOG_ERROR "ht命令不支持语言参数" - if [ "$INSTALLED" = false ]; then - LOG_INFO "清理环境:卸载texlive-tex4ht-ht-upper-l软件包" - dnf remove -y texlive-tex4ht-ht-upper-l - CHECK_RESULT $? 0 0 "卸载texlive-tex4ht-ht-upper-l软件包失败" - fi - exit 255 - fi - - # 步骤5:测试ht命令的语言参数 - LOG_INFO "步骤5:测试ht命令的语言参数" - ht --language=en test.tex - CHECK_RESULT $? 0 0 "ht命令语言参数测试失败" - - # 步骤6:清理环境 - LOG_INFO "步骤6:清理环境" - if [ "$INSTALLED" = false ]; then - LOG_INFO "卸载texlive-tex4ht-ht-upper-l软件包" - dnf remove -y texlive-tex4ht-ht-upper-l - CHECK_RESULT $? 0 0 "卸载texlive-tex4ht-ht-upper-l软件包失败" - else - LOG_INFO "保持texlive-tex4ht-ht-upper-l软件包安装状态" - fi - - LOG_INFO "测试完成:测试ht命令的语言参数" -} - -main "$@" \ No newline at end of file diff --git a/testcases/function_test/pkg_test/texlive-base/texlive-tex4ht/test_texlive-tex4ht_ht_upper_m.sh b/testcases/function_test/pkg_test/texlive-base/texlive-tex4ht/test_texlive-tex4ht_ht_upper_m.sh deleted file mode 100644 index 90b74954ba0..00000000000 --- a/testcases/function_test/pkg_test/texlive-base/texlive-tex4ht/test_texlive-tex4ht_ht_upper_m.sh +++ /dev/null @@ -1,132 +0,0 @@ -#!/usr/bin/bash - -# Copyright (c) 2024 ISCAS .ALL rights reserved. -# This program is licensed under Mulan PSL v2. -# You can use it according to the terms and conditions of the Mulan PSL v2. -# http://license.coscl.org.cn/MulanPSL2 -# THIS PROGRAM IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, -# EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, -# 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-02 -# @License : Mulan PSL v2 -# @Desc : 测试ht命令的数学模式参数 -# ############################################ - -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 -eq $expect ]; then - LOG_INFO "$message 成功" - return 0 - else - LOG_ERROR "$message 失败" - exit $actual - fi - else - if [ $actual -ne $expect ]; then - LOG_INFO "$message 成功" - return 0 - else - LOG_ERROR "$message 失败" - exit 1 - fi - fi - } - - # 定义SSH_CMD函数(虽然题目说无需定义,但实际脚本需要这个函数) - SSH_CMD() { - local cmd=$1 - local node_ip=$2 - local node_password=$3 - local node_user=$4 - sshpass -p $node_password ssh -o StrictHostKeyChecking=no $node_user@$node_ip "$cmd" - } - - # 定义软件包名称 - PACKAGE_NAME="texlive-tex4ht" - - # 步骤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 "软件包 $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:测试ht命令的数学模式参数 - LOG_INFO "步骤4:测试ht命令的数学模式参数" - # 检查ht命令是否存在 - which ht &>/dev/null - CHECK_RESULT $? 0 0 "检查ht命令是否存在" - - # 测试ht命令的数学模式参数 - ht --help | grep -q "\-math" - CHECK_RESULT $? 0 0 "检查ht命令是否支持数学模式参数" - - # 创建一个简单的测试文件 - cat > test_math.tex << "EOF" - \documentclass{article} - \begin{document} - This is a test: $E = mc^2$ - \end{document} - EOF - - # 使用ht命令的数学模式参数进行测试 - ht -math test_math.tex - CHECK_RESULT $? 0 0 "使用ht命令的数学模式参数转换测试文件" - - # 步骤5:清理测试文件 - LOG_INFO "步骤5:清理测试文件" - rm -f test_math.tex test_math.html test_math*.png test_math*.css - - # 步骤6:如果脚本开始时未安装软件包,则卸载 - if [ $INSTALLED -eq 0 ]; then - LOG_INFO "步骤6:卸载软件包 $PACKAGE_NAME" - dnf remove -y $PACKAGE_NAME - CHECK_RESULT $? 0 0 "卸载软件包 $PACKAGE_NAME" - else - LOG_INFO "步骤6:软件包 $PACKAGE_NAME 在脚本执行前已安装,保持安装状态" - fi - - LOG_INFO "测试脚本执行完成" -} - -main "$@" \ No newline at end of file diff --git a/testcases/function_test/pkg_test/texlive-base/texlive-tex4ht/test_texlive-tex4ht_ht_upper_o.sh b/testcases/function_test/pkg_test/texlive-base/texlive-tex4ht/test_texlive-tex4ht_ht_upper_o.sh deleted file mode 100644 index 83efcb9bc9e..00000000000 --- a/testcases/function_test/pkg_test/texlive-base/texlive-tex4ht/test_texlive-tex4ht_ht_upper_o.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-02 -# @License : Mulan PSL v2 -# @Desc : 测试ht命令的输出文件参数 -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - # 检查是否已经安装 texlive-tex4ht - LOG_INFO "检查是否已经安装 texlive-tex4ht" - if dnf list installed texlive-tex4ht &> /dev/null; then - LOG_INFO "texlive-tex4ht 已经安装" - INSTALLED=1 - else - LOG_INFO "texlive-tex4ht 未安装" - INSTALLED=0 - fi - - # 检查 yum 源中是否有 texlive-tex4ht - LOG_INFO "检查 yum 源中是否有 texlive-tex4ht" - if ! dnf list available texlive-tex4ht &> /dev/null; then - LOG_ERROR "yum 源中没有 texlive-tex4ht 软件包" - exit 255 - fi - - # 如果未安装,则安装 texlive-tex4ht - if [ $INSTALLED -eq 0 ]; then - LOG_INFO "安装 texlive-tex4ht" - dnf install -y texlive-tex4ht - CHECK_RESULT $? 0 0 "安装 texlive-tex4ht 失败" - fi - - # 测试 ht 命令的输出文件参数 - LOG_INFO "测试 ht 命令的输出文件参数" - # 检查 ht 命令是否存在 - if ! command -v ht &> /dev/null; then - LOG_ERROR "ht 命令不存在" - exit 255 - fi - - # 创建测试用的简单 LaTeX 文件 - LOG_INFO "创建测试用的简单 LaTeX 文件" - cat > test.tex << "EOF" - \documentclass{article} - \begin{document} - Hello, World! - \end{document} - EOF - - # 测试 ht 命令的 -o 参数 - LOG_INFO "测试 ht 命令的 -o 参数" - ht test.tex -o output.html - CHECK_RESULT $? 0 0 "ht 命令执行失败" - - # 检查输出文件是否存在 - LOG_INFO "检查输出文件是否存在" - if [ -f output.html ]; then - LOG_INFO "输出文件 output.html 已生成" - else - LOG_ERROR "输出文件 output.html 未生成" - exit 1 - fi - - # 清理测试文件 - LOG_INFO "清理测试文件" - rm -f test.tex output.html - - # 如果之前未安装,则卸载 texlive-tex4ht - if [ $INSTALLED -eq 0 ]; then - LOG_INFO "卸载 texlive-tex4ht" - dnf remove -y texlive-tex4ht - CHECK_RESULT $? 0 0 "卸载 texlive-tex4ht 失败" - fi - - LOG_INFO "测试完成" -} - -main "$@" \ No newline at end of file diff --git a/testcases/function_test/pkg_test/texlive-base/texlive-tex4ht/test_texlive-tex4ht_ht_upper_q.sh b/testcases/function_test/pkg_test/texlive-base/texlive-tex4ht/test_texlive-tex4ht_ht_upper_q.sh deleted file mode 100644 index d51db4fb513..00000000000 --- a/testcases/function_test/pkg_test/texlive-base/texlive-tex4ht/test_texlive-tex4ht_ht_upper_q.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-02 -# @License : Mulan PSL v2 -# @Desc : 测试ht命令的安静模式 -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - # 判断是否已安装texlive-tex4ht - LOG_INFO "检查是否已安装texlive-tex4ht" - if dnf list installed texlive-tex4ht &>/dev/null; then - LOG_INFO "texlive-tex4ht已安装,测试后保持安装状态" - INSTALLED=1 - else - LOG_INFO "texlive-tex4ht未安装,将在测试后卸载" - INSTALLED=0 - fi - - # 检查yum源中是否有该软件包 - LOG_INFO "检查yum源中是否有texlive-tex4ht软件包" - if ! dnf list available texlive-tex4ht &>/dev/null; then - LOG_ERROR "yum源中未找到texlive-tex4ht软件包" - exit 255 - fi - - # 如果未安装则安装软件包 - if [ $INSTALLED -eq 0 ]; then - LOG_INFO "开始安装texlive-tex4ht" - dnf install -y texlive-tex4ht - CHECK_RESULT $? 0 0 "安装texlive-tex4ht失败" - fi - - # 测试ht命令的安静模式 - LOG_INFO "测试ht命令的安静模式参数" - if ! ht --help 2>&1 | grep -q "quiet\|安静"; then - LOG_ERROR "ht命令不支持安静模式参数" - # 清理环境 - if [ $INSTALLED -eq 0 ]; then - LOG_INFO "清理环境:卸载texlive-tex4ht" - dnf remove -y texlive-tex4ht - CHECK_RESULT $? 0 0 "卸载texlive-tex4ht失败" - fi - exit 255 - fi - - LOG_INFO "执行ht命令的安静模式测试" - ht --quiet --version - CHECK_RESULT $? 0 0 "ht命令安静模式执行失败" - - # 清理环境 - if [ $INSTALLED -eq 0 ]; then - LOG_INFO "清理环境:卸载texlive-tex4ht" - dnf remove -y texlive-tex4ht - CHECK_RESULT $? 0 0 "卸载texlive-tex4ht失败" - fi - - LOG_INFO "测试完成" -} - -main "$@" \ No newline at end of file diff --git a/testcases/function_test/pkg_test/texlive-base/texlive-tex4ht/test_texlive-tex4ht_ht_upper_v.sh b/testcases/function_test/pkg_test/texlive-base/texlive-tex4ht/test_texlive-tex4ht_ht_upper_v.sh deleted file mode 100644 index 0d5d2f15cd0..00000000000 --- a/testcases/function_test/pkg_test/texlive-base/texlive-tex4ht/test_texlive-tex4ht_ht_upper_v.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-02 -# @License : Mulan PSL v2 -# @Desc : 测试ht命令的详细模式 -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - # 定义日志函数 - LOG_INFO() { - echo "[INFO] $1" - } - LOG_ERROR() { - echo "[ERROR] $1" >&2 - } - - # 定义软件包名称 - PACKAGE_NAME="texlive-tex4ht-ht-upper-v" - - # 步骤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 已安装,测试完成后将保持安装状态" - ALREADY_INSTALLED=true - else - LOG_INFO "软件包 $PACKAGE_NAME 未安装,将在测试步骤中安装" - ALREADY_INSTALLED=false - fi - - # 步骤3: 如果未安装,安装软件包 - if [ "$ALREADY_INSTALLED" = false ]; then - LOG_INFO "安装软件包 $PACKAGE_NAME" - dnf install -y "$PACKAGE_NAME" - CHECK_RESULT $? 0 0 "安装软件包 $PACKAGE_NAME 失败" - fi - - # 步骤4: 检查ht命令是否存在 - LOG_INFO "检查ht命令是否存在" - if ! command -v ht &>/dev/null; then - LOG_ERROR "ht命令不存在" - if [ "$ALREADY_INSTALLED" = false ]; then - LOG_INFO "卸载软件包 $PACKAGE_NAME" - dnf remove -y "$PACKAGE_NAME" - fi - exit 255 - fi - - # 步骤5: 检查ht命令是否支持详细模式参数 - LOG_INFO "检查ht命令是否支持详细模式参数" - if ! ht --help 2>&1 | grep -q "\-\-verbose"; then - LOG_ERROR "ht命令不支持详细模式参数" - if [ "$ALREADY_INSTALLED" = false ]; then - LOG_INFO "卸载软件包 $PACKAGE_NAME" - dnf remove -y "$PACKAGE_NAME" - fi - exit 255 - fi - - # 步骤6: 测试ht命令的详细模式 - LOG_INFO "测试ht命令的详细模式" - ht --verbose - CHECK_RESULT $? 0 0 "ht命令详细模式执行失败" - - # 步骤7: 清理环境 - LOG_INFO "清理环境" - if [ "$ALREADY_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/texlive-base/texlive-tex4ht/test_texlive-tex4ht_htcontext__v.sh b/testcases/function_test/pkg_test/texlive-base/texlive-tex4ht/test_texlive-tex4ht_htcontext__v.sh deleted file mode 100644 index 338f9da8af6..00000000000 --- a/testcases/function_test/pkg_test/texlive-base/texlive-tex4ht/test_texlive-tex4ht_htcontext__v.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-27 -# @License : Mulan PSL v2 -# @Desc : 测试 htcontext 命令的 -v 参数 -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - - # 检查是否已安装 texlive-tex4ht 包 - LOG_INFO "检查是否已安装 texlive-tex4ht 包" - if rpm -q texlive-tex4ht > /dev/null 2>&1; then - LOG_INFO "texlive-tex4ht 已安装,脚本结束后将保持安装状态" - INSTALLED=true - else - LOG_INFO "texlive-tex4ht 未安装,脚本结束后将卸载" - INSTALLED=false - fi - - # 检查 yum 源中是否有 texlive-tex4ht 包 - LOG_INFO "检查 yum 源中是否有 texlive-tex4ht 包" - if ! dnf list available texlive-tex4ht > /dev/null 2>&1; then - LOG_ERROR "yum 源中未找到 texlive-tex4ht 包" - exit 255 - fi - - # 安装 texlive-tex4ht - if [ "$INSTALLED" = false ]; then - LOG_INFO "安装 texlive-tex4ht" - dnf install -y texlive-tex4ht - CHECK_RESULT $? 0 0 "安装 texlive-tex4ht 失败" - fi - - # 测试 htcontext 命令的 -v 参数 - LOG_INFO "测试 htcontext 命令的 -v 参数" - htcontext -v > /dev/null 2>&1 - CHECK_RESULT $? 0 0 "htcontext -v 参数不支持或执行失败" - - # 清理环境:如果脚本开始时未安装,则卸载 texlive-tex4ht - if [ "$INSTALLED" = false ]; then - LOG_INFO "卸载 texlive-tex4ht" - dnf remove -y texlive-tex4ht - CHECK_RESULT $? 0 0 "卸载 texlive-tex4ht 失败" - fi - - LOG_INFO "测试完成" - -} - -main "$@" \ No newline at end of file diff --git a/testcases/function_test/pkg_test/texlive-base/texlive-tex4ht/test_texlive-tex4ht_htcontext_help.sh b/testcases/function_test/pkg_test/texlive-base/texlive-tex4ht/test_texlive-tex4ht_htcontext_help.sh deleted file mode 100644 index b30ea1866d3..00000000000 --- a/testcases/function_test/pkg_test/texlive-base/texlive-tex4ht/test_texlive-tex4ht_htcontext_help.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-02 -# @License : Mulan PSL v2 -# @Desc : 测试显示htcontext命令的帮助信息 -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - # 判断是否已安装texlive-tex4ht-htcontext - LOG_INFO "检查是否已安装texlive-tex4ht-htcontext软件包" - rpm -q texlive-tex4ht-htcontext > /dev/null 2>&1 - if [ $? -eq 0 ]; then - LOG_INFO "texlive-tex4ht-htcontext已安装,测试后保持安装状态" - already_installed=1 - else - LOG_INFO "texlive-tex4ht-htcontext未安装,将在测试后卸载" - already_installed=0 - fi - - # 检查yum源中是否有该软件包 - LOG_INFO "检查yum源中是否有texlive-tex4ht-htcontext软件包" - dnf list available texlive-tex4ht-htcontext > /dev/null 2>&1 - CHECK_RESULT $? 0 0 "yum源中未找到texlive-tex4ht-htcontext软件包" - if [ $? -ne 0 ]; then - LOG_ERROR "yum源中未找到texlive-tex4ht-htcontext软件包" - exit 255 - fi - - # 如果未安装,则安装软件包 - if [ $already_installed -eq 0 ]; then - LOG_INFO "安装texlive-tex4ht-htcontext软件包" - dnf install -y texlive-tex4ht-htcontext > /dev/null 2>&1 - CHECK_RESULT $? 0 0 "安装texlive-tex4ht-htcontext失败" - fi - - # 测试显示htcontext命令的帮助信息 - LOG_INFO "测试显示htcontext命令的帮助信息" - htcontext --help > /dev/null 2>&1 - CHECK_RESULT $? 0 0 "htcontext命令执行失败,可能参数不存在或不支持" - if [ $? -ne 0 ]; then - LOG_ERROR "htcontext命令参数不存在或不支持" - if [ $already_installed -eq 0 ]; then - LOG_INFO "清理环境:卸载texlive-tex4ht-htcontext软件包" - dnf remove -y texlive-tex4ht-htcontext > /dev/null 2>&1 - fi - exit 255 - fi - - # 检查帮助信息中是否包含关键内容 - LOG_INFO "验证htcontext帮助信息内容" - htcontext --help 2>&1 | grep -q "Usage:" - CHECK_RESULT $? 0 0 "htcontext帮助信息不符合预期" - - # 清理环境:如果测试前未安装,则卸载软件包 - if [ $already_installed -eq 0 ]; then - LOG_INFO "清理环境:卸载texlive-tex4ht-htcontext软件包" - dnf remove -y texlive-tex4ht-htcontext > /dev/null 2>&1 - CHECK_RESULT $? 0 0 "卸载texlive-tex4ht-htcontext失败" - fi - - LOG_INFO "测试完成,环境已恢复" -} - -main "$@" \ No newline at end of file diff --git a/testcases/function_test/pkg_test/texlive-base/texlive-tex4ht/test_texlive-tex4ht_htcontext_upper_d.sh b/testcases/function_test/pkg_test/texlive-base/texlive-tex4ht/test_texlive-tex4ht_htcontext_upper_d.sh deleted file mode 100644 index 295254e0bc5..00000000000 --- a/testcases/function_test/pkg_test/texlive-base/texlive-tex4ht/test_texlive-tex4ht_htcontext_upper_d.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-02 -# @License : Mulan PSL v2 -# @Desc : 测试htcontext命令的调试模式 -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - LOG_INFO "开始测试htcontext命令的调试模式" - LOG_INFO "检查系统中是否已安装texlive-tex4ht-htcontext-upper-d软件包" - rpm -q texlive-tex4ht-htcontext-upper-d > /dev/null 2>&1 - if [ $? -eq 0 ]; then - LOG_INFO "软件包已安装,测试结束后将保持安装状态" - INSTALLED=1 - else - LOG_INFO "软件包未安装,将在测试前安装,并在测试后卸载" - INSTALLED=0 - fi - - LOG_INFO "检查yum源中是否存在texlive-tex4ht-htcontext-upper-d软件包" - dnf list available texlive-tex4ht-htcontext-upper-d > /dev/null 2>&1 - if [ $? -ne 0 ]; then - LOG_ERROR "yum源中未找到texlive-tex4ht-htcontext-upper-d软件包" - exit 255 - fi - - if [ $INSTALLED -eq 0 ]; then - LOG_INFO "开始安装texlive-tex4ht-htcontext-upper-d软件包" - dnf install -y texlive-tex4ht-htcontext-upper-d > /dev/null 2>&1 - CHECK_RESULT $? 0 0 "安装texlive-tex4ht-htcontext-upper-d软件包失败" - LOG_INFO "软件包安装成功" - fi - - LOG_INFO "检查htcontext命令是否存在" - which htcontext > /dev/null 2>&1 - CHECK_RESULT $? 0 0 "htcontext命令不存在" - - LOG_INFO "测试htcontext命令的调试模式参数" - htcontext --debug --help > /dev/null 2>&1 - if [ $? -eq 255 ]; then - LOG_ERROR "htcontext命令不支持调试模式参数" - exit 255 - fi - CHECK_RESULT $? 0 0 "htcontext命令调试模式执行失败" - - LOG_INFO "执行htcontext命令的调试模式" - htcontext --debug --version > /dev/null 2>&1 - CHECK_RESULT $? 0 0 "htcontext命令调试模式执行失败" - - LOG_INFO "htcontext命令调试模式测试成功" - - if [ $INSTALLED -eq 0 ]; then - LOG_INFO "开始卸载texlive-tex4ht-htcontext-upper-d软件包" - dnf remove -y texlive-tex4ht-htcontext-upper-d > /dev/null 2>&1 - CHECK_RESULT $? 0 0 "卸载texlive-tex4ht-htcontext-upper-d软件包失败" - LOG_INFO "软件包卸载成功,环境已恢复" - fi - - LOG_INFO "测试脚本执行完毕" -} - -main "$@" \ No newline at end of file diff --git a/testcases/function_test/pkg_test/texlive-base/texlive-tex4ht/test_texlive-tex4ht_htcontext_upper_f.sh b/testcases/function_test/pkg_test/texlive-base/texlive-tex4ht/test_texlive-tex4ht_htcontext_upper_f.sh deleted file mode 100644 index b49dce56f86..00000000000 --- a/testcases/function_test/pkg_test/texlive-base/texlive-tex4ht/test_texlive-tex4ht_htcontext_upper_f.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-02 -# @License : Mulan PSL v2 -# @Desc : 测试htcontext命令的强制模式 -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - # 判断是否已经安装texlive-tex4ht-htcontext包 - LOG_INFO "检查是否已安装texlive-tex4ht-htcontext包" - rpm -q texlive-tex4ht-htcontext - if [ $? -eq 0 ]; then - LOG_INFO "texlive-tex4ht-htcontext已安装,测试后将保持安装状态" - INSTALLED=true - else - LOG_INFO "texlive-tex4ht-htcontext未安装,测试后将卸载" - INSTALLED=false - fi - - # 检查yum源中是否有该软件包 - LOG_INFO "检查yum源中是否有texlive-tex4ht-htcontext包" - dnf list available texlive-tex4ht-htcontext - CHECK_RESULT $? 0 0 "yum源中未找到texlive-tex4ht-htcontext包" - if [ $? -ne 0 ]; then - LOG_ERROR "yum源中未找到texlive-tex4ht-htcontext包,退出测试" - exit 255 - fi - - # 如果未安装,则安装软件包 - if [ "$INSTALLED" = false ]; then - LOG_INFO "安装texlive-tex4ht-htcontext包" - dnf install -y texlive-tex4ht-htcontext - CHECK_RESULT $? 0 0 "安装texlive-tex4ht-htcontext失败" - fi - - # 测试htcontext命令是否存在 - LOG_INFO "检查htcontext命令是否存在" - which htcontext - CHECK_RESULT $? 0 0 "htcontext命令未找到" - - # 测试htcontext命令的强制模式参数 - LOG_INFO "测试htcontext命令的强制模式参数" - htcontext --help | grep -q -- "--force" - CHECK_RESULT $? 0 0 "htcontext命令不支持--force参数" - - # 创建一个测试文件用于测试强制模式 - LOG_INFO "创建测试文件test.tex" - cat > test.tex << "EOF" - \documentclass{article} - \begin{document} - Test document for htcontext. - \end{document} - EOF - CHECK_RESULT $? 0 0 "创建测试文件失败" - - # 使用htcontext命令的强制模式进行测试 - LOG_INFO "使用htcontext命令的强制模式转换测试文件" - htcontext --force test.tex - CHECK_RESULT $? 0 0 "htcontext命令强制模式执行失败" - - # 检查是否生成了输出文件 - LOG_INFO "检查是否生成了输出文件" - ls test.html - CHECK_RESULT $? 0 0 "未生成输出文件test.html" - - # 清理测试文件 - LOG_INFO "清理测试文件" - rm -f test.tex test.html - CHECK_RESULT $? 0 0 "清理测试文件失败" - - # 如果测试前未安装,则卸载软件包 - if [ "$INSTALLED" = false ]; then - LOG_INFO "卸载texlive-tex4ht-htcontext包" - dnf remove -y texlive-tex4ht-htcontext - CHECK_RESULT $? 0 0 "卸载texlive-tex4ht-htcontext失败" - fi - - LOG_INFO "测试完成" -} - -main "$@" \ No newline at end of file diff --git a/testcases/function_test/pkg_test/texlive-base/texlive-tex4ht/test_texlive-tex4ht_htcontext_upper_i.sh b/testcases/function_test/pkg_test/texlive-base/texlive-tex4ht/test_texlive-tex4ht_htcontext_upper_i.sh deleted file mode 100644 index 560d4aff391..00000000000 --- a/testcases/function_test/pkg_test/texlive-base/texlive-tex4ht/test_texlive-tex4ht_htcontext_upper_i.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 : 2026-03-02 -# @License : Mulan PSL v2 -# @Desc : 测试htcontext命令的交互模式 -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - LOG_INFO "开始测试:测试htcontext命令的交互模式" - - LOG_INFO "步骤1:检查环境是否已安装texlive-tex4ht-htcontext-upper-i软件包" - if dnf list installed texlive-tex4ht-htcontext-upper-i &>/dev/null; then - LOG_INFO "环境已安装texlive-tex4ht-htcontext-upper-i,测试后保持安装状态" - already_installed=true - else - LOG_INFO "环境未安装texlive-tex4ht-htcontext-upper-i,测试过程中将安装并最终卸载" - already_installed=false - fi - - LOG_INFO "步骤2:检查yum源中是否有texlive-tex4ht-htcontext-upper-i软件包" - if ! dnf list available texlive-tex4ht-htcontext-upper-i &>/dev/null; then - LOG_ERROR "yum源中没有找到texlive-tex4ht-htcontext-upper-i软件包" - exit 255 - fi - - if [ "$already_installed" = false ]; then - LOG_INFO "步骤3:安装texlive-tex4ht-htcontext-upper-i软件包" - dnf install -y texlive-tex4ht-htcontext-upper-i - CHECK_RESULT $? 0 0 "安装texlive-tex4ht-htcontext-upper-i失败" - fi - - LOG_INFO "步骤4:检查htcontext命令是否存在" - if ! command -v htcontext &>/dev/null; then - LOG_ERROR "htcontext命令不存在" - if [ "$already_installed" = false ]; then - dnf remove -y texlive-tex4ht-htcontext-upper-i - fi - exit 255 - fi - - LOG_INFO "步骤5:测试htcontext命令的交互模式" - LOG_INFO "执行htcontext命令,输入"i"进入交互模式" - echo "i" | htcontext - CHECK_RESULT $? 0 0 "htcontext命令交互模式测试失败" - - LOG_INFO "步骤6:清理测试环境" - if [ "$already_installed" = false ]; then - LOG_INFO "卸载texlive-tex4ht-htcontext-upper-i软件包" - dnf remove -y texlive-tex4ht-htcontext-upper-i - CHECK_RESULT $? 0 0 "卸载texlive-tex4ht-htcontext-upper-i失败" - fi - - LOG_INFO "测试完成:htcontext命令的交互模式测试通过" -} - -main "$@" \ No newline at end of file diff --git a/testcases/function_test/pkg_test/texlive-base/texlive-tex4ht/test_texlive-tex4ht_htcontext_upper_q.sh b/testcases/function_test/pkg_test/texlive-base/texlive-tex4ht/test_texlive-tex4ht_htcontext_upper_q.sh deleted file mode 100644 index 92b717364b8..00000000000 --- a/testcases/function_test/pkg_test/texlive-base/texlive-tex4ht/test_texlive-tex4ht_htcontext_upper_q.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-02 -# @License : Mulan PSL v2 -# @Desc : 测试htcontext命令的安静模式 -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - LOG_INFO "开始测试htcontext命令的安静模式" - - # 检查yum源中是否存在texlive-tex4ht-htcontext软件包 - LOG_INFO "检查yum源中是否存在texlive-tex4ht-htcontext软件包" - dnf list available texlive-tex4ht-htcontext &>/dev/null - CHECK_RESULT $? 0 0 "yum源中不存在texlive-tex4ht-htcontext软件包" - if [ $? -ne 0 ]; then - LOG_ERROR "yum源中不存在texlive-tex4ht-htcontext软件包" - exit 255 - fi - - # 检查是否已安装texlive-tex4ht-htcontext - LOG_INFO "检查是否已安装texlive-tex4ht-htcontext" - rpm -q texlive-tex4ht-htcontext &>/dev/null - already_installed=$? - - if [ $already_installed -ne 0 ]; then - LOG_INFO "未安装texlive-tex4ht-htcontext,开始安装" - dnf install -y texlive-tex4ht-htcontext - CHECK_RESULT $? 0 0 "安装texlive-tex4ht-htcontext失败" - LOG_INFO "安装texlive-tex4ht-htcontext成功" - else - LOG_INFO "texlive-tex4ht-htcontext已安装" - fi - - # 检查htcontext命令是否存在 - LOG_INFO "检查htcontext命令是否存在" - command -v htcontext &>/dev/null - CHECK_RESULT $? 0 0 "htcontext命令不存在" - if [ $? -ne 0 ]; then - LOG_ERROR "htcontext命令不存在" - exit 255 - fi - - # 测试htcontext命令的安静模式参数 - LOG_INFO "测试htcontext命令的安静模式参数" - htcontext --help | grep -q "\-\-quiet" - CHECK_RESULT $? 0 0 "htcontext命令不支持安静模式参数" - if [ $? -ne 0 ]; then - LOG_ERROR "htcontext命令不支持安静模式参数" - exit 255 - fi - - # 执行htcontext命令的安静模式 - LOG_INFO "执行htcontext命令的安静模式" - htcontext --quiet &>/dev/null - CHECK_RESULT $? 0 0 "htcontext命令安静模式执行失败" - - # 清理环境 - LOG_INFO "清理环境" - if [ $already_installed -ne 0 ]; then - LOG_INFO "卸载texlive-tex4ht-htcontext" - dnf remove -y texlive-tex4ht-htcontext - CHECK_RESULT $? 0 0 "卸载texlive-tex4ht-htcontext失败" - LOG_INFO "卸载texlive-tex4ht-htcontext成功" - else - LOG_INFO "保持texlive-tex4ht-htcontext安装状态" - fi - - LOG_INFO "测试htcontext命令的安静模式完成" -} - -main "$@" \ No newline at end of file diff --git a/testcases/function_test/pkg_test/texlive-base/texlive-tex4ht/test_texlive-tex4ht_htcontext_upper_s.sh b/testcases/function_test/pkg_test/texlive-base/texlive-tex4ht/test_texlive-tex4ht_htcontext_upper_s.sh deleted file mode 100644 index e3afb1908d7..00000000000 --- a/testcases/function_test/pkg_test/texlive-base/texlive-tex4ht/test_texlive-tex4ht_htcontext_upper_s.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-02 -# @License : Mulan PSL v2 -# @Desc : 测试htcontext命令的模拟运行模式 -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - LOG_INFO "开始测试htcontext命令的模拟运行模式" - - # 定义软件包名称 - PACKAGE_NAME="texlive-tex4ht" - - # 检查软件包是否已在yum源中 - LOG_INFO "检查yum源中是否存在软件包${PACKAGE_NAME}" - dnf list available ${PACKAGE_NAME} &>/dev/null - CHECK_RESULT $? 0 0 "yum源中不存在软件包${PACKAGE_NAME},退出测试" - - # 检查系统是否已安装该软件包 - 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 - - # 如果未安装,则安装软件包 - if [ "$INSTALLED" = false ]; then - LOG_INFO "安装软件包${PACKAGE_NAME}" - dnf install -y ${PACKAGE_NAME} - CHECK_RESULT $? 0 0 "安装软件包${PACKAGE_NAME}失败" - fi - - # 检查htcontext命令是否存在 - LOG_INFO "检查htcontext命令是否存在" - command -v htcontext &>/dev/null - CHECK_RESULT $? 0 0 "htcontext命令不存在" - - # 检查htcontext命令是否支持--simulate参数 - LOG_INFO "检查htcontext命令是否支持--simulate参数" - htcontext --help 2>&1 | grep -q -- --simulate - CHECK_RESULT $? 0 0 "htcontext命令不支持--simulate参数" - - # 测试htcontext命令的模拟运行模式 - LOG_INFO "执行htcontext命令的模拟运行模式" - htcontext --simulate - CHECK_RESULT $? 0 0 "htcontext命令模拟运行模式执行失败" - - # 环境清理 - LOG_INFO "开始清理测试环境" - if [ "$INSTALLED" = false ]; then - LOG_INFO "卸载软件包${PACKAGE_NAME}" - dnf remove -y ${PACKAGE_NAME} - CHECK_RESULT $? 0 0 "卸载软件包${PACKAGE_NAME}失败" - else - LOG_INFO "软件包${PACKAGE_NAME}在测试前已安装,保持安装状态" - fi - - LOG_INFO "测试完成" -} - -main "$@" \ No newline at end of file diff --git a/testcases/function_test/pkg_test/texlive-base/texlive-tex4ht/test_texlive-tex4ht_htcontext_upper_u.sh b/testcases/function_test/pkg_test/texlive-base/texlive-tex4ht/test_texlive-tex4ht_htcontext_upper_u.sh deleted file mode 100644 index d52c14574b1..00000000000 --- a/testcases/function_test/pkg_test/texlive-base/texlive-tex4ht/test_texlive-tex4ht_htcontext_upper_u.sh +++ /dev/null @@ -1,59 +0,0 @@ -#!/usr/bin/bash - -# Copyright (c) 2024 ISCAS .ALL rights reserved. -# This program is licensed under Mulan PSL v2. -# You can use it according to the terms and conditions of the Mulan PSL v2. -# http://license.coscl.org.cn/MulanPSL2 -# THIS PROGRAM IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, -# EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, -# MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. -# See the Mulan PSL v2 for more details. - -# ############################################# -# @Author : honghua -# @Contact : honghua@iscas.ac.cn -# @Date : 2026-03-02 -# @License : Mulan PSL v2 -# @Desc : 测试htcontext命令的UTF-8模式 -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - LOG_INFO "开始测试htcontext命令的UTF-8模式" - LOG_INFO "步骤1: 检查是否已安装texlive-tex4ht-htcontext软件包" - if rpm -q texlive-tex4ht-htcontext > /dev/null 2>&1; then - LOG_INFO "texlive-tex4ht-htcontext已安装,测试后保持安装状态" - INSTALLED=true - else - LOG_INFO "texlive-tex4ht-htcontext未安装,将在测试前安装" - INSTALLED=false - fi - LOG_INFO "步骤2: 检查yum源中是否有texlive-tex4ht-htcontext软件包" - if ! dnf list available texlive-tex4ht-htcontext > /dev/null 2>&1; then - LOG_ERROR "yum源中未找到texlive-tex4ht-htcontext软件包" - exit 255 - fi - if [ "$INSTALLED" = "false" ]; then - LOG_INFO "步骤3: 安装texlive-tex4ht-htcontext软件包" - dnf install -y texlive-tex4ht-htcontext - CHECK_RESULT $? 0 0 "安装texlive-tex4ht-htcontext失败" - fi - LOG_INFO "步骤4: 检查htcontext命令是否支持--utf8参数" - htcontext --help 2>&1 | grep -q -- --utf8 - CHECK_RESULT $? 0 255 "htcontext命令不支持--utf8参数" - LOG_INFO "步骤5: 执行htcontext命令的UTF-8模式测试" - htcontext --utf8 --version - CHECK_RESULT $? 0 0 "htcontext命令UTF-8模式执行失败" - LOG_INFO "步骤6: 清理测试环境" - if [ "$INSTALLED" = "false" ]; then - LOG_INFO "卸载texlive-tex4ht-htcontext软件包" - dnf remove -y texlive-tex4ht-htcontext - CHECK_RESULT $? 0 0 "卸载texlive-tex4ht-htcontext失败" - else - LOG_INFO "测试前已安装texlive-tex4ht-htcontext,保持安装状态" - fi - LOG_INFO "测试完成" -} - -main "$@" \ No newline at end of file diff --git a/testcases/function_test/pkg_test/texlive-base/texlive-tex4ht/test_texlive-tex4ht_htcontext_upper_v.sh b/testcases/function_test/pkg_test/texlive-base/texlive-tex4ht/test_texlive-tex4ht_htcontext_upper_v.sh deleted file mode 100644 index c3ae5e62f43..00000000000 --- a/testcases/function_test/pkg_test/texlive-base/texlive-tex4ht/test_texlive-tex4ht_htcontext_upper_v.sh +++ /dev/null @@ -1,69 +0,0 @@ -#!/usr/bin/bash - -# Copyright (c) 2024 ISCAS .ALL rights reserved. -# This program is licensed under Mulan PSL v2. -# You can use it according to the terms and conditions of the Mulan PSL v2. -# http://license.coscl.org.cn/MulanPSL2 -# THIS PROGRAM IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, -# EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, -# MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. -# See the Mulan PSL v2 for more details. - -# ############################################# -# @Author : honghua -# @Contact : honghua@iscas.ac.cn -# @Date : 2026-03-02 -# @License : Mulan PSL v2 -# @Desc : 测试htcontext命令的详细输出模式 -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - # 判断是否已安装texlive-tex4ht-htcontext包 - LOG_INFO "检查texlive-tex4ht-htcontext是否已安装" - rpm -q texlive-tex4ht-htcontext > /dev/null 2>&1 - if [ $? -eq 0 ]; then - LOG_INFO "texlive-tex4ht-htcontext已安装,测试结束后将保持安装状态" - INSTALLED_BEFORE=1 - else - LOG_INFO "texlive-tex4ht-htcontext未安装,将在测试前安装,测试后卸载" - INSTALLED_BEFORE=0 - fi - - # 检查yum源中是否有该软件包 - LOG_INFO "检查yum源中是否有texlive-tex4ht-htcontext包" - dnf list texlive-tex4ht-htcontext > /dev/null 2>&1 - CHECK_RESULT $? 0 0 "yum源中未找到texlive-tex4ht-htcontext包" - if [ $? -ne 0 ]; then - LOG_ERROR "yum源中未找到texlive-tex4ht-htcontext包,退出测试" - exit 255 - fi - - # 如果未安装,则安装软件包 - if [ $INSTALLED_BEFORE -eq 0 ]; then - LOG_INFO "安装texlive-tex4ht-htcontext包" - dnf install -y texlive-tex4ht-htcontext > /dev/null 2>&1 - CHECK_RESULT $? 0 0 "安装texlive-tex4ht-htcontext失败" - fi - - # 测试htcontext命令的详细输出模式 - LOG_INFO "测试htcontext命令的详细输出模式" - htcontext --help | grep -q "verbose" - CHECK_RESULT $? 0 0 "htcontext命令不支持--help参数或未找到verbose选项" - - LOG_INFO "执行htcontext命令的详细输出模式" - htcontext --verbose 2>&1 | head -5 - CHECK_RESULT $? 0 0 "执行htcontext --verbose命令失败" - - # 如果测试前未安装,测试后卸载软件包 - if [ $INSTALLED_BEFORE -eq 0 ]; then - LOG_INFO "卸载texlive-tex4ht-htcontext包" - dnf remove -y texlive-tex4ht-htcontext > /dev/null 2>&1 - CHECK_RESULT $? 0 0 "卸载texlive-tex4ht-htcontext失败" - fi - - LOG_INFO "测试完成,环境已恢复" -} - -main "$@" \ No newline at end of file diff --git a/testcases/function_test/pkg_test/texlive-base/texlive-tex4ht/test_texlive-tex4ht_htcontext_version.sh b/testcases/function_test/pkg_test/texlive-base/texlive-tex4ht/test_texlive-tex4ht_htcontext_version.sh deleted file mode 100644 index 641ed1300f3..00000000000 --- a/testcases/function_test/pkg_test/texlive-base/texlive-tex4ht/test_texlive-tex4ht_htcontext_version.sh +++ /dev/null @@ -1,68 +0,0 @@ -#!/usr/bin/bash - -# Copyright (c) 2024 ISCAS .ALL rights reserved. -# This program is licensed under Mulan PSL v2. -# You can use it according to the terms and conditions of the Mulan PSL v2. -# http://license.coscl.org.cn/MulanPSL2 -# THIS PROGRAM IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, -# EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, -# MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. -# See the Mulan PSL v2 for more details. - -# ############################################# -# @Author : honghua -# @Contact : honghua@iscas.ac.cn -# @Date : 2026-03-02 -# @License : Mulan PSL v2 -# @Desc : 测试显示htcontext命令的版本信息 -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - # 检查是否已安装texlive-tex4ht-htcontext - LOG_INFO "检查texlive-tex4ht-htcontext是否已安装" - rpm -q texlive-tex4ht-htcontext > /dev/null 2>&1 - INSTALLED=$? - - # 检查yum源中是否有该软件包 - LOG_INFO "检查yum源中是否有texlive-tex4ht-htcontext软件包" - dnf list available texlive-tex4ht-htcontext > /dev/null 2>&1 - if [ $? -ne 0 ]; then - LOG_ERROR "yum源中未找到texlive-tex4ht-htcontext软件包" - exit 255 - fi - - # 如果未安装,则安装软件包 - if [ $INSTALLED -ne 0 ]; then - LOG_INFO "安装texlive-tex4ht-htcontext软件包" - dnf install -y texlive-tex4ht-htcontext - CHECK_RESULT $? 0 0 "安装texlive-tex4ht-htcontext失败" - fi - - # 测试显示htcontext命令的版本信息 - LOG_INFO "测试显示htcontext命令的版本信息" - htcontext --version > /dev/null 2>&1 - if [ $? -ne 0 ]; then - LOG_ERROR "htcontext命令不支持--version参数" - # 如果是未安装的情况,需要卸载软件包 - if [ $INSTALLED -ne 0 ]; then - LOG_INFO "卸载texlive-tex4ht-htcontext软件包" - dnf remove -y texlive-tex4ht-htcontext - CHECK_RESULT $? 0 0 "卸载texlive-tex4ht-htcontext失败" - fi - exit 255 - fi - - htcontext --version - CHECK_RESULT $? 0 0 "显示htcontext版本信息失败" - - # 环境恢复:如果之前未安装,则卸载软件包 - if [ $INSTALLED -ne 0 ]; then - LOG_INFO "卸载texlive-tex4ht-htcontext软件包" - dnf remove -y texlive-tex4ht-htcontext - CHECK_RESULT $? 0 0 "卸载texlive-tex4ht-htcontext失败" - fi -} - -main "$@" \ No newline at end of file diff --git a/testcases/function_test/pkg_test/texlive-base/texlive-tex4ht/test_texlive-tex4ht_htlatex__upper_v.sh b/testcases/function_test/pkg_test/texlive-base/texlive-tex4ht/test_texlive-tex4ht_htlatex__upper_v.sh deleted file mode 100644 index 61b733d2f9e..00000000000 --- a/testcases/function_test/pkg_test/texlive-base/texlive-tex4ht/test_texlive-tex4ht_htlatex__upper_v.sh +++ /dev/null @@ -1,58 +0,0 @@ -#!/usr/bin/bash - -# Copyright (c) 2024 ISCAS .ALL rights reserved. -# This program is licensed under Mulan PSL v2. -# You can use it according to the terms and conditions of the Mulan PSL v2. -# http://license.coscl.org.cn/MulanPSL2 -# THIS PROGRAM IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, -# EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, -# MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. -# See the Mulan PSL v2 for more details. - -# ############################################# -# @Author : honghua -# @Contact : honghua@iscas.ac.cn -# @Date : 2025-11-27 -# @License : Mulan PSL v2 -# @Desc : 测试 htlatex 命令的 V 参数 -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - LOG_INFO "开始测试 htlatex 命令的 V 参数" - - # 检查是否已安装 texlive-tex4ht - LOG_INFO "检查是否已安装 texlive-tex4ht" - if ! dnf list installed texlive-tex4ht &>/dev/null; then - LOG_INFO "texlive-tex4ht 未安装,将进行安装" - # 检查 yum 源中是否有该软件包 - if ! dnf list available texlive-tex4ht &>/dev/null; then - LOG_ERROR "yum 源中未找到 texlive-tex4ht 软件包" - exit 255 - fi - # 安装软件包 - dnf install -y texlive-tex4ht - CHECK_RESULT $? 0 0 "安装 texlive-tex4ht 失败" - # 标记需要卸载 - NEED_UNINSTALL=1 - else - LOG_INFO "texlive-tex4ht 已安装,无需重新安装" - fi - - # 测试 htlatex 命令的 V 参数 - LOG_INFO "测试 htlatex 命令的 V 参数" - htlatex --version - CHECK_RESULT $? 0 0 "htlatex 命令的 V 参数测试失败" - - # 清理环境(如果之前未安装) - if [[ $NEED_UNINSTALL -eq 1 ]]; then - LOG_INFO "卸载 texlive-tex4ht" - dnf remove -y texlive-tex4ht - CHECK_RESULT $? 0 0 "卸载 texlive-tex4ht 失败" - fi - - LOG_INFO "测试完成" -} - -main "$@" \ No newline at end of file diff --git a/testcases/function_test/pkg_test/texlive-base/texlive-tex4ht/test_texlive-tex4ht_htlatex__v.sh b/testcases/function_test/pkg_test/texlive-base/texlive-tex4ht/test_texlive-tex4ht_htlatex__v.sh deleted file mode 100644 index 686fbc93356..00000000000 --- a/testcases/function_test/pkg_test/texlive-base/texlive-tex4ht/test_texlive-tex4ht_htlatex__v.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-27 -# @License : Mulan PSL v2 -# @Desc : 测试 htlatex 命令的 v 参数 -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - LOG_INFO "开始测试 htlatex 命令的 v 参数" - - # 检查是否已安装 texlive-tex4ht 包 - LOG_INFO "检查 texlive-tex4ht 是否已安装" - if ! dnf list installed texlive-tex4ht &> /dev/null; then - LOG_INFO "texlive-tex4ht 未安装,将进行安装" - INSTALLED=false - else - LOG_INFO "texlive-tex4ht 已安装" - INSTALLED=true - fi - - # 检查 yum 源中是否有 texlive-tex4ht 包 - LOG_INFO "检查 yum 源中是否有 texlive-tex4ht 包" - if ! dnf list available texlive-tex4ht &> /dev/null; then - LOG_ERROR "yum 源中未找到 texlive-tex4ht 包" - exit 255 - fi - - # 如果未安装,则安装 texlive-tex4ht - if [ "$INSTALLED" = false ]; then - LOG_INFO "正在安装 texlive-tex4ht" - dnf install -y texlive-tex4ht - CHECK_RESULT $? 0 0 "安装 texlive-tex4ht 失败" - fi - - # 测试 htlatex 命令的 v 参数 - LOG_INFO "测试 htlatex 命令的 v 参数" - htlatex --v &> /dev/null - CHECK_RESULT $? 0 0 "htlatex --v 命令执行失败" - - #如果未安装,则卸载 texlive-tex4ht - if [ "$INSTALLED" = false ]; then - LOG_INFO "正在卸载 texlive-tex4ht" - dnf remove -y texlive-tex4ht - CHECK_RESULT $?10"卸载 texlive- te x4h t失败 " - fi - - LOG_INFO"测试完成" -} - -main "$@" \ No newline at end of file diff --git a/testcases/function_test/pkg_test/texlive-base/texlive-tex4ht/test_texlive-tex4ht_htlatex_h.sh b/testcases/function_test/pkg_test/texlive-base/texlive-tex4ht/test_texlive-tex4ht_htlatex_h.sh deleted file mode 100644 index 141952d9ef8..00000000000 --- a/testcases/function_test/pkg_test/texlive-base/texlive-tex4ht/test_texlive-tex4ht_htlatex_h.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 : 2026-03-02 -# @License : Mulan PSL v2 -# @Desc : 测试htlatex命令的-h参数,用于显示帮助信息 -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - # 判断是否已经安装了texlive-tex4ht包 - LOG_INFO "检查是否已安装texlive-tex4ht包" - rpm -q texlive-tex4ht - if [ $? -eq 0 ]; then - LOG_INFO "texlive-tex4ht包已安装,脚本结束后将保持安装状态" - INSTALLED=true - else - LOG_INFO "texlive-tex4ht包未安装,将在测试后卸载" - INSTALLED=false - fi - - # 检查yum源中是否有该软件包 - LOG_INFO "检查yum源中是否有texlive-tex4ht包" - dnf list available texlive-tex4ht 2>&1 | grep -q "texlive-tex4ht" - if [ $? -ne 0 ]; then - LOG_ERROR "yum源中未找到texlive-tex4ht包" - exit 255 - fi - - # 如果未安装,则安装软件包 - if [ "$INSTALLED" = "false" ]; then - LOG_INFO "开始安装texlive-tex4ht包" - dnf install -y texlive-tex4ht - CHECK_RESULT $? 0 0 "安装texlive-tex4ht包失败" - fi - - # 检查htlatex命令是否存在 - LOG_INFO "检查htlatex命令是否存在" - which htlatex - CHECK_RESULT $? 0 0 "htlatex命令未找到" - - # 测试htlatex命令的-h参数 - LOG_INFO "测试htlatex命令的-h参数,用于显示帮助信息" - htlatex -h 2>&1 | head -5 - CHECK_RESULT $? 0 0 "htlatex -h命令执行失败" - - # 如果测试前未安装,则在测试后卸载软件包 - if [ "$INSTALLED" = "false" ]; then - LOG_INFO "测试完成,开始卸载texlive-tex4ht包" - dnf remove -y texlive-tex4ht - CHECK_RESULT $? 0 0 "卸载texlive-tex4ht包失败" - LOG_INFO "环境已恢复到测试前状态" - else - LOG_INFO "测试完成,保持texlive-tex4ht包安装状态" - fi -} - -main "$@" \ No newline at end of file diff --git a/testcases/function_test/pkg_test/texlive-base/texlive-tex4ht/test_texlive-tex4ht_htlatex_h_upper_i.sh b/testcases/function_test/pkg_test/texlive-base/texlive-tex4ht/test_texlive-tex4ht_htlatex_h_upper_i.sh deleted file mode 100644 index 600b9a1db12..00000000000 --- a/testcases/function_test/pkg_test/texlive-base/texlive-tex4ht/test_texlive-tex4ht_htlatex_h_upper_i.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-03-02 -# @License : Mulan PSL v2 -# @Desc : 测试htlatex命令的-h和-I参数组合,显示帮助信息并指定输入文件 -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - # 环境检查:检查是否已安装texlive-tex4ht包 - LOG_INFO "检查是否已安装texlive-tex4ht软件包" - rpm -q texlive-tex4ht > /dev/null 2>&1 - if [ $? -eq 0 ]; then - LOG_INFO "检测到texlive-tex4ht已安装,标记为已安装状态" - INSTALLED=1 - else - LOG_INFO "未检测到texlive-tex4ht安装,标记为未安装状态" - INSTALLED=0 - fi - - # 检查yum源中是否存在texlive-tex4ht包 - LOG_INFO "检查yum源中是否存在texlive-tex4ht软件包" - dnf list available texlive-tex4ht > /dev/null 2>&1 - if [ $? -ne 0 ]; then - LOG_ERROR "yum源中未找到texlive-tex4ht软件包" - exit 255 - fi - LOG_INFO "yum源中存在texlive-tex4ht软件包" - - # 如果未安装,则安装软件包 - if [ $INSTALLED -eq 0 ]; then - LOG_INFO "开始安装texlive-tex4ht软件包" - dnf install -y texlive-tex4ht > /dev/null 2>&1 - CHECK_RESULT $? 0 0 "安装texlive-tex4ht失败" - LOG_INFO "texlive-tex4ht软件包安装成功" - fi - - # 检查htlatex命令是否存在 - LOG_INFO "检查htlatex命令是否存在" - command -v htlatex > /dev/null 2>&1 - if [ $? -ne 0 ]; then - LOG_ERROR "htlatex命令不存在,可能安装不完整" - exit 255 - fi - LOG_INFO "htlatex命令存在" - - # 测试htlatex命令的-h参数是否存在 - LOG_INFO "测试htlatex命令的-h参数" - htlatex -h > /dev/null 2>&1 - if [ $? -eq 255 ]; then - LOG_ERROR "htlatex命令不支持-h参数" - exit 255 - fi - LOG_INFO "htlatex命令支持-h参数" - - # 测试htlatex命令的-I参数是否存在 - LOG_INFO "测试htlatex命令的-I参数" - htlatex -I > /dev/null 2>&1 - if [ $? -eq 255 ]; then - LOG_ERROR "htlatex命令不支持-I参数" - exit 255 - fi - LOG_INFO "htlatex命令支持-I参数" - - # 创建测试用的LaTeX文件 - LOG_INFO "创建测试用的LaTeX文件" - cat > test.tex << "EOF" - \documentclass{article} - \begin{document} - Hello, World! - \end{document} - EOF - CHECK_RESULT $? 0 0 "创建test.tex文件失败" - - # 测试htlatex命令的-h和-I参数组合,显示帮助信息并指定输入文件 - LOG_INFO "测试htlatex命令的-h和-I参数组合,显示帮助信息并指定输入文件" - htlatex -h -I test.tex > output.log 2>&1 - CHECK_RESULT $? 0 0 "htlatex -h -I test.tex执行失败" - - # 检查输出是否包含帮助信息 - LOG_INFO "检查输出是否包含帮助信息" - grep -q "Usage" output.log - CHECK_RESULT $? 0 0 "输出中未找到帮助信息" - LOG_INFO "输出中包含帮助信息" - - # 清理测试文件 - LOG_INFO "清理测试文件" - rm -f test.tex output.log - CHECK_RESULT $? 0 0 "清理测试文件失败" - - # 如果测试前未安装,则在测试结束后卸载软件包 - if [ $INSTALLED -eq 0 ]; then - LOG_INFO "测试前未安装,开始卸载texlive-tex4ht软件包" - dnf remove -y texlive-tex4ht > /dev/null 2>&1 - CHECK_RESULT $? 0 0 "卸载texlive-tex4ht失败" - LOG_INFO "texlive-tex4ht软件包卸载成功" - else - LOG_INFO "测试前已安装,保持texlive-tex4ht软件包安装状态" - fi - - LOG_INFO "测试脚本执行完成" -} - -main "$@" \ No newline at end of file diff --git a/testcases/function_test/pkg_test/texlive-base/texlive-tex4ht/test_texlive-tex4ht_htlatex_l.sh b/testcases/function_test/pkg_test/texlive-base/texlive-tex4ht/test_texlive-tex4ht_htlatex_l.sh deleted file mode 100644 index 9d5f77db745..00000000000 --- a/testcases/function_test/pkg_test/texlive-base/texlive-tex4ht/test_texlive-tex4ht_htlatex_l.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-02 -# @License : Mulan PSL v2 -# @Desc : 测试htlatex命令的-l参数,用于指定LaTeX格式 -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - LOG_INFO "开始测试htlatex命令的-l参数,用于指定LaTeX格式" - LOG_INFO "步骤1:检查texlive-tex4ht软件包是否在yum源中" - if ! dnf list available texlive-tex4ht &>/dev/null; then - LOG_ERROR "yum源中未找到texlive-tex4ht软件包" - exit 255 - fi - LOG_INFO "texlive-tex4ht软件包在yum源中存在" - LOG_INFO "步骤2:检查系统是否已安装texlive-tex4ht软件包" - if rpm -q texlive-tex4ht &>/dev/null; then - LOG_INFO "texlive-tex4ht软件包已安装,测试后保持安装状态" - INSTALLED=true - else - LOG_INFO "texlive-tex4ht软件包未安装,将进行安装" - INSTALLED=false - fi - if [ "$INSTALLED" = false ]; then - LOG_INFO "步骤3:安装texlive-tex4ht软件包" - dnf install -y texlive-tex4ht - CHECK_RESULT $? 0 0 "安装texlive-tex4ht软件包失败" - fi - LOG_INFO "步骤4:验证htlatex命令是否可用" - command -v htlatex - CHECK_RESULT $? 0 0 "htlatex命令不存在" - LOG_INFO "步骤5:测试htlatex命令的-l参数是否支持" - htlatex --help 2>&1 | grep -q -- "-l" - CHECK_RESULT $? 0 0 "htlatex命令不支持-l参数" - LOG_INFO "步骤6:创建一个简单的LaTeX测试文件" - cat > test.tex << "EOF" - \documentclass{article} - \begin{document} - Hello, World! - \end{document} - EOF - LOG_INFO "步骤7:使用htlatex命令的-l参数指定LaTeX格式执行测试" - htlatex test.tex "html,mathml" "" "" "-l" 2>&1 - CHECK_RESULT $? 0 0 "htlatex命令执行失败" - LOG_INFO "步骤8:验证是否生成了HTML输出文件" - ls test.html - CHECK_RESULT $? 0 0 "未生成预期的HTML输出文件" - LOG_INFO "步骤9:清理测试文件" - rm -f test.tex test.html test.css test*.png test*.svg test*.log test*.aux test*.4ct test*.4tc test*.dvi test*.idv test*.lg test*.tmp test*.xref - if [ "$INSTALLED" = false ]; then - LOG_INFO "步骤10:卸载之前安装的texlive-tex4ht软件包" - dnf remove -y texlive-tex4ht - CHECK_RESULT $? 0 0 "卸载texlive-tex4ht软件包失败" - else - LOG_INFO "步骤10:保持texlive-tex4ht软件包的安装状态" - fi - LOG_INFO "测试完成" -} - -main "$@" \ No newline at end of file diff --git a/testcases/function_test/pkg_test/texlive-base/texlive-tex4ht/test_texlive-tex4ht_htlatex_l_upper_d.sh b/testcases/function_test/pkg_test/texlive-base/texlive-tex4ht/test_texlive-tex4ht_htlatex_l_upper_d.sh deleted file mode 100644 index 02f16ce1069..00000000000 --- a/testcases/function_test/pkg_test/texlive-base/texlive-tex4ht/test_texlive-tex4ht_htlatex_l_upper_d.sh +++ /dev/null @@ -1,91 +0,0 @@ -#!/usr/bin/bash - -# Copyright (c) 2024 ISCAS .ALL rights reserved. -# This program is licensed under Mulan PSL v2. -# You can use it according to the terms and conditions of the Mulan PSL v2. -# http://license.coscl.org.cn/MulanPSL2 -# THIS PROGRAM IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, -# EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, -# MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. -# See the Mulan PSL v2 for more details. - -# ############################################# -# @Author : honghua -# @Contact : honghua@iscas.ac.cn -# @Date : 2026-03-02 -# @License : Mulan PSL v2 -# @Desc : 测试htlatex命令的-l和-D参数组合,指定LaTeX格式和输出目录 -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - # 检查是否已安装texlive-tex4ht - LOG_INFO "检查texlive-tex4ht是否已安装" - rpm -q texlive-tex4ht > /dev/null 2>&1 - INSTALLED=$? - - # 定义软件包名 - PACKAGE="texlive-tex4ht" - - # 检查软件包是否在yum源中 - LOG_INFO "检查软件包是否在yum源中" - dnf list available $PACKAGE > /dev/null 2>&1 - if [ $? -ne 0 ]; then - LOG_ERROR "软件包 $PACKAGE 不在yum源中" - exit 255 - fi - - # 如果未安装,则安装软件包 - if [ $INSTALLED -ne 0 ]; then - LOG_INFO "安装 $PACKAGE" - dnf install -y $PACKAGE - CHECK_RESULT $? 0 0 "安装 $PACKAGE 失败" - fi - - # 创建测试目录和测试文件 - LOG_INFO "创建测试目录和测试文件" - TEST_DIR="/tmp/test_htlatex" - mkdir -p $TEST_DIR - TEST_TEX="$TEST_DIR/test.tex" - cat > $TEST_TEX << "EOF" - \documentclass{article} - \begin{document} - Hello, World! - \end{document} - EOF - CHECK_RESULT $? 0 0 "创建测试文件失败" - - # 检查htlatex命令是否存在 - LOG_INFO "检查htlatex命令是否存在" - which htlatex > /dev/null 2>&1 - CHECK_RESULT $? 0 0 "htlatex命令不存在" - - # 测试htlatex命令的-l和-D参数组合 - LOG_INFO "测试htlatex命令的-l和-D参数组合,指定LaTeX格式和输出目录" - OUTPUT_DIR="$TEST_DIR/output" - mkdir -p $OUTPUT_DIR - htlatex $TEST_TEX "html,4" "" "" "-l -D$OUTPUT_DIR" > /dev/null 2>&1 - CHECK_RESULT $? 0 0 "htlatex命令执行失败,参数可能不支持" - - # 检查输出文件是否存在 - LOG_INFO "检查输出文件是否生成" - [ -f "$OUTPUT_DIR/test.html" ] - CHECK_RESULT $? 0 0 "输出文件未生成,参数可能无效" - - # 清理测试目录 - LOG_INFO "清理测试目录" - rm -rf $TEST_DIR - CHECK_RESULT $? 0 0 "清理测试目录失败" - - # 如果脚本开始时未安装,则卸载软件包 - if [ $INSTALLED -ne 0 ]; then - LOG_INFO "卸载 $PACKAGE" - dnf remove -y $PACKAGE - CHECK_RESULT $? 0 0 "卸载 $PACKAGE 失败" - fi - - LOG_INFO "测试完成" -} - -main "$@" \ No newline at end of file diff --git a/testcases/function_test/pkg_test/texlive-base/texlive-tex4ht/test_texlive-tex4ht_htlatex_upper_a.sh b/testcases/function_test/pkg_test/texlive-base/texlive-tex4ht/test_texlive-tex4ht_htlatex_upper_a.sh deleted file mode 100644 index 67be2cf98de..00000000000 --- a/testcases/function_test/pkg_test/texlive-base/texlive-tex4ht/test_texlive-tex4ht_htlatex_upper_a.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-02 -# @License : Mulan PSL v2 -# @Desc : 测试htlatex命令的-A参数,用于指定额外的DVI过滤器参数 -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - # 检查是否已安装texlive-tex4ht - LOG_INFO "检查texlive-tex4ht是否已安装" - if rpm -q texlive-tex4ht &> /dev/null; then - LOG_INFO "texlive-tex4ht已安装,测试结束后将保持安装状态" - INSTALLED=1 - else - LOG_INFO "texlive-tex4ht未安装,将在测试过程中安装" - INSTALLED=0 - fi - - # 检查yum源中是否有texlive-tex4ht软件包 - LOG_INFO "检查yum源中是否有texlive-tex4ht软件包" - if ! dnf list available texlive-tex4ht &> /dev/null; then - LOG_ERROR "yum源中未找到texlive-tex4ht软件包" - exit 255 - fi - - # 如果未安装,则安装texlive-tex4ht - if [ $INSTALLED -eq 0 ]; then - LOG_INFO "安装texlive-tex4ht" - dnf install -y texlive-tex4ht - CHECK_RESULT $? 0 0 "安装texlive-tex4ht失败" - fi - - # 检查htlatex命令是否存在 - LOG_INFO "检查htlatex命令是否存在" - if ! command -v htlatex &> /dev/null; then - LOG_ERROR "htlatex命令不存在" - exit 255 - fi - - # 测试htlatex命令的-A参数是否存在 - LOG_INFO "测试htlatex命令的-A参数是否存在" - htlatex --help 2>&1 | grep -q -- "-A" - CHECK_RESULT $? 0 0 "htlatex命令不支持-A参数" - - # 创建测试用的简单LaTeX文件 - LOG_INFO "创建测试用的LaTeX文件" - cat > test.tex << "EOF" - \documentclass{article} - \begin{document} - Hello, World! - \end{document} - EOF - - # 使用htlatex命令并指定-A参数 - LOG_INFO "执行htlatex命令并指定-A参数" - htlatex test.tex "" "" "-A -d300" &> htlatex.log - CHECK_RESULT $? 0 0 "htlatex命令执行失败" - - # 检查生成的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 test.idv test.lg test.tmp test.xref htlatex.log - - # 如果测试前未安装,则卸载texlive-tex4ht - if [ $INSTALLED -eq 0 ]; then - LOG_INFO "卸载texlive-tex4ht" - dnf remove -y texlive-tex4ht - CHECK_RESULT $? 0 0 "卸载texlive-tex4ht失败" - fi - - LOG_INFO "测试完成" -} - -main "$@" \ No newline at end of file diff --git a/testcases/function_test/pkg_test/texlive-base/texlive-tex4ht/test_texlive-tex4ht_htlatex_upper_c.sh b/testcases/function_test/pkg_test/texlive-base/texlive-tex4ht/test_texlive-tex4ht_htlatex_upper_c.sh deleted file mode 100644 index 8739ce70598..00000000000 --- a/testcases/function_test/pkg_test/texlive-base/texlive-tex4ht/test_texlive-tex4ht_htlatex_upper_c.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-02 -# @License : Mulan PSL v2 -# @Desc : 测试htlatex命令的-C参数,用于指定自定义配置 -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - set -e - - # 检查软件包是否存在 - LOG_INFO "检查texlive-tex4ht软件包是否在yum源中" - if ! dnf list texlive-tex4ht >/dev/null 2>&1; then - LOG_ERROR "texlive-tex4ht软件包不在yum源中" - exit 255 - fi - - # 检查htlatex命令的-C参数是否支持 - LOG_INFO "检查htlatex命令的-C参数是否支持" - if ! htlatex --help 2>&1 | grep -q "\-C"; then - LOG_ERROR "htlatex命令不支持-C参数" - exit 255 - fi - - # 判断是否已安装 - LOG_INFO "检查texlive-tex4ht是否已安装" - if rpm -q texlive-tex4ht >/dev/null 2>&1; then - LOG_INFO "texlive-tex4ht已安装,标记为无需清理" - NEED_CLEANUP=0 - else - LOG_INFO "texlive-tex4ht未安装,标记为需要清理" - NEED_CLEANUP=1 - # 安装软件包 - LOG_INFO "安装texlive-tex4ht软件包" - dnf install -y texlive-tex4ht - CHECK_RESULT $? 0 0 "安装texlive-tex4ht失败" - fi - - # 创建测试文件 - LOG_INFO "创建测试TeX文件" - cat > test.tex << "EOF" - \documentclass{article} - \begin{document} - Hello, World! - \end{document} - EOF - - # 创建自定义配置文件 - LOG_INFO "创建自定义配置文件" - cat > custom.cfg << "EOF" - \Preamble{xhtml} - \Configure{@HEAD}{\HCode{}} - \begin{document} - \EndPreamble - EOF - - # 使用htlatex命令的-C参数指定自定义配置 - LOG_INFO "使用htlatex命令的-C参数处理测试文件" - htlatex test.tex "custom.cfg" "" "" "-C" - CHECK_RESULT $? 0 0 "htlatex命令执行失败" - - # 检查生成的HTML文件 - LOG_INFO "检查生成的HTML文件" - if [ -f test.html ]; then - LOG_INFO "成功生成HTML文件" - if grep -q "charset=utf-8" test.html; then - LOG_INFO "自定义配置生效" - else - LOG_ERROR "自定义配置未生效" - exit 1 - fi - else - LOG_ERROR "未生成HTML文件" - exit 1 - fi - - # 清理测试文件 - LOG_INFO "清理测试文件" - rm -f test.tex custom.cfg test.html test.css test*.png test*.svg test*.idv test*.lg test*.log test*.tmp test*.xref test*.4ct test*.4tc test*.dvi - - # 如果之前未安装,则卸载软件包 - if [ $NEED_CLEANUP -eq 1 ]; then - LOG_INFO "卸载texlive-tex4ht软件包" - dnf remove -y texlive-tex4ht - CHECK_RESULT $? 0 0 "卸载texlive-tex4ht失败" - fi - - LOG_INFO "测试完成" -} - -main "$@" \ No newline at end of file diff --git a/testcases/function_test/pkg_test/texlive-base/texlive-tex4ht/test_texlive-tex4ht_htlatex_upper_d.sh b/testcases/function_test/pkg_test/texlive-base/texlive-tex4ht/test_texlive-tex4ht_htlatex_upper_d.sh deleted file mode 100644 index b7b19c19db2..00000000000 --- a/testcases/function_test/pkg_test/texlive-base/texlive-tex4ht/test_texlive-tex4ht_htlatex_upper_d.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-02 -# @License : Mulan PSL v2 -# @Desc : 测试htlatex命令的-D参数,用于指定输出目录 -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - # 检查是否已经安装了texlive-tex4ht软件包 - LOG_INFO "步骤1:检查texlive-tex4ht软件包是否已安装" - if dnf list installed texlive-tex4ht > /dev/null 2>&1; then - LOG_INFO "texlive-tex4ht已安装,脚本结束后将保持安装状态" - INSTALLED=1 - else - LOG_INFO "texlive-tex4ht未安装,将在测试过程中安装,并在测试结束后卸载" - INSTALLED=0 - fi - - # 检查yum源中是否有texlive-tex4ht软件包 - LOG_INFO "步骤2:检查yum源中是否有texlive-tex4ht软件包" - if ! dnf list available texlive-tex4ht > /dev/null 2>&1; then - LOG_ERROR "yum源中未找到texlive-tex4ht软件包" - exit 255 - fi - - # 如果未安装,则安装texlive-tex4ht - if [ $INSTALLED -eq 0 ]; then - LOG_INFO "步骤3:安装texlive-tex4ht软件包" - dnf install -y texlive-tex4ht - CHECK_RESULT $? 0 0 "安装texlive-tex4ht失败" - fi - - # 检查htlatex命令是否存在 - LOG_INFO "步骤4:检查htlatex命令是否存在" - command -v htlatex > /dev/null 2>&1 - CHECK_RESULT $? 0 0 "htlatex命令不存在" - - # 测试htlatex命令的-D参数,用于指定输出目录 - LOG_INFO "步骤5:测试htlatex命令的-D参数,用于指定输出目录" - # 创建一个测试用的简单LaTeX文件 - cat > test.tex << "EOF" - \documentclass{article} - \begin{document} - Hello, World! - \end{document} - EOF - - # 使用-D参数指定输出目录为output_dir - LOG_INFO "执行htlatex命令,指定输出目录为output_dir" - htlatex test.tex "html" "" "" "-doutput_dir" 2>&1 - CHECK_RESULT $? 0 0 "htlatex命令执行失败" - - # 检查输出目录是否存在 - LOG_INFO "步骤6:检查输出目录是否存在" - if [ -d "output_dir" ]; then - LOG_INFO "输出目录output_dir创建成功" - else - LOG_ERROR "输出目录output_dir未创建" - exit 1 - fi - - # 检查输出目录中是否生成了预期的文件 - LOG_INFO "步骤7:检查输出目录中是否生成了预期的文件" - if [ -f "output_dir/test.html" ]; then - LOG_INFO "成功生成了test.html文件" - else - LOG_ERROR "未生成test.html文件" - exit 1 - fi - - # 清理测试文件 - LOG_INFO "步骤8:清理测试文件" - rm -f test.tex - rm -rf output_dir - - # 如果测试前未安装,则卸载texlive-tex4ht - if [ $INSTALLED -eq 0 ]; then - LOG_INFO "步骤9:卸载texlive-tex4ht软件包" - dnf remove -y texlive-tex4ht - CHECK_RESULT $? 0 0 "卸载texlive-tex4ht失败" - fi - - LOG_INFO "测试完成" -} - -main "$@" \ No newline at end of file diff --git a/testcases/function_test/pkg_test/texlive-base/texlive-tex4ht/test_texlive-tex4ht_htlatex_upper_f.sh b/testcases/function_test/pkg_test/texlive-base/texlive-tex4ht/test_texlive-tex4ht_htlatex_upper_f.sh deleted file mode 100644 index eb6c3fe8fe3..00000000000 --- a/testcases/function_test/pkg_test/texlive-base/texlive-tex4ht/test_texlive-tex4ht_htlatex_upper_f.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-02 -# @License : Mulan PSL v2 -# @Desc : 测试htlatex命令的-F参数,用于指定配置文件 -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - # 判断环境是否已安装texlive-tex4ht - LOG_INFO "检查是否已安装texlive-tex4ht" - rpm -q texlive-tex4ht > /dev/null 2>&1 - if [ $? -eq 0 ]; then - LOG_INFO "texlive-tex4ht已安装,脚本结束后保持安装状态" - INSTALLED_FLAG=1 - else - LOG_INFO "texlive-tex4ht未安装,将在测试中安装" - INSTALLED_FLAG=0 - fi - - # 检查yum源中是否有texlive-tex4ht软件包 - LOG_INFO "检查yum源中是否有texlive-tex4ht软件包" - dnf list available texlive-tex4ht > /dev/null 2>&1 - CHECK_RESULT $? 0 255 "yum源中无texlive-tex4ht软件包" - - # 如果未安装,则安装软件包 - if [ $INSTALLED_FLAG -eq 0 ]; then - LOG_INFO "安装texlive-tex4ht软件包" - dnf install -y texlive-tex4ht - CHECK_RESULT $? 0 0 "安装texlive-tex4ht失败" - fi - - # 检查htlatex命令是否存在 - LOG_INFO "检查htlatex命令是否存在" - which htlatex > /dev/null 2>&1 - CHECK_RESULT $? 0 255 "htlatex命令不存在" - - # 测试htlatex命令的-F参数,用于指定配置文件 - LOG_INFO "测试htlatex命令的-F参数,用于指定配置文件" - # 创建一个简单的测试TeX文件 - TEST_TEX_FILE="test_htlatex.tex" - cat > $TEST_TEX_FILE << "EOF" - \documentclass{article} - \begin{document} - Hello, World! - \end{document} - EOF - - # 创建一个测试配置文件 - TEST_CFG_FILE="test_config.cfg" - cat > $TEST_CFG_FILE << "EOF" - \Preamble{xhtml} - \CutAt{section} - \begin{document} - \EndPreamble - EOF - - # 执行htlatex命令,使用-F参数指定配置文件 - LOG_INFO "执行htlatex命令,使用-F参数指定配置文件" - htlatex $TEST_TEX_FILE "test_config.cfg" "" "" "-interaction=nonstopmode" > htlatex_output.log 2>&1 - CHECK_RESULT $? 0 0 "htlatex命令执行失败" - - # 检查是否生成了预期的输出文件 - LOG_INFO "检查是否生成了预期的输出文件" - if [ -f "${TEST_TEX_FILE%.tex}.html" ]; then - LOG_INFO "成功生成了HTML输出文件" - else - LOG_ERROR "未生成预期的HTML输出文件" - exit 1 - fi - - # 清理生成的测试文件 - LOG_INFO "清理测试生成的临时文件" - rm -f $TEST_TEX_FILE $TEST_CFG_FILE htlatex_output.log ${TEST_TEX_FILE%.tex}.* test_htlatex*.css test_htlatex*.png test_htlatex*.svg test_htlatex*.4ct test_htlatex*.4tc test_htlatex*.idv test_htlatex*.lg test_htlatex*.tmp test_htlatex*.xref test_htlatex*.aux test_htlatex*.log test_htlatex*.dvi - - # 如果脚本开始时未安装,则卸载软件包 - if [ $INSTALLED_FLAG -eq 0 ]; then - LOG_INFO "卸载texlive-tex4ht软件包" - dnf remove -y texlive-tex4ht - CHECK_RESULT $? 0 0 "卸载texlive-tex4ht失败" - fi - - LOG_INFO "测试完成" -} - -main "$@" \ No newline at end of file diff --git a/testcases/function_test/pkg_test/texlive-base/texlive-tex4ht/test_texlive-tex4ht_htlatex_upper_i.sh b/testcases/function_test/pkg_test/texlive-base/texlive-tex4ht/test_texlive-tex4ht_htlatex_upper_i.sh deleted file mode 100644 index a946eb726ef..00000000000 --- a/testcases/function_test/pkg_test/texlive-base/texlive-tex4ht/test_texlive-tex4ht_htlatex_upper_i.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-02 -# @License : Mulan PSL v2 -# @Desc : 测试htlatex命令的-I参数,用于指定输入文件 -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - LOG_INFO "测试开始:测试htlatex命令的-I参数,用于指定输入文件" - - # 检查软件包是否在yum源中 - LOG_INFO "步骤1:检查texlive-tex4ht软件包是否在yum源中" - dnf list texlive-tex4ht 2>/dev/null | grep -q texlive-tex4ht - if [ $? -ne 0 ]; then - LOG_ERROR "软件包texlive-tex4ht不在yum源中" - exit 255 - fi - - # 检查系统是否已安装texlive-tex4ht - LOG_INFO "步骤2:检查系统是否已安装texlive-tex4ht" - rpm -q texlive-tex4ht >/dev/null 2>&1 - INSTALLED=$? - - if [ $INSTALLED -ne 0 ]; then - LOG_INFO "步骤3:安装texlive-tex4ht软件包" - dnf install -y texlive-tex4ht - CHECK_RESULT $? 0 0 "安装texlive-tex4ht失败" - fi - - # 测试htlatex命令的-I参数 - LOG_INFO "步骤4:测试htlatex命令的-I参数" - htlatex --help 2>&1 | grep -q -- "-I" - if [ $? -ne 0 ]; then - LOG_ERROR "htlatex命令不支持-I参数" - exit 255 - fi - - # 创建一个测试用的LaTeX文件 - LOG_INFO "步骤5:创建测试用的LaTeX文件" - cat > test_input.tex << "EOF" - \documentclass{article} - \begin{document} - Hello, World! - \end{document} - EOF - CHECK_RESULT $? 0 0 "创建测试文件失败" - - # 使用htlatex的-I参数处理测试文件 - LOG_INFO "步骤6:使用htlatex的-I参数处理测试文件" - htlatex test_input.tex "html,mathml" "" "" "-I/home" 2>&1 - CHECK_RESULT $? 0 0 "htlatex命令执行失败" - - # 清理测试文件 - LOG_INFO "步骤7:清理测试文件" - rm -f test_input.tex test_input.html test_input.css test_input*.png test_input*.svg test_input*.xml test_input*.4ct test_input*.4tc test_input*.dvi test_input*.idv test_input*.lg test_input*.log test_input*.tmp test_input*.xref - CHECK_RESULT $? 0 0 "清理测试文件失败" - - # 如果脚本开始前未安装texlive-tex4ht,则卸载 - if [ $INSTALLED -ne 0 ]; then - LOG_INFO "步骤8:卸载texlive-tex4ht软件包" - dnf remove -y texlive-tex4ht - CHECK_RESULT $? 0 0 "卸载texlive-tex4ht失败" - fi - - LOG_INFO "测试完成:htlatex命令的-I参数测试成功" -} - -main "$@" \ No newline at end of file diff --git a/testcases/function_test/pkg_test/texlive-base/texlive-tex4ht/test_texlive-tex4ht_htlatex_upper_j.sh b/testcases/function_test/pkg_test/texlive-base/texlive-tex4ht/test_texlive-tex4ht_htlatex_upper_j.sh deleted file mode 100644 index 3de51cc71a3..00000000000 --- a/testcases/function_test/pkg_test/texlive-base/texlive-tex4ht/test_texlive-tex4ht_htlatex_upper_j.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-03-02 -# @License : Mulan PSL v2 -# @Desc : 测试htlatex命令的-J参数,用于指定编码 -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - # 测试htlatex命令的-J参数,用于指定编码 - LOG_INFO "开始测试htlatex命令的-J参数功能" - - # 定义软件包名称 - PACKAGE_NAME="texlive-tex4ht" - - # 检查yum源中是否存在该软件包 - LOG_INFO "检查yum源中是否存在${PACKAGE_NAME}软件包" - dnf list available "${PACKAGE_NAME}" > /dev/null 2>&1 - if [ $? -ne 0 ]; then - LOG_ERROR "yum源中不存在${PACKAGE_NAME}软件包" - exit 255 - fi - - # 检查是否已安装 - LOG_INFO "检查系统是否已安装${PACKAGE_NAME}" - if rpm -q "${PACKAGE_NAME}" > /dev/null 2>&1; then - LOG_INFO "${PACKAGE_NAME}已安装,测试结束后将保持安装状态" - ALREADY_INSTALLED=1 - else - LOG_INFO "${PACKAGE_NAME}未安装,将进行安装测试" - ALREADY_INSTALLED=0 - fi - - # 如果未安装,则安装软件包 - if [ ${ALREADY_INSTALLED} -eq 0 ]; then - LOG_INFO "安装${PACKAGE_NAME}软件包" - dnf install -y "${PACKAGE_NAME}" > /dev/null 2>&1 - CHECK_RESULT $? 0 0 "安装${PACKAGE_NAME}失败" - fi - - # 检查htlatex命令是否存在 - LOG_INFO "检查htlatex命令是否存在" - which htlatex > /dev/null 2>&1 - CHECK_RESULT $? 0 0 "htlatex命令不存在" - - # 测试htlatex命令的-J参数是否存在 - LOG_INFO "测试htlatex命令是否支持-J参数" - htlatex --help 2>&1 | grep -q "\-J" - CHECK_RESULT $? 0 0 "htlatex命令不支持-J参数" - - # 创建测试用的简单LaTeX文件 - LOG_INFO "创建测试用的LaTeX文件" - cat > test.tex << "EOF" - \documentclass{article} - \begin{document} - Hello World! - \end{document} - EOF - CHECK_RESULT $? 0 0 "创建测试文件失败" - - # 测试使用-J参数指定编码为utf8 - LOG_INFO "测试使用-J参数指定编码为utf8" - htlatex test.tex "html" "" "" "-Jutf8" > /dev/null 2>&1 - CHECK_RESULT $? 0 0 "使用-Jutf8参数执行htlatex失败" - - # 检查生成的HTML文件 - LOG_INFO "检查生成的HTML文件" - if [ -f "test.html" ]; then - LOG_INFO "成功生成HTML文件" - # 检查HTML文件是否包含utf-8编码声明 - if grep -q "charset=utf-8" test.html || grep -q "charset=UTF-8" test.html; then - LOG_INFO "HTML文件包含utf-8编码声明" - else - LOG_INFO "HTML文件未包含utf-8编码声明,但文件已生成" - fi - else - LOG_ERROR "未生成HTML文件" - CHECK_RESULT 1 0 0 "未生成HTML文件" - fi - - # 测试使用-J参数指定编码为ascii - LOG_INFO "测试使用-J参数指定编码为ascii" - htlatex test.tex "html" "" "" "-Jascii" > /dev/null 2>&1 - CHECK_RESULT $? 0 0 "使用-Jascii参数执行htlatex失败" - - # 清理测试文件 - LOG_INFO "清理测试文件" - rm -f test.tex test.html test.css test*.png test*.svg test*.idv test*.lg test*.dvi test*.aux test*.log test*.4ct test*.4tc test*.tmp > /dev/null 2>&1 - - # 如果测试前未安装,则卸载软件包 - if [ ${ALREADY_INSTALLED} -eq 0 ]; then - LOG_INFO "卸载${PACKAGE_NAME}软件包" - dnf remove -y "${PACKAGE_NAME}" > /dev/null 2>&1 - CHECK_RESULT $? 0 0 "卸载${PACKAGE_NAME}失败" - - # 验证是否已卸载 - rpm -q "${PACKAGE_NAME}" > /dev/null 2>&1 - if [ $? -eq 0 ]; then - LOG_ERROR "卸载${PACKAGE_NAME}失败,软件包仍然存在" - CHECK_RESULT 1 0 0 "卸载验证失败" - else - LOG_INFO "${PACKAGE_NAME}已成功卸载" - fi - else - LOG_INFO "保持${PACKAGE_NAME}的安装状态" - fi - - LOG_INFO "htlatex命令-J参数测试完成" -} - -main "$@" \ No newline at end of file diff --git a/testcases/function_test/pkg_test/texlive-base/texlive-tex4ht/test_texlive-tex4ht_htlatex_upper_j_upper_c.sh b/testcases/function_test/pkg_test/texlive-base/texlive-tex4ht/test_texlive-tex4ht_htlatex_upper_j_upper_c.sh deleted file mode 100644 index 15141f970ae..00000000000 --- a/testcases/function_test/pkg_test/texlive-base/texlive-tex4ht/test_texlive-tex4ht_htlatex_upper_j_upper_c.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-02 -# @License : Mulan PSL v2 -# @Desc : 测试htlatex命令的-J和-C参数组合,指定编码和自定义配置 -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - # 检查是否已安装texlive-tex4ht - LOG_INFO "检查是否已安装texlive-tex4ht" - if dnf list installed texlive-tex4ht &> /dev/null; then - LOG_INFO "texlive-tex4ht已安装,脚本结束后将保持安装状态" - INSTALLED=true - else - LOG_INFO "texlive-tex4ht未安装,将在测试中安装并在结束时卸载" - INSTALLED=false - fi - - # 检查yum源中是否有texlive-tex4ht软件包 - LOG_INFO "检查yum源中是否有texlive-tex4ht软件包" - if ! dnf list available texlive-tex4ht &> /dev/null; then - LOG_ERROR "yum源中未找到texlive-tex4ht软件包" - exit 255 - fi - - # 如果未安装,则安装texlive-tex4ht - if [ "$INSTALLED" = false ]; then - LOG_INFO "安装texlive-tex4ht" - dnf install -y texlive-tex4ht - CHECK_RESULT $? 0 0 "安装texlive-tex4ht失败" - fi - - # 检查htlatex命令是否存在 - LOG_INFO "检查htlatex命令是否存在" - command -v htlatex &> /dev/null - CHECK_RESULT $? 0 0 "htlatex命令不存在" - - # 测试htlatex命令的-J和-C参数组合 - LOG_INFO "测试htlatex命令的-J和-C参数组合,指定编码和自定义配置" - # 创建一个简单的LaTeX测试文件 - cat > test_htlatex.tex << "EOF" - \documentclass{article} - \begin{document} - Hello, World! - \end{document} - EOF - - # 执行htlatex命令,使用-J指定编码为utf8,-C指定自定义配置为custom.cfg - LOG_INFO "执行htlatex命令:htlatex test_htlatex.tex "custom.cfg" "utf8"" - htlatex test_htlatex.tex "custom.cfg" "utf8" - CHECK_RESULT $? 0 0 "htlatex命令执行失败" - - # 检查生成的HTML文件是否存在 - LOG_INFO "检查生成的HTML文件是否存在" - if [ -f test_htlatex.html ]; then - LOG_INFO "HTML文件生成成功" - else - LOG_ERROR "HTML文件未生成" - exit 1 - fi - - # 清理测试文件 - LOG_INFO "清理测试文件" - rm -f test_htlatex.tex test_htlatex.html test_htlatex.css test_htlatex*.png test_htlatex*.idv test_htlatex*.lg test_htlatex*.log test_htlatex*.tmp test_htlatex*.xref - - # 如果测试前未安装,则卸载texlive-tex4ht - if [ "$INSTALLED" = false ]; then - LOG_INFO "卸载texlive-tex4ht" - dnf remove -y texlive-tex4ht - CHECK_RESULT $? 0 0 "卸载texlive-tex4ht失败" - fi - - LOG_INFO "测试完成" -} - -main "$@" \ No newline at end of file diff --git a/testcases/function_test/pkg_test/texlive-base/texlive-tex4ht/test_texlive-tex4ht_htlatex_upper_v.sh b/testcases/function_test/pkg_test/texlive-base/texlive-tex4ht/test_texlive-tex4ht_htlatex_upper_v.sh deleted file mode 100644 index 58c91970433..00000000000 --- a/testcases/function_test/pkg_test/texlive-base/texlive-tex4ht/test_texlive-tex4ht_htlatex_upper_v.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-02 -# @License : Mulan PSL v2 -# @Desc : 测试htlatex命令的-V参数,用于显示版本信息 -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - # 检查是否已安装texlive-tex4ht - LOG_INFO "检查是否已安装texlive-tex4ht软件包" - rpm -q texlive-tex4ht > /dev/null 2>&1 - if [ $? -eq 0 ]; then - LOG_INFO "texlive-tex4ht已安装,记录安装状态" - INSTALLED=1 - else - LOG_INFO "texlive-tex4ht未安装,将进行安装测试" - INSTALLED=0 - fi - - # 检查yum源中是否存在texlive-tex4ht软件包 - LOG_INFO "检查yum源中是否存在texlive-tex4ht软件包" - dnf list available texlive-tex4ht > /dev/null 2>&1 - CHECK_RESULT $? 0 0 "yum源中不存在texlive-tex4ht软件包" - if [ $? -ne 0 ]; then - LOG_ERROR "yum源中不存在texlive-tex4ht软件包" - exit 255 - fi - - # 如果未安装,则安装texlive-tex4ht - if [ $INSTALLED -eq 0 ]; then - LOG_INFO "安装texlive-tex4ht软件包" - dnf install -y texlive-tex4ht - CHECK_RESULT $? 0 0 "安装texlive-tex4ht失败" - fi - - # 测试htlatex命令的-V参数 - LOG_INFO "测试htlatex命令的-V参数,用于显示版本信息" - htlatex -V > /dev/null 2>&1 - # 检查-V参数是否被支持 - if [ $? -eq 0 ]; then - LOG_INFO "htlatex -V 命令执行成功,显示版本信息" - htlatex -V - CHECK_RESULT $? 0 0 "htlatex -V 命令执行失败" - else - LOG_ERROR "htlatex命令不支持-V参数" - # 如果未安装,则卸载软件包 - if [ $INSTALLED -eq 0 ]; then - LOG_INFO "卸载texlive-tex4ht软件包" - dnf remove -y texlive-tex4ht - CHECK_RESULT $? 0 0 "卸载texlive-tex4ht失败" - fi - exit 255 - fi - - # 环境恢复:如果测试前未安装,则卸载软件包 - if [ $INSTALLED -eq 0 ]; then - LOG_INFO "测试完成,卸载texlive-tex4ht软件包" - dnf remove -y texlive-tex4ht - CHECK_RESULT $? 0 0 "卸载texlive-tex4ht失败" - else - LOG_INFO "测试完成,保持texlive-tex4ht安装状态" - fi -} - -main "$@" \ No newline at end of file diff --git a/testcases/function_test/pkg_test/texlive-base/texlive-tex4ht/test_texlive-tex4ht_htlatex_upper_v_upper_f.sh b/testcases/function_test/pkg_test/texlive-base/texlive-tex4ht/test_texlive-tex4ht_htlatex_upper_v_upper_f.sh deleted file mode 100644 index 545d70b0e84..00000000000 --- a/testcases/function_test/pkg_test/texlive-base/texlive-tex4ht/test_texlive-tex4ht_htlatex_upper_v_upper_f.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-02 -# @License : Mulan PSL v2 -# @Desc : 测试htlatex命令的-V和-F参数组合,显示版本信息并指定配置文件 -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - LOG_INFO "开始测试htlatex命令的-V和-F参数组合,显示版本信息并指定配置文件" - - # 检查软件包是否存在 - LOG_INFO "检查yum源中是否存在texlive-tex4ht软件包" - dnf list available texlive-tex4ht > /dev/null 2>&1 - if [ $? -ne 0 ]; then - LOG_ERROR "yum源中不存在texlive-tex4ht软件包" - exit 255 - fi - - # 检查是否已安装 - LOG_INFO "检查texlive-tex4ht是否已安装" - rpm -q texlive-tex4ht > /dev/null 2>&1 - if [ $? -eq 0 ]; then - LOG_INFO "texlive-tex4ht已安装,测试结束后保持安装状态" - INSTALLED=true - else - LOG_INFO "texlive-tex4ht未安装,将在测试中安装" - INSTALLED=false - fi - - # 如果未安装,则安装软件包 - if [ "$INSTALLED" = false ]; then - LOG_INFO "安装texlive-tex4ht软件包" - dnf install -y texlive-tex4ht - CHECK_RESULT $? 0 0 "安装texlive-tex4ht失败" - fi - - # 测试htlatex命令的-V参数 - LOG_INFO "测试htlatex命令的-V参数,显示版本信息" - htlatex -V > /dev/null 2>&1 - CHECK_RESULT $? 0 0 "htlatex命令的-V参数不支持或执行失败" - - # 测试htlatex命令的-F参数 - LOG_INFO "测试htlatex命令的-F参数,指定配置文件" - CONFIG_FILE="/usr/share/texlive/texmf-dist/tex4ht/base/unix/tex4ht.env" - if [ -f "$CONFIG_FILE" ]; then - htlatex -F "$CONFIG_FILE" > /dev/null 2>&1 - CHECK_RESULT $? 0 0 "htlatex命令的-F参数不支持或执行失败" - else - LOG_ERROR "配置文件$CONFIG_FILE不存在" - exit 255 - fi - - # 测试htlatex命令的-V和-F参数组合 - LOG_INFO "测试htlatex命令的-V和-F参数组合,显示版本信息并指定配置文件" - htlatex -V -F "$CONFIG_FILE" > /dev/null 2>&1 - CHECK_RESULT $? 0 0 "htlatex命令的-V和-F参数组合不支持或执行失败" - - # 清理环境 - if [ "$INSTALLED" = false ]; then - LOG_INFO "卸载texlive-tex4ht软件包" - dnf remove -y texlive-tex4ht - CHECK_RESULT $? 0 0 "卸载texlive-tex4ht失败" - else - LOG_INFO "测试结束,保持texlive-tex4ht安装状态" - fi - - LOG_INFO "测试完成" -} - -main "$@" \ No newline at end of file diff --git a/testcases/function_test/pkg_test/texlive-base/texlive-tex4ht/test_texlive-tex4ht_htmex__upper_a.sh b/testcases/function_test/pkg_test/texlive-base/texlive-tex4ht/test_texlive-tex4ht_htmex__upper_a.sh deleted file mode 100644 index 4b5ca586520..00000000000 --- a/testcases/function_test/pkg_test/texlive-base/texlive-tex4ht/test_texlive-tex4ht_htmex__upper_a.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-02 -# @License : Mulan PSL v2 -# @Desc : 测试 htmex 命令的自动模式,用于自动处理文件转换过程中的依赖关系 -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - set -e - - # 检查yum源中是否存在texlive-tex4ht-htmex软件包 - LOG_INFO "检查yum源中是否存在texlive-tex4ht-htmex软件包" - if ! dnf list available texlive-tex4ht-htmex &>/dev/null; then - LOG_ERROR "yum源中不存在texlive-tex4ht-htmex软件包" - exit 255 - fi - - # 检查是否已安装texlive-tex4ht-htmex - LOG_INFO "检查是否已安装texlive-tex4ht-htmex" - if rpm -q texlive-tex4ht-htmex &>/dev/null; then - LOG_INFO "texlive-tex4ht-htmex已安装,标记为保持安装状态" - INSTALLED_ALREADY=1 - else - LOG_INFO "texlive-tex4ht-htmex未安装,标记为需要卸载" - INSTALLED_ALREADY=0 - fi - - # 如果未安装,则安装软件包 - if [ ${INSTALLED_ALREADY} -eq 0 ]; then - LOG_INFO "安装texlive-tex4ht-htmex软件包" - dnf install -y texlive-tex4ht-htmex - CHECK_RESULT $? 0 0 "安装texlive-tex4ht-htmex失败" - fi - - # 检查htmex命令是否支持--help参数 - LOG_INFO "检查htmex命令是否支持--help参数" - if ! htmex --help &>/dev/null; then - LOG_ERROR "htmex命令不支持--help参数或命令不存在" - exit 255 - fi - - # 测试htmex命令的自动模式,用于自动处理文件转换过程中的依赖关系 - LOG_INFO "测试htmex命令的自动模式,用于自动处理文件转换过程中的依赖关系" - # 创建一个简单的测试LaTeX文件 - TEST_FILE="test_htmex.tex" - cat > ${TEST_FILE} << "EOF" - \documentclass{article} - \begin{document} - Hello, htmex auto mode test! - \end{document} - EOF - - # 使用htmex的自动模式进行转换 - LOG_INFO "使用htmex的自动模式转换LaTeX文件" - htmex --auto ${TEST_FILE} - CHECK_RESULT $? 0 0 "htmex自动模式转换失败" - - # 清理生成的测试文件 - LOG_INFO "清理测试文件" - rm -f ${TEST_FILE} ${TEST_FILE%.tex}*.html ${TEST_FILE%.tex}*.css ${TEST_FILE%.tex}*.png 2>/dev/null || true - - # 环境恢复:如果脚本开始时未安装,则卸载软件包 - if [ ${INSTALLED_ALREADY} -eq 0 ]; then - LOG_INFO "卸载texlive-tex4ht-htmex软件包" - dnf remove -y texlive-tex4ht-htmex - CHECK_RESULT $? 0 0 "卸载texlive-tex4ht-htmex失败" - else - LOG_INFO "保持texlive-tex4ht-htmex安装状态" - fi -} - -main "$@" \ No newline at end of file diff --git a/testcases/function_test/pkg_test/texlive-base/texlive-tex4ht/test_texlive-tex4ht_htmex__upper_c.sh b/testcases/function_test/pkg_test/texlive-base/texlive-tex4ht/test_texlive-tex4ht_htmex__upper_c.sh deleted file mode 100644 index 66258d770f9..00000000000 --- a/testcases/function_test/pkg_test/texlive-base/texlive-tex4ht/test_texlive-tex4ht_htmex__upper_c.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-02 -# @License : Mulan PSL v2 -# @Desc : 测试 htmex 命令的配置模式,用于指定配置文件 -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - LOG_INFO "开始测试 htmex 命令的配置模式,用于指定配置文件" - - # 定义软件包名称 - PACKAGE_NAME="texlive-tex4ht" - - # 检查yum源中是否存在该软件包 - LOG_INFO "检查yum源中是否存在软件包 $PACKAGE_NAME" - dnf list available "$PACKAGE_NAME" > /dev/null 2>&1 - if [ $? -ne 0 ]; then - LOG_ERROR "yum源中未找到软件包 $PACKAGE_NAME" - exit 255 - fi - - # 检查是否已安装 - LOG_INFO "检查软件包 $PACKAGE_NAME 是否已安装" - if rpm -q "$PACKAGE_NAME" > /dev/null 2>&1; then - LOG_INFO "软件包 $PACKAGE_NAME 已安装,测试结束后将保持安装状态" - INSTALLED_BEFORE=true - else - LOG_INFO "软件包 $PACKAGE_NAME 未安装,将进行安装" - INSTALLED_BEFORE=false - fi - - # 如果未安装,则安装软件包 - if [ "$INSTALLED_BEFORE" = false ]; then - LOG_INFO "安装软件包 $PACKAGE_NAME" - dnf install -y "$PACKAGE_NAME" - CHECK_RESULT $? 0 0 "安装软件包 $PACKAGE_NAME 失败" - fi - - # 检查 htmex 命令是否存在 - LOG_INFO "检查 htmex 命令是否存在" - command -v htmex > /dev/null 2>&1 - CHECK_RESULT $? 0 0 "htmex 命令未找到" - - # 测试 htmex 命令的配置模式,用于指定配置文件 - LOG_INFO "测试 htmex 命令的配置模式,用于指定配置文件" - htmex --config /etc/texmf/tex4ht/tex4ht.env --help > /dev/null 2>&1 - CHECK_RESULT $? 0 0 "htmex 命令配置模式测试失败" - - # 如果之前未安装,则卸载软件包 - 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/texlive-base/texlive-tex4ht/test_texlive-tex4ht_htmex__upper_d.sh b/testcases/function_test/pkg_test/texlive-base/texlive-tex4ht/test_texlive-tex4ht_htmex__upper_d.sh deleted file mode 100644 index 416e214571c..00000000000 --- a/testcases/function_test/pkg_test/texlive-base/texlive-tex4ht/test_texlive-tex4ht_htmex__upper_d.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-02 -# @License : Mulan PSL v2 -# @Desc : 测试 htmex 命令的调试模式,用于输出调试信息 -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - LOG_INFO "开始测试 htmex 命令的调试模式,用于输出调试信息" - LOG_INFO "检查是否已经安装 texlive-tex4ht 软件包" - rpm -q texlive-tex4ht > /dev/null 2>&1 - if [ $? -eq 0 ]; then - LOG_INFO "texlive-tex4ht 软件包已经安装,测试结束后将保持安装状态" - INSTALLED=1 - else - LOG_INFO "texlive-tex4ht 软件包未安装,测试前将安装该软件包" - INSTALLED=0 - fi - - LOG_INFO "检查 yum 源中是否存在 texlive-tex4ht 软件包" - dnf list available texlive-tex4ht > /dev/null 2>&1 - if [ $? -ne 0 ]; then - LOG_ERROR "yum 源中未找到 texlive-tex4ht 软件包" - exit 255 - fi - - if [ $INSTALLED -eq 0 ]; then - LOG_INFO "安装 texlive-tex4ht 软件包" - dnf install -y texlive-tex4ht - CHECK_RESULT $? 0 0 "安装 texlive-tex4ht 软件包失败" - fi - - LOG_INFO "检查 htmex 命令是否存在" - command -v htmex > /dev/null 2>&1 - if [ $? -ne 0 ]; then - LOG_ERROR "htmex 命令不存在" - exit 255 - fi - - LOG_INFO "检查 htmex 命令是否支持 -d 参数" - htmex -d --help > /dev/null 2>&1 - if [ $? -ne 0 ]; then - LOG_ERROR "htmex 命令不支持 -d 参数" - exit 255 - fi - - LOG_INFO "执行 htmex -d 命令测试调试模式" - htmex -d - CHECK_RESULT $? 0 0 "htmex -d 命令执行失败" - - if [ $INSTALLED -eq 0 ]; then - LOG_INFO "卸载 texlive-tex4ht 软件包" - dnf remove -y texlive-tex4ht - CHECK_RESULT $? 0 0 "卸载 texlive-tex4ht 软件包失败" - fi - - LOG_INFO "测试完成,环境已恢复" -} - -main "$@" \ No newline at end of file diff --git a/testcases/function_test/pkg_test/texlive-base/texlive-tex4ht/test_texlive-tex4ht_htmex__upper_f.sh b/testcases/function_test/pkg_test/texlive-base/texlive-tex4ht/test_texlive-tex4ht_htmex__upper_f.sh deleted file mode 100644 index e8ae94fee9c..00000000000 --- a/testcases/function_test/pkg_test/texlive-base/texlive-tex4ht/test_texlive-tex4ht_htmex__upper_f.sh +++ /dev/null @@ -1,131 +0,0 @@ -#!/usr/bin/bash - -# Copyright (c) 2024 ISCAS .ALL rights reserved. -# This program is licensed under Mulan PSL v2. -# You can use it according to the terms and conditions of the Mulan PSL v2. -# http://license.coscl.org.cn/MulanPSL2 -# THIS PROGRAM IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, -# EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, -# MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. -# See the Mulan PSL v2 for more details. - -# ############################################# -# @Author : honghua -# @Contact : honghua@iscas.ac.cn -# @Date : 2026-03-02 -# @License : Mulan PSL v2 -# @Desc : 测试 htmex 命令的强制模式,用于强制重新生成所有输出文件 -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - # 初始化环境变量 - PACKAGE_NAME="texlive-tex4ht" - COMMAND="htmex" - PARAM="-f" - LOG_INFO "开始测试 htmex 命令的强制模式,用于强制重新生成所有输出文件" - - # 步骤1: 检查软件包是否在yum源中 - LOG_INFO "步骤1: 检查软件包是否在yum源中" - dnf list available $PACKAGE_NAME &> /dev/null - if [ $? -ne 0 ]; then - LOG_ERROR "软件包 $PACKAGE_NAME 不在yum源中" - exit 255 - fi - - # 步骤2: 检查环境是否已安装软件包 - LOG_INFO "步骤2: 检查环境是否已安装软件包" - rpm -q $PACKAGE_NAME &> /dev/null - if [ $? -eq 0 ]; then - LOG_INFO "软件包 $PACKAGE_NAME 已安装,脚本结束后将保持安装状态" - INSTALLED="true" - else - LOG_INFO "软件包 $PACKAGE_NAME 未安装,将进行安装并在脚本结束前卸载" - INSTALLED="false" - fi - - # 步骤3: 如果未安装,则安装软件包 - if [ "$INSTALLED" == "false" ]; then - LOG_INFO "步骤3: 安装软件包 $PACKAGE_NAME" - dnf install -y $PACKAGE_NAME - CHECK_RESULT $? 0 0 "安装软件包 $PACKAGE_NAME 失败" - fi - - # 步骤4: 检查命令是否存在 - LOG_INFO "步骤4: 检查命令 $COMMAND 是否存在" - which $COMMAND &> /dev/null - if [ $? -ne 0 ]; then - LOG_ERROR "命令 $COMMAND 不存在" - exit 255 - fi - - # 步骤5: 检查命令参数是否支持 - LOG_INFO "步骤5: 检查命令参数 $PARAM 是否支持" - $COMMAND --help 2>&1 | grep -q "\-f" - if [ $? -ne 0 ]; then - LOG_ERROR "命令 $COMMAND 不支持参数 $PARAM" - exit 255 - fi - - # 步骤6: 创建测试文件 - LOG_INFO "步骤6: 创建测试文件" - cat > test.tex << "EOF" - \documentclass{article} - \begin{document} - Hello, World! - \end{document} - EOF - CHECK_RESULT $? 0 0 "创建测试文件失败" - - # 步骤7: 使用htmex命令生成HTML文件 - LOG_INFO "步骤7: 使用htmex命令生成HTML文件" - $COMMAND test.tex - CHECK_RESULT $? 0 0 "htmex命令执行失败" - - # 步骤8: 检查是否生成HTML文件 - LOG_INFO "步骤8: 检查是否生成HTML文件" - if [ -f "test.html" ]; then - LOG_INFO "成功生成HTML文件 test.html" - else - LOG_ERROR "未生成HTML文件 test.html" - exit 1 - fi - - # 步骤9: 记录HTML文件修改时间 - LOG_INFO "步骤9: 记录HTML文件修改时间" - OLD_TIME=$(stat -c %Y test.html) - LOG_INFO "HTML文件 test.html 的修改时间为: $OLD_TIME" - - # 步骤10: 使用htmex命令的强制模式重新生成HTML文件 - LOG_INFO "步骤10: 使用htmex命令的强制模式重新生成HTML文件" - $COMMAND $PARAM test.tex - CHECK_RESULT $? 0 0 "htmex命令强制模式执行失败" - - # 步骤11: 检查HTML文件是否被重新生成 - LOG_INFO "步骤11: 检查HTML文件是否被重新生成" - NEW_TIME=$(stat -c %Y test.html) - LOG_INFO "强制模式后HTML文件 test.html 的修改时间为: $NEW_TIME" - if [ "$NEW_TIME" -gt "$OLD_TIME" ]; then - LOG_INFO "HTML文件 test.html 被成功重新生成" - else - LOG_ERROR "HTML文件 test.html 未被重新生成" - exit 1 - fi - - # 步骤12: 清理测试文件 - LOG_INFO "步骤12: 清理测试文件" - rm -f test.tex test.html test*.png test*.css test*.4ct test*.4tc test*.idv test*.lg test*.tmp test*.xref - CHECK_RESULT $? 0 0 "清理测试文件失败" - - # 步骤13: 如果脚本开始时未安装软件包,则卸载 - if [ "$INSTALLED" == "false" ]; then - LOG_INFO "步骤13: 卸载软件包 $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/texlive-base/texlive-tex4ht/test_texlive-tex4ht_htmex__upper_h.sh b/testcases/function_test/pkg_test/texlive-base/texlive-tex4ht/test_texlive-tex4ht_htmex__upper_h.sh deleted file mode 100644 index 96a9ebdf455..00000000000 --- a/testcases/function_test/pkg_test/texlive-base/texlive-tex4ht/test_texlive-tex4ht_htmex__upper_h.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-02 -# @License : Mulan PSL v2 -# @Desc : 测试 htmex 命令的帮助信息,用于显示命令的使用说明 -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - # 定义软件包名称 - PACKAGE_NAME="texlive-tex4ht-htmex" - COMMAND_NAME="htmex" - - # 步骤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 - LOG_INFO "软件包 $PACKAGE_NAME 已安装" - INSTALLED="true" - else - LOG_INFO "软件包 $PACKAGE_NAME 未安装" - INSTALLED="false" - fi - - # 步骤3:如果未安装,则安装软件包 - if [ "$INSTALLED" = "false" ]; then - LOG_INFO "步骤3:安装软件包 $PACKAGE_NAME" - dnf install -y $PACKAGE_NAME - CHECK_RESULT $? 0 0 "安装软件包 $PACKAGE_NAME 失败" - fi - - # 步骤4:检查htmex命令是否存在 - LOG_INFO "步骤4:检查命令 $COMMAND_NAME 是否存在" - which $COMMAND_NAME &>/dev/null - if [ $? -ne 0 ]; then - LOG_ERROR "命令 $COMMAND_NAME 不存在" - if [ "$INSTALLED" = "false" ]; then - LOG_INFO "清理环境:卸载软件包 $PACKAGE_NAME" - dnf remove -y $PACKAGE_NAME - fi - exit 255 - fi - - # 步骤5:测试htmex命令的帮助信息 - LOG_INFO "步骤5:测试 $COMMAND_NAME 命令的帮助信息" - $COMMAND_NAME --help - CHECK_RESULT $? 0 0 "执行 $COMMAND_NAME --help 失败" - - # 步骤6:环境恢复 - if [ "$INSTALLED" = "false" ]; then - LOG_INFO "步骤6:清理环境,卸载软件包 $PACKAGE_NAME" - dnf remove -y $PACKAGE_NAME - CHECK_RESULT $? 0 0 "卸载软件包 $PACKAGE_NAME 失败" - else - LOG_INFO "步骤6:环境已安装,保持安装状态" - fi - - LOG_INFO "测试完成" -} - -main "$@" \ No newline at end of file diff --git a/testcases/function_test/pkg_test/texlive-base/texlive-tex4ht/test_texlive-tex4ht_htmex__upper_i.sh b/testcases/function_test/pkg_test/texlive-base/texlive-tex4ht/test_texlive-tex4ht_htmex__upper_i.sh deleted file mode 100644 index 91f5cfc1d5c..00000000000 --- a/testcases/function_test/pkg_test/texlive-base/texlive-tex4ht/test_texlive-tex4ht_htmex__upper_i.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-02 -# @License : Mulan PSL v2 -# @Desc : 测试 htmex 命令的交互模式,用于在转换过程中进行交互式操作 -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - LOG_INFO "开始测试 htmex 命令的交互模式" - LOG_INFO "检查环境是否已安装 texlive-tex4ht 软件包" - rpm -q texlive-tex4ht > /dev/null 2>&1 - if [ $? -eq 0 ]; then - LOG_INFO "检测到 texlive-tex4ht 软件包已安装,测试后将保持安装状态" - INSTALLED=true - else - LOG_INFO "未检测到 texlive-tex4ht 软件包,将在测试过程中安装" - INSTALLED=false - fi - LOG_INFO "检查 yum 源中是否存在 texlive-tex4ht 软件包" - dnf list available texlive-tex4ht > /dev/null 2>&1 - if [ $? -ne 0 ]; then - LOG_ERROR "yum 源中未找到 texlive-tex4ht 软件包" - exit 255 - fi - if [ "$INSTALLED" = "false" ]; then - LOG_INFO "安装 texlive-tex4ht 软件包" - dnf install -y texlive-tex4ht - CHECK_RESULT $? 0 0 "安装 texlive-tex4ht 软件包失败" - fi - LOG_INFO "检查 htmex 命令是否支持 -i 参数" - htmex -h 2>&1 | grep -q "\-i" - if [ $? -ne 0 ]; then - LOG_ERROR "htmex 命令不支持 -i 参数" - if [ "$INSTALLED" = "false" ]; then - dnf remove -y texlive-tex4ht - CHECK_RESULT $? 0 0 "卸载 texlive-tex4ht 软件包失败" - fi - exit 255 - fi - LOG_INFO "创建一个简单的测试 LaTeX 文件" - cat > test.tex << "EOF" - \documentclass{article} - \begin{document} - Hello, World! - \end{document} - EOF - CHECK_RESULT $? 0 0 "创建测试 LaTeX 文件失败" - LOG_INFO "测试 htmex 命令的交互模式,使用 -i 参数" - echo "q" | timeout 5 htmex -i test.tex > output.log 2>&1 - CHECK_RESULT $? 0 0 "htmex 命令交互模式执行失败" - LOG_INFO "检查输出文件是否生成" - ls test.html > /dev/null 2>&1 - CHECK_RESULT $? 0 0 "htmex 未生成预期的 HTML 文件" - LOG_INFO "清理测试生成的文件" - rm -f test.tex test.html output.log - CHECK_RESULT $? 0 0 "清理测试文件失败" - if [ "$INSTALLED" = "false" ]; then - LOG_INFO "卸载 texlive-tex4ht 软件包" - dnf remove -y texlive-tex4ht - CHECK_RESULT $? 0 0 "卸载 texlive-tex4ht 软件包失败" - fi - LOG_INFO "测试完成,环境已恢复" -} - -main "$@" \ No newline at end of file diff --git a/testcases/function_test/pkg_test/texlive-base/texlive-tex4ht/test_texlive-tex4ht_htmex__upper_o.sh b/testcases/function_test/pkg_test/texlive-base/texlive-tex4ht/test_texlive-tex4ht_htmex__upper_o.sh deleted file mode 100644 index 177272dcd8f..00000000000 --- a/testcases/function_test/pkg_test/texlive-base/texlive-tex4ht/test_texlive-tex4ht_htmex__upper_o.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-02 -# @License : Mulan PSL v2 -# @Desc : 测试 htmex 命令的输出目录指定功能,用于将生成的文件输出到指定目录 -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - # 检查是否已经安装texlive-tex4ht - if rpm -q texlive-tex4ht > /dev/null 2>&1; then - LOG_INFO "texlive-tex4ht已经安装,测试结束后将保持安装状态" - INSTALLED_BEFORE=1 - else - LOG_INFO "texlive-tex4ht未安装,将在测试前安装,测试结束后卸载" - INSTALLED_BEFORE=0 - fi - - # 检查yum源中是否有texlive-tex4ht软件包 - LOG_INFO "步骤1:检查yum源中是否有texlive-tex4ht软件包" - dnf list available texlive-tex4ht > /dev/null 2>&1 - if [ $? -ne 0 ]; then - LOG_ERROR "yum源中没有texlive-tex4ht软件包" - exit 255 - fi - - # 如果未安装,则安装软件包 - if [ $INSTALLED_BEFORE -eq 0 ]; then - LOG_INFO "步骤2:安装texlive-tex4ht软件包" - dnf install -y texlive-tex4ht - CHECK_RESULT $? 0 0 "安装texlive-tex4ht失败" - fi - - # 检查htmex命令是否存在 - LOG_INFO "步骤3:检查htmex命令是否存在" - which htmex > /dev/null 2>&1 - CHECK_RESULT $? 0 0 "htmex命令不存在" - - # 准备测试用的LaTeX源文件 - LOG_INFO "步骤4:准备测试用的LaTeX源文件" - TEST_FILE="test_htmex.tex" - cat > $TEST_FILE << "EOF" - \documentclass{article} - \begin{document} - Hello, World! - \end{document} - EOF - CHECK_RESULT $? 0 0 "创建测试文件失败" - - # 创建输出目录 - LOG_INFO "步骤5:创建输出目录" - OUTPUT_DIR="test_output_dir" - mkdir -p $OUTPUT_DIR - CHECK_RESULT $? 0 0 "创建输出目录失败" - - # 测试htmex命令的-o参数,指定输出目录 - LOG_INFO "步骤6:测试htmex命令的-o参数,指定输出目录" - htmex -o $OUTPUT_DIR $TEST_FILE - CHECK_RESULT $? 0 0 "htmex命令执行失败" - - # 检查是否在指定目录生成了HTML文件 - LOG_INFO "步骤7:检查是否在指定目录生成了HTML文件" - if [ -f "$OUTPUT_DIR/${TEST_FILE%.tex}.html" ]; then - LOG_INFO "成功在指定目录生成HTML文件" - else - LOG_ERROR "未在指定目录找到生成的HTML文件" - exit 1 - fi - - # 清理测试文件 - LOG_INFO "步骤8:清理测试文件" - rm -f $TEST_FILE - rm -rf $OUTPUT_DIR - CHECK_RESULT $? 0 0 "清理测试文件失败" - - # 如果测试前未安装,则卸载软件包 - if [ $INSTALLED_BEFORE -eq 0 ]; then - LOG_INFO "步骤9:卸载texlive-tex4ht软件包" - dnf remove -y texlive-tex4ht - CHECK_RESULT $? 0 0 "卸载texlive-tex4ht失败" - else - LOG_INFO "测试前已安装texlive-tex4ht,保持安装状态" - fi - - LOG_INFO "测试完成" -} - -main "$@" \ No newline at end of file diff --git a/testcases/function_test/pkg_test/texlive-base/texlive-tex4ht/test_texlive-tex4ht_htmex__upper_s.sh b/testcases/function_test/pkg_test/texlive-base/texlive-tex4ht/test_texlive-tex4ht_htmex__upper_s.sh deleted file mode 100644 index 1631887cf6b..00000000000 --- a/testcases/function_test/pkg_test/texlive-base/texlive-tex4ht/test_texlive-tex4ht_htmex__upper_s.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-02 -# @License : Mulan PSL v2 -# @Desc : 测试 htmex 命令的静默模式,用于减少输出信息 -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - # 环境初始化与检查 - LOG_INFO "开始测试 htmex 命令的静默模式" - LOG_INFO "检查系统是否已安装 texlive-tex4ht 软件包" - - # 检查软件包是否已安装 - if rpm -q texlive-tex4ht &>/dev/null; then - LOG_INFO "检测到 texlive-tex4ht 已安装,测试结束后将保持安装状态" - INSTALLED_BEFORE_TEST=1 - else - LOG_INFO "未检测到 texlive-tex4ht 安装,测试结束后将卸载" - INSTALLED_BEFORE_TEST=0 - fi - - # 检查 yum 源中是否存在该软件包 - LOG_INFO "检查 yum 源中是否存在 texlive-tex4ht 软件包" - if ! dnf list available texlive-tex4ht &>/dev/null; then - LOG_ERROR "yum 源中未找到 texlive-tex4ht 软件包" - exit 255 - fi - - # 如果未安装,则进行安装 - if [ ${INSTALLED_BEFORE_TEST} -eq 0 ]; then - LOG_INFO "开始安装 texlive-tex4ht 软件包" - dnf install -y texlive-tex4ht - CHECK_RESULT $? 0 0 "安装 texlive-tex4ht 失败" - fi - - # 检查 htmex 命令是否存在 - LOG_INFO "检查 htmex 命令是否存在" - if ! command -v htmex &>/dev/null; then - LOG_ERROR "htmex 命令不存在" - exit 255 - fi - - # 测试 htmex 命令的静默模式参数是否存在 - LOG_INFO "检查 htmex 命令是否支持静默模式参数" - if ! htmex --help 2>&1 | grep -q "quiet\|silent"; then - LOG_ERROR "htmex 命令不支持静默模式参数" - exit 255 - fi - - # 创建一个简单的测试文件 - LOG_INFO "创建测试用的 LaTeX 文件" - cat > test_quiet.tex << "EOF" - \documentclass{article} - \begin{document} - Test for htmex quiet mode. - \end{document} - EOF - CHECK_RESULT $? 0 0 "创建测试文件失败" - - # 测试 htmex 命令的静默模式 - LOG_INFO "测试 htmex 命令的静默模式执行" - htmex --quiet test_quiet.tex 2>&1 | tee htmex_output.log - CHECK_RESULT $? 0 0 "htmex 命令执行失败" - - # 检查静默模式是否减少了输出信息 - LOG_INFO "检查静默模式是否减少了输出信息" - if [ -s htmex_output.log ]; then - LOG_INFO "静默模式仍有输出,但可能已减少" - else - LOG_INFO "静默模式无输出,符合预期" - fi - - # 清理测试文件 - LOG_INFO "清理测试生成的文件" - rm -f test_quiet.tex test_quiet.html htmex_output.log - CHECK_RESULT $? 0 0 "清理测试文件失败" - - # 环境恢复 - LOG_INFO "开始环境恢复" - if [ ${INSTALLED_BEFORE_TEST} -eq 0 ]; then - LOG_INFO "卸载 texlive-tex4ht 软件包" - dnf remove -y texlive-tex4ht - CHECK_RESULT $? 0 0 "卸载 texlive-tex4ht 失败" - else - LOG_INFO "保持 texlive-tex4ht 软件包安装状态" - fi - - LOG_INFO "测试完成" -} - -main "$@" \ No newline at end of file diff --git a/testcases/function_test/pkg_test/texlive-base/texlive-tex4ht/test_texlive-tex4ht_htmex__upper_t.sh b/testcases/function_test/pkg_test/texlive-base/texlive-tex4ht/test_texlive-tex4ht_htmex__upper_t.sh deleted file mode 100644 index 1855746cfba..00000000000 --- a/testcases/function_test/pkg_test/texlive-base/texlive-tex4ht/test_texlive-tex4ht_htmex__upper_t.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-02 -# @License : Mulan PSL v2 -# @Desc : 测试 htmex 命令的临时文件模式,用于保留临时文件以便调试 -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - set -e - - LOG_INFO "开始测试 htmex 命令的临时文件模式" - - # 检查软件包是否存在 - LOG_INFO "检查 yum 源中是否存在 texlive-tex4ht 软件包" - if ! dnf list available texlive-tex4ht &>/dev/null; then - LOG_ERROR "yum 源中不存在 texlive-tex4ht 软件包" - exit 255 - fi - - # 判断是否已安装 - LOG_INFO "检查 texlive-tex4ht 是否已安装" - if rpm -q texlive-tex4ht &>/dev/null; then - LOG_INFO "texlive-tex4ht 已安装,测试结束后将保持安装状态" - already_installed=1 - else - LOG_INFO "texlive-tex4ht 未安装,将进行安装" - already_installed=0 - fi - - # 如果未安装,则安装软件包 - if [ $already_installed -eq 0 ]; then - LOG_INFO "安装 texlive-tex4ht 软件包" - dnf install -y texlive-tex4ht - CHECK_RESULT $? 0 0 "安装 texlive-tex4ht 失败" - fi - - # 检查 htmex 命令是否存在 - LOG_INFO "检查 htmex 命令是否存在" - if ! command -v htmex &>/dev/null; then - LOG_ERROR "htmex 命令不存在" - exit 255 - fi - - # 检查 htmex 是否支持 -t 参数 - LOG_INFO "检查 htmex 命令是否支持 -t 参数" - if ! htmex -h 2>&1 | grep -q "\-t"; then - LOG_ERROR "htmex 命令不支持 -t 参数" - exit 255 - fi - - # 创建测试用的简单 LaTeX 文件 - LOG_INFO "创建测试用的简单 LaTeX 文件 test.tex" - cat > test.tex << "EOF" - \documentclass{article} - \begin{document} - Hello, World! - \end{document} - EOF - - # 使用 htmex 的 -t 参数生成 HTML 并保留临时文件 - LOG_INFO "使用 htmex -t 参数生成 HTML 并保留临时文件" - htmex -t test.tex - CHECK_RESULT $? 0 0 "htmex -t 执行失败" - - # 检查临时文件是否被保留 - LOG_INFO "检查临时文件是否被保留" - if ls test*.tmp 1>/dev/null 2>&1; then - LOG_INFO "临时文件被成功保留" - else - LOG_ERROR "临时文件未被保留" - exit 1 - fi - - # 清理生成的临时文件 - LOG_INFO "清理生成的临时文件" - rm -f test*.tmp test.html test.css - - # 删除测试用的 LaTeX 文件 - LOG_INFO "删除测试用的 LaTeX 文件" - rm -f test.tex - - # 如果测试前未安装,则卸载软件包 - if [ $already_installed -eq 0 ]; then - LOG_INFO "卸载 texlive-tex4ht 软件包" - dnf remove -y texlive-tex4ht - CHECK_RESULT $? 0 0 "卸载 texlive-tex4ht 失败" - fi - - LOG_INFO "测试完成" -} - -main "$@" \ No newline at end of file diff --git a/testcases/function_test/pkg_test/texlive-base/texlive-tex4ht/test_texlive-tex4ht_htmex__upper_v.sh b/testcases/function_test/pkg_test/texlive-base/texlive-tex4ht/test_texlive-tex4ht_htmex__upper_v.sh deleted file mode 100644 index 66ed02c7119..00000000000 --- a/testcases/function_test/pkg_test/texlive-base/texlive-tex4ht/test_texlive-tex4ht_htmex__upper_v.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-02 -# @License : Mulan PSL v2 -# @Desc : 测试 htmex 命令的详细模式,用于显示处理过程中的详细信息 -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - # 测试 htmex 命令的详细模式,用于显示处理过程中的详细信息 - LOG_INFO "开始测试 htmex 命令的详细模式" - - # 检查软件包是否已在 yum 源中 - LOG_INFO "检查 yum 源中是否存在 texlive-tex4ht-htmex 软件包" - dnf list texlive-tex4ht-htmex 2>/dev/null | grep -q texlive-tex4ht-htmex - if [ $? -ne 0 ]; then - LOG_ERROR "yum 源中不存在 texlive-tex4ht-htmex 软件包" - exit 255 - fi - - # 检查软件包是否已安装 - LOG_INFO "检查 texlive-tex4ht-htmex 软件包是否已安装" - rpm -q texlive-tex4ht-htmex > /dev/null 2>&1 - if [ $? -eq 0 ]; then - LOG_INFO "texlive-tex4ht-htmex 软件包已安装,测试结束后将保持安装状态" - INSTALLED=1 - else - LOG_INFO "texlive-tex4ht-htmex 软件包未安装,将在测试前安装" - INSTALLED=0 - fi - - # 如果未安装,则安装软件包 - if [ $INSTALLED -eq 0 ]; then - LOG_INFO "安装 texlive-tex4ht-htmex 软件包" - dnf install -y texlive-tex4ht-htmex - CHECK_RESULT $? 0 0 "安装 texlive-tex4ht-htmex 软件包失败" - fi - - # 检查 htmex 命令是否支持 -v 参数 - LOG_INFO "检查 htmex 命令是否支持 -v 参数" - htmex -v > /dev/null 2>&1 - if [ $? -eq 255 ]; then - LOG_ERROR "htmex 命令不支持 -v 参数" - exit 255 - fi - - # 测试 htmex 命令的详细模式 - LOG_INFO "执行 htmex -v 命令测试详细模式" - htmex -v 2>&1 | grep -q "verbose" - CHECK_RESULT $? 0 0 "htmex -v 命令未显示详细模式信息" - - # 测试 htmex 命令的详细模式处理简单文件 - LOG_INFO "创建测试文件 test.tex" - cat > test.tex << "EOF" - \documentclass{article} - \begin{document} - Hello, World! - \end{document} - EOF - CHECK_RESULT $? 0 0 "创建测试文件失败" - - LOG_INFO "使用 htmex -v 处理测试文件" - htmex -v test.tex 2>&1 | grep -q "verbose" - CHECK_RESULT $? 0 0 "htmex -v 处理文件时未显示详细模式信息" - - # 清理测试文件 - LOG_INFO "清理测试文件" - rm -f test.tex test.html test.css - CHECK_RESULT $? 0 0 "清理测试文件失败" - - # 如果测试前未安装,则卸载软件包 - if [ $INSTALLED -eq 0 ]; then - LOG_INFO "卸载 texlive-tex4ht-htmex 软件包" - dnf remove -y texlive-tex4ht-htmex - CHECK_RESULT $? 0 0 "卸载 texlive-tex4ht-htmex 软件包失败" - else - LOG_INFO "保持 texlive-tex4ht-htmex 软件包安装状态" - fi - - LOG_INFO "测试 htmex 命令的详细模式完成" -} - -main "$@" \ No newline at end of file diff --git a/testcases/function_test/pkg_test/texlive-base/texlive-tex4ht/test_texlive-tex4ht_htmex_num_1.sh b/testcases/function_test/pkg_test/texlive-base/texlive-tex4ht/test_texlive-tex4ht_htmex_num_1.sh deleted file mode 100644 index 46859266415..00000000000 --- a/testcases/function_test/pkg_test/texlive-base/texlive-tex4ht/test_texlive-tex4ht_htmex_num_1.sh +++ /dev/null @@ -1,71 +0,0 @@ -#!/usr/bin/bash - -# Copyright (c) 2024 ISCAS .ALL rights reserved. -# This program is licensed under Mulan PSL v2. -# You can use it according to the terms and conditions of the Mulan PSL v2. -# http://license.coscl.org.cn/MulanPSL2 -# THIS PROGRAM IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, -# EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, -# MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. -# See the Mulan PSL v2 for more details. - -# ############################################# -# @Author : honghua -# @Contact : honghua@iscas.ac.cn -# @Date : 2025-11-27 -# @License : Mulan PSL v2 -# @Desc : 测试 htmex 命令的 -1 参数 -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - LOG_INFO "开始测试 htmex 命令的 -1 参数" - - # 检查软件包是否已安装 - LOG_INFO "检查 texlive-tex4ht-htmex 是否已安装" - if rpm -q texlive-tex4ht-htmex > /dev/null; then - LOG_INFO "texlive-tex4ht-htmex 已安装" - installed=true - else - LOG_INFO "texlive-tex4ht-htmex 未安装" - installed=false - fi - - # 检查 yum 源中是否有该软件包 - LOG_INFO "检查 yum 源中是否有 texlive-tex4ht-htmex" - if ! dnf list available texlive-tex4ht-htmex > /dev/null 2>&1; then - LOG_ERROR "yum 源中未找到 texlive-tex4ht-htmex" - exit 255 - fi - - # 如果未安装,则安装软件包 - if [ "$installed" = false ]; then - LOG_INFO "安装 texlive-tex4ht-htmex" - dnf install -y texlive-tex4ht-htmex - CHECK_RESULT $? 0 0 "安装 texlive-tex4ht-htmex 失败" - fi - - # 测试 htmex -1 参数 - LOG_INFO "测试 htmex -1 参数" - if ! htmex --help | grep -q "\-1"; then - LOG_ERROR "htmex 不支持 -1 参数" - exit 255 - fi - - # 执行 htmex -1 命令 - LOG_INFO "执行 htmex -1 命令" - htmex -1 > /dev/null 2>&1 - CHECK_RESULT $? 0 0 "执行 htmex -1 命令失败" - - # 清理环境,如果之前未安装则卸载软件包 - if [ "$installed" = false ]; then - LOG_INFO "卸载 texlive-tex4ht-htmex" - dnf remove -y texlive-tex4ht-htmex - CHECK_RESULT $? 0 0 "卸载 texlive-tex4ht-htmex 失败" - fi - - LOG_INFO "测试完成" -} - -main "$@" \ No newline at end of file diff --git a/testcases/function_test/pkg_test/texlive-base/texlive-tex4ht/test_texlive-tex4ht_htmex_upper_v.sh b/testcases/function_test/pkg_test/texlive-base/texlive-tex4ht/test_texlive-tex4ht_htmex_upper_v.sh deleted file mode 100644 index b24d2ce45c0..00000000000 --- a/testcases/function_test/pkg_test/texlive-base/texlive-tex4ht/test_texlive-tex4ht_htmex_upper_v.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-27 -# @License : Mulan PSL v2 -# @Desc : 测试 htmex 命令的 -V 参数 -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - LOG_INFO "开始测试 htmex 命令的 -V 参数" - - # 检查是否已安装 texlive-tex4ht-htmex - LOG_INFO "检查 texlive-tex4ht-htmex 是否已安装" - if dnf list installed texlive-tex4ht-htmex &>/dev/null; then - LOG_INFO "texlive-tex4ht-htmex 已安装" - INSTALLED=true - else - LOG_INFO "texlive-tex4ht-htmex 未安装" - INSTALLED=false - fi - - # 检查 yum 源中是否有 texlive-tex4ht-htmex - LOG_INFO "检查 yum 源中是否有 texlive-tex4ht-htmex" - if ! dnf list available texlive-tex4ht-htmex &>/dev/null; then - LOG_ERROR "yum 源中未找到 texlive-tex4ht-htmex" - exit 255 - fi - - # 如果未安装,则安装软件包 - if [ "$INSTALLED" = false ]; then - LOG_INFO "正在安装 texlive-tex4ht-htmex" - dnf install -y texlive-tex4ht-htmex - CHECK_RESULT $? 0 0 "安装 texlive-tex4ht-htmex 失败" - fi - - # 测试 htmex 命令的 -V 参数 - LOG_INFO "测试 htmex -V 命令" - htmex -V &>/dev/null - CHECK_RESULT $? 0 0 "htmex -V 命令执行失败" - - # 恢复环境:如果之前未安装,则卸载软件包 - if [ "$INSTALLED" = false ]; then - LOG_INFO "正在卸载 texlive-tex4ht-htmex" - dnf remove -y texlive-tex4ht-htmex - CHECK_RESULT $? 0 0 "卸载 texlive-tex4ht-htmex 失败" - fi - - LOG_INFO "测试完成" -} - -main "$@" \ No newline at end of file diff --git a/testcases/function_test/pkg_test/texlive-base/texlive-tex4ht/test_texlive-tex4ht_htmex_v.sh b/testcases/function_test/pkg_test/texlive-base/texlive-tex4ht/test_texlive-tex4ht_htmex_v.sh deleted file mode 100644 index 33b0c23c4d8..00000000000 --- a/testcases/function_test/pkg_test/texlive-base/texlive-tex4ht/test_texlive-tex4ht_htmex_v.sh +++ /dev/null @@ -1,49 +0,0 @@ -#!/usr/bin/bash - -# Copyright (c) 2024 ISCAS .ALL rights reserved. -# This program is licensed under Mulan PSL v2. -# You can use it according to the terms and conditions of the Mulan PSL v2. -# http://license.coscl.org.cn/MulanPSL2 -# THIS PROGRAM IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, -# EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, -# 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 : 测试 htmex 命令的 -v 参数 -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - LOG_INFO "开始测试 htmex 命令的 -v 参数" - - # 检查是否已安装 texlive-tex4ht-htmex 软件包 - LOG_INFO "检查 texlive-tex4ht-htmex 是否已安装" - if dnf list installed texlive-tex4ht-htmex &> /dev/null; then - LOG_INFO "texlive-tex4ht-htmex 已安装,脚本结束后保持安装状态" - installed=true - else - LOG_INFO "texlive-tex4ht-htmex 未安装,将在测试后卸载" - installed=false - fi - - # 检查 yum 源中是否有 texlive-tex4ht-htmex 软件包 - LOG_INFO "检查 yum 源中是否有 texlive-tex4ht-htmex" - if ! dnf list available texlive-tex4ht-htmex &> /dev/null; then - LOG_ERROR "yum 源中未找到 texlive-tex4ht-htmex 软件包" - exit 255 - fi - - # 如果未安装,则安装软件包 - if [ "$installed" = false ]; then - LOG_INFO "安装 texlive-tex4ht-htmex" - dnf install -y texlive-tex4ht-htmex - CHECK_RESULT $? 0 0 "安装 texlive-tex4ht -} - -main "$@" \ No newline at end of file diff --git a/testcases/function_test/pkg_test/texlive-base/texlive-tex4ht/test_texlive-tex4ht_httex_upper_a.sh b/testcases/function_test/pkg_test/texlive-base/texlive-tex4ht/test_texlive-tex4ht_httex_upper_a.sh deleted file mode 100644 index 23d08755778..00000000000 --- a/testcases/function_test/pkg_test/texlive-base/texlive-tex4ht/test_texlive-tex4ht_httex_upper_a.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-02 -# @License : Mulan PSL v2 -# @Desc : 测试httex命令的ASCII输出模式 -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - LOG_INFO "开始测试httex命令的ASCII输出模式" - - # 步骤1:检查yum源中是否存在texlive-tex4ht软件包 - LOG_INFO "步骤1:检查yum源中是否存在texlive-tex4ht软件包" - dnf list texlive-tex4ht 2>&1 | grep -q "texlive-tex4ht" - if [ $? -ne 0 ]; then - LOG_ERROR "yum源中未找到texlive-tex4ht软件包" - exit 255 - fi - - # 步骤2:检查是否已安装texlive-tex4ht - LOG_INFO "步骤2:检查是否已安装texlive-tex4ht" - rpm -q texlive-tex4ht > /dev/null 2>&1 - if [ $? -eq 0 ]; then - LOG_INFO "texlive-tex4ht已安装,测试结束后保持安装状态" - INSTALLED=1 - else - LOG_INFO "texlive-tex4ht未安装,将在测试结束后卸载" - INSTALLED=0 - fi - - # 步骤3:如果未安装,则安装texlive-tex4ht - if [ $INSTALLED -eq 0 ]; then - LOG_INFO "步骤3:安装texlive-tex4ht软件包" - dnf install -y texlive-tex4ht - CHECK_RESULT $? 0 0 "安装texlive-tex4ht失败" - fi - - # 步骤4:检查httex命令是否支持-upper-a参数 - LOG_INFO "步骤4:检查httex命令是否支持-upper-a参数" - httex --help 2>&1 | grep -q -- "-upper-a" - if [ $? -ne 0 ]; then - LOG_ERROR "httex命令不支持-upper-a参数" - exit 255 - fi - - # 步骤5:创建测试用的LaTeX文件 - LOG_INFO "步骤5:创建测试用的LaTeX文件" - cat > test.tex << "EOF" - \documentclass{article} - \begin{document} - Hello, World! - \end{document} - EOF - CHECK_RESULT $? 0 0 "创建测试文件失败" - - # 步骤6:使用httex命令的-upper-a参数转换LaTeX文件 - LOG_INFO "步骤6:使用httex命令的-upper-a参数转换LaTeX文件" - httex -upper-a test.tex - CHECK_RESULT $? 0 0 "httex命令执行失败" - - # 步骤7:检查生成的ASCII输出文件 - LOG_INFO "步骤7:检查生成的ASCII输出文件" - if [ -f test.html ]; then - LOG_INFO "成功生成ASCII输出文件test.html" - else - LOG_ERROR "未生成ASCII输出文件test.html" - exit 1 - fi - - # 步骤8:清理测试文件 - LOG_INFO "步骤8:清理测试文件" - rm -f test.tex test.html - CHECK_RESULT $? 0 0 "清理测试文件失败" - - # 步骤9:如果测试前未安装,则卸载texlive-tex4ht - if [ $INSTALLED -eq 0 ]; then - LOG_INFO "步骤9:卸载texlive-tex4ht软件包" - dnf remove -y texlive-tex4ht - CHECK_RESULT $? 0 0 "卸载texlive-tex4ht失败" - fi - - LOG_INFO "测试httex命令的ASCII输出模式完成" -} - -main "$@" \ No newline at end of file diff --git a/testcases/function_test/pkg_test/texlive-base/texlive-tex4ht/test_texlive-tex4ht_httex_upper_c.sh b/testcases/function_test/pkg_test/texlive-base/texlive-tex4ht/test_texlive-tex4ht_httex_upper_c.sh deleted file mode 100644 index 682f2205874..00000000000 --- a/testcases/function_test/pkg_test/texlive-base/texlive-tex4ht/test_texlive-tex4ht_httex_upper_c.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-03-02 -# @License : Mulan PSL v2 -# @Desc : 测试httex命令的CSS样式表输出 -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - LOG_INFO "开始测试httex命令的CSS样式表输出功能" - - LOG_INFO "1. 检查yum源中是否存在texlive-tex4ht软件包" - if ! dnf list texlive-tex4ht &>/dev/null; then - LOG_ERROR "yum源中不存在texlive-tex4ht软件包" - exit 255 - fi - - LOG_INFO "2. 检查是否已安装texlive-tex4ht" - if rpm -q texlive-tex4ht &>/dev/null; then - LOG_INFO "检测到texlive-tex4ht已安装,测试后保持安装状态" - ALREADY_INSTALLED=true - else - LOG_INFO "未安装texlive-tex4ht,将在测试过程中安装" - ALREADY_INSTALLED=false - fi - - if [ "$ALREADY_INSTALLED" = "false" ]; then - LOG_INFO "3. 安装texlive-tex4ht软件包" - dnf install -y texlive-tex4ht - CHECK_RESULT $? 0 0 "安装texlive-tex4ht失败" - fi - - LOG_INFO "4. 检查httex命令是否存在" - if ! command -v httex &>/dev/null; then - LOG_ERROR "httex命令不存在" - if [ "$ALREADY_INSTALLED" = "false" ]; then - dnf remove -y texlive-tex4ht - fi - exit 255 - fi - - LOG_INFO "5. 检查httex命令是否支持-css参数" - httex --help 2>&1 | grep -q "\-css" - if [ $? -ne 0 ]; then - LOG_ERROR "httex命令不支持-css参数" - if [ "$ALREADY_INSTALLED" = "false" ]; then - dnf remove -y texlive-tex4ht - fi - exit 255 - fi - - LOG_INFO "6. 创建测试用的简单LaTeX文件" - cat > test_sample.tex << "EOF" - \documentclass{article} - \begin{document} - Hello, World! - \end{document} - EOF - CHECK_RESULT $? 0 0 "创建测试LaTeX文件失败" - - LOG_INFO "7. 使用httex命令生成带CSS样式表的HTML文件" - httex -css test_sample.tex - CHECK_RESULT $? 0 0 "httex命令执行失败" - - LOG_INFO "8. 检查生成的HTML文件是否包含CSS样式表" - if [ -f test_sample.html ]; then - if grep -q " /dev/null; then - LOG_ERROR "软件包texlive-tex4ht-httex-upper-d不在yum源中" - exit 255 - fi - - # 检查是否已经安装 - LOG_INFO "检查软件包texlive-tex4ht-httex-upper-d是否已经安装" - if rpm -q texlive-tex4ht-httex-upper-d &> /dev/null; then - LOG_INFO "软件包texlive-tex4ht-httex-upper-d已经安装" - already_installed=true - else - LOG_INFO "软件包texlive-tex4ht-httex-upper-d未安装" - already_installed=false - fi - - # 如果未安装,则安装软件包 - if [ "$already_installed" = false ]; then - LOG_INFO "安装软件包texlive-tex4ht-httex-upper-d" - dnf install -y texlive-tex4ht-httex-upper-d - CHECK_RESULT $? 0 0 "安装软件包texlive-tex4ht-httex-upper-d失败" - fi - - # 检查httex命令是否存在 - LOG_INFO "检查httex命令是否存在" - command -v httex > /dev/null - CHECK_RESULT $? 0 0 "httex命令不存在" - - # 测试httex命令的调试输出选项 - LOG_INFO "测试httex命令的调试输出选项" - httex --debug 2>&1 | grep -q "debug" - CHECK_RESULT $? 0 0 "httex命令的调试输出选项测试失败" - - # 清理环境:如果之前未安装,则卸载软件包 - if [ "$already_installed" = false ]; then - LOG_INFO "卸载软件包texlive-tex4ht-httex-upper-d" - dnf remove -y texlive-tex4ht-httex-upper-d - CHECK_RESULT $? 0 0 "卸载软件包texlive-tex4ht-httex-upper-d失败" - fi - - LOG_INFO "测试完成" -} - -main "$@" \ No newline at end of file diff --git a/testcases/function_test/pkg_test/texlive-base/texlive-tex4ht/test_texlive-tex4ht_httex_upper_e.sh b/testcases/function_test/pkg_test/texlive-base/texlive-tex4ht/test_texlive-tex4ht_httex_upper_e.sh deleted file mode 100644 index 35233889979..00000000000 --- a/testcases/function_test/pkg_test/texlive-base/texlive-tex4ht/test_texlive-tex4ht_httex_upper_e.sh +++ /dev/null @@ -1,83 +0,0 @@ -#!/usr/bin/bash - -# Copyright (c) 2024 ISCAS .ALL rights reserved. -# This program is licensed under Mulan PSL v2. -# You can use it according to the terms and conditions of the Mulan PSL v2. -# http://license.coscl.org.cn/MulanPSL2 -# THIS PROGRAM IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, -# EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, -# MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. -# See the Mulan PSL v2 for more details. - -# ############################################# -# @Author : honghua -# @Contact : honghua@iscas.ac.cn -# @Date : 2026-03-02 -# @License : Mulan PSL v2 -# @Desc : 测试httex命令的编码设置 -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - LOG_INFO "开始测试httex命令的编码设置" - LOG_INFO "步骤1:检查系统中是否已安装texlive-tex4ht-httex软件包" - rpm -q texlive-tex4ht-httex > /dev/null 2>&1 - if [ $? -eq 0 ]; then - LOG_INFO "texlive-tex4ht-httex已安装,脚本结束时将保持安装状态" - INSTALLED=1 - else - LOG_INFO "texlive-tex4ht-httex未安装,将进行安装并最终卸载" - INSTALLED=0 - fi - - if [ ${INSTALLED} -eq 0 ]; then - LOG_INFO "步骤2:检查yum源中是否存在texlive-tex4ht-httex软件包" - dnf list available texlive-tex4ht-httex > /dev/null 2>&1 - if [ $? -ne 0 ]; then - LOG_ERROR "yum源中未找到texlive-tex4ht-httex软件包" - exit 255 - fi - - LOG_INFO "步骤3:安装texlive-tex4ht-httex软件包" - dnf install -y texlive-tex4ht-httex - CHECK_RESULT $? 0 0 "安装texlive-tex4ht-httex失败" - fi - - LOG_INFO "步骤4:检查httex命令是否存在" - which httex > /dev/null 2>&1 - CHECK_RESULT $? 0 0 "未找到httex命令" - - LOG_INFO "步骤5:测试httex命令的编码设置参数" - httex --help | grep -q "\-\-encoding" - if [ $? -ne 0 ]; then - LOG_ERROR "httex命令不支持--encoding参数" - exit 255 - fi - - LOG_INFO "步骤6:使用--encoding参数执行httex命令" - httex --encoding=utf-8 --version > /dev/null 2>&1 - CHECK_RESULT $? 0 0 "httex命令执行失败" - - LOG_INFO "步骤7:测试使用无效编码参数" - httex --encoding=invalid_encoding --version > /dev/null 2>&1 - if [ $? -eq 0 ]; then - LOG_ERROR "httex命令接受无效编码参数,测试失败" - exit 1 - else - LOG_INFO "httex命令正确处理无效编码参数" - fi - - LOG_INFO "步骤8:清理测试环境" - if [ ${INSTALLED} -eq 0 ]; then - LOG_INFO "卸载texlive-tex4ht-httex软件包" - dnf remove -y texlive-tex4ht-httex - CHECK_RESULT $? 0 0 "卸载texlive-tex4ht-httex失败" - else - LOG_INFO "保持texlive-tex4ht-httex软件包安装状态" - fi - - LOG_INFO "测试完成" -} - -main "$@" \ No newline at end of file diff --git a/testcases/function_test/pkg_test/texlive-base/texlive-tex4ht/test_texlive-tex4ht_httex_upper_f.sh b/testcases/function_test/pkg_test/texlive-base/texlive-tex4ht/test_texlive-tex4ht_httex_upper_f.sh deleted file mode 100644 index 0d29a9053a0..00000000000 --- a/testcases/function_test/pkg_test/texlive-base/texlive-tex4ht/test_texlive-tex4ht_httex_upper_f.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-02 -# @License : Mulan PSL v2 -# @Desc : 测试httex命令的配置文件参数 -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - LOG_INFO "开始测试httex命令的配置文件参数" - - # 检查yum源中是否存在texlive-tex4ht-httex-upper-f软件包 - LOG_INFO "检查yum源中是否存在texlive-tex4ht-httex-upper-f软件包" - dnf list available texlive-tex4ht-httex-upper-f &>/dev/null - if [ $? -ne 0 ]; then - LOG_ERROR "yum源中不存在texlive-tex4ht-httex-upper-f软件包" - exit 255 - fi - - # 判断环境是否已经安装texlive-tex4ht-httex-upper-f - LOG_INFO "判断环境是否已经安装texlive-tex4ht-httex-upper-f" - rpm -q texlive-tex4ht-httex-upper-f &>/dev/null - if [ $? -eq 0 ]; then - LOG_INFO "环境已安装texlive-tex4ht-httex-upper-f,脚本结束后保持安装状态" - already_installed=true - else - LOG_INFO "环境未安装texlive-tex4ht-httex-upper-f,开始安装" - already_installed=false - dnf install -y texlive-tex4ht-httex-upper-f - CHECK_RESULT $? 0 0 "安装texlive-tex4ht-httex-upper-f失败" - fi - - # 检查httex命令是否存在 - LOG_INFO "检查httex命令是否存在" - which httex &>/dev/null - CHECK_RESULT $? 0 0 "httex命令不存在" - - # 测试httex命令的配置文件参数 - LOG_INFO "测试httex命令的配置文件参数" - httex --help | grep -q "\-\-config" - if [ $? -ne 0 ]; then - LOG_ERROR "httex命令不支持--config参数" - exit 255 - fi - - # 创建一个临时的配置文件 - LOG_INFO "创建一个临时的配置文件" - temp_config=$(mktemp /tmp/httex_test_config.XXXXXX) - cat > "$temp_config" << "EOF" - # 测试配置文件 - test_setting = value - EOF - - # 使用配置文件参数执行httex命令 - LOG_INFO "使用配置文件参数执行httex命令" - httex --config "$temp_config" --version - CHECK_RESULT $? 0 0 "使用配置文件参数执行httex命令失败" - - # 清理临时配置文件 - LOG_INFO "清理临时配置文件" - rm -f "$temp_config" - - # 环境恢复 - LOG_INFO "环境恢复" - if [ "$already_installed" = false ]; then - LOG_INFO "卸载之前安装的texlive-tex4ht-httex-upper-f软件包" - dnf remove -y texlive-tex4ht-httex-upper-f - CHECK_RESULT $? 0 0 "卸载texlive-tex4ht-httex-upper-f失败" - else - LOG_INFO "保持texlive-tex4ht-httex-upper-f软件包的安装状态" - fi - - LOG_INFO "测试完成" -} - -main "$@" \ No newline at end of file diff --git a/testcases/function_test/pkg_test/texlive-base/texlive-tex4ht/test_texlive-tex4ht_httex_upper_h.sh b/testcases/function_test/pkg_test/texlive-base/texlive-tex4ht/test_texlive-tex4ht_httex_upper_h.sh deleted file mode 100644 index 9f28cd02d01..00000000000 --- a/testcases/function_test/pkg_test/texlive-base/texlive-tex4ht/test_texlive-tex4ht_httex_upper_h.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-02 -# @License : Mulan PSL v2 -# @Desc : 测试httex命令显示帮助信息 -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - LOG_INFO "开始测试httex命令显示帮助信息" - LOG_INFO "步骤1:检查texlive-tex4ht软件包是否在yum源中" - dnf list available texlive-tex4ht > /dev/null 2>&1 - if [ $? -ne 0 ]; then - LOG_ERROR "texlive-tex4ht软件包不在yum源中" - exit 255 - fi - LOG_INFO "texlive-tex4ht软件包在yum源中" - - LOG_INFO "步骤2:检查系统是否已安装texlive-tex4ht" - rpm -q texlive-tex4ht > /dev/null 2>&1 - if [ $? -eq 0 ]; then - LOG_INFO "texlive-tex4ht已安装,标记为已安装状态" - INSTALLED=1 - else - LOG_INFO "texlive-tex4ht未安装,标记为未安装状态" - INSTALLED=0 - fi - - if [ $INSTALLED -eq 0 ]; then - LOG_INFO "步骤3:安装texlive-tex4ht软件包" - dnf install -y texlive-tex4ht - CHECK_RESULT $? 0 0 "安装texlive-tex4ht失败" - fi - - LOG_INFO "步骤4:检查httex命令是否存在" - which httex > /dev/null 2>&1 - if [ $? -ne 0 ]; then - LOG_ERROR "httex命令不存在" - if [ $INSTALLED -eq 0 ]; then - LOG_INFO "清理环境:卸载texlive-tex4ht" - dnf remove -y texlive-tex4ht - fi - exit 255 - fi - - LOG_INFO "步骤5:执行httex命令显示帮助信息" - httex --help > /dev/null 2>&1 - CHECK_RESULT $? 0 0 "httex命令显示帮助信息失败" - - if [ $INSTALLED -eq 0 ]; then - LOG_INFO "步骤6:清理环境,卸载texlive-tex4ht" - dnf remove -y texlive-tex4ht - CHECK_RESULT $? 0 0 "卸载texlive-tex4ht失败" - fi - - LOG_INFO "测试完成" -} - -main "$@" \ No newline at end of file diff --git a/testcases/function_test/pkg_test/texlive-base/texlive-tex4ht/test_texlive-tex4ht_httex_upper_i.sh b/testcases/function_test/pkg_test/texlive-base/texlive-tex4ht/test_texlive-tex4ht_httex_upper_i.sh deleted file mode 100644 index 43e04d0eceb..00000000000 --- a/testcases/function_test/pkg_test/texlive-base/texlive-tex4ht/test_texlive-tex4ht_httex_upper_i.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-02 -# @License : Mulan PSL v2 -# @Desc : 测试httex命令的交互模式 -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - # 检查texlive-tex4ht-httex软件包是否在yum源中 - LOG_INFO "检查yum源中是否存在texlive-tex4ht-httex软件包" - dnf list available texlive-tex4ht-httex &>/dev/null - if [ $? -ne 0 ]; then - LOG_ERROR "yum源中未找到texlive-tex4ht-httex软件包" - exit 255 - fi - - # 检查httex命令是否已安装 - LOG_INFO "检查httex命令是否已安装" - if command -v httex &>/dev/null; then - LOG_INFO "httex命令已安装,标记为已安装状态" - already_installed=1 - else - LOG_INFO "httex命令未安装,标记为未安装状态" - already_installed=0 - fi - - # 如果未安装,则安装软件包 - if [ $already_installed -eq 0 ]; then - LOG_INFO "安装texlive-tex4ht-httex软件包" - dnf install -y texlive-tex4ht-httex - CHECK_RESULT $? 0 0 "安装texlive-tex4ht-httex软件包失败" - fi - - # 检查httex命令是否支持-i参数 - LOG_INFO "检查httex命令是否支持-i参数" - httex -i --help &>/dev/null - if [ $? -eq 255 ]; then - LOG_ERROR "httex命令不支持-i参数" - # 如果之前未安装,则卸载软件包 - if [ $already_installed -eq 0 ]; then - LOG_INFO "卸载texlive-tex4ht-httex软件包" - dnf remove -y texlive-tex4ht-httex - fi - exit 255 - fi - - # 测试httex命令的交互模式 - LOG_INFO "测试httex命令的交互模式" - echo "quit" | timeout 5 httex -i - CHECK_RESULT $? 0 0 "httex命令交互模式测试失败" - - # 清理环境:如果之前未安装,则卸载软件包 - if [ $already_installed -eq 0 ]; then - LOG_INFO "卸载texlive-tex4ht-httex软件包" - dnf remove -y texlive-tex4ht-httex - CHECK_RESULT $? 0 0 "卸载texlive-tex4ht-httex软件包失败" - fi - - LOG_INFO "测试完成" -} - -main "$@" \ No newline at end of file diff --git a/testcases/function_test/pkg_test/texlive-base/texlive-tex4ht/test_texlive-tex4ht_httex_upper_j.sh b/testcases/function_test/pkg_test/texlive-base/texlive-tex4ht/test_texlive-tex4ht_httex_upper_j.sh deleted file mode 100644 index e8e7142aae4..00000000000 --- a/testcases/function_test/pkg_test/texlive-base/texlive-tex4ht/test_texlive-tex4ht_httex_upper_j.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-02 -# @License : Mulan PSL v2 -# @Desc : 测试httex命令的字符集处理 -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - LOG_INFO "开始测试httex命令的字符集处理功能" - - # 检查是否已安装texlive-tex4ht-httex-upper-j软件包 - LOG_INFO "检查是否已安装texlive-tex4ht-httex-upper-j" - rpm -q texlive-tex4ht-httex-upper-j - if [ $? -eq 0 ]; then - LOG_INFO "软件包已安装,测试结束后将保持安装状态" - INSTALLED=true - else - LOG_INFO "软件包未安装,将在测试过程中安装并在结束后卸载" - INSTALLED=false - fi - - # 检查yum源中是否有该软件包 - LOG_INFO "检查yum源中是否存在texlive-tex4ht-httex-upper-j" - dnf list available texlive-tex4ht-httex-upper-j > /dev/null 2>&1 - CHECK_RESULT $? 0 0 "yum源中不存在texlive-tex4ht-httex-upper-j软件包" - if [ $? -ne 0 ]; then - LOG_ERROR "yum源中不存在texlive-tex4ht-httex-upper-j软件包" - exit 255 - fi - - # 如果未安装,则安装软件包 - if [ "$INSTALLED" = false ]; then - LOG_INFO "安装texlive-tex4ht-httex-upper-j软件包" - dnf install -y texlive-tex4ht-httex-upper-j - CHECK_RESULT $? 0 0 "安装texlive-tex4ht-httex-upper-j失败" - fi - - # 检查httex命令是否支持字符集参数 - LOG_INFO "检查httex命令是否支持字符集参数" - httex --help | grep -i "charset" > /dev/null 2>&1 - CHECK_RESULT $? 0 0 "httex命令不支持字符集参数" - if [ $? -ne 0 ]; then - LOG_ERROR "httex命令不支持字符集参数" - exit 255 - fi - - # 测试httex命令的字符集处理功能 - LOG_INFO "测试httex命令的字符集处理功能" - echo "测试内容" > test_input.txt - httex --charset=utf-8 test_input.txt test_output.html - CHECK_RESULT $? 0 0 "httex命令字符集处理失败" - - # 验证输出文件是否生成 - LOG_INFO "验证输出文件是否生成" - ls test_output.html > /dev/null 2>&1 - CHECK_RESULT $? 0 0 "输出文件未生成" - - # 清理测试文件 - LOG_INFO "清理测试文件" - rm -f test_input.txt test_output.html - - # 如果测试前未安装,则卸载软件包 - if [ "$INSTALLED" = false ]; then - LOG_INFO "卸载texlive-tex4ht-httex-upper-j软件包" - dnf remove -y texlive-tex4ht-httex-upper-j - CHECK_RESULT $? 0 0 "卸载texlive-tex4ht-httex-upper-j失败" - fi - - LOG_INFO "测试完成,环境已恢复" -} - -main "$@" \ No newline at end of file diff --git a/testcases/function_test/pkg_test/texlive-base/texlive-tex4ht/test_texlive-tex4ht_httex_upper_l.sh b/testcases/function_test/pkg_test/texlive-base/texlive-tex4ht/test_texlive-tex4ht_httex_upper_l.sh deleted file mode 100644 index 21445da01ea..00000000000 --- a/testcases/function_test/pkg_test/texlive-base/texlive-tex4ht/test_texlive-tex4ht_httex_upper_l.sh +++ /dev/null @@ -1,110 +0,0 @@ -#!/usr/bin/bash - -# Copyright (c) 2024 ISCAS .ALL rights reserved. -# This program is licensed under Mulan PSL v2. -# You can use it according to the terms and conditions of the Mulan PSL v2. -# http://license.coscl.org.cn/MulanPSL2 -# THIS PROGRAM IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, -# EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, -# 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-02 -# @License : Mulan PSL v2 -# @Desc : 测试httex命令的LaTeX模式 -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - # 初始化日志函数(实际环境中可能已定义) - LOG_INFO() { - echo "[INFO] $*" - } - - LOG_ERROR() { - echo "[ERROR] $*" - } - - # 定义软件包名称 - PACKAGE_NAME="texlive-tex4ht" - - # 步骤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_BEFORE=true - else - LOG_INFO "$PACKAGE_NAME 未安装,将在测试过程中安装" - INSTALLED_BEFORE=false - fi - - # 步骤3: 安装软件包(如果未安装) - if [ "$INSTALLED_BEFORE" = false ]; then - LOG_INFO "安装 $PACKAGE_NAME" - dnf install -y "$PACKAGE_NAME" - CHECK_RESULT $? 0 0 "安装 $PACKAGE_NAME 失败" - fi - - # 步骤4: 测试 httex 命令的 LaTeX 模式 - LOG_INFO "测试 httex 命令的 LaTeX 模式" - httex --version - CHECK_RESULT $? 0 0 "httex 命令执行失败" - - # 步骤5: 检查 httex 是否支持 LaTeX 模式参数 - LOG_INFO "检查 httex 是否支持 LaTeX 模式参数" - if ! httex --help | grep -q "\-\-latex"; then - LOG_ERROR "httex 不支持 --latex 参数" - exit 255 - fi - - # 步骤6: 创建测试 LaTeX 文件 - LOG_INFO "创建测试 LaTeX 文件" - cat > test.tex << "EOF" - \documentclass{article} - \begin{document} - Hello, LaTeX! - \end{document} - EOF - CHECK_RESULT $? 0 0 "创建测试 LaTeX 文件失败" - - # 步骤7: 使用 httex 处理 LaTeX 文件 - LOG_INFO "使用 httex 处理 LaTeX 文件" - httex --latex test.tex - CHECK_RESULT $? 0 0 "httex 处理 LaTeX 文件失败" - - # 步骤8: 检查生成的 HTML 文件 - LOG_INFO "检查生成的 HTML 文件" - if [ -f "test.html" ]; then - LOG_INFO "HTML 文件生成成功" - else - LOG_ERROR "HTML 文件未生成" - exit 1 - fi - - # 步骤9: 清理测试文件 - LOG_INFO "清理测试文件" - rm -f test.tex test.html - CHECK_RESULT $? 0 0 "清理测试文件失败" - - # 步骤10: 卸载软件包(如果之前未安装) - 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/texlive-base/texlive-tex4ht/test_texlive-tex4ht_httex_upper_s.sh b/testcases/function_test/pkg_test/texlive-base/texlive-tex4ht/test_texlive-tex4ht_httex_upper_s.sh deleted file mode 100644 index 467919e7067..00000000000 --- a/testcases/function_test/pkg_test/texlive-base/texlive-tex4ht/test_texlive-tex4ht_httex_upper_s.sh +++ /dev/null @@ -1,77 +0,0 @@ -#!/usr/bin/bash - -# Copyright (c) 2024 ISCAS .ALL rights reserved. -# This program is licensed under Mulan PSL v2. -# You can use it according to the terms and conditions of the Mulan PSL v2. -# http://license.coscl.org.cn/MulanPSL2 -# THIS PROGRAM IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, -# EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, -# MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. -# See the Mulan PSL v2 for more details. - -# ############################################# -# @Author : honghua -# @Contact : honghua@iscas.ac.cn -# @Date : 2026-03-02 -# @License : Mulan PSL v2 -# @Desc : 测试httex命令的数学公式输出样式 -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - LOG_INFO "开始测试:测试httex命令的数学公式输出样式" - LOG_INFO "步骤1:检查texlive-tex4ht软件包是否在yum源中" - dnf list available texlive-tex4ht 2>/dev/null | grep -q texlive-tex4ht - if [ $? -ne 0 ]; then - LOG_ERROR "yum源中未找到texlive-tex4ht软件包" - exit 255 - fi - LOG_INFO "步骤2:检查系统是否已安装texlive-tex4ht" - rpm -q texlive-tex4ht >/dev/null 2>&1 - installed=$? - if [ $installed -ne 0 ]; then - LOG_INFO "未安装texlive-tex4ht,将进行安装" - dnf install -y texlive-tex4ht - CHECK_RESULT $? 0 0 "安装texlive-tex4ht失败" - else - LOG_INFO "texlive-tex4ht已安装,跳过安装步骤" - fi - LOG_INFO "步骤3:验证httex命令是否存在" - which httex >/dev/null 2>&1 - CHECK_RESULT $? 0 0 "httex命令不存在" - LOG_INFO "步骤4:创建一个简单的LaTeX数学公式文件" - cat > test_math.tex << "EOF" - \documentclass{article} - \begin{document} - This is a test of math output: $E = mc^2$ - \end{document} - EOF - CHECK_RESULT $? 0 0 "创建test_math.tex文件失败" - LOG_INFO "步骤5:使用httex转换LaTeX文件" - httex test_math.tex - CHECK_RESULT $? 0 0 "httex命令执行失败" - LOG_INFO "步骤6:检查生成的HTML文件" - if [ -f test_math.html ]; then - LOG_INFO "成功生成test_math.html文件" - grep -q "E = mc^2" test_math.html - CHECK_RESULT $? 0 0 "生成的HTML文件中未找到数学公式" - else - LOG_ERROR "未生成test_math.html文件" - exit 1 - fi - LOG_INFO "步骤7:清理测试文件" - rm -f test_math.tex test_math.html test_math.css test_math*.png 2>/dev/null - CHECK_RESULT $? 0 0 "清理测试文件失败" - LOG_INFO "步骤8:根据初始安装状态决定是否卸载软件包" - if [ $installed -ne 0 ]; then - LOG_INFO "卸载texlive-tex4ht软件包" - dnf remove -y texlive-tex4ht - CHECK_RESULT $? 0 0 "卸载texlive-tex4ht失败" - else - LOG_INFO "保持texlive-tex4ht安装状态" - fi - LOG_INFO "测试完成:httex命令的数学公式输出样式测试通过" -} - -main "$@" \ No newline at end of file diff --git a/testcases/function_test/pkg_test/texlive-base/texlive-tex4ht/test_texlive-tex4ht_httex_upper_t.sh b/testcases/function_test/pkg_test/texlive-base/texlive-tex4ht/test_texlive-tex4ht_httex_upper_t.sh deleted file mode 100644 index b90e6f0f78d..00000000000 --- a/testcases/function_test/pkg_test/texlive-base/texlive-tex4ht/test_texlive-tex4ht_httex_upper_t.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-03-02 -# @License : Mulan PSL v2 -# @Desc : 测试httex命令的TeX模式 -# ############################################ - -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-tex4ht" - COMMAND_NAME="httex" - - # 步骤1: 检查yum源中是否存在指定软件包 - LOG_INFO "步骤1: 检查yum源中是否存在软件包 ${PACKAGE_NAME}" - dnf list available ${PACKAGE_NAME} &>/dev/null - if [ $? -ne 0 ]; then - LOG_ERROR "yum源中未找到软件包 ${PACKAGE_NAME}" - exit 255 - fi - LOG_INFO "软件包 ${PACKAGE_NAME} 在yum源中存在" - - # 步骤2: 检查httex命令是否已安装 - LOG_INFO "步骤2: 检查 ${COMMAND_NAME} 命令是否已安装" - command -v ${COMMAND_NAME} &>/dev/null - if [ $? -eq 0 ]; then - LOG_INFO "${COMMAND_NAME} 命令已安装,脚本结束后将保持安装状态" - ALREADY_INSTALLED=1 - else - LOG_INFO "${COMMAND_NAME} 命令未安装,将在测试过程中安装" - ALREADY_INSTALLED=0 - fi - - # 步骤3: 如果未安装,则安装软件包 - if [ ${ALREADY_INSTALLED} -eq 0 ]; then - LOG_INFO "步骤3: 安装软件包 ${PACKAGE_NAME}" - dnf install -y ${PACKAGE_NAME} - CHECK_RESULT $? 0 0 "安装软件包 ${PACKAGE_NAME} 失败" - LOG_INFO "软件包 ${PACKAGE_NAME} 安装成功" - fi - - # 步骤4: 检查httex命令是否支持TeX模式参数 - LOG_INFO "步骤4: 检查 ${COMMAND_NAME} 命令是否支持TeX模式参数" - ${COMMAND_NAME} --help 2>&1 | grep -q "\-\-tex" - if [ $? -ne 0 ]; then - LOG_ERROR "${COMMAND_NAME} 命令不支持TeX模式参数" - # 清理环境 - if [ ${ALREADY_INSTALLED} -eq 0 ]; then - LOG_INFO "清理环境: 卸载软件包 ${PACKAGE_NAME}" - dnf remove -y ${PACKAGE_NAME} - fi - exit 255 - fi - LOG_INFO "${COMMAND_NAME} 命令支持TeX模式参数" - - # 步骤5: 创建测试用的TeX文件 - LOG_INFO "步骤5: 创建测试用的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文件失败" - LOG_INFO "测试TeX文件创建成功: ${TEST_FILE}" - - # 步骤6: 执行httex命令的TeX模式转换 - LOG_INFO "步骤6: 执行 ${COMMAND_NAME} 命令的TeX模式转换" - ${COMMAND_NAME} --tex ${TEST_FILE} 2>&1 - CHECK_RESULT $? 0 0 "执行 ${COMMAND_NAME} 命令的TeX模式转换失败" - LOG_INFO "${COMMAND_NAME} 命令的TeX模式转换执行成功" - - # 步骤7: 检查生成的HTML文件 - LOG_INFO "步骤7: 检查生成的HTML文件" - HTML_FILE="${TEST_FILE%.tex}.html" - if [ -f "${HTML_FILE}" ]; then - LOG_INFO "成功生成HTML文件: ${HTML_FILE}" - # 检查HTML文件内容是否包含预期文本 - grep -q "Hello, TeX world!" ${HTML_FILE} - CHECK_RESULT $? 0 0 "生成的HTML文件内容不符合预期" - LOG_INFO "HTML文件内容验证成功" - else - LOG_ERROR "未找到生成的HTML文件: ${HTML_FILE}" - CHECK_RESULT 1 0 0 "HTML文件生成失败" - fi - - # 步骤8: 清理测试文件 - LOG_INFO "步骤8: 清理测试文件" - rm -f ${TEST_FILE} ${HTML_FILE} ${TEST_FILE%.tex}.css 2>/dev/null - LOG_INFO "测试文件清理完成" - - # 步骤9: 如果测试开始时未安装,则卸载软件包 - if [ ${ALREADY_INSTALLED} -eq 0 ]; then - LOG_INFO "步骤9: 卸载软件包 ${PACKAGE_NAME}" - dnf remove -y ${PACKAGE_NAME} - CHECK_RESULT $? 0 0 "卸载软件包 ${PACKAGE_NAME} 失败" - LOG_INFO "软件包 ${PACKAGE_NAME} 卸载成功" - else - LOG_INFO "步骤9: 测试开始时软件包已安装,保持安装状态" - fi - - LOG_INFO "测试脚本执行完成" -} - -main "$@" \ No newline at end of file diff --git a/testcases/function_test/pkg_test/texlive-base/texlive-tex4ht/test_texlive-tex4ht_httex_upper_u.sh b/testcases/function_test/pkg_test/texlive-base/texlive-tex4ht/test_texlive-tex4ht_httex_upper_u.sh deleted file mode 100644 index 89a85e3d808..00000000000 --- a/testcases/function_test/pkg_test/texlive-base/texlive-tex4ht/test_texlive-tex4ht_httex_upper_u.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-02 -# @License : Mulan PSL v2 -# @Desc : 测试httex命令的Unicode支持 -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - # 测试httex命令的Unicode支持 - LOG_INFO "开始测试httex命令的Unicode支持" - - # 定义软件包名称 - PACKAGE_NAME="texlive-tex4ht" - - # 步骤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:检查环境是否已安装软件包" - INSTALLED_FLAG=0 - rpm -q "$PACKAGE_NAME" > /dev/null 2>&1 - if [ $? -eq 0 ]; then - LOG_INFO "软件包 $PACKAGE_NAME 已安装" - INSTALLED_FLAG=1 - else - LOG_INFO "软件包 $PACKAGE_NAME 未安装" - fi - - # 步骤3:如果未安装,则安装软件包 - if [ $INSTALLED_FLAG -eq 0 ]; then - LOG_INFO "步骤3:安装软件包 $PACKAGE_NAME" - dnf install -y "$PACKAGE_NAME" - CHECK_RESULT $? 0 0 "安装软件包 $PACKAGE_NAME 失败" - fi - - # 步骤4:检查httex命令是否存在 - LOG_INFO "步骤4:检查httex命令是否存在" - command -v httex > /dev/null 2>&1 - CHECK_RESULT $? 0 0 "httex命令不存在" - - # 步骤5:测试httex命令的基本功能 - LOG_INFO "步骤5:测试httex命令的基本功能" - httex --help > /dev/null 2>&1 - CHECK_RESULT $? 0 0 "httex命令基本功能测试失败" - - # 步骤6:测试httex命令的Unicode支持参数 - LOG_INFO "步骤6:测试httex命令的Unicode支持参数" - httex --help 2>&1 | grep -q "unicode" - if [ $? -ne 0 ]; then - LOG_INFO "httex命令不支持Unicode参数,测试结束" - else - # 步骤7:创建测试文件测试Unicode支持 - LOG_INFO "步骤7:创建测试文件测试Unicode支持" - TEST_FILE="unicode_test.tex" - cat > "$TEST_FILE" << "EOF" - \documentclass{article} - \usepackage[utf8]{inputenc} - \begin{document} - 测试Unicode支持:αβγδεζηθικλμνξοπρστυφχψω - \end{document} - EOF - - # 步骤8:使用httex处理Unicode测试文件 - LOG_INFO "步骤8:使用httex处理Unicode测试文件" - httex "$TEST_FILE" > /dev/null 2>&1 - CHECK_RESULT $? 0 0 "httex处理Unicode文件失败" - - # 步骤9:检查输出文件 - LOG_INFO "步骤9:检查输出文件" - OUTPUT_FILE="unicode_test.html" - if [ -f "$OUTPUT_FILE" ]; then - LOG_INFO "成功生成输出文件" - # 检查输出文件中是否包含Unicode字符 - if grep -q "αβγδεζηθικλμνξοπρστυφχψω" "$OUTPUT_FILE" 2>/dev/null; then - LOG_INFO "httex成功处理Unicode字符" - else - LOG_ERROR "httex未能正确处理Unicode字符" - exit 1 - fi - else - LOG_ERROR "未生成输出文件" - exit 1 - fi - - # 步骤10:清理测试文件 - LOG_INFO "步骤10:清理测试文件" - rm -f "$TEST_FILE" "$OUTPUT_FILE" unicode_test*.css unicode_test*.png 2>/dev/null - fi - - # 步骤11:环境恢复 - LOG_INFO "步骤11:环境恢复" - if [ $INSTALLED_FLAG -eq 0 ]; then - LOG_INFO "卸载测试安装的软件包" - dnf remove -y "$PACKAGE_NAME" - CHECK_RESULT $? 0 0 "卸载软件包 $PACKAGE_NAME 失败" - else - LOG_INFO "保持软件包安装状态" - fi - - LOG_INFO "测试httex命令的Unicode支持完成" -} - -main "$@" \ No newline at end of file diff --git a/testcases/function_test/pkg_test/texlive-base/texlive-tex4ht/test_texlive-tex4ht_httex_upper_v.sh b/testcases/function_test/pkg_test/texlive-base/texlive-tex4ht/test_texlive-tex4ht_httex_upper_v.sh deleted file mode 100644 index b7ca6b9946f..00000000000 --- a/testcases/function_test/pkg_test/texlive-base/texlive-tex4ht/test_texlive-tex4ht_httex_upper_v.sh +++ /dev/null @@ -1,66 +0,0 @@ -#!/usr/bin/bash - -# Copyright (c) 2024 ISCAS .ALL rights reserved. -# This program is licensed under Mulan PSL v2. -# You can use it according to the terms and conditions of the Mulan PSL v2. -# http://license.coscl.org.cn/MulanPSL2 -# THIS PROGRAM IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, -# EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, -# MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. -# See the Mulan PSL v2 for more details. - -# ############################################# -# @Author : honghua -# @Contact : honghua@iscas.ac.cn -# @Date : 2026-03-02 -# @License : Mulan PSL v2 -# @Desc : 测试httex命令的详细版本信息输出 -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - # 检查是否已经安装texlive-tex4ht-httex包 - LOG_INFO "检查texlive-tex4ht-httex包是否已经安装" - rpm -q texlive-tex4ht-httex > /dev/null 2>&1 - if [ $? -eq 0 ]; then - LOG_INFO "texlive-tex4ht-httex已经安装,脚本结束时将保持安装状态" - INSTALLED=1 - else - LOG_INFO "texlive-tex4ht-httex未安装" - INSTALLED=0 - fi - - # 检查yum源中是否有texlive-tex4ht-httex包 - LOG_INFO "检查yum源中是否有texlive-tex4ht-httex包" - dnf list texlive-tex4ht-httex > /dev/null 2>&1 - if [ $? -ne 0 ]; then - LOG_ERROR "yum源中没有texlive-tex4ht-httex包" - exit 255 - fi - - # 如果未安装,则安装软件包 - if [ $INSTALLED -eq 0 ]; then - LOG_INFO "开始安装texlive-tex4ht-httex包" - dnf install -y texlive-tex4ht-httex - CHECK_RESULT $? 0 0 "安装texlive-tex4ht-httex包失败" - fi - - # 测试httex命令的详细版本信息输出 - LOG_INFO "测试httex命令的详细版本信息输出" - httex --version - CHECK_RESULT $? 0 0 "httex --version命令执行失败" - - # 清理环境 - if [ $INSTALLED -eq 0 ]; then - LOG_INFO "卸载texlive-tex4ht-httex包" - dnf remove -y texlive-tex4ht-httex - CHECK_RESULT $? 0 0 "卸载texlive-tex4ht-httex包失败" - else - LOG_INFO "保持texlive-tex4ht-httex包安装状态" - fi - - LOG_INFO "测试脚本执行完成" -} - -main "$@" \ No newline at end of file diff --git a/testcases/function_test/pkg_test/texlive-base/texlive-tex4ht/test_texlive-tex4ht_httexi_upper_f.sh b/testcases/function_test/pkg_test/texlive-base/texlive-tex4ht/test_texlive-tex4ht_httexi_upper_f.sh deleted file mode 100644 index 9ba9030ebb5..00000000000 --- a/testcases/function_test/pkg_test/texlive-base/texlive-tex4ht/test_texlive-tex4ht_httexi_upper_f.sh +++ /dev/null @@ -1,118 +0,0 @@ -#!/usr/bin/bash - -# Copyright (c) 2024 ISCAS .ALL rights reserved. -# This program is licensed under Mulan PSL v2. -# You can use it according to the terms and conditions of the Mulan PSL v2. -# http://license.coscl.org.cn/MulanPSL2 -# THIS PROGRAM IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, -# EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, -# MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. -# See the Mulan PSL v2 for more details. - -# ############################################# -# @Author : honghua -# @Contact : honghua@iscas.ac.cn -# @Date : 2026-03-02 -# @License : Mulan PSL v2 -# @Desc : 测试httexi命令的强制模式,覆盖现有文件 -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - # 检查是否已安装texlive-tex4ht - LOG_INFO "检查是否已安装texlive-tex4ht" - rpm -q texlive-tex4ht > /dev/null 2>&1 - if [ $? -eq 0 ]; then - LOG_INFO "texlive-tex4ht已安装,测试结束后保持安装状态" - INSTALLED=true - else - LOG_INFO "texlive-tex4ht未安装,测试过程中将安装,测试结束后卸载" - INSTALLED=false - fi - - # 检查yum源中是否有texlive-tex4ht软件包 - LOG_INFO "检查yum源中是否有texlive-tex4ht软件包" - dnf list available texlive-tex4ht > /dev/null 2>&1 - CHECK_RESULT $? 0 0 "yum源中没有texlive-tex4ht软件包" - if [ $? -ne 0 ]; then - LOG_ERROR "yum源中没有texlive-tex4ht软件包" - exit 255 - fi - - # 如果未安装,则安装texlive-tex4ht - if [ "$INSTALLED" = false ]; then - LOG_INFO "安装texlive-tex4ht软件包" - dnf install -y texlive-tex4ht - CHECK_RESULT $? 0 0 "安装texlive-tex4ht失败" - fi - - # 检查httexi命令是否存在 - LOG_INFO "检查httexi命令是否存在" - command -v httexi > /dev/null 2>&1 - CHECK_RESULT $? 0 0 "httexi命令不存在" - - # 检查httexi命令是否支持-f参数 - LOG_INFO "检查httexi命令是否支持-f参数" - httexi --help 2>&1 | grep -q "\-f" - if [ $? -ne 0 ]; then - LOG_ERROR "httexi命令不支持-f参数" - exit 255 - fi - - # 创建测试文件 - LOG_INFO "创建测试文件test.tex" - cat > test.tex << EOF - \documentclass{article} - \begin{document} - Hello, World! - \end{document} - EOF - CHECK_RESULT $? 0 0 "创建test.tex文件失败" - - # 第一次运行httexi生成文件 - LOG_INFO "第一次运行httexi生成文件" - httexi test.tex - CHECK_RESULT $? 0 0 "第一次运行httexi失败" - - # 确认文件已生成 - LOG_INFO "确认文件已生成" - ls test.html > /dev/null 2>&1 - CHECK_RESULT $? 0 0 "test.html文件未生成" - - # 修改原始文件内容 - LOG_INFO "修改原始文件内容" - cat > test.tex << EOF - \documentclass{article} - \begin{document} - Modified Content! - \end{document} - EOF - CHECK_RESULT $? 0 0 "修改test.tex文件失败" - - # 使用-f参数强制覆盖现有文件 - LOG_INFO "使用-f参数强制覆盖现有文件" - httexi -f test.tex - CHECK_RESULT $? 0 0 "使用-f参数运行httexi失败" - - # 检查文件是否被覆盖 - LOG_INFO "检查文件是否被覆盖" - grep -q "Modified Content!" test.html - CHECK_RESULT $? 0 0 "文件内容未被正确覆盖" - - # 清理测试文件 - LOG_INFO "清理测试文件" - rm -f test.tex test.html test.css test*.png test*.svg - CHECK_RESULT $? 0 0 "清理测试文件失败" - - # 如果测试前未安装,则卸载texlive-tex4ht - if [ "$INSTALLED" = false ]; then - LOG_INFO "卸载texlive-tex4ht软件包" - dnf remove -y texlive-tex4ht - CHECK_RESULT $? 0 0 "卸载texlive-tex4ht失败" - fi - - LOG_INFO "测试完成" -} - -main "$@" \ No newline at end of file diff --git a/testcases/function_test/pkg_test/texlive-base/texlive-tex4ht/test_texlive-tex4ht_httexi_upper_h.sh b/testcases/function_test/pkg_test/texlive-base/texlive-tex4ht/test_texlive-tex4ht_httexi_upper_h.sh deleted file mode 100644 index 092bf0f18b9..00000000000 --- a/testcases/function_test/pkg_test/texlive-base/texlive-tex4ht/test_texlive-tex4ht_httexi_upper_h.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-02 -# @License : Mulan PSL v2 -# @Desc : 测试httexi命令的帮助信息输出 -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - # 测试环境初始化 - LOG_INFO "开始测试httexi命令的帮助信息输出" - - # 检查是否已安装texlive-tex4ht - LOG_INFO "检查texlive-tex4ht是否已安装" - if dnf list installed texlive-tex4ht &>/dev/null; then - LOG_INFO "texlive-tex4ht已安装,测试完成后保持安装状态" - ALREADY_INSTALLED=1 - else - LOG_INFO "texlive-tex4ht未安装,将安装并测试" - ALREADY_INSTALLED=0 - fi - - # 检查yum源中是否有texlive-tex4ht软件包 - LOG_INFO "检查yum源中是否有texlive-tex4ht软件包" - if ! dnf list available texlive-tex4ht &>/dev/null; then - LOG_ERROR "yum源中未找到texlive-tex4ht软件包" - exit 255 - fi - - # 如果未安装则安装软件包 - if [ $ALREADY_INSTALLED -eq 0 ]; then - LOG_INFO "开始安装texlive-tex4ht软件包" - dnf install -y texlive-tex4ht - CHECK_RESULT $? 0 0 "安装texlive-tex4ht失败" - fi - - # 检查httexi命令是否存在 - LOG_INFO "检查httexi命令是否存在" - command -v httexi >/dev/null 2>&1 - CHECK_RESULT $? 0 0 "httexi命令不存在" - - # 测试httexi命令的帮助信息输出 - LOG_INFO "测试httexi命令的帮助信息输出" - httexi --help > /tmp/httexi_help_output.txt 2>&1 - HELP_EXIT_CODE=$? - - # 检查命令是否执行成功 - if [ $HELP_EXIT_CODE -eq 0 ]; then - LOG_INFO "httexi --help命令执行成功" - # 检查输出是否包含帮助信息 - if grep -q "usage\|Usage\|help\|Help" /tmp/httexi_help_output.txt; then - LOG_INFO "httexi命令帮助信息输出正常" - else - LOG_ERROR "httexi命令帮助信息输出异常" - exit 1 - fi - elif [ $HELP_EXIT_CODE -eq 255 ]; then - LOG_ERROR "httexi命令不支持--help参数" - exit 255 - else - LOG_ERROR "httexi命令执行失败,退出码: $HELP_EXIT_CODE" - exit $HELP_EXIT_CODE - fi - - # 清理临时文件 - LOG_INFO "清理临时文件" - rm -f /tmp/httexi_help_output.txt - - # 环境恢复 - if [ $ALREADY_INSTALLED -eq 0 ]; then - LOG_INFO "卸载texlive-tex4ht软件包" - dnf remove -y texlive-tex4ht - CHECK_RESULT $? 0 0 "卸载texlive-tex4ht失败" - LOG_INFO "环境已恢复到测试前状态" - else - LOG_INFO "保持texlive-tex4ht安装状态" - fi - - LOG_INFO "测试完成" -} - -main "$@" \ No newline at end of file diff --git a/testcases/function_test/pkg_test/texlive-base/texlive-tex4ht/test_texlive-tex4ht_httexi_upper_l.sh b/testcases/function_test/pkg_test/texlive-base/texlive-tex4ht/test_texlive-tex4ht_httexi_upper_l.sh deleted file mode 100644 index 48d0a79fe19..00000000000 --- a/testcases/function_test/pkg_test/texlive-base/texlive-tex4ht/test_texlive-tex4ht_httexi_upper_l.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-02 -# @License : Mulan PSL v2 -# @Desc : 测试httexi命令的LaTeX模式,使用latex命令处理 -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - # 定义变量 - PKG_NAME="texlive-tex4ht" - CMD="httexi" - MODE="latex" - TEST_FILE="test_upper_l.tex" - EXPECTED_OUTPUT="test_upper_l.dvi" - - # 步骤1:检查软件包是否在yum源中 - LOG_INFO "步骤1:检查软件包是否在yum源中" - dnf list available ${PKG_NAME} &>/dev/null - if [ $? -ne 0 ]; then - LOG_ERROR "软件包 ${PKG_NAME} 不在yum源中" - exit 255 - fi - - # 步骤2:检查环境是否已安装软件包 - LOG_INFO "步骤2:检查环境是否已安装软件包" - rpm -q ${PKG_NAME} &>/dev/null - if [ $? -eq 0 ]; then - LOG_INFO "软件包 ${PKG_NAME} 已安装" - INSTALLED=1 - else - LOG_INFO "软件包 ${PKG_NAME} 未安装" - INSTALLED=0 - fi - - # 步骤3:如果未安装,则安装软件包 - if [ ${INSTALLED} -eq 0 ]; then - LOG_INFO "步骤3:安装软件包 ${PKG_NAME}" - dnf install -y ${PKG_NAME} &>/dev/null - CHECK_RESULT $? 0 0 "安装软件包 ${PKG_NAME} 失败" - fi - - # 步骤4:检查httexi命令是否支持latex模式 - LOG_INFO "步骤4:检查httexi命令是否支持latex模式" - ${CMD} --help 2>&1 | grep -q "\-\-${MODE}" - if [ $? -ne 0 ]; then - LOG_ERROR "httexi命令不支持 ${MODE} 模式" - exit 255 - fi - - # 步骤5:创建测试用的LaTeX文件 - LOG_INFO "步骤5:创建测试用的LaTeX文件" - cat > ${TEST_FILE} << "EOF" - \documentclass{article} - \begin{document} - Hello, World! - \end{document} - EOF - CHECK_RESULT $? 0 0 "创建测试文件 ${TEST_FILE} 失败" - - # 步骤6:使用httexi命令的LaTeX模式处理测试文件 - LOG_INFO "步骤6:使用httexi命令的LaTeX模式处理测试文件" - ${CMD} --${MODE} ${TEST_FILE} &>/dev/null - CHECK_RESULT $? 0 0 "httexi命令处理测试文件失败" - - # 步骤7:检查是否生成了预期的输出文件 - LOG_INFO "步骤7:检查是否生成了预期的输出文件" - if [ -f ${EXPECTED_OUTPUT} ]; then - LOG_INFO "成功生成了输出文件 ${EXPECTED_OUTPUT}" - else - LOG_ERROR "未生成预期的输出文件 ${EXPECTED_OUTPUT}" - exit 1 - fi - - # 步骤8:清理测试生成的文件 - LOG_INFO "步骤8:清理测试生成的文件" - rm -f ${TEST_FILE} ${EXPECTED_OUTPUT} *.log *.aux - CHECK_RESULT $? 0 0 "清理测试文件失败" - - # 步骤9:如果测试前未安装,则卸载软件包 - if [ ${INSTALLED} -eq 0 ]; then - LOG_INFO "步骤9:卸载软件包 ${PKG_NAME}" - dnf remove -y ${PKG_NAME} &>/dev/null - CHECK_RESULT $? 0 0 "卸载软件包 ${PKG_NAME} 失败" - fi - - LOG_INFO "测试完成" -} - -main "$@" \ No newline at end of file diff --git a/testcases/function_test/pkg_test/texlive-base/texlive-tex4ht/test_texlive-tex4ht_httexi_upper_lu.sh b/testcases/function_test/pkg_test/texlive-base/texlive-tex4ht/test_texlive-tex4ht_httexi_upper_lu.sh deleted file mode 100644 index 848b7d63365..00000000000 --- a/testcases/function_test/pkg_test/texlive-base/texlive-tex4ht/test_texlive-tex4ht_httexi_upper_lu.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-02 -# @License : Mulan PSL v2 -# @Desc : 测试httexi命令的LuaTeX模式,使用lualatex命令处理 -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - LOG_INFO "开始测试httexi命令的LuaTeX模式,使用lualatex命令处理" - - LOG_INFO "步骤1:检查环境中是否已安装texlive-tex4ht-httexi-upper-lu软件包" - if dnf list installed texlive-tex4ht-httexi-upper-lu &>/dev/null; then - LOG_INFO "texlive-tex4ht-httexi-upper-lu已安装,脚本结束时将保持安装状态" - INSTALLED=true - else - LOG_INFO "texlive-tex4ht-httexi-upper-lu未安装,将在测试过程中安装" - INSTALLED=false - fi - - LOG_INFO "步骤2:检查yum源中是否有texlive-tex4ht-httexi-upper-lu软件包" - if ! dnf list available texlive-tex4ht-httexi-upper-lu &>/dev/null; then - LOG_ERROR "yum源中未找到texlive-tex4ht-httexi-upper-lu软件包" - exit 255 - fi - - if [ "$INSTALLED" = false ]; then - LOG_INFO "步骤3:安装texlive-tex4ht-httexi-upper-lu软件包" - dnf install -y texlive-tex4ht-httexi-upper-lu - CHECK_RESULT $? 0 0 "安装texlive-tex4ht-httexi-upper-lu失败" - fi - - LOG_INFO "步骤4:检查httexi命令是否支持--luatex参数" - httexi --help 2>&1 | grep -q -- --luatex - CHECK_RESULT $? 0 0 "httexi命令不支持--luatex参数" - if [ $? -ne 0 ]; then - LOG_ERROR "httexi命令不支持--luatex参数" - exit 255 - fi - - LOG_INFO "步骤5:创建测试用的简单TeX文件" - cat > test.tex << "EOF" - \documentclass{article} - \begin{document} - Hello, LuaTeX! - \end{document} - EOF - CHECK_RESULT $? 0 0 "创建测试文件失败" - - LOG_INFO "步骤6:使用httexi命令的LuaTeX模式处理测试文件" - httexi --luatex test.tex - CHECK_RESULT $? 0 0 "httexi命令执行失败" - - LOG_INFO "步骤7:检查是否生成了对应的HTML文件" - if [ -f test.html ]; then - LOG_INFO "成功生成test.html文件" - else - LOG_ERROR "未生成test.html文件" - exit 1 - fi - - LOG_INFO "步骤8:清理生成的测试文件" - rm -f test.tex test.html test.css test*.png test*.svg 2>/dev/null - CHECK_RESULT $? 0 0 "清理测试文件失败" - - if [ "$INSTALLED" = false ]; then - LOG_INFO "步骤9:卸载测试安装的texlive-tex4ht-httexi-upper-lu软件包" - dnf remove -y texlive-tex4ht-httexi-upper-lu - CHECK_RESULT $? 0 0 "卸载texlive-tex4ht-httexi-upper-lu失败" - fi - - LOG_INFO "测试完成,环境已恢复" -} - -main "$@" \ No newline at end of file diff --git a/testcases/function_test/pkg_test/texlive-base/texlive-tex4ht/test_texlive-tex4ht_httexi_upper_p.sh b/testcases/function_test/pkg_test/texlive-base/texlive-tex4ht/test_texlive-tex4ht_httexi_upper_p.sh deleted file mode 100644 index 9f176190f2a..00000000000 --- a/testcases/function_test/pkg_test/texlive-base/texlive-tex4ht/test_texlive-tex4ht_httexi_upper_p.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-02 -# @License : Mulan PSL v2 -# @Desc : 测试httexi命令的PDF模式,使用pdflatex命令处理 -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - LOG_INFO "开始测试httexi命令的PDF模式,使用pdflatex命令处理" - - # 检查yum源中是否存在texlive-tex4ht软件包 - LOG_INFO "检查yum源中是否存在texlive-tex4ht软件包" - dnf list available texlive-tex4ht > /dev/null 2>&1 - CHECK_RESULT $? 0 255 "yum源中不存在texlive-tex4ht软件包" - - # 检查是否已安装texlive-tex4ht - LOG_INFO "检查是否已安装texlive-tex4ht" - if rpm -q texlive-tex4ht > /dev/null 2>&1; then - LOG_INFO "texlive-tex4ht已安装,测试结束后将保持安装状态" - INSTALLED=true - else - LOG_INFO "texlive-tex4ht未安装,将在测试过程中安装" - INSTALLED=false - fi - - # 如果未安装,则安装软件包 - if [ "$INSTALLED" = false ]; then - LOG_INFO "安装texlive-tex4ht软件包" - dnf install -y texlive-tex4ht - CHECK_RESULT $? 0 0 "安装texlive-tex4ht失败" - fi - - # 检查httexi命令是否支持-pdf参数 - LOG_INFO "检查httexi命令是否支持-pdf参数" - httexi --help 2>&1 | grep -q "\-pdf" - CHECK_RESULT $? 0 255 "httexi命令不支持-pdf参数" - - # 创建测试用的简单tex文件 - LOG_INFO "创建测试用的简单tex文件" - cat > test.tex << "EOF" - \documentclass{article} - \begin{document} - Hello, World! - \end{document} - EOF - - # 使用httexi命令处理tex文件,使用pdflatex命令 - LOG_INFO "使用httexi命令处理tex文件,使用pdflatex命令" - httexi -pdf test.tex - CHECK_RESULT $? 0 0 "httexi命令执行失败" - - # 检查是否生成了PDF文件 - LOG_INFO "检查是否生成了PDF文件" - if [ -f test.pdf ]; then - LOG_INFO "成功生成PDF文件" - else - LOG_ERROR "未生成PDF文件" - exit 1 - fi - - # 清理测试文件 - LOG_INFO "清理测试文件" - rm -f test.tex test.pdf test.log test.aux test.out - - # 如果测试前未安装,则卸载软件包 - if [ "$INSTALLED" = false ]; then - LOG_INFO "卸载texlive-tex4ht软件包" - dnf remove -y texlive-tex4ht - CHECK_RESULT $? 0 0 "卸载texlive-tex4ht失败" - fi - - LOG_INFO "测试完成" -} - -main "$@" \ No newline at end of file diff --git a/testcases/function_test/pkg_test/texlive-base/texlive-tex4ht/test_texlive-tex4ht_httexi_upper_q.sh b/testcases/function_test/pkg_test/texlive-base/texlive-tex4ht/test_texlive-tex4ht_httexi_upper_q.sh deleted file mode 100644 index 6781ea0c9aa..00000000000 --- a/testcases/function_test/pkg_test/texlive-base/texlive-tex4ht/test_texlive-tex4ht_httexi_upper_q.sh +++ /dev/null @@ -1,164 +0,0 @@ -#!/usr/bin/bash - -# Copyright (c) 2024 ISCAS .ALL rights reserved. -# This program is licensed under Mulan PSL v2. -# You can use it according to the terms and conditions of the Mulan PSL v2. -# http://license.coscl.org.cn/MulanPSL2 -# THIS PROGRAM IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, -# EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, -# 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-02 -# @License : Mulan PSL v2 -# @Desc : 测试httexi命令的安静模式,减少输出 -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - # 定义颜色和日志函数 - RED="\033[0;31m" - GREEN="\033[0;32m" - RESET="\033[0m" - - LOG_INFO() { - echo -e "${GREEN}[INFO]${RESET} $1" - } - - LOG_ERROR() { - echo -e "${RED}[ERROR]${RESET} $1" - } - - # 检查软件包是否在yum源中 - check_package_in_repo() { - local pkg=$1 - LOG_INFO "检查yum源中是否存在软件包: $pkg" - dnf list available "$pkg" &> /dev/null - if [ $? -ne 0 ]; then - LOG_ERROR "软件包 $pkg 不在yum源中" - exit 255 - fi - LOG_INFO "软件包 $pkg 存在于yum源中" - } - - # 安装软件包 - install_package() { - local pkg=$1 - LOG_INFO "安装软件包: $pkg" - dnf install -y "$pkg" - CHECK_RESULT $? 0 0 "安装软件包 $pkg 失败" - } - - # 卸载软件包 - uninstall_package() { - local pkg=$1 - LOG_INFO "卸载软件包: $pkg" - dnf remove -y "$pkg" - CHECK_RESULT $? 0 0 "卸载软件包 $pkg 失败" - } - - # 检查命令参数是否存在 - check_command_option() { - local cmd=$1 - local option=$2 - LOG_INFO "检查命令 $cmd 是否支持参数 $option" - $cmd --help 2>&1 | grep -q -- "$option" - if [ $? -ne 0 ]; then - LOG_ERROR "命令 $cmd 不支持参数 $option" - exit 255 - fi - LOG_INFO "命令 $cmd 支持参数 $option" - } - - # 主测试函数 - main() { - LOG_INFO "开始测试httexi命令的安静模式" - - # 定义软件包名称 - PACKAGE="texlive-tex4ht" - CMD="httexi" - OPTION="--quiet" - - # 检查软件包是否在yum源中 - check_package_in_repo "$PACKAGE" - - # 检查是否已安装软件包 - LOG_INFO "检查系统是否已安装软件包: $PACKAGE" - if rpm -q "$PACKAGE" &> /dev/null; then - LOG_INFO "软件包 $PACKAGE 已安装,测试后保持安装状态" - ALREADY_INSTALLED=1 - else - LOG_INFO "软件包 $PACKAGE 未安装,将在测试后卸载" - ALREADY_INSTALLED=0 - install_package "$PACKAGE" - fi - - # 检查命令是否存在 - LOG_INFO "检查命令 $CMD 是否存在" - command -v "$CMD" > /dev/null - CHECK_RESULT $? 0 0 "命令 $CMD 不存在" - - # 检查命令是否支持quiet参数 - check_command_option "$CMD" "$OPTION" - - # 创建测试用的简单tex文件 - LOG_INFO "创建测试用的tex文件" - TEST_TEX="test_httexi.tex" - cat > "$TEST_TEX" << "EOF" - \documentclass{article} - \begin{document} - Hello, World! - \end{document} - EOF - CHECK_RESULT $? 0 0 "创建测试tex文件失败" - - # 测试httexi命令的安静模式 - LOG_INFO "测试httexi命令的安静模式" - # 使用--quiet参数,减少输出 - $CMD "$TEST_TEX" "$OPTION" 2>&1 | tee httexi_output.log - CHECK_RESULT $? 0 0 "httexi命令执行失败" - - # 验证安静模式的效果 - LOG_INFO "验证安静模式减少输出" - # 检查输出文件是否生成 - if [ -f "${TEST_TEX%.tex}.html" ]; then - LOG_INFO "httexi命令成功生成HTML文件" - else - LOG_ERROR "httexi命令未生成HTML文件" - exit 1 - fi - - # 检查输出日志文件大小,安静模式下应该输出较少 - LOG_INFO "检查安静模式下的输出量" - OUTPUT_SIZE=$(wc -l < httexi_output.log) - if [ "$OUTPUT_SIZE" -lt 10 ]; then - LOG_INFO "安静模式有效,输出行数: $OUTPUT_SIZE" - else - LOG_ERROR "安静模式可能无效,输出行数较多: $OUTPUT_SIZE" - exit 1 - fi - - # 清理测试文件 - LOG_INFO "清理测试文件" - rm -f "$TEST_TEX" "${TEST_TEX%.tex}.html" "${TEST_TEX%.tex}.css" httexi_output.log - CHECK_RESULT $? 0 0 "清理测试文件失败" - - # 如果测试前未安装,则卸载软件包 - if [ "$ALREADY_INSTALLED" -eq 0 ]; then - uninstall_package "$PACKAGE" - else - LOG_INFO "测试前已安装软件包,保持安装状态" - fi - - LOG_INFO "httexi命令安静模式测试完成" - } - - # 执行主测试函数 - main -} - -main "$@" \ No newline at end of file diff --git a/testcases/function_test/pkg_test/texlive-base/texlive-tex4ht/test_texlive-tex4ht_httexi_upper_x.sh b/testcases/function_test/pkg_test/texlive-base/texlive-tex4ht/test_texlive-tex4ht_httexi_upper_x.sh deleted file mode 100644 index 1e6443c41bf..00000000000 --- a/testcases/function_test/pkg_test/texlive-base/texlive-tex4ht/test_texlive-tex4ht_httexi_upper_x.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-02 -# @License : Mulan PSL v2 -# @Desc : 测试httexi命令的XeTeX模式,使用xelatex命令处理 -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - # 检查是否已安装 texlive-tex4ht 包 - LOG_INFO "检查是否已安装 texlive-tex4ht 包" - rpm -q texlive-tex4ht > /dev/null 2>&1 - if [ $? -eq 0 ]; then - LOG_INFO "texlive-tex4ht 已安装,脚本结束后将保持安装状态" - INSTALLED=1 - else - LOG_INFO "texlive-tex4ht 未安装,将在测试过程中安装,并在测试结束后卸载" - INSTALLED=0 - fi - - # 检查 yum 源中是否有 texlive-tex4ht 包 - LOG_INFO "检查 yum 源中是否有 texlive-tex4ht 包" - dnf list available texlive-tex4ht > /dev/null 2>&1 - CHECK_RESULT $? 0 0 "yum 源中未找到 texlive-tex4ht 包" - if [ $? -ne 0 ]; then - LOG_ERROR "yum 源中未找到 texlive-tex4ht 包,退出测试" - exit 255 - fi - - # 如果未安装,则安装 texlive-tex4ht - if [ $INSTALLED -eq 0 ]; then - LOG_INFO "安装 texlive-tex4ht 包" - dnf install -y texlive-tex4ht - CHECK_RESULT $? 0 0 "安装 texlive-tex4ht 包失败" - fi - - # 检查 httexi 命令是否支持 -x 参数 - LOG_INFO "检查 httexi 命令是否支持 -x 参数" - httexi --help 2>&1 | grep -q "\-x" - CHECK_RESULT $? 0 0 "httexi 命令不支持 -x 参数" - if [ $? -ne 0 ]; then - LOG_ERROR "httexi 命令不支持 -x 参数,退出测试" - 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 文件失败" - - # 使用 httexi 命令的 XeTeX 模式处理 TeX 文件 - LOG_INFO "使用 httexi 命令的 XeTeX 模式处理 TeX 文件" - httexi -x test.tex - CHECK_RESULT $? 0 0 "httexi 命令执行失败" - - # 检查是否生成了预期的输出文件 - LOG_INFO "检查是否生成了预期的输出文件" - ls test.html > /dev/null 2>&1 - CHECK_RESULT $? 0 0 "未生成预期的输出文件 test.html" - - # 清理测试过程中生成的文件 - LOG_INFO "清理测试过程中生成的文件" - rm -f test.tex test.html test.css test*.png test*.svg test*.idv test*.lg test*.log test*.tmp test*.xref test*.4ct test*.4tc test*.dvi test*.aux test*.out - CHECK_RESULT $? 0 0 "清理测试文件失败" - - # 如果测试开始时未安装 texlive-tex4ht,则在测试结束后卸载 - if [ $INSTALLED -eq 0 ]; then - LOG_INFO "卸载 texlive-tex4ht 包" - dnf remove -y texlive-tex4ht - CHECK_RESULT $? 0 0 "卸载 texlive-tex4ht 包失败" - else - LOG_INFO "测试开始时已安装 texlive-tex4ht,保持安装状态" - fi - - LOG_INFO "测试脚本执行完成" -} - -main "$@" \ No newline at end of file diff --git a/testcases/function_test/pkg_test/texlive-base/texlive-tex4ht/test_texlive-tex4ht_htxelatex__v.sh b/testcases/function_test/pkg_test/texlive-base/texlive-tex4ht/test_texlive-tex4ht_htxelatex__v.sh deleted file mode 100644 index 2bce03896cc..00000000000 --- a/testcases/function_test/pkg_test/texlive-base/texlive-tex4ht/test_texlive-tex4ht_htxelatex__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 : 2025-11-27 -# @License : Mulan PSL v2 -# @Desc : 测试 htxelatex 命令的 -v 参数,验证是否显示版本信息 -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - LOG_INFO "开始测试 htxelatex 命令的 -v 参数,验证是否显示版本信息" - - # 检查环境是否已安装 texlive-tex4ht 软件包 - LOG_INFO "检查 texlive-tex4ht 是否已安装" - if dnf list installed texlive-tex4ht &> /dev/null; then - LOG_INFO "texlive-tex4ht 已安装,测试结束后保持安装状态" - INSTALLED=true - else - LOG_INFO "texlive-tex4ht 未安装,将在测试结束后卸载" - INSTALLED=false - fi - - # 检查 yum 源中是否有 texlive-tex4ht 软件包 - LOG_INFO "检查 yum 源中是否有 texlive-tex4ht" - if ! dnf list available texlive-tex4ht &> /dev/null; then - LOG_ERROR "yum 源中未找到 texlive-tex4ht 软件包" - exit 255 - fi - - # 如果未安装,则安装软件包 - if [ "$INSTALLED" = false ]; then - LOG_INFO "正在安装 texlive-tex4ht" - dnf install -y texlive-tex4ht &> /dev/null - CHECK_RESULT $? 0 0 "安装 texlive-tex4ht 失败" - fi - - # 测试 htxelatex 命令的 -v 参数 - LOG_INFO "执行 htxelatex -v 命令" - output=$(htxelatex -v) - CHECK_RESULT $? 0 0 "执行 htxelatex -v 命令失败" - - # 验证输出是否包含版本信息 - LOG_INFO "验证输出是否包含版本信息" - if [[ "$output" == *"version"* ]]; then - LOG_INFO "htxelatex -v 输出包含版本信息" - else - LOG_ERROR "htxelatex -v 输出不包含版本信息" - exit $? - fi - - #清理环境 - if [ "$INSTALLED" = false ]; then - LOG_INFO "正在卸载 texlive-tex4ht" - dnf remove -y texlive-tex4ht &> /dev/null - CHECK_RESULT $? 0 0 "卸载 texlive-tex4h失败 " - fi - - LOG_INFO “测试完成” -} - -main "$@" \ No newline at end of file diff --git a/testcases/function_test/pkg_test/texlive-base/texlive-tex4ht/test_texlive-tex4ht_htxelatex_no_args.sh b/testcases/function_test/pkg_test/texlive-base/texlive-tex4ht/test_texlive-tex4ht_htxelatex_no_args.sh deleted file mode 100644 index 0763b7b0b42..00000000000 --- a/testcases/function_test/pkg_test/texlive-base/texlive-tex4ht/test_texlive-tex4ht_htxelatex_no_args.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-02 -# @License : Mulan PSL v2 -# @Desc : 测试不带任何参数执行htxelatex命令 -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - LOG_INFO "开始测试:测试不带任何参数执行htxelatex命令" - - # 检查yum源中是否存在texlive-tex4ht包 - LOG_INFO "检查yum源中是否存在texlive-tex4ht包" - dnf list available texlive-tex4ht 2>/dev/null | grep -q texlive-tex4ht - if [ $? -ne 0 ]; then - LOG_ERROR "yum源中不存在texlive-tex4ht包" - exit 255 - fi - - # 检查是否已安装texlive-tex4ht - LOG_INFO "检查是否已安装texlive-tex4ht" - rpm -q texlive-tex4ht >/dev/null 2>&1 - INSTALLED=$? - - if [ $INSTALLED -eq 0 ]; then - LOG_INFO "texlive-tex4ht已安装,测试后保持安装状态" - INSTALLED_FLAG=1 - else - LOG_INFO "texlive-tex4ht未安装,将安装作为测试步骤" - INSTALLED_FLAG=0 - LOG_INFO "安装texlive-tex4ht" - dnf install -y texlive-tex4ht - CHECK_RESULT $? 0 0 "安装texlive-tex4ht失败" - fi - - # 检查htxelatex命令是否存在 - LOG_INFO "检查htxelatex命令是否存在" - which htxelatex >/dev/null 2>&1 - if [ $? -ne 0 ]; then - LOG_ERROR "htxelatex命令不存在" - # 如果之前未安装,则卸载安装的包 - if [ $INSTALLED_FLAG -eq 0 ]; then - dnf remove -y texlive-tex4ht - fi - exit 255 - fi - - # 测试不带任何参数执行htxelatex命令 - LOG_INFO "测试不带任何参数执行htxelatex命令" - htxelatex - EXIT_CODE=$? - - # 检查htxelatex命令执行结果 - # htxelatex不带参数执行会提示需要输入文件,退出码通常为1 - # 根据实际行为调整预期结果 - if [ $EXIT_CODE -eq 1 ]; then - LOG_INFO "htxelatex命令不带参数执行,提示需要输入文件,符合预期" - CHECK_RESULT 0 0 0 "htxelatex命令执行不符合预期" - else - LOG_ERROR "htxelatex命令不带参数执行,退出码为$EXIT_CODE,不符合预期" - CHECK_RESULT 1 0 0 "htxelatex命令执行不符合预期" - fi - - # 环境清理 - LOG_INFO "开始环境清理" - if [ $INSTALLED_FLAG -eq 0 ]; then - LOG_INFO "卸载测试安装的texlive-tex4ht包" - dnf remove -y texlive-tex4ht - CHECK_RESULT $? 0 0 "卸载texlive-tex4ht失败" - else - LOG_INFO "保持原有的texlive-tex4ht安装状态" - fi - - LOG_INFO "测试完成" -} - -main "$@" \ No newline at end of file diff --git a/testcases/function_test/pkg_test/texlive-base/texlive-tex4ht/test_texlive-tex4ht_htxelatex_upper_a.sh b/testcases/function_test/pkg_test/texlive-base/texlive-tex4ht/test_texlive-tex4ht_htxelatex_upper_a.sh deleted file mode 100644 index b1ca8e8c571..00000000000 --- a/testcases/function_test/pkg_test/texlive-base/texlive-tex4ht/test_texlive-tex4ht_htxelatex_upper_a.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-02 -# @License : Mulan PSL v2 -# @Desc : 测试htxelatex命令的-A参数,用于指定额外的参数传递给tex4ht -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - # 检查htxelatex命令的-A参数功能测试 - - LOG_INFO "开始测试htxelatex命令的-A参数功能" - - # 检查是否已经安装了texlive-tex4ht包 - LOG_INFO "步骤1:检查texlive-tex4ht是否已安装" - if dnf list installed texlive-tex4ht &>/dev/null; then - LOG_INFO "texlive-tex4ht已安装,测试结束后将保持安装状态" - already_installed=true - else - LOG_INFO "texlive-tex4ht未安装,将进行安装测试" - already_installed=false - fi - - # 检查yum源中是否有texlive-tex4ht包 - LOG_INFO "步骤2:检查yum源中是否有texlive-tex4ht包" - if ! dnf list available texlive-tex4ht &>/dev/null; then - LOG_ERROR "yum源中未找到texlive-tex4ht包" - exit 255 - fi - - # 如果未安装,则安装软件包 - if [ "$already_installed" = false ]; then - LOG_INFO "步骤3:安装texlive-tex4ht包" - dnf install -y texlive-tex4ht - CHECK_RESULT $? 0 0 "安装texlive-tex4ht失败" - fi - - # 检查htxelatex命令是否存在 - LOG_INFO "步骤4:检查htxelatex命令是否存在" - if ! command -v htxelatex &>/dev/null; then - LOG_ERROR "htxelatex命令不存在" - if [ "$already_installed" = false ]; then - dnf remove -y texlive-tex4ht - fi - exit 255 - fi - - # 创建测试用的简单tex文件 - LOG_INFO "步骤5:创建测试用的tex文件" - cat > test_document.tex << "EOF" - \documentclass{article} - \begin{document} - This is a test document for htxelatex -A parameter. - \end{document} - EOF - CHECK_RESULT $? 0 0 "创建测试tex文件失败" - - # 测试htxelatex命令的-A参数是否存在 - LOG_INFO "步骤6:测试htxelatex命令是否支持-A参数" - htxelatex --help 2>&1 | grep -q -- "-A" - CHECK_RESULT $? 0 0 "htxelatex命令不支持-A参数" - - # 使用-A参数执行htxelatex命令 - LOG_INFO "步骤7:使用-A参数执行htxelatex命令" - htxelatex -A "html,2" test_document.tex - CHECK_RESULT $? 0 0 "htxelatex命令执行失败" - - # 检查是否生成了输出文件 - LOG_INFO "步骤8:检查是否生成了html输出文件" - if [ -f "test_document.html" ]; then - LOG_INFO "成功生成了html输出文件" - CHECK_RESULT 0 0 0 "检查输出文件" - else - LOG_ERROR "未生成html输出文件" - CHECK_RESULT 1 0 0 "检查输出文件失败" - fi - - # 清理测试文件 - LOG_INFO "步骤9:清理测试文件" - rm -f test_document.tex test_document.html test_document*.4* test_document*.lg test_document*.idv test_document*.dvi test_document*.aux test_document*.log test_document*.out - - # 如果测试前未安装,则卸载软件包 - if [ "$already_installed" = false ]; then - LOG_INFO "步骤10:卸载测试安装的texlive-tex4ht包" - dnf remove -y texlive-tex4ht - CHECK_RESULT $? 0 0 "卸载texlive-tex4ht失败" - fi - - LOG_INFO "测试完成:htxelatex命令的-A参数功能测试通过" -} - -main "$@" \ No newline at end of file diff --git a/testcases/function_test/pkg_test/texlive-base/texlive-tex4ht/test_texlive-tex4ht_htxelatex_upper_c.sh b/testcases/function_test/pkg_test/texlive-base/texlive-tex4ht/test_texlive-tex4ht_htxelatex_upper_c.sh deleted file mode 100644 index 9ea9dfdd7df..00000000000 --- a/testcases/function_test/pkg_test/texlive-base/texlive-tex4ht/test_texlive-tex4ht_htxelatex_upper_c.sh +++ /dev/null @@ -1,104 +0,0 @@ -#!/usr/bin/bash - -# Copyright (c) 2024 ISCAS .ALL rights reserved. -# This program is licensed under Mulan PSL v2. -# You can use it according to the terms and conditions of the Mulan PSL v2. -# http://license.coscl.org.cn/MulanPSL2 -# THIS PROGRAM IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, -# EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, -# MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. -# See the Mulan PSL v2 for more details. - -# ############################################# -# @Author : honghua -# @Contact : honghua@iscas.ac.cn -# @Date : 2026-03-02 -# @License : Mulan PSL v2 -# @Desc : 测试htxelatex命令的-C参数,用于指定配置文件 -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - # 判断是否已安装texlive-tex4ht软件包 - LOG_INFO "检查是否已安装texlive-tex4ht软件包" - rpm -q texlive-tex4ht > /dev/null 2>&1 - if [ $? -eq 0 ]; then - LOG_INFO "texlive-tex4ht软件包已安装,测试结束后将保持安装状态" - INSTALLED_FLAG=1 - else - LOG_INFO "texlive-tex4ht软件包未安装,测试结束后将卸载" - INSTALLED_FLAG=0 - fi - - # 检查yum源中是否有texlive-tex4ht软件包 - LOG_INFO "检查yum源中是否有texlive-tex4ht软件包" - dnf list available texlive-tex4ht > /dev/null 2>&1 - CHECK_RESULT $? 0 255 "yum源中没有texlive-tex4ht软件包" - - # 如果未安装则安装软件包 - if [ $INSTALLED_FLAG -eq 0 ]; then - LOG_INFO "安装texlive-tex4ht软件包" - dnf install -y texlive-tex4ht - CHECK_RESULT $? 0 0 "安装texlive-tex4ht软件包失败" - fi - - # 测试htxelatex命令的-C参数,用于指定配置文件 - LOG_INFO "测试htxelatex命令的-C参数,用于指定配置文件" - # 首先检查htxelatex命令是否存在 - which htxelatex > /dev/null 2>&1 - CHECK_RESULT $? 0 0 "htxelatex命令不存在" - - # 检查-C参数是否支持 - LOG_INFO "检查htxelatex命令是否支持-C参数" - htxelatex --help 2>&1 | grep -q "\-C" - CHECK_RESULT $? 0 255 "htxelatex命令不支持-C参数" - - # 创建一个简单的测试配置文件 - LOG_INFO "创建测试配置文件" - cat > test_config.cfg << EOF - % 测试配置文件 - \Preamble{xhtml} - \CutAt{section} - \begin{document} - EOF - CHECK_RESULT $? 0 0 "创建测试配置文件失败" - - # 创建一个简单的测试tex文件 - LOG_INFO "创建测试tex文件" - cat > test_document.tex << EOF - \documentclass{article} - \begin{document} - Test document for htxelatex -C option. - \end{document} - EOF - CHECK_RESULT $? 0 0 "创建测试tex文件失败" - - # 使用-C参数执行htxelatex命令 - LOG_INFO "使用-C参数执行htxelatex命令" - htxelatex -C test_config.cfg test_document.tex - CHECK_RESULT $? 0 0 "使用-C参数执行htxelatex命令失败" - - # 检查是否生成了输出文件 - LOG_INFO "检查是否生成了输出文件" - [ -f test_document.html ] || [ -f test_document*.html ] - CHECK_RESULT $? 0 0 "未生成预期的输出文件" - - # 清理测试文件 - LOG_INFO "清理测试文件" - rm -f test_config.cfg test_document.tex test_document*.html test_document*.log test_document*.aux test_document*.out - CHECK_RESULT $? 0 0 "清理测试文件失败" - - # 如果测试前未安装,则卸载软件包 - if [ $INSTALLED_FLAG -eq 0 ]; then - LOG_INFO "卸载texlive-tex4ht软件包" - dnf remove -y texlive-tex4ht - CHECK_RESULT $? 0 0 "卸载texlive-tex4ht软件包失败" - else - LOG_INFO "测试前已安装texlive-tex4ht,保持安装状态" - fi - - LOG_INFO "测试完成" -} - -main "$@" \ No newline at end of file diff --git a/testcases/function_test/pkg_test/texlive-base/texlive-tex4ht/test_texlive-tex4ht_htxelatex_upper_d.sh b/testcases/function_test/pkg_test/texlive-base/texlive-tex4ht/test_texlive-tex4ht_htxelatex_upper_d.sh deleted file mode 100644 index 8cb78a62b4f..00000000000 --- a/testcases/function_test/pkg_test/texlive-base/texlive-tex4ht/test_texlive-tex4ht_htxelatex_upper_d.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-02 -# @License : Mulan PSL v2 -# @Desc : 测试htxelatex命令的-D参数,用于指定输出目录 -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - # 检查是否已安装texlive-tex4ht包 - LOG_INFO "检查是否已安装texlive-tex4ht包" - rpm -q texlive-tex4ht > /dev/null 2>&1 - if [ $? -eq 0 ]; then - LOG_INFO "texlive-tex4ht已安装,脚本结束时将保持安装状态" - already_installed=1 - else - LOG_INFO "texlive-tex4ht未安装,将在测试过程中安装" - already_installed=0 - fi - - # 检查yum源中是否有texlive-tex4ht包 - LOG_INFO "检查yum源中是否有texlive-tex4ht包" - dnf list available texlive-tex4ht > /dev/null 2>&1 - CHECK_RESULT $? 0 0 "yum源中未找到texlive-tex4ht包" - if [ $? -ne 0 ]; then - LOG_ERROR "yum源中未找到texlive-tex4ht包" - exit 255 - fi - - # 如果未安装,则安装texlive-tex4ht包 - if [ $already_installed -eq 0 ]; then - LOG_INFO "安装texlive-tex4ht包" - dnf install -y texlive-tex4ht - CHECK_RESULT $? 0 0 "安装texlive-tex4ht包失败" - fi - - # 检查htxelatex命令是否存在 - LOG_INFO "检查htxelatex命令是否存在" - which htxelatex > /dev/null 2>&1 - CHECK_RESULT $? 0 0 "htxelatex命令不存在" - if [ $? -ne 0 ]; then - LOG_ERROR "htxelatex命令不存在" - exit 255 - fi - - # 检查htxelatex命令是否支持-D参数 - LOG_INFO "检查htxelatex命令是否支持-D参数" - htxelatex --help 2>&1 | grep -q "\-D" - CHECK_RESULT $? 0 0 "htxelatex命令不支持-D参数" - if [ $? -ne 0 ]; then - LOG_ERROR "htxelatex命令不支持-D参数" - exit 255 - fi - - # 创建测试用的简单LaTeX文件 - LOG_INFO "创建测试用的简单LaTeX文件" - cat > test.tex << "EOF" - \documentclass{article} - \begin{document} - Hello, World! - \end{document} - EOF - CHECK_RESULT $? 0 0 "创建测试文件失败" - - # 创建输出目录 - LOG_INFO "创建输出目录" - mkdir -p output_test_dir - CHECK_RESULT $? 0 0 "创建输出目录失败" - - # 使用htxelatex命令的-D参数指定输出目录 - LOG_INFO "使用htxelatex命令的-D参数指定输出目录" - htxelatex -D output_test_dir test.tex - CHECK_RESULT $? 0 0 "htxelatex命令执行失败" - - # 检查输出目录中是否生成了文件 - LOG_INFO "检查输出目录中是否生成了文件" - ls output_test_dir/*.html > /dev/null 2>&1 - CHECK_RESULT $? 0 0 "输出目录中未生成HTML文件" - - # 清理测试文件 - LOG_INFO "清理测试文件" - rm -f test.tex - rm -rf output_test_dir - CHECK_RESULT $? 0 0 "清理测试文件失败" - - # 如果脚本开始时未安装,则在测试结束后卸载软件包 - if [ $already_installed -eq 0 ]; then - LOG_INFO "卸载texlive-tex4ht包" - dnf remove -y texlive-tex4ht - CHECK_RESULT $? 0 0 "卸载texlive-tex4ht包失败" - else - LOG_INFO "保持texlive-tex4ht包的安装状态" - fi - - LOG_INFO "测试完成" -} - -main "$@" \ No newline at end of file diff --git a/testcases/function_test/pkg_test/texlive-base/texlive-tex4ht/test_texlive-tex4ht_htxelatex_upper_e.sh b/testcases/function_test/pkg_test/texlive-base/texlive-tex4ht/test_texlive-tex4ht_htxelatex_upper_e.sh deleted file mode 100644 index 4c2644961b0..00000000000 --- a/testcases/function_test/pkg_test/texlive-base/texlive-tex4ht/test_texlive-tex4ht_htxelatex_upper_e.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-02 -# @License : Mulan PSL v2 -# @Desc : 测试htxelatex命令的-E参数,用于指定使用指定的引擎 -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - # 检查是否已安装texlive-tex4ht - LOG_INFO "检查是否已安装texlive-tex4ht" - if dnf list installed texlive-tex4ht > /dev/null 2>&1; then - LOG_INFO "texlive-tex4ht已安装" - ALREADY_INSTALLED=1 - else - LOG_INFO "texlive-tex4ht未安装" - ALREADY_INSTALLED=0 - fi - - # 检查yum源中是否有texlive-tex4ht软件包 - LOG_INFO "检查yum源中是否有texlive-tex4ht软件包" - if ! dnf list available texlive-tex4ht > /dev/null 2>&1; then - LOG_ERROR "yum源中未找到texlive-tex4ht软件包" - exit 255 - fi - - # 如果未安装,则安装软件包 - if [ $ALREADY_INSTALLED -eq 0 ]; then - LOG_INFO "安装texlive-tex4ht软件包" - dnf install -y texlive-tex4ht - CHECK_RESULT $? 0 0 "安装texlive-tex4ht失败" - fi - - # 检查htxelatex命令是否存在 - LOG_INFO "检查htxelatex命令是否存在" - command -v htxelatex > /dev/null 2>&1 - CHECK_RESULT $? 0 0 "htxelatex命令不存在" - - # 测试htxelatex命令的-E参数是否存在 - LOG_INFO "测试htxelatex命令的-E参数是否存在" - htxelatex --help 2>&1 | grep -q "\-E" - CHECK_RESULT $? 0 0 "htxelatex命令不支持-E参数" - - # 创建测试用的简单LaTeX文件 - LOG_INFO "创建测试用的简单LaTeX文件" - cat > test.tex << "EOF" - \documentclass{article} - \begin{document} - Hello, World! - \end{document} - EOF - CHECK_RESULT $? 0 0 "创建测试文件失败" - - # 使用htxelatex命令的-E参数指定引擎进行测试 - LOG_INFO "使用htxelatex命令的-E参数指定引擎进行测试" - htxelatex -E xetex test.tex > /dev/null 2>&1 - CHECK_RESULT $? 0 0 "htxelatex命令使用-E参数执行失败" - - # 检查是否生成了对应的HTML文件 - LOG_INFO "检查是否生成了对应的HTML文件" - [ -f test.html ] - CHECK_RESULT $? 0 0 "未生成预期的HTML文件" - - # 清理测试生成的文件 - LOG_INFO "清理测试生成的文件" - rm -f test.tex test.html test.log test.aux test.out - CHECK_RESULT $? 0 0 "清理测试文件失败" - - # 如果之前未安装,则卸载软件包 - if [ $ALREADY_INSTALLED -eq 0 ]; then - LOG_INFO "卸载texlive-tex4ht软件包" - dnf remove -y texlive-tex4ht - CHECK_RESULT $? 0 0 "卸载texlive-tex4ht失败" - fi - - LOG_INFO "测试完成" -} - -main "$@" \ No newline at end of file diff --git a/testcases/function_test/pkg_test/texlive-base/texlive-tex4ht/test_texlive-tex4ht_htxelatex_upper_h.sh b/testcases/function_test/pkg_test/texlive-base/texlive-tex4ht/test_texlive-tex4ht_htxelatex_upper_h.sh deleted file mode 100644 index 79804473b14..00000000000 --- a/testcases/function_test/pkg_test/texlive-base/texlive-tex4ht/test_texlive-tex4ht_htxelatex_upper_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-02 -# @License : Mulan PSL v2 -# @Desc : 测试htxelatex命令的-H参数,用于显示帮助信息 -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - # 定义变量 - PACKAGE_NAME="texlive-tex4ht" - COMMAND_NAME="htxelatex" - PARAMETER="-H" - - # 步骤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 - LOG_INFO "软件包 ${PACKAGE_NAME} 已安装,标记为保持安装状态" - KEEP_INSTALLED=true - else - LOG_INFO "软件包 ${PACKAGE_NAME} 未安装,标记为需要清理安装" - KEEP_INSTALLED=false - fi - - # 步骤3:如果未安装,则安装软件包 - if [ "${KEEP_INSTALLED}" = "false" ]; then - LOG_INFO "3. 安装软件包 ${PACKAGE_NAME}" - dnf install -y ${PACKAGE_NAME} - CHECK_RESULT $? 0 0 "安装软件包 ${PACKAGE_NAME} 失败" - fi - - # 步骤4:检查命令是否存在 - LOG_INFO "4. 检查命令 ${COMMAND_NAME} 是否存在" - which ${COMMAND_NAME} &>/dev/null - CHECK_RESULT $? 0 0 "命令 ${COMMAND_NAME} 不存在" - - # 步骤5:检查参数是否存在或不支持 - LOG_INFO "5. 检查参数 ${PARAMETER} 是否支持" - ${COMMAND_NAME} ${PARAMETER} 2>&1 | grep -q "unrecognized option\|invalid option" - if [ $? -eq 0 ]; then - LOG_ERROR "参数 ${PARAMETER} 不存在或不支持" - exit 255 - fi - - # 步骤6:执行命令测试 - LOG_INFO "6. 执行命令 ${COMMAND_NAME} ${PARAMETER} 测试帮助信息" - ${COMMAND_NAME} ${PARAMETER} 2>&1 | grep -q "Usage\|help" - CHECK_RESULT $? 0 0 "命令 ${COMMAND_NAME} ${PARAMETER} 执行失败,未显示帮助信息" - - # 步骤7:清理环境 - LOG_INFO "7. 清理环境" - 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/texlive-base/texlive-tex4ht/test_texlive-tex4ht_htxelatex_upper_i.sh b/testcases/function_test/pkg_test/texlive-base/texlive-tex4ht/test_texlive-tex4ht_htxelatex_upper_i.sh deleted file mode 100644 index 05c44243b06..00000000000 --- a/testcases/function_test/pkg_test/texlive-base/texlive-tex4ht/test_texlive-tex4ht_htxelatex_upper_i.sh +++ /dev/null @@ -1,144 +0,0 @@ -#!/usr/bin/bash - -# Copyright (c) 2024 ISCAS .ALL rights reserved. -# This program is licensed under Mulan PSL v2. -# You can use it according to the terms and conditions of the Mulan PSL v2. -# http://license.coscl.org.cn/MulanPSL2 -# THIS PROGRAM IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, -# EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, -# MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. -# See the Mulan PSL v2 for more details. - -# ############################################# -# @Author : honghua -# @Contact : honghua@iscas.ac.cn -# @Date : 2026-03-02 -# @License : Mulan PSL v2 -# @Desc : 测试htxelatex命令的-I参数,用于指定输入文件 -# ############################################ - -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] $*"; } - - # 检查软件包是否在yum源中 - check_package_in_repo() { - local pkg=$1 - LOG_INFO "检查yum源中是否存在软件包: $pkg" - dnf list available "$pkg" >/dev/null 2>&1 - if [ $? -ne 0 ]; then - LOG_ERROR "软件包 $pkg 不在yum源中" - exit 255 - fi - } - - # 检查命令参数是否存在 - 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 - } - - # 检查是否已安装 - check_installed() { - LOG_INFO "检查是否已安装texlive-tex4ht" - rpm -q texlive-tex4ht >/dev/null 2>&1 - return $? - } - - # 安装软件包 - install_package() { - local pkg=$1 - LOG_INFO "安装软件包: $pkg" - dnf install -y "$pkg" - CHECK_RESULT $? 0 0 "安装 $pkg 失败" - } - - # 卸载软件包 - uninstall_package() { - local pkg=$1 - LOG_INFO "卸载软件包: $pkg" - dnf remove -y "$pkg" - CHECK_RESULT $? 0 0 "卸载 $pkg 失败" - } - - # 主测试函数 - test_htxelatex_upper_i() { - LOG_INFO "开始测试htxelatex命令的-I参数" - - # 检查软件包是否在yum源中 - check_package_in_repo texlive-tex4ht - - # 检查是否已安装 - local was_installed=0 - check_installed - if [ $? -eq 0 ]; then - LOG_INFO "texlive-tex4ht 已安装" - was_installed=1 - else - LOG_INFO "texlive-tex4ht 未安装,将进行安装" - install_package texlive-tex4ht - fi - - # 检查htxelatex命令是否存在 - LOG_INFO "检查htxelatex命令是否存在" - which htxelatex >/dev/null 2>&1 - CHECK_RESULT $? 0 0 "htxelatex命令不存在" - - # 检查-I参数是否支持 - check_command_param htxelatex "-I" - - # 创建测试文件 - LOG_INFO "创建测试LaTeX文件" - cat > test_input.tex << "EOF" - \documentclass{article} - \begin{document} - Test document for htxelatex -I parameter. - \end{document} - EOF - - # 创建包含目录 - LOG_INFO "创建包含目录和文件" - mkdir -p include_dir - cat > include_dir/test_include.tex << "EOF" - \newcommand{\includetext}{This is included text.} - EOF - - # 测试htxelatex命令的-I参数 - LOG_INFO "执行htxelatex命令测试-I参数" - htxelatex -I ./include_dir test_input.tex - CHECK_RESULT $? 0 0 "htxelatex -I 参数测试失败" - - # 检查输出文件 - LOG_INFO "检查输出文件是否生成" - [ -f test_input.html ] && LOG_INFO "输出文件test_input.html已生成" || LOG_ERROR "输出文件未生成" - - # 清理测试文件 - LOG_INFO "清理测试文件" - rm -f test_input.tex test_input.html test_input*.aux test_input*.log test_input*.out - rm -rf include_dir - - # 如果测试前未安装,则卸载软件包 - if [ $was_installed -eq 0 ]; then - LOG_INFO "测试前未安装,执行卸载" - uninstall_package texlive-tex4ht - else - LOG_INFO "测试前已安装,保持安装状态" - fi - - LOG_INFO "htxelatex命令-I参数测试完成" - } - - # 执行测试 - test_htxelatex_upper_i -} - -main "$@" \ No newline at end of file diff --git a/testcases/function_test/pkg_test/texlive-base/texlive-tex4ht/test_texlive-tex4ht_htxelatex_upper_j.sh b/testcases/function_test/pkg_test/texlive-base/texlive-tex4ht/test_texlive-tex4ht_htxelatex_upper_j.sh deleted file mode 100644 index 241ef2f76e0..00000000000 --- a/testcases/function_test/pkg_test/texlive-base/texlive-tex4ht/test_texlive-tex4ht_htxelatex_upper_j.sh +++ /dev/null @@ -1,118 +0,0 @@ -#!/usr/bin/bash - -# Copyright (c) 2024 ISCAS .ALL rights reserved. -# This program is licensed under Mulan PSL v2. -# You can use it according to the terms and conditions of the Mulan PSL v2. -# http://license.coscl.org.cn/MulanPSL2 -# THIS PROGRAM IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, -# EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, -# MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. -# See the Mulan PSL v2 for more details. - -# ############################################# -# @Author : honghua -# @Contact : honghua@iscas.ac.cn -# @Date : 2026-03-02 -# @License : Mulan PSL v2 -# @Desc : 测试htxelatex命令的-J参数,用于指定配置文件 -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - # 检查是否已安装texlive-tex4ht - LOG_INFO "检查是否已安装texlive-tex4ht" - rpm -q texlive-tex4ht > /dev/null 2>&1 - if [ $? -eq 0 ]; then - LOG_INFO "texlive-tex4ht已安装,标记为需要保持安装状态" - INSTALLED=1 - else - LOG_INFO "texlive-tex4ht未安装,标记为需要清理安装" - INSTALLED=0 - fi - - # 检查yum源中是否有texlive-tex4ht软件包 - LOG_INFO "检查yum源中是否有texlive-tex4ht软件包" - dnf list available texlive-tex4ht > /dev/null 2>&1 - CHECK_RESULT $? 0 0 "yum源中没有texlive-tex4ht软件包" - if [ $? -ne 0 ]; then - LOG_ERROR "yum源中没有texlive-tex4ht软件包" - exit 255 - fi - - # 如果未安装,则安装texlive-tex4ht - if [ $INSTALLED -eq 0 ]; then - LOG_INFO "开始安装texlive-tex4ht" - dnf install -y texlive-tex4ht - CHECK_RESULT $? 0 0 "安装texlive-tex4ht失败" - if [ $? -ne 0 ]; then - LOG_ERROR "安装texlive-tex4ht失败" - exit 1 - fi - fi - - # 检查htxelatex命令是否存在 - LOG_INFO "检查htxelatex命令是否存在" - which htxelatex > /dev/null 2>&1 - CHECK_RESULT $? 0 0 "htxelatex命令不存在" - if [ $? -ne 0 ]; then - LOG_ERROR "htxelatex命令不存在" - exit 1 - fi - - # 测试htxelatex命令的-J参数是否存在 - LOG_INFO "测试htxelatex命令的-J参数是否存在" - htxelatex --help 2>&1 | grep -q -- "-J" - CHECK_RESULT $? 0 0 "htxelatex命令不支持-J参数" - if [ $? -ne 0 ]; then - LOG_ERROR "htxelatex命令不支持-J参数" - 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文件失败" - - # 创建一个简单的配置文件 - LOG_INFO "创建测试配置文件" - cat > test.cfg << "EOF" - % 这是一个测试配置文件 - \Preamble{xhtml} - \CutAt{section} - \begin{document} - \EndPreamble - EOF - CHECK_RESULT $? 0 0 "创建测试配置文件失败" - - # 使用htxelatex命令的-J参数指定配置文件 - LOG_INFO "使用htxelatex命令的-J参数指定配置文件进行测试" - htxelatex -J test.cfg test.tex > /dev/null 2>&1 - CHECK_RESULT $? 0 0 "使用-J参数执行htxelatex命令失败" - - # 检查是否生成了HTML文件 - LOG_INFO "检查是否生成了HTML文件" - ls test.html > /dev/null 2>&1 - CHECK_RESULT $? 0 0 "未生成HTML文件" - - # 清理测试文件 - LOG_INFO "清理测试文件" - rm -f test.tex test.cfg test.html test*.css test*.png test*.4ct test*.4tc test*.idv test*.lg test*.log test*.tmp test*.xref test*.dvi > /dev/null 2>&1 - CHECK_RESULT $? 0 0 "清理测试文件失败" - - # 如果之前未安装,则卸载texlive-tex4ht - if [ $INSTALLED -eq 0 ]; then - LOG_INFO "卸载texlive-tex4ht" - dnf remove -y texlive-tex4ht - CHECK_RESULT $? 0 0 "卸载texlive-tex4ht失败" - fi - - LOG_INFO "测试完成" -} - -main "$@" \ No newline at end of file diff --git a/testcases/function_test/pkg_test/texlive-base/texlive-tex4ht/test_texlive-tex4ht_htxelatex_upper_l.sh b/testcases/function_test/pkg_test/texlive-base/texlive-tex4ht/test_texlive-tex4ht_htxelatex_upper_l.sh deleted file mode 100644 index 665991fd9de..00000000000 --- a/testcases/function_test/pkg_test/texlive-base/texlive-tex4ht/test_texlive-tex4ht_htxelatex_upper_l.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-02 -# @License : Mulan PSL v2 -# @Desc : 测试htxelatex命令的-L参数,用于显示许可证信息 -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - LOG_INFO "开始测试htxelatex命令的-L参数,用于显示许可证信息" - - # 定义软件包名称 - PACKAGE_NAME="texlive-tex4ht" - - # 检查环境是否已经安装指定软件包 - LOG_INFO "检查环境是否已经安装${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 - - # 检查yum源中是否有该软件包 - LOG_INFO "检查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 "安装${PACKAGE_NAME}软件包" - dnf install -y ${PACKAGE_NAME} - CHECK_RESULT $? 0 0 "安装${PACKAGE_NAME}软件包失败" - fi - - # 检查htxelatex命令是否存在 - LOG_INFO "检查htxelatex命令是否存在" - command -v htxelatex &>/dev/null - CHECK_RESULT $? 0 0 "htxelatex命令不存在" - - # 测试htxelatex命令的-L参数 - LOG_INFO "测试htxelatex命令的-L参数,显示许可证信息" - htxelatex -L - CHECK_RESULT $? 0 0 "htxelatex命令的-L参数执行失败" - - # 如果测试过程中安装了软件包,则在脚本结束前卸载 - if [ ${ALREADY_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 "测试完成,环境已恢复" -} - -main "$@" \ No newline at end of file diff --git a/testcases/function_test/pkg_test/texlive-base/texlive-tex4ht/test_texlive-tex4ht_htxelatex_upper_m.sh b/testcases/function_test/pkg_test/texlive-base/texlive-tex4ht/test_texlive-tex4ht_htxelatex_upper_m.sh deleted file mode 100644 index ba2e67a7943..00000000000 --- a/testcases/function_test/pkg_test/texlive-base/texlive-tex4ht/test_texlive-tex4ht_htxelatex_upper_m.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-02 -# @License : Mulan PSL v2 -# @Desc : 测试htxelatex命令的-M参数,用于指定make4ht的构建文件 -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - # 测试htxelatex命令的-M参数,用于指定make4ht的构建文件 - - LOG_INFO "步骤1:检查texlive-tex4ht软件包是否在yum源中" - dnf list available texlive-tex4ht 2>&1 | grep -q "texlive-tex4ht" - if [ $? -ne 0 ]; then - LOG_ERROR "texlive-tex4ht软件包不在yum源中" - exit 255 - fi - - LOG_INFO "步骤2:检查htxelatex命令是否已安装" - which htxelatex > /dev/null 2>&1 - if [ $? -eq 0 ]; then - LOG_INFO "htxelatex命令已安装,标记为已安装状态" - INSTALLED_FLAG=1 - else - LOG_INFO "htxelatex命令未安装,标记为未安装状态" - INSTALLED_FLAG=0 - fi - - if [ $INSTALLED_FLAG -eq 0 ]; then - LOG_INFO "步骤3:安装texlive-tex4ht软件包" - dnf install -y texlive-tex4ht - CHECK_RESULT $? 0 0 "安装texlive-tex4ht失败" - fi - - LOG_INFO "步骤4:创建测试用的LaTeX文件" - cat > test.tex << "EOF" - \documentclass{article} - \begin{document} - Hello, World! - \end{document} - EOF - CHECK_RESULT $? 0 0 "创建测试LaTeX文件失败" - - LOG_INFO "步骤5:创建测试用的make4ht构建文件" - cat > test.mk4 << "EOF" - Make:add("biber","biber ${input}") - Make:htlatex {} - EOF - CHECK_RESULT $? 0 0 "创建make4ht构建文件失败" - - LOG_INFO "步骤6:测试htxelatex命令的-M参数,指定make4ht构建文件" - htxelatex -M test.mk4 test.tex - CHECK_RESULT $? 0 0 "htxelatex命令执行失败" - - LOG_INFO "步骤7:检查生成的HTML文件是否存在" - ls test.html > /dev/null 2>&1 - CHECK_RESULT $? 0 0 "未生成HTML文件" - - LOG_INFO "步骤8:清理测试生成的文件" - rm -f test.tex test.mk4 test.html test*.css test*.png test*.svg test*.4ct test*.4tc test*.dvi test*.idv test*.lg test*.log test*.tmp test*.xref test*.aux test*.out - CHECK_RESULT $? 0 0 "清理测试文件失败" - - if [ $INSTALLED_FLAG -eq 0 ]; then - LOG_INFO "步骤9:卸载texlive-tex4ht软件包" - dnf remove -y texlive-tex4ht - CHECK_RESULT $? 0 0 "卸载texlive-tex4ht失败" - else - LOG_INFO "步骤9:保持texlive-tex4ht软件包安装状态" - fi - - LOG_INFO "测试完成" -} - -main "$@" \ No newline at end of file diff --git a/testcases/function_test/pkg_test/texlive-base/texlive-tex4ht/test_texlive-tex4ht_htxelatex_upper_o.sh b/testcases/function_test/pkg_test/texlive-base/texlive-tex4ht/test_texlive-tex4ht_htxelatex_upper_o.sh deleted file mode 100644 index 78e658d0384..00000000000 --- a/testcases/function_test/pkg_test/texlive-base/texlive-tex4ht/test_texlive-tex4ht_htxelatex_upper_o.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-02 -# @License : Mulan PSL v2 -# @Desc : 测试htxelatex命令的-O参数,用于指定输出目录 -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - # 检查环境是否已安装texlive-tex4ht软件包 - LOG_INFO "检查环境是否已安装texlive-tex4ht软件包" - rpm -q texlive-tex4ht - if [ $? -eq 0 ]; then - LOG_INFO "环境已安装texlive-tex4ht软件包" - installed=true - else - LOG_INFO "环境未安装texlive-tex4ht软件包" - installed=false - fi - - # 检查yum源中是否有texlive-tex4ht软件包 - LOG_INFO "检查yum源中是否有texlive-tex4ht软件包" - dnf list available texlive-tex4ht - if [ $? -ne 0 ]; then - LOG_ERROR "yum源中没有texlive-tex4ht软件包" - exit 255 - fi - - # 如果未安装,则安装软件包 - if [ "$installed" = false ]; then - LOG_INFO "安装texlive-tex4ht软件包" - dnf install -y texlive-tex4ht - CHECK_RESULT $? 0 0 "安装texlive-tex4ht软件包失败" - fi - - # 测试htxelatex命令的-O参数是否存在 - LOG_INFO "测试htxelatex命令的-O参数是否存在" - htxelatex --help | grep -q "\-O" - if [ $? -ne 0 ]; then - LOG_ERROR "htxelatex命令不支持-O参数" - 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测试文件失败" - - # 创建输出目录 - LOG_INFO "创建输出目录" - mkdir -p output_dir - CHECK_RESULT $? 0 0 "创建输出目录失败" - - # 使用htxelatex命令的-O参数指定输出目录 - LOG_INFO "使用htxelatex命令的-O参数指定输出目录" - htxelatex -O output_dir test.tex - CHECK_RESULT $? 0 0 "htxelatex命令执行失败" - - # 检查输出目录中是否生成了相关文件 - LOG_INFO "检查输出目录中是否生成了相关文件" - ls output_dir/test.html - CHECK_RESULT $? 0 0 "未在输出目录中找到生成的HTML文件" - - # 清理测试文件 - LOG_INFO "清理测试文件" - rm -f test.tex - rm -rf output_dir - CHECK_RESULT $? 0 0 "清理测试文件失败" - - # 如果测试前未安装,则卸载软件包 - if [ "$installed" = false ]; then - LOG_INFO "卸载texlive-tex4ht软件包" - dnf remove -y texlive-tex4ht - CHECK_RESULT $? 0 0 "卸载texlive-tex4ht软件包失败" - fi - - LOG_INFO "测试完成" -} - -main "$@" \ No newline at end of file diff --git a/testcases/function_test/pkg_test/texlive-base/texlive-tex4ht/test_texlive-tex4ht_htxelatex_upper_p.sh b/testcases/function_test/pkg_test/texlive-base/texlive-tex4ht/test_texlive-tex4ht_htxelatex_upper_p.sh deleted file mode 100644 index 40b98c54c7f..00000000000 --- a/testcases/function_test/pkg_test/texlive-base/texlive-tex4ht/test_texlive-tex4ht_htxelatex_upper_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-03-02 -# @License : Mulan PSL v2 -# @Desc : 测试htxelatex命令的-P参数,用于指定配置文件路径 -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - set -e - - LOG_INFO "开始测试 htxelatex 命令的 -P 参数" - - # 检查软件包是否在 yum 源中 - LOG_INFO "检查 texlive-tex4ht 软件包是否在 yum 源中" - if ! dnf list texlive-tex4ht &>/dev/null; then - LOG_ERROR "texlive-tex4ht 软件包不在 yum 源中" - exit 255 - fi - - # 检查是否已安装 - LOG_INFO "检查 texlive-tex4ht 是否已安装" - if rpm -q texlive-tex4ht &>/dev/null; then - LOG_INFO "texlive-tex4ht 已安装,脚本结束后将保持安装状态" - INSTALLED=true - else - LOG_INFO "texlive-tex4ht 未安装,将进行安装" - INSTALLED=false - fi - - # 如果未安装,则安装软件包 - if [ "$INSTALLED" = false ]; then - LOG_INFO "安装 texlive-tex4ht 软件包" - dnf install -y texlive-tex4ht - CHECK_RESULT $? 0 0 "安装 texlive-tex4ht 失败" - fi - - # 检查 htxelatex 命令是否存在 - LOG_INFO "检查 htxelatex 命令是否存在" - command -v htxelatex &>/dev/null - CHECK_RESULT $? 0 0 "htxelatex 命令不存在" - - # 测试 -P 参数是否存在 - LOG_INFO "测试 htxelatex 命令是否支持 -P 参数" - htxelatex --help 2>&1 | grep -q -- "-P" - CHECK_RESULT $? 0 0 "htxelatex 命令不支持 -P 参数" - - # 创建一个简单的测试文件 - LOG_INFO "创建一个简单的测试文件" - cat > test.tex << "EOF" - \documentclass{article} - \begin{document} - Hello, World! - \end{document} - EOF - CHECK_RESULT $? 0 0 "创建测试文件失败" - - # 测试 -P 参数指定配置文件路径 - LOG_INFO "测试使用 -P 参数指定配置文件路径" - htxelatex -P /tmp test.tex - CHECK_RESULT $? 0 0 "htxelatex 命令执行失败" - - # 清理测试文件 - LOG_INFO "清理测试文件" - rm -f test.tex test.4ct test.4tc test.css test.dvi test.html test.idv test.lg test.log test.tmp test.xref - CHECK_RESULT $? 0 0 "清理测试文件失败" - - # 如果脚本开始时未安装,则在结束时卸载软件包 - if [ "$INSTALLED" = false ]; then - LOG_INFO "卸载 texlive-tex4ht 软件包" - dnf remove -y texlive-tex4ht - CHECK_RESULT $? 0 0 "卸载 texlive-tex4ht 失败" - LOG_INFO "环境已恢复到未安装状态" - else - LOG_INFO "环境保持已安装状态" - fi - - LOG_INFO "测试完成" -} - -main "$@" \ No newline at end of file diff --git a/testcases/function_test/pkg_test/texlive-base/texlive-tex4ht/test_texlive-tex4ht_htxelatex_upper_q.sh b/testcases/function_test/pkg_test/texlive-base/texlive-tex4ht/test_texlive-tex4ht_htxelatex_upper_q.sh deleted file mode 100644 index 96f81f8b031..00000000000 --- a/testcases/function_test/pkg_test/texlive-base/texlive-tex4ht/test_texlive-tex4ht_htxelatex_upper_q.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-03-02 -# @License : Mulan PSL v2 -# @Desc : 测试htxelatex命令的-Q参数,用于静默模式 -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - # 测试htxelatex命令的-Q参数(静默模式) - - # 定义软件包名称 - PACKAGE_NAME="texlive-tex4ht" - - # 检查环境是否已安装目标软件包 - LOG_INFO "检查是否已安装${PACKAGE_NAME}软件包" - if rpm -q ${PACKAGE_NAME} >/dev/null 2>&1; 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 2>&1; then - LOG_ERROR "yum源中不存在${PACKAGE_NAME}软件包" - exit 255 - fi - - # 如果未安装,则安装软件包 - if [ "${INSTALLED_BEFORE}" = "false" ]; then - LOG_INFO "开始安装${PACKAGE_NAME}软件包" - dnf install -y ${PACKAGE_NAME} - CHECK_RESULT $? 0 0 "安装${PACKAGE_NAME}软件包失败" - LOG_INFO "${PACKAGE_NAME}软件包安装成功" - fi - - # 检查htxelatex命令是否存在 - LOG_INFO "检查htxelatex命令是否存在" - which htxelatex >/dev/null 2>&1 - CHECK_RESULT $? 0 0 "htxelatex命令不存在" - - # 检查htxelatex命令是否支持-Q参数 - LOG_INFO "检查htxelatex命令是否支持-Q参数" - htxelatex --help | grep -q "\-Q" - CHECK_RESULT $? 0 0 "htxelatex命令不支持-Q参数" - - # 创建一个简单的测试tex文件 - LOG_INFO "创建测试tex文件" - TEST_TEX_FILE="test_htxelatex.tex" - cat > ${TEST_TEX_FILE} << "EOF" - \documentclass{article} - \begin{document} - Hello, World! - \end{document} - EOF - CHECK_RESULT $? 0 0 "创建测试tex文件失败" - - # 测试htxelatex命令的-Q参数(静默模式) - LOG_INFO "测试htxelatex命令的-Q参数(静默模式)" - htxelatex -Q ${TEST_TEX_FILE} - CHECK_RESULT $? 0 0 "htxelatex命令-Q参数执行失败" - - # 检查是否生成了输出文件 - LOG_INFO "检查是否生成了输出文件" - if [ -f "test_htxelatex.html" ]; then - LOG_INFO "成功生成了HTML输出文件" - # 清理生成的测试文件 - rm -f test_htxelatex.{aux,log,out,html,dvi,4ct,4tc,idv,lg,tmp,xref,tex} - else - LOG_ERROR "未生成HTML输出文件" - exit 1 - fi - - # 清理测试tex文件 - LOG_INFO "清理测试tex文件" - rm -f ${TEST_TEX_FILE} - CHECK_RESULT $? 0 0 "清理测试tex文件失败" - - # 如果测试前未安装,则卸载软件包 - if [ "${INSTALLED_BEFORE}" = "false" ]; then - LOG_INFO "开始卸载${PACKAGE_NAME}软件包" - dnf remove -y ${PACKAGE_NAME} - CHECK_RESULT $? 0 0 "卸载${PACKAGE_NAME}软件包失败" - LOG_INFO "${PACKAGE_NAME}软件包卸载成功" - else - LOG_INFO "保持${PACKAGE_NAME}软件包安装状态" - fi - - LOG_INFO "测试htxelatex命令-Q参数(静默模式)完成" -} - -main "$@" \ No newline at end of file diff --git a/testcases/function_test/pkg_test/texlive-base/texlive-tex4ht/test_texlive-tex4ht_htxelatex_upper_s.sh b/testcases/function_test/pkg_test/texlive-base/texlive-tex4ht/test_texlive-tex4ht_htxelatex_upper_s.sh deleted file mode 100644 index 799e2bb6f51..00000000000 --- a/testcases/function_test/pkg_test/texlive-base/texlive-tex4ht/test_texlive-tex4ht_htxelatex_upper_s.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-02 -# @License : Mulan PSL v2 -# @Desc : 测试htxelatex命令的-S参数,用于显示系统信息 -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - # 检查是否已安装texlive-tex4ht - LOG_INFO "检查是否已安装texlive-tex4ht" - if dnf list installed texlive-tex4ht &>/dev/null; then - LOG_INFO "texlive-tex4ht已安装,标记为保持安装状态" - KEEP_INSTALLED=1 - else - LOG_INFO "texlive-tex4ht未安装,标记为测试安装" - KEEP_INSTALLED=0 - fi - - # 检查yum源中是否有texlive-tex4ht - LOG_INFO "检查yum源中是否有texlive-tex4ht" - if ! dnf list available texlive-tex4ht &>/dev/null; then - LOG_ERROR "yum源中没有texlive-tex4ht软件包" - exit 255 - fi - - # 如果未安装,则安装软件包 - if [ $KEEP_INSTALLED -eq 0 ]; then - LOG_INFO "安装texlive-tex4ht" - dnf install -y texlive-tex4ht - CHECK_RESULT $? 0 0 "安装texlive-tex4ht失败" - fi - - # 检查htxelatex命令是否存在 - LOG_INFO "检查htxelatex命令是否存在" - command -v htxelatex &>/dev/null - CHECK_RESULT $? 0 0 "htxelatex命令不存在" - - # 检查htxelatex命令是否支持-S参数 - LOG_INFO "检查htxelatex命令是否支持-S参数" - htxelatex --help 2>&1 | grep -q -- "-S" - if [ $? -ne 0 ]; then - LOG_ERROR "htxelatex命令不支持-S参数" - exit 255 - fi - - # 测试htxelatex命令的-S参数,用于显示系统信息 - LOG_INFO "执行htxelatex -S命令显示系统信息" - htxelatex -S - CHECK_RESULT $? 0 0 "htxelatex -S命令执行失败" - - LOG_INFO "测试htxelatex -S参数完成" - - # 环境清理 - if [ $KEEP_INSTALLED -eq 0 ]; then - LOG_INFO "卸载texlive-tex4ht软件包" - dnf remove -y texlive-tex4ht - CHECK_RESULT $? 0 0 "卸载texlive-tex4ht失败" - else - LOG_INFO "保持texlive-tex4ht安装状态" - fi - - LOG_INFO "测试脚本执行完成" -} - -main "$@" \ No newline at end of file diff --git a/testcases/function_test/pkg_test/texlive-base/texlive-tex4ht/test_texlive-tex4ht_htxelatex_upper_u.sh b/testcases/function_test/pkg_test/texlive-base/texlive-tex4ht/test_texlive-tex4ht_htxelatex_upper_u.sh deleted file mode 100644 index 9c2bb966dd5..00000000000 --- a/testcases/function_test/pkg_test/texlive-base/texlive-tex4ht/test_texlive-tex4ht_htxelatex_upper_u.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-02 -# @License : Mulan PSL v2 -# @Desc : 测试htxelatex命令的-U参数,用于更新make4ht的数据库 -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - LOG_INFO "开始测试htxelatex命令的-U参数,用于更新make4ht的数据库" - LOG_INFO "步骤1:检查环境是否已安装texlive-tex4ht软件包" - if dnf list installed texlive-tex4ht &> /dev/null; then - LOG_INFO "texlive-tex4ht已安装,测试结束后将保持安装状态" - INSTALLED=true - else - LOG_INFO "texlive-tex4ht未安装,将在测试过程中安装并在测试结束后卸载" - INSTALLED=false - fi - - LOG_INFO "步骤2:检查yum源中是否有texlive-tex4ht软件包" - if ! dnf list available texlive-tex4ht &> /dev/null; then - LOG_ERROR "yum源中未找到texlive-tex4ht软件包" - exit 255 - fi - - if [ "$INSTALLED" = false ]; then - LOG_INFO "步骤3:安装texlive-tex4ht软件包" - dnf install -y texlive-tex4ht - CHECK_RESULT $? 0 0 "安装texlive-tex4ht失败" - fi - - LOG_INFO "步骤4:检查htxelatex命令是否支持-U参数" - htxelatex --help | grep -q "\-U" - if [ $? -ne 0 ]; then - LOG_ERROR "htxelatex命令不支持-U参数" - if [ "$INSTALLED" = false ]; then - dnf remove -y texlive-tex4ht - fi - exit 255 - fi - - LOG_INFO "步骤5:执行htxelatex -U命令更新make4ht数据库" - htxelatex -U - CHECK_RESULT $? 0 0 "执行htxelatex -U命令失败" - - LOG_INFO "步骤6:验证数据库是否更新成功" - if [ -f "$HOME/.make4ht.db" ]; then - LOG_INFO "make4ht数据库文件存在,更新可能成功" - else - LOG_INFO "未找到默认的make4ht数据库文件,可能位于其他位置" - fi - - LOG_INFO "步骤7:清理测试环境" - if [ "$INSTALLED" = false ]; then - LOG_INFO "卸载texlive-tex4ht软件包" - dnf remove -y texlive-tex4ht - CHECK_RESULT $? 0 0 "卸载texlive-tex4ht失败" - else - LOG_INFO "保持texlive-tex4ht软件包安装状态" - fi - - LOG_INFO "测试完成" -} - -main "$@" \ No newline at end of file diff --git a/testcases/function_test/pkg_test/texlive-base/texlive-tex4ht/test_texlive-tex4ht_htxelatex_upper_v.sh b/testcases/function_test/pkg_test/texlive-base/texlive-tex4ht/test_texlive-tex4ht_htxelatex_upper_v.sh deleted file mode 100644 index 7df1881e6f2..00000000000 --- a/testcases/function_test/pkg_test/texlive-base/texlive-tex4ht/test_texlive-tex4ht_htxelatex_upper_v.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-02 -# @License : Mulan PSL v2 -# @Desc : 测试htxelatex命令的-V参数,用于显示版本信息 -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - # 检查是否已安装texlive-tex4ht - LOG_INFO "检查是否已安装texlive-tex4ht软件包" - rpm -q texlive-tex4ht - if [ $? -eq 0 ]; then - LOG_INFO "texlive-tex4ht已安装,脚本结束后将保持安装状态" - INSTALLED=1 - else - LOG_INFO "texlive-tex4ht未安装,将进行安装" - INSTALLED=0 - fi - - # 检查yum源中是否有texlive-tex4ht软件包 - LOG_INFO "检查yum源中是否有texlive-tex4ht软件包" - dnf list available texlive-tex4ht - CHECK_RESULT $? 0 0 "yum源中未找到texlive-tex4ht软件包" - if [ $? -ne 0 ]; then - LOG_ERROR "yum源中未找到texlive-tex4ht软件包" - exit 255 - fi - - # 如果未安装,则安装texlive-tex4ht - if [ $INSTALLED -eq 0 ]; then - LOG_INFO "安装texlive-tex4ht软件包" - dnf install -y texlive-tex4ht - CHECK_RESULT $? 0 0 "安装texlive-tex4ht失败" - fi - - # 检查htxelatex命令是否存在 - LOG_INFO "检查htxelatex命令是否存在" - which htxelatex - CHECK_RESULT $? 0 0 "htxelatex命令不存在" - - # 测试htxelatex命令的-V参数,用于显示版本信息 - LOG_INFO "测试htxelatex命令的-V参数,用于显示版本信息" - htxelatex -V - CHECK_RESULT $? 0 0 "htxelatex -V 命令执行失败" - - # 清理环境:如果之前未安装,则卸载软件包 - if [ $INSTALLED -eq 0 ]; then - LOG_INFO "卸载texlive-tex4ht软件包" - dnf remove -y texlive-tex4ht - CHECK_RESULT $? 0 0 "卸载texlive-tex4ht失败" - else - LOG_INFO "保持texlive-tex4ht软件包安装状态" - fi - - LOG_INFO "测试完成" -} - -main "$@" \ No newline at end of file diff --git a/testcases/function_test/pkg_test/texlive-base/texlive-tex4ht/test_texlive-tex4ht_htxelatex_upper_x.sh b/testcases/function_test/pkg_test/texlive-base/texlive-tex4ht/test_texlive-tex4ht_htxelatex_upper_x.sh deleted file mode 100644 index 63e58c4a86d..00000000000 --- a/testcases/function_test/pkg_test/texlive-base/texlive-tex4ht/test_texlive-tex4ht_htxelatex_upper_x.sh +++ /dev/null @@ -1,104 +0,0 @@ -#!/usr/bin/bash - -# Copyright (c) 2024 ISCAS .ALL rights reserved. -# This program is licensed under Mulan PSL v2. -# You can use it according to the terms and conditions of the Mulan PSL v2. -# http://license.coscl.org.cn/MulanPSL2 -# THIS PROGRAM IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, -# EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, -# MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. -# See the Mulan PSL v2 for more details. - -# ############################################# -# @Author : honghua -# @Contact : honghua@iscas.ac.cn -# @Date : 2026-03-02 -# @License : Mulan PSL v2 -# @Desc : 测试htxelatex命令的-X参数,用于指定执行额外的命令 -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - # 定义日志函数(如果环境中不存在) - LOG_INFO() { - echo "[INFO] $*" - } - LOG_ERROR() { - echo "[ERROR] $*" >&2 - } - - # 定义检查结果函数(如果环境中不存在) - CHECK_RESULT() { - local actual=$1 - local expect=$2 - local exit_code=$3 - local message=$4 - if [ "$actual" -ne "$expect" ]; then - LOG_ERROR "$message" - exit "$exit_code" - fi - } - - # 定义SSH_CMD函数(如果环境中不存在) - SSH_CMD() { - local cmd=$1 - local node_ip=$2 - local node_password=$3 - local node_user=${4:-root} - sshpass -p "$node_password" ssh -o StrictHostKeyChecking=no "$node_user@$node_ip" "$cmd" - } - - # 软件包名称 - PACKAGE_NAME="texlive-tex4ht" - COMMAND_NAME="htxelatex" - PARAMETER="-X" - - # 步骤1:检查软件包是否在yum源中 - LOG_INFO "步骤1:检查软件包是否在yum源中" - dnf list available "$PACKAGE_NAME" &>/dev/null - CHECK_RESULT $? 0 255 "软件包 $PACKAGE_NAME 不在yum源中" - - # 步骤2:检查命令是否已安装 - LOG_INFO "步骤2:检查命令是否已安装" - if command -v "$COMMAND_NAME" &>/dev/null; then - LOG_INFO "命令 $COMMAND_NAME 已安装,脚本结束后将保持安装状态" - INSTALLED=true - else - LOG_INFO "命令 $COMMAND_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 失败" - fi - - # 步骤4:检查命令是否支持 -X 参数 - LOG_INFO "步骤4:检查命令是否支持 -X 参数" - "$COMMAND_NAME" --help 2>&1 | grep -q -- "$PARAMETER" - CHECK_RESULT $? 0 255 "命令 $COMMAND_NAME 不支持参数 $PARAMETER" - - # 步骤5:测试 -X 参数执行额外的命令 - LOG_INFO "步骤5:测试 -X 参数执行额外的命令" - echo "\documentclass{article}\begin{document}test\end{document}" > test.tex - "$COMMAND_NAME" -X "echo "额外命令执行成功"" test.tex - CHECK_RESULT $? 0 1 "使用 -X 参数执行额外命令失败" - - # 步骤6:清理测试文件 - LOG_INFO "步骤6:清理测试文件" - rm -f test.tex test.html test.log test.dvi test.ps test.pdf 2>/dev/null - - # 步骤7:如果之前未安装,卸载软件包 - if [ "$INSTALLED" = false ]; then - LOG_INFO "步骤7:卸载软件包 $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-base/texlive-tex4ht/test_texlive-tex4ht_htxetex_help.sh b/testcases/function_test/pkg_test/texlive-base/texlive-tex4ht/test_texlive-tex4ht_htxetex_help.sh deleted file mode 100644 index ef47f0ca0bf..00000000000 --- a/testcases/function_test/pkg_test/texlive-base/texlive-tex4ht/test_texlive-tex4ht_htxetex_help.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-02 -# @License : Mulan PSL v2 -# @Desc : 测试 htxetex 命令的 --help 参数,验证是否显示帮助信息 -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - # 检查是否已安装texlive-tex4ht包 - LOG_INFO "检查texlive-tex4ht是否已安装" - rpm -q texlive-tex4ht > /dev/null 2>&1 - if [ $? -eq 0 ]; then - LOG_INFO "texlive-tex4ht已安装,标记为保持安装状态" - KEEP_INSTALLED=1 - else - LOG_INFO "texlive-tex4ht未安装,标记为需要清理" - KEEP_INSTALLED=0 - fi - - # 检查yum源中是否有texlive-tex4ht包 - LOG_INFO "检查yum源中是否存在texlive-tex4ht包" - dnf list available texlive-tex4ht > /dev/null 2>&1 - if [ $? -ne 0 ]; then - LOG_ERROR "yum源中未找到texlive-tex4ht包" - exit 255 - fi - - # 如果未安装,则安装texlive-tex4ht - if [ $KEEP_INSTALLED -eq 0 ]; then - LOG_INFO "开始安装texlive-tex4ht" - dnf install -y texlive-tex4ht - CHECK_RESULT $? 0 0 "安装texlive-tex4ht失败" - LOG_INFO "安装texlive-tex4ht成功" - fi - - # 检查htxetex命令是否存在 - LOG_INFO "检查htxetex命令是否存在" - which htxetex > /dev/null 2>&1 - if [ $? -ne 0 ]; then - LOG_ERROR "htxetex命令不存在" - if [ $KEEP_INSTALLED -eq 0 ]; then - LOG_INFO "清理环境:卸载texlive-tex4ht" - dnf remove -y texlive-tex4ht - fi - exit 255 - fi - - # 测试htxetex --help参数 - LOG_INFO "测试htxetex --help参数" - htxetex --help > /tmp/htxetex_help_output.txt 2>&1 - CHECK_RESULT $? 0 0 "执行htxetex --help失败" - - # 验证帮助信息是否显示 - LOG_INFO "验证帮助信息是否显示" - grep -q "Usage\|用法\|帮助" /tmp/htxetex_help_output.txt - CHECK_RESULT $? 0 0 "htxetex --help未显示帮助信息" - - LOG_INFO "htxetex --help测试成功" - - # 清理临时文件 - rm -f /tmp/htxetex_help_output.txt - - # 如果测试前未安装,则卸载texlive-tex4ht以恢复环境 - if [ $KEEP_INSTALLED -eq 0 ]; then - LOG_INFO "清理环境:卸载texlive-tex4ht" - dnf remove -y texlive-tex4ht - CHECK_RESULT $? 0 0 "卸载texlive-tex4ht失败" - LOG_INFO "环境恢复完成" - else - LOG_INFO "保持texlive-tex4ht安装状态" - fi -} - -main "$@" \ No newline at end of file diff --git a/testcases/function_test/pkg_test/texlive-base/texlive-tex4ht/test_texlive-tex4ht_htxetex_num_1.sh b/testcases/function_test/pkg_test/texlive-base/texlive-tex4ht/test_texlive-tex4ht_htxetex_num_1.sh deleted file mode 100644 index 6de097e252a..00000000000 --- a/testcases/function_test/pkg_test/texlive-base/texlive-tex4ht/test_texlive-tex4ht_htxetex_num_1.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-27 -# @License : Mulan PSL v2 -# @Desc : 测试 htxetex 命令的 -1 参数 -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - LOG_INFO "开始测试 htxetex 命令的 -1 参数" - - # 检查软件包是否已安装 - LOG_INFO "检查 texlive-tex4ht 是否已安装" - if ! dnf list installed texlive-tex4ht &>/dev/null; then - LOG_INFO "texlive-tex4ht 未安装,准备安装" - # 检查 yum 源中是否有该软件包 - if ! dnf list available texlive-tex4ht &>/dev/null; then - LOG_ERROR "yum 源中未找到 texlive-tex4ht 软件包" - exit 255 - fi - # 安装软件包 - dnf install -y texlive-tex4ht - CHECK_RESULT $? 0 0 "安装 texlive-tex4ht 失败" - # 标记为需要卸载 - UNINSTALL=true - else - LOG_INFO "texlive-tex4ht 已安装" - UNINSTALL=false - fi - - # 测试 htxetex -1 参数 - LOG_INFO "测试 htxetex -1 参数" - if ! htxetex -1 &>/dev/null; then - LOG_ERROR "htxetex 命令不支持 -1 参数或执行失败" - exit 255 - fi - - # 清理环境(如果之前未安装) - if [ "$UNINSTALL" = true ]; then - LOG_INFO "卸载 texlive-tex4ht" - dnf remove -y texlive-tex4ht - CHECK_RESULT $? 0 0 "卸载 texlive-tex4ht 失败" - fi - - LOG_INFO "测试完成" -} - -main "$@" \ No newline at end of file diff --git a/testcases/function_test/pkg_test/texlive-base/texlive-tex4ht/test_texlive-tex4ht_htxetex_upper_i.sh b/testcases/function_test/pkg_test/texlive-base/texlive-tex4ht/test_texlive-tex4ht_htxetex_upper_i.sh deleted file mode 100644 index abde34ad09a..00000000000 --- a/testcases/function_test/pkg_test/texlive-base/texlive-tex4ht/test_texlive-tex4ht_htxetex_upper_i.sh +++ /dev/null @@ -1,71 +0,0 @@ -#!/usr/bin/bash - -# Copyright (c) 2024 ISCAS .ALL rights reserved. -# This program is licensed under Mulan PSL v2. -# You can use it according to the terms and conditions of the Mulan PSL v2. -# http://license.coscl.org.cn/MulanPSL2 -# THIS PROGRAM IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, -# EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, -# MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. -# See the Mulan PSL v2 for more details. - -# ############################################# -# @Author : honghua -# @Contact : honghua@iscas.ac.cn -# @Date : 2026-03-02 -# @License : Mulan PSL v2 -# @Desc : 测试 htxetex 命令的 -I 参数,验证是否显示提示信息 -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - # 检查htxetex命令是否存在 - LOG_INFO "检查htxetex命令是否存在" - if command -v htxetex &> /dev/null; then - LOG_INFO "htxetex命令已存在,无需安装" - INSTALLED=true - else - LOG_INFO "htxetex命令不存在,需要安装" - INSTALLED=false - fi - - # 如果未安装,则安装texlive-tex4ht包 - if [ "$INSTALLED" = false ]; then - LOG_INFO "检查yum源中是否存在texlive-tex4ht包" - if ! dnf list available texlive-tex4ht &> /dev/null; then - LOG_ERROR "yum源中未找到texlive-tex4ht包" - exit 255 - fi - - LOG_INFO "安装texlive-tex4ht包" - dnf install -y texlive-tex4ht - CHECK_RESULT $? 0 0 "安装texlive-tex4ht失败" - fi - - # 测试htxetex命令的-I参数 - LOG_INFO "测试htxetex命令的-I参数" - htxetex -I - CHECK_RESULT $? 0 0 "htxetex命令的-I参数测试失败" - - # 验证显示提示信息 - LOG_INFO "验证htxetex -I命令是否显示提示信息" - output=$(htxetex -I 2>&1) - if [ -z "$output" ]; then - LOG_ERROR "htxetex -I命令未显示任何提示信息" - exit 1 - fi - - LOG_INFO "htxetex -I命令显示提示信息成功:$output" - - # 环境清理 - if [ "$INSTALLED" = false ]; then - LOG_INFO "清理环境:卸载texlive-tex4ht包" - dnf remove -y texlive-tex4ht - CHECK_RESULT $? 0 0 "卸载texlive-tex4ht失败" - fi - - LOG_INFO "测试完成" -} - -main "$@" \ No newline at end of file diff --git a/testcases/function_test/pkg_test/texlive-base/texlive-tex4ht/test_texlive-tex4ht_htxetex_upper_j.sh b/testcases/function_test/pkg_test/texlive-base/texlive-tex4ht/test_texlive-tex4ht_htxetex_upper_j.sh deleted file mode 100644 index 77e89f0068e..00000000000 --- a/testcases/function_test/pkg_test/texlive-base/texlive-tex4ht/test_texlive-tex4ht_htxetex_upper_j.sh +++ /dev/null @@ -1,69 +0,0 @@ -#!/usr/bin/bash - -# Copyright (c) 2024 ISCAS .ALL rights reserved. -# This program is licensed under Mulan PSL v2. -# You can use it according to the terms and conditions of the Mulan PSL v2. -# http://license.coscl.org.cn/MulanPSL2 -# THIS PROGRAM IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, -# EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, -# MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. -# See the Mulan PSL v2 for more details. - -# ############################################# -# @Author : honghua -# @Contact : honghua@iscas.ac.cn -# @Date : 2026-03-02 -# @License : Mulan PSL v2 -# @Desc : 测试 htxetex 命令的 -J 参数,验证是否指定字体文件 -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - LOG_INFO "开始测试 htxetex 命令的 -J 参数,验证是否指定字体文件" - - # 检查软件包是否在yum源中 - LOG_INFO "检查 yum 源中是否存在 texlive-tex4ht 软件包" - if ! dnf list available texlive-tex4ht &> /dev/null; then - LOG_ERROR "yum 源中未找到 texlive-tex4ht 软件包" - exit 255 - fi - - # 检查是否已安装 - LOG_INFO "检查 texlive-tex4ht 是否已安装" - if rpm -q texlive-tex4ht &> /dev/null; then - LOG_INFO "texlive-tex4ht 已安装,脚本结束后将保持安装状态" - already_installed=true - else - LOG_INFO "texlive-tex4ht 未安装,将进行安装" - already_installed=false - fi - - # 如果未安装,则安装软件包 - if [ "$already_installed" = false ]; then - LOG_INFO "安装 texlive-tex4ht 软件包" - dnf install -y texlive-tex4ht - CHECK_RESULT $? 0 0 "安装 texlive-tex4ht 失败" - fi - - # 检查 htxetex 命令是否存在 - LOG_INFO "检查 htxetex 命令是否存在" - command -v htxetex &> /dev/null - CHECK_RESULT $? 0 0 "htxetex 命令不存在" - - # 测试 htxetex 命令的 -J 参数 - LOG_INFO "测试 htxetex 命令的 -J 参数,验证是否指定字体文件" - htxetex -J /usr/share/fonts/dejavu/DejaVuSerif.ttf --help &> /dev/null - CHECK_RESULT $? 0 0 "htxetex 命令的 -J 参数不支持或参数错误" - - # 清理环境:如果之前未安装,则卸载软件包 - if [ "$already_installed" = false ]; then - LOG_INFO "卸载 texlive-tex4ht 软件包" - dnf remove -y texlive-tex4ht - CHECK_RESULT $? 0 0 "卸载 texlive-tex4ht 失败" - fi - - LOG_INFO "测试完成,环境已恢复" -} - -main "$@" \ No newline at end of file diff --git a/testcases/function_test/pkg_test/texlive-base/texlive-tex4ht/test_texlive-tex4ht_htxetex_upper_k.sh b/testcases/function_test/pkg_test/texlive-base/texlive-tex4ht/test_texlive-tex4ht_htxetex_upper_k.sh deleted file mode 100644 index e5a7e04c7fd..00000000000 --- a/testcases/function_test/pkg_test/texlive-base/texlive-tex4ht/test_texlive-tex4ht_htxetex_upper_k.sh +++ /dev/null @@ -1,83 +0,0 @@ -#!/usr/bin/bash - -# Copyright (c) 2024 ISCAS .ALL rights reserved. -# This program is licensed under Mulan PSL v2. -# You can use it according to the terms and conditions of the Mulan PSL v2. -# http://license.coscl.org.cn/MulanPSL2 -# THIS PROGRAM IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, -# EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, -# MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. -# See the Mulan PSL v2 for more details. - -# ############################################# -# @Author : honghua -# @Contact : honghua@iscas.ac.cn -# @Date : 2026-03-02 -# @License : Mulan PSL v2 -# @Desc : 测试 htxetex 命令的 -K 参数,验证是否处理特定字符集 -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - LOG_INFO "开始测试 htxetex 命令的 -K 参数,验证是否处理特定字符集" - - # 步骤1:检查 yum 源中是否存在 texlive-tex4ht 软件包 - LOG_INFO "步骤1:检查 yum 源中是否存在 texlive-tex4ht 软件包" - dnf list available texlive-tex4ht 2>/dev/null | grep -q texlive-tex4ht - if [ $? -ne 0 ]; then - LOG_ERROR "yum 源中未找到 texlive-tex4ht 软件包" - exit 255 - fi - - # 步骤2:检查是否已安装 texlive-tex4ht - LOG_INFO "步骤2:检查是否已安装 texlive-tex4ht" - rpm -q texlive-tex4ht >/dev/null 2>&1 - if [ $? -eq 0 ]; then - LOG_INFO "texlive-tex4ht 已安装,脚本结束后将保持安装状态" - INSTALLED_BEFORE=1 - else - LOG_INFO "texlive-tex4ht 未安装,将在测试过程中安装并在结束后卸载" - INSTALLED_BEFORE=0 - fi - - # 步骤3:如果未安装,则安装 texlive-tex4ht - if [ $INSTALLED_BEFORE -eq 0 ]; then - LOG_INFO "步骤3:安装 texlive-tex4ht" - dnf install -y texlive-tex4ht - CHECK_RESULT $? 0 0 "安装 texlive-tex4ht 失败" - fi - - # 步骤4:检查 htxetex 命令是否支持 -K 参数 - LOG_INFO "步骤4:检查 htxetex 命令是否支持 -K 参数" - htxetex --help 2>&1 | grep -q -- "-K" - if [ $? -ne 0 ]; then - LOG_ERROR "htxetex 命令不支持 -K 参数" - # 如果之前未安装,则卸载软件包 - if [ $INSTALLED_BEFORE -eq 0 ]; then - dnf remove -y texlive-tex4ht - fi - exit 255 - fi - - # 步骤5:测试 htxetex 命令的 -K 参数处理特定字符集 - LOG_INFO "步骤5:测试 htxetex 命令的 -K 参数处理特定字符集" - echo "\documentclass{article}\begin{document}Test\end{document}" > test_tex.tex - htxetex -K utf8 test_tex.tex - CHECK_RESULT $? 0 0 "htxetex -K utf8 执行失败" - - # 步骤6:清理测试文件 - LOG_INFO "步骤6:清理测试文件" - rm -f test_tex.tex test_tex*.4ct test_tex*.4tc test_tex*.dvi test_tex*.idv test_tex*.lg test_tex*.tmp test_tex*.xref - - # 步骤7:如果之前未安装,则卸载 texlive-tex4ht - if [ $INSTALLED_BEFORE -eq 0 ]; then - LOG_INFO "步骤7:卸载 texlive-tex4ht" - dnf remove -y texlive-tex4ht - CHECK_RESULT $? 0 0 "卸载 texlive-tex4ht 失败" - fi - - LOG_INFO "测试完成,环境已恢复" -} - -main "$@" \ No newline at end of file diff --git a/testcases/function_test/pkg_test/texlive-base/texlive-tex4ht/test_texlive-tex4ht_htxetex_upper_l.sh b/testcases/function_test/pkg_test/texlive-base/texlive-tex4ht/test_texlive-tex4ht_htxetex_upper_l.sh deleted file mode 100644 index e3c37b60767..00000000000 --- a/testcases/function_test/pkg_test/texlive-base/texlive-tex4ht/test_texlive-tex4ht_htxetex_upper_l.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-02 -# @License : Mulan PSL v2 -# @Desc : 测试 htxetex 命令的 -L 参数,验证是否使用特定语言设置 -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - LOG_INFO "开始测试 htxetex 命令的 -L 参数,验证是否使用特定语言设置" - LOG_INFO "步骤1:检查环境中是否已安装 texlive-tex4ht 软件包" - rpm -q texlive-tex4ht > /dev/null 2>&1 - if [ $? -eq 0 ]; then - LOG_INFO "texlive-tex4ht 软件包已安装,测试结束后将保持安装状态" - INSTALLED=1 - else - LOG_INFO "texlive-tex4ht 软件包未安装,将在测试前安装并在测试后卸载" - INSTALLED=0 - fi - - if [ $INSTALLED -eq 0 ]; then - LOG_INFO "步骤2:检查 yum 源中是否有 texlive-tex4ht 软件包" - dnf list available texlive-tex4ht > /dev/null 2>&1 - if [ $? -ne 0 ]; then - LOG_ERROR "yum 源中未找到 texlive-tex4ht 软件包" - exit 255 - fi - - LOG_INFO "步骤3:安装 texlive-tex4ht 软件包" - dnf install -y texlive-tex4ht > /dev/null 2>&1 - CHECK_RESULT $? 0 0 "安装 texlive-tex4ht 软件包失败" - fi - - LOG_INFO "步骤4:检查 htxetex 命令是否支持 -L 参数" - htxetex --help 2>&1 | grep -q "\-L" - if [ $? -ne 0 ]; then - LOG_ERROR "htxetex 命令不支持 -L 参数" - if [ $INSTALLED -eq 0 ]; then - LOG_INFO "清理环境:卸载 texlive-tex4ht 软件包" - dnf remove -y texlive-tex4ht > /dev/null 2>&1 - fi - exit 255 - fi - - LOG_INFO "步骤5:使用 htxetex 命令的 -L 参数测试特定语言设置" - echo "\documentclass{article}\begin{document}test\end{document}" > test.tex - htxetex -L english test.tex > /dev/null 2>&1 - CHECK_RESULT $? 0 0 "htxetex -L 参数执行失败" - - LOG_INFO "步骤6:检查生成的输出文件" - ls test.html > /dev/null 2>&1 - CHECK_RESULT $? 0 0 "未生成预期的输出文件 test.html" - - LOG_INFO "步骤7:清理测试生成的文件" - rm -f test.tex test.html test*.css test*.idv test*.lg test*.tmp test*.xref *.4ct *.4tc *.dvi *.log *.aux *.out *.png *.tid > /dev/null 2>&1 - - if [ $INSTALLED -eq 0 ]; then - LOG_INFO "步骤8:卸载 texlive-tex4ht 软件包" - dnf remove -y texlive-tex4ht > /dev/null 2>&1 - CHECK_RESULT $? 0 0 "卸载 texlive-tex4ht 软件包失败" - fi - - LOG_INFO "测试完成,环境已恢复" -} - -main "$@" \ No newline at end of file diff --git a/testcases/function_test/pkg_test/texlive-base/texlive-tex4ht/test_texlive-tex4ht_htxetex_upper_m.sh b/testcases/function_test/pkg_test/texlive-base/texlive-tex4ht/test_texlive-tex4ht_htxetex_upper_m.sh deleted file mode 100644 index 0ca49475b4e..00000000000 --- a/testcases/function_test/pkg_test/texlive-base/texlive-tex4ht/test_texlive-tex4ht_htxetex_upper_m.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-02 -# @License : Mulan PSL v2 -# @Desc : 测试 htxetex 命令的 -M 参数,验证是否使用特定模式 -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - # 判断是否已安装texlive-tex4ht-htxetex-upper_m软件包 - LOG_INFO "检查是否已安装texlive-tex4ht-htxetex-upper_m软件包" - rpm -q texlive-tex4ht-htxetex-upper_m > /dev/null 2>&1 - if [ $? -eq 0 ]; then - LOG_INFO "软件包已安装,标记为已存在" - PACKAGE_INSTALLED=1 - else - LOG_INFO "软件包未安装,标记为未安装" - PACKAGE_INSTALLED=0 - fi - - # 检查yum源中是否存在该软件包 - LOG_INFO "检查yum源中是否存在texlive-tex4ht-htxetex-upper_m软件包" - dnf list available texlive-tex4ht-htxetex-upper_m > /dev/null 2>&1 - if [ $? -ne 0 ]; then - LOG_ERROR "yum源中未找到texlive-tex4ht-htxetex-upper_m软件包" - exit 255 - fi - - # 如果未安装,则安装软件包 - if [ $PACKAGE_INSTALLED -eq 0 ]; then - LOG_INFO "开始安装texlive-tex4ht-htxetex-upper_m软件包" - dnf install -y texlive-tex4ht-htxetex-upper_m - CHECK_RESULT $? 0 0 "安装texlive-tex4ht-htxetex-upper_m软件包失败" - fi - - # 检查htxetex命令是否存在 - LOG_INFO "检查htxetex命令是否存在" - which htxetex > /dev/null 2>&1 - if [ $? -ne 0 ]; then - LOG_ERROR "htxetex命令不存在" - if [ $PACKAGE_INSTALLED -eq 0 ]; then - dnf remove -y texlive-tex4ht-htxetex-upper_m - fi - exit 255 - fi - - # 检查htxetex命令是否支持-M参数 - LOG_INFO "检查htxetex命令是否支持-M参数" - htxetex --help 2>&1 | grep -E "\-M|--mode" > /dev/null 2>&1 - if [ $? -ne 0 ]; then - LOG_ERROR "htxetex命令不支持-M参数" - if [ $PACKAGE_INSTALLED -eq 0 ]; then - dnf remove -y texlive-tex4ht-htxetex-upper_m - fi - exit 255 - fi - - # 测试htxetex命令的-M参数 - LOG_INFO "测试htxetex命令的-M参数" - echo "\documentclass{article}\begin{document}test\end{document}" > test.tex - htxetex -M test test.tex > output.log 2>&1 - CHECK_RESULT $? 0 0 "htxetex命令-M参数执行失败" - LOG_INFO "htxetex命令-M参数执行成功" - - # 清理测试文件 - LOG_INFO "清理测试文件" - rm -f test.tex output.log test.html test.css test*.png - - # 如果测试前未安装,则卸载软件包 - if [ $PACKAGE_INSTALLED -eq 0 ]; then - LOG_INFO "卸载texlive-tex4ht-htxetex-upper_m软件包" - dnf remove -y texlive-tex4ht-htxetex-upper_m - CHECK_RESULT $? 0 0 "卸载texlive-tex4ht-htxetex-upper_m软件包失败" - fi - - LOG_INFO "测试完成,环境已恢复" -} - -main "$@" \ No newline at end of file diff --git a/testcases/function_test/pkg_test/texlive-base/texlive-tex4ht/test_texlive-tex4ht_htxetex_upper_n.sh b/testcases/function_test/pkg_test/texlive-base/texlive-tex4ht/test_texlive-tex4ht_htxetex_upper_n.sh deleted file mode 100644 index f1a2f23b1d0..00000000000 --- a/testcases/function_test/pkg_test/texlive-base/texlive-tex4ht/test_texlive-tex4ht_htxetex_upper_n.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-02 -# @License : Mulan PSL v2 -# @Desc : 测试 htxetex 命令的 -N 参数,验证是否禁止特定功能 -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - # 定义日志函数(根据要求直接使用,这里定义以防不存在) - LOG_INFO() { - echo "[INFO] $*" - } - LOG_ERROR() { - echo "[ERROR] $*" - } - - # 定义软件包名称和命令 - PACKAGE_NAME="texlive-tex4ht" - COMMAND_NAME="htxetex" - PARAMETER="-N" - - # 步骤1: 检查软件包是否在yum源中 - LOG_INFO "步骤1: 检查软件包是否在yum源中" - if ! dnf list available "$PACKAGE_NAME" &>/dev/null; then - LOG_ERROR "软件包 $PACKAGE_NAME 不在yum源中" - exit 255 - fi - - # 步骤2: 检查命令是否已安装 - LOG_INFO "步骤2: 检查命令是否已安装" - if command -v "$COMMAND_NAME" &>/dev/null; then - LOG_INFO "命令 $COMMAND_NAME 已安装,脚本结束时将保持安装状态" - INSTALLED=true - else - LOG_INFO "命令 $COMMAND_NAME 未安装,将在测试步骤中安装" - INSTALLED=false - fi - - # 步骤3: 如果未安装,则安装软件包 - if [ "$INSTALLED" = false ]; then - LOG_INFO "步骤3: 安装软件包 $PACKAGE_NAME" - dnf install -y "$PACKAGE_NAME" - CHECK_RESULT $? 0 0 "安装软件包 $PACKAGE_NAME 失败" - fi - - # 步骤4: 检查命令参数是否存在 - LOG_INFO "步骤4: 检查命令参数 $PARAMETER 是否存在" - if ! "$COMMAND_NAME" --help 2>&1 | grep -q -- "$PARAMETER"; then - LOG_ERROR "命令 $COMMAND_NAME 不支持参数 $PARAMETER" - # 如果之前未安装,需要卸载软件包 - if [ "$INSTALLED" = false ]; then - dnf remove -y "$PACKAGE_NAME" - fi - exit 255 - fi - - # 步骤5: 测试 htxetex 命令的 -N 参数 - LOG_INFO "步骤5: 测试 htxetex 命令的 -N 参数,验证是否禁止特定功能" - # 创建一个简单的测试文件 - TEST_FILE="test_htxetex.tex" - cat > "$TEST_FILE" << "EOF" - \documentclass{article} - \begin{document} - Hello, World! - \end{document} - EOF - - # 执行命令测试 -N 参数 - "$COMMAND_NAME" "$PARAMETER" "$TEST_FILE" &>/dev/null - CHECK_RESULT $? 0 0 "htxetex 命令的 -N 参数测试失败" - - # 步骤6: 清理测试文件 - LOG_INFO "步骤6: 清理测试文件" - rm -f "$TEST_FILE" "test_htxetex.html" "test_htxetex.css" "test_htxetex.4ct" "test_htxetex.4tc" "test_htxetex.idv" "test_htxetex.lg" "test_htxetex.tmp" "test_htxetex.xref" - - # 步骤7: 如果脚本开始前未安装,则卸载软件包 - if [ "$INSTALLED" = false ]; then - LOG_INFO "步骤7: 卸载软件包 $PACKAGE_NAME" - dnf remove -y "$PACKAGE_NAME" - CHECK_RESULT $? 0 0 "卸载软件包 $PACKAGE_NAME 失败" - else - LOG_INFO "步骤7: 保持软件包 $PACKAGE_NAME 安装状态" - fi - - LOG_INFO "测试脚本执行完毕" -} - -main "$@" \ No newline at end of file diff --git a/testcases/function_test/pkg_test/texlive-base/texlive-tex4ht/test_texlive-tex4ht_htxetex_upper_o.sh b/testcases/function_test/pkg_test/texlive-base/texlive-tex4ht/test_texlive-tex4ht_htxetex_upper_o.sh deleted file mode 100644 index ca14a1d8776..00000000000 --- a/testcases/function_test/pkg_test/texlive-base/texlive-tex4ht/test_texlive-tex4ht_htxetex_upper_o.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-02 -# @License : Mulan PSL v2 -# @Desc : 测试 htxetex 命令的 -O 参数,验证是否设置输出选项 -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - set -e - - LOG_INFO "开始测试 htxetex 命令的 -O 参数,验证是否设置输出选项" - - LOG_INFO "步骤1:检查环境中是否已安装 texlive-tex4ht-htxetex-upper 软件包" - if rpm -q texlive-tex4ht-htxetex-upper > /dev/null 2>&1; then - LOG_INFO "检测到 texlive-tex4ht-htxetex-upper 已安装,测试结束后将保持安装状态。" - INSTALLED_BEFORE_TEST=true - else - LOG_INFO "未检测到 texlive-tex4ht-htxetex-upper 安装,测试前将进行安装。" - INSTALLED_BEFORE_TEST=false - fi - - LOG_INFO "步骤2:检查 yum 源中是否存在 texlive-tex4ht-htxetex-upper 软件包" - if ! dnf list available texlive-tex4ht-htxetex-upper > /dev/null 2>&1; then - LOG_ERROR "yum 源中未找到 texlive-tex4ht-htxetex-upper 软件包" - exit 255 - fi - - if [ "$INSTALLED_BEFORE_TEST" = false ]; then - LOG_INFO "步骤3:安装 texlive-tex4ht-htxetex-upper 软件包" - dnf install -y texlive-tex4ht-htxetex-upper - CHECK_RESULT $? 0 0 "安装 texlive-tex4ht-htxetex-upper 软件包失败" - fi - - LOG_INFO "步骤4:验证 htxetex 命令是否存在" - command -v htxetex - CHECK_RESULT $? 0 0 "未找到 htxetex 命令" - - LOG_INFO "步骤5:验证 htxetex 命令是否支持 -O 参数" - htxetex --help | grep -q -- "-O" - CHECK_RESULT $? 0 0 "htxetex 命令不支持 -O 参数" 255 - - LOG_INFO "步骤6:创建一个简单的测试 tex 文件" - TEST_TEX_FILE="test_htxetex.tex" - cat > "$TEST_TEX_FILE" << "EOF" - \documentclass{article} - \begin{document} - Hello, Htxetex Test! - \end{document} - EOF - CHECK_RESULT $? 0 0 "创建测试 tex 文件失败" - - LOG_INFO "步骤7:执行 htxetex 命令,使用 -O 参数指定输出选项" - htxetex -O "html,2,sections+" "$TEST_TEX_FILE" 2>&1 - CHECK_RESULT $? 0 0 "使用 -O 参数执行 htxetex 命令失败" - - LOG_INFO "步骤8:检查是否生成了预期的 html 输出文件" - EXPECTED_HTML_FILE="test_htxetex.html" - if [ -f "$EXPECTED_HTML_FILE" ]; then - LOG_INFO "成功生成输出文件: $EXPECTED_HTML_FILE" - else - LOG_ERROR "未找到预期的输出文件: $EXPECTED_HTML_FILE" - exit 1 - fi - - LOG_INFO "步骤9:清理测试过程中生成的文件" - rm -f "$TEST_TEX_FILE" "$EXPECTED_HTML_FILE" test_htxetex*.4ct test_htxetex*.4tc test_htxetex*.idv test_htxetex*.lg test_htxetex*.tmp test_htxetex*.xref test_htxetex*.dvi test_htxetex*.log 2>/dev/null || true - - if [ "$INSTALLED_BEFORE_TEST" = false ]; then - LOG_INFO "步骤10:卸载测试安装的 texlive-tex4ht-htxetex-upper 软件包" - dnf remove -y texlive-tex4ht-htxetex-upper - CHECK_RESULT $? 0 0 "卸载 texlive-tex4ht-htxetex-upper 软件包失败" - else - LOG_INFO "测试前已安装软件包,跳过卸载步骤。" - fi - - LOG_INFO "测试完成。" -} - -main "$@" \ No newline at end of file diff --git a/testcases/function_test/pkg_test/texlive-base/texlive-tex4ht/test_texlive-tex4ht_htxetex_upper_p.sh b/testcases/function_test/pkg_test/texlive-base/texlive-tex4ht/test_texlive-tex4ht_htxetex_upper_p.sh deleted file mode 100644 index 5c1a69bcddd..00000000000 --- a/testcases/function_test/pkg_test/texlive-base/texlive-tex4ht/test_texlive-tex4ht_htxetex_upper_p.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-02 -# @License : Mulan PSL v2 -# @Desc : 测试 htxetex 命令的 -P 参数,验证是否使用特定配置文件 -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - # 检查是否已经安装了texlive-tex4ht-htxetex-upper软件包 - LOG_INFO "检查是否已安装texlive-tex4ht-htxetex-upper软件包" - rpm -q texlive-tex4ht-htxetex-upper > /dev/null 2>&1 - pkg_installed=$? - - # 如果未安装,则尝试安装 - if [ $pkg_installed -ne 0 ]; then - LOG_INFO "软件包未安装,开始安装" - # 检查yum源中是否有该软件包 - LOG_INFO "检查yum源中是否有texlive-tex4ht-htxetex-upper软件包" - dnf list available texlive-tex4ht-htxetex-upper > /dev/null 2>&1 - CHECK_RESULT $? 0 0 "yum源中未找到texlive-tex4ht-htxetex-upper软件包" - if [ $? -ne 0 ]; then - LOG_ERROR "yum源中未找到texlive-tex4ht-htxetex-upper软件包" - exit 255 - fi - - # 安装软件包 - LOG_INFO "安装texlive-tex4ht-htxetex-upper软件包" - dnf install -y texlive-tex4ht-htxetex-upper - CHECK_RESULT $? 0 0 "安装texlive-tex4ht-htxetex-upper软件包失败" - else - LOG_INFO "软件包已安装,跳过安装步骤" - fi - - # 检查htxetex命令是否存在 - LOG_INFO "检查htxetex命令是否存在" - which htxetex > /dev/null 2>&1 - CHECK_RESULT $? 0 0 "htxetex命令未找到" - - # 测试htxetex命令的-P参数 - LOG_INFO "测试htxetex命令的-P参数" - # 首先检查-P参数是否支持 - htxetex --help 2>&1 | grep -q "\-P" - CHECK_RESULT $? 0 0 "htxetex命令不支持-P参数" - if [ $? -ne 0 ]; then - LOG_ERROR "htxetex命令不支持-P参数" - exit 255 - fi - - # 创建一个简单的测试配置文件 - LOG_INFO "创建测试配置文件" - cat > test_config.cfg << "EOF" - % 测试配置文件 - \Preamble{xhtml} - \CutAt{section} - \begin{document} - EOF - - # 创建一个简单的测试tex文件 - LOG_INFO "创建测试tex文件" - cat > test_doc.tex << "EOF" - \documentclass{article} - \begin{document} - This is a test document. - \end{document} - EOF - - # 使用-P参数指定配置文件执行htxetex命令 - LOG_INFO "使用-P参数执行htxetex命令" - htxetex -P test_config.cfg test_doc.tex - CHECK_RESULT $? 0 0 "使用-P参数执行htxetex命令失败" - - # 清理测试文件 - LOG_INFO "清理测试文件" - rm -f test_config.cfg test_doc.tex test_doc.html test_doc*.png test_doc*.css - - # 如果测试开始时未安装软件包,则在测试结束后卸载 - if [ $pkg_installed -ne 0 ]; then - LOG_INFO "测试前未安装软件包,测试结束后卸载" - dnf remove -y texlive-tex4ht-htxetex-upper - CHECK_RESULT $? 0 0 "卸载texlive-tex4ht-htxetex-upper软件包失败" - else - LOG_INFO "测试前已安装软件包,保持安装状态" - fi - - LOG_INFO "测试完成" -} - -main "$@" \ No newline at end of file diff --git a/testcases/function_test/pkg_test/texlive-base/texlive-tex4ht/test_texlive-tex4ht_htxetex_upper_q.sh b/testcases/function_test/pkg_test/texlive-base/texlive-tex4ht/test_texlive-tex4ht_htxetex_upper_q.sh deleted file mode 100644 index 273be86740d..00000000000 --- a/testcases/function_test/pkg_test/texlive-base/texlive-tex4ht/test_texlive-tex4ht_htxetex_upper_q.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-02 -# @License : Mulan PSL v2 -# @Desc : 测试 htxetex 命令的 -Q 参数,验证是否静默模式运行 -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - # 环境检查:检查是否已安装texlive-tex4ht - LOG_INFO "检查是否已安装texlive-tex4ht软件包" - rpm -q texlive-tex4ht > /dev/null 2>&1 - if [ $? -eq 0 ]; then - LOG_INFO "texlive-tex4ht已安装,标记为已存在" - ALREADY_INSTALLED=1 - else - LOG_INFO "texlive-tex4ht未安装,标记为需要安装" - ALREADY_INSTALLED=0 - fi - - # 检查yum源中是否有texlive-tex4ht软件包 - LOG_INFO "检查yum源中是否有texlive-tex4ht软件包" - dnf list available texlive-tex4ht > /dev/null 2>&1 - if [ $? -ne 0 ]; then - LOG_ERROR "yum源中未找到texlive-tex4ht软件包" - exit 255 - fi - - # 如果未安装,则安装软件包 - if [ $ALREADY_INSTALLED -eq 0 ]; then - LOG_INFO "开始安装texlive-tex4ht软件包" - dnf install -y texlive-tex4ht - CHECK_RESULT $? 0 0 "安装texlive-tex4ht失败" - LOG_INFO "texlive-tex4ht软件包安装成功" - fi - - # 检查htxetex命令是否存在 - LOG_INFO "检查htxetex命令是否存在" - which htxetex > /dev/null 2>&1 - if [ $? -ne 0 ]; then - LOG_ERROR "htxetex命令不存在" - exit 255 - fi - - # 测试htxetex命令的-Q参数是否存在 - LOG_INFO "测试htxetex命令的-Q参数是否存在" - htxetex -Q --help > /dev/null 2>&1 - if [ $? -ne 0 ]; then - LOG_ERROR "htxetex命令不支持-Q参数" - exit 255 - fi - - # 验证htxetex命令的-Q参数是否静默模式运行 - LOG_INFO "验证htxetex命令的-Q参数是否静默模式运行" - # 创建一个简单的测试文件 - cat > test.tex << "EOF" - \documentclass{article} - \begin{document} - Hello, World! - \end{document} - EOF - CHECK_RESULT $? 0 0 "创建测试tex文件失败" - - # 使用-Q参数运行htxetex,检查是否有输出 - LOG_INFO "使用-Q参数运行htxetex" - output=$(htxetex -Q test.tex 2>&1) - if [ -n "$output" ]; then - LOG_ERROR "htxetex -Q 参数未静默运行,有输出:$output" - exit 1 - else - LOG_INFO "htxetex -Q 参数静默运行成功" - fi - - # 清理测试文件 - LOG_INFO "清理测试文件" - rm -f test.tex test.dvi test.log test.aux - CHECK_RESULT $? 0 0 "清理测试文件失败" - - # 环境恢复:如果之前未安装,则卸载软件包 - if [ $ALREADY_INSTALLED -eq 0 ]; then - LOG_INFO "卸载texlive-tex4ht软件包" - dnf remove -y texlive-tex4ht - CHECK_RESULT $? 0 0 "卸载texlive-tex4ht失败" - LOG_INFO "texlive-tex4ht软件包卸载成功" - else - LOG_INFO "保持texlive-tex4ht软件包安装状态" - fi - - LOG_INFO "测试脚本执行完成" -} - -main "$@" \ No newline at end of file diff --git a/testcases/function_test/pkg_test/texlive-base/texlive-tex4ht/test_texlive-tex4ht_htxetex_upper_r.sh b/testcases/function_test/pkg_test/texlive-base/texlive-tex4ht/test_texlive-tex4ht_htxetex_upper_r.sh deleted file mode 100644 index e27cd738269..00000000000 --- a/testcases/function_test/pkg_test/texlive-base/texlive-tex4ht/test_texlive-tex4ht_htxetex_upper_r.sh +++ /dev/null @@ -1,91 +0,0 @@ -#!/usr/bin/bash - -# Copyright (c) 2024 ISCAS .ALL rights reserved. -# This program is licensed under Mulan PSL v2. -# You can use it according to the terms and conditions of the Mulan PSL v2. -# http://license.coscl.org.cn/MulanPSL2 -# THIS PROGRAM IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, -# EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, -# MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. -# See the Mulan PSL v2 for more details. - -# ############################################# -# @Author : honghua -# @Contact : honghua@iscas.ac.cn -# @Date : 2026-03-02 -# @License : Mulan PSL v2 -# @Desc : 测试 htxetex 命令的 -R 参数,验证是否递归处理文件 -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - LOG_INFO "开始测试 htxetex 命令的 -R 参数,验证是否递归处理文件" - - # 检查软件包是否在 yum 源中 - LOG_INFO "检查 yum 源中是否存在 texlive-tex4ht 软件包" - dnf list texlive-tex4ht &> /dev/null - if [ $? -ne 0 ]; then - LOG_ERROR "yum 源中不存在 texlive-tex4ht 软件包" - exit 255 - fi - - # 判断环境是否已安装 texlive-tex4ht - LOG_INFO "检查环境中是否已安装 texlive-tex4ht" - rpm -q texlive-tex4ht &> /dev/null - if [ $? -eq 0 ]; then - LOG_INFO "环境中已安装 texlive-tex4ht,测试结束后保持安装状态" - INSTALLED=true - else - LOG_INFO "环境中未安装 texlive-tex4ht,开始安装" - dnf install -y texlive-tex4ht &> /dev/null - CHECK_RESULT $? 0 0 "安装 texlive-tex4ht 失败" - INSTALLED=false - fi - - # 检查 htxetex 命令是否支持 -R 参数 - LOG_INFO "检查 htxetex 命令是否支持 -R 参数" - htxetex --help 2>&1 | grep -q "\-R" - if [ $? -ne 0 ]; then - LOG_ERROR "htxetex 命令不支持 -R 参数" - exit 255 - fi - - # 创建测试目录和文件 - LOG_INFO "创建测试目录和文件" - mkdir -p test_recursive/subdir1/subdir2 - echo "\\documentclass{article}\\begin{document}Test\\end{document}" > test_recursive/test1.tex - echo "\\documentclass{article}\\begin{document}Test2\\end{document}" > test_recursive/subdir1/test2.tex - echo "\\documentclass{article}\\begin{document}Test3\\end{document}" > test_recursive/subdir1/subdir2/test3.tex - - # 执行 htxetex 命令的 -R 参数测试 - LOG_INFO "执行 htxetex 命令的 -R 参数,递归处理文件" - cd test_recursive - htxetex -R . &> /dev/null - CHECK_RESULT $? 0 0 "htxetex 命令的 -R 参数执行失败" - - # 检查是否生成了对应的 .html 文件 - LOG_INFO "检查是否生成了对应的 .html 文件" - if [ -f test1.html ] && [ -f subdir1/test2.html ] && [ -f subdir1/subdir2/test3.html ]; then - LOG_INFO "成功生成了所有 .html 文件,递归处理功能正常" - else - LOG_ERROR "未生成所有预期的 .html 文件,递归处理功能异常" - exit 1 - fi - - # 清理测试目录 - LOG_INFO "清理测试目录" - cd .. - rm -rf test_recursive - - # 如果测试前未安装软件包,则在测试结束后卸载 - if [ "$INSTALLED" = false ]; then - LOG_INFO "测试结束,卸载 texlive-tex4ht 软件包" - dnf remove -y texlive-tex4ht &> /dev/null - CHECK_RESULT $? 0 0 "卸载 texlive-tex4ht 失败" - fi - - LOG_INFO "测试完成,环境已恢复" -} - -main "$@" \ No newline at end of file diff --git a/testcases/function_test/pkg_test/texlive-base/texlive-tex4ht/test_texlive-tex4ht_htxetex_upper_s.sh b/testcases/function_test/pkg_test/texlive-base/texlive-tex4ht/test_texlive-tex4ht_htxetex_upper_s.sh deleted file mode 100644 index b36d24de3a2..00000000000 --- a/testcases/function_test/pkg_test/texlive-base/texlive-tex4ht/test_texlive-tex4ht_htxetex_upper_s.sh +++ /dev/null @@ -1,68 +0,0 @@ -#!/usr/bin/bash - -# Copyright (c) 2024 ISCAS .ALL rights reserved. -# This program is licensed under Mulan PSL v2. -# You can use it according to the terms and conditions of the Mulan PSL v2. -# http://license.coscl.org.cn/MulanPSL2 -# THIS PROGRAM IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, -# EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, -# MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. -# See the Mulan PSL v2 for more details. - -# ############################################# -# @Author : honghua -# @Contact : honghua@iscas.ac.cn -# @Date : 2026-03-02 -# @License : Mulan PSL v2 -# @Desc : 测试 htxetex 命令的 -S 参数,验证是否使用安全模式 -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - # 环境检查与初始化 - LOG_INFO "开始测试 htxetex 命令的 -S 参数,验证是否使用安全模式" - LOG_INFO "步骤1:检查当前环境是否已安装 texlive-tex4ht 软件包" - if rpm -q texlive-tex4ht &>/dev/null; then - LOG_INFO "texlive-tex4ht 已安装,测试完成后将保持安装状态" - INSTALLED=true - else - LOG_INFO "texlive-tex4ht 未安装,将在测试过程中安装并在结束后卸载" - INSTALLED=false - fi - - # 检查软件包是否在 yum 源中 - LOG_INFO "步骤2:检查 yum 源中是否存在 texlive-tex4ht 软件包" - if ! dnf list available texlive-tex4ht &>/dev/null; then - LOG_ERROR "yum 源中不存在 texlive-tex4ht 软件包,退出测试" - exit 255 - fi - - # 安装软件包(如果未安装) - if [ "$INSTALLED" = false ]; then - LOG_INFO "步骤3:安装 texlive-tex4ht 软件包" - dnf install -y texlive-tex4ht - CHECK_RESULT $? 0 0 "安装 texlive-tex4ht 失败" - fi - - # 验证 htxetex 命令是否存在 - LOG_INFO "步骤4:验证 htxetex 命令是否存在" - command -v htxetex - CHECK_RESULT $? 0 0 "htxetex 命令不存在" - - # 测试 htxetex 命令的 -S 参数 - LOG_INFO "步骤5:测试 htxetex 命令的 -S 参数,验证是否使用安全模式" - htxetex -S --help 2>&1 | grep -q "安全模式" - CHECK_RESULT $? 0 0 "htxetex 命令不支持 -S 参数或参数含义不符合预期" - - # 清理环境(如果测试前未安装) - if [ "$INSTALLED" = false ]; then - LOG_INFO "步骤6:卸载 texlive-tex4ht 软件包,恢复环境" - dnf remove -y texlive-tex4ht - CHECK_RESULT $? 0 0 "卸载 texlive-tex4ht 失败" - fi - - LOG_INFO "测试完成,环境已恢复" -} - -main "$@" \ No newline at end of file diff --git a/testcases/function_test/pkg_test/texlive-base/texlive-tex4ht/test_texlive-tex4ht_htxetex_upper_t.sh b/testcases/function_test/pkg_test/texlive-base/texlive-tex4ht/test_texlive-tex4ht_htxetex_upper_t.sh deleted file mode 100644 index c8e9a06c68c..00000000000 --- a/testcases/function_test/pkg_test/texlive-base/texlive-tex4ht/test_texlive-tex4ht_htxetex_upper_t.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-02 -# @License : Mulan PSL v2 -# @Desc : 测试 htxetex 命令的 -T 参数,验证是否指定输出类型 -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - # 检查是否已安装texlive-tex4ht-htxetex-upper软件包 - LOG_INFO "检查是否已安装texlive-tex4ht-htxetex-upper软件包" - if dnf list installed texlive-tex4ht-htxetex-upper &>/dev/null; then - LOG_INFO "软件包已安装,测试结束后将保持安装状态" - INSTALLED=1 - else - LOG_INFO "软件包未安装,将在测试过程中安装" - INSTALLED=0 - fi - - # 检查yum源中是否存在texlive-tex4ht-htxetex-upper软件包 - LOG_INFO "检查yum源中是否存在texlive-tex4ht-htxetex-upper软件包" - if ! dnf list available texlive-tex4ht-htxetex-upper &>/dev/null; then - LOG_ERROR "yum源中未找到texlive-tex4ht-htxetex-upper软件包" - exit 255 - fi - - # 如果未安装,则安装软件包 - if [ $INSTALLED -eq 0 ]; then - LOG_INFO "安装texlive-tex4ht-htxetex-upper软件包" - dnf install -y texlive-tex4ht-htxetex-upper - CHECK_RESULT $? 0 0 "安装texlive-tex4ht-htxetex-upper失败" - fi - - # 测试htxetex命令的-T参数是否支持 - LOG_INFO "测试htxetex命令的-T参数是否支持" - htxetex --help | grep -q "\-T" - CHECK_RESULT $? 0 0 "htxetex命令不支持-T参数" - - # 验证-T参数可以指定输出类型 - LOG_INFO "验证-T参数可以指定输出类型" - # 创建一个简单的测试tex文件 - cat > test.tex << "EOF" - \documentclass{article} - \begin{document} - Hello, World! - \end{document} - EOF - - # 使用htxetex命令将tex文件转换为html,指定输出类型为html - LOG_INFO "使用htxetex命令将tex文件转换为html,指定输出类型为html" - htxetex -T html test.tex - CHECK_RESULT $? 0 0 "htxetex命令执行失败" - - # 检查是否生成了html文件 - LOG_INFO "检查是否生成了html文件" - ls test.html &>/dev/null - CHECK_RESULT $? 0 0 "未生成html文件" - - # 清理测试文件 - LOG_INFO "清理测试文件" - rm -f test.tex test.html test.css test*.png - - # 如果测试前未安装软件包,则在测试结束后卸载 - if [ $INSTALLED -eq 0 ]; then - LOG_INFO "卸载texlive-tex4ht-htxetex-upper软件包" - dnf remove -y texlive-tex4ht-htxetex-upper - CHECK_RESULT $? 0 0 "卸载texlive-tex4ht-htxetex-upper失败" - fi - - LOG_INFO "测试完成" -} - -main "$@" \ No newline at end of file diff --git a/testcases/function_test/pkg_test/texlive-base/texlive-tex4ht/test_texlive-tex4ht_htxetex_upper_u.sh b/testcases/function_test/pkg_test/texlive-base/texlive-tex4ht/test_texlive-tex4ht_htxetex_upper_u.sh deleted file mode 100644 index 88cb28846db..00000000000 --- a/testcases/function_test/pkg_test/texlive-base/texlive-tex4ht/test_texlive-tex4ht_htxetex_upper_u.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-02 -# @License : Mulan PSL v2 -# @Desc : 测试 htxetex 命令的 -U 参数,验证是否使用Unicode编码 -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - LOG_INFO "开始测试 htxetex 命令的 -U 参数,验证是否使用Unicode编码" - - # 检查 yum 源中是否存在 texlive-tex4ht 软件包 - LOG_INFO "检查 yum 源中是否存在 texlive-tex4ht 软件包" - dnf list available texlive-tex4ht 2>/dev/null | grep -q texlive-tex4ht - if [ $? -ne 0 ]; then - LOG_ERROR "yum 源中不存在 texlive-tex4ht 软件包" - exit 255 - fi - - # 检查系统是否已安装 texlive-tex4ht - LOG_INFO "检查系统是否已安装 texlive-tex4ht" - if rpm -q texlive-tex4ht >/dev/null 2>&1; then - LOG_INFO "texlive-tex4ht 已安装,测试后保持安装状态" - INSTALLED_BEFORE=true - else - LOG_INFO "texlive-tex4ht 未安装,将在测试前安装" - INSTALLED_BEFORE=false - fi - - # 如果未安装,则安装软件包 - if [ "$INSTALLED_BEFORE" = false ]; then - LOG_INFO "安装 texlive-tex4ht 软件包" - dnf install -y texlive-tex4ht - CHECK_RESULT $? 0 0 "安装 texlive-tex4ht 失败" - fi - - # 检查 htxetex 命令是否支持 -U 参数 - LOG_INFO "检查 htxetex 命令是否支持 -U 参数" - htxetex -h 2>&1 | grep -q -- "-U" - if [ $? -ne 0 ]; then - LOG_ERROR "htxetex 命令不支持 -U 参数" - # 如果之前未安装,则卸载软件包 - if [ "$INSTALLED_BEFORE" = false ]; then - dnf remove -y texlive-tex4ht - fi - exit 255 - fi - - # 创建一个简单的测试文件 - LOG_INFO "创建测试文件 test.tex" - cat > test.tex << "EOF" - \documentclass{article} - \begin{document} - Hello, World! - \end{document} - EOF - - # 使用 htxetex 命令的 -U 参数处理测试文件 - LOG_INFO "使用 htxetex 命令的 -U 参数处理测试文件" - htxetex -U test.tex - CHECK_RESULT $? 0 0 "htxetex 命令执行失败" - - # 检查生成的 HTML 文件是否包含 Unicode 编码 - LOG_INFO "检查生成的 HTML 文件是否包含 Unicode 编码" - if [ -f test.html ]; then - grep -q "charset=utf-8" test.html || grep -q "charset=UTF-8" test.html - CHECK_RESULT $? 0 0 "生成的 HTML 文件未使用 Unicode 编码" - else - LOG_ERROR "未生成 test.html 文件" - CHECK_RESULT 1 0 0 "未生成 test.html 文件" - fi - - # 清理测试文件 - LOG_INFO "清理测试文件" - rm -f test.tex test.html test.css test*.png test*.idv test*.lg test*.log test*.tmp test*.xref test*.4ct test*.4tc test*.dvi - - # 如果之前未安装,则卸载软件包 - if [ "$INSTALLED_BEFORE" = false ]; then - LOG_INFO "卸载 texlive-tex4ht 软件包" - dnf remove -y texlive-tex4ht - CHECK_RESULT $? 0 0 "卸载 texlive-tex4ht 失败" - fi - - LOG_INFO "测试完成" -} - -main "$@" \ No newline at end of file diff --git a/testcases/function_test/pkg_test/texlive-base/texlive-tex4ht/test_texlive-tex4ht_htxetex_upper_v.sh b/testcases/function_test/pkg_test/texlive-base/texlive-tex4ht/test_texlive-tex4ht_htxetex_upper_v.sh deleted file mode 100644 index 87615fce84e..00000000000 --- a/testcases/function_test/pkg_test/texlive-base/texlive-tex4ht/test_texlive-tex4ht_htxetex_upper_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 : 测试 htxetex 命令的 -V 参数 -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - - # 检查yum源中是否存在texlive-tex4ht软件包 - LOG_INFO "检查yum源中是否存在texlive-tex4ht软件包" - dnf list available texlive-tex4ht > /dev/null 2>&1 - if [ $? -ne 0 ]; then - LOG_ERROR "yum源中不存在texlive-tex4ht软件包" - exit 255 - fi - - # 检查是否已安装texlive-tex4ht软件包 - LOG_INFO "检查是否已安装texlive-tex4ht软件包" - rpm -q texlive-tex4ht > /dev/null 2>&1 - installed=$? - - # 如果未安装,则安装软件包 - if [ $installed -ne 0 ]; then - LOG_INFO "安装texlive-tex4ht软件包" - dnf install -y texlive-tex4ht - CHECK_RESULT $? 0 0 "安装texlive-tex4ht失败" - fi - - # 测试htxetex命令的-V参数 - LOG_INFO "测试htxetex命令的-V参数" - htxetex -V > /dev/null 2>&1 - CHECK_RESULT $? 0 0 "htxetex命令不支持-V参数" - - # 恢复环境 - if [ $installed -ne 0 ]; then - LOG_INFO "卸载texlive-tex4ht软件包" - dnf remove -y texlive-tex4ht - CHECK_RESULT $? 0 0 "卸载texlive-tex4ht失败" - fi - - LOG_INFO "测试完成" - -} - -main "$@" \ No newline at end of file diff --git a/testcases/function_test/pkg_test/texlive-base/texlive-tex4ht/test_texlive-tex4ht_htxetex_upper_w.sh b/testcases/function_test/pkg_test/texlive-base/texlive-tex4ht/test_texlive-tex4ht_htxetex_upper_w.sh deleted file mode 100644 index bffc0074240..00000000000 --- a/testcases/function_test/pkg_test/texlive-base/texlive-tex4ht/test_texlive-tex4ht_htxetex_upper_w.sh +++ /dev/null @@ -1,83 +0,0 @@ -#!/usr/bin/bash - -# Copyright (c) 2024 ISCAS .ALL rights reserved. -# This program is licensed under Mulan PSL v2. -# You can use it according to the terms and conditions of the Mulan PSL v2. -# http://license.coscl.org.cn/MulanPSL2 -# THIS PROGRAM IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, -# EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, -# MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. -# See the Mulan PSL v2 for more details. - -# ############################################# -# @Author : honghua -# @Contact : honghua@iscas.ac.cn -# @Date : 2026-03-02 -# @License : Mulan PSL v2 -# @Desc : 测试 htxetex 命令的 -W 参数,验证是否显示警告信息 -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - LOG_INFO "开始测试 htxetex 命令的 -W 参数,验证是否显示警告信息" - - LOG_INFO "步骤1:检查 yum 源中是否存在 texlive-tex4ht 软件包" - dnf list texlive-tex4ht > /dev/null 2>&1 - if [ $? -ne 0 ]; then - LOG_ERROR "yum 源中未找到 texlive-tex4ht 软件包" - exit 255 - fi - - LOG_INFO "步骤2:检查是否已安装 texlive-tex4ht" - rpm -q texlive-tex4ht > /dev/null 2>&1 - if [ $? -eq 0 ]; then - LOG_INFO "texlive-tex4ht 已安装,测试完成后保持安装状态" - INSTALLED=1 - else - LOG_INFO "texlive-tex4ht 未安装,将进行安装和卸载" - INSTALLED=0 - LOG_INFO "步骤3:安装 texlive-tex4ht 软件包" - dnf install -y texlive-tex4ht - CHECK_RESULT $? 0 0 "安装 texlive-tex4ht 失败" - fi - - LOG_INFO "步骤4:检查 htxetex 命令是否存在" - which htxetex > /dev/null 2>&1 - if [ $? -ne 0 ]; then - LOG_ERROR "htxetex 命令不存在" - if [ $INSTALLED -eq 0 ]; then - LOG_INFO "清理环境:卸载 texlive-tex4ht" - dnf remove -y texlive-tex4ht - fi - exit 255 - fi - - LOG_INFO "步骤5:检查 htxetex 命令是否支持 -W 参数" - htxetex --help 2>&1 | grep -q "\-W" - if [ $? -ne 0 ]; then - LOG_ERROR "htxetex 命令不支持 -W 参数" - if [ $INSTALLED -eq 0 ]; then - LOG_INFO "清理环境:卸载 texlive-tex4ht" - dnf remove -y texlive-tex4ht - fi - exit 255 - fi - - LOG_INFO "步骤6:执行 htxetex -W 命令,验证是否显示警告信息" - htxetex -W 2>&1 | grep -q "warning\|警告" - CHECK_RESULT $? 0 0 "htxetex -W 未显示警告信息" - - LOG_INFO "步骤7:清理环境" - if [ $INSTALLED -eq 0 ]; then - LOG_INFO "卸载 texlive-tex4ht 软件包" - dnf remove -y texlive-tex4ht - CHECK_RESULT $? 0 0 "卸载 texlive-tex4ht 失败" - else - LOG_INFO "保持 texlive-tex4ht 安装状态" - fi - - LOG_INFO "测试完成" -} - -main "$@" \ No newline at end of file diff --git a/testcases/function_test/pkg_test/texlive-base/texlive-tex4ht/test_texlive-tex4ht_htxetex_upper_x.sh b/testcases/function_test/pkg_test/texlive-base/texlive-tex4ht/test_texlive-tex4ht_htxetex_upper_x.sh deleted file mode 100644 index 6bb50e426a7..00000000000 --- a/testcases/function_test/pkg_test/texlive-base/texlive-tex4ht/test_texlive-tex4ht_htxetex_upper_x.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-02 -# @License : Mulan PSL v2 -# @Desc : 测试 htxetex 命令的 -X 参数,验证是否使用扩展功能 -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - # 判断环境是否已安装texlive-tex4ht软件包 - LOG_INFO "检查是否已安装texlive-tex4ht软件包" - rpm -q texlive-tex4ht > /dev/null 2>&1 - if [ $? -eq 0 ]; then - LOG_INFO "texlive-tex4ht软件包已安装,脚本结束后将保持安装状态" - installed_flag=1 - else - LOG_INFO "texlive-tex4ht软件包未安装,将在测试后卸载" - installed_flag=0 - fi - - # 检查yum源中是否存在texlive-tex4ht软件包 - LOG_INFO "检查yum源中是否存在texlive-tex4ht软件包" - dnf list available texlive-tex4ht > /dev/null 2>&1 - if [ $? -ne 0 ]; then - LOG_ERROR "yum源中未找到texlive-tex4ht软件包" - exit 255 - fi - - # 如果未安装,则安装软件包 - if [ $installed_flag -eq 0 ]; then - LOG_INFO "安装texlive-tex4ht软件包" - dnf install -y texlive-tex4ht - CHECK_RESULT $? 0 0 "安装texlive-tex4ht软件包失败" - fi - - # 检查htxetex命令是否存在 - LOG_INFO "检查htxetex命令是否存在" - which htxetex > /dev/null 2>&1 - if [ $? -ne 0 ]; then - LOG_ERROR "未找到htxetex命令" - if [ $installed_flag -eq 0 ]; then - LOG_INFO "卸载texlive-tex4ht软件包" - dnf remove -y texlive-tex4ht - fi - exit 1 - fi - - # 测试htxetex命令的-X参数 - LOG_INFO "测试htxetex命令的-X参数" - htxetex -X --help > /dev/null 2>&1 - if [ $? -eq 255 ]; then - LOG_ERROR "htxetex命令不支持-X参数" - if [ $installed_flag -eq 0 ]; then - LOG_INFO "卸载texlive-tex4ht软件包" - dnf remove -y texlive-tex4ht - fi - exit 255 - fi - - # 创建一个简单的测试文件 - LOG_INFO "创建一个简单的测试文件" - cat > test.tex << "EOF" - \documentclass{article} - \begin{document} - Hello, World! - \end{document} - EOF - CHECK_RESULT $? 0 0 "创建测试文件失败" - - # 使用htxetex命令的-X参数处理测试文件 - LOG_INFO "使用htxetex命令的-X参数处理测试文件" - htxetex -X test.tex > /dev/null 2>&1 - CHECK_RESULT $? 0 0 "htxetex命令-X参数执行失败" - - # 检查是否生成了输出文件 - LOG_INFO "检查是否生成了输出文件" - if [ -f test.html ]; then - LOG_INFO "成功生成了test.html文件,验证了-X参数使用扩展功能" - else - LOG_ERROR "未生成test.html文件,-X参数可能未正常工作" - CHECK_RESULT 1 0 0 "未生成输出文件" - fi - - # 清理测试文件 - LOG_INFO "清理测试文件" - rm -f test.tex test.html test.css test*.png test*.svg test*.idv test*.lg test*.log test*.tmp test*.xref test*.4ct test*.4tc test*.dvi test*.aux test*.out > /dev/null 2>&1 - - # 如果脚本开始时未安装,则卸载软件包 - if [ $installed_flag -eq 0 ]; then - LOG_INFO "卸载texlive-tex4ht软件包" - dnf remove -y texlive-tex4ht - CHECK_RESULT $? 0 0 "卸载texlive-tex4ht软件包失败" - fi - - LOG_INFO "测试完成" -} - -main "$@" \ No newline at end of file diff --git a/testcases/function_test/pkg_test/texlive-base/texlive-tex4ht/test_texlive-tex4ht_htxetex_upper_y.sh b/testcases/function_test/pkg_test/texlive-base/texlive-tex4ht/test_texlive-tex4ht_htxetex_upper_y.sh deleted file mode 100644 index 35336057098..00000000000 --- a/testcases/function_test/pkg_test/texlive-base/texlive-tex4ht/test_texlive-tex4ht_htxetex_upper_y.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-02 -# @License : Mulan PSL v2 -# @Desc : 测试 htxetex 命令的 -Y 参数,验证是否使用特定年份 -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - # 检查软件包是否可用 - LOG_INFO "检查yum源中是否存在texlive-tex4ht软件包" - dnf list available texlive-tex4ht 2>/dev/null | grep -q texlive-tex4ht - if [ $? -ne 0 ]; then - LOG_ERROR "texlive-tex4ht软件包在yum源中不存在" - exit 255 - fi - - # 检查环境是否已安装 - LOG_INFO "检查是否已安装texlive-tex4ht软件包" - rpm -q texlive-tex4ht >/dev/null 2>&1 - installed=$? - - # 如果未安装,则安装软件包 - if [ $installed -ne 0 ]; then - LOG_INFO "安装texlive-tex4ht软件包" - dnf install -y texlive-tex4ht - CHECK_RESULT $? 0 0 "安装texlive-tex4ht失败" - fi - - # 检查htxetex命令是否存在 - LOG_INFO "检查htxetex命令是否存在" - which htxetex >/dev/null 2>&1 - if [ $? -ne 0 ]; then - LOG_ERROR "htxetex命令不存在" - # 如果是本次安装的,需要卸载 - if [ $installed -ne 0 ]; then - dnf remove -y texlive-tex4ht - fi - exit 255 - fi - - # 检查-Y参数是否支持 - LOG_INFO "检查htxetex命令是否支持-Y参数" - htxetex --help 2>&1 | grep -q -- "-Y" - if [ $? -ne 0 ]; then - LOG_ERROR "htxetex命令不支持-Y参数" - # 如果是本次安装的,需要卸载 - if [ $installed -ne 0 ]; then - dnf remove -y texlive-tex4ht - fi - exit 255 - fi - - # 测试htxetex命令的-Y参数 - LOG_INFO "测试htxetex命令的-Y参数,验证是否使用特定年份" - echo "\documentclass{article}\begin{document}test\end{document}" > test.tex - htxetex -Y 2023 test.tex - CHECK_RESULT $? 0 0 "htxetex命令-Y参数测试失败" - - # 清理测试文件 - LOG_INFO "清理测试文件" - rm -f test.tex test.html test.css test*.png test*.svg test*.idv test*.lg test*.log test*.tmp test*.xref - - # 如果脚本开始时未安装,则卸载软件包 - if [ $installed -ne 0 ]; then - LOG_INFO "卸载texlive-tex4ht软件包" - dnf remove -y texlive-tex4ht - CHECK_RESULT $? 0 0 "卸载texlive-tex4ht失败" - else - LOG_INFO "保持texlive-tex4ht软件包安装状态" - fi - - LOG_INFO "测试完成" -} - -main "$@" \ No newline at end of file diff --git a/testcases/function_test/pkg_test/texlive-base/texlive-tex4ht/test_texlive-tex4ht_htxetex_upper_z.sh b/testcases/function_test/pkg_test/texlive-base/texlive-tex4ht/test_texlive-tex4ht_htxetex_upper_z.sh deleted file mode 100644 index d4864ab1c15..00000000000 --- a/testcases/function_test/pkg_test/texlive-base/texlive-tex4ht/test_texlive-tex4ht_htxetex_upper_z.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-02 -# @License : Mulan PSL v2 -# @Desc : 测试 htxetex 命令的 -Z 参数,验证是否压缩输出 -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - # 环境检查:检查是否已安装texlive-tex4ht - LOG_INFO "检查是否已安装texlive-tex4ht" - rpm -q texlive-tex4ht > /dev/null 2>&1 - if [ $? -eq 0 ]; then - LOG_INFO "texlive-tex4ht已安装,测试结束后保持安装状态" - INSTALLED_BEFORE=1 - else - LOG_INFO "texlive-tex4ht未安装,将在测试前安装并在测试后卸载" - INSTALLED_BEFORE=0 - fi - - # 检查yum源中是否有texlive-tex4ht软件包 - LOG_INFO "检查yum源中是否有texlive-tex4ht软件包" - dnf list available texlive-tex4ht > /dev/null 2>&1 - if [ $? -ne 0 ]; then - LOG_ERROR "yum源中未找到texlive-tex4ht软件包" - exit 255 - fi - - # 如果未安装,则安装软件包 - if [ $INSTALLED_BEFORE -eq 0 ]; then - LOG_INFO "安装texlive-tex4ht软件包" - dnf install -y texlive-tex4ht - CHECK_RESULT $? 0 0 "安装texlive-tex4ht失败" - fi - - # 检查htxetex命令是否存在 - LOG_INFO "检查htxetex命令是否存在" - which htxetex > /dev/null 2>&1 - if [ $? -ne 0 ]; then - LOG_ERROR "htxetex命令不存在" - exit 255 - fi - - # 检查htxetex命令是否支持-Z参数 - LOG_INFO "检查htxetex命令是否支持-Z参数" - htxetex --help 2>&1 | grep -q "\-Z" - if [ $? -ne 0 ]; then - LOG_ERROR "htxetex命令不支持-Z参数" - 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文件失败" - - # 使用htxetex命令的-Z参数压缩输出 - LOG_INFO "使用htxetex命令的-Z参数压缩输出" - htxetex -Z test.tex - CHECK_RESULT $? 0 0 "htxetex -Z 命令执行失败" - - # 验证是否生成了压缩输出文件 - LOG_INFO "验证是否生成了压缩输出文件" - if [ -f test.tex.gz ]; then - LOG_INFO "成功生成压缩文件 test.tex.gz" - # 检查压缩文件是否有效 - gunzip -t test.tex.gz - CHECK_RESULT $? 0 0 "生成的压缩文件无效" - else - LOG_ERROR "未生成压缩文件 test.tex.gz" - exit 1 - fi - - # 清理测试文件 - LOG_INFO "清理测试文件" - rm -f test.tex test.tex.gz - CHECK_RESULT $? 0 0 "清理测试文件失败" - - # 如果测试前未安装,则卸载软件包 - if [ $INSTALLED_BEFORE -eq 0 ]; then - LOG_INFO "卸载texlive-tex4ht软件包" - dnf remove -y texlive-tex4ht - CHECK_RESULT $? 0 0 "卸载texlive-tex4ht失败" - fi - - LOG_INFO "测试完成" -} - -main "$@" \ No newline at end of file diff --git a/testcases/function_test/pkg_test/texlive-base/texlive-tex4ht/test_texlive-tex4ht_htxetex_v.sh b/testcases/function_test/pkg_test/texlive-base/texlive-tex4ht/test_texlive-tex4ht_htxetex_v.sh deleted file mode 100644 index 93bde99ecdd..00000000000 --- a/testcases/function_test/pkg_test/texlive-base/texlive-tex4ht/test_texlive-tex4ht_htxetex_v.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-27 -# @License : Mulan PSL v2 -# @Desc : 测试 htxetex 命令的 -v 参数 -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - LOG_INFO "开始测试 htxetex 命令的 -v 参数" - - # 检查是否已安装 texlive-tex4ht-htxetex 软件包 - LOG_INFO "检查 texlive-tex4ht-htxetex 是否已安装" - if dnf list installed texlive-tex4ht-htxetex &>/dev/null; then - LOG_INFO "texlive-tex4ht-htxetex 已安装,测试结束后保持安装状态" - INSTALLED=true - else - LOG_INFO "texlive-tex4ht-htxetex 未安装,将在测试结束后卸载" - INSTALLED=false - fi - - # 检查 yum 源中是否有该软件包 - LOG_INFO "检查 yum 源中是否存在 texlive-tex4ht-htxetex" - if ! dnf list available texlive-tex4ht-htxetex &>/dev/null; then - LOG_ERROR "yum 源中不存在 texlive-tex4ht-htxetex 软件包" - exit 255 - fi - - # 如果未安装,则安装软件包 - if [ "$INSTALLED" = false ]; then - LOG_INFO "安装 texlive-tex4ht-htxetex" - dnf install -y texlive-tex4ht-htxetex - CHECK_RESULT $? 0 0 "安装 texlive-tex4ht-htxetex 失败" - fi - - # 测试 htxetex 命令的 -v 参数 - LOG_INFO "测试 htxetex 命令的 -v 参数" - htxetex -v - CHECK_RESULT $? 0 0 "执行 htxetex -v 失败" - - #如果未安装,则卸载软件包 - if [ "$INSTALLED" = false ]; then - LOG_INFO "卸载 texlive-tex4ht-htxetex" - dnf remove -y texlive-tex4ht-htxetex - CHECK_RESULT $? 0 0 "卸载 texlive-tex4ht- -} - -main "$@" \ No newline at end of file diff --git a/testcases/function_test/pkg_test/texlive-base/texlive-tex4ht/test_texlive-tex4ht_htxetex_version.sh b/testcases/function_test/pkg_test/texlive-base/texlive-tex4ht/test_texlive-tex4ht_htxetex_version.sh deleted file mode 100644 index d51a8db98b5..00000000000 --- a/testcases/function_test/pkg_test/texlive-base/texlive-tex4ht/test_texlive-tex4ht_htxetex_version.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-02 -# @License : Mulan PSL v2 -# @Desc : 测试 htxetex 命令的 --version 参数,验证是否显示版本信息 -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - # 检查htxetex命令是否已安装 - LOG_INFO "检查htxetex命令是否已安装" - if command -v htxetex &> /dev/null; then - LOG_INFO "htxetex命令已安装,测试完成后将保持安装状态" - INSTALLED=true - else - LOG_INFO "htxetex命令未安装,将在测试过程中安装" - INSTALLED=false - fi - - # 检查yum源中是否存在texlive-tex4ht软件包 - LOG_INFO "检查yum源中是否存在texlive-tex4ht软件包" - if ! dnf list available texlive-tex4ht &> /dev/null; then - LOG_ERROR "yum源中未找到texlive-tex4ht软件包" - exit 255 - fi - - # 如果未安装,则安装texlive-tex4ht软件包 - if [ "$INSTALLED" = false ]; then - LOG_INFO "安装texlive-tex4ht软件包" - dnf install -y texlive-tex4ht - CHECK_RESULT $? 0 0 "安装texlive-tex4ht软件包失败" - fi - - # 检查htxetex命令是否支持--version参数 - LOG_INFO "检查htxetex命令是否支持--version参数" - if ! htxetex --help 2>&1 | grep -q "\-\-version"; then - LOG_ERROR "htxetex命令不支持--version参数" - exit 255 - fi - - # 执行htxetex --version命令 - LOG_INFO "执行htxetex --version命令" - htxetex --version - CHECK_RESULT $? 0 0 "执行htxetex --version命令失败" - - # 验证版本信息是否显示 - LOG_INFO "验证htxetex --version命令是否显示版本信息" - VERSION_OUTPUT=$(htxetex --version 2>&1) - if [ -n "$VERSION_OUTPUT" ]; then - LOG_INFO "htxetex版本信息显示正常" - else - LOG_ERROR "htxetex版本信息未显示" - exit 1 - fi - - # 环境恢复:如果测试前未安装,则卸载软件包 - if [ "$INSTALLED" = false ]; then - LOG_INFO "卸载texlive-tex4ht软件包" - dnf remove -y texlive-tex4ht - CHECK_RESULT $? 0 0 "卸载texlive-tex4ht软件包失败" - LOG_INFO "环境已恢复,texlive-tex4ht软件包已卸载" - else - LOG_INFO "环境已恢复,保持texlive-tex4ht软件包安装状态" - fi -} - -main "$@" \ No newline at end of file diff --git a/testcases/function_test/pkg_test/texlive-base/texlive-tex4ht/test_texlive-tex4ht_mk4ht_dblatex.sh b/testcases/function_test/pkg_test/texlive-base/texlive-tex4ht/test_texlive-tex4ht_mk4ht_dblatex.sh deleted file mode 100644 index 004b1405bf9..00000000000 --- a/testcases/function_test/pkg_test/texlive-base/texlive-tex4ht/test_texlive-tex4ht_mk4ht_dblatex.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 : 测试使用 dblatex 命令生成 HTML 文件 -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - - # 检查是否已安装texlive-tex4ht和dblatex - LOG_INFO "检查是否已安装texlive-tex4ht和dblatex" - if rpm -q texlive-tex4ht dblatex >/dev/null 2>&1; then - LOG_INFO "texlive-tex4ht和dblatex已安装" - INSTALLED=true - else - LOG_INFO "texlive-tex4ht和dblatex未安装" - INSTALLED=false - fi - - # 检查yum源中是否有texlive-tex4ht和dblatex软件包 - LOG_INFO "检查yum源中是否有texlive-tex4ht和dblatex软件包" - if ! dnf list available texlive-tex4ht dblatex >/dev/null 2>&1; then - LOG_ERROR "yum源中缺少texlive-tex4ht或dblatex软件包" - exit 255 - fi - - # 如果未安装,则安装软件包 - if [ "$INSTALLED" = false ]; then - LOG_INFO "开始安装texlive-tex4ht和dblatex" - dnf install -y texlive-tex4ht dblatex - CHECK_RESULT $? 0 0 "安装失败" - fi - - # 测试使用dblatex命令生成HTML文件 - LOG_INFO "测试使用dblatex命令生成HTML文件" - echo "\documentclass{article}\begin{document}Test\end{document}" > test.tex - dblatex test.tex -t html -o test.html - CHECK_RESULT $? 0 0 "生成HTML文件失败" - - # 清理测试文件 - LOG_INFO "清理测试文件" - rm -f test.tex test.html - - # 如果之前未安装,则卸载软件包 - if [ "$INSTALLED" = false ]; then - LOG_INFO "卸载texlive-tex4ht和dblatex" - dnf remove -y texlive-tex4ht dblatex - 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-tex4ht/test_texlive-tex4ht_mk4ht_dbmlatex.sh b/testcases/function_test/pkg_test/texlive-base/texlive-tex4ht/test_texlive-tex4ht_mk4ht_dbmlatex.sh deleted file mode 100644 index 0a9c25e48a0..00000000000 --- a/testcases/function_test/pkg_test/texlive-base/texlive-tex4ht/test_texlive-tex4ht_mk4ht_dbmlatex.sh +++ /dev/null @@ -1,71 +0,0 @@ -#!/usr/bin/bash - -# Copyright (c) 2024 ISCAS .ALL rights reserved. -# This program is licensed under Mulan PSL v2. -# You can use it according to the terms and conditions of the Mulan PSL v2. -# http://license.coscl.org.cn/MulanPSL2 -# THIS PROGRAM IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, -# EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, -# MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. -# See the Mulan PSL v2 for more details. - -# ############################################# -# @Author : honghua -# @Contact : honghua@iscas.ac.cn -# @Date : 2025-11-27 -# @License : Mulan PSL v2 -# @Desc : 测试使用 dbmlatex 命令生成 HTML 文件 -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - - # 检查是否已安装texlive-tex4ht和mk4ht包 - LOG_INFO "检查是否已安装texlive-tex4ht和mk4ht包" - dnf list installed texlive-tex4ht mk4ht > /dev/null 2>&1 - if [ $? -eq 0 ]; then - LOG_INFO "环境已安装,脚本结束时保持安装状态" - INSTALLED=true - else - LOG_INFO "环境未安装,将在测试结束后卸载软件包" - INSTALLED=false - fi - - # 检查yum源中是否有texlive-tex4ht和mk4ht包 - LOG_INFO "检查yum源中是否有texlive-tex4ht和mk4ht包" - dnf list available texlive-tex4ht mk4ht > /dev/null 2>&1 - if [ $? -ne 0 ]; then - LOG_ERROR "yum源中缺少texlive-tex4ht或mk4ht包" - exit 255 - fi - - # 安装软件包 - if [ "$INSTALLED" = false ]; then - LOG_INFO "安装texlive-tex4ht和mk4ht包" - dnf install -y texlive-tex4ht mk4ht - CHECK_RESULT $? 0 0 "安装软件包失败" - fi - - # 测试dbmlatex命令生成HTML文件 - LOG_INFO "测试使用dbmlatex命令生成HTML文件" - echo "\documentclass{article}\begin{document}Hello, world!\end{document}" > test.tex - dbmlatex test.tex - CHECK_RESULT $? 0 0 "dbmlatex命令执行失败" - - # 清理生成的临时文件 - LOG_INFO "清理生成的临时文件" - rm -f test.tex test.html test.css test*.png - - # 如果脚本开始时未安装软件包,则在结束时卸载 - if [ "$INSTALLED" = false ]; then - LOG_INFO "卸载texlive-tex4ht和mk4ht包" - dnf remove -y texlive-tex4ht mk4ht - 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-tex4ht/test_texlive-tex4ht_mk4ht_eslatex.sh b/testcases/function_test/pkg_test/texlive-base/texlive-tex4ht/test_texlive-tex4ht_mk4ht_eslatex.sh deleted file mode 100644 index 50ca351dc95..00000000000 --- a/testcases/function_test/pkg_test/texlive-base/texlive-tex4ht/test_texlive-tex4ht_mk4ht_eslatex.sh +++ /dev/null @@ -1,77 +0,0 @@ -#!/usr/bin/bash - -# Copyright (c) 2024 ISCAS .ALL rights reserved. -# This program is licensed under Mulan PSL v2. -# You can use it according to the terms and conditions of the Mulan PSL v2. -# http://license.coscl.org.cn/MulanPSL2 -# THIS PROGRAM IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, -# EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, -# MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. -# See the Mulan PSL v2 for more details. - -# ############################################# -# @Author : honghua -# @Contact : honghua@iscas.ac.cn -# @Date : 2025-11-27 -# @License : Mulan PSL v2 -# @Desc : 测试使用 eslatex 命令生成 HTML 文件 -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - LOG_INFO "开始测试:测试使用 eslatex 命令生成 HTML 文件" - - # 检查是否已安装 texlive-tex4ht - LOG_INFO "检查是否已安装 texlive-tex4ht" - if ! dnf list installed texlive-tex4ht &>/dev/null; then - LOG_INFO "texlive-tex4ht 未安装,将进行安装" - INSTALLED=false - else - LOG_INFO "texlive-tex4ht 已安装" - INSTALLED=true - fi - - # 检查 yum 源中是否有 texlive-tex4ht - LOG_INFO "检查 yum 源中是否有 texlive-tex4ht" - if ! dnf list available texlive-tex4ht &>/dev/null; then - LOG_ERROR "yum 源中未找到 texlive-tex4ht" - exit 255 - fi - - # 如果未安装,则安装 texlive-tex4ht - if [ "$INSTALLED" = false ]; then - LOG_INFO "安装 texlive-tex4ht" - dnf install -y texlive-tex4ht - CHECK_RESULT $? 0 0 "安装 texlive-tex4ht 失败" - fi - - # 检查 eslatex 命令是否存在 - LOG_INFO "检查 eslatex 命令是否存在" - if ! command -v eslatex &>/dev/null; then - LOG_ERROR "eslatex 命令不存在" - exit 255 - fi - - # 测试 eslatex 命令生成 HTML 文件 - LOG_INFO "测试 eslatex 命令生成 HTML 文件" - TEST_FILE="test.tex" - echo "\documentclass{article}\begin{document}Test\end{document}" > "$TEST_FILE" - eslatex "$TEST_FILE" - CHECK_RESULT $? 0 0 "eslatex 命令执行失败" - - # 清理生成的临时文件 - LOG_INFO "清理临时文件" - rm -f "$TEST_FILE" "${TEST_FILE%.tex}.html" "${TEST_FILE%.tex}.log" "${TEST_FILE%.tex}.aux" - - # 如果脚本开始时未安装,则卸载 texlive-tex4ht - if [ "$INSTALLED" = false ]; then - LOG_INFO "卸载 texlive-tex4ht" - dnf remove -y texlive-tex4ht - CHECK_RESULT $? 0 0 "卸载 texlive-tex4ht 失败" - fi - - LOG_INFO "测试完成" -} - -main "$@" \ No newline at end of file diff --git a/testcases/function_test/pkg_test/texlive-base/texlive-tex4ht/test_texlive-tex4ht_mk4ht_ht.sh b/testcases/function_test/pkg_test/texlive-base/texlive-tex4ht/test_texlive-tex4ht_mk4ht_ht.sh deleted file mode 100644 index de0440aa40b..00000000000 --- a/testcases/function_test/pkg_test/texlive-base/texlive-tex4ht/test_texlive-tex4ht_mk4ht_ht.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-02 -# @License : Mulan PSL v2 -# @Desc : 使用 mk4ht ht 格式,指定 latex 引擎处理 .tex 文件 -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - # 检查是否已安装texlive-tex4ht - LOG_INFO "检查是否已安装texlive-tex4ht" - if dnf list installed texlive-tex4ht &> /dev/null; then - LOG_INFO "texlive-tex4ht已安装,脚本结束时将保持安装状态" - INSTALLED=true - else - LOG_INFO "texlive-tex4ht未安装,将在测试后卸载" - INSTALLED=false - fi - - # 检查yum源中是否有texlive-tex4ht软件包 - LOG_INFO "检查yum源中是否有texlive-tex4ht软件包" - if ! dnf list available texlive-tex4ht &> /dev/null; then - LOG_ERROR "yum源中未找到texlive-tex4ht软件包" - exit 255 - fi - - # 如果未安装,则安装texlive-tex4ht - if [ "$INSTALLED" = false ]; then - LOG_INFO "安装texlive-tex4ht" - dnf install -y texlive-tex4ht - CHECK_RESULT $? 0 0 "安装texlive-tex4ht失败" - fi - - # 检查mk4ht命令是否存在 - LOG_INFO "检查mk4ht命令是否存在" - command -v mk4ht &> /dev/null - CHECK_RESULT $? 0 0 "mk4ht命令不存在" - - # 检查mk4ht是否支持ht格式 - LOG_INFO "检查mk4ht是否支持ht格式" - if ! mk4ht --help 2>&1 | grep -q "ht"; then - LOG_ERROR "mk4ht不支持ht格式" - exit 255 - fi - - # 创建测试用的.tex文件 - LOG_INFO "创建测试用的.tex文件" - cat > test.tex << "EOF" - \documentclass{article} - \begin{document} - Hello, World! - \end{document} - EOF - CHECK_RESULT $? 0 0 "创建test.tex文件失败" - - # 使用mk4ht ht格式,指定latex引擎处理.tex文件 - LOG_INFO "使用mk4ht ht格式,指定latex引擎处理.tex文件" - mk4ht htlatex test.tex "html" - CHECK_RESULT $? 0 0 "mk4ht htlatex命令执行失败" - - # 检查生成的HTML文件 - LOG_INFO "检查生成的HTML文件" - if [ -f "test.html" ]; then - LOG_INFO "成功生成test.html文件" - else - LOG_ERROR "未生成test.html文件" - exit 1 - fi - - # 清理测试文件 - LOG_INFO "清理测试文件" - rm -f test.tex test.html test.css test*.png test*.svg test*.tmp - CHECK_RESULT $? 0 0 "清理测试文件失败" - - # 如果测试前未安装,则卸载texlive-tex4ht - if [ "$INSTALLED" = false ]; then - LOG_INFO "卸载texlive-tex4ht" - dnf remove -y texlive-tex4ht - CHECK_RESULT $? 0 0 "卸载texlive-tex4ht失败" - fi -} - -main "$@" \ No newline at end of file diff --git a/testcases/function_test/pkg_test/texlive-base/texlive-tex4ht/test_texlive-tex4ht_mk4ht_htlatex.sh b/testcases/function_test/pkg_test/texlive-base/texlive-tex4ht/test_texlive-tex4ht_mk4ht_htlatex.sh deleted file mode 100644 index 7c63d2e5179..00000000000 --- a/testcases/function_test/pkg_test/texlive-base/texlive-tex4ht/test_texlive-tex4ht_mk4ht_htlatex.sh +++ /dev/null @@ -1,87 +0,0 @@ -#!/usr/bin/bash - -# Copyright (c) 2024 ISCAS .ALL rights reserved. -# This program is licensed under Mulan PSL v2. -# You can use it according to the terms and conditions of the Mulan PSL v2. -# http://license.coscl.org.cn/MulanPSL2 -# THIS PROGRAM IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, -# EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, -# MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. -# See the Mulan PSL v2 for more details. - -# ############################################# -# @Author : honghua -# @Contact : honghua@iscas.ac.cn -# @Date : 2025-11-27 -# @License : Mulan PSL v2 -# @Desc : 测试使用 htlatex 命令生成 HTML 文件 -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - LOG_INFO "开始测试 htlatex 命令生成 HTML 文件" - - # 检查是否已安装 texlive-tex4ht 和 mk4ht - LOG_INFO "检查 texlive-tex4ht 和 mk4ht 是否已安装" - if ! dnf list installed texlive-tex4ht &> /dev/null || ! dnf list installed mk4ht &> /dev/null; then - LOG_INFO "环境未安装,准备安装 texlive-tex4ht 和 mk4ht" - # 检查 yum 源中是否有 texlive-tex4ht 和 mk4ht - if ! dnf list available texlive-tex4ht &> /dev/null || ! dnf list available mk4ht &> /dev/null; then - LOG_ERROR "yum 源中缺少 texlive-tex4ht 或 mk4ht 软件包" - exit 255 - fi - # 安装软件包 - dnf install -y texlive-tex4ht mk4ht - CHECK_RESULT $? 0 0 "安装 texlive-tex4ht 和 mk4ht 失败" - # 标记需要卸载 - UNINSTALL=true - else - LOG_INFO "环境已安装 texlive-tex4ht 和 mk4ht" - UNINSTALL=false - fi - - # 检查 htlatex 命令是否存在 - LOG_INFO "检查 htlatex 命令是否存在" - if ! command -v htlatex &> /dev/null; then - LOG_ERROR "未找到 htlatex 命令" - exit 255 - fi - - #创建测试文件 test.tex - LOG_INFO "创建测试文件 test.tex" - cat < test.tex - \documentclass{article} - \begin{document} - Hello, World! - \end{document} - EOF - CHECK_RESULT $? 0 0 "创建测试文件失败" - - #使用 htlatex生成 HTML文件 - LOG_INFO "使用 htlatex 生成 HTML文件" - htlatex test.tex - CHECK_RESULT $? 0 0 "生成 HTML文件失败" - - #检查生成的 HTML文件是否存在 - LOG_INFO "检查生成的HTML文件是否存在" - if [ ! -f test.html ]; then - LOG_ERROR "未生成HTML文件" - exit1 - fi - - #清理测试文件和生成的HTML文件 - LOG_INFO "清理测试文件和生成的HTML文件" - rm -f test.tex test.html *.css *.4ct *.4tc *.aux *.dvi *.idv *.lg *.log *.tmp *.xref - - #如果之前安装了软件包则卸载 - if [ "$UNINSTALL" = true ]; then - LOG_INFO "卸载 texlive-tex4ht 和 mk4ht" - dnf remove -y texlive-tex4ht mk4ht - CHECK_RESULT $? 0 0 "卸载 texlive-tex4h t和 mk$h t失败" - fi - - LOG_INFO “测试完成” -} - -main "$@" \ No newline at end of file diff --git a/testcases/function_test/pkg_test/texlive-base/texlive-tex4ht/test_texlive-tex4ht_mk4ht_htlatex_with_t4ht_args.sh b/testcases/function_test/pkg_test/texlive-base/texlive-tex4ht/test_texlive-tex4ht_mk4ht_htlatex_with_t4ht_args.sh deleted file mode 100644 index 74ab5627a87..00000000000 --- a/testcases/function_test/pkg_test/texlive-base/texlive-tex4ht/test_texlive-tex4ht_mk4ht_htlatex_with_t4ht_args.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-02 -# @License : Mulan PSL v2 -# @Desc : 使用 htlatex 处理 .tex 文件,并为 t4ht.c 指定额外参数 -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - # 检查是否已安装texlive-tex4ht - LOG_INFO "检查是否已安装texlive-tex4ht软件包" - rpm -q texlive-tex4ht > /dev/null 2>&1 - if [ $? -eq 0 ]; then - LOG_INFO "texlive-tex4ht已安装,测试结束后保持安装状态" - installed_before=1 - else - LOG_INFO "texlive-tex4ht未安装,测试前将安装,测试后卸载" - installed_before=0 - fi - - # 检查yum源中是否有texlive-tex4ht软件包 - LOG_INFO "检查yum源中是否有texlive-tex4ht软件包" - dnf list available texlive-tex4ht > /dev/null 2>&1 - if [ $? -ne 0 ]; then - LOG_ERROR "yum源中没有texlive-tex4ht软件包" - exit 255 - fi - - # 如果未安装,则安装texlive-tex4ht - if [ $installed_before -eq 0 ]; then - LOG_INFO "安装texlive-tex4ht软件包" - dnf install -y texlive-tex4ht > /dev/null 2>&1 - CHECK_RESULT $? 0 0 "安装texlive-tex4ht失败" - fi - - # 检查htlatex命令是否可用 - LOG_INFO "检查htlatex命令是否可用" - which htlatex > /dev/null 2>&1 - CHECK_RESULT $? 0 0 "htlatex命令不存在" - - # 检查htlatex是否支持-t4ht参数 - LOG_INFO "检查htlatex是否支持-t4ht参数" - htlatex --help 2>&1 | grep -q "\-t4ht" - CHECK_RESULT $? 0 0 "htlatex不支持-t4ht参数" - - # 创建测试用的.tex文件 - LOG_INFO "创建测试用的.tex文件" - cat > test_document.tex << "EOF" - \documentclass{article} - \begin{document} - Hello, World! - \end{document} - EOF - CHECK_RESULT $? 0 0 "创建.tex文件失败" - - # 使用htlatex处理.tex文件,并为t4ht.c指定额外参数 - LOG_INFO "使用htlatex处理.tex文件,并为t4ht.c指定额外参数" - htlatex test_document.tex "" "" "-t4ht -cvalidate" > htlatex_output.log 2>&1 - CHECK_RESULT $? 0 0 "htlatex命令执行失败" - - # 检查生成的HTML文件是否存在 - LOG_INFO "检查生成的HTML文件是否存在" - [ -f test_document.html ] - CHECK_RESULT $? 0 0 "未生成HTML文件" - - # 清理测试文件 - LOG_INFO "清理测试文件" - rm -f test_document.tex test_document.html test_document.css test_document*.png test_document*.svg test_document*.idv test_document*.lg test_document*.log test_document*.aux test_document*.dvi test_document*.4ct test_document*.4tc htlatex_output.log - - # 如果测试前未安装,则卸载texlive-tex4ht - if [ $installed_before -eq 0 ]; then - LOG_INFO "卸载texlive-tex4ht软件包" - dnf remove -y texlive-tex4ht > /dev/null 2>&1 - CHECK_RESULT $? 0 0 "卸载texlive-tex4ht失败" - fi - - LOG_INFO "测试完成" -} - -main "$@" \ No newline at end of file diff --git a/testcases/function_test/pkg_test/texlive-base/texlive-tex4ht/test_texlive-tex4ht_mk4ht_htlatex_with_tex4ht_args.sh b/testcases/function_test/pkg_test/texlive-base/texlive-tex4ht/test_texlive-tex4ht_mk4ht_htlatex_with_tex4ht_args.sh deleted file mode 100644 index 1ab16a9cab1..00000000000 --- a/testcases/function_test/pkg_test/texlive-base/texlive-tex4ht/test_texlive-tex4ht_mk4ht_htlatex_with_tex4ht_args.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-02 -# @License : Mulan PSL v2 -# @Desc : 使用 htlatex 处理 .tex 文件,并为 tex4ht.c 指定额外参数 -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - LOG_INFO "开始测试:使用 htlatex 处理 .tex 文件,并为 tex4ht.c 指定额外参数" - - # 检查软件包是否在 yum 源中 - LOG_INFO "检查 yum 源中是否存在 texlive-tex4ht 软件包" - dnf list available texlive-tex4ht &>/dev/null - if [ $? -ne 0 ]; then - LOG_ERROR "yum 源中不存在 texlive-tex4ht 软件包" - exit 255 - fi - - # 检查是否已经安装了 texlive-tex4ht - LOG_INFO "检查 texlive-tex4ht 是否已经安装" - rpm -q texlive-tex4ht &>/dev/null - if [ $? -eq 0 ]; then - LOG_INFO "texlive-tex4ht 已经安装,标记为已安装状态" - ALREADY_INSTALLED=1 - else - LOG_INFO "texlive-tex4ht 未安装,标记为未安装状态" - ALREADY_INSTALLED=0 - fi - - # 如果未安装,则安装软件包 - if [ $ALREADY_INSTALLED -eq 0 ]; then - LOG_INFO "安装 texlive-tex4ht 软件包" - dnf install -y texlive-tex4ht - CHECK_RESULT $? 0 0 "安装 texlive-tex4ht 失败" - fi - - # 检查 htlatex 命令是否可用 - LOG_INFO "检查 htlatex 命令是否可用" - which htlatex &>/dev/null - CHECK_RESULT $? 0 0 "htlatex 命令不存在" - - # 创建一个简单的 .tex 文件用于测试 - LOG_INFO "创建测试用的 .tex 文件" - cat > test.tex << "EOF" - \documentclass{article} - \begin{document} - Hello, World! - \end{document} - EOF - CHECK_RESULT $? 0 0 "创建 test.tex 文件失败" - - # 测试 htlatex 命令,并为 tex4ht.c 指定额外参数 - LOG_INFO "使用 htlatex 处理 test.tex 文件,并为 tex4ht.c 指定额外参数" - htlatex test.tex "html,2" "" "" "-cvalidate -cunihtf" 2>&1 - CHECK_RESULT $? 0 0 "htlatex 命令执行失败" - - # 检查生成的 HTML 文件是否存在 - LOG_INFO "检查生成的 HTML 文件是否存在" - ls test.html &>/dev/null - CHECK_RESULT $? 0 0 "未生成 test.html 文件" - - # 清理测试文件 - LOG_INFO "清理测试文件" - rm -f test.tex test.html test.css test*.png test*.svg test*.tmp test*.idv test*.lg test*.4ct test*.4tc test*.dvi test*.aux test*.log - CHECK_RESULT $? 0 0 "清理测试文件失败" - - # 如果之前未安装,则卸载软件包 - if [ $ALREADY_INSTALLED -eq 0 ]; then - LOG_INFO "卸载 texlive-tex4ht 软件包" - dnf remove -y texlive-tex4ht - CHECK_RESULT $? 0 0 "卸载 texlive-tex4ht 失败" - else - LOG_INFO "保持 texlive-tex4ht 安装状态" - fi - - LOG_INFO "测试完成" -} - -main "$@" \ No newline at end of file diff --git a/testcases/function_test/pkg_test/texlive-base/texlive-tex4ht/test_texlive-tex4ht_mk4ht_htlatex_with_tex_args.sh b/testcases/function_test/pkg_test/texlive-base/texlive-tex4ht/test_texlive-tex4ht_mk4ht_htlatex_with_tex_args.sh deleted file mode 100644 index af7ad5b7ae6..00000000000 --- a/testcases/function_test/pkg_test/texlive-base/texlive-tex4ht/test_texlive-tex4ht_mk4ht_htlatex_with_tex_args.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-02 -# @License : Mulan PSL v2 -# @Desc : 使用 htlatex 处理 .tex 文件,并为 latex 命令指定额外参数 -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - LOG_INFO "开始测试:使用 htlatex 处理 .tex 文件,并为 latex 命令指定额外参数" - - LOG_INFO "步骤1: 检查是否已安装 texlive-tex4ht 软件包" - if rpm -q texlive-tex4ht &> /dev/null; then - LOG_INFO "texlive-tex4ht 已安装,测试结束后将保持安装状态" - INSTALLED=true - else - LOG_INFO "texlive-tex4ht 未安装,将在测试步骤中安装" - INSTALLED=false - fi - - LOG_INFO "步骤2: 检查 yum 源中是否有 texlive-tex4ht 软件包" - if ! dnf list available texlive-tex4ht &> /dev/null; then - LOG_ERROR "yum 源中未找到 texlive-tex4ht 软件包" - exit 255 - fi - - if [ "$INSTALLED" = false ]; then - LOG_INFO "步骤3: 安装 texlive-tex4ht 软件包" - dnf install -y texlive-tex4ht - CHECK_RESULT $? 0 0 "安装 texlive-tex4ht 失败" - fi - - LOG_INFO "步骤4: 检查 mk4ht 和 htlatex 命令是否存在" - command -v mk4ht &> /dev/null - CHECK_RESULT $? 0 0 "mk4ht 命令不存在" - command -v htlatex &> /dev/null - CHECK_RESULT $? 0 0 "htlatex 命令不存在" - - LOG_INFO "步骤5: 创建测试用的 .tex 文件" - cat > test_htlatex.tex << "EOF" - \documentclass{article} - \begin{document} - Hello, World! - \end{document} - EOF - CHECK_RESULT $? 0 0 "创建 test_htlatex.tex 文件失败" - - LOG_INFO "步骤6: 使用 htlatex 处理 .tex 文件,并为 latex 命令指定额外参数 -interaction=nonstopmode" - htlatex test_htlatex.tex "html,mathjax" "" "" "-interaction=nonstopmode" - CHECK_RESULT $? 0 0 "htlatex 命令执行失败" - - LOG_INFO "步骤7: 检查是否生成了预期的输出文件" - if [ -f "test_htlatex.html" ]; then - LOG_INFO "成功生成 test_htlatex.html 文件" - else - LOG_ERROR "未生成 test_htlatex.html 文件" - exit 1 - fi - - LOG_INFO "步骤8: 清理生成的测试文件" - rm -f test_htlatex.tex test_htlatex.html test_htlatex.css test_htlatex*.png test_htlatex*.svg test_htlatex*.log test_htlatex*.aux test_htlatex*.dvi test_htlatex*.idv test_htlatex*.lg test_htlatex*.tmp test_htlatex*.xref - CHECK_RESULT $? 0 0 "清理测试文件失败" - - if [ "$INSTALLED" = false ]; then - LOG_INFO "步骤9: 卸载 texlive-tex4ht 软件包" - dnf remove -y texlive-tex4ht - CHECK_RESULT $? 0 0 "卸载 texlive-tex4ht 失败" - else - LOG_INFO "步骤9: 测试开始前已安装 texlive-tex4ht,保持安装状态" - fi - - LOG_INFO "测试完成" -} - -main "$@" \ No newline at end of file diff --git a/testcases/function_test/pkg_test/texlive-base/texlive-tex4ht/test_texlive-tex4ht_mk4ht_jhlatex.sh b/testcases/function_test/pkg_test/texlive-base/texlive-tex4ht/test_texlive-tex4ht_mk4ht_jhlatex.sh deleted file mode 100644 index ad01b26855d..00000000000 --- a/testcases/function_test/pkg_test/texlive-base/texlive-tex4ht/test_texlive-tex4ht_mk4ht_jhlatex.sh +++ /dev/null @@ -1,71 +0,0 @@ -#!/usr/bin/bash - -# Copyright (c) 2024 ISCAS .ALL rights reserved. -# This program is licensed under Mulan PSL v2. -# You can use it according to the terms and conditions of the Mulan PSL v2. -# http://license.coscl.org.cn/MulanPSL2 -# THIS PROGRAM IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, -# EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, -# MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. -# See the Mulan PSL v2 for more details. - -# ############################################# -# @Author : honghua -# @Contact : honghua@iscas.ac.cn -# @Date : 2025-11-27 -# @License : Mulan PSL v2 -# @Desc : 测试使用 jhlatex 命令生成 HTML 文件 -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - LOG_INFO "开始测试 jhlatex 命令生成 HTML 文件" - - # 检查是否已安装 texlive-tex4ht 和 mk4ht - LOG_INFO "检查是否已安装 texlive-tex4ht 和 mk4ht" - if ! dnf list installed texlive-tex4ht &> /dev/null || ! dnf list installed mk4ht &> /dev/null; then - LOG_INFO "环境未安装,将进行安装" - INSTALLED=false - else - LOG_INFO "环境已安装" - INSTALLED=true - fi - - # 检查 yum 源中是否有 texlive-tex4ht 和 mk4ht - LOG_INFO "检查 yum 源中是否有 texlive-tex4ht 和 mk4ht" - if ! dnf list available texlive-tex4ht &> /dev/null || ! dnf list available mk4ht &> /dev/null; then - LOG_ERROR "yum 源中缺少 texlive-tex4ht 或 mk4ht 软件包" - exit 255 - fi - - # 如果未安装,则安装软件包 - if [ "$INSTALLED" = false ]; then - LOG_INFO "正在安装 texlive-tex4ht 和 mk4ht" - dnf install -y texlive-tex4ht mk4ht - CHECK_RESULT $? 0 0 "安装 texlive-tex4ht 和 mk4ht 失败" - fi - - # 检查 jhlatex 命令是否存在 - LOG_INFO "检查 jhlatex 命令是否存在" - if ! command -v jhlatex &> /dev/null; then - LOG_ERROR "jhlatex 命令不存在或不支持" - exit 255 - fi - - # 测试 jhlatex 命令生成 HTML - LOG_INFO "测试使用 jhlatex 命令生成 HTML" - jhlatex sample.tex sample.html - CHECK_RESULT $? 0 0 "jhlatex 命令执行失败" - - # 清理环境:如果之前未安装,则卸载软件包 - if [ "$INSTALLED" = false ]; then - LOG_INFO "卸载 texlive-tex4ht 和 mk4ht" - dnf remove -y texlive-tex4ht mk4ht - CHECK_RESULT $? 0 0 "卸载 texlive-tex4ht 和 mk4ht失败" - fi - - LOG_INFO "测试完成,环境已恢复" -} - -main "$@" \ No newline at end of file diff --git a/testcases/function_test/pkg_test/texlive-base/texlive-tex4ht/test_texlive-tex4ht_mk4ht_no_filename.sh b/testcases/function_test/pkg_test/texlive-base/texlive-tex4ht/test_texlive-tex4ht_mk4ht_no_filename.sh deleted file mode 100644 index c00bf98ca04..00000000000 --- a/testcases/function_test/pkg_test/texlive-base/texlive-tex4ht/test_texlive-tex4ht_mk4ht_no_filename.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 : 2026-03-02 -# @License : Mulan PSL v2 -# @Desc : 不带文件名参数调用 mk4ht,触发未初始化变量警告 -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - LOG_INFO "开始测试:不带文件名参数调用 mk4ht,触发未初始化变量警告" - LOG_INFO "步骤1:检查系统是否已安装 texlive-tex4ht 软件包" - rpm -q texlive-tex4ht > /dev/null 2>&1 - if [ $? -eq 0 ]; then - LOG_INFO "texlive-tex4ht 已安装,标记为已安装状态" - INSTALLED=true - else - LOG_INFO "texlive-tex4ht 未安装,标记为未安装状态" - INSTALLED=false - fi - - LOG_INFO "步骤2:检查 yum 源中是否有 texlive-tex4ht 软件包" - dnf list available texlive-tex4ht > /dev/null 2>&1 - CHECK_RESULT $? 0 0 "yum 源中未找到 texlive-tex4ht 软件包" - if [ $? -ne 0 ]; then - LOG_ERROR "yum 源中未找到 texlive-tex4ht 软件包" - exit 255 - fi - - if [ "$INSTALLED" = "false" ]; then - LOG_INFO "步骤3:安装 texlive-tex4ht 软件包" - dnf install -y texlive-tex4ht - CHECK_RESULT $? 0 0 "安装 texlive-tex4ht 失败" - fi - - LOG_INFO "步骤4:不带文件名参数调用 mk4ht,检查是否触发未初始化变量警告" - mk4ht 2>&1 | grep -i "warning.*uninitialized" - CHECK_RESULT $? 0 0 "未触发预期的未初始化变量警告" - - if [ "$INSTALLED" = "false" ]; then - LOG_INFO "步骤5:卸载 texlive-tex4ht 软件包,恢复环境" - dnf remove -y texlive-tex4ht - CHECK_RESULT $? 0 0 "卸载 texlive-tex4ht 失败" - fi - - LOG_INFO "测试完成,环境已恢复" -} - -main "$@" \ No newline at end of file diff --git a/testcases/function_test/pkg_test/texlive-base/texlive-tex4ht/test_texlive-tex4ht_mk4ht_oolatex.sh b/testcases/function_test/pkg_test/texlive-base/texlive-tex4ht/test_texlive-tex4ht_mk4ht_oolatex.sh deleted file mode 100644 index 63284cb885a..00000000000 --- a/testcases/function_test/pkg_test/texlive-base/texlive-tex4ht/test_texlive-tex4ht_mk4ht_oolatex.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-11-27 -# @License : Mulan PSL v2 -# @Desc : 测试使用 oolatex 命令生成 HTML 文件 -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - - # 检查是否已安装texlive-tex4ht和mk4ht - if ! dnf list installed texlive-tex4ht &> /dev/null || ! dnf list installed mk4ht &> /dev/null; then - LOG_INFO "环境未安装,开始安装texlive-tex4ht和mk4ht" - # 检查yum源中是否有texlive-tex4ht和mk4ht - if ! dnf list available texlive-tex4ht &> /dev/null || ! dnf list available mk4ht &> /dev/null; then - LOG_ERROR "yum源中缺少texlive-tex4ht或mk4ht软件包" - exit 255 - fi - # 安装软件包 - dnf install -y texlive-tex4ht mk4ht - CHECK_RESULT $? 0 0 "安装texlive-tex4ht和mk4ht失败" - else - LOG_INFO "环境已安装,跳过安装步骤" - fi - - # 测试使用oolatex命令生成HTML文件 - LOG_INFO "测试使用oolatex命令生成HTML文件" - cat < test.tex - \documentclass{article} - \begin{document} - Hello, World! - \end{document} - EOF - - # 执行oolatex命令生成HTML文件 - oolatex test.tex - CHECK_RESULT $? 0 0 "oolatex命令执行失败" - - # 检查生成的HTML文件是否存在 - if [ ! -f "test.html" ]; then - LOG_ERROR "未生成预期的HTML文件" - exit 1 - fi - LOG_INFO "成功生成HTML文件" - - # 清理测试文件 - rm -f test.tex test.html test.css test.log test.dvi test.idv test.lg test.aux test.4ct test.4tc test.tmp - - # 如果脚本开始时未安装软件包,则在结束时卸载 - if ! dnf list installed texlive-tex4ht &> /dev/null || ! dnf list installed mk4ht &> /dev/null; then - LOG_INFO "卸载texlive-tex4ht和mk4ht" - dnf remove -y texlive-tex4ht mk4ht - CHECK_RESULT $? 0 0 "卸载texlive-tex4ht和mk4ht失败" - fi - - LOG_INFO "测试脚本执行完毕,环境已恢复" - -} - -main "$@" \ No newline at end of file diff --git a/testcases/function_test/pkg_test/texlive-base/texlive-tex4ht/test_texlive-tex4ht_mk4ht_teilatex.sh b/testcases/function_test/pkg_test/texlive-base/texlive-tex4ht/test_texlive-tex4ht_mk4ht_teilatex.sh deleted file mode 100644 index fdf1e1a22bc..00000000000 --- a/testcases/function_test/pkg_test/texlive-base/texlive-tex4ht/test_texlive-tex4ht_mk4ht_teilatex.sh +++ /dev/null @@ -1,72 +0,0 @@ -#!/usr/bin/bash - -# Copyright (c) 2024 ISCAS .ALL rights reserved. -# This program is licensed under Mulan PSL v2. -# You can use it according to the terms and conditions of the Mulan PSL v2. -# http://license.coscl.org.cn/MulanPSL2 -# THIS PROGRAM IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, -# EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, -# MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. -# See the Mulan PSL v2 for more details. - -# ############################################# -# @Author : honghua -# @Contact : honghua@iscas.ac.cn -# @Date : 2025-11-27 -# @License : Mulan PSL v2 -# @Desc : 测试使用 teilatex 命令生成 HTML 文件 -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - - # 检查是否已安装texlive-tex4ht和mk4ht - if ! dnf list installed texlive-tex4ht &>/dev/null || ! dnf list installed mk4ht &>/dev/null; then - LOG_INFO "环境未安装texlive-tex4ht或mk4ht,将进行安装" - # 检查yum源中是否有该软件包 - if ! dnf list available texlive-tex4ht &>/dev/null || ! dnf list available mk4ht &>/dev/null; then - LOG_ERROR "yum源中未找到texlive-tex4ht或mk4ht软件包" - exit 255 - fi - # 安装软件包 - dnf install -y texlive-tex4ht mk4ht - CHECK_RESULT $? 0 0 "安装texlive-tex4ht和mk4ht失败" - INSTALLED=true - else - LOG_INFO "环境已安装texlive-tex4ht和mk4ht,无需重复安装" - INSTALLED=false - fi - - # 测试使用texi2html命令生成HTML文件 - LOG_INFO "测试使用texi2html命令生成HTML文件" - echo "\documentclass{article}\begin{document}Hello, World!\end{document}" > test.tex - - # 生成HTML文件 - texi2html test.tex --output=test.html --no-validate - CHECK_RESULT $? 0 0 "texi2html命令执行失败" - - # 检查生成的HTML文件是否存在 - if [ ! -f "test.html" ]; then - LOG_ERROR "未生成test.html文件" - exit 1 - fi - - LOG_INFO "生成的HTML文件内容如下:" - cat test.html - - # 清理测试文件 - rm -f test.tex test.html - - # 如果脚本开始时安装了软件包,则在结束时卸载它们 - if [ "$INSTALLED" = true ]; then - LOG_INFO "卸载之前安装的软件包" - dnf remove -y texlive-tex4ht mk4ht - CHECK_RESULT $? 0 0 "卸载texlive-tex4ht和mk4ht失败" - fi - - LOG_INFO "测试脚本执行完毕,环境已恢复" - -} - -main "$@" \ No newline at end of file diff --git a/testcases/function_test/pkg_test/texlive-base/texlive-tex4ht/test_texlive-tex4ht_mk4ht_tex.sh b/testcases/function_test/pkg_test/texlive-base/texlive-tex4ht/test_texlive-tex4ht_mk4ht_tex.sh deleted file mode 100644 index c2c6a55f3ad..00000000000 --- a/testcases/function_test/pkg_test/texlive-base/texlive-tex4ht/test_texlive-tex4ht_mk4ht_tex.sh +++ /dev/null @@ -1,116 +0,0 @@ -#!/usr/bin/bash - -# Copyright (c) 2024 ISCAS .ALL rights reserved. -# This program is licensed under Mulan PSL v2. -# You can use it according to the terms and conditions of the Mulan PSL v2. -# http://license.coscl.org.cn/MulanPSL2 -# THIS PROGRAM IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, -# EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, -# 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-02 -# @License : Mulan PSL v2 -# @Desc : 使用 tex 引擎(而非 latex)处理 .tex 文件 -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - # 环境检查:检查是否已安装texlive-tex4ht和mk4ht-tex - LOG_INFO "检查是否已安装texlive-tex4ht和mk4ht-tex软件包" - rpm -q texlive-tex4ht mk4ht-tex > /dev/null 2>&1 - if [ $? -eq 0 ]; then - LOG_INFO "软件包已安装,标记为保持安装状态" - KEEP_INSTALLED=1 - else - LOG_INFO "软件包未安装,标记为需要测试后卸载" - KEEP_INSTALLED=0 - fi - - # 检查yum源中是否存在软件包 - LOG_INFO "检查yum源中是否存在texlive-tex4ht和mk4ht-tex软件包" - dnf list available texlive-tex4ht mk4ht-tex > /dev/null 2>&1 - CHECK_RESULT $? 0 0 "yum源中不存在texlive-tex4ht或mk4ht-tex软件包" - if [ $? -ne 0 ]; then - LOG_ERROR "yum源中不存在texlive-tex4ht或mk4ht-tex软件包" - exit 255 - fi - - # 如果未安装,则安装软件包 - if [ $KEEP_INSTALLED -eq 0 ]; then - LOG_INFO "开始安装texlive-tex4ht和mk4ht-tex软件包" - dnf install -y texlive-tex4ht mk4ht-tex - CHECK_RESULT $? 0 0 "安装texlive-tex4ht和mk4ht-tex软件包失败" - fi - - # 检查tex命令是否可用 - LOG_INFO "检查tex命令是否可用" - which tex > /dev/null 2>&1 - CHECK_RESULT $? 0 0 "tex命令不存在" - - # 检查mk4ht命令是否可用 - LOG_INFO "检查mk4ht命令是否可用" - which mk4ht > /dev/null 2>&1 - CHECK_RESULT $? 0 0 "mk4ht命令不存在" - - # 创建测试用的.tex文件 - LOG_INFO "创建测试用的.tex文件" - TEST_TEX_FILE="test_tex4ht.tex" - cat > $TEST_TEX_FILE << "EOF" - \documentclass{article} - \begin{document} - Hello, Tex4ht! - \end{document} - EOF - CHECK_RESULT $? 0 0 "创建测试.tex文件失败" - - # 使用tex引擎处理.tex文件 - LOG_INFO "使用tex引擎处理.tex文件" - tex $TEST_TEX_FILE - CHECK_RESULT $? 0 0 "tex引擎处理.tex文件失败" - - # 检查生成的.dvi文件 - LOG_INFO "检查生成的.dvi文件" - if [ -f "test_tex4ht.dvi" ]; then - LOG_INFO "成功生成.dvi文件" - else - LOG_ERROR "未生成.dvi文件" - exit 1 - fi - - # 使用mk4ht命令处理.dvi文件 - LOG_INFO "使用mk4ht命令处理.dvi文件" - mk4ht tex4ht test_tex4ht.dvi - CHECK_RESULT $? 0 0 "mk4ht命令处理.dvi文件失败" - - # 检查生成的.html文件 - LOG_INFO "检查生成的.html文件" - if [ -f "test_tex4ht.html" ]; then - LOG_INFO "成功生成.html文件" - else - LOG_ERROR "未生成.html文件" - exit 1 - fi - - # 清理测试文件 - LOG_INFO "清理测试文件" - rm -f test_tex4ht.* - CHECK_RESULT $? 0 0 "清理测试文件失败" - - # 如果测试前未安装,则卸载软件包 - if [ $KEEP_INSTALLED -eq 0 ]; then - LOG_INFO "卸载texlive-tex4ht和mk4ht-tex软件包" - dnf remove -y texlive-tex4ht mk4ht-tex - CHECK_RESULT $? 0 0 "卸载texlive-tex4ht和mk4ht-tex软件包失败" - else - LOG_INFO "保持软件包安装状态" - fi - - LOG_INFO "测试完成" -} - -main "$@" \ No newline at end of file diff --git a/testcases/function_test/pkg_test/texlive-base/texlive-tex4ht/test_texlive-tex4ht_mk4ht_xelatex.sh b/testcases/function_test/pkg_test/texlive-base/texlive-tex4ht/test_texlive-tex4ht_mk4ht_xelatex.sh deleted file mode 100644 index 0823a5774cf..00000000000 --- a/testcases/function_test/pkg_test/texlive-base/texlive-tex4ht/test_texlive-tex4ht_mk4ht_xelatex.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-02 -# @License : Mulan PSL v2 -# @Desc : 使用 xelatex 引擎处理 .tex 文件 -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - LOG_INFO "开始测试: 使用 xelatex 引擎处理 .tex 文件" - LOG_INFO "步骤1: 检查texlive-tex4ht-mk4ht-xelatex软件包是否在yum源中" - dnf list texlive-tex4ht-mk4ht-xelatex &>/dev/null - if [ $? -ne 0 ]; then - LOG_ERROR "软件包 texlive-tex4ht-mk4ht-xelatex 不在yum源中" - exit 255 - fi - LOG_INFO "软件包 texlive-tex4ht-mk4ht-xelatex 存在于yum源中" - - LOG_INFO "步骤2: 检查当前环境是否已安装texlive-tex4ht-mk4ht-xelatex" - rpm -q texlive-tex4ht-mk4ht-xelatex &>/dev/null - if [ $? -eq 0 ]; then - INSTALLED=1 - LOG_INFO "环境已安装texlive-tex4ht-mk4ht-xelatex,测试后保持安装状态" - else - INSTALLED=0 - LOG_INFO "环境未安装texlive-tex4ht-mk4ht-xelatex,将进行安装测试" - fi - - if [ $INSTALLED -eq 0 ]; then - LOG_INFO "步骤3: 安装texlive-tex4ht-mk4ht-xelatex软件包" - dnf install -y texlive-tex4ht-mk4ht-xelatex - CHECK_RESULT $? 0 0 "安装texlive-tex4ht-mk4ht-xelatex软件包失败" - LOG_INFO "软件包安装成功" - fi - - LOG_INFO "步骤4: 检查xelatex命令是否可用" - command -v xelatex &>/dev/null - CHECK_RESULT $? 0 0 "xelatex命令不存在" - LOG_INFO "xelatex命令可用" - - LOG_INFO "步骤5: 检查xelatex命令是否支持--help参数" - xelatex --help &>/dev/null - if [ $? -ne 0 ]; then - LOG_ERROR "xelatex命令不支持--help参数" - exit 255 - fi - LOG_INFO "xelatex命令支持--help参数" - - LOG_INFO "步骤6: 创建测试用的.tex文件" - TEST_TEX_FILE="/tmp/test_xelatex.tex" - cat > $TEST_TEX_FILE << "EOF" - \documentclass{article} - \begin{document} - Hello, OpenEuler! - \end{document} - EOF - CHECK_RESULT $? 0 0 "创建测试.tex文件失败" - LOG_INFO "测试.tex文件创建成功: $TEST_TEX_FILE" - - LOG_INFO "步骤7: 使用xelatex引擎处理.tex文件" - xelatex -interaction=nonstopmode $TEST_TEX_FILE &>/dev/null - CHECK_RESULT $? 0 0 "使用xelatex处理.tex文件失败" - LOG_INFO "xelatex成功处理.tex文件" - - LOG_INFO "步骤8: 检查生成的PDF文件" - if [ -f "${TEST_TEX_FILE%.tex}.pdf" ]; then - LOG_INFO "PDF文件生成成功: ${TEST_TEX_FILE%.tex}.pdf" - else - LOG_ERROR "PDF文件未生成" - exit 1 - fi - - LOG_INFO "步骤9: 清理测试文件" - rm -f $TEST_TEX_FILE ${TEST_TEX_FILE%.tex}.pdf ${TEST_TEX_FILE%.tex}.aux ${TEST_TEX_FILE%.tex}.log - CHECK_RESULT $? 0 0 "清理测试文件失败" - LOG_INFO "测试文件清理成功" - - if [ $INSTALLED -eq 0 ]; then - LOG_INFO "步骤10: 卸载测试安装的texlive-tex4ht-mk4ht-xelatex软件包" - dnf remove -y texlive-tex4ht-mk4ht-xelatex - CHECK_RESULT $? 0 0 "卸载texlive-tex4ht-mk4ht-xelatex软件包失败" - LOG_INFO "软件包卸载成功,环境已恢复" - else - LOG_INFO "步骤10: 环境已安装软件包,保持安装状态,无需卸载" - fi - - LOG_INFO "测试完成: 使用 xelatex 引擎处理 .tex 文件" -} - -main "$@" \ No newline at end of file diff --git a/testcases/function_test/pkg_test/texlive-base/texlive-tex4ht/test_texlive-tex4ht_mk4ht_xetex.sh b/testcases/function_test/pkg_test/texlive-base/texlive-tex4ht/test_texlive-tex4ht_mk4ht_xetex.sh deleted file mode 100644 index 1719c409a4f..00000000000 --- a/testcases/function_test/pkg_test/texlive-base/texlive-tex4ht/test_texlive-tex4ht_mk4ht_xetex.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-27 -# @License : Mulan PSL v2 -# @Desc : 测试使用 xetex 命令生成 HTML 文件 -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - # 检查是否已安装texlive-tex4ht和mk4ht - LOG_INFO "检查是否已安装texlive-tex4ht和mk4ht" - if ! dnf list installed texlive-tex4ht mk4ht &>/dev/null; then - LOG_INFO "未安装texlive-tex4ht和mk4ht,准备安装" - # 检查yum源中是否有软件包 - if ! dnf list available texlive-tex4ht mk4ht &>/dev/null; then - LOG_ERROR "yum源中未找到texlive-tex4ht或mk4ht软件包" - exit 255 - fi - # 安装软件包 - dnf install -y texlive-tex4ht mk4ht - CHECK_RESULT $? 0 0 "安装texlive-tex4ht和mk4ht失败" - # 标记为需要卸载 - NEED_UNINSTALL=1 - else - LOG_INFO "texlive-tex4ht和mk4ht已安装" - fi - - # 测试xetex命令生成HTML文件 - LOG_INFO "测试使用xetex命令生成HTML文件" - cat > test.tex < /dev/null || ! dnf list installed mk4ht &> /dev/null; then - LOG_INFO "未安装 texlive-tex4ht 或 mk4ht,准备安装" - # 检查 yum 源中是否有 texlive-tex4ht 和 mk4ht - if ! dnf list available texlive-tex4ht &> /dev/null || ! dnf list available mk4ht &> /dev/null; then - LOG_ERROR "yum 源中未找到 texlive-tex4ht 或 mk4ht 包" - exit 255 - fi - # 安装 texlive-tex4ht 和 mk4ht - dnf install -y texlive-tex4ht mk4ht - CHECK_RESULT $? 0 0 "安装 texlive-tex4ht 或 mk4ht 失败" - # 标记为需要卸载 - NEED_UNINSTALL=1 - else - LOG_INFO "已安装 texlive-tex4ht 和 mk4ht,跳过安装步骤" - NEED_UNINSTALL=0 - fi - - # 检查 xhlatex 命令是否存在 - LOG_INFO "检查 xhlatex 命令是否存在" - if ! command -v xhlatex &> /dev/null; then - LOG_ERROR "xhlatex 命令不存在或不支持" - exit 255 - fi - - # 测试 xhlatex 命令生成 HTML - LOG_INFO "测试使用 xhlatex 命令生成 HTML" - echo "\documentclass{article}\begin{document}Hello, World!\end{document}" > test.tex - xhlatex test.tex - CHECK_RESULT $? 0 0 "xhlatex 生成 HTML 失败" - - #清理临时文件 - rm -f test.tex test.html test.log test.dvi test.4ct - - #恢复环境 - if [ "$NEED_UNINSTALL" -eq 1 ]; then - LOG_INFO "卸载 texlive-tex4h t和 mktht" - dnf remove -y texlivetex4h t mktht - 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-tex4ht/test_texlive-tex4ht_t4ht_b.sh b/testcases/function_test/pkg_test/texlive-base/texlive-tex4ht/test_texlive-tex4ht_t4ht_b.sh deleted file mode 100644 index efecd7953f8..00000000000 --- a/testcases/function_test/pkg_test/texlive-base/texlive-tex4ht/test_texlive-tex4ht_t4ht_b.sh +++ /dev/null @@ -1,62 +0,0 @@ -#!/usr/bin/bash - -# Copyright (c) 2024 ISCAS .ALL rights reserved. -# This program is licensed under Mulan PSL v2. -# You can use it according to the terms and conditions of the Mulan PSL v2. -# http://license.coscl.org.cn/MulanPSL2 -# THIS PROGRAM IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, -# EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, -# MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. -# See the Mulan PSL v2 for more details. - -# ############################################# -# @Author : honghua -# @Contact : honghua@iscas.ac.cn -# @Date : 2025-11-27 -# @License : Mulan PSL v2 -# @Desc : 测试忽略 -d -m -M 参数对位图的影响 -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - - # 检查是否已安装texlive-tex4ht-t4ht-b软件包 - LOG_INFO "检查是否已安装texlive-tex4ht-t4ht-b软件包" - if dnf list installed texlive-tex4ht-t4ht-b &>/dev/null; then - LOG_INFO "软件包已安装,脚本结束后保持安装状态" - installed=true - else - LOG_INFO "软件包未安装,将在测试完成后卸载" - installed=false - fi - - # 检查yum源中是否存在texlive-tex4ht-t4ht-b软件包 - LOG_INFO "检查yum源中是否存在texlive-tex4ht-t4ht-b软件包" - if ! dnf list available texlive-tex4ht-t4ht-b &>/dev/null; then - LOG_ERROR "yum源中不存在texlive-tex4ht-t4ht-b软件包" - exit 255 - fi - - # 安装texlive-tex4ht-t4ht-b软件包 - LOG_INFO "安装texlive-tex4ht-t4ht-b软件包" - dnf install -y texlive-tex4ht-t4ht-b - CHECK_RESULT $? 0 0 "安装失败" - - # 测试忽略 -d -m -M 参数对位图的影响 - LOG_INFO "测试忽略 -d -m -M 参数对位图的影响" - command="some_tex4ht_command" # 替换为实际的tex4ht命令 - $command -d test1 -m test2 -M test3 - CHECK_RESULT $? 0 0 "参数测试失败" - - # 清理环境:如果脚本开始时未安装,则卸载软件包 - if [ "$installed" = false ]; then - LOG_INFO "卸载texlive-tex4ht-t5t5t5t5t5t5t5t5t5t5t5t5t5t5t5t55tt55tt55tt55tt55tt55tt55tt55tt55tt55tt55tt55tt555555555555555555555555555555555555555555555555555555555b软件包" - dnf remove -y texlive-tex45tb45tb45tb45tb45tb45tb45tb45tb45tb45tb45tb45tb455b455b455b455b455b455b455b455b455b455b455b455b45454545454545454545454545454545454545454545454545454545454545454h5hthththththththththththththththththththththhbbbbbbbbbbbbbbbbbbbbb --nobest --allmatches --skip-broken --setopt=clean_requirements_on_remove=1 || true # force remove if necessary but avoid breaking the system by using || true here as a safety measure in case of failure during removal process which might leave some dependencies unresolved but not critical for this test script"s purpose since it"s just cleaning up after itself anyway so no need to fail here if removal fails due to some reason like missing packages or whatever else could go wrong during uninstallation process (e.g., broken dependencies). - fi - - LOG_INFO "测试完成,环境已恢复" - -} - -main "$@" \ No newline at end of file diff --git a/testcases/function_test/pkg_test/texlive-base/texlive-tex4ht/test_texlive-tex4ht_t4ht_c.sh b/testcases/function_test/pkg_test/texlive-base/texlive-tex4ht/test_texlive-tex4ht_t4ht_c.sh deleted file mode 100644 index 519d63af690..00000000000 --- a/testcases/function_test/pkg_test/texlive-base/texlive-tex4ht/test_texlive-tex4ht_t4ht_c.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 : 测试选择环境文件中的命名段 -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - LOG_INFO "开始测试选择环境文件中的命名段" - - # 检查是否已安装texlive-tex4ht-t4ht-c - LOG_INFO "检查是否已安装texlive-tex4ht-t4ht-c" - if dnf list installed texlive-tex4ht-t4ht-c &>/dev/null; then - LOG_INFO "texlive-tex4ht-t4ht-c已安装" - installed=true - else - LOG_INFO "texlive-tex4ht-t4ht-c未安装" - installed=false - fi - - # 检查yum源中是否有该软件包 - LOG_INFO "检查yum源中是否有texlive-tex4ht-t4ht-c" - if ! dnf list available texlive-tex4ht-t4ht-c &>/dev/null; then - LOG_ERROR "yum源中未找到texlive-tex4ht-t4ht-c" - exit 255 - fi - - # 若未安装则安装软件包 - if [ "$installed" = false ]; then - LOG_INFO "开始安装texlive-tex4ht-t4ht-c" - dnf install -y texlive-tex4ht-t4ht-c - CHECK_RESULT $? 0 0 "安装texlive-tex4ht-t4ht-c失败" - fi - - # 测试命令参数是否存在或支持 - LOG_INFO "测试命令参数是否存在或支持" - texexec --help &>/dev/null - CHECK_RESULT $? 0 255 "命令参数不支持" - - # 执行测试命令 - LOG_INFO "执行测试命令" - texexec --version - CHECK_RESULT $? 0 0 "执行命令失败" - - # 清理环境:若脚本开始时未安装,则卸载软件包 - if [ "$installed" = false ]; then - LOG_INFO "卸载texlive-tex4ht-t4ht-c" - dnf remove -y texlive-tex4ht-t5t5t-c &>/dev/null - fi - - LOG_INFO "测试完成" -} - -main "$@" \ No newline at end of file diff --git a/testcases/function_test/pkg_test/texlive-base/texlive-tex4ht/test_texlive-tex4ht_t4ht_d.sh b/testcases/function_test/pkg_test/texlive-base/texlive-tex4ht/test_texlive-tex4ht_t4ht_d.sh deleted file mode 100644 index d56bf5b9942..00000000000 --- a/testcases/function_test/pkg_test/texlive-base/texlive-tex4ht/test_texlive-tex4ht_t4ht_d.sh +++ /dev/null @@ -1,84 +0,0 @@ -#!/usr/bin/bash - -# Copyright (c) 2024 ISCAS .ALL rights reserved. -# This program is licensed under Mulan PSL v2. -# You can use it according to the terms and conditions of the Mulan PSL v2. -# http://license.coscl.org.cn/MulanPSL2 -# THIS PROGRAM IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, -# EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, -# MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. -# See the Mulan PSL v2 for more details. - -# ############################################# -# @Author : honghua -# @Contact : honghua@iscas.ac.cn -# @Date : 2025-11-27 -# @License : Mulan PSL v2 -# @Desc : 测试指定输出文件的目录 -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - - # 检查是否已安装texlive-tex4ht-t4ht-d软件包 - LOG_INFO "检查是否已安装texlive-tex4ht-t4ht-d软件包" - rpm -q texlive-tex4ht-t4ht-d - if [ $? -eq 0 ]; then - LOG_INFO "texlive-tex4ht-t4ht-d已安装" - installed=true - else - LOG_INFO "texlive-tex4ht-t4ht-d未安装" - installed=false - fi - - # 检查yum源中是否存在texlive-tex4ht-t4ht-d软件包 - LOG_INFO "检查yum源中是否存在texlive-tex4ht-t4ht-d软件包" - dnf list available texlive-tex4ht-t4ht-d &> /dev/null - if [ $? -ne 0 ]; then - LOG_ERROR "yum源中不存在texlive-tex4ht-t4ht-d软件包" - exit 255 - fi - - # 如果未安装,则安装软件包 - if [ "$installed" = false ]; then - LOG_INFO "开始安装texlive-tex4ht-t4ht-d软件包" - dnf install -y texlive-tex4ht-t4ht-d &> /dev/null - CHECK_RESULT $? 0 0 "安装texlive-tex4ht-t4ht-d失败" - LOG_INFO "texlive-tex4ht-t5t5t-d安装成功" - fi - - # 测试指定输出文件的目录功能 - LOG_INFO "测试指定输出文件的目录功能" - output_dir="/tmp/tt_output" - mkdir -p "$output_dir" - CHECK_RESULT $? 0 0 "创建输出目录失败" - - # 执行命令并检查结果(假设命令为htlatex,具体命令需根据实际调整) - LOG_INFO "执行htlatex命令并指定输出目录" - command="htlatex sample.tex \"\" \"\" \"\" -d$output_dir" - eval $command - CHECK_RESULT $? 0 0 "执行命令失败" - - # 检查输出目录中是否有文件生成 - LOG_INFO "检查输出目录中是否有文件生成" - ls "$output_dir" | grep -q ".html" - CHECK_RESULT $? 0 0 "未生成预期输出文件" - - # 清理临时输出目录 - LOG_INFO "清理临时输出目录" - rm -rf "$output_dir" - CHECK_RESULT $? 0 0 "清理输出目录失败" - - # 如果脚本开始时未安装,则卸载软件包 - if [ "$installed" = false ]; then - LOG_INFO "卸载texlive-5t5t5t-d软件包" - dnf remove -y texlivetex4htt45d &> /dev/null - CHECK_RESULT $? 00 00 "卸载失败" - fi - - exit 0 - -} - -main "$@" \ No newline at end of file diff --git a/testcases/function_test/pkg_test/texlive-base/texlive-tex4ht/test_texlive-tex4ht_t4ht_e.sh b/testcases/function_test/pkg_test/texlive-base/texlive-tex4ht/test_texlive-tex4ht_t4ht_e.sh deleted file mode 100644 index af5df214427..00000000000 --- a/testcases/function_test/pkg_test/texlive-base/texlive-tex4ht/test_texlive-tex4ht_t4ht_e.sh +++ /dev/null @@ -1,79 +0,0 @@ -#!/usr/bin/bash - -# Copyright (c) 2024 ISCAS .ALL rights reserved. -# This program is licensed under Mulan PSL v2. -# You can use it according to the terms and conditions of the Mulan PSL v2. -# http://license.coscl.org.cn/MulanPSL2 -# THIS PROGRAM IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, -# EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, -# MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. -# See the Mulan PSL v2 for more details. - -# ############################################# -# @Author : honghua -# @Contact : honghua@iscas.ac.cn -# @Date : 2025-11-27 -# @License : Mulan PSL v2 -# @Desc : 测试指定 tex4ht.env 文件的位置 -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - LOG_INFO "开始测试指定 tex4ht.env 文件的位置" - - # 检查是否已安装 texlive-tex4ht-t4ht 软件包 - LOG_INFO "检查 texlive-tex4ht-t4ht 是否已安装" - if rpm -q texlive-tex4ht-t4ht &>/dev/null; then - LOG_INFO "texlive-tex4ht-t4ht 已安装,脚本结束时将保持安装状态" - INSTALLED=true - else - LOG_INFO "texlive-tex4ht-t4ht 未安装,将在测试结束后卸载" - INSTALLED=false - fi - - # 检查 yum 源中是否有 texlive-tex4ht-t4ht 软件包 - LOG_INFO "检查 yum 源中是否有 texlive-tex4ht-t4ht" - if ! dnf list available texlive-tex4ht-t4ht &>/dev/null; then - LOG_ERROR "yum 源中未找到 texlive-tex4ht-t4ht 软件包" - exit 255 - fi - - # 如果未安装,则安装软件包 - if [ "$INSTALLED" = false ]; then - LOG_INFO "开始安装 texlive-tex4ht-t4ht" - dnf install -y texlive-tex4ht-t4ht - CHECK_RESULT $? 0 0 "安装 texlive-tex4ht-t4ht 失败" - fi - - # 检查命令参数是否存在 - LOG_INFO "检查命令参数是否支持" - if ! htlatex --help &>/dev/null; then - LOG_ERROR "命令 htlatex 不支持或参数错误" - exit 255 - fi - - # 测试指定 tex4ht.env 文件的位置 - LOG_INFO "测试指定 tex4ht.env 文件的位置" - TEX4HT_ENV_PATH=$(kpsewhich tex4ht.env) - if [ -z "$TEX4HT_ENV_PATH" ]; then - LOG_ERROR "未找到 tex4ht.env 文件" - exit 1 - else - LOG_INFO "tex4ht.env 文件位置: $TEX3HT_ENV_PATH" - fi - - # CHECK_RESULT验证结果 - CHECK_RESULT $? 0 0 "查找 tex4h.env 文件失败" - - #环境恢复:如果之前未安装,则卸载软件包 - if [ "$INSTALLED" = false ]; then - LOG_INFO "卸载 texlive-tex4h-t4h" - dnf remove -y texlivetex4h t4h - CHECK RESULT $? 00"卸载 texlivetex h tt h失败” - fi - - LOG INFO“测试完成” -} - -main "$@" \ No newline at end of file diff --git a/testcases/function_test/pkg_test/texlive-base/texlive-tex4ht/test_texlive-tex4ht_t4ht_g.sh b/testcases/function_test/pkg_test/texlive-base/texlive-tex4ht/test_texlive-tex4ht_t4ht_g.sh deleted file mode 100644 index e5a8c9b904d..00000000000 --- a/testcases/function_test/pkg_test/texlive-base/texlive-tex4ht/test_texlive-tex4ht_t4ht_g.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-27 -# @License : Mulan PSL v2 -# @Desc : 测试忽略系统调用中的错误 -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - - # 检查是否已安装texlive-tex4ht-t4ht-g软件包 - LOG_INFO "检查是否已安装texlive-tex4ht-t4ht-g软件包" - rpm -q texlive-tex4ht-t4ht-g > /dev/null 2>&1 - if [ $? -eq 0 ]; then - LOG_INFO "texlive-tex4ht-t4ht-g已安装,脚本结束后保持安装状态" - installed=true - else - LOG_INFO "texlive-tex4ht-t4ht-g未安装,将在测试完成后卸载" - installed=false - fi - - # 检查yum源中是否存在texlive-tex4ht-t4ht-g软件包 - LOG_INFO "检查yum源中是否存在texlive-tex4ht-t4ht-g软件包" - dnf list available texlive-tex4ht-t4ht-g > /dev/null 2>&1 - if [ $? -ne 0 ]; then - LOG_ERROR "yum源中不存在texlive-tex4ht-t4ht-g软件包" - exit 255 - fi - - # 安装texlive-tex4ht-t4ht-g软件包 - LOG_INFO "安装texlive-tex4ht-t4ht-g软件包" - dnf install -y texlive-tex4ht-t4ht-g > /dev/null 2>&1 - CHECK_RESULT $? 0 0 "安装texlive-tex4ht-t3xt-h3失败" - - # 测试忽略系统调用中的错误 - LOG_INFO "测试忽略系统调用中的错误" - fake_command_ignore_error > /dev/null 2>&1 - CHECK_RESULT $? 0 0 "忽略系统调用中的错误测试失败" - - # 清理环境 - if [ "$installed" = false ]; then - LOG_INFO "卸载之前安装的软件包texlive-tsx4h3-t3xt-h3" - dnf remove -y texliv3-tek5h3t-r5x7-h7 > /dev/null ?>&? - fi - - LOG_INFO “测试脚本执行完毕” - exit ? - -} - -main "$@" \ No newline at end of file diff --git a/testcases/function_test/pkg_test/texlive-base/texlive-tex4ht/test_texlive-tex4ht_t4ht_i.sh b/testcases/function_test/pkg_test/texlive-base/texlive-tex4ht/test_texlive-tex4ht_t4ht_i.sh deleted file mode 100644 index 93821b78270..00000000000 --- a/testcases/function_test/pkg_test/texlive-base/texlive-tex4ht/test_texlive-tex4ht_t4ht_i.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-tex4ht-t4ht包 - LOG_INFO "检查是否已安装texlive-tex4ht-t4ht包" - rpm -q texlive-tex4ht-t4ht > /dev/null 2>&1 - if [ $? -eq 0 ]; then - LOG_INFO "texlive-tex4ht-t4ht已安装,脚本结束时将保持安装状态" - installed=true - else - LOG_INFO "texlive-tex4ht-t4ht未安装,将在测试后卸载" - installed=false - fi - - # 检查yum源中是否存在该软件包 - LOG_INFO "检查yum源中是否存在texlive-tex4ht-t4ht包" - dnf list available texlive-tex4ht-t4ht > /dev/null 2>&1 - if [ $? -ne 0 ]; then - LOG_ERROR "yum源中不存在texlive-tex4ht-t4ht包" - exit 255 - fi - - # 安装软件包 - if [ "$installed" = false ]; then - LOG_INFO "开始安装texlive-tex4ht-t4ht包" - dnf install -y texlive-tex4ht-t4ht - CHECK_RESULT $? 0 0 "安装失败" - fi - - # 测试调试信息的输出 - LOG_INFO "测试调试信息的输出" - t4ht --version > /dev/null 2>&1 - CHECK_RESULT $? 0 0 "t4ht命令执行失败" - - # 清理环境(如果最初未安装) - if [ "$installed" = false ]; then - LOG_INFO "卸载texlive-tex4ht-t4ht包" - dnf remove -y texlive-tex4ht-t4ht - 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-tex4ht/test_texlive-tex4ht_t4ht_m.sh b/testcases/function_test/pkg_test/texlive-base/texlive-tex4ht/test_texlive-tex4ht_t4ht_m.sh deleted file mode 100644 index 0c7aec07a82..00000000000 --- a/testcases/function_test/pkg_test/texlive-base/texlive-tex4ht/test_texlive-tex4ht_t4ht_m.sh +++ /dev/null @@ -1,76 +0,0 @@ -#!/usr/bin/bash - -# Copyright (c) 2024 ISCAS .ALL rights reserved. -# This program is licensed under Mulan PSL v2. -# You can use it according to the terms and conditions of the Mulan PSL v2. -# http://license.coscl.org.cn/MulanPSL2 -# THIS PROGRAM IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, -# EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, -# MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. -# See the Mulan PSL v2 for more details. - -# ############################################# -# @Author : honghua -# @Contact : honghua@iscas.ac.cn -# @Date : 2025-11-27 -# @License : Mulan PSL v2 -# @Desc : 测试设置新输出文件的权限 -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - - # 检查是否已安装texlive-tex4ht-t4ht-m软件包 - LOG_INFO "检查是否已安装texlive-tex4ht-t4ht-m软件包" - if dnf list installed texlive-tex4ht-t4ht-m &>/dev/null; then - LOG_INFO "软件包已安装,脚本结束后保持安装状态" - installed=true - else - LOG_INFO "软件包未安装,将在测试后卸载" - installed=false - fi - - # 检查yum源中是否存在texlive-tex4ht-t4ht-m软件包 - LOG_INFO "检查yum源中是否存在texlive-tex4ht-t4ht-m软件包" - if ! dnf list available texlive-tex4ht-t4ht-m &>/dev/null; then - LOG_ERROR "yum源中不存在texlive-tex4ht-t4ht-m软件包" - exit 255 - fi - - # 如果未安装,则安装软件包 - if [ "$installed" = false ]; then - LOG_INFO "安装texlive-tex4ht-t4ht-m软件包" - dnf install -y texlive-tex4ht-t4ht-m - CHECK_RESULT $? 0 0 "安装失败" - fi - - # 测试设置新输出文件的权限 - LOG_INFO "测试设置新输出文件的权限" - output_file="test_output.ps" - touch "$output_file" && chmod 644 "$output_file" - CHECK_RESULT $? 0 0 "创建或设置文件权限失败" - - # 检查文件权限是否符合预期 - LOG_INFO "检查文件权限是否符合预期" - expected_permissions="644" - actual_permissions=$(stat -c "%a" "$output_file") - CHECK_RESULT "$actual_permissions" "$expected_permissions" 0 "文件权限不符合预期" - - # 清理测试文件 - LOG_INFO "清理测试文件" - rm -f "$output_file" - CHECK_RESULT $? 0 0 "删除测试文件失败" - - # 如果之前未安装,则卸载软件包 - if [ "$installed" = false ]; then - LOG_INFO "卸载texlive-tex4ht-t4ht-m软件包" - dnf remove -y texlive-tex4ht-t4ht-m - 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-tex4ht/test_texlive-tex4ht_t4ht_p.sh b/testcases/function_test/pkg_test/texlive-base/texlive-tex4ht/test_texlive-tex4ht_t4ht_p.sh deleted file mode 100644 index f2bea9ae6ce..00000000000 --- a/testcases/function_test/pkg_test/texlive-base/texlive-tex4ht/test_texlive-tex4ht_t4ht_p.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-11-27 -# @License : Mulan PSL v2 -# @Desc : 测试不转换图片的功能 -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - LOG_INFO "开始测试不转换图片的功能" - - # 检查是否已安装texlive-tex4ht-t4ht包 - LOG_INFO "检查是否已安装texlive-tex4ht-t4ht包" - if rpm -q texlive-tex4ht-t4ht &>/dev/null; then - LOG_INFO "texlive-tex4ht-t4ht包已安装" - installed=true - else - LOG_INFO "texlive-tex4ht-t4ht包未安装" - installed=false - fi - - # 检查yum源中是否有该软件包 - LOG_INFO "检查yum源中是否有texlive-tex4ht-t4ht包" - if ! dnf list available texlive-tex4ht-t4ht &>/dev/null; then - LOG_ERROR "yum源中未找到texlive-tex4ht-t4ht包" - exit 255 - fi - - # 如果未安装,则安装软件包 - if [ "$installed" = false ]; then - LOG_INFO "安装texlive-tex4ht-t4ht包" - dnf install -y texlive-tex4ht-t4ht - CHECK_RESULT $? 0 0 "安装texlive-tex4ht-t4ht包失败" - fi - - # 测试不转换图片的功能 - LOG_INFO "测试不转换图片的功能" - command_output=$(htlatex sample.tex "" "" "-dimages/" 2>&1) - CHECK_RESULT $? 0 0 "执行htlatex命令失败" - - # 验证输出中是否包含不转换图片的相关信息 - LOG_INFO "验证输出中是否包含不转换图片的相关信息" - if echo "$command_output" | grep -q "not converting images"; then - LOG_INFO "测试通过:成功检测到不转换图片的功能" - else - LOG_ERROR "测试失败:未检测到不转换图片的功能" - exit 1 - fi - - # 如果最初未安装,则在测试完成后卸载软件包 - if [ "$installed" = false ]; then - LOG_INFO "卸载texlive-tex4ht-t4ht包" - dnf remove -y texlive-tex4ht-t4ht - CHECK_RESULT $? 0 0 "卸载texlive-tex4ht-t4ht包失败" - fi - - LOG_INFO "测试完成,环境已恢复" -} - -main "$@" \ No newline at end of file diff --git a/testcases/function_test/pkg_test/texlive-base/texlive-tex4ht/test_texlive-tex4ht_t4ht_r.sh b/testcases/function_test/pkg_test/texlive-base/texlive-tex4ht/test_texlive-tex4ht_t4ht_r.sh deleted file mode 100644 index 2f010f02a91..00000000000 --- a/testcases/function_test/pkg_test/texlive-base/texlive-tex4ht/test_texlive-tex4ht_t4ht_r.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-27 -# @License : Mulan PSL v2 -# @Desc : 测试替换所有字形的位图 -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - - LOG_INFO "开始测试替换所有字形的位图" - - # 检查软件包是否已安装 - if rpm -q texlive-tex4ht-t4ht-r > /dev/null 2>&1; then - LOG_INFO "检测到 texlive-tex4ht-t4ht-r 已安装" - INSTALLED=true - else - LOG_INFO "未检测到 texlive-tex4ht-t4ht-r,将进行安装测试" - INSTALLED=false - fi - - # 检查yum源中是否有该软件包 - LOG_INFO "检查yum源中是否存在 texlive-tex4ht-t4ht-r" - if ! dnf list available texlive-tex4ht-t4ht-r > /dev/null 2>&1; then - LOG_ERROR "yum源中未找到 texlive-tex4ht-t4ht-r" - exit 255 - fi - - # 如果未安装,则安装软件包 - if [ "$INSTALLED" = false ]; then - LOG_INFO "正在安装 texlive-tex4ht-t4ht-r" - dnf install -y texlive-tex4ht-t4ht-r - CHECK_RESULT $? 0 0 "安装 texlive-tex4ht-t4ht-r 失败" - fi - - # 测试替换所有字形的位图 - LOG_INFO "测试替换所有字形的位图功能" - htlatex test.tex "" "-d./" "--interaction=nonstopmode --shell-restricted" - CHECK_RESULT $? 0 0 "替换所有字形的位图功能测试失败" - - # 清理环境:如果脚本开始时未安装,则卸载软件包 - if [ "$INSTALLED" = false ]; then - LOG_INFO "卸载 texlive-tex4ht-t4ht-r" - dnf remove -y texlive-tex4ht-t4ht-r - CHECK_RESULT $? 0 0 "卸载 texlive-tex4ht-t4ht-r 失败" - fi - - LOG_INFO "测试完成,环境已恢复" - -} - -main "$@" \ No newline at end of file diff --git a/testcases/function_test/pkg_test/texlive-base/texlive-tex4ht/test_texlive-tex4ht_t4ht_special_dot.sh b/testcases/function_test/pkg_test/texlive-base/texlive-tex4ht/test_texlive-tex4ht_t4ht_special_dot.sh deleted file mode 100644 index e7b54c72a5d..00000000000 --- a/testcases/function_test/pkg_test/texlive-base/texlive-tex4ht/test_texlive-tex4ht_t4ht_special_dot.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-02 -# @License : Mulan PSL v2 -# @Desc : 测试为.脚本中的%%2字段提供内容的功能 -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - # 检查是否已安装texlive-tex4ht - LOG_INFO "检查是否已安装texlive-tex4ht" - rpm -q texlive-tex4ht - if [ $? -eq 0 ]; then - LOG_INFO "texlive-tex4ht已安装,脚本结束时将保持安装状态" - INSTALLED_FLAG=1 - else - LOG_INFO "texlive-tex4ht未安装,将在测试步骤中安装" - INSTALLED_FLAG=0 - fi - - # 检查yum源中是否有texlive-tex4ht软件包 - LOG_INFO "检查yum源中是否有texlive-tex4ht软件包" - dnf list available texlive-tex4ht - if [ $? -ne 0 ]; then - LOG_ERROR "yum源中没有texlive-tex4ht软件包" - exit 255 - fi - - # 安装texlive-tex4ht(如果未安装) - if [ $INSTALLED_FLAG -eq 0 ]; then - LOG_INFO "安装texlive-tex4ht" - dnf install -y texlive-tex4ht - CHECK_RESULT $? 0 0 "安装texlive-tex4ht失败" - fi - - # 测试为.脚本中的%%2字段提供内容的功能 - LOG_INFO "测试为.脚本中的%%2字段提供内容的功能" - # 这里假设有一个命令或脚本需要测试,例如使用htlatex命令并传递参数 - # 检查htlatex命令是否存在 - command -v htlatex - if [ $? -ne 0 ]; then - LOG_ERROR "htlatex命令不存在" - exit 255 - fi - - # 创建一个简单的测试tex文件 - LOG_INFO "创建测试tex文件" - cat > test.tex << "EOF" - \documentclass{article} - \begin{document} - Hello, World! - \end{document} - EOF - - # 使用htlatex命令处理测试文件,并传递参数 - LOG_INFO "执行htlatex命令,测试%%2字段功能" - htlatex test.tex "html,2" "" "" "-interaction=nonstopmode" - CHECK_RESULT $? 0 0 "htlatex命令执行失败" - - # 检查生成的html文件是否存在 - LOG_INFO "检查生成的html文件" - if [ -f "test.html" ]; then - LOG_INFO "成功生成html文件" - else - LOG_ERROR "未生成html文件" - exit 1 - fi - - # 清理测试文件 - LOG_INFO "清理测试文件" - rm -f test.tex test.html test.css test*.png test*.idv test*.lg test*.tmp test*.dvi test*.aux test*.log test*.4ct test*.4tc - - # 如果脚本开始前未安装texlive-tex4ht,则在脚本结束前卸载 - if [ $INSTALLED_FLAG -eq 0 ]; then - LOG_INFO "卸载texlive-tex4ht" - dnf remove -y texlive-tex4ht - CHECK_RESULT $? 0 0 "卸载texlive-tex4ht失败" - fi - - LOG_INFO "测试脚本执行完毕" -} - -main "$@" \ No newline at end of file diff --git a/testcases/function_test/pkg_test/texlive-base/texlive-tex4ht/test_texlive-tex4ht_t4ht_upper_m.sh b/testcases/function_test/pkg_test/texlive-base/texlive-tex4ht/test_texlive-tex4ht_t4ht_upper_m.sh deleted file mode 100644 index 5a89109db32..00000000000 --- a/testcases/function_test/pkg_test/texlive-base/texlive-tex4ht/test_texlive-tex4ht_t4ht_upper_m.sh +++ /dev/null @@ -1,76 +0,0 @@ -#!/usr/bin/bash - -# Copyright (c) 2024 ISCAS .ALL rights reserved. -# This program is licensed under Mulan PSL v2. -# You can use it according to the terms and conditions of the Mulan PSL v2. -# http://license.coscl.org.cn/MulanPSL2 -# THIS PROGRAM IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, -# EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, -# MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. -# See the Mulan PSL v2 for more details. - -# ############################################# -# @Author : honghua -# @Contact : honghua@iscas.ac.cn -# @Date : 2025-11-27 -# @License : Mulan PSL v2 -# @Desc : 测试设置所有输出文件的权限 -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - LOG_INFO "开始测试设置所有输出文件的权限" - - # 检查软件包是否已安装 - LOG_INFO "检查texlive-tex4ht-t4ht-upper-m软件包是否已安装" - if rpm -q texlive-tex4ht-t4ht-upper-m &>/dev/null; then - LOG_INFO "texlive-tex4ht-t4ht-upper-m已安装" - installed=true - else - LOG_INFO "texlive-tex4ht-t4ht-upper-m未安装" - installed=false - fi - - # 检查yum源中是否有该软件包 - LOG_INFO "检查yum源中是否有texlive-tex4ht-t4ht-upper-m软件包" - if ! dnf list available texlive-tex4ht-t4ht-upper-m &>/dev/null; then - LOG_ERROR "yum源中未找到texlive-tex4ht-t4ht-upper-m软件包" - exit 255 - fi - - # 如果未安装,则安装软件包 - if [ "$installed" = false ]; then - LOG_INFO "安装texlive-tex4ht-t4ht-upper-m软件包" - dnf install -y texlive-tex4ht-t4ht-upper-m - CHECK_RESULT $? 0 0 "安装texlive-tex4ht-t4ht-upper-m失败" - fi - - # 测试设置所有输出文件的权限 - LOG_INFO "测试设置所有输出文件的权限" - output_dir="/tmp/tex4ht_output" - mkdir -p "$output_dir" - echo "test content" > "$output_dir/test_file.txt" - - # 设置权限 - chmod 644 "$output_dir/test_file.txt" - CHECK_RESULT $? 0 0 "设置文件权限失败" - - # 验证权限 - actual_perms=$(stat -c "%a" "$output_dir/test_file.txt") - CHECK_RESULT "$actual_perms" "644" 0 "文件权限设置不正确" - - # 清理测试文件 - rm -rf "$output_dir" - - # 如果最初未安装,则卸载软件包 - if [ "$installed" = false ]; then - LOG_INFO "卸载texlive-tex4ht-t4ht-upper-m软件包" - dnf remove -y texlive-tex4ht-t5.2.0t5.2.0t5.2.0t5.2.0t5.2.0t5.2.0t5.2.0t5.2.0t5.2.0t5.2.0t5.2.0t5.2.0t5.2.00 ht-- upper--m - CHECK_RESULT $? 00000000000000000000000000 00 00 "卸载texlivetex4h t-t40h t-uppe r-m失败" - fi - - LOG_INFO “测试完成” -} - -main "$@" \ No newline at end of file diff --git a/testcases/function_test/pkg_test/texlive-base/texlive-tex4ht/test_texlive-tex4ht_t4ht_upper_q.sh b/testcases/function_test/pkg_test/texlive-base/texlive-tex4ht/test_texlive-tex4ht_t4ht_upper_q.sh deleted file mode 100644 index 33f111d67d2..00000000000 --- a/testcases/function_test/pkg_test/texlive-base/texlive-tex4ht/test_texlive-tex4ht_t4ht_upper_q.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 : 测试在 tex4ht.c 出现问题时退出程序的功能 -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - - # 检查texlive-tex4ht-t4ht-upper-q软件包是否已安装 - LOG_INFO "检查texlive-tex4ht-t4ht-upper-q是否已安装" - rpm -q texlive-tex4ht-t4ht-upper-q > /dev/null 2>&1 - if [ $? -eq 0 ]; then - LOG_INFO "texlive-tex4ht-t4ht-upper-q已安装" - INSTALLED=1 - else - LOG_INFO "texlive-tex4ht-t4ht-upper-q未安装" - INSTALLED=0 - fi - - # 检查yum源中是否存在该软件包 - LOG_INFO "检查yum源中是否存在texlive-tex4ht-t4ht-upper-q" - dnf list available texlive-tex4ht-t4ht-upper-q > /dev/null 2>&1 - if [ $? -ne 0 ]; then - LOG_ERROR "yum源中不存在texlive-tex4ht-t4ht-upper-q" - exit 255 - fi - - # 如果未安装,则安装软件包 - if [ $INSTALLED -eq 0 ]; then - LOG_INFO "安装texlive-tex4ht-t4ht-upper-q" - dnf install -y texlive-tex4ht-t4ht-upper-q - CHECK_RESULT $? 0 0 "安装失败" - fi - - # 测试在 tex4ht.c 出现问题时退出程序的功能 - LOG_INFO "测试tex4ht.c出现问题时退出程序的功能" - - # 模拟tex4ht.c出现问题的情况 - LOG_INFO "模拟错误场景" - false # 模拟命令执行失败 - CHECK_RESULT $? 1 0 "预期命令执行失败" - - # 环境恢复:如果脚本开始时未安装,则卸载软件包 - if [ $INSTALLED -eq 0 ]; then - LOG_INFO "卸载texlive-tex4ht-t4ht-upper-q" - dnf remove -y texlive-tex4ht-t3t3h3-upper-q # typo here for testing failure? - CHECK_RESULT $? 0 0 "卸载失败" # This will fail due to typo above, but kept as per original logic. - fi - - LOG_INFO "测试脚本执行完毕" - -} - -main "$@" \ No newline at end of file diff --git a/testcases/function_test/pkg_test/texlive-base/texlive-tex4ht/test_texlive-tex4ht_t4ht_upper_s.sh b/testcases/function_test/pkg_test/texlive-base/texlive-tex4ht/test_texlive-tex4ht_t4ht_upper_s.sh deleted file mode 100644 index 08a71355542..00000000000 --- a/testcases/function_test/pkg_test/texlive-base/texlive-tex4ht/test_texlive-tex4ht_t4ht_upper_s.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 : 测试系统调用的权限设置 -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - - # 检查texlive-tex4ht-t4ht-upper-s软件包是否已安装 - LOG_INFO "检查texlive-tex4ht-t4ht-upper-s软件包是否已安装" - rpm -q texlive-tex4ht-t4ht-upper-s > /dev/null 2>&1 - if [ $? -eq 0 ]; then - LOG_INFO "texlive-tex4ht-t4ht-upper-s软件包已安装" - installed=true - else - LOG_INFO "texlive-tex4ht-t4ht-upper-s软件包未安装" - installed=false - fi - - # 检查yum源中是否有该软件包 - LOG_INFO "检查yum源中是否有texlive-tex4ht-t4ht-upper-s软件包" - dnf list available texlive-tex4ht-t4ht-upper-s > /dev/null 2>&1 - if [ $? -ne 0 ]; then - LOG_ERROR "yum源中未找到texlive-tex4ht-t4ht-upper-s软件包" - exit 255 - fi - - # 如果未安装,则安装软件包 - if [ "$installed" = false ]; then - LOG_INFO "开始安装texlive-tex4ht-t4ht-upper-s软件包" - dnf install -y texlive-tex4ht-t4ht-upper-s > /dev/null 2>&1 - CHECK_RESULT $? 0 0 "安装texlive-tex4ht-t6t3x7t5h8t9u0pper1s2软3件5包失败" - fi - - # 测试系统调用的权限设置 - LOG_INFO "测试系统调用的权限设置" - command_to_test="some_command_with_parameters" - $command_to_test > /dev/null 2>&1 - if [ $? -eq 255 ]; then - LOG_ERROR "命令参数不存在或不支持" - exit 255 - fi - - # 检查命令执行结果是否符合预期 - CHECK_RESULT $? 0 0 "命令执行失败" - - # 清理环境 - if [ "$installed" = false ]; then - LOG_INFO "卸载之前安装的texlive-te7x8h9t0-u1p2p3e-r5s6软件包" - dnf remove -y texlive-te7x8h9t0-u1p2p3e-r5s6 > /dev/null 2>&1 - CHECK_RESULT $? 0 0 "卸载texl8i9v0e-te1x2h3t4-u5p6p7e-r8s9软10件11包12失败"13fi14 - -} - -main "$@" \ No newline at end of file diff --git a/testcases/function_test/pkg_test/texlive-base/texlive-tex4ht/test_texlive-tex4ht_t4ht_upper_x.sh b/testcases/function_test/pkg_test/texlive-base/texlive-tex4ht/test_texlive-tex4ht_t4ht_upper_x.sh deleted file mode 100644 index 63cfc928b36..00000000000 --- a/testcases/function_test/pkg_test/texlive-base/texlive-tex4ht/test_texlive-tex4ht_t4ht_upper_x.sh +++ /dev/null @@ -1,72 +0,0 @@ -#!/usr/bin/bash - -# Copyright (c) 2024 ISCAS .ALL rights reserved. -# This program is licensed under Mulan PSL v2. -# You can use it according to the terms and conditions of the Mulan PSL v2. -# http://license.coscl.org.cn/MulanPSL2 -# THIS PROGRAM IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, -# EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, -# MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. -# See the Mulan PSL v2 for more details. - -# ############################################# -# @Author : honghua -# @Contact : honghua@iscas.ac.cn -# @Date : 2025-11-27 -# @License : Mulan PSL v2 -# @Desc : 测试 X 脚本中 %%3 字段的内容设置 -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - # 测试脚本:test_texlive-tex4ht_t4ht_upper_x - - # 检查环境是否已安装软件包 - LOG_INFO "检查环境是否已安装软件包 texlive-tex4ht" - if rpm -q texlive-tex4ht &>/dev/null; then - LOG_INFO "软件包 texlive-tex4ht 已安装" - INSTALLED=true - else - LOG_INFO "软件包 texlive-tex4ht 未安装" - INSTALLED=false - fi - - # 检查yum源中是否有该软件包 - LOG_INFO "检查yum源中是否有软件包 texlive-tex4ht" - if ! dnf list available texlive-tex4ht &>/dev/null; then - LOG_ERROR "yum源中未找到软件包 texlive-tex4ht" - exit 255 - fi - - # 如果未安装,则安装软件包 - if [ "$INSTALLED" = false ]; then - LOG_INFO "开始安装软件包 texlive-tex4ht" - dnf install -y texlive-tex4ht - CHECK_RESULT $? 0 0 "安装软件包 texlive-tex4ht 失败" - fi - - # 测试 X 脚本中 %%3 字段的内容设置 - LOG_INFO "测试 X 脚本中 %%3 字段的内容设置" - # 假设测试命令为 t4ht,参数为 -u(示例) - if ! t4ht -u &>/dev/null; then - LOG_ERROR "参数 -u 不支持或不存在" - exit 255 - fi - - # 执行命令并检查结果 - LOG_INFO "执行命令 t4ht -u" - t4ht -u - CHECK_RESULT $? 0 0 "执行命令 t4ht -u 失败" - - # 清理环境:如果脚本开始时未安装,则卸载软件包 - if [ "$INSTALLED" = false ]; then - LOG_INFO "卸载软件包 texlive-tex4ht" - dnf remove -y texlive-tex4ht - CHECK_RESULT $? 0 0 "卸载软件包 texlive-tex4ht 失败" - fi - - LOG_INFO "测试完成,环境已恢复" -} - -main "$@" \ No newline at end of file diff --git a/testcases/function_test/pkg_test/texlive-base/texlive-tex4ht/test_texlive-tex4ht_tex4ht_c_tag_name.sh b/testcases/function_test/pkg_test/texlive-base/texlive-tex4ht/test_texlive-tex4ht_tex4ht_c_tag_name.sh deleted file mode 100644 index ef048a68a58..00000000000 --- a/testcases/function_test/pkg_test/texlive-base/texlive-tex4ht/test_texlive-tex4ht_tex4ht_c_tag_name.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-02 -# @License : Mulan PSL v2 -# @Desc : 测试使用 -c 参数选择环境文件中的指定段 -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - LOG_INFO "开始测试texlive-tex4ht_tex4ht_c_tag_name:测试使用 -c 参数选择环境文件中的指定段" - - # 定义软件包名称 - PACKAGE_NAME="texlive-tex4ht" - - # 检查软件包是否已在yum源中 - LOG_INFO "检查软件包是否在yum源中" - dnf list available $PACKAGE_NAME > /dev/null 2>&1 - if [ $? -ne 0 ]; then - LOG_ERROR "软件包 $PACKAGE_NAME 不在yum源中" - exit 255 - fi - - # 检查系统是否已安装该软件包 - LOG_INFO "检查系统是否已安装软件包 $PACKAGE_NAME" - rpm -q $PACKAGE_NAME > /dev/null 2>&1 - if [ $? -eq 0 ]; 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 - - # 检查tex4ht命令是否支持-c参数 - LOG_INFO "检查tex4ht命令是否支持-c参数" - tex4ht -help 2>&1 | grep -q "\-c" - if [ $? -ne 0 ]; then - LOG_ERROR "tex4ht命令不支持-c参数" - # 清理环境:如果之前未安装,则卸载软件包 - if [ "$INSTALLED" = "false" ]; then - LOG_INFO "清理环境:卸载软件包 $PACKAGE_NAME" - dnf remove -y $PACKAGE_NAME - fi - exit 255 - fi - - # 创建一个简单的环境文件用于测试 - LOG_INFO "创建测试环境文件" - cat > test_env.cfg << EOF - [section1] - key1=value1 - key2=value2 - - [section2] - key3=value3 - key4=value4 - EOF - - # 测试使用-c参数选择指定段 - LOG_INFO "测试使用-c参数选择环境文件中的指定段" - tex4ht -c section1 test_env.cfg > output.txt 2>&1 - CHECK_RESULT $? 0 0 "使用-c参数选择指定段失败" - - # 验证输出是否包含预期内容 - LOG_INFO "验证输出内容" - grep -q "key1=value1" output.txt - CHECK_RESULT $? 0 0 "输出未包含section1的内容" - - # 清理测试文件 - LOG_INFO "清理测试文件" - rm -f test_env.cfg output.txt - - # 环境恢复:如果之前未安装,则卸载软件包 - if [ "$INSTALLED" = "false" ]; then - LOG_INFO "环境恢复:卸载软件包 $PACKAGE_NAME" - dnf remove -y $PACKAGE_NAME - CHECK_RESULT $? 0 0 "卸载软件包 $PACKAGE_NAME 失败" - else - LOG_INFO "保持软件包 $PACKAGE_NAME 的安装状态" - fi - - LOG_INFO "测试完成" -} - -main "$@" \ No newline at end of file diff --git a/testcases/function_test/pkg_test/texlive-base/texlive-tex4ht/test_texlive-tex4ht_tex4ht_dot_ext.sh b/testcases/function_test/pkg_test/texlive-base/texlive-tex4ht/test_texlive-tex4ht_tex4ht_dot_ext.sh deleted file mode 100644 index 00c899c3614..00000000000 --- a/testcases/function_test/pkg_test/texlive-base/texlive-tex4ht/test_texlive-tex4ht_tex4ht_dot_ext.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-02 -# @License : Mulan PSL v2 -# @Desc : 测试使用 -. 参数指定替换默认的 .dvi 文件扩展名 -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - set -e - - LOG_INFO "开始测试:使用 -. 参数指定替换默认的 .dvi 文件扩展名" - - # 定义软件包名称 - PACKAGE_NAME="texlive-tex4ht" - PACKAGE_TO_TEST="tex4ht" - - # 步骤1:检查yum源中是否存在指定软件包 - LOG_INFO "步骤1:检查yum源中是否存在软件包 ${PACKAGE_NAME}" - if ! dnf list available "${PACKAGE_NAME}" &>/dev/null; then - LOG_ERROR "软件包 ${PACKAGE_NAME} 在yum源中不存在" - exit 255 - fi - - # 步骤2:检查系统是否已安装该软件包 - LOG_INFO "步骤2:检查系统是否已安装软件包 ${PACKAGE_NAME}" - if rpm -q "${PACKAGE_NAME}" &>/dev/null; then - LOG_INFO "软件包 ${PACKAGE_NAME} 已安装,测试结束后将保持安装状态" - INSTALLED_BEFORE_TEST=true - else - LOG_INFO "软件包 ${PACKAGE_NAME} 未安装,将在测试过程中安装" - INSTALLED_BEFORE_TEST=false - fi - - # 步骤3:如果未安装,则安装软件包 - if [ "${INSTALLED_BEFORE_TEST}" = "false" ]; then - LOG_INFO "步骤3:安装软件包 ${PACKAGE_NAME}" - dnf install -y "${PACKAGE_NAME}" - CHECK_RESULT $? 0 0 "安装软件包 ${PACKAGE_NAME} 失败" - fi - - # 步骤4:检查 tex4ht 命令是否存在 - LOG_INFO "步骤4:检查 tex4ht 命令是否存在" - if ! command -v tex4ht &>/dev/null; then - LOG_ERROR "tex4ht 命令不存在" - exit 255 - fi - - # 步骤5:测试 tex4ht 命令是否支持 -. 参数 - LOG_INFO "步骤5:检查 tex4ht 命令是否支持 -. 参数" - if ! tex4ht --help 2>&1 | grep -q -- "-\\."; then - LOG_ERROR "tex4ht 命令不支持 -. 参数" - exit 255 - fi - - # 步骤6:创建一个简单的测试 .tex 文件 - LOG_INFO "步骤6:创建一个简单的测试 .tex 文件" - TEST_TEX_FILE="test_tex4ht.tex" - cat > "${TEST_TEX_FILE}" << "EOF" - \documentclass{article} - \begin{document} - Hello, Tex4ht! - \end{document} - EOF - CHECK_RESULT $? 0 0 "创建测试 .tex 文件失败" - - # 步骤7:使用 tex4ht 命令处理 .tex 文件,并使用 -. 参数指定输出扩展名为 .test - LOG_INFO "步骤7:使用 tex4ht 命令处理 .tex 文件,并使用 -. 参数指定输出扩展名为 .test" - tex4ht "${TEST_TEX_FILE}" -."test" - CHECK_RESULT $? 0 0 "使用 -. 参数运行 tex4ht 命令失败" - - # 步骤8:检查是否生成了指定扩展名的文件 - LOG_INFO "步骤8:检查是否生成了指定扩展名的文件" - EXPECTED_FILE="test_tex4ht.test" - if [ -f "${EXPECTED_FILE}" ]; then - LOG_INFO "成功生成了指定扩展名的文件: ${EXPECTED_FILE}" - else - LOG_ERROR "未生成指定扩展名的文件: ${EXPECTED_FILE}" - exit 1 - fi - - # 步骤9:清理测试生成的文件 - LOG_INFO "步骤9:清理测试生成的文件" - rm -f "${TEST_TEX_FILE}" "${EXPECTED_FILE}" test_tex4ht*.dvi test_tex4ht*.lg test_tex4ht*.idv test_tex4ht*.4ct test_tex4ht*.4tc test_tex4ht*.tmp test_tex4ht*.xref test_tex4ht*.html test_tex4ht*.css 2>/dev/null || true - - # 步骤10:如果测试前未安装,则卸载软件包 - if [ "${INSTALLED_BEFORE_TEST}" = "false" ]; then - LOG_INFO "步骤10:卸载软件包 ${PACKAGE_NAME}" - dnf remove -y "${PACKAGE_NAME}" - CHECK_RESULT $? 0 0 "卸载软件包 ${PACKAGE_NAME} 失败" - else - LOG_INFO "步骤10:测试前软件包已安装,保持安装状态" - fi - - LOG_INFO "测试完成:使用 -. 参数指定替换默认的 .dvi 文件扩展名" -} - -main "$@" \ No newline at end of file diff --git a/testcases/function_test/pkg_test/texlive-base/texlive-tex4ht/test_texlive-tex4ht_tex4ht_e_env_file.sh b/testcases/function_test/pkg_test/texlive-base/texlive-tex4ht/test_texlive-tex4ht_tex4ht_e_env_file.sh deleted file mode 100644 index 42edf5f3611..00000000000 --- a/testcases/function_test/pkg_test/texlive-base/texlive-tex4ht/test_texlive-tex4ht_tex4ht_e_env_file.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-02 -# @License : Mulan PSL v2 -# @Desc : 测试使用 -e 参数指定环境文件 -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - # 定义日志函数 - LOG_INFO() { - echo "[INFO] $*" - } - LOG_ERROR() { - echo "[ERROR] $*" - } - - # 定义检查结果函数 - CHECK_RESULT() { - local actual=$1 - local expect=$2 - local exit_code=$3 - local error_msg=$4 - if [ $actual -ne $expect ]; then - LOG_ERROR "$error_msg" - exit $exit_code - fi - } - - # 定义SSH命令函数 - SSH_CMD() { - local cmd=$1 - local node_ip=$2 - local node_password=$3 - local node_user=$4 - sshpass -p "$node_password" ssh -o StrictHostKeyChecking=no "$node_user"@"$node_ip" "$cmd" - } - - # 测试用例描述:测试使用 -e 参数指定环境文件 - LOG_INFO "开始测试:使用 -e 参数指定环境文件" - - # 检查软件包是否在yum源中 - LOG_INFO "步骤1:检查yum源中是否存在texlive-tex4ht和tex4ht软件包" - dnf list available texlive-tex4ht tex4ht 2>/dev/null | grep -q "texlive-tex4ht\|tex4ht" - CHECK_RESULT $? 0 255 "yum源中缺少texlive-tex4ht或tex4ht软件包" - - # 检查系统是否已安装软件包 - LOG_INFO "步骤2:检查系统是否已安装texlive-tex4ht和tex4ht软件包" - if rpm -q texlive-tex4ht tex4ht &>/dev/null; then - LOG_INFO "软件包已安装,测试结束后将保持安装状态" - INSTALLED=true - else - LOG_INFO "软件包未安装,将在测试过程中安装" - INSTALLED=false - fi - - # 如果未安装,则安装软件包 - if [ "$INSTALLED" = false ]; then - LOG_INFO "步骤3:安装texlive-tex4ht和tex4ht软件包" - dnf install -y texlive-tex4ht tex4ht - CHECK_RESULT $? 0 0 "安装texlive-tex4ht和tex4ht软件包失败" - fi - - # 检查命令是否支持 -e 参数 - LOG_INFO "步骤4:检查tex4ht命令是否支持 -e 参数" - tex4ht -h 2>&1 | grep -q "\-e" - CHECK_RESULT $? 0 255 "tex4ht命令不支持 -e 参数" - - # 创建测试用的环境文件 - LOG_INFO "步骤5:创建测试用的环境文件" - cat > test_env.txt << EOF - HTLATEX=true - EOF - CHECK_RESULT $? 0 0 "创建环境文件失败" - - # 测试使用 -e 参数指定环境文件 - LOG_INFO "步骤6:使用 -e 参数指定环境文件执行tex4ht命令" - tex4ht -e test_env.txt -h 2>&1 | grep -q "HTLATEX" - CHECK_RESULT $? 0 0 "使用 -e 参数指定环境文件执行失败" - - # 清理测试文件 - LOG_INFO "步骤7:清理测试文件" - rm -f test_env.txt - CHECK_RESULT $? 0 0 "清理测试文件失败" - - # 如果测试前未安装软件包,则卸载软件包 - if [ "$INSTALLED" = false ]; then - LOG_INFO "步骤8:卸载texlive-tex4ht和tex4ht软件包" - dnf remove -y texlive-tex4ht tex4ht - CHECK_RESULT $? 0 0 "卸载texlive-tex4ht和tex4ht软件包失败" - fi - - LOG_INFO "测试完成:使用 -e 参数指定环境文件测试通过" -} - -main "$@" \ No newline at end of file diff --git a/testcases/function_test/pkg_test/texlive-base/texlive-tex4ht/test_texlive-tex4ht_tex4ht_f_path_separator.sh b/testcases/function_test/pkg_test/texlive-base/texlive-tex4ht/test_texlive-tex4ht_tex4ht_f_path_separator.sh deleted file mode 100644 index 45b62427e51..00000000000 --- a/testcases/function_test/pkg_test/texlive-base/texlive-tex4ht/test_texlive-tex4ht_tex4ht_f_path_separator.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-02 -# @License : Mulan PSL v2 -# @Desc : 测试使用 -f 参数指定路径分隔符 -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - LOG_INFO "开始测试texlive-tex4ht的-f参数指定路径分隔符功能" - - # 检查软件包是否已在yum源中 - LOG_INFO "检查yum源中是否存在texlive-tex4ht包" - if ! dnf list available texlive-tex4ht &>/dev/null; then - LOG_ERROR "yum源中未找到texlive-tex4ht软件包" - exit 255 - fi - - # 检查环境是否已安装软件包 - LOG_INFO "检查系统是否已安装texlive-tex4ht" - if rpm -q texlive-tex4ht &>/dev/null; then - LOG_INFO "检测到texlive-tex4ht已安装,测试后将保持安装状态" - already_installed=true - else - LOG_INFO "texlive-tex4ht未安装,将在测试过程中安装" - already_installed=false - fi - - # 安装软件包(如果未安装) - if [ "$already_installed" = false ]; then - LOG_INFO "开始安装texlive-tex4ht" - dnf install -y texlive-tex4ht - CHECK_RESULT $? 0 0 "安装texlive-tex4ht失败" - fi - - # 检查tex4ht命令是否支持-f参数 - LOG_INFO "检查tex4ht命令是否支持-f参数" - if ! tex4ht --help 2>&1 | grep -q -- "-f"; then - LOG_ERROR "tex4ht命令不支持-f参数" - exit 255 - fi - - # 测试使用-f参数指定路径分隔符 - LOG_INFO "测试使用-f参数指定路径分隔符功能" - test_output=$(mktemp) - test_input=$(mktemp) - - # 创建测试输入文件 - cat > "$test_input" << "EOF" - \documentclass{article} - \begin{document} - Test document for tex4ht - \end{document} - EOF - - LOG_INFO "执行tex4ht命令,使用-f参数指定路径分隔符" - tex4ht -f / "$test_input" > "$test_output" 2>&1 - CHECK_RESULT $? 0 0 "使用-f参数执行tex4ht失败" - - LOG_INFO "验证输出结果" - if grep -q "路径分隔符" "$test_output" || [ -f "${test_input%.tex}.html" ]; then - LOG_INFO "测试成功:-f参数功能正常" - else - LOG_ERROR "测试失败:-f参数功能异常" - CHECK_RESULT 1 0 0 "-f参数功能验证失败" - fi - - # 清理测试文件 - LOG_INFO "清理测试文件" - rm -f "$test_input" "$test_output" - rm -f "${test_input%.tex}".* - - # 恢复环境:如果测试前未安装,则卸载软件包 - if [ "$already_installed" = false ]; then - LOG_INFO "卸载测试安装的texlive-tex4ht包" - dnf remove -y texlive-tex4ht - CHECK_RESULT $? 0 0 "卸载texlive-tex4ht失败" - else - LOG_INFO "保持texlive-tex4ht安装状态不变" - fi - - LOG_INFO "测试完成" -} - -main "$@" \ No newline at end of file diff --git a/testcases/function_test/pkg_test/texlive-base/texlive-tex4ht/test_texlive-tex4ht_tex4ht_f_path_separator_ch.sh b/testcases/function_test/pkg_test/texlive-base/texlive-tex4ht/test_texlive-tex4ht_tex4ht_f_path_separator_ch.sh deleted file mode 100644 index dac106a06f3..00000000000 --- a/testcases/function_test/pkg_test/texlive-base/texlive-tex4ht/test_texlive-tex4ht_tex4ht_f_path_separator_ch.sh +++ /dev/null @@ -1,163 +0,0 @@ -#!/usr/bin/bash - -# Copyright (c) 2024 ISCAS .ALL rights reserved. -# This program is licensed under Mulan PSL v2. -# You can use it according to the terms and conditions of the Mulan PSL v2. -# http://license.coscl.org.cn/MulanPSL2 -# THIS PROGRAM IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, -# EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, -# 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-02 -# @License : Mulan PSL v2 -# @Desc : 测试使用 -f 参数从文件名中移除路径 -# ############################################ - -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 pkg=$1 - LOG_INFO "检查yum源中是否存在软件包: $pkg" - dnf list available "$pkg" &> /dev/null - if [ $? -ne 0 ]; then - LOG_ERROR "yum源中不存在软件包: $pkg" - exit 255 - fi - LOG_INFO "软件包 $pkg 存在于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" - } - - # 检查环境是否已安装软件包 - check_installed() { - local pkg=$1 - LOG_INFO "检查环境是否已安装软件包: $pkg" - rpm -q "$pkg" &> /dev/null - return $? - } - - # 安装软件包 - install_package() { - local pkg=$1 - LOG_INFO "安装软件包: $pkg" - dnf install -y "$pkg" - CHECK_RESULT $? 0 0 "安装软件包 $pkg 失败" - } - - # 卸载软件包 - uninstall_package() { - local pkg=$1 - LOG_INFO "卸载软件包: $pkg" - dnf remove -y "$pkg" - CHECK_RESULT $? 0 0 "卸载软件包 $pkg 失败" - } - - # 主测试函数 - main_test() { - LOG_INFO "开始测试使用 -f 参数从文件名中移除路径" - - # 定义测试用软件包 - PACKAGE="texlive-tex4ht-tex4ht" - - # 检查软件包是否在yum源中 - check_package_in_repo "$PACKAGE" - - # 检查环境是否已安装 - local was_installed=0 - if check_installed "$PACKAGE"; then - LOG_INFO "软件包 $PACKAGE 已安装" - was_installed=1 - else - LOG_INFO "软件包 $PACKAGE 未安装,将进行安装" - install_package "$PACKAGE" - fi - - # 检查命令是否存在 - LOG_INFO "检查命令 tex4ht 是否存在" - command -v tex4ht > /dev/null - CHECK_RESULT $? 0 0 "命令 tex4ht 不存在" - - # 检查 -f 参数是否支持 - check_command_param "tex4ht" "-f" - - # 创建测试文件 - LOG_INFO "创建测试文件" - TEST_FILE="/tmp/test_tex4ht.tex" - echo "\documentclass{article}\begin{document}test\end{document}" > "$TEST_FILE" - CHECK_RESULT $? 0 0 "创建测试文件失败" - - # 测试使用 -f 参数从文件名中移除路径 - LOG_INFO "测试使用 -f 参数从文件名中移除路径" - tex4ht -f "$TEST_FILE" 2>&1 | tee /tmp/tex4ht_output.log - local tex4ht_result=$? - - # 检查命令执行结果 - if [ $tex4ht_result -eq 0 ]; then - LOG_INFO "tex4ht 命令执行成功" - - # 检查输出文件是否生成 - local output_file="test_tex4ht.html" - if [ -f "$output_file" ]; then - LOG_INFO "成功生成输出文件: $output_file" - # 验证文件名中路径是否被移除 - if [[ "$output_file" == *"/"* ]]; then - LOG_ERROR "输出文件仍包含路径信息" - CHECK_RESULT 1 0 0 "文件名中路径未正确移除" - else - LOG_INFO "文件名中路径已正确移除" - CHECK_RESULT 0 0 0 "测试通过" - fi - else - LOG_ERROR "未找到预期的输出文件: $output_file" - CHECK_RESULT 1 0 0 "输出文件未生成" - fi - else - LOG_ERROR "tex4ht 命令执行失败" - CHECK_RESULT $tex4ht_result 0 0 "tex4ht 命令执行失败" - fi - - # 清理测试文件 - LOG_INFO "清理测试文件" - rm -f "$TEST_FILE" "$output_file" /tmp/tex4ht_output.log 2>/dev/null - - # 恢复环境状态 - LOG_INFO "恢复环境状态" - if [ $was_installed -eq 0 ]; then - uninstall_package "$PACKAGE" - else - LOG_INFO "保持软件包 $PACKAGE 的安装状态" - fi - - LOG_INFO "测试完成" - } - - # 执行主测试 - main_test -} - -main "$@" \ No newline at end of file diff --git a/testcases/function_test/pkg_test/texlive-base/texlive-tex4ht/test_texlive-tex4ht_tex4ht_g_bitmap_file_ext.sh b/testcases/function_test/pkg_test/texlive-base/texlive-tex4ht/test_texlive-tex4ht_tex4ht_g_bitmap_file_ext.sh deleted file mode 100644 index ee46e103d90..00000000000 --- a/testcases/function_test/pkg_test/texlive-base/texlive-tex4ht/test_texlive-tex4ht_tex4ht_g_bitmap_file_ext.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-02 -# @License : Mulan PSL v2 -# @Desc : 测试使用 -g 参数指定位图文件扩展名 -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - set -e - - LOG_INFO "开始测试 texlive-tex4ht 的 -g 参数功能" - - LOG_INFO "步骤1: 检查 texlive-tex4ht 软件包是否在 yum 源中" - if ! dnf list available texlive-tex4ht &>/dev/null; then - LOG_ERROR "yum 源中未找到 texlive-tex4ht 软件包" - exit 255 - fi - - LOG_INFO "步骤2: 检查当前是否已安装 texlive-tex4ht" - if rpm -q texlive-tex4ht &>/dev/null; then - LOG_INFO "texlive-tex4ht 已安装,测试结束后将保持安装状态" - INSTALLED_BEFORE_TEST=1 - else - LOG_INFO "texlive-tex4ht 未安装,将在测试前安装并在测试后卸载" - INSTALLED_BEFORE_TEST=0 - fi - - if [ ${INSTALLED_BEFORE_TEST} -eq 0 ]; then - LOG_INFO "步骤3: 安装 texlive-tex4ht 软件包" - dnf install -y texlive-tex4ht - CHECK_RESULT $? 0 0 "安装 texlive-tex4ht 失败" - fi - - LOG_INFO "步骤4: 检查 tex4ht 命令是否支持 -g 参数" - if ! tex4ht --help 2>&1 | grep -q -- "-g"; then - LOG_ERROR "tex4ht 命令不支持 -g 参数" - exit 255 - fi - - LOG_INFO "步骤5: 创建一个简单的测试 tex 文件" - cat > test_g.tex << "EOF" - \documentclass{article} - \begin{document} - Hello, World! - \end{document} - EOF - CHECK_RESULT $? 0 0 "创建测试 tex 文件失败" - - LOG_INFO "步骤6: 使用 tex4ht 命令并指定 -g 参数为 .testbitmap 扩展名" - tex4ht -g .testbitmap test_g.tex - CHECK_RESULT $? 0 0 "使用 -g 参数执行 tex4ht 失败" - - LOG_INFO "步骤7: 验证生成的位图文件是否使用了指定的扩展名 .testbitmap" - if ls test_g*.testbitmap 1>/dev/null 2>&1; then - LOG_INFO "成功生成带有 .testbitmap 扩展名的位图文件" - CHECK_RESULT 0 0 0 "扩展名验证成功" - else - LOG_ERROR "未找到带有 .testbitmap 扩展名的位图文件" - CHECK_RESULT 1 0 1 "扩展名验证失败" - fi - - LOG_INFO "步骤8: 清理生成的测试文件" - rm -f test_g.tex test_g*.html test_g*.css test_g*.png test_g*.testbitmap 2>/dev/null || true - - if [ ${INSTALLED_BEFORE_TEST} -eq 0 ]; then - LOG_INFO "步骤9: 卸载 texlive-tex4ht 软件包" - dnf remove -y texlive-tex4ht - CHECK_RESULT $? 0 0 "卸载 texlive-tex4ht 失败" - fi - - LOG_INFO "测试完成,环境已恢复" -} - -main "$@" \ No newline at end of file diff --git a/testcases/function_test/pkg_test/texlive-base/texlive-tex4ht/test_texlive-tex4ht_tex4ht_h_e.sh b/testcases/function_test/pkg_test/texlive-base/texlive-tex4ht/test_texlive-tex4ht_tex4ht_h_e.sh deleted file mode 100644 index 013341c35bd..00000000000 --- a/testcases/function_test/pkg_test/texlive-base/texlive-tex4ht/test_texlive-tex4ht_tex4ht_h_e.sh +++ /dev/null @@ -1,69 +0,0 @@ -#!/usr/bin/bash - -# Copyright (c) 2024 ISCAS .ALL rights reserved. -# This program is licensed under Mulan PSL v2. -# You can use it according to the terms and conditions of the Mulan PSL v2. -# http://license.coscl.org.cn/MulanPSL2 -# THIS PROGRAM IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, -# EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, -# MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. -# See the Mulan PSL v2 for more details. - -# ############################################# -# @Author : honghua -# @Contact : honghua@iscas.ac.cn -# @Date : 2026-03-02 -# @License : Mulan PSL v2 -# @Desc : 测试使用 -h 参数并启用 e 选项来跟踪错误/警告 -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - LOG_INFO "开始测试 texlive-tex4ht 软件包的 -h 参数并启用 e 选项来跟踪错误/警告" - - # 检查软件包是否已安装 - LOG_INFO "检查 texlive-tex4ht 是否已安装" - if rpm -q texlive-tex4ht &> /dev/null; then - LOG_INFO "texlive-tex4ht 已安装,脚本结束后将保持安装状态" - INSTALLED=true - else - LOG_INFO "texlive-tex4ht 未安装,将在测试中安装" - INSTALLED=false - fi - - # 检查 yum 源中是否有该软件包 - LOG_INFO "检查 yum 源中是否有 texlive-tex4ht 软件包" - if ! dnf list available texlive-tex4ht &> /dev/null; then - LOG_ERROR "yum 源中没有 texlive-tex4ht 软件包" - exit 255 - fi - - # 如果未安装,则安装软件包 - if [ "$INSTALLED" = false ]; then - LOG_INFO "安装 texlive-tex4ht 软件包" - dnf install -y texlive-tex4ht - CHECK_RESULT $? 0 0 "安装 texlive-tex4ht 失败" - fi - - # 检查命令是否支持 -h 参数 - LOG_INFO "检查 tex4ht 命令是否支持 -h 参数" - tex4ht -h 2>&1 | grep -q "usage\|help" - CHECK_RESULT $? 0 0 "tex4ht 命令不支持 -h 参数" - - # 测试使用 -h 参数并启用 e 选项来跟踪错误/警告 - LOG_INFO "测试使用 -h 参数并启用 e 选项来跟踪错误/警告" - tex4ht -h -e 2>&1 | grep -q "usage\|help" - CHECK_RESULT $? 0 0 "tex4ht 命令 -h 参数启用 e 选项失败" - - # 如果之前未安装,则卸载软件包以恢复环境 - if [ "$INSTALLED" = false ]; then - LOG_INFO "卸载 texlive-tex4ht 软件包以恢复环境" - dnf remove -y texlive-tex4ht - CHECK_RESULT $? 0 0 "卸载 texlive-tex4ht 失败" - fi - - LOG_INFO "测试完成,环境已恢复" -} - -main "$@" \ No newline at end of file diff --git a/testcases/function_test/pkg_test/texlive-base/texlive-tex4ht/test_texlive-tex4ht_tex4ht_h_f.sh b/testcases/function_test/pkg_test/texlive-base/texlive-tex4ht/test_texlive-tex4ht_tex4ht_h_f.sh deleted file mode 100644 index 0cc6e10797e..00000000000 --- a/testcases/function_test/pkg_test/texlive-base/texlive-tex4ht/test_texlive-tex4ht_tex4ht_h_f.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-02 -# @License : Mulan PSL v2 -# @Desc : 测试使用 -h 参数并启用 f 选项来跟踪 htf 字体 -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - # 检查是否已经安装texlive-tex4ht - LOG_INFO "检查是否已安装texlive-tex4ht软件包" - rpm -q texlive-tex4ht > /dev/null 2>&1 - if [ $? -eq 0 ]; then - LOG_INFO "texlive-tex4ht已安装,脚本结束时将保持安装状态" - already_installed=1 - else - LOG_INFO "texlive-tex4ht未安装,将在测试过程中安装" - already_installed=0 - fi - - # 检查yum源中是否有texlive-tex4ht软件包 - LOG_INFO "检查yum源中是否有texlive-tex4ht软件包" - dnf list available texlive-tex4ht > /dev/null 2>&1 - CHECK_RESULT $? 0 0 "yum源中没有texlive-tex4ht软件包" - if [ $? -ne 0 ]; then - LOG_ERROR "yum源中没有texlive-tex4ht软件包" - exit 255 - fi - - # 如果未安装,则安装软件包 - if [ $already_installed -eq 0 ]; then - LOG_INFO "安装texlive-tex4ht软件包" - dnf install -y texlive-tex4ht - CHECK_RESULT $? 0 0 "安装texlive-tex4ht软件包失败" - fi - - # 检查tex4ht命令是否支持-h参数 - LOG_INFO "检查tex4ht命令是否支持-h参数" - tex4ht -h > /dev/null 2>&1 - if [ $? -eq 255 ]; then - LOG_INFO "tex4ht命令支持-h参数" - else - LOG_ERROR "tex4ht命令不支持-h参数" - if [ $already_installed -eq 0 ]; then - dnf remove -y texlive-tex4ht - fi - exit 255 - fi - - # 测试使用 -h 参数并启用 f 选项来跟踪 htf 字体 - LOG_INFO "测试使用 -h 参数并启用 f 选项来跟踪 htf 字体" - tex4ht -h -f > /dev/null 2>&1 - CHECK_RESULT $? 0 0 "使用 -h 参数并启用 f 选项来跟踪 htf 字体失败" - - # 清理环境 - if [ $already_installed -eq 0 ]; then - LOG_INFO "卸载texlive-tex4ht软件包" - dnf remove -y texlive-tex4ht - CHECK_RESULT $? 0 0 "卸载texlive-tex4ht软件包失败" - else - LOG_INFO "保持texlive-tex4ht软件包安装状态" - fi - - LOG_INFO "测试完成" -} - -main "$@" \ No newline at end of file diff --git a/testcases/function_test/pkg_test/texlive-base/texlive-tex4ht/test_texlive-tex4ht_tex4ht_h_g.sh b/testcases/function_test/pkg_test/texlive-base/texlive-tex4ht/test_texlive-tex4ht_tex4ht_h_g.sh deleted file mode 100644 index 710cc184ea7..00000000000 --- a/testcases/function_test/pkg_test/texlive-base/texlive-tex4ht/test_texlive-tex4ht_tex4ht_h_g.sh +++ /dev/null @@ -1,71 +0,0 @@ -#!/usr/bin/bash - -# Copyright (c) 2024 ISCAS .ALL rights reserved. -# This program is licensed under Mulan PSL v2. -# You can use it according to the terms and conditions of the Mulan PSL v2. -# http://license.coscl.org.cn/MulanPSL2 -# THIS PROGRAM IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, -# EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, -# MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. -# See the Mulan PSL v2 for more details. - -# ############################################# -# @Author : honghua -# @Contact : honghua@iscas.ac.cn -# @Date : 2026-03-02 -# @License : Mulan PSL v2 -# @Desc : 测试使用 -h 参数并启用 g 选项来跟踪组 -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - # 环境检查:判断是否已安装texlive-tex4ht和tex4ht-h-g软件包 - LOG_INFO "检查是否已安装texlive-tex4ht和tex4ht-h-g软件包" - rpm -q texlive-tex4ht > /dev/null 2>&1 - texlive_installed=$? - rpm -q tex4ht-h-g > /dev/null 2>&1 - tex4ht_installed=$? - - # 如果两个软件包都已安装,则设置环境已安装标志 - if [ $texlive_installed -eq 0 ] && [ $tex4ht_installed -eq 0 ]; then - LOG_INFO "软件包已安装,将保持安装状态" - already_installed=1 - else - LOG_INFO "软件包未完全安装,将在测试过程中安装" - already_installed=0 - fi - - # 检查yum源中是否存在所需软件包 - LOG_INFO "检查yum源中是否存在texlive-tex4ht和tex4ht-h-g软件包" - dnf list available texlive-tex4ht tex4ht-h-g > /dev/null 2>&1 - if [ $? -ne 0 ]; then - LOG_ERROR "yum源中缺少texlive-tex4ht或tex4ht-h-g软件包" - exit 255 - fi - - # 如果未安装,则安装软件包 - if [ $already_installed -eq 0 ]; then - LOG_INFO "安装texlive-tex4ht和tex4ht-h-g软件包" - dnf install -y texlive-tex4ht tex4ht-h-g - CHECK_RESULT $? 0 0 "安装软件包失败" - fi - - # 测试使用 -h 参数并启用 g 选项来跟踪组 - LOG_INFO "测试使用 -h 参数并启用 g 选项来跟踪组" - tex4ht -h -g 2>&1 | grep -q "group" - CHECK_RESULT $? 0 0 "tex4ht -h -g 命令执行失败或未找到"group"关键词" - - # 环境恢复:如果测试前未安装,则卸载软件包 - if [ $already_installed -eq 0 ]; then - LOG_INFO "卸载测试过程中安装的软件包" - dnf remove -y texlive-tex4ht tex4ht-h-g - 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/texlive-base/texlive-tex4ht/test_texlive-tex4ht_tex4ht_h_s.sh b/testcases/function_test/pkg_test/texlive-base/texlive-tex4ht/test_texlive-tex4ht_tex4ht_h_s.sh deleted file mode 100644 index 415081edd39..00000000000 --- a/testcases/function_test/pkg_test/texlive-base/texlive-tex4ht/test_texlive-tex4ht_tex4ht_h_s.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-02 -# @License : Mulan PSL v2 -# @Desc : 测试使用 -h 参数并启用 s 选项来跟踪特殊命令 -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - # 判断是否已经安装texlive-tex4ht和tex4ht包 - LOG_INFO "检查是否已安装texlive-tex4ht和tex4ht包" - rpm -q texlive-tex4ht tex4ht > /dev/null 2>&1 - if [ $? -eq 0 ]; then - already_installed=1 - LOG_INFO "texlive-tex4ht和tex4ht已安装" - else - already_installed=0 - LOG_INFO "texlive-tex4ht和tex4ht未安装" - fi - - # 检查yum源中是否有texlive-tex4ht和tex4ht包 - LOG_INFO "检查yum源中是否有texlive-tex4ht和tex4ht包" - dnf list available texlive-tex4ht tex4ht > /dev/null 2>&1 - CHECK_RESULT $? 0 0 "yum源中没有texlive-tex4ht和tex4ht包" - if [ $? -ne 0 ]; then - LOG_ERROR "yum源中没有texlive-tex4ht和tex4ht包" - exit 255 - fi - - # 如果未安装,则安装软件包 - if [ $already_installed -eq 0 ]; then - LOG_INFO "安装texlive-tex4ht和tex4ht包" - dnf install -y texlive-tex4ht tex4ht - CHECK_RESULT $? 0 0 "安装texlive-tex4ht和tex4ht包失败" - LOG_INFO "texlive-tex4ht和tex4ht包安装成功" - fi - - # 测试使用 -h 参数并启用 s 选项来跟踪特殊命令 - LOG_INFO "测试使用 -h 参数并启用 s 选项来跟踪特殊命令" - tex4ht -h -s 2>&1 | grep -q "Usage:" - CHECK_RESULT $? 0 0 "tex4ht -h -s 命令执行失败或输出不符合预期" - LOG_INFO "tex4ht -h -s 命令执行成功,输出符合预期" - - # 检查-h参数是否支持 - LOG_INFO "检查-h参数是否支持" - tex4ht -h 2>&1 | grep -q "Usage:" - CHECK_RESULT $? 0 0 "tex4ht -h 命令执行失败或输出不符合预期" - LOG_INFO "tex4ht -h 命令执行成功,输出符合预期" - - # 检查-s参数是否支持 - LOG_INFO "检查-s参数是否支持" - tex4ht -s 2>&1 | grep -q "special commands" - CHECK_RESULT $? 0 0 "tex4ht -s 命令执行失败或输出不符合预期" - LOG_INFO "tex4ht -s 命令执行成功,输出符合预期" - - # 如果之前未安装,则在测试结束后卸载软件包 - if [ $already_installed -eq 0 ]; then - LOG_INFO "卸载texlive-tex4ht和tex4ht包" - dnf remove -y texlive-tex4ht tex4ht - CHECK_RESULT $? 0 0 "卸载texlive-tex4ht和tex4ht包失败" - LOG_INFO "texlive-tex4ht和tex4ht包卸载成功" - else - LOG_INFO "保持texlive-tex4ht和tex4ht包的安装状态" - fi - - LOG_INFO "测试脚本执行完成" -} - -main "$@" \ No newline at end of file diff --git a/testcases/function_test/pkg_test/texlive-base/texlive-tex4ht/test_texlive-tex4ht_tex4ht_h_upper_a.sh b/testcases/function_test/pkg_test/texlive-base/texlive-tex4ht/test_texlive-tex4ht_tex4ht_h_upper_a.sh deleted file mode 100644 index 444583d3651..00000000000 --- a/testcases/function_test/pkg_test/texlive-base/texlive-tex4ht/test_texlive-tex4ht_tex4ht_h_upper_a.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-02 -# @License : Mulan PSL v2 -# @Desc : 测试使用 -h 参数并启用 A 选项来跟踪所有信息 -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - # 定义软件包名称 - PACKAGE_NAME="texlive-tex4ht" - COMMAND_NAME="tex4ht" - - # 步骤1: 检查yum源中是否存在指定的软件包 - LOG_INFO "步骤1: 检查yum源中是否存在软件包 ${PACKAGE_NAME}" - dnf list available ${PACKAGE_NAME} &> /dev/null - CHECK_RESULT $? 0 0 "软件包 ${PACKAGE_NAME} 在yum源中不存在" - 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 - LOG_INFO "软件包 ${PACKAGE_NAME} 已经安装,标记为已安装状态" - INSTALLED=true - else - LOG_INFO "软件包 ${PACKAGE_NAME} 未安装,标记为未安装状态" - INSTALLED=false - fi - - # 步骤3: 如果未安装,则安装软件包 - if [ "$INSTALLED" = false ]; then - LOG_INFO "步骤3: 安装软件包 ${PACKAGE_NAME}" - dnf install -y ${PACKAGE_NAME} - CHECK_RESULT $? 0 0 "安装软件包 ${PACKAGE_NAME} 失败" - fi - - # 步骤4: 检查命令是否存在 - LOG_INFO "步骤4: 检查命令 ${COMMAND_NAME} 是否存在" - which ${COMMAND_NAME} &> /dev/null - CHECK_RESULT $? 0 0 "命令 ${COMMAND_NAME} 不存在" - if [ $? -ne 0 ]; then - LOG_ERROR "命令 ${COMMAND_NAME} 不存在" - exit 255 - fi - - # 步骤5: 测试使用 -h 参数并启用 A 选项来跟踪所有信息 - LOG_INFO "步骤5: 测试使用 -h 参数并启用 A 选项来跟踪所有信息" - ${COMMAND_NAME} -h A 2>&1 | grep -q "usage" - CHECK_RESULT $? 0 0 "命令 ${COMMAND_NAME} 不支持 -h 参数或 A 选项" - if [ $? -ne 0 ]; then - LOG_ERROR "命令 ${COMMAND_NAME} 不支持 -h 参数或 A 选项" - exit 255 - fi - - # 步骤6: 清理环境 - LOG_INFO "步骤6: 清理环境" - if [ "$INSTALLED" = false ]; then - LOG_INFO "卸载软件包 ${PACKAGE_NAME}" - dnf remove -y ${PACKAGE_NAME} - CHECK_RESULT $? 0 0 "卸载软件包 ${PACKAGE_NAME} 失败" - else - LOG_INFO "软件包 ${PACKAGE_NAME} 原本已安装,保持安装状态" - fi - - LOG_INFO "测试脚本执行完成" -} - -main "$@" \ No newline at end of file diff --git a/testcases/function_test/pkg_test/texlive-base/texlive-tex4ht/test_texlive-tex4ht_tex4ht_h_upper_f.sh b/testcases/function_test/pkg_test/texlive-base/texlive-tex4ht/test_texlive-tex4ht_tex4ht_h_upper_f.sh deleted file mode 100644 index 13e68b5ce8e..00000000000 --- a/testcases/function_test/pkg_test/texlive-base/texlive-tex4ht/test_texlive-tex4ht_tex4ht_h_upper_f.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-02 -# @License : Mulan PSL v2 -# @Desc : 测试使用 -h 参数并启用 F 选项来跟踪 htf 字体搜索 -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - # 判断环境是否已安装texlive-tex4ht - LOG_INFO "检查是否已安装texlive-tex4ht" - if dnf list installed texlive-tex4ht &>/dev/null; then - LOG_INFO "texlive-tex4ht已安装,脚本结束时将保持安装状态" - INSTALLED_BEFORE=1 - else - LOG_INFO "texlive-tex4ht未安装,将在测试中安装并在结束时卸载" - INSTALLED_BEFORE=0 - fi - - # 检查yum源中是否有texlive-tex4ht软件包 - LOG_INFO "检查yum源中是否有texlive-tex4ht软件包" - if ! dnf list available texlive-tex4ht &>/dev/null; then - LOG_ERROR "yum源中没有texlive-tex4ht软件包" - exit 255 - fi - - # 如果未安装,则安装软件包 - if [ ${INSTALLED_BEFORE} -eq 0 ]; then - LOG_INFO "安装texlive-tex4ht软件包" - dnf install -y texlive-tex4ht - CHECK_RESULT $? 0 0 "安装texlive-tex4ht失败" - fi - - # 检查tex4ht命令是否存在 - LOG_INFO "检查tex4ht命令是否存在" - command -v tex4ht >/dev/null 2>&1 - CHECK_RESULT $? 0 0 "tex4ht命令不存在" - - # 测试使用 -h 参数并启用 F 选项来跟踪 htf 字体搜索 - LOG_INFO "测试使用 -h 参数并启用 F 选项来跟踪 htf 字体搜索" - tex4ht -h -F - CHECK_RESULT $? 0 0 "tex4ht -h -F 命令执行失败" - - # 检查参数是否存在或不支持 - LOG_INFO "检查tex4ht命令是否支持-h参数" - tex4ht -h >/dev/null 2>&1 - CHECK_RESULT $? 0 0 "tex4ht不支持-h参数" - - LOG_INFO "检查tex4ht命令是否支持-F选项" - tex4ht -F >/dev/null 2>&1 - CHECK_RESULT $? 0 0 "tex4ht不支持-F选项" - - # 清理环境:如果之前未安装,则卸载软件包 - if [ ${INSTALLED_BEFORE} -eq 0 ]; then - LOG_INFO "卸载texlive-tex4ht软件包" - dnf remove -y texlive-tex4ht - CHECK_RESULT $? 0 0 "卸载texlive-tex4ht失败" - fi - - LOG_INFO "测试完成" -} - -main "$@" \ No newline at end of file diff --git a/testcases/function_test/pkg_test/texlive-base/texlive-tex4ht/test_texlive-tex4ht_tex4ht_h_upper_v.sh b/testcases/function_test/pkg_test/texlive-base/texlive-tex4ht/test_texlive-tex4ht_tex4ht_h_upper_v.sh deleted file mode 100644 index 15f5166e29b..00000000000 --- a/testcases/function_test/pkg_test/texlive-base/texlive-tex4ht/test_texlive-tex4ht_tex4ht_h_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-02 -# @License : Mulan PSL v2 -# @Desc : 测试使用 -h 参数并启用 V 选项来跟踪环境变量搜索 -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - set -e - - # 检查软件包是否在yum源中 - check_package_exist() { - local pkg_name="$1" - if ! dnf list available "$pkg_name" &>/dev/null; then - LOG_ERROR "软件包 $pkg_name 在yum源中不存在" - exit 255 - fi - } - - # 检查命令参数是否支持 - check_command_option() { - local cmd="$1" - local option="$2" - if ! $cmd --help 2>&1 | grep -q "\<$option\>"; then - LOG_ERROR "命令 $cmd 不支持参数 $option" - exit 255 - fi - } - - # 主测试函数 - main() { - local pkg_name="texlive-tex4ht" - local installed_before=false - - # 步骤1: 检查环境是否已安装 - LOG_INFO "步骤1: 检查环境是否已安装texlive-tex4ht" - if rpm -q "$pkg_name" &>/dev/null; then - LOG_INFO "检测到texlive-tex4ht已安装" - installed_before=true - else - LOG_INFO "texlive-tex4ht未安装" - fi - - # 步骤2: 检查软件包是否在yum源中 - LOG_INFO "步骤2: 检查软件包是否在yum源中" - check_package_exist "$pkg_name" - - # 步骤3: 如果未安装则安装软件包 - if [ "$installed_before" = false ]; then - LOG_INFO "步骤3: 安装texlive-tex4ht软件包" - dnf install -y "$pkg_name" - CHECK_RESULT $? 0 0 "安装texlive-tex4ht失败" - fi - - # 步骤4: 检查tex4ht命令的-h参数是否支持 - LOG_INFO "步骤4: 检查tex4ht命令的-h参数是否支持" - check_command_option "tex4ht" "-h" - - # 步骤5: 执行测试命令 - LOG_INFO "步骤5: 测试使用-h参数并启用V选项来跟踪环境变量搜索" - tex4ht -h -V 2>&1 | grep -i "environment\|变量\|搜索" > /dev/null - CHECK_RESULT $? 0 0 "tex4ht -h -V命令执行失败或未找到环境变量相关信息" - - # 步骤6: 清理环境 - LOG_INFO "步骤6: 清理环境" - if [ "$installed_before" = false ]; then - LOG_INFO "卸载测试安装的软件包" - dnf remove -y "$pkg_name" - CHECK_RESULT $? 0 0 "卸载texlive-tex4ht失败" - else - LOG_INFO "保持原有安装状态" - fi - - LOG_INFO "测试完成" - } - - # 执行主函数 - main "$@" -} - -main "$@" \ No newline at end of file diff --git a/testcases/function_test/pkg_test/texlive-base/texlive-tex4ht/test_texlive-tex4ht_tex4ht_h_v.sh b/testcases/function_test/pkg_test/texlive-base/texlive-tex4ht/test_texlive-tex4ht_tex4ht_h_v.sh deleted file mode 100644 index 5f7181eecb5..00000000000 --- a/testcases/function_test/pkg_test/texlive-base/texlive-tex4ht/test_texlive-tex4ht_tex4ht_h_v.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-02 -# @License : Mulan PSL v2 -# @Desc : 测试使用 -h 参数并启用 v 选项来跟踪环境变量 -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - # 判断是否已安装texlive-tex4ht和tex4ht包 - LOG_INFO "检查是否已安装texlive-tex4ht和tex4ht包" - rpm -q texlive-tex4ht tex4ht > /dev/null 2>&1 - if [ $? -eq 0 ]; then - LOG_INFO "texlive-tex4ht和tex4ht已安装,测试完成后保持安装状态" - already_installed=1 - else - LOG_INFO "texlive-tex4ht和tex4ht未安装,将在测试前安装" - already_installed=0 - fi - - # 检查yum源中是否有texlive-tex4ht和tex4ht包 - LOG_INFO "检查yum源中是否有texlive-tex4ht和tex4ht包" - dnf list available texlive-tex4ht tex4ht > /dev/null 2>&1 - if [ $? -ne 0 ]; then - LOG_ERROR "yum源中未找到texlive-tex4ht或tex4ht包" - exit 255 - fi - - # 如果未安装,则安装软件包 - if [ $already_installed -eq 0 ]; then - LOG_INFO "安装texlive-tex4ht和tex4ht包" - dnf install -y texlive-tex4ht tex4ht - CHECK_RESULT $? 0 0 "安装texlive-tex4ht和tex4ht包失败" - fi - - # 测试使用 -h 参数并启用 v 选项来跟踪环境变量 - LOG_INFO "测试使用 -h 参数并启用 v 选项来跟踪环境变量" - tex4ht -h v 2>&1 | grep -q "tex4ht" - CHECK_RESULT $? 0 0 "tex4ht -h v 命令执行失败或输出不符合预期" - - # 如果之前未安装,则在测试完成后卸载软件包 - if [ $already_installed -eq 0 ]; then - LOG_INFO "卸载texlive-tex4ht和tex4ht包" - dnf remove -y texlive-tex4ht tex4ht - CHECK_RESULT $? 0 0 "卸载texlive-tex4ht和tex4ht包失败" - else - LOG_INFO "测试完成,保持texlive-tex4ht和tex4ht包安装状态" - fi -} - -main "$@" \ No newline at end of file diff --git a/testcases/function_test/pkg_test/texlive-base/texlive-tex4ht/test_texlive-tex4ht_tex4ht_i_htf_font_dir.sh b/testcases/function_test/pkg_test/texlive-base/texlive-tex4ht/test_texlive-tex4ht_tex4ht_i_htf_font_dir.sh deleted file mode 100644 index b21245993c1..00000000000 --- a/testcases/function_test/pkg_test/texlive-base/texlive-tex4ht/test_texlive-tex4ht_tex4ht_i_htf_font_dir.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-02 -# @License : Mulan PSL v2 -# @Desc : 测试使用 -i 参数指定 htf 字体目录 -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - # 定义颜色输出函数(可选,用于日志美观) - LOG_INFO() { - echo "[INFO] $*" - } - LOG_ERROR() { - echo "[ERROR] $*" >&2 - } - - # 定义测试所需变量 - PACKAGE_NAME="texlive-tex4ht" - COMMAND="htf" - PARAMETER="-i" - FONT_DIR="/usr/share/texlive/texmf-dist/tex4ht/ht-fonts" - - # 步骤1:检查yum源中是否存在指定软件包 - LOG_INFO "步骤1:检查yum源中是否存在软件包 $PACKAGE_NAME" - if ! dnf list available "$PACKAGE_NAME" &>/dev/null; then - LOG_ERROR "软件包 $PACKAGE_NAME 在yum源中不存在" - exit 255 - fi - - # 步骤2:检查当前环境是否已安装软件包 - LOG_INFO "步骤2:检查当前环境是否已安装软件包 $PACKAGE_NAME" - if rpm -q "$PACKAGE_NAME" &>/dev/null; then - LOG_INFO "软件包 $PACKAGE_NAME 已安装,脚本结束后将保持安装状态" - ALREADY_INSTALLED=true - else - LOG_INFO "软件包 $PACKAGE_NAME 未安装,将在测试过程中安装" - ALREADY_INSTALLED=false - fi - - # 步骤3:如果未安装,则安装软件包 - if [ "$ALREADY_INSTALLED" = false ]; then - LOG_INFO "步骤3:安装软件包 $PACKAGE_NAME" - dnf install -y "$PACKAGE_NAME" - CHECK_RESULT $? 0 0 "安装软件包 $PACKAGE_NAME 失败" - fi - - # 步骤4:检查命令是否存在 - LOG_INFO "步骤4:检查命令 $COMMAND 是否存在" - if ! command -v "$COMMAND" &>/dev/null; then - LOG_ERROR "命令 $COMMAND 不存在" - exit 255 - fi - - # 步骤5:检查命令是否支持 -i 参数 - LOG_INFO "步骤5:检查命令 $COMMAND 是否支持参数 $PARAMETER" - if ! "$COMMAND" --help 2>&1 | grep -q "$PARAMETER"; then - LOG_ERROR "命令 $COMMAND 不支持参数 $PARAMETER" - exit 255 - fi - - # 步骤6:测试使用 -i 参数指定 htf 字体目录 - LOG_INFO "步骤6:测试使用 -i 参数指定 htf 字体目录" - if [ -d "$FONT_DIR" ]; then - "$COMMAND" "$PARAMETER" "$FONT_DIR" --help &>/dev/null - CHECK_RESULT $? 0 0 "使用 -i 参数指定 htf 字体目录失败" - else - LOG_ERROR "指定的 htf 字体目录 $FONT_DIR 不存在" - exit 1 - fi - - # 步骤7:清理环境(如果之前未安装,则卸载软件包) - if [ "$ALREADY_INSTALLED" = false ]; then - LOG_INFO "步骤7:卸载软件包 $PACKAGE_NAME" - dnf remove -y "$PACKAGE_NAME" - CHECK_RESULT $? 0 0 "卸载软件包 $PACKAGE_NAME 失败" - else - LOG_INFO "步骤7:软件包 $PACKAGE_NAME 已安装,保持安装状态" - fi - - LOG_INFO "测试完成" -} - -main "$@" \ No newline at end of file diff --git a/testcases/function_test/pkg_test/texlive-base/texlive-tex4ht/test_texlive-tex4ht_tex4ht_l_bookkeeping_file.sh b/testcases/function_test/pkg_test/texlive-base/texlive-tex4ht/test_texlive-tex4ht_tex4ht_l_bookkeeping_file.sh deleted file mode 100644 index 7a09c51310a..00000000000 --- a/testcases/function_test/pkg_test/texlive-base/texlive-tex4ht/test_texlive-tex4ht_tex4ht_l_bookkeeping_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-02 -# @License : Mulan PSL v2 -# @Desc : 测试使用 -l 参数指定簿记文件 -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - # 检查是否已安装texlive-tex4ht - LOG_INFO "检查是否已安装texlive-tex4ht" - rpm -q texlive-tex4ht > /dev/null 2>&1 - if [ $? -eq 0 ]; then - LOG_INFO "texlive-tex4ht已安装" - installed=1 - else - LOG_INFO "texlive-tex4ht未安装" - installed=0 - fi - - # 检查yum源中是否有texlive-tex4ht - LOG_INFO "检查yum源中是否有texlive-tex4ht" - dnf list available texlive-tex4ht > /dev/null 2>&1 - CHECK_RESULT $? 0 0 "yum源中不存在texlive-tex4ht软件包" - if [ $? -ne 0 ]; then - LOG_ERROR "yum源中不存在texlive-tex4ht软件包" - exit 255 - fi - - # 如果未安装,则安装texlive-tex4ht - if [ $installed -eq 0 ]; then - LOG_INFO "安装texlive-tex4ht" - dnf install -y texlive-tex4ht - CHECK_RESULT $? 0 0 "安装texlive-tex4ht失败" - fi - - # 检查tex4ht命令是否存在 - LOG_INFO "检查tex4ht命令是否存在" - which tex4ht > /dev/null 2>&1 - CHECK_RESULT $? 0 0 "tex4ht命令不存在" - - # 测试-l参数是否存在 - LOG_INFO "测试tex4ht命令是否支持-l参数" - tex4ht -l 2>&1 | grep -q "bookkeeping" - CHECK_RESULT $? 0 0 "tex4ht命令不支持-l参数" - if [ $? -ne 0 ]; then - LOG_ERROR "tex4ht命令不支持-l参数" - exit 255 - fi - - # 创建测试用的简单tex文件 - LOG_INFO "创建测试用的简单tex文件" - cat > test.tex << "EOF" - \documentclass{article} - \begin{document} - Hello, world! - \end{document} - EOF - CHECK_RESULT $? 0 0 "创建test.tex文件失败" - - # 测试使用-l参数指定簿记文件 - LOG_INFO "测试使用-l参数指定簿记文件" - tex4ht -l test.bookkeeping test.tex - CHECK_RESULT $? 0 0 "使用-l参数执行tex4ht失败" - - # 检查簿记文件是否生成 - LOG_INFO "检查簿记文件是否生成" - [ -f test.bookkeeping ] - CHECK_RESULT $? 0 0 "簿记文件未生成" - - # 清理测试文件 - LOG_INFO "清理测试文件" - rm -f test.tex test.bookkeeping test.html test.css test*.png test*.svg test*.idv test*.lg test*.log test*.tmp test*.xref test*.4ct test*.4tc test*.dvi - CHECK_RESULT $? 0 0 "清理测试文件失败" - - # 如果之前未安装,则卸载texlive-tex4ht - if [ $installed -eq 0 ]; then - LOG_INFO "卸载texlive-tex4ht" - dnf remove -y texlive-tex4ht - CHECK_RESULT $? 0 0 "卸载texlive-tex4ht失败" - fi - - LOG_INFO "测试完成" -} - -main "$@" \ No newline at end of file diff --git a/testcases/function_test/pkg_test/texlive-base/texlive-tex4ht/test_texlive-tex4ht_tex4ht_s_css_file_ext.sh b/testcases/function_test/pkg_test/texlive-base/texlive-tex4ht/test_texlive-tex4ht_tex4ht_s_css_file_ext.sh deleted file mode 100644 index c967e93cfd1..00000000000 --- a/testcases/function_test/pkg_test/texlive-base/texlive-tex4ht/test_texlive-tex4ht_tex4ht_s_css_file_ext.sh +++ /dev/null @@ -1,138 +0,0 @@ -#!/usr/bin/bash - -# Copyright (c) 2024 ISCAS .ALL rights reserved. -# This program is licensed under Mulan PSL v2. -# You can use it according to the terms and conditions of the Mulan PSL v2. -# http://license.coscl.org.cn/MulanPSL2 -# THIS PROGRAM IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, -# EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, -# 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-02 -# @License : Mulan PSL v2 -# @Desc : 测试使用 -s 参数指定 CSS 文件扩展名,默认 -s4cs -# ############################################ - -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-tex4ht" - - # 步骤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: 检查软件包是否已安装" - rpm -q $PACKAGE_NAME > /dev/null 2>&1 - PACKAGE_INSTALLED=$? - - # 记录初始安装状态 - INITIAL_INSTALL_STATUS=$PACKAGE_INSTALLED - - # 如果未安装,则安装软件包 - if [ $PACKAGE_INSTALLED -ne 0 ]; then - LOG_INFO "步骤3: 安装软件包 $PACKAGE_NAME" - dnf install -y $PACKAGE_NAME - CHECK_RESULT $? 0 0 "安装软件包 $PACKAGE_NAME 失败" - fi - - # 步骤4: 检查htlatex命令是否存在 - LOG_INFO "步骤4: 检查htlatex命令是否存在" - which htlatex > /dev/null 2>&1 - CHECK_RESULT $? 0 0 "htlatex命令不存在" - - # 步骤5: 创建测试用的简单LaTeX文件 - LOG_INFO "步骤5: 创建测试用的简单LaTeX文件" - TEST_TEX_FILE="test_tex4ht.tex" - cat > $TEST_TEX_FILE << "EOF" - \documentclass{article} - \begin{document} - Hello, TeX4ht! - \end{document} - EOF - CHECK_RESULT $? 0 0 "创建测试LaTeX文件失败" - - # 步骤6: 测试不带-s参数的情况(默认-s4cs) - LOG_INFO "步骤6: 测试不带-s参数的情况(默认-s4cs)" - htlatex $TEST_TEX_FILE > /dev/null 2>&1 - CHECK_RESULT $? 0 0 "htlatex命令执行失败" - - # 检查是否生成了CSS文件 - if [ -f "${TEST_TEX_FILE%.tex}.css" ]; then - LOG_INFO "默认情况下生成了CSS文件: ${TEST_TEX_FILE%.tex}.css" - else - LOG_ERROR "默认情况下未生成CSS文件" - exit 1 - fi - - # 清理测试生成的文件 - rm -f ${TEST_TEX_FILE%.tex}.* > /dev/null 2>&1 - - # 步骤7: 测试带-s参数指定CSS文件扩展名 - LOG_INFO "步骤7: 测试带-s参数指定CSS文件扩展名" - htlatex $TEST_TEX_FILE "html,2" "" "" "-smycss" > /dev/null 2>&1 - CHECK_RESULT $? 0 0 "htlatex命令带-s参数执行失败" - - # 检查是否生成了指定扩展名的CSS文件 - if [ -f "${TEST_TEX_FILE%.tex}.mycss" ]; then - LOG_INFO "成功生成了指定扩展名的CSS文件: ${TEST_TEX_FILE%.tex}.mycss" - else - LOG_ERROR "未生成指定扩展名的CSS文件" - exit 1 - fi - - # 步骤8: 测试-s参数不支持的情况 - LOG_INFO "步骤8: 测试-s参数不支持的情况(模拟参数错误)" - # 这里我们尝试使用一个不支持的参数格式 - htlatex $TEST_TEX_FILE "html,2" "" "" "-s" > /dev/null 2>&1 - if [ $? -eq 255 ]; then - LOG_INFO "检测到-s参数错误,退出码为255" - # 清理测试文件 - rm -f ${TEST_TEX_FILE%.tex}.* > /dev/null 2>&1 - rm -f $TEST_TEX_FILE > /dev/null 2>&1 - # 恢复环境 - if [ $INITIAL_INSTALL_STATUS -ne 0 ]; then - LOG_INFO "步骤9: 卸载测试安装的软件包" - dnf remove -y $PACKAGE_NAME > /dev/null 2>&1 - LOG_INFO "已卸载软件包 $PACKAGE_NAME" - fi - exit 255 - fi - - # 步骤9: 清理测试文件 - LOG_INFO "步骤9: 清理测试文件" - rm -f ${TEST_TEX_FILE%.tex}.* > /dev/null 2>&1 - rm -f $TEST_TEX_FILE > /dev/null 2>&1 - CHECK_RESULT $? 0 0 "清理测试文件失败" - - # 步骤10: 恢复环境 - LOG_INFO "步骤10: 恢复环境" - if [ $INITIAL_INSTALL_STATUS -ne 0 ]; then - LOG_INFO "卸载测试安装的软件包" - 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 "测试完成:成功测试了htlatex命令的-s参数功能" -} - -main "$@" \ No newline at end of file diff --git a/testcases/function_test/pkg_test/texlive-base/texlive-tex4ht/test_texlive-tex4ht_tex4ht_t_tfm_font_dir.sh b/testcases/function_test/pkg_test/texlive-base/texlive-tex4ht/test_texlive-tex4ht_tex4ht_t_tfm_font_dir.sh deleted file mode 100644 index af3091e9e9c..00000000000 --- a/testcases/function_test/pkg_test/texlive-base/texlive-tex4ht/test_texlive-tex4ht_tex4ht_t_tfm_font_dir.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-02 -# @License : Mulan PSL v2 -# @Desc : 测试使用 -t 参数指定 tfm 字体目录 -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - set -e - - LOG_INFO "开始测试:测试使用 -t 参数指定 tfm 字体目录" - - # 检查软件包是否在yum源中 - LOG_INFO "检查软件包 texlive-tex4ht 是否在yum源中" - if ! dnf list texlive-tex4ht 2>/dev/null | grep -q texlive-tex4ht; then - LOG_ERROR "软件包 texlive-tex4ht 不在yum源中" - exit 255 - fi - - # 检查环境是否已安装 - LOG_INFO "检查环境是否已安装 texlive-tex4ht" - if rpm -q texlive-tex4ht >/dev/null 2>&1; then - LOG_INFO "环境已安装 texlive-tex4ht,测试后保持安装状态" - already_installed=true - else - LOG_INFO "环境未安装 texlive-tex4ht,将在测试中安装" - already_installed=false - fi - - # 如果未安装,则安装软件包 - if [ "$already_installed" = false ]; then - LOG_INFO "安装软件包 texlive-tex4ht" - dnf install -y texlive-tex4ht - CHECK_RESULT $? 0 0 "安装 texlive-tex4ht 失败" - fi - - # 测试使用 -t 参数指定 tfm 字体目录 - LOG_INFO "测试使用 -t 参数指定 tfm 字体目录" - test_tfm_dir="/tmp/test_tfm_dir" - mkdir -p "$test_tfm_dir" - tex4ht -t "$test_tfm_dir" --help >/dev/null 2>&1 - CHECK_RESULT $? 0 0 "tex4ht 命令不支持 -t 参数" - - # 清理测试创建的临时目录 - LOG_INFO "清理测试创建的临时目录" - rm -rf "$test_tfm_dir" - - # 如果测试前未安装,则卸载软件包 - if [ "$already_installed" = false ]; then - LOG_INFO "卸载软件包 texlive-tex4ht" - dnf remove -y texlive-tex4ht - CHECK_RESULT $? 0 0 "卸载 texlive-tex4ht 失败" - fi - - LOG_INFO "测试完成" -} - -main "$@" \ No newline at end of file diff --git a/testcases/function_test/pkg_test/texlive-base/texlive-tex4ht/test_texlive-tex4ht_tex4ht_u_num_10.sh b/testcases/function_test/pkg_test/texlive-base/texlive-tex4ht/test_texlive-tex4ht_tex4ht_u_num_10.sh deleted file mode 100644 index f1d907e49c3..00000000000 --- a/testcases/function_test/pkg_test/texlive-base/texlive-tex4ht/test_texlive-tex4ht_tex4ht_u_num_10.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-02 -# @License : Mulan PSL v2 -# @Desc : 测试使用 -u10 参数以 10 为基数处理 Unicode 字符 -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - # 检查是否已安装 texlive-tex4ht 和 tex4ht 软件包 - LOG_INFO "检查是否已安装 texlive-tex4ht 和 tex4ht 软件包" - rpm -q texlive-tex4ht tex4ht > /dev/null 2>&1 - if [ $? -eq 0 ]; then - LOG_INFO "软件包已安装,标记为已安装状态" - INSTALLED="true" - else - LOG_INFO "软件包未安装,标记为未安装状态" - INSTALLED="false" - fi - - # 检查yum源中是否有 texlive-tex4ht 和 tex4ht 软件包 - LOG_INFO "检查yum源中是否有 texlive-tex4ht 和 tex4ht 软件包" - dnf list available texlive-tex4ht tex4ht > /dev/null 2>&1 - CHECK_RESULT $? 0 0 "yum源中缺少 texlive-tex4ht 或 tex4ht 软件包" - - # 如果未安装,则安装软件包 - if [ "$INSTALLED" = "false" ]; then - LOG_INFO "开始安装 texlive-tex4ht 和 tex4ht 软件包" - dnf install -y texlive-tex4ht tex4ht - CHECK_RESULT $? 0 0 "安装 texlive-tex4ht 和 tex4ht 软件包失败" - LOG_INFO "软件包安装成功" - else - LOG_INFO "软件包已安装,跳过安装步骤" - fi - - # 测试使用 -u10 参数以 10 为基数处理 Unicode 字符 - LOG_INFO "测试使用 -u10 参数以 10 为基数处理 Unicode 字符" - # 检查 tex4ht 命令是否支持 -u 参数 - tex4ht -h 2>&1 | grep -q -- "-u" - CHECK_RESULT $? 0 0 "tex4ht 命令不支持 -u 参数" - - # 执行测试命令,使用 -u10 参数 - LOG_INFO "执行 tex4ht -u10 命令" - tex4ht -u10 > /dev/null 2>&1 - CHECK_RESULT $? 0 0 "使用 -u10 参数执行 tex4ht 命令失败" - - LOG_INFO "测试使用 -u10 参数以 10 为基数处理 Unicode 字符成功" - - # 清理环境,如果之前未安装,则卸载软件包 - if [ "$INSTALLED" = "false" ]; then - LOG_INFO "开始卸载 texlive-tex4ht 和 tex4ht 软件包" - dnf remove -y texlive-tex4ht tex4ht - CHECK_RESULT $? 0 0 "卸载 texlive-tex4ht 和 tex4ht 软件包失败" - LOG_INFO "软件包卸载成功" - else - LOG_INFO "保持软件包安装状态,无需卸载" - fi - - LOG_INFO "测试脚本执行完成" -} - -main "$@" \ No newline at end of file diff --git a/testcases/function_test/pkg_test/texlive-base/texlive-tex4ht/test_texlive-tex4ht_tex4ht_upper_f_ch_code.sh b/testcases/function_test/pkg_test/texlive-base/texlive-tex4ht/test_texlive-tex4ht_tex4ht_upper_f_ch_code.sh deleted file mode 100644 index 273013b02b5..00000000000 --- a/testcases/function_test/pkg_test/texlive-base/texlive-tex4ht/test_texlive-tex4ht_tex4ht_upper_f_ch_code.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-02 -# @License : Mulan PSL v2 -# @Desc : 测试使用 -F 参数指定缺失字体字符的替换码 -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - # 测试脚本开始 - - LOG_INFO "开始测试:测试使用 -F 参数指定缺失字体字符的替换码" - - # 定义软件包名称 - PACKAGE_NAME="texlive-tex4ht" - - # 检查软件包是否已在系统中安装 - LOG_INFO "步骤1:检查软件包是否已安装" - if rpm -q $PACKAGE_NAME &>/dev/null; then - LOG_INFO "软件包 $PACKAGE_NAME 已安装,测试结束后将保持安装状态" - ALREADY_INSTALLED=1 - else - LOG_INFO "软件包 $PACKAGE_NAME 未安装,将在测试过程中安装" - ALREADY_INSTALLED=0 - fi - - # 检查yum源中是否存在该软件包 - 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:检查 tex4ht 命令是否存在" - if ! command -v tex4ht &>/dev/null; then - LOG_ERROR "tex4ht 命令未找到" - exit 255 - fi - - # 检查 -F 参数是否支持 - LOG_INFO "步骤5:检查 tex4ht 命令是否支持 -F 参数" - if ! tex4ht --help 2>&1 | grep -q -- "-F"; then - LOG_ERROR "tex4ht 命令不支持 -F 参数" - exit 255 - fi - - # 创建测试用的 TeX 文件 - LOG_INFO "步骤6:创建测试用的 TeX 文件" - TEST_TEX_FILE="test_font_replace.tex" - cat > $TEST_TEX_FILE << "EOF" - \documentclass{article} - \begin{document} - This is a test document with special characters: é, ñ, ü. - \end{document} - EOF - CHECK_RESULT $? 0 0 "创建测试 TeX 文件失败" - - # 测试使用 -F 参数指定缺失字体字符的替换码 - LOG_INFO "步骤7:使用 -F 参数执行 tex4ht 命令" - tex4ht -F utf8 $TEST_TEX_FILE - CHECK_RESULT $? 0 0 "使用 -F 参数执行 tex4ht 命令失败" - - # 清理测试文件 - LOG_INFO "步骤8:清理测试文件" - rm -f $TEST_TEX_FILE *.html *.css *.4ct *.4tc *.dvi *.idv *.lg *.log *.tmp *.xref - CHECK_RESULT $? 0 0 "清理测试文件失败" - - # 如果测试开始时未安装,则在测试结束后卸载软件包 - 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 "测试完成:测试使用 -F 参数指定缺失字体字符的替换码" -} - -main "$@" \ No newline at end of file diff --git a/testcases/function_test/pkg_test/texlive-base/texlive-tex4ht/test_texlive-tex4ht_tex4ht_upper_p_filter.sh b/testcases/function_test/pkg_test/texlive-base/texlive-tex4ht/test_texlive-tex4ht_tex4ht_upper_p_filter.sh deleted file mode 100644 index 2f91690f2a2..00000000000 --- a/testcases/function_test/pkg_test/texlive-base/texlive-tex4ht/test_texlive-tex4ht_tex4ht_upper_p_filter.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-02 -# @License : Mulan PSL v2 -# @Desc : 测试使用 -P 参数并指定过滤器以控制系统调用权限 -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - # 检查是否已经安装了texlive-tex4ht-tex4ht-upper-p-filter软件包 - LOG_INFO "检查是否已安装texlive-tex4ht-tex4ht-upper-p-filter软件包" - rpm -q texlive-tex4ht-tex4ht-upper-p-filter - if [ $? -eq 0 ]; then - LOG_INFO "软件包已安装,脚本结束将保持安装状态" - INSTALLED=1 - else - LOG_INFO "软件包未安装,将在测试过程中安装" - INSTALLED=0 - fi - - # 检查yum源中是否存在texlive-tex4ht-tex4ht-upper-p-filter软件包 - LOG_INFO "检查yum源中是否存在texlive-tex4ht-tex4ht-upper-p-filter软件包" - dnf list available texlive-tex4ht-tex4ht-upper-p-filter - if [ $? -ne 0 ]; then - LOG_ERROR "yum源中不存在texlive-tex4ht-tex4ht-upper-p-filter软件包" - exit 255 - fi - - # 如果未安装,则安装软件包 - if [ $INSTALLED -eq 0 ]; then - LOG_INFO "安装texlive-tex4ht-tex4ht-upper-p-filter软件包" - dnf install -y texlive-tex4ht-tex4ht-upper-p-filter - CHECK_RESULT $? 0 0 "安装texlive-tex4ht-tex4ht-upper-p-filter失败" - fi - - # 测试使用 -P 参数并指定过滤器以控制系统调用权限 - LOG_INFO "测试使用 -P 参数并指定过滤器以控制系统调用权限" - # 假设测试命令为test_command,这里用示例命令代替,实际应根据软件包提供的命令进行测试 - # 检查命令是否存在 - command -v test_command - if [ $? -ne 0 ]; then - LOG_ERROR "test_command命令不存在" - exit 255 - fi - - # 测试命令是否支持 -P 参数 - LOG_INFO "检查test_command是否支持 -P 参数" - test_command --help | grep -q "\-P" - if [ $? -ne 0 ]; then - LOG_ERROR "test_command不支持 -P 参数" - exit 255 - fi - - # 执行测试命令,使用 -P 参数并指定过滤器 - LOG_INFO "执行test_command -P filter_test" - test_command -P filter_test - CHECK_RESULT $? 0 0 "使用 -P 参数执行test_command失败" - - # 清理环境:如果脚本开始时未安装软件包,则卸载 - if [ $INSTALLED -eq 0 ]; then - LOG_INFO "卸载texlive-tex4ht-tex4ht-upper-p-filter软件包" - dnf remove -y texlive-tex4ht-tex4ht-upper-p-filter - CHECK_RESULT $? 0 0 "卸载texlive-tex4ht-tex4ht-upper-p-filter失败" - else - LOG_INFO "软件包在脚本执行前已安装,保持安装状态" - fi - - LOG_INFO "测试完成,环境已恢复" -} - -main "$@" \ No newline at end of file diff --git a/testcases/function_test/pkg_test/texlive-base/texlive-tex4ht/test_texlive-tex4ht_tex4ht_upper_p_star.sh b/testcases/function_test/pkg_test/texlive-base/texlive-tex4ht/test_texlive-tex4ht_tex4ht_upper_p_star.sh deleted file mode 100644 index 2183b72a797..00000000000 --- a/testcases/function_test/pkg_test/texlive-base/texlive-tex4ht/test_texlive-tex4ht_tex4ht_upper_p_star.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-02 -# @License : Mulan PSL v2 -# @Desc : 测试使用 -P 参数并指定 * 以始终允许系统调用 -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - LOG_INFO "开始测试:使用 -P 参数并指定 * 以始终允许系统调用" - - # 定义软件包名称 - PACKAGE_NAME="texlive-tex4ht-tex4ht-upper-p-star" - - # 步骤1:检查软件包是否在yum源中 - LOG_INFO "步骤1:检查软件包是否在yum源中" - dnf list available $PACKAGE_NAME &>/dev/null - if [ $? -ne 0 ]; then - LOG_ERROR "软件包 $PACKAGE_NAME 不在yum源中" - exit 255 - fi - - # 步骤2:检查系统是否已安装该软件包 - LOG_INFO "步骤2:检查系统是否已安装该软件包" - rpm -q $PACKAGE_NAME &>/dev/null - if [ $? -eq 0 ]; then - ALREADY_INSTALLED=true - LOG_INFO "软件包已安装,测试结束后将保持安装状态" - else - ALREADY_INSTALLED=false - LOG_INFO "软件包未安装,将在测试结束后卸载" - fi - - # 步骤3:如果未安装,则安装软件包 - if [ "$ALREADY_INSTALLED" = false ]; then - LOG_INFO "步骤3:安装软件包" - dnf install -y $PACKAGE_NAME - CHECK_RESULT $? 0 0 "安装软件包失败" - fi - - # 步骤4:检查命令是否支持 -P 参数 - LOG_INFO "步骤4:检查命令是否支持 -P 参数" - if ! command -v tex4ht &>/dev/null; then - LOG_ERROR "命令 tex4ht 不存在" - exit 255 - fi - - # 尝试运行带 -P 参数的 tex4ht 命令 - LOG_INFO "步骤5:测试使用 -P 参数并指定 * 以始终允许系统调用" - tex4ht -P "*" --help &>/dev/null - if [ $? -eq 255 ]; then - LOG_ERROR "命令 tex4ht 不支持 -P 参数" - exit 255 - fi - - # 步骤6:执行实际测试命令 - LOG_INFO "步骤6:执行实际测试命令" - tex4ht -P "*" test.tex 2>&1 | grep -q "success" - CHECK_RESULT $? 0 0 "使用 -P 参数执行命令失败" - - # 步骤7:环境清理 - LOG_INFO "步骤7:环境清理" - if [ "$ALREADY_INSTALLED" = false ]; then - LOG_INFO "卸载软件包" - dnf remove -y $PACKAGE_NAME - CHECK_RESULT $? 0 0 "卸载软件包失败" - else - LOG_INFO "保持软件包安装状态" - fi - - LOG_INFO "测试完成" -} - -main "$@" \ No newline at end of file diff --git a/testcases/function_test/pkg_test/texlive-base/texlive-tex4ht/test_texlive-tex4ht_tex4ht_upper_s_image_script.sh b/testcases/function_test/pkg_test/texlive-base/texlive-tex4ht/test_texlive-tex4ht_tex4ht_upper_s_image_script.sh deleted file mode 100644 index 57c682e81c9..00000000000 --- a/testcases/function_test/pkg_test/texlive-base/texlive-tex4ht/test_texlive-tex4ht_tex4ht_upper_s_image_script.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-02 -# @License : Mulan PSL v2 -# @Desc : 测试使用 -S 参数指定图像脚本 -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - # 定义软件包名称 - PACKAGE_NAME="texlive-tex4ht" - - # 步骤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 "检查环境是否已安装软件包" - if rpm -q "$PACKAGE_NAME" &>/dev/null; then - LOG_INFO "软件包已安装,标记为已安装状态" - INSTALLED=true - else - LOG_INFO "软件包未安装,标记为未安装状态" - INSTALLED=false - fi - - # 步骤3: 如果未安装,则安装软件包 - if [ "$INSTALLED" = false ]; then - LOG_INFO "安装软件包 $PACKAGE_NAME" - dnf install -y "$PACKAGE_NAME" - CHECK_RESULT $? 0 0 "安装软件包失败" - fi - - # 步骤4: 检查tex4ht命令是否存在 - LOG_INFO "检查tex4ht命令是否存在" - which tex4ht &>/dev/null - CHECK_RESULT $? 0 0 "tex4ht命令不存在" - - # 步骤5: 检查-S参数是否支持 - LOG_INFO "检查-S参数是否支持" - tex4ht -h 2>&1 | grep -q -- "-S" - if [ $? -ne 0 ]; then - LOG_ERROR "tex4ht命令不支持-S参数" - exit 255 - fi - - # 步骤6: 测试使用-S参数指定图像脚本 - LOG_INFO "测试使用-S参数指定图像脚本" - # 创建一个简单的测试文件 - TEST_FILE="test_tex4ht.tex" - cat > "$TEST_FILE" << "EOF" - \documentclass{article} - \begin{document} - Hello, World! - \end{document} - EOF - - # 使用-S参数执行tex4ht命令 - tex4ht -S "test_script" "$TEST_FILE" &>/dev/null - CHECK_RESULT $? 0 0 "使用-S参数执行tex4ht命令失败" - - # 步骤7: 清理测试文件 - LOG_INFO "清理测试文件" - rm -f "$TEST_FILE" "test_tex4ht.html" "test_tex4ht.css" "test_tex4ht.png" "test_tex4ht.4ct" "test_tex4ht.4tc" "test_tex4ht.dvi" "test_tex4ht.idv" "test_tex4ht.lg" "test_tex4ht.tmp" "test_tex4ht.xref" - - # 步骤8: 如果脚本开始时未安装,则卸载软件包 - if [ "$INSTALLED" = false ]; then - LOG_INFO "卸载软件包 $PACKAGE_NAME" - dnf remove -y "$PACKAGE_NAME" - CHECK_RESULT $? 0 0 "卸载软件包失败" - fi - - LOG_INFO "测试完成" -} - -main "$@" \ No newline at end of file diff --git a/testcases/function_test/pkg_test/texlive-base/texlive-tex4ht/test_texlive-tex4ht_tex4ht_utf8.sh b/testcases/function_test/pkg_test/texlive-base/texlive-tex4ht/test_texlive-tex4ht_tex4ht_utf8.sh deleted file mode 100644 index 6c89917c5d6..00000000000 --- a/testcases/function_test/pkg_test/texlive-base/texlive-tex4ht/test_texlive-tex4ht_tex4ht_utf8.sh +++ /dev/null @@ -1,115 +0,0 @@ -#!/usr/bin/bash - -# Copyright (c) 2024 ISCAS .ALL rights reserved. -# This program is licensed under Mulan PSL v2. -# You can use it according to the terms and conditions of the Mulan PSL v2. -# http://license.coscl.org.cn/MulanPSL2 -# THIS PROGRAM IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, -# EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, -# MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. -# See the Mulan PSL v2 for more details. - -# ############################################# -# @Author : honghua -# @Contact : honghua@iscas.ac.cn -# @Date : 2026-03-02 -# @License : Mulan PSL v2 -# @Desc : 测试使用 -utf8 参数指定 Unicode 字符使用 UTF-8 编码 -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - # 测试脚本:测试使用 -utf8 参数指定 Unicode 字符使用 UTF-8 编码 - - # 定义全局变量 - PACKAGE_NAME="texlive-tex4ht" - COMMAND="tex4ht" - PARAM="-utf8" - TEST_FILE="test_utf8.tex" - EXPECTED_OUTPUT="UTF-8" - - # 步骤1:检查软件包是否已在YUM源中 - LOG_INFO "步骤1:检查软件包是否已在YUM源中" - dnf list available $PACKAGE_NAME > /dev/null 2>&1 - CHECK_RESULT $? 0 0 "软件包 $PACKAGE_NAME 不在YUM源中,无法安装" - if [ $? -eq 255 ]; then - LOG_ERROR "软件包 $PACKAGE_NAME 不在YUM源中" - exit 255 - fi - - # 步骤2:检查环境是否已安装软件包 - LOG_INFO "步骤2:检查环境是否已安装软件包" - rpm -q $PACKAGE_NAME > /dev/null 2>&1 - if [ $? -eq 0 ]; then - LOG_INFO "软件包 $PACKAGE_NAME 已安装,脚本结束后将保持安装状态" - INSTALLED=true - else - LOG_INFO "软件包 $PACKAGE_NAME 未安装,将在测试步骤中安装" - INSTALLED=false - fi - - # 步骤3:安装软件包(如果未安装) - if [ "$INSTALLED" = false ]; then - LOG_INFO "步骤3:安装软件包 $PACKAGE_NAME" - dnf install -y $PACKAGE_NAME - CHECK_RESULT $? 0 0 "安装软件包 $PACKAGE_NAME 失败" - if [ $? -ne 0 ]; then - LOG_ERROR "安装软件包 $PACKAGE_NAME 失败" - exit $? - fi - fi - - # 步骤4:检查命令是否支持 -utf8 参数 - LOG_INFO "步骤4:检查命令 $COMMAND 是否支持 -utf8 参数" - $COMMAND --help 2>&1 | grep -q "$PARAM" - CHECK_RESULT $? 0 0 "命令 $COMMAND 不支持参数 $PARAM" - if [ $? -eq 255 ]; then - LOG_ERROR "命令 $COMMAND 不支持参数 $PARAM" - # 清理环境 - if [ "$INSTALLED" = false ]; then - LOG_INFO "清理环境:卸载软件包 $PACKAGE_NAME" - dnf remove -y $PACKAGE_NAME - fi - exit 255 - fi - - # 步骤5:创建测试文件 - LOG_INFO "步骤5:创建测试文件 $TEST_FILE" - cat > $TEST_FILE << EOF - \documentclass{article} - \begin{document} - Hello, 世界! - \end{document} - EOF - CHECK_RESULT $? 0 0 "创建测试文件 $TEST_FILE 失败" - - # 步骤6:使用 -utf8 参数执行命令 - LOG_INFO "步骤6:使用 -utf8 参数执行命令 $COMMAND" - $COMMAND $PARAM $TEST_FILE > output.log 2>&1 - CHECK_RESULT $? 0 0 "命令 $COMMAND 执行失败" - - # 步骤7:检查输出是否包含 UTF-8 编码 - LOG_INFO "步骤7:检查输出是否包含 UTF-8 编码" - grep -q "$EXPECTED_OUTPUT" output.log - CHECK_RESULT $? 0 0 "输出中未找到 UTF-8 编码" - - # 步骤8:清理测试文件 - LOG_INFO "步骤8:清理测试文件" - rm -f $TEST_FILE output.log - CHECK_RESULT $? 0 0 "清理测试文件失败" - - # 步骤9:恢复环境 - LOG_INFO "步骤9:恢复环境" - if [ "$INSTALLED" = false ]; then - LOG_INFO "卸载软件包 $PACKAGE_NAME" - dnf remove -y $PACKAGE_NAME - CHECK_RESULT $? 0 0 "卸载软件包 $PACKAGE_NAME 失败" - else - LOG_INFO "软件包 $PACKAGE_NAME 保持安装状态" - fi - - LOG_INFO "测试完成" -} - -main "$@" \ No newline at end of file diff --git a/testcases/function_test/pkg_test/texlive-base/texlive-tex4ht/test_texlive-tex4ht_tex4ht_v_idv_version.sh b/testcases/function_test/pkg_test/texlive-base/texlive-tex4ht/test_texlive-tex4ht_tex4ht_v_idv_version.sh deleted file mode 100644 index d74db9c1e36..00000000000 --- a/testcases/function_test/pkg_test/texlive-base/texlive-tex4ht/test_texlive-tex4ht_tex4ht_v_idv_version.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-02 -# @License : Mulan PSL v2 -# @Desc : 测试使用 -v 参数替换给定的 dvi 版本 -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - # 判断是否已安装texlive-tex4ht和tex4ht - LOG_INFO "检查是否已安装texlive-tex4ht和tex4ht软件包" - rpm -q texlive-tex4ht tex4ht > /dev/null 2>&1 - installed=$? - - # 如果未安装,则安装软件包 - if [ $installed -ne 0 ]; then - LOG_INFO "未安装texlive-tex4ht和tex4ht,开始安装" - dnf list available texlive-tex4ht tex4ht > /dev/null 2>&1 - CHECK_RESULT $? 0 0 "yum源中缺少texlive-tex4ht或tex4ht软件包" - dnf install -y texlive-tex4ht tex4ht - CHECK_RESULT $? 0 0 "安装texlive-tex4ht和tex4ht失败" - LOG_INFO "安装texlive-tex4ht和tex4ht成功" - fi - - # 检查htlatex命令是否存在 - LOG_INFO "检查htlatex命令是否存在" - command -v htlatex > /dev/null 2>&1 - CHECK_RESULT $? 0 0 "htlatex命令不存在" - - # 检查-v参数是否支持 - LOG_INFO "检查htlatex命令是否支持-v参数" - htlatex --help 2>&1 | grep -q -- "-v" - CHECK_RESULT $? 0 0 "htlatex命令不支持-v参数" - - # 创建一个简单的测试tex文件 - LOG_INFO "创建测试tex文件" - cat > test.tex << "EOF" - \documentclass{article} - \begin{document} - Hello, World! - \end{document} - EOF - CHECK_RESULT $? 0 0 "创建测试tex文件失败" - - # 使用htlatex命令生成dvi文件 - LOG_INFO "使用htlatex生成dvi文件" - htlatex test.tex > /dev/null 2>&1 - CHECK_RESULT $? 0 0 "htlatex生成dvi文件失败" - - # 检查是否生成了dvi文件 - LOG_INFO "检查是否生成了dvi文件" - [ -f test.dvi ] - CHECK_RESULT $? 0 0 "未生成dvi文件" - - # 使用-v参数替换给定的dvi版本 - LOG_INFO "使用-v参数替换给定的dvi版本" - htlatex -v test.dvi > /dev/null 2>&1 - CHECK_RESULT $? 0 0 "使用-v参数替换dvi版本失败" - - # 清理生成的测试文件 - LOG_INFO "清理生成的测试文件" - rm -f test.tex test.aux test.log test.dvi test.idv test.lg test.tmp test.xref test.4ct test.4tc test.css test.html - CHECK_RESULT $? 0 0 "清理测试文件失败" - - # 如果脚本开始时未安装,则在结束时卸载软件包 - if [ $installed -ne 0 ]; then - LOG_INFO "卸载texlive-tex4ht和tex4ht软件包" - dnf remove -y texlive-tex4ht tex4ht - CHECK_RESULT $? 0 0 "卸载texlive-tex4ht和tex4ht失败" - LOG_INFO "卸载texlive-tex4ht和tex4ht成功" - fi - - LOG_INFO "测试完成" -} - -main "$@" \ No newline at end of file diff --git a/testcases/function_test/pkg_test/texlive-base/texlive-tex4ht/test_texlive-tex4ht_tex4ht_xs.sh b/testcases/function_test/pkg_test/texlive-base/texlive-tex4ht/test_texlive-tex4ht_tex4ht_xs.sh deleted file mode 100644 index fe0b71f14f7..00000000000 --- a/testcases/function_test/pkg_test/texlive-base/texlive-tex4ht/test_texlive-tex4ht_tex4ht_xs.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-03-02 -# @License : Mulan PSL v2 -# @Desc : 测试使用 -xs 参数为自动生成的 GIF 文件使用 MS-DOS 文件名 -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - # 定义软件包名称 - PACKAGE_NAME="texlive-tex4ht" - BINARY_NAME="tex4ht" - - # 步骤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 - if [ $? -eq 0 ]; then - LOG_INFO "软件包 ${PACKAGE_NAME} 已安装" - INSTALLED=true - else - LOG_INFO "软件包 ${PACKAGE_NAME} 未安装" - INSTALLED=false - fi - - # 步骤3: 如果未安装,则安装软件包 - if [ "${INSTALLED}" = "false" ]; then - LOG_INFO "3. 安装软件包: ${PACKAGE_NAME}" - dnf install -y ${PACKAGE_NAME} - CHECK_RESULT $? 0 0 "安装软件包 ${PACKAGE_NAME} 失败" - LOG_INFO "软件包 ${PACKAGE_NAME} 安装成功" - fi - - # 步骤4: 检查tex4ht命令是否支持 -xs 参数 - LOG_INFO "4. 检查 tex4ht 命令是否支持 -xs 参数" - ${BINARY_NAME} --help 2>&1 | grep -q "\-xs" - if [ $? -ne 0 ]; then - LOG_ERROR "tex4ht 命令不支持 -xs 参数" - exit 255 - fi - LOG_INFO "tex4ht 命令支持 -xs 参数" - - # 步骤5: 创建一个简单的LaTeX文件用于测试 - LOG_INFO "5. 创建测试LaTeX文件" - cat > test.tex << "EOF" - \documentclass{article} - \begin{document} - Hello, World! - \end{document} - EOF - CHECK_RESULT $? 0 0 "创建LaTeX测试文件失败" - - # 步骤6: 使用tex4ht命令并指定 -xs 参数处理LaTeX文件 - LOG_INFO "6. 使用 tex4ht 命令并指定 -xs 参数处理LaTeX文件" - ${BINARY_NAME} test.tex -xs - CHECK_RESULT $? 0 0 "使用 -xs 参数处理LaTeX文件失败" - LOG_INFO "使用 -xs 参数处理LaTeX文件成功" - - # 步骤7: 检查是否生成了GIF文件且文件名符合MS-DOS格式 - LOG_INFO "7. 检查是否生成了GIF文件且文件名符合MS-DOS格式" - GIF_FILE=$(ls *.gif 2>/dev/null | head -1) - if [ -n "${GIF_FILE}" ]; then - LOG_INFO "找到生成的GIF文件: ${GIF_FILE}" - # 检查文件名是否符合MS-DOS 8.3格式(基本名称不超过8个字符,扩展名不超过3个字符) - BASENAME=$(basename "${GIF_FILE}" .gif) - if [[ ${#BASENAME} -le 8 && "${GIF_FILE}" =~ ^[a-zA-Z0-9_]+\.[a-zA-Z0-9_]{3}$ ]]; then - LOG_INFO "GIF文件名 ${GIF_FILE} 符合MS-DOS格式" - else - LOG_ERROR "GIF文件名 ${GIF_FILE} 不符合MS-DOS格式" - exit 1 - fi - else - LOG_ERROR "未找到生成的GIF文件" - exit 1 - fi - - # 步骤8: 清理测试过程中生成的文件 - LOG_INFO "8. 清理测试过程中生成的文件" - rm -f test.tex *.html *.css *.gif *.png *.tmp *.idv *.lg *.4ct *.4tc *.dvi *.aux *.log *.xref *.4og *.4tg *.4of *.4ot - CHECK_RESULT $? 0 0 "清理测试文件失败" - LOG_INFO "测试文件清理成功" - - # 步骤9: 如果测试前未安装软件包,则在测试结束后卸载 - if [ "${INSTALLED}" = "false" ]; then - LOG_INFO "9. 卸载软件包: ${PACKAGE_NAME}" - dnf remove -y ${PACKAGE_NAME} - CHECK_RESULT $? 0 0 "卸载软件包 ${PACKAGE_NAME} 失败" - LOG_INFO "软件包 ${PACKAGE_NAME} 卸载成功" - else - LOG_INFO "9. 测试前软件包已安装,保持安装状态" - fi - - LOG_INFO "测试完成: 使用 -xs 参数为自动生成的 GIF 文件使用 MS-DOS 文件名" -} - -main "$@" \ No newline at end of file diff --git a/testcases/function_test/pkg_test/texlive-base/texlive-tex4ht/test_texlive-tex4ht_xhlatex_no_args.sh b/testcases/function_test/pkg_test/texlive-base/texlive-tex4ht/test_texlive-tex4ht_xhlatex_no_args.sh deleted file mode 100644 index ed8f4092386..00000000000 --- a/testcases/function_test/pkg_test/texlive-base/texlive-tex4ht/test_texlive-tex4ht_xhlatex_no_args.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-02 -# @License : Mulan PSL v2 -# @Desc : 测试不带参数运行xhlatex命令 -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - # 定义软件包名称 - PACKAGE_NAME="texlive-tex4ht" - - # 步骤1: 检查yum源中是否存在指定软件包 - LOG_INFO "检查yum源中是否存在软件包: $PACKAGE_NAME" - dnf list available $PACKAGE_NAME &>/dev/null - if [ $? -ne 0 ]; then - LOG_ERROR "yum源中不存在软件包: $PACKAGE_NAME" - exit 255 - fi - - # 步骤2: 检查是否已安装软件包 - LOG_INFO "检查是否已安装软件包: $PACKAGE_NAME" - if rpm -q $PACKAGE_NAME &>/dev/null; then - LOG_INFO "软件包 $PACKAGE_NAME 已安装,脚本结束时将保持安装状态" - INSTALLED_BEFORE=true - else - LOG_INFO "软件包 $PACKAGE_NAME 未安装,将进行安装" - INSTALLED_BEFORE=false - fi - - # 步骤3: 如果未安装,则安装软件包 - if [ "$INSTALLED_BEFORE" = false ]; then - LOG_INFO "安装软件包: $PACKAGE_NAME" - dnf install -y $PACKAGE_NAME - CHECK_RESULT $? 0 0 "安装软件包 $PACKAGE_NAME 失败" - fi - - # 步骤4: 检查xhlatex命令是否存在 - LOG_INFO "检查xhlatex命令是否存在" - which xhlatex &>/dev/null - if [ $? -ne 0 ]; then - LOG_ERROR "xhlatex命令不存在" - exit 255 - fi - - # 步骤5: 测试不带参数运行xhlatex命令 - LOG_INFO "测试不带参数运行xhlatex命令" - xhlatex - CHECK_RESULT $? 0 0 "不带参数运行xhlatex命令失败" - - # 步骤6: 环境恢复 - if [ "$INSTALLED_BEFORE" = 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/texlive-base/texlive-tex4ht/test_texlive-tex4ht_xhlatex_num_1.sh b/testcases/function_test/pkg_test/texlive-base/texlive-tex4ht/test_texlive-tex4ht_xhlatex_num_1.sh deleted file mode 100644 index 79261cd151c..00000000000 --- a/testcases/function_test/pkg_test/texlive-base/texlive-tex4ht/test_texlive-tex4ht_xhlatex_num_1.sh +++ /dev/null @@ -1,83 +0,0 @@ -#!/usr/bin/bash - -# Copyright (c) 2024 ISCAS .ALL rights reserved. -# This program is licensed under Mulan PSL v2. -# You can use it according to the terms and conditions of the Mulan PSL v2. -# http://license.coscl.org.cn/MulanPSL2 -# THIS PROGRAM IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, -# EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, -# MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. -# See the Mulan PSL v2 for more details. - -# ############################################# -# @Author : honghua -# @Contact : honghua@iscas.ac.cn -# @Date : 2025-11-27 -# @License : Mulan PSL v2 -# @Desc : 测试 xhlatex 命令的 -1 参数 -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - - # 检查是否已安装texlive-tex4ht包 - LOG_INFO "检查是否已安装texlive-tex4ht包" - rpm -q texlive-tex4ht > /dev/null 2>&1 - if [ $? -eq 0 ]; then - LOG_INFO "texlive-tex4ht已安装,脚本结束时保持安装状态" - installed=true - else - LOG_INFO "texlive-tex4ht未安装,将在测试结束后卸载" - installed=false - fi - - # 检查yum源中是否有texlive-tex4ht包 - LOG_INFO "检查yum源中是否有texlive-tex4ht包" - dnf list available texlive-tex4ht > /dev/null 2>&1 - if [ $? -ne 0 ]; then - LOG_ERROR "yum源中未找到texlive-tex4ht包" - exit 255 - fi - - # 安装texlive-tex4ht包 - if [ "$installed" = false ]; then - LOG_INFO "安装texlive-tex4ht包" - dnf install -y texlive-tex4ht - CHECK_RESULT $? 0 0 "安装texlive-tex4ht包失败" - fi - - # 检查xhlatex命令是否存在 - LOG_INFO "检查xhlatex命令是否存在" - which xhlatex > /dev/null 2>&1 - if [ $? -ne 0 ]; then - LOG_ERROR "xhlatex命令不存在" - if [ "$installed" = false ]; then - dnf remove -y texlive-tex4ht - fi - exit 255 - fi - - # 测试xhlatex命令的-1参数 - LOG_INFO "测试xhlatex命令的-1参数" - xhlatex -1 --help > /dev/null 2>&1 - if [ $? -ne 0 ]; then - LOG_ERROR "xhlatex命令不支持-1参数" - if [ "$installed" = false ]; then - dnf remove -y texlive-tex4ht - fi - exit 255 - fi - - # 清理环境 - if [ "$installed" = false ]; then - LOG_INFO "卸载texlive-tex4ht包" - dnf remove -y texlive-tex4ht - CHECK_RESULT $? 0 0 "卸载texlive-tex4ht包失败" - fi - - LOG_INFO "测试完成" - -} - -main "$@" \ No newline at end of file diff --git a/testcases/function_test/pkg_test/texlive-base/texlive-tex4ht/test_texlive-tex4ht_xhlatex_upper_a.sh b/testcases/function_test/pkg_test/texlive-base/texlive-tex4ht/test_texlive-tex4ht_xhlatex_upper_a.sh deleted file mode 100644 index 1ea7414f15d..00000000000 --- a/testcases/function_test/pkg_test/texlive-base/texlive-tex4ht/test_texlive-tex4ht_xhlatex_upper_a.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-02 -# @License : Mulan PSL v2 -# @Desc : 测试带-A参数运行xhlatex命令 -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - set -e - - LOG_INFO "开始测试带-A参数运行xhlatex命令" - - LOG_INFO "步骤1: 检查texlive-tex4ht软件包是否在yum源中" - if ! dnf list available texlive-tex4ht 2>/dev/null | grep -q texlive-tex4ht; then - LOG_ERROR "texlive-tex4ht软件包不在yum源中" - exit 255 - fi - - LOG_INFO "步骤2: 检查xhlatex命令的-A参数是否支持" - if ! xhlatex --help 2>&1 | grep -q -- "-A"; then - LOG_ERROR "xhlatex命令不支持-A参数" - exit 255 - fi - - LOG_INFO "步骤3: 检查texlive-tex4ht是否已安装" - if rpm -q texlive-tex4ht >/dev/null 2>&1; then - LOG_INFO "texlive-tex4ht已安装,测试完成后保持安装状态" - already_installed=true - else - LOG_INFO "texlive-tex4ht未安装,开始安装" - already_installed=false - dnf install -y texlive-tex4ht - CHECK_RESULT $? 0 0 "安装texlive-tex4ht失败" - fi - - LOG_INFO "步骤4: 创建测试LaTeX文件" - cat > test_document.tex << "EOF" - \documentclass{article} - \begin{document} - Test document for xhlatex -A parameter. - \end{document} - EOF - CHECK_RESULT $? 0 0 "创建测试文件失败" - - LOG_INFO "步骤5: 使用-A参数运行xhlatex命令" - xhlatex -A test_document.tex - CHECK_RESULT $? 0 0 "xhlatex -A命令执行失败" - - LOG_INFO "步骤6: 检查生成的HTML文件" - if [ -f "test_document.html" ]; then - LOG_INFO "成功生成HTML文件: test_document.html" - else - LOG_ERROR "未生成预期的HTML文件" - CHECK_RESULT 1 0 0 "HTML文件生成失败" - fi - - LOG_INFO "步骤7: 清理测试文件" - rm -f test_document.tex test_document.html test_document.log test_document.aux test_document.out - CHECK_RESULT $? 0 0 "清理测试文件失败" - - LOG_INFO "步骤8: 环境恢复" - if [ "$already_installed" = "false" ]; then - LOG_INFO "卸载测试安装的texlive-tex4ht软件包" - dnf remove -y texlive-tex4ht - CHECK_RESULT $? 0 0 "卸载texlive-tex4ht失败" - else - LOG_INFO "保持texlive-tex4ht安装状态" - fi - - LOG_INFO "测试完成" -} - -main "$@" \ No newline at end of file diff --git a/testcases/function_test/pkg_test/texlive-base/texlive-tex4ht/test_texlive-tex4ht_xhlatex_upper_b.sh b/testcases/function_test/pkg_test/texlive-base/texlive-tex4ht/test_texlive-tex4ht_xhlatex_upper_b.sh deleted file mode 100644 index 35c31c4f4ca..00000000000 --- a/testcases/function_test/pkg_test/texlive-base/texlive-tex4ht/test_texlive-tex4ht_xhlatex_upper_b.sh +++ /dev/null @@ -1,91 +0,0 @@ -#!/usr/bin/bash - -# Copyright (c) 2024 ISCAS .ALL rights reserved. -# This program is licensed under Mulan PSL v2. -# You can use it according to the terms and conditions of the Mulan PSL v2. -# http://license.coscl.org.cn/MulanPSL2 -# THIS PROGRAM IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, -# EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, -# MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. -# See the Mulan PSL v2 for more details. - -# ############################################# -# @Author : honghua -# @Contact : honghua@iscas.ac.cn -# @Date : 2026-03-02 -# @License : Mulan PSL v2 -# @Desc : 测试带-B参数运行xhlatex命令 -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - LOG_INFO "开始测试:测试带-B参数运行xhlatex命令" - - # 检查yum源中是否存在texlive-tex4ht软件包 - LOG_INFO "检查yum源中是否存在texlive-tex4ht软件包" - dnf list texlive-tex4ht 2>&1 | grep -q "texlive-tex4ht" - if [ $? -ne 0 ]; then - LOG_ERROR "yum源中未找到texlive-tex4ht软件包" - exit 255 - fi - - # 检查是否已经安装texlive-tex4ht - LOG_INFO "检查是否已经安装texlive-tex4ht" - rpm -q texlive-tex4ht > /dev/null 2>&1 - installed=$? - - if [ $installed -eq 0 ]; then - LOG_INFO "texlive-tex4ht已经安装,测试完成后将保持安装状态" - else - LOG_INFO "texlive-tex4ht未安装,将安装软件包作为测试步骤" - LOG_INFO "安装texlive-tex4ht软件包" - dnf install -y texlive-tex4ht - CHECK_RESULT $? 0 0 "安装texlive-tex4ht失败" - fi - - # 检查xhlatex命令是否存在 - LOG_INFO "检查xhlatex命令是否存在" - command -v xhlatex > /dev/null 2>&1 - if [ $? -ne 0 ]; then - LOG_ERROR "xhlatex命令不存在" - exit 255 - fi - - # 检查xhlatex命令是否支持-B参数 - LOG_INFO "检查xhlatex命令是否支持-B参数" - xhlatex --help 2>&1 | grep -q "\-B" - if [ $? -ne 0 ]; then - LOG_ERROR "xhlatex命令不支持-B参数" - exit 255 - fi - - # 创建测试用的简单LaTeX文件 - LOG_INFO "创建测试用的简单LaTeX文件" - cat > test.tex << "EOF" - \documentclass{article} - \begin{document} - Hello, World! - \end{document} - EOF - - # 使用-B参数运行xhlatex命令 - LOG_INFO "使用-B参数运行xhlatex命令" - xhlatex -B test.tex - CHECK_RESULT $? 0 0 "带-B参数运行xhlatex命令失败" - - # 清理测试文件 - LOG_INFO "清理测试文件" - rm -f test.tex test.aux test.log test.out - - # 如果测试前未安装,则卸载软件包 - if [ $installed -ne 0 ]; then - LOG_INFO "卸载texlive-tex4ht软件包" - dnf remove -y texlive-tex4ht - CHECK_RESULT $? 0 0 "卸载texlive-tex4ht失败" - fi - - LOG_INFO "测试完成:测试带-B参数运行xhlatex命令" -} - -main "$@" \ No newline at end of file diff --git a/testcases/function_test/pkg_test/texlive-base/texlive-tex4ht/test_texlive-tex4ht_xhlatex_upper_c.sh b/testcases/function_test/pkg_test/texlive-base/texlive-tex4ht/test_texlive-tex4ht_xhlatex_upper_c.sh deleted file mode 100644 index fbf81fd93f4..00000000000 --- a/testcases/function_test/pkg_test/texlive-base/texlive-tex4ht/test_texlive-tex4ht_xhlatex_upper_c.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-02 -# @License : Mulan PSL v2 -# @Desc : 测试带-C参数运行xhlatex命令 -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - LOG_INFO "开始测试带-C参数运行xhlatex命令" - LOG_INFO "步骤1:检查是否已安装texlive-tex4ht包" - if rpm -q texlive-tex4ht > /dev/null 2>&1; then - LOG_INFO "texlive-tex4ht已安装,测试结束后将保持安装状态" - INSTALLED_BEFORE=true - else - LOG_INFO "texlive-tex4ht未安装,将在测试前安装,测试后卸载" - INSTALLED_BEFORE=false - fi - - LOG_INFO "步骤2:检查yum源中是否存在texlive-tex4ht包" - if ! dnf list available texlive-tex4ht > /dev/null 2>&1; then - LOG_ERROR "yum源中不存在texlive-tex4ht包" - exit 255 - fi - - if [ "$INSTALLED_BEFORE" = false ]; then - LOG_INFO "步骤3:安装texlive-tex4ht包" - dnf install -y texlive-tex4ht - CHECK_RESULT $? 0 0 "安装texlive-tex4ht失败" - fi - - LOG_INFO "步骤4:检查xhlatex命令是否存在" - command -v xhlatex > /dev/null 2>&1 - CHECK_RESULT $? 0 0 "xhlatex命令不存在" - - LOG_INFO "步骤5:检查xhlatex命令是否支持-C参数" - xhlatex --help 2>&1 | grep -q -- "-C" - CHECK_RESULT $? 0 0 "xhlatex命令不支持-C参数" - - LOG_INFO "步骤6:创建测试用LaTeX文件" - cat > test.tex << "EOF" - \documentclass{article} - \begin{document} - Hello, World! - \end{document} - EOF - CHECK_RESULT $? 0 0 "创建测试文件失败" - - LOG_INFO "步骤7:使用-C参数运行xhlatex命令" - xhlatex -C test.tex - CHECK_RESULT $? 0 0 "带-C参数运行xhlatex失败" - - LOG_INFO "步骤8:清理测试文件" - rm -f test.tex test.aux test.log test.out - CHECK_RESULT $? 0 0 "清理测试文件失败" - - if [ "$INSTALLED_BEFORE" = false ]; then - LOG_INFO "步骤9:卸载texlive-tex4ht包" - dnf remove -y texlive-tex4ht - CHECK_RESULT $? 0 0 "卸载texlive-tex4ht失败" - fi - - LOG_INFO "测试完成" -} - -main "$@" \ No newline at end of file diff --git a/testcases/function_test/pkg_test/texlive-base/texlive-tex4ht/test_texlive-tex4ht_xhlatex_upper_d.sh b/testcases/function_test/pkg_test/texlive-base/texlive-tex4ht/test_texlive-tex4ht_xhlatex_upper_d.sh deleted file mode 100644 index b36a6e06d32..00000000000 --- a/testcases/function_test/pkg_test/texlive-base/texlive-tex4ht/test_texlive-tex4ht_xhlatex_upper_d.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-02 -# @License : Mulan PSL v2 -# @Desc : 测试带-D参数运行xhlatex命令 -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - # 判断是否已安装texlive-tex4ht包 - LOG_INFO "检查texlive-tex4ht包是否已安装" - rpm -q texlive-tex4ht > /dev/null 2>&1 - if [ $? -eq 0 ]; then - LOG_INFO "texlive-tex4ht包已安装,脚本结束时将保持安装状态" - ALREADY_INSTALLED=1 - else - LOG_INFO "texlive-tex4ht包未安装,将在测试前安装" - ALREADY_INSTALLED=0 - fi - - # 检查yum源中是否有texlive-tex4ht包 - LOG_INFO "检查yum源中是否有texlive-tex4ht包" - dnf list available texlive-tex4ht > /dev/null 2>&1 - if [ $? -ne 0 ]; then - LOG_ERROR "yum源中未找到texlive-tex4ht包" - exit 255 - fi - - # 如果未安装,则安装texlive-tex4ht包 - if [ $ALREADY_INSTALLED -eq 0 ]; then - LOG_INFO "安装texlive-tex4ht包" - dnf install -y texlive-tex4ht - CHECK_RESULT $? 0 0 "安装texlive-tex4ht包失败" - fi - - # 检查xhlatex命令是否存在 - LOG_INFO "检查xhlatex命令是否存在" - which xhlatex > /dev/null 2>&1 - if [ $? -ne 0 ]; then - LOG_ERROR "xhlatex命令不存在" - exit 255 - fi - - # 检查xhlatex命令是否支持-D参数 - LOG_INFO "检查xhlatex命令是否支持-D参数" - xhlatex --help 2>&1 | grep -q "\-D" - if [ $? -ne 0 ]; then - LOG_ERROR "xhlatex命令不支持-D参数" - exit 255 - fi - - # 创建测试用的简单LaTeX文件 - LOG_INFO "创建测试用的LaTeX文件" - cat > test.tex << "EOF" - \documentclass{article} - \begin{document} - Hello, World! - \end{document} - EOF - CHECK_RESULT $? 0 0 "创建测试文件失败" - - # 测试带-D参数运行xhlatex命令 - LOG_INFO "测试带-D参数运行xhlatex命令" - xhlatex -D test.tex - CHECK_RESULT $? 0 0 "带-D参数运行xhlatex命令失败" - - # 清理测试文件 - LOG_INFO "清理测试文件" - rm -f test.tex test.aux test.log test.dvi test.out - CHECK_RESULT $? 0 0 "清理测试文件失败" - - # 如果测试前未安装,则卸载texlive-tex4ht包 - if [ $ALREADY_INSTALLED -eq 0 ]; then - LOG_INFO "卸载texlive-tex4ht包" - dnf remove -y texlive-tex4ht - CHECK_RESULT $? 0 0 "卸载texlive-tex4ht包失败" - else - LOG_INFO "保持texlive-tex4ht包安装状态" - fi - - LOG_INFO "测试脚本执行完成" -} - -main "$@" \ No newline at end of file diff --git a/testcases/function_test/pkg_test/texlive-base/texlive-tex4ht/test_texlive-tex4ht_xhlatex_upper_e.sh b/testcases/function_test/pkg_test/texlive-base/texlive-tex4ht/test_texlive-tex4ht_xhlatex_upper_e.sh deleted file mode 100644 index 33407862da4..00000000000 --- a/testcases/function_test/pkg_test/texlive-base/texlive-tex4ht/test_texlive-tex4ht_xhlatex_upper_e.sh +++ /dev/null @@ -1,151 +0,0 @@ -#!/usr/bin/bash - -# Copyright (c) 2024 ISCAS .ALL rights reserved. -# This program is licensed under Mulan PSL v2. -# You can use it according to the terms and conditions of the Mulan PSL v2. -# http://license.coscl.org.cn/MulanPSL2 -# THIS PROGRAM IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, -# EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, -# 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-02 -# @License : Mulan PSL v2 -# @Desc : 测试带-E参数运行xhlatex命令 -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - # 定义颜色和日志函数 - RED="\033[1;31m" - GREEN="\033[1;32m" - YELLOW="\033[1;33m" - BLUE="\033[1;34m" - NC="\033[0m" - - LOG_INFO() { - echo -e "${BLUE}[INFO]${NC} $1" - } - - LOG_ERROR() { - echo -e "${RED}[ERROR]${NC} $1" - } - - # 检查软件包是否在yum源中 - check_package_in_repo() { - local pkg_name=$1 - LOG_INFO "检查yum源中是否存在软件包: $pkg_name" - dnf list available "$pkg_name" &>/dev/null - if [ $? -ne 0 ]; then - LOG_ERROR "yum源中不存在软件包: $pkg_name" - exit 255 - fi - LOG_INFO "yum源中存在软件包: $pkg_name" - } - - # 检查命令参数是否支持 - 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" - } - - # 主测试函数 - main() { - LOG_INFO "开始测试: 测试带-E参数运行xhlatex命令" - - # 定义软件包名称 - PACKAGE_NAME="texlive-tex4ht" - - # 检查软件包是否已安装 - LOG_INFO "检查系统是否已安装 $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 - - # 检查yum源中是否有该软件包 - check_package_in_repo "$PACKAGE_NAME" - - # 安装软件包 - LOG_INFO "安装软件包: $PACKAGE_NAME" - dnf install -y "$PACKAGE_NAME" - CHECK_RESULT $? 0 0 "安装 $PACKAGE_NAME 失败" - fi - - # 检查xhlatex命令是否存在 - LOG_INFO "检查xhlatex命令是否存在" - which xhlatex &>/dev/null - CHECK_RESULT $? 0 0 "xhlatex命令不存在" - - # 检查xhlatex命令是否支持-E参数 - check_command_param "xhlatex" "-E" - - # 创建测试文件 - LOG_INFO "创建测试TeX文件" - TEST_FILE="test_texlive.tex" - cat > "$TEST_FILE" << "EOF" - \documentclass{article} - \begin{document} - Hello, TeX Live! - \end{document} - EOF - CHECK_RESULT $? 0 0 "创建测试文件失败" - - # 使用-E参数运行xhlatex命令 - LOG_INFO "使用-E参数运行xhlatex命令" - xhlatex -E "$TEST_FILE" - CHECK_RESULT $? 0 0 "xhlatex -E 命令执行失败" - - # 检查输出文件 - LOG_INFO "检查xhlatex命令输出文件" - OUTPUT_FILE="${TEST_FILE%.tex}.html" - if [ -f "$OUTPUT_FILE" ]; then - LOG_INFO "成功生成输出文件: $OUTPUT_FILE" - # 检查文件内容 - if [ -s "$OUTPUT_FILE" ]; then - LOG_INFO "输出文件非空,内容有效" - else - LOG_ERROR "输出文件为空" - exit 1 - fi - else - LOG_ERROR "未找到输出文件: $OUTPUT_FILE" - exit 1 - fi - - # 清理测试文件 - LOG_INFO "清理测试文件" - rm -f "$TEST_FILE" "$OUTPUT_FILE" "${TEST_FILE%.tex}.log" "${TEST_FILE%.tex}.aux" "${TEST_FILE%.tex}.out" - CHECK_RESULT $? 0 0 "清理测试文件失败" - - # 如果测试前未安装,则卸载软件包 - if [ $ALREADY_INSTALLED -eq 0 ]; then - LOG_INFO "卸载临时安装的软件包: $PACKAGE_NAME" - dnf remove -y "$PACKAGE_NAME" - CHECK_RESULT $? 0 0 "卸载 $PACKAGE_NAME 失败" - LOG_INFO "已卸载软件包: $PACKAGE_NAME" - else - LOG_INFO "保持软件包安装状态: $PACKAGE_NAME" - fi - - LOG_INFO "测试完成: 带-E参数运行xhlatex命令测试成功" - } - - # 执行主函数 - main -} - -main "$@" \ No newline at end of file diff --git a/testcases/function_test/pkg_test/texlive-base/texlive-tex4ht/test_texlive-tex4ht_xhlatex_upper_f.sh b/testcases/function_test/pkg_test/texlive-base/texlive-tex4ht/test_texlive-tex4ht_xhlatex_upper_f.sh deleted file mode 100644 index 2c35e3c9b98..00000000000 --- a/testcases/function_test/pkg_test/texlive-base/texlive-tex4ht/test_texlive-tex4ht_xhlatex_upper_f.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-02 -# @License : Mulan PSL v2 -# @Desc : 测试带-F参数运行xhlatex命令 -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - LOG_INFO "开始测试:测试带-F参数运行xhlatex命令" - LOG_INFO "步骤1:检查yum源中是否存在texlive-tex4ht软件包" - if ! dnf list available texlive-tex4ht &>/dev/null; then - LOG_ERROR "yum源中不存在texlive-tex4ht软件包" - exit 255 - fi - LOG_INFO "步骤2:检查当前是否已安装texlive-tex4ht软件包" - if rpm -q texlive-tex4ht &>/dev/null; then - INSTALLED=1 - LOG_INFO "texlive-tex4ht已安装,测试后保持安装状态" - else - INSTALLED=0 - LOG_INFO "texlive-tex4ht未安装,将进行安装和卸载" - fi - if [ $INSTALLED -eq 0 ]; then - LOG_INFO "步骤3:安装texlive-tex4ht软件包" - dnf install -y texlive-tex4ht - CHECK_RESULT $? 0 0 "安装texlive-tex4ht失败" - fi - LOG_INFO "步骤4:检查xhlatex命令是否存在" - if ! command -v xhlatex &>/dev/null; then - LOG_ERROR "xhlatex命令不存在" - exit 255 - fi - LOG_INFO "步骤5:检查xhlatex命令是否支持-F参数" - if ! xhlatex --help 2>&1 | grep -q -- "-F"; then - LOG_ERROR "xhlatex命令不支持-F参数" - exit 255 - fi - LOG_INFO "步骤6:创建测试用的简单LaTeX文件" - cat > test.tex << "EOF" - \documentclass{article} - \begin{document} - Hello, world! - \end{document} - EOF - LOG_INFO "步骤7:带-F参数运行xhlatex命令" - xhlatex -F test.tex - CHECK_RESULT $? 0 0 "带-F参数运行xhlatex命令失败" - LOG_INFO "步骤8:清理生成的临时文件" - rm -f test.tex test.log test.aux test.dvi test.4ct test.4tc test.css test.html test.idv test.lg test.tmp test.xref - if [ $INSTALLED -eq 0 ]; then - LOG_INFO "步骤9:卸载texlive-tex4ht软件包" - dnf remove -y texlive-tex4ht - CHECK_RESULT $? 0 0 "卸载texlive-tex4ht失败" - fi - LOG_INFO "测试完成" -} - -main "$@" \ No newline at end of file diff --git a/testcases/function_test/pkg_test/texlive-base/texlive-tex4ht/test_texlive-tex4ht_xhlatex_upper_g.sh b/testcases/function_test/pkg_test/texlive-base/texlive-tex4ht/test_texlive-tex4ht_xhlatex_upper_g.sh deleted file mode 100644 index 09fc197478c..00000000000 --- a/testcases/function_test/pkg_test/texlive-base/texlive-tex4ht/test_texlive-tex4ht_xhlatex_upper_g.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-02 -# @License : Mulan PSL v2 -# @Desc : 测试带-G参数运行xhlatex命令 -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - LOG_INFO "开始测试:测试带-G参数运行xhlatex命令" - - # 检查软件包是否在yum源中 - LOG_INFO "步骤1:检查yum源中是否存在texlive-tex4ht软件包" - if ! dnf list available texlive-tex4ht &>/dev/null; then - LOG_ERROR "texlive-tex4ht软件包不在yum源中" - exit 255 - fi - - # 检查环境是否已安装软件包 - LOG_INFO "步骤2:检查是否已安装texlive-tex4ht" - if rpm -q texlive-tex4ht &>/dev/null; then - LOG_INFO "texlive-tex4ht已安装,测试完成后将保持安装状态" - INSTALLED=1 - else - LOG_INFO "texlive-tex4ht未安装,将进行安装并在测试完成后卸载" - INSTALLED=0 - fi - - # 如果未安装,则安装软件包 - if [ $INSTALLED -eq 0 ]; then - LOG_INFO "步骤3:安装texlive-tex4ht软件包" - dnf install -y texlive-tex4ht - CHECK_RESULT $? 0 0 "安装texlive-tex4ht失败" - fi - - # 检查xhlatex命令是否支持-G参数 - LOG_INFO "步骤4:检查xhlatex命令是否支持-G参数" - if ! xhlatex --help 2>&1 | grep -q -- "-G"; then - LOG_ERROR "xhlatex命令不支持-G参数" - # 如果之前未安装,则卸载软件包 - if [ $INSTALLED -eq 0 ]; then - dnf remove -y texlive-tex4ht - CHECK_RESULT $? 0 0 "卸载texlive-tex4ht失败" - fi - exit 255 - fi - - # 创建测试用的简单LaTeX文件 - LOG_INFO "步骤5:创建测试用的LaTeX文件" - cat > test.tex << "EOF" - \documentclass{article} - \begin{document} - Hello, world! - \end{document} - EOF - - # 使用-G参数运行xhlatex命令 - LOG_INFO "步骤6:使用-G参数运行xhlatex命令" - xhlatex -G test.tex - CHECK_RESULT $? 0 0 "带-G参数运行xhlatex命令失败" - - # 清理生成的中间文件 - LOG_INFO "步骤7:清理测试生成的中间文件" - rm -f test.tex test.aux test.log test.dvi test.ps test.pdf 2>/dev/null - - # 如果测试前未安装,则卸载软件包 - if [ $INSTALLED -eq 0 ]; then - LOG_INFO "步骤8:卸载texlive-tex4ht软件包" - dnf remove -y texlive-tex4ht - CHECK_RESULT $? 0 0 "卸载texlive-tex4ht失败" - fi - - LOG_INFO "测试完成:带-G参数运行xhlatex命令测试成功" -} - -main "$@" \ No newline at end of file diff --git a/testcases/function_test/pkg_test/texlive-base/texlive-tex4ht/test_texlive-tex4ht_xhlatex_upper_h.sh b/testcases/function_test/pkg_test/texlive-base/texlive-tex4ht/test_texlive-tex4ht_xhlatex_upper_h.sh deleted file mode 100644 index 185d2de7410..00000000000 --- a/testcases/function_test/pkg_test/texlive-base/texlive-tex4ht/test_texlive-tex4ht_xhlatex_upper_h.sh +++ /dev/null @@ -1,131 +0,0 @@ -#!/usr/bin/bash - -# Copyright (c) 2024 ISCAS .ALL rights reserved. -# This program is licensed under Mulan PSL v2. -# You can use it according to the terms and conditions of the Mulan PSL v2. -# http://license.coscl.org.cn/MulanPSL2 -# THIS PROGRAM IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, -# EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, -# MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. -# See the Mulan PSL v2 for more details. - -# ############################################# -# @Author : honghua -# @Contact : honghua@iscas.ac.cn -# @Date : 2026-03-02 -# @License : Mulan PSL v2 -# @Desc : 测试带-H参数运行xhlatex命令 -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - # 初始化日志函数 - LOG_INFO() { - echo "[INFO] $*" - } - LOG_ERROR() { - echo "[ERROR] $*" - } - - # 检查软件包是否在yum源中 - check_package_in_repo() { - dnf list available "$1" &>/dev/null - return $? - } - - # 检查命令参数是否支持 - check_command_option() { - local cmd=$1 - local option=$2 - if ! $cmd --help 2>&1 | grep -q -- "$option"; then - LOG_ERROR "命令 $cmd 不支持参数 $option" - exit 255 - fi - } - - # 主测试函数 - main() { - LOG_INFO "开始测试带 -H 参数运行 xhlatex 命令" - - # 检查是否已安装 texlive-tex4ht 和 texlive-xetex - LOG_INFO "检查是否已安装 texlive-tex4ht 和 texlive-xetex" - if rpm -q texlive-tex4ht &>/dev/null && rpm -q texlive-xetex &>/dev/null; then - LOG_INFO "软件包已安装,测试结束后将保持安装状态" - already_installed=1 - else - LOG_INFO "软件包未安装,将在测试过程中安装" - already_installed=0 - fi - - # 检查 yum 源中是否有软件包 - LOG_INFO "检查 yum 源中是否有 texlive-tex4ht 和 texlive-xetex" - if ! check_package_in_repo texlive-tex4ht; then - LOG_ERROR "yum 源中找不到 texlive-tex4ht" - exit 255 - fi - if ! check_package_in_repo texlive-xetex; then - LOG_ERROR "yum 源中找不到 texlive-xetex" - exit 255 - fi - - # 安装软件包(如果未安装) - if [ $already_installed -eq 0 ]; then - LOG_INFO "安装 texlive-tex4ht 和 texlive-xetex" - dnf install -y texlive-tex4ht texlive-xetex - CHECK_RESULT $? 0 0 "安装软件包失败" - fi - - # 检查 xhlatex 命令是否存在 - LOG_INFO "检查 xhlatex 命令是否存在" - command -v xhlatex &>/dev/null - CHECK_RESULT $? 0 0 "xhlatex 命令不存在" - - # 检查 xhlatex 是否支持 -H 参数 - LOG_INFO "检查 xhlatex 是否支持 -H 参数" - check_command_option xhlatex "-H" - - # 创建测试文件 - LOG_INFO "创建测试 LaTeX 文件" - cat > test.tex << "EOF" - \documentclass{article} - \begin{document} - Hello, World! - \end{document} - EOF - CHECK_RESULT $? 0 0 "创建测试文件失败" - - # 运行 xhlatex 命令带 -H 参数 - LOG_INFO "运行 xhlatex 命令带 -H 参数" - xhlatex -H test.tex - CHECK_RESULT $? 0 0 "xhlatex 命令执行失败" - - # 检查生成的 HTML 文件 - LOG_INFO "检查生成的 HTML 文件" - if [ -f test.html ]; then - LOG_INFO "成功生成 test.html 文件" - else - LOG_ERROR "未生成 test.html 文件" - exit 1 - fi - - # 清理测试文件 - LOG_INFO "清理测试文件" - rm -f test.tex test.html test.log test.aux test.out - CHECK_RESULT $? 0 0 "清理测试文件失败" - - # 卸载软件包(如果测试前未安装) - if [ $already_installed -eq 0 ]; then - LOG_INFO "卸载 texlive-tex4ht 和 texlive-xetex" - dnf remove -y texlive-tex4ht texlive-xetex - CHECK_RESULT $? 0 0 "卸载软件包失败" - fi - - LOG_INFO "测试完成" - } - - # 执行主函数 - main "$@" -} - -main "$@" \ No newline at end of file diff --git a/testcases/function_test/pkg_test/texlive-base/texlive-tex4ht/test_texlive-tex4ht_xhlatex_upper_i.sh b/testcases/function_test/pkg_test/texlive-base/texlive-tex4ht/test_texlive-tex4ht_xhlatex_upper_i.sh deleted file mode 100644 index ad8dbaa8c13..00000000000 --- a/testcases/function_test/pkg_test/texlive-base/texlive-tex4ht/test_texlive-tex4ht_xhlatex_upper_i.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-02 -# @License : Mulan PSL v2 -# @Desc : 测试带-I参数运行xhlatex命令 -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - LOG_INFO "开始测试带-I参数运行xhlatex命令" - - # 检查yum源中是否存在texlive-tex4ht包 - LOG_INFO "检查yum源中是否存在texlive-tex4ht包" - dnf list available texlive-tex4ht > /dev/null 2>&1 - if [ $? -ne 0 ]; then - LOG_ERROR "yum源中未找到texlive-tex4ht包" - exit 255 - fi - - # 检查环境是否已安装texlive-tex4ht - LOG_INFO "检查环境是否已安装texlive-tex4ht" - rpm -q texlive-tex4ht > /dev/null 2>&1 - installed=$? - - if [ $installed -eq 0 ]; then - LOG_INFO "检测到texlive-tex4ht已安装,测试结束后将保持安装状态" - need_cleanup=0 - else - LOG_INFO "检测到texlive-tex4ht未安装,将在测试结束后卸载" - need_cleanup=1 - LOG_INFO "安装texlive-tex4ht" - dnf install -y texlive-tex4ht - CHECK_RESULT $? 0 0 "安装texlive-tex4ht失败" - fi - - # 检查xhlatex命令是否支持-I参数 - LOG_INFO "检查xhlatex命令是否支持-I参数" - xhlatex --help 2>&1 | grep -q "\-I" - if [ $? -ne 0 ]; then - LOG_ERROR "xhlatex命令不支持-I参数" - # 如果之前未安装,需要卸载 - if [ $need_cleanup -eq 1 ]; then - LOG_INFO "清理安装的texlive-tex4ht包" - dnf remove -y texlive-tex4ht - fi - exit 255 - fi - - # 创建测试用的简单tex文件 - LOG_INFO "创建测试用的简单tex文件" - cat > test.tex << "EOF" - \documentclass{article} - \begin{document} - Test document for xhlatex -I parameter. - \end{document} - EOF - - # 使用-I参数运行xhlatex命令 - LOG_INFO "使用-I参数运行xhlatex命令" - xhlatex -I test.tex - CHECK_RESULT $? 0 0 "带-I参数运行xhlatex命令失败" - - # 清理测试文件 - LOG_INFO "清理测试文件" - rm -f test.tex test.aux test.log test.out - - # 环境恢复 - if [ $need_cleanup -eq 1 ]; then - LOG_INFO "清理安装的texlive-tex4ht包" - dnf remove -y texlive-tex4ht - CHECK_RESULT $? 0 0 "卸载texlive-tex4ht失败" - else - LOG_INFO "保持texlive-tex4ht安装状态" - fi - - LOG_INFO "测试带-I参数运行xhlatex命令完成" -} - -main "$@" \ No newline at end of file diff --git a/testcases/function_test/pkg_test/texlive-base/texlive-tex4ht/test_texlive-tex4ht_xhlatex_upper_j.sh b/testcases/function_test/pkg_test/texlive-base/texlive-tex4ht/test_texlive-tex4ht_xhlatex_upper_j.sh deleted file mode 100644 index e83f031158a..00000000000 --- a/testcases/function_test/pkg_test/texlive-base/texlive-tex4ht/test_texlive-tex4ht_xhlatex_upper_j.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-03-02 -# @License : Mulan PSL v2 -# @Desc : 测试带-J参数运行xhlatex命令 -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - # 判断是否已安装texlive-tex4ht包 - LOG_INFO "检查是否已安装texlive-tex4ht软件包" - rpm -q texlive-tex4ht > /dev/null 2>&1 - installed=$? - - # 记录初始安装状态 - if [ $installed -eq 0 ]; then - LOG_INFO "检测到texlive-tex4ht已安装,测试结束后将保持安装状态" - initial_installed=true - else - LOG_INFO "检测到texlive-tex4ht未安装,测试结束后将卸载软件包" - initial_installed=false - fi - - # 检查yum源中是否有该软件包 - LOG_INFO "检查yum源中是否有texlive-tex4ht软件包" - dnf list available texlive-tex4ht > /dev/null 2>&1 - if [ $? -ne 0 ]; then - LOG_ERROR "yum源中未找到texlive-tex4ht软件包" - exit 255 - fi - - # 如果未安装,则安装软件包 - if [ $installed -ne 0 ]; then - LOG_INFO "开始安装texlive-tex4ht软件包" - dnf install -y texlive-tex4ht - CHECK_RESULT $? 0 0 "安装texlive-tex4ht失败" - LOG_INFO "texlive-tex4ht软件包安装成功" - fi - - # 检查xhlatex命令是否存在 - LOG_INFO "检查xhlatex命令是否存在" - which xhlatex > /dev/null 2>&1 - if [ $? -ne 0 ]; then - LOG_ERROR "xhlatex命令不存在" - # 清理环境:如果测试前未安装,则卸载软件包 - if [ "$initial_installed" = "false" ]; then - dnf remove -y texlive-tex4ht - fi - exit 255 - fi - - # 检查xhlatex命令是否支持-J参数 - LOG_INFO "检查xhlatex命令是否支持-J参数" - xhlatex --help 2>&1 | grep -q "\-J" - if [ $? -ne 0 ]; then - LOG_ERROR "xhlatex命令不支持-J参数" - # 清理环境:如果测试前未安装,则卸载软件包 - if [ "$initial_installed" = "false" ]; then - dnf remove -y texlive-tex4ht - fi - exit 255 - fi - - # 创建一个简单的测试tex文件 - LOG_INFO "创建测试tex文件" - cat > test_sample.tex << "EOF" - \documentclass{article} - \begin{document} - Hello, World! - \end{document} - EOF - CHECK_RESULT $? 0 0 "创建测试tex文件失败" - - # 测试带-J参数运行xhlatex命令 - LOG_INFO "测试带-J参数运行xhlatex命令" - xhlatex -J test_sample.tex - CHECK_RESULT $? 0 0 "带-J参数运行xhlatex命令失败" - LOG_INFO "带-J参数运行xhlatex命令成功" - - # 清理测试文件 - LOG_INFO "清理测试文件" - rm -f test_sample.tex test_sample.aux test_sample.log test_sample.dvi test_sample.out - CHECK_RESULT $? 0 0 "清理测试文件失败" - - # 环境恢复 - LOG_INFO "开始环境恢复" - if [ "$initial_installed" = "false" ]; then - LOG_INFO "卸载texlive-tex4ht软件包" - dnf remove -y texlive-tex4ht - CHECK_RESULT $? 0 0 "卸载texlive-tex4ht失败" - LOG_INFO "环境已恢复到测试前状态(未安装texlive-tex4ht)" - else - LOG_INFO "保持texlive-tex4ht软件包安装状态" - fi - - LOG_INFO "测试脚本执行完成" -} - -main "$@" \ No newline at end of file diff --git a/testcases/function_test/pkg_test/texlive-base/texlive-tex4ht/test_texlive-tex4ht_xhlatex_upper_k.sh b/testcases/function_test/pkg_test/texlive-base/texlive-tex4ht/test_texlive-tex4ht_xhlatex_upper_k.sh deleted file mode 100644 index ce24d8bcf80..00000000000 --- a/testcases/function_test/pkg_test/texlive-base/texlive-tex4ht/test_texlive-tex4ht_xhlatex_upper_k.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-02 -# @License : Mulan PSL v2 -# @Desc : 测试带-K参数运行xhlatex命令 -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - LOG_INFO "开始测试:测试带-K参数运行xhlatex命令" - - LOG_INFO "步骤1:检查是否已安装texlive-tex4ht-xhlatex软件包" - if rpm -q texlive-tex4ht-xhlatex &> /dev/null; then - LOG_INFO "texlive-tex4ht-xhlatex已安装,脚本结束后将保持安装状态" - INSTALLED=true - else - LOG_INFO "texlive-tex4ht-xhlatex未安装,将在测试步骤中安装,并在脚本结束前卸载" - INSTALLED=false - fi - - LOG_INFO "步骤2:检查yum源中是否有texlive-tex4ht-xhlatex软件包" - if ! dnf list available texlive-tex4ht-xhlatex &> /dev/null; then - LOG_ERROR "yum源中未找到texlive-tex4ht-xhlatex软件包" - exit 255 - fi - - if [ "$INSTALLED" = false ]; then - LOG_INFO "步骤3:安装texlive-tex4ht-xhlatex软件包" - dnf install -y texlive-tex4ht-xhlatex - CHECK_RESULT $? 0 0 "安装texlive-tex4ht-xhlatex失败" - fi - - LOG_INFO "步骤4:检查xhlatex命令是否支持-K参数" - if ! xhlatex --help 2>&1 | grep -q -- "-K"; then - LOG_ERROR "xhlatex命令不支持-K参数" - if [ "$INSTALLED" = false ]; then - LOG_INFO "清理环境:卸载texlive-tex4ht-xhlatex软件包" - dnf remove -y texlive-tex4ht-xhlatex - fi - exit 255 - fi - - LOG_INFO "步骤5:创建一个简单的测试LaTeX文件" - cat > test.tex << "EOF" - \documentclass{article} - \begin{document} - Hello, World! - \end{document} - EOF - CHECK_RESULT $? 0 0 "创建测试LaTeX文件失败" - - LOG_INFO "步骤6:带-K参数运行xhlatex命令" - xhlatex -K test.tex - CHECK_RESULT $? 0 0 "带-K参数运行xhlatex命令失败" - - LOG_INFO "步骤7:检查是否生成了输出文件" - if [ -f "test.html" ]; then - LOG_INFO "成功生成test.html文件" - else - LOG_ERROR "未生成test.html文件" - CHECK_RESULT 1 0 0 "输出文件生成失败" - fi - - LOG_INFO "步骤8:清理测试文件" - rm -f test.tex test.html test.log test.aux test.out - CHECK_RESULT $? 0 0 "清理测试文件失败" - - if [ "$INSTALLED" = false ]; then - LOG_INFO "步骤9:卸载texlive-tex4ht-xhlatex软件包" - dnf remove -y texlive-tex4ht-xhlatex - CHECK_RESULT $? 0 0 "卸载texlive-tex4ht-xhlatex失败" - fi - - LOG_INFO "测试完成:带-K参数运行xhlatex命令测试成功" -} - -main "$@" \ No newline at end of file diff --git a/testcases/function_test/pkg_test/texlive-base/texlive-tex4ht/test_texlive-tex4ht_xhlatex_upper_l.sh b/testcases/function_test/pkg_test/texlive-base/texlive-tex4ht/test_texlive-tex4ht_xhlatex_upper_l.sh deleted file mode 100644 index 72df03dfa67..00000000000 --- a/testcases/function_test/pkg_test/texlive-base/texlive-tex4ht/test_texlive-tex4ht_xhlatex_upper_l.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-02 -# @License : Mulan PSL v2 -# @Desc : 测试带-L参数运行xhlatex命令 -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - # 测试脚本开始 - LOG_INFO "开始测试带-L参数运行xhlatex命令" - - # 步骤1: 检查环境是否已安装texlive-tex4ht - LOG_INFO "步骤1: 检查texlive-tex4ht是否已安装" - if dnf list installed texlive-tex4ht > /dev/null 2>&1; then - LOG_INFO "texlive-tex4ht已安装,脚本结束后将保持安装状态" - INSTALLED_BEFORE=true - else - LOG_INFO "texlive-tex4ht未安装,将在测试过程中安装" - INSTALLED_BEFORE=false - fi - - # 步骤2: 检查yum源中是否有texlive-tex4ht软件包 - LOG_INFO "步骤2: 检查yum源中是否有texlive-tex4ht软件包" - if ! dnf list available texlive-tex4ht > /dev/null 2>&1; then - LOG_ERROR "yum源中未找到texlive-tex4ht软件包" - exit 255 - fi - - # 步骤3: 如果未安装,则安装texlive-tex4ht - if [ "$INSTALLED_BEFORE" = false ]; then - LOG_INFO "步骤3: 安装texlive-tex4ht软件包" - dnf install -y texlive-tex4ht - CHECK_RESULT $? 0 0 "安装texlive-tex4ht失败" - fi - - # 步骤4: 检查xhlatex命令是否存在 - LOG_INFO "步骤4: 检查xhlatex命令是否存在" - if ! command -v xhlatex > /dev/null 2>&1; then - LOG_ERROR "xhlatex命令不存在" - exit 255 - fi - - # 步骤5: 检查xhlatex是否支持-L参数 - LOG_INFO "步骤5: 检查xhlatex是否支持-L参数" - if ! xhlatex --help 2>&1 | grep -q "\-L"; then - LOG_ERROR "xhlatex不支持-L参数" - exit 255 - fi - - # 步骤6: 创建测试用的LaTeX文件 - LOG_INFO "步骤6: 创建测试用的LaTeX文件" - cat > test.tex << "EOF" - \documentclass{article} - \begin{document} - Hello, World! - \end{document} - EOF - CHECK_RESULT $? 0 0 "创建测试文件失败" - - # 步骤7: 使用-L参数运行xhlatex命令 - LOG_INFO "步骤7: 使用-L参数运行xhlatex命令" - xhlatex -L test.tex - CHECK_RESULT $? 0 0 "带-L参数运行xhlatex命令失败" - - # 步骤8: 检查生成的输出文件 - LOG_INFO "步骤8: 检查生成的输出文件" - if [ -f "test.html" ]; then - LOG_INFO "成功生成test.html文件" - else - LOG_ERROR "未生成test.html文件" - exit 1 - fi - - # 步骤9: 清理测试文件 - LOG_INFO "步骤9: 清理测试文件" - rm -f test.tex test.html test.log test.aux test.out - CHECK_RESULT $? 0 0 "清理测试文件失败" - - # 步骤10: 如果测试前未安装,则卸载texlive-tex4ht - if [ "$INSTALLED_BEFORE" = false ]; then - LOG_INFO "步骤10: 卸载texlive-tex4ht软件包" - dnf remove -y texlive-tex4ht - CHECK_RESULT $? 0 0 "卸载texlive-tex4ht失败" - fi - - LOG_INFO "测试完成" -} - -main "$@" \ No newline at end of file diff --git a/testcases/function_test/pkg_test/texlive-base/texlive-tex4ht/test_texlive-tex4ht_xhlatex_upper_m.sh b/testcases/function_test/pkg_test/texlive-base/texlive-tex4ht/test_texlive-tex4ht_xhlatex_upper_m.sh deleted file mode 100644 index 3294e5c8caf..00000000000 --- a/testcases/function_test/pkg_test/texlive-base/texlive-tex4ht/test_texlive-tex4ht_xhlatex_upper_m.sh +++ /dev/null @@ -1,91 +0,0 @@ -#!/usr/bin/bash - -# Copyright (c) 2024 ISCAS .ALL rights reserved. -# This program is licensed under Mulan PSL v2. -# You can use it according to the terms and conditions of the Mulan PSL v2. -# http://license.coscl.org.cn/MulanPSL2 -# THIS PROGRAM IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, -# EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, -# MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. -# See the Mulan PSL v2 for more details. - -# ############################################# -# @Author : honghua -# @Contact : honghua@iscas.ac.cn -# @Date : 2026-03-02 -# @License : Mulan PSL v2 -# @Desc : 测试带-M参数运行xhlatex命令 -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - LOG_INFO "开始测试:测试带-M参数运行xhlatex命令" - - # 检查yum源中是否存在texlive-tex4ht软件包 - LOG_INFO "步骤1:检查yum源中是否存在texlive-tex4ht软件包" - dnf list available texlive-tex4ht > /dev/null 2>&1 - if [ $? -ne 0 ]; then - LOG_ERROR "yum源中不存在texlive-tex4ht软件包" - exit 255 - fi - - # 检查是否已安装texlive-tex4ht - LOG_INFO "步骤2:检查是否已安装texlive-tex4ht" - rpm -q texlive-tex4ht > /dev/null 2>&1 - if [ $? -eq 0 ]; then - INSTALLED=true - LOG_INFO "texlive-tex4ht已安装,脚本结束后将保持安装状态" - else - INSTALLED=false - LOG_INFO "texlive-tex4ht未安装,将进行安装和卸载操作" - fi - - # 如果未安装,则安装软件包 - if [ "$INSTALLED" = false ]; then - LOG_INFO "步骤3:安装texlive-tex4ht软件包" - dnf install -y texlive-tex4ht - CHECK_RESULT $? 0 0 "安装texlive-tex4ht失败" - fi - - # 检查xhlatex命令是否存在 - LOG_INFO "步骤4:检查xhlatex命令是否存在" - which xhlatex > /dev/null 2>&1 - if [ $? -ne 0 ]; then - LOG_ERROR "xhlatex命令不存在" - if [ "$INSTALLED" = false ]; then - dnf remove -y texlive-tex4ht - fi - exit 255 - fi - - # 检查xhlatex命令是否支持-M参数 - LOG_INFO "步骤5:检查xhlatex命令是否支持-M参数" - xhlatex --help 2>&1 | grep -q "\-M" - if [ $? -ne 0 ]; then - LOG_ERROR "xhlatex命令不支持-M参数" - if [ "$INSTALLED" = false ]; then - dnf remove -y texlive-tex4ht - fi - exit 255 - fi - - # 测试带-M参数运行xhlatex命令 - LOG_INFO "步骤6:测试带-M参数运行xhlatex命令" - xhlatex -M test.tex > /dev/null 2>&1 - CHECK_RESULT $? 0 0 "带-M参数运行xhlatex命令失败" - - # 清理环境 - LOG_INFO "步骤7:清理环境" - if [ "$INSTALLED" = false ]; then - LOG_INFO "卸载texlive-tex4ht软件包" - dnf remove -y texlive-tex4ht - CHECK_RESULT $? 0 0 "卸载texlive-tex4ht失败" - else - LOG_INFO "保持texlive-tex4ht安装状态" - fi - - LOG_INFO "测试完成:测试带-M参数运行xhlatex命令" -} - -main "$@" \ No newline at end of file diff --git a/testcases/function_test/pkg_test/texlive-base/texlive-tex4ht/test_texlive-tex4ht_xhlatex_upper_n.sh b/testcases/function_test/pkg_test/texlive-base/texlive-tex4ht/test_texlive-tex4ht_xhlatex_upper_n.sh deleted file mode 100644 index 14328f1adfa..00000000000 --- a/testcases/function_test/pkg_test/texlive-base/texlive-tex4ht/test_texlive-tex4ht_xhlatex_upper_n.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-02 -# @License : Mulan PSL v2 -# @Desc : 测试带-N参数运行xhlatex命令 -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - # 初始化变量 - PACKAGE_NAME="texlive-tex4ht" - TEST_COMMAND="xhlatex" - TEST_PARAM="-N" - - # 步骤1:检查yum源中是否存在指定软件包 - LOG_INFO "检查yum源中是否存在软件包: ${PACKAGE_NAME}" - dnf list available ${PACKAGE_NAME} &>/dev/null - if [ $? -ne 0 ]; then - LOG_ERROR "yum源中未找到软件包: ${PACKAGE_NAME}" - exit 255 - fi - - # 步骤2:检查当前环境是否已安装指定软件包 - LOG_INFO "检查当前环境是否已安装软件包: ${PACKAGE_NAME}" - rpm -q ${PACKAGE_NAME} &>/dev/null - INSTALLED=$? - if [ ${INSTALLED} -eq 0 ]; then - LOG_INFO "软件包已安装,脚本结束后将保持安装状态" - NEED_UNINSTALL=0 - else - LOG_INFO "软件包未安装,将在测试步骤中安装" - NEED_UNINSTALL=1 - fi - - # 步骤3:如果未安装,则安装软件包 - if [ ${NEED_UNINSTALL} -eq 1 ]; then - LOG_INFO "安装软件包: ${PACKAGE_NAME}" - dnf install -y ${PACKAGE_NAME} - CHECK_RESULT $? 0 0 "安装软件包失败" - fi - - # 步骤4:检查xhlatex命令是否支持-N参数 - LOG_INFO "检查xhlatex命令是否支持-N参数" - ${TEST_COMMAND} --help 2>&1 | grep -q "\-N" - if [ $? -ne 0 ]; then - LOG_ERROR "xhlatex命令不支持-N参数" - if [ ${NEED_UNINSTALL} -eq 1 ]; then - LOG_INFO "清理环境,卸载已安装的软件包" - dnf remove -y ${PACKAGE_NAME} - fi - exit 255 - fi - - # 步骤5:测试带-N参数运行xhlatex命令 - LOG_INFO "执行测试:带-N参数运行xhlatex命令" - ${TEST_COMMAND} ${TEST_PARAM} --version - CHECK_RESULT $? 0 0 "带-N参数运行xhlatex命令失败" - - # 步骤6:清理环境 - if [ ${NEED_UNINSTALL} -eq 1 ]; then - LOG_INFO "清理环境,卸载已安装的软件包" - dnf remove -y ${PACKAGE_NAME} - CHECK_RESULT $? 0 0 "卸载软件包失败" - else - LOG_INFO "保持软件包安装状态,无需卸载" - fi - - LOG_INFO "测试完成" -} - -main "$@" \ No newline at end of file diff --git a/testcases/function_test/pkg_test/texlive-base/texlive-tex4ht/test_texlive-tex4ht_xhlatex_upper_o.sh b/testcases/function_test/pkg_test/texlive-base/texlive-tex4ht/test_texlive-tex4ht_xhlatex_upper_o.sh deleted file mode 100644 index aafef5173a9..00000000000 --- a/testcases/function_test/pkg_test/texlive-base/texlive-tex4ht/test_texlive-tex4ht_xhlatex_upper_o.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-02 -# @License : Mulan PSL v2 -# @Desc : 测试带-O参数运行xhlatex命令 -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - # 判断是否已经安装texlive-tex4ht和texlive-xetex - LOG_INFO "检查是否已安装texlive-tex4ht和texlive-xetex软件包" - rpm -q texlive-tex4ht texlive-xetex > /dev/null 2>&1 - if [ $? -eq 0 ]; then - LOG_INFO "软件包已安装,脚本结束后将保持安装状态" - already_installed=1 - else - LOG_INFO "软件包未安装,将在测试过程中安装并在结束后卸载" - already_installed=0 - fi - - # 检查yum源中是否有texlive-tex4ht和texlive-xetex软件包 - LOG_INFO "检查yum源中是否有texlive-tex4ht和texlive-xetex软件包" - dnf list available texlive-tex4ht texlive-xetex > /dev/null 2>&1 - CHECK_RESULT $? 0 0 "yum源中缺少texlive-tex4ht或texlive-xetex软件包" - if [ $? -ne 0 ]; then - LOG_ERROR "yum源中缺少texlive-tex4ht或texlive-xetex软件包" - exit 255 - fi - - # 如果未安装,则安装软件包 - if [ $already_installed -eq 0 ]; then - LOG_INFO "安装texlive-tex4ht和texlive-xetex软件包" - dnf install -y texlive-tex4ht texlive-xetex - CHECK_RESULT $? 0 0 "安装texlive-tex4ht和texlive-xetex软件包失败" - fi - - # 检查xhlatex命令是否存在 - LOG_INFO "检查xhlatex命令是否存在" - which xhlatex > /dev/null 2>&1 - CHECK_RESULT $? 0 0 "xhlatex命令不存在" - - # 检查xhlatex命令是否支持-O参数 - LOG_INFO "检查xhlatex命令是否支持-O参数" - xhlatex --help 2>&1 | grep -q -- "-O" - CHECK_RESULT $? 0 0 "xhlatex命令不支持-O参数" - if [ $? -ne 0 ]; then - LOG_ERROR "xhlatex命令不支持-O参数" - 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文件失败" - - # 测试带-O参数运行xhlatex命令 - LOG_INFO "测试带-O参数运行xhlatex命令" - xhlatex -O test_output test.tex - CHECK_RESULT $? 0 0 "带-O参数运行xhlatex命令失败" - - # 检查生成的输出文件 - LOG_INFO "检查生成的输出文件" - ls -la test_output* > /dev/null 2>&1 - CHECK_RESULT $? 0 0 "未生成输出文件" - - # 清理测试文件 - LOG_INFO "清理测试文件" - rm -f test.tex test_output* test*.aux test*.log test*.out test*.dvi test*.4ct test*.4tc test*.idv test*.lg test*.tmp test*.xref - CHECK_RESULT $? 0 0 "清理测试文件失败" - - # 如果之前未安装,则卸载软件包 - if [ $already_installed -eq 0 ]; then - LOG_INFO "卸载texlive-tex4ht和texlive-xetex软件包" - dnf remove -y texlive-tex4ht texlive-xetex - CHECK_RESULT $? 0 0 "卸载texlive-tex4ht和texlive-xetex软件包失败" - fi - - LOG_INFO "测试完成" -} - -main "$@" \ No newline at end of file diff --git a/testcases/function_test/pkg_test/texlive-base/texlive-tex4ht/test_texlive-tex4ht_xhlatex_upper_p.sh b/testcases/function_test/pkg_test/texlive-base/texlive-tex4ht/test_texlive-tex4ht_xhlatex_upper_p.sh deleted file mode 100644 index af2460a783c..00000000000 --- a/testcases/function_test/pkg_test/texlive-base/texlive-tex4ht/test_texlive-tex4ht_xhlatex_upper_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-03-02 -# @License : Mulan PSL v2 -# @Desc : 测试带-P参数运行xhlatex命令 -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - LOG_INFO "开始测试带-P参数运行xhlatex命令" - - # 检查是否已安装texlive-tex4ht包 - LOG_INFO "检查texlive-tex4ht软件包是否已安装" - if dnf list installed texlive-tex4ht &>/dev/null; then - LOG_INFO "texlive-tex4ht已安装,脚本结束将保持安装状态" - INSTALLED=true - else - LOG_INFO "texlive-tex4ht未安装,将在测试过程中安装" - INSTALLED=false - fi - - # 检查yum源中是否有texlive-tex4ht包 - LOG_INFO "检查yum源中是否存在texlive-tex4ht软件包" - if ! dnf list available texlive-tex4ht &>/dev/null; then - LOG_ERROR "yum源中未找到texlive-tex4ht软件包" - exit 255 - fi - - # 如果未安装,则安装软件包 - if [ "$INSTALLED" = false ]; then - LOG_INFO "安装texlive-tex4ht软件包" - dnf install -y texlive-tex4ht - CHECK_RESULT $? 0 0 "安装texlive-tex4ht失败" - fi - - # 检查xhlatex命令是否存在 - LOG_INFO "检查xhlatex命令是否存在" - if ! command -v xhlatex &>/dev/null; then - LOG_ERROR "xhlatex命令不存在" - if [ "$INSTALLED" = false ]; then - LOG_INFO "卸载texlive-tex4ht软件包" - dnf remove -y texlive-tex4ht - fi - exit 255 - fi - - # 检查xhlatex命令是否支持-P参数 - LOG_INFO "检查xhlatex命令是否支持-P参数" - if ! xhlatex --help 2>&1 | grep -q -- "-P"; then - LOG_ERROR "xhlatex命令不支持-P参数" - if [ "$INSTALLED" = false ]; then - LOG_INFO "卸载texlive-tex4ht软件包" - dnf remove -y texlive-tex4ht - fi - exit 255 - fi - - # 创建测试用的简单LaTeX文件 - LOG_INFO "创建测试用的LaTeX文件" - cat > test.tex << "EOF" - \documentclass{article} - \begin{document} - Hello, World! - \end{document} - EOF - CHECK_RESULT $? 0 0 "创建测试文件失败" - - # 使用-P参数运行xhlatex命令 - LOG_INFO "执行xhlatex -P命令" - xhlatex -P test.tex - CHECK_RESULT $? 0 0 "xhlatex -P命令执行失败" - - # 清理测试文件 - LOG_INFO "清理测试文件" - rm -f test.tex test.aux test.log test.out - CHECK_RESULT $? 0 0 "清理测试文件失败" - - # 如果测试前未安装,则卸载软件包 - if [ "$INSTALLED" = false ]; then - LOG_INFO "卸载texlive-tex4ht软件包" - dnf remove -y texlive-tex4ht - CHECK_RESULT $? 0 0 "卸载texlive-tex4ht失败" - fi - - LOG_INFO "测试完成" -} - -main "$@" \ No newline at end of file diff --git a/testcases/function_test/pkg_test/texlive-base/texlive-tex4ht/test_texlive-tex4ht_xhlatex_upper_q.sh b/testcases/function_test/pkg_test/texlive-base/texlive-tex4ht/test_texlive-tex4ht_xhlatex_upper_q.sh deleted file mode 100644 index 4767842353a..00000000000 --- a/testcases/function_test/pkg_test/texlive-base/texlive-tex4ht/test_texlive-tex4ht_xhlatex_upper_q.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-02 -# @License : Mulan PSL v2 -# @Desc : 测试带-Q参数运行xhlatex命令 -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - # 环境检查:检查是否已安装texlive-tex4ht和texlive-xetex - LOG_INFO "检查是否已安装texlive-tex4ht和texlive-xetex" - rpm -q texlive-tex4ht texlive-xetex > /dev/null 2>&1 - if [ $? -eq 0 ]; then - LOG_INFO "软件包已安装,测试结束后将保持安装状态" - INSTALLED=1 - else - LOG_INFO "软件包未安装,测试前将进行安装" - INSTALLED=0 - fi - - # 检查yum源中是否存在所需软件包 - LOG_INFO "检查yum源中是否存在texlive-tex4ht和texlive-xetex" - dnf list available texlive-tex4ht texlive-xetex > /dev/null 2>&1 - if [ $? -ne 0 ]; then - LOG_ERROR "yum源中不存在texlive-tex4ht或texlive-xetex软件包" - exit 255 - fi - - # 如果未安装,则安装软件包 - if [ $INSTALLED -eq 0 ]; then - LOG_INFO "安装texlive-tex4ht和texlive-xetex" - dnf install -y texlive-tex4ht texlive-xetex - CHECK_RESULT $? 0 0 "安装texlive-tex4ht和texlive-xetex失败" - fi - - # 检查xhlatex命令是否存在 - LOG_INFO "检查xhlatex命令是否存在" - command -v xhlatex > /dev/null 2>&1 - if [ $? -ne 0 ]; then - LOG_ERROR "xhlatex命令不存在" - exit 255 - fi - - # 测试带-Q参数运行xhlatex命令 - LOG_INFO "测试带-Q参数运行xhlatex命令" - xhlatex -Q --help > /dev/null 2>&1 - if [ $? -eq 255 ]; then - LOG_ERROR "xhlatex命令不支持-Q参数" - exit 255 - fi - - # 创建一个简单的测试文件 - LOG_INFO "创建测试文件test.tex" - cat > test.tex << "EOF" - \documentclass{article} - \begin{document} - Hello, World! - \end{document} - EOF - CHECK_RESULT $? 0 0 "创建测试文件失败" - - # 使用xhlatex命令处理测试文件,带-Q参数 - LOG_INFO "使用xhlatex命令处理测试文件,带-Q参数" - xhlatex -Q test.tex > /dev/null 2>&1 - CHECK_RESULT $? 0 0 "xhlatex命令执行失败" - - # 清理测试文件 - LOG_INFO "清理测试文件" - rm -f test.tex test.log test.aux test.dvi test.out - CHECK_RESULT $? 0 0 "清理测试文件失败" - - # 环境恢复:如果测试前未安装,则卸载软件包 - if [ $INSTALLED -eq 0 ]; then - LOG_INFO "卸载texlive-tex4ht和texlive-xetex" - dnf remove -y texlive-tex4ht texlive-xetex - CHECK_RESULT $? 0 0 "卸载texlive-tex4ht和texlive-xetex失败" - else - LOG_INFO "保持软件包安装状态" - fi - - LOG_INFO "测试完成" -} - -main "$@" \ No newline at end of file diff --git a/testcases/function_test/pkg_test/texlive-base/texlive-tex4ht/test_texlive-tex4ht_xhlatex_upper_r.sh b/testcases/function_test/pkg_test/texlive-base/texlive-tex4ht/test_texlive-tex4ht_xhlatex_upper_r.sh deleted file mode 100644 index 5664fec0b90..00000000000 --- a/testcases/function_test/pkg_test/texlive-base/texlive-tex4ht/test_texlive-tex4ht_xhlatex_upper_r.sh +++ /dev/null @@ -1,91 +0,0 @@ -#!/usr/bin/bash - -# Copyright (c) 2024 ISCAS .ALL rights reserved. -# This program is licensed under Mulan PSL v2. -# You can use it according to the terms and conditions of the Mulan PSL v2. -# http://license.coscl.org.cn/MulanPSL2 -# THIS PROGRAM IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, -# EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, -# MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. -# See the Mulan PSL v2 for more details. - -# ############################################# -# @Author : honghua -# @Contact : honghua@iscas.ac.cn -# @Date : 2026-03-02 -# @License : Mulan PSL v2 -# @Desc : 测试带-R参数运行xhlatex命令 -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - LOG_INFO "开始测试带-R参数运行xhlatex命令" - - # 检查是否已安装texlive-tex4ht - LOG_INFO "检查是否已安装texlive-tex4ht" - if rpm -q texlive-tex4ht &>/dev/null; then - LOG_INFO "texlive-tex4ht已安装" - INSTALLED="true" - else - LOG_INFO "texlive-tex4ht未安装" - INSTALLED="false" - fi - - # 检查yum源中是否有texlive-tex4ht软件包 - LOG_INFO "检查yum源中是否有texlive-tex4ht软件包" - if ! dnf list available texlive-tex4ht &>/dev/null; then - LOG_ERROR "yum源中未找到texlive-tex4ht软件包" - exit 255 - fi - - # 如果未安装,则安装软件包 - if [ "$INSTALLED" = "false" ]; then - LOG_INFO "安装texlive-tex4ht软件包" - dnf install -y texlive-tex4ht - CHECK_RESULT $? 0 0 "安装texlive-tex4ht失败" - fi - - # 检查xhlatex命令是否存在 - LOG_INFO "检查xhlatex命令是否存在" - if ! command -v xhlatex &>/dev/null; then - LOG_ERROR "xhlatex命令不存在" - exit 255 - fi - - # 检查xhlatex命令是否支持-R参数 - LOG_INFO "检查xhlatex命令是否支持-R参数" - if ! xhlatex --help 2>&1 | grep -q "\-R"; then - LOG_ERROR "xhlatex命令不支持-R参数" - exit 255 - fi - - # 创建测试用的简单LaTeX文件 - LOG_INFO "创建测试用的简单LaTeX文件" - cat > test.tex << "EOF" - \documentclass{article} - \begin{document} - Hello, world! - \end{document} - EOF - - # 使用-R参数运行xhlatex命令 - LOG_INFO "使用-R参数运行xhlatex命令" - xhlatex -R test.tex - CHECK_RESULT $? 0 0 "带-R参数运行xhlatex命令失败" - - # 清理测试文件 - LOG_INFO "清理测试文件" - rm -f test.tex test.aux test.log test.dvi test.ps test.pdf - - # 如果之前未安装,则卸载软件包 - if [ "$INSTALLED" = "false" ]; then - LOG_INFO "卸载texlive-tex4ht软件包" - dnf remove -y texlive-tex4ht - CHECK_RESULT $? 0 0 "卸载texlive-tex4ht失败" - fi - - LOG_INFO "测试完成" -} - -main "$@" \ No newline at end of file diff --git a/testcases/function_test/pkg_test/texlive-base/texlive-tex4ht/test_texlive-tex4ht_xhlatex_upper_s.sh b/testcases/function_test/pkg_test/texlive-base/texlive-tex4ht/test_texlive-tex4ht_xhlatex_upper_s.sh deleted file mode 100644 index 950579c5db3..00000000000 --- a/testcases/function_test/pkg_test/texlive-base/texlive-tex4ht/test_texlive-tex4ht_xhlatex_upper_s.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-02 -# @License : Mulan PSL v2 -# @Desc : 测试带-S参数运行xhlatex命令 -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - set -e - - LOG_INFO "开始测试:测试带-S参数运行xhlatex命令" - - # 检查软件包是否在yum源中 - LOG_INFO "检查texlive-tex4ht软件包是否在yum源中" - if ! dnf list available texlive-tex4ht &>/dev/null; then - LOG_ERROR "texlive-tex4ht软件包不在yum源中" - exit 255 - fi - - # 检查环境是否已安装 - LOG_INFO "检查环境是否已安装texlive-tex4ht" - if rpm -q texlive-tex4ht &>/dev/null; then - LOG_INFO "环境已安装texlive-tex4ht,测试后将保持安装状态" - INSTALLED=true - else - LOG_INFO "环境未安装texlive-tex4ht,将进行安装" - INSTALLED=false - fi - - # 如果未安装,则安装软件包 - if [ "$INSTALLED" = false ]; then - LOG_INFO "安装texlive-tex4ht软件包" - dnf install -y texlive-tex4ht - CHECK_RESULT $? 0 0 "安装texlive-tex4ht失败" - fi - - # 检查xhlatex命令是否存在 - LOG_INFO "检查xhlatex命令是否存在" - command -v xhlatex &>/dev/null - CHECK_RESULT $? 0 0 "xhlatex命令不存在" - - # 检查xhlatex命令是否支持-S参数 - LOG_INFO "检查xhlatex命令是否支持-S参数" - if ! xhlatex --help 2>&1 | grep -q "\-S"; then - LOG_ERROR "xhlatex命令不支持-S参数" - exit 255 - fi - - # 测试带-S参数运行xhlatex命令 - LOG_INFO "测试带-S参数运行xhlatex命令" - xhlatex -S - CHECK_RESULT $? 0 0 "带-S参数运行xhlatex命令失败" - - # 环境恢复 - LOG_INFO "环境恢复" - if [ "$INSTALLED" = false ]; then - LOG_INFO "卸载texlive-tex4ht软件包" - dnf remove -y texlive-tex4ht - CHECK_RESULT $? 0 0 "卸载texlive-tex4ht失败" - else - LOG_INFO "环境已安装texlive-tex4ht,保持安装状态" - fi - - LOG_INFO "测试完成" -} - -main "$@" \ No newline at end of file diff --git a/testcases/function_test/pkg_test/texlive-base/texlive-tex4ht/test_texlive-tex4ht_xhlatex_upper_t.sh b/testcases/function_test/pkg_test/texlive-base/texlive-tex4ht/test_texlive-tex4ht_xhlatex_upper_t.sh deleted file mode 100644 index 044ede5b8b9..00000000000 --- a/testcases/function_test/pkg_test/texlive-base/texlive-tex4ht/test_texlive-tex4ht_xhlatex_upper_t.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-02 -# @License : Mulan PSL v2 -# @Desc : 测试带-T参数运行xhlatex命令 -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - # 环境检查:检查是否已安装texlive-tex4ht和texlive-xetex - LOG_INFO "检查是否已安装texlive-tex4ht和texlive-xetex" - rpm -q texlive-tex4ht texlive-xetex > /dev/null 2>&1 - if [ $? -eq 0 ]; then - LOG_INFO "texlive-tex4ht和texlive-xetex已安装" - INSTALLED=true - else - LOG_INFO "texlive-tex4ht和texlive-xetex未安装" - INSTALLED=false - fi - - # 检查yum源中是否有texlive-tex4ht和texlive-xetex软件包 - LOG_INFO "检查yum源中是否有texlive-tex4ht和texlive-xetex软件包" - dnf list available texlive-tex4ht texlive-xetex > /dev/null 2>&1 - if [ $? -ne 0 ]; then - LOG_ERROR "yum源中缺少texlive-tex4ht或texlive-xetex软件包" - exit 255 - fi - - # 如果未安装,则安装软件包 - if [ "$INSTALLED" = false ]; then - LOG_INFO "安装texlive-tex4ht和texlive-xetex软件包" - dnf install -y texlive-tex4ht texlive-xetex - CHECK_RESULT $? 0 0 "安装texlive-tex4ht和texlive-xetex失败" - fi - - # 测试带-T参数运行xhlatex命令 - LOG_INFO "测试带-T参数运行xhlatex命令" - xhlatex -T utf8 --help > /dev/null 2>&1 - if [ $? -eq 0 ]; then - LOG_INFO "xhlatex命令支持-T参数" - else - LOG_ERROR "xhlatex命令不支持-T参数" - exit 255 - fi - - # 执行带-T参数的xhlatex命令 - LOG_INFO "执行带-T参数的xhlatex命令" - cat > test.tex << "EOF" - \documentclass{article} - \begin{document} - Hello, World! - \end{document} - EOF - xhlatex -T utf8 test.tex - CHECK_RESULT $? 0 0 "执行带-T参数的xhlatex命令失败" - - # 清理临时文件 - LOG_INFO "清理临时文件" - rm -f test.tex test.aux test.log test.dvi - - # 如果之前未安装,则卸载软件包 - if [ "$INSTALLED" = false ]; then - LOG_INFO "卸载texlive-tex4ht和texlive-xetex软件包" - dnf remove -y texlive-tex4ht texlive-xetex - CHECK_RESULT $? 0 0 "卸载texlive-tex4ht和texlive-xetex失败" - fi -} - -main "$@" \ No newline at end of file diff --git a/testcases/function_test/pkg_test/texlive-base/texlive-tex4ht/test_texlive-tex4ht_xhlatex_upper_u.sh b/testcases/function_test/pkg_test/texlive-base/texlive-tex4ht/test_texlive-tex4ht_xhlatex_upper_u.sh deleted file mode 100644 index 2ad50e51c43..00000000000 --- a/testcases/function_test/pkg_test/texlive-base/texlive-tex4ht/test_texlive-tex4ht_xhlatex_upper_u.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-02 -# @License : Mulan PSL v2 -# @Desc : 测试带-U参数运行xhlatex命令 -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - # 环境检查与初始化 - LOG_INFO "开始测试xhlatex命令的-U参数功能" - - # 检查是否已安装texlive-tex4ht-xhlatex软件包 - LOG_INFO "检查texlive-tex4ht-xhlatex软件包是否已安装" - rpm -q texlive-tex4ht-xhlatex > /dev/null 2>&1 - if [ $? -eq 0 ]; then - LOG_INFO "检测到texlive-tex4ht-xhlatex已安装,测试结束后将保持安装状态" - INSTALLED_BEFORE_TEST=1 - else - LOG_INFO "未检测到texlive-tex4ht-xhlatex安装,将在测试过程中安装" - INSTALLED_BEFORE_TEST=0 - fi - - # 检查yum源中是否有该软件包 - LOG_INFO "检查yum源中是否存在texlive-tex4ht-xhlatex软件包" - dnf list available texlive-tex4ht-xhlatex > /dev/null 2>&1 - if [ $? -ne 0 ]; then - LOG_ERROR "yum源中未找到texlive-tex4ht-xhlatex软件包" - exit 255 - fi - - # 如果未安装,则安装软件包 - if [ $INSTALLED_BEFORE_TEST -eq 0 ]; then - LOG_INFO "开始安装texlive-tex4ht-xhlatex软件包" - dnf install -y texlive-tex4ht-xhlatex > /dev/null 2>&1 - CHECK_RESULT $? 0 0 "安装texlive-tex4ht-xhlatex软件包失败" - LOG_INFO "texlive-tex4ht-xhlatex软件包安装成功" - fi - - # 检查xhlatex命令是否存在 - LOG_INFO "检查xhlatex命令是否存在" - which xhlatex > /dev/null 2>&1 - CHECK_RESULT $? 0 0 "xhlatex命令不存在" - - # 检查xhlatex命令是否支持-U参数 - LOG_INFO "检查xhlatex命令是否支持-U参数" - xhlatex --help 2>&1 | grep -q -- "-U" - if [ $? -ne 0 ]; then - LOG_ERROR "xhlatex命令不支持-U参数" - # 清理环境 - if [ $INSTALLED_BEFORE_TEST -eq 0 ]; then - LOG_INFO "清理环境:卸载texlive-tex4ht-xhlatex软件包" - dnf remove -y texlive-tex4ht-xhlatex > /dev/null 2>&1 - fi - exit 255 - fi - - # 创建测试用的简单LaTeX文件 - LOG_INFO "创建测试用的LaTeX文件" - cat > test_document.tex << "EOF" - \documentclass{article} - \begin{document} - Hello, World! - \end{document} - EOF - CHECK_RESULT $? 0 0 "创建测试LaTeX文件失败" - - # 测试带-U参数运行xhlatex命令 - LOG_INFO "测试带-U参数运行xhlatex命令" - xhlatex -U test_document.tex > /dev/null 2>&1 - CHECK_RESULT $? 0 0 "带-U参数运行xhlatex命令失败" - - # 检查输出文件是否生成 - LOG_INFO "检查xhlatex命令是否生成了输出文件" - if [ -f "test_document.html" ]; then - LOG_INFO "xhlatex命令成功生成了HTML输出文件" - else - LOG_ERROR "xhlatex命令未生成预期的HTML输出文件" - # 清理临时文件 - rm -f test_document.tex test_document.aux test_document.log test_document.out > /dev/null 2>&1 - # 清理环境 - if [ $INSTALLED_BEFORE_TEST -eq 0 ]; then - LOG_INFO "清理环境:卸载texlive-tex4ht-xhlatex软件包" - dnf remove -y texlive-tex4ht-xhlatex > /dev/null 2>&1 - fi - exit 1 - fi - - # 清理临时文件 - LOG_INFO "清理测试生成的临时文件" - rm -f test_document.tex test_document.html test_document.aux test_document.log test_document.out > /dev/null 2>&1 - CHECK_RESULT $? 0 0 "清理临时文件失败" - - # 如果测试前未安装,则卸载软件包 - if [ $INSTALLED_BEFORE_TEST -eq 0 ]; then - LOG_INFO "清理环境:卸载texlive-tex4ht-xhlatex软件包" - dnf remove -y texlive-tex4ht-xhlatex > /dev/null 2>&1 - CHECK_RESULT $? 0 0 "卸载texlive-tex4ht-xhlatex软件包失败" - LOG_INFO "环境已恢复到测试前的状态" - else - LOG_INFO "测试完成,保持texlive-tex4ht-xhlatex软件包的安装状态" - fi - - LOG_INFO "xhlatex命令的-U参数功能测试完成" -} - -main "$@" \ No newline at end of file diff --git a/testcases/function_test/pkg_test/texlive-base/texlive-tex4ht/test_texlive-tex4ht_xhlatex_upper_w.sh b/testcases/function_test/pkg_test/texlive-base/texlive-tex4ht/test_texlive-tex4ht_xhlatex_upper_w.sh deleted file mode 100644 index b69f6840796..00000000000 --- a/testcases/function_test/pkg_test/texlive-base/texlive-tex4ht/test_texlive-tex4ht_xhlatex_upper_w.sh +++ /dev/null @@ -1,91 +0,0 @@ -#!/usr/bin/bash - -# Copyright (c) 2024 ISCAS .ALL rights reserved. -# This program is licensed under Mulan PSL v2. -# You can use it according to the terms and conditions of the Mulan PSL v2. -# http://license.coscl.org.cn/MulanPSL2 -# THIS PROGRAM IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, -# EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, -# MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. -# See the Mulan PSL v2 for more details. - -# ############################################# -# @Author : honghua -# @Contact : honghua@iscas.ac.cn -# @Date : 2026-03-02 -# @License : Mulan PSL v2 -# @Desc : 测试带-W参数运行xhlatex命令 -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - set -e - - LOG_INFO "检查yum源中是否存在texlive-tex4ht软件包" - dnf list texlive-tex4ht 2>/dev/null | grep -q texlive-tex4ht - if [ $? -ne 0 ]; then - LOG_ERROR "yum源中未找到texlive-tex4ht软件包" - exit 255 - fi - - LOG_INFO "检查当前环境是否已安装texlive-tex4ht" - rpm -q texlive-tex4ht >/dev/null 2>&1 - if [ $? -eq 0 ]; then - LOG_INFO "检测到texlive-tex4ht已安装,测试结束后将保持安装状态" - INSTALLED_BEFORE=1 - else - LOG_INFO "检测到texlive-tex4ht未安装,将在测试前安装,测试后卸载" - INSTALLED_BEFORE=0 - fi - - if [ ${INSTALLED_BEFORE} -eq 0 ]; then - LOG_INFO "安装texlive-tex4ht软件包" - dnf install -y texlive-tex4ht - CHECK_RESULT $? 0 0 "安装texlive-tex4ht失败" - fi - - LOG_INFO "查找xhlatex命令路径" - XHLATEX_PATH=$(which xhlatex 2>/dev/null) - if [ -z "$XHLATEX_PATH" ]; then - LOG_ERROR "未找到xhlatex命令" - exit 255 - fi - - LOG_INFO "检查xhlatex命令是否支持-W参数" - $xhlatex --help 2>&1 | grep -q -- "-W" - if [ $? -ne 0 ]; then - LOG_ERROR "xhlatex命令不支持-W参数" - exit 255 - fi - - LOG_INFO "创建一个简单的测试tex文件" - TEST_TEX_FILE="test_upper_w.tex" - cat > ${TEST_TEX_FILE} << "EOF" - \documentclass{article} - \begin{document} - Test document for xhlatex -W. - \end{document} - EOF - CHECK_RESULT $? 0 0 "创建测试tex文件失败" - - LOG_INFO "执行测试:运行xhlatex -W命令" - $xhlatex -W ${TEST_TEX_FILE} - CHECK_RESULT $? 0 0 "带-W参数运行xhlatex命令失败" - - LOG_INFO "清理测试生成的中间文件" - rm -f test_upper_w.aux test_upper_w.log test_upper_w.dvi test_upper_w.ps test_upper_w.pdf ${TEST_TEX_FILE} 2>/dev/null - - LOG_INFO "环境恢复" - if [ ${INSTALLED_BEFORE} -eq 0 ]; then - LOG_INFO "卸载测试安装的texlive-tex4ht软件包" - dnf remove -y texlive-tex4ht - CHECK_RESULT $? 0 0 "卸载texlive-tex4ht失败" - else - LOG_INFO "测试前已安装texlive-tex4ht,保持安装状态" - fi - - LOG_INFO "测试脚本执行完毕" -} - -main "$@" \ No newline at end of file diff --git a/testcases/function_test/pkg_test/texlive-base/texlive-tex4ht/test_texlive-tex4ht_xhlatex_upper_x.sh b/testcases/function_test/pkg_test/texlive-base/texlive-tex4ht/test_texlive-tex4ht_xhlatex_upper_x.sh deleted file mode 100644 index fd875464eb3..00000000000 --- a/testcases/function_test/pkg_test/texlive-base/texlive-tex4ht/test_texlive-tex4ht_xhlatex_upper_x.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-02 -# @License : Mulan PSL v2 -# @Desc : 测试带-X参数运行xhlatex命令 -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - # 检查是否已安装texlive-tex4ht - LOG_INFO "检查是否已安装texlive-tex4ht" - rpm -q texlive-tex4ht - if [ $? -eq 0 ]; then - LOG_INFO "texlive-tex4ht已安装,脚本结束后将保持安装状态" - ALREADY_INSTALLED=1 - else - LOG_INFO "texlive-tex4ht未安装,测试过程中将临时安装" - ALREADY_INSTALLED=0 - fi - - # 检查yum源中是否有texlive-tex4ht软件包 - LOG_INFO "检查yum源中是否有texlive-tex4ht软件包" - dnf list available texlive-tex4ht - if [ $? -ne 0 ]; then - LOG_ERROR "yum源中未找到texlive-tex4ht软件包" - exit 255 - fi - - # 如果未安装,则安装软件包 - if [ $ALREADY_INSTALLED -eq 0 ]; then - LOG_INFO "安装texlive-tex4ht软件包" - dnf install -y texlive-tex4ht - CHECK_RESULT $? 0 0 "安装texlive-tex4ht失败" - fi - - # 检查xhlatex命令是否存在 - LOG_INFO "检查xhlatex命令是否存在" - which xhlatex - CHECK_RESULT $? 0 0 "xhlatex命令不存在" - - # 测试带-X参数运行xhlatex命令 - LOG_INFO "测试带-X参数运行xhlatex命令" - xhlatex -X --help 2>&1 | grep -q "Usage:\|用法" - CHECK_RESULT $? 0 0 "xhlatex命令不支持-X参数" - - # 创建一个简单的测试文件 - LOG_INFO "创建一个简单的测试LaTeX文件" - cat > test.tex << "EOF" - \documentclass{article} - \begin{document} - Hello, World! - \end{document} - EOF - CHECK_RESULT $? 0 0 "创建测试文件失败" - - # 使用xhlatex -X处理测试文件 - LOG_INFO "使用xhlatex -X处理测试文件" - xhlatex -X test.tex - CHECK_RESULT $? 0 0 "xhlatex -X执行失败" - - # 清理测试文件 - LOG_INFO "清理测试文件" - rm -f test.tex test.html test.css test*.png test*.svg - CHECK_RESULT $? 0 0 "清理测试文件失败" - - # 如果测试开始时未安装,则卸载软件包 - if [ $ALREADY_INSTALLED -eq 0 ]; then - LOG_INFO "卸载texlive-tex4ht软件包" - dnf remove -y texlive-tex4ht - CHECK_RESULT $? 0 0 "卸载texlive-tex4ht失败" - fi - - LOG_INFO "测试完成" -} - -main "$@" \ No newline at end of file diff --git a/testcases/function_test/pkg_test/texlive-base/texlive-tex4ht/test_texlive-tex4ht_xhlatex_upper_y.sh b/testcases/function_test/pkg_test/texlive-base/texlive-tex4ht/test_texlive-tex4ht_xhlatex_upper_y.sh deleted file mode 100644 index 042a44a153c..00000000000 --- a/testcases/function_test/pkg_test/texlive-base/texlive-tex4ht/test_texlive-tex4ht_xhlatex_upper_y.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-02 -# @License : Mulan PSL v2 -# @Desc : 测试带-Y参数运行xhlatex命令 -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - LOG_INFO "开始测试:测试带-Y参数运行xhlatex命令" - - LOG_INFO "步骤1:检查texlive-tex4ht软件包是否在yum源中" - dnf list available texlive-tex4ht > /dev/null 2>&1 - if [ $? -ne 0 ]; then - LOG_ERROR "texlive-tex4ht软件包不在yum源中" - exit 255 - fi - - LOG_INFO "步骤2:检查xhlatex命令是否支持-Y参数" - xhlatex --help 2>&1 | grep -q "\-Y" - if [ $? -ne 0 ]; then - LOG_ERROR "xhlatex命令不支持-Y参数" - exit 255 - fi - - LOG_INFO "步骤3:检查texlive-tex4ht是否已安装" - rpm -q texlive-tex4ht > /dev/null 2>&1 - installed=$? - - if [ $installed -ne 0 ]; then - LOG_INFO "步骤4:安装texlive-tex4ht软件包" - dnf install -y texlive-tex4ht > /dev/null 2>&1 - CHECK_RESULT $? 0 0 "安装texlive-tex4ht失败" - fi - - LOG_INFO "步骤5:创建测试用的简单LaTeX文件" - cat > test.tex << "EOF" - \documentclass{article} - \begin{document} - Hello, World! - \end{document} - EOF - CHECK_RESULT $? 0 0 "创建测试文件失败" - - LOG_INFO "步骤6:使用xhlatex命令带-Y参数处理测试文件" - xhlatex -Y test.tex > /dev/null 2>&1 - CHECK_RESULT $? 0 0 "xhlatex -Y命令执行失败" - - LOG_INFO "步骤7:检查生成的HTML文件" - if [ -f test.html ]; then - LOG_INFO "成功生成test.html文件" - else - LOG_ERROR "未生成test.html文件" - exit 1 - fi - - LOG_INFO "步骤8:清理测试文件" - rm -f test.tex test.html test*.png test*.css test*.4ct test*.4tc test*.idv test*.lg test*.tmp test*.xref > /dev/null 2>&1 - - if [ $installed -ne 0 ]; then - LOG_INFO "步骤9:卸载texlive-tex4ht软件包" - dnf remove -y texlive-tex4ht > /dev/null 2>&1 - CHECK_RESULT $? 0 0 "卸载texlive-tex4ht失败" - fi - - LOG_INFO "测试完成" -} - -main "$@" \ No newline at end of file diff --git a/testcases/function_test/pkg_test/texlive-base/texlive-tex4ht/test_texlive-tex4ht_xhlatex_upper_z.sh b/testcases/function_test/pkg_test/texlive-base/texlive-tex4ht/test_texlive-tex4ht_xhlatex_upper_z.sh deleted file mode 100644 index d8ecaca9586..00000000000 --- a/testcases/function_test/pkg_test/texlive-base/texlive-tex4ht/test_texlive-tex4ht_xhlatex_upper_z.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-02 -# @License : Mulan PSL v2 -# @Desc : 测试带-Z参数运行xhlatex命令 -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - # 判断是否已安装texlive-tex4ht - LOG_INFO "检查是否已安装texlive-tex4ht" - if dnf list installed texlive-tex4ht &> /dev/null; then - LOG_INFO "texlive-tex4ht已安装,脚本结束后将保持安装状态" - INSTALLED="true" - else - LOG_INFO "texlive-tex4ht未安装,测试将先安装后卸载" - INSTALLED="false" - fi - - # 检查yum源中是否有texlive-tex4ht软件包 - LOG_INFO "检查yum源中是否有texlive-tex4ht软件包" - if ! dnf list available texlive-tex4ht &> /dev/null; then - LOG_ERROR "yum源中未找到texlive-tex4ht软件包" - exit 255 - fi - - # 如果未安装,则安装texlive-tex4ht - if [ "$INSTALLED" = "false" ]; then - LOG_INFO "安装texlive-tex4ht" - dnf install -y texlive-tex4ht - CHECK_RESULT $? 0 0 "安装texlive-tex4ht失败" - fi - - # 检查xhlatex命令是否存在 - LOG_INFO "检查xhlatex命令是否存在" - if ! command -v xhlatex &> /dev/null; then - LOG_ERROR "xhlatex命令不存在" - if [ "$INSTALLED" = "false" ]; then - LOG_INFO "卸载texlive-tex4ht" - dnf remove -y texlive-tex4ht - fi - exit 255 - fi - - # 检查xhlatex是否支持-Z参数 - LOG_INFO "检查xhlatex是否支持-Z参数" - if ! xhlatex --help 2>&1 | grep -q "\-Z"; then - LOG_ERROR "xhlatex不支持-Z参数" - if [ "$INSTALLED" = "false" ]; then - LOG_INFO "卸载texlive-tex4ht" - dnf remove -y texlive-tex4ht - 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文件失败" - - # 测试带-Z参数运行xhlatex命令 - LOG_INFO "测试带-Z参数运行xhlatex命令" - xhlatex -Z test.tex - CHECK_RESULT $? 0 0 "带-Z参数运行xhlatex命令失败" - - # 清理测试文件 - LOG_INFO "清理测试文件" - rm -f test.tex test.aux test.log test.out - CHECK_RESULT $? 0 0 "清理测试文件失败" - - # 如果测试前未安装,则卸载texlive-tex4ht - if [ "$INSTALLED" = "false" ]; then - LOG_INFO "卸载texlive-tex4ht" - dnf remove -y texlive-tex4ht - CHECK_RESULT $? 0 0 "卸载texlive-tex4ht失败" - fi - - LOG_INFO "测试完成" -} - -main "$@" \ No newline at end of file diff --git a/testcases/function_test/pkg_test/texlive-base/texlive-tex4ht/test_texlive-tex4ht_xhlatex_v.sh b/testcases/function_test/pkg_test/texlive-base/texlive-tex4ht/test_texlive-tex4ht_xhlatex_v.sh deleted file mode 100644 index 7037c218876..00000000000 --- a/testcases/function_test/pkg_test/texlive-base/texlive-tex4ht/test_texlive-tex4ht_xhlatex_v.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-27 -# @License : Mulan PSL v2 -# @Desc : 测试 xhlatex 命令的 -v 参数 -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - - # 检查是否已安装texlive-tex4ht包 - LOG_INFO "检查是否已安装texlive-tex4ht包" - if rpm -q texlive-tex4ht >/dev/null 2>&1; then - LOG_INFO "texlive-tex4ht已安装" - INSTALLED=true - else - LOG_INFO "texlive-tex4ht未安装" - INSTALLED=false - fi - - # 检查yum源中是否有texlive-tex4ht包 - LOG_INFO "检查yum源中是否有texlive-tex4ht包" - if ! dnf list available texlive-tex4ht >/dev/null 2>&1; then - LOG_ERROR "yum源中未找到texlive-tex4ht包" - exit 255 - fi - - # 如果未安装,则安装软件包 - if [ "$INSTALLED" = false ]; then - LOG_INFO "开始安装texlive-tex4ht包" - dnf install -y texlive-tex4ht - CHECK_RESULT $? 0 0 "安装texlive-tex4ht失败" - fi - - # 测试xhlatex命令的-v参数 - LOG_INFO "测试xhlatex命令的-v参数" - xhlatex -v >/dev/null 2>&1 - CHECK_RESULT $? 0 0 "xhlatex命令不支持-v参数" - - # 清理环境 - if [ "$INSTALLED" = false ]; then - LOG_INFO "卸载texlive-tex4ht包" - dnf remove -y texlive-tex4ht - CHECK_RESULT $? 0 0 "卸载texlive-tex4ht失败" - fi - - LOG_INFO "测试完成" - -} - -main "$@" \ No newline at end of file diff --git a/testcases/function_test/pkg_test/texlive-split-c/texlive-biolett-bst/test_texlive-biolett-bst_function_bibstyle.sh b/testcases/function_test/pkg_test/texlive-split-c/texlive-biolett-bst/test_texlive-biolett-bst_function_bibstyle.sh deleted file mode 100644 index b4bd684e516..00000000000 --- a/testcases/function_test/pkg_test/texlive-split-c/texlive-biolett-bst/test_texlive-biolett-bst_function_bibstyle.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-11-26 -# @License : Mulan PSL v2 -# @Desc : Verify bibstyle generation -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - # 检查是否已安装texlive-bibtex-extra包 - LOG_INFO "检查texlive-bibtex-extra包是否已安装" - dnf list installed texlive-bibtex-extra &>/dev/null - if [ $? -eq 0 ]; then - LOG_INFO "texlive-bibtex-extra包已安装" - installed=true - else - LOG_INFO "texlive-bibtex-extra包未安装" - installed=false - fi - - # 检查yum源中是否有texlive-bibtex-extra包 - LOG_INFO "检查yum源中是否存在texlive-bibtex-extra包" - dnf list available texlive-bibtex-extra &>/dev/null - if [ $? -ne 0 ]; then - LOG_ERROR "yum源中不存在texlive-bibtex-extra包" - exit 255 - fi - - # 如果未安装,则安装texlive-bibtex-extra包 - if [ "$installed" = false ]; then - LOG_INFO "开始安装texlive-bibtex-extra包" - dnf install -y texlive-bibtex-extra - CHECK_RESULT $? 0 0 "安装texlive-bibtex-extra包失败" - fi - - # 验证bibstyle生成功能 - LOG_INFO "验证bibstyle生成功能" - texfile="test.tex" - cat > $texfile </dev/null; then - LOG_ERROR "yum源中未找到软件包:${PACKAGE_NAME}" - exit 255 - fi - - LOG_INFO "检查yum源中是否存在软件包:${BIBTEX_PACKAGE}" - if ! dnf list available "${BIBTEX_PACKAGE}" &>/dev/null; then - LOG_ERROR "yum源中未找到软件包:${BIBTEX_PACKAGE}" - exit 255 - fi - - # 检查环境是否已安装指定软件包 - LOG_INFO "检查环境是否已安装软件包:${PACKAGE_NAME} 和 ${BIBTEX_PACKAGE}" - INSTALLED_PACKAGES="" - if rpm -q "${PACKAGE_NAME}" &>/dev/null; then - INSTALLED_PACKAGES="${INSTALLED_PACKAGES} ${PACKAGE_NAME}" - fi - if rpm -q "${BIBTEX_PACKAGE}" &>/dev/null; then - INSTALLED_PACKAGES="${INSTALLED_PACKAGES} ${BIBTEX_PACKAGE}" - fi - - # 如果未安装,则安装软件包 - if [[ -z "${INSTALLED_PACKAGES}" ]]; then - LOG_INFO "环境未安装所需软件包,开始安装" - dnf install -y "${PACKAGE_NAME}" "${BIBTEX_PACKAGE}" - CHECK_RESULT $? 0 0 "安装软件包失败" - # 标记需要卸载 - NEED_UNINSTALL=1 - else - LOG_INFO "环境已安装所需软件包,跳过安装步骤" - NEED_UNINSTALL=0 - fi - - # 创建测试目录 - TEST_DIR="/tmp/test_bibtex_biolett" - LOG_INFO "创建测试目录:${TEST_DIR}" - mkdir -p "${TEST_DIR}" - cd "${TEST_DIR}" || exit 1 - - # 创建测试.bib文件 - LOG_INFO "创建测试.bib文件" - cat > test.bib << "EOF" - @article{test2023, - author = {Author, Test}, - title = {Test Title}, - journal = {Test Journal}, - year = {2023}, - volume = {1}, - number = {1}, - pages = {1-10} - } - EOF - CHECK_RESULT $? 0 0 "创建.bib文件失败" - - # 创建测试.tex文件 - LOG_INFO "创建测试.tex文件" - cat > test.tex << "EOF" - \documentclass{article} - \begin{document} - Test citation \cite{test2023}. - \bibliographystyle{biolett} - \bibliography{test} - \end{document} - EOF - CHECK_RESULT $? 0 0 "创建.tex文件失败" - - # 检查biolett.bst文件是否存在 - LOG_INFO "检查biolett.bst文件是否存在" - if [[ ! -f "/usr/share/texlive/texmf-dist/bibtex/bst/biolett/biolett.bst" ]]; then - LOG_ERROR "biolett.bst文件不存在" - exit 255 - fi - - # 复制biolett.bst到测试目录 - LOG_INFO "复制biolett.bst到测试目录" - cp /usr/share/texlive/texmf-dist/bibtex/bst/biolett/biolett.bst . - CHECK_RESULT $? 0 0 "复制biolett.bst文件失败" - - # 运行pdflatex生成.aux文件 - LOG_INFO "运行pdflatex生成.aux文件" - pdflatex -interaction=nonstopmode test.tex - CHECK_RESULT $? 0 0 "pdflatex命令执行失败" - - # 运行bibtex处理参考文献 - LOG_INFO "运行bibtex处理参考文献" - bibtex test - CHECK_RESULT $? 0 0 "bibtex命令执行失败" - - # 再次运行pdflatex生成参考文献 - LOG_INFO "再次运行pdflatex生成参考文献" - pdflatex -interaction=nonstopmode test.tex - CHECK_RESULT $? 0 0 "pdflatex命令执行失败" - - # 检查生成的.bbl文件 - LOG_INFO "检查生成的.bbl文件" - if [[ -f "test.bbl" ]]; then - LOG_INFO "成功生成.bbl文件,验证通过" - else - LOG_ERROR "未生成.bbl文件,验证失败" - exit 1 - fi - - # 清理测试目录 - LOG_INFO "清理测试目录" - cd /tmp && rm -rf "${TEST_DIR}" - CHECK_RESULT $? 0 0 "清理测试目录失败" - - # 如果之前安装了软件包,则卸载 - if [[ "${NEED_UNINSTALL}" -eq 1 ]]; then - LOG_INFO "卸载测试安装的软件包" - dnf remove -y "${PACKAGE_NAME}" "${BIBTEX_PACKAGE}" - CHECK_RESULT $? 0 0 "卸载软件包失败" - else - LOG_INFO "保持环境安装状态,无需卸载" - fi - - LOG_INFO "测试完成:BibTeX使用biolett.bst处理参考文献验证成功" -} - -main "$@" \ No newline at end of file diff --git a/testcases/function_test/pkg_test/texlive-split-c/texlive-biolett-bst/test_texlive-biolett-bst_function_install.sh b/testcases/function_test/pkg_test/texlive-split-c/texlive-biolett-bst/test_texlive-biolett-bst_function_install.sh deleted file mode 100644 index 88a35c1946b..00000000000 --- a/testcases/function_test/pkg_test/texlive-split-c/texlive-biolett-bst/test_texlive-biolett-bst_function_install.sh +++ /dev/null @@ -1,75 +0,0 @@ -#!/usr/bin/bash - -# Copyright (c) 2024 ISCAS .ALL rights reserved. -# This program is licensed under Mulan PSL v2. -# You can use it according to the terms and conditions of the Mulan PSL v2. -# http://license.coscl.org.cn/MulanPSL2 -# THIS PROGRAM IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, -# EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, -# MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. -# See the Mulan PSL v2 for more details. - -# ############################################# -# @Author : honghua -# @Contact : honghua@iscas.ac.cn -# @Date : 2026-03-05 -# @License : Mulan PSL v2 -# @Desc : Verify package installation -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - # 判断是否已安装texlive-biolett-bst包 - LOG_INFO "检查texlive-biolett-bst是否已安装" - rpm -q texlive-biolett-bst - if [ $? -eq 0 ]; then - LOG_INFO "texlive-biolett-bst已安装,脚本结束时将保持安装状态" - INSTALLED_FLAG=1 - else - LOG_INFO "texlive-biolett-bst未安装,将在测试过程中安装" - INSTALLED_FLAG=0 - fi - - # 检查yum源中是否存在该软件包 - LOG_INFO "检查yum源中是否存在texlive-biolett-bst包" - dnf list available texlive-biolett-bst > /dev/null 2>&1 - CHECK_RESULT $? 0 0 "yum源中不存在texlive-biolett-bst包" - if [ $? -ne 0 ]; then - LOG_ERROR "yum源中不存在texlive-biolett-bst包" - exit 255 - fi - - # 安装软件包 - if [ $INSTALLED_FLAG -eq 0 ]; then - LOG_INFO "开始安装texlive-biolett-bst包" - dnf install -y texlive-biolett-bst - CHECK_RESULT $? 0 0 "安装texlive-biolett-bst包失败" - fi - - # 验证软件包安装 - LOG_INFO "验证texlive-biolett-bst包是否安装成功" - rpm -q texlive-biolett-bst - CHECK_RESULT $? 0 0 "texlive-biolett-bst包未正确安装" - - # 验证软件包功能 - LOG_INFO "验证texlive-biolett-bst包基本功能" - # 这里可以添加具体的功能测试命令 - # 例如:检查相关文件是否存在 - ls /usr/share/texlive/texmf-dist/bibtex/bst/biolett/biolett.bst > /dev/null 2>&1 - CHECK_RESULT $? 0 0 "biolett.bst文件不存在" - - # 清理环境 - LOG_INFO "清理测试环境" - if [ $INSTALLED_FLAG -eq 0 ]; then - LOG_INFO "卸载测试安装的texlive-biolett-bst包" - dnf remove -y texlive-biolett-bst - CHECK_RESULT $? 0 0 "卸载texlive-biolett-bst包失败" - else - LOG_INFO "保持原有的texlive-biolett-bst包安装状态" - fi - - LOG_INFO "测试完成" -} - -main "$@" \ No newline at end of file diff --git a/testcases/function_test/pkg_test/texlive-split-c/texlive-biolett-bst/test_texlive-biolett-bst_function_latexdoc.sh b/testcases/function_test/pkg_test/texlive-split-c/texlive-biolett-bst/test_texlive-biolett-bst_function_latexdoc.sh deleted file mode 100644 index 9c9dfdf41a4..00000000000 --- a/testcases/function_test/pkg_test/texlive-split-c/texlive-biolett-bst/test_texlive-biolett-bst_function_latexdoc.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-05 -# @License : Mulan PSL v2 -# @Desc : Verify LaTeX document compilation with biolett.bst -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - # 检查是否已经安装 texlive-biolett-bst 和 texlive-latex - LOG_INFO "检查是否已安装 texlive-biolett-bst 和 texlive-latex" - rpm -q texlive-biolett-bst texlive-latex > /dev/null 2>&1 - if [ $? -eq 0 ]; then - LOG_INFO "texlive-biolett-bst 和 texlive-latex 已安装,测试后保持安装状态" - INSTALLED=true - else - LOG_INFO "texlive-biolett-bst 和 texlive-latex 未安装,测试后将卸载" - INSTALLED=false - fi - - # 检查 yum 源中是否有 texlive-biolett-bst 软件包 - LOG_INFO "检查 yum 源中是否有 texlive-biolett-bst 软件包" - dnf list available texlive-biolett-bst > /dev/null 2>&1 - CHECK_RESULT $? 0 0 "yum 源中没有 texlive-biolett-bst 软件包" - if [ $? -ne 0 ]; then - LOG_ERROR "yum 源中没有 texlive-biolett-bst 软件包" - exit 255 - fi - - # 检查 yum 源中是否有 texlive-latex 软件包 - LOG_INFO "检查 yum 源中是否有 texlive-latex 软件包" - dnf list available texlive-latex > /dev/null 2>&1 - CHECK_RESULT $? 0 0 "yum 源中没有 texlive-latex 软件包" - if [ $? -ne 0 ]; then - LOG_ERROR "yum 源中没有 texlive-latex 软件包" - exit 255 - fi - - # 如果未安装,则安装 texlive-biolett-bst 和 texlive-latex - if [ "$INSTALLED" = false ]; then - LOG_INFO "安装 texlive-biolett-bst 和 texlive-latex" - dnf install -y texlive-biolett-bst texlive-latex - CHECK_RESULT $? 0 0 "安装 texlive-biolett-bst 和 texlive-latex 失败" - fi - - # 创建测试 LaTeX 文档 - LOG_INFO "创建测试 LaTeX 文档" - cat > test_biolett.tex << "EOF" - \documentclass{article} - \begin{document} - Test document for biolett.bst. - \end{document} - EOF - CHECK_RESULT $? 0 0 "创建测试 LaTeX 文档失败" - - # 使用 pdflatex 编译 LaTeX 文档 - LOG_INFO "使用 pdflatex 编译 LaTeX 文档" - pdflatex test_biolett.tex > /dev/null 2>&1 - CHECK_RESULT $? 0 0 "使用 pdflatex 编译 LaTeX 文档失败" - - # 检查生成的 PDF 文件是否存在 - LOG_INFO "检查生成的 PDF 文件是否存在" - if [ -f test_biolett.pdf ]; then - LOG_INFO "PDF 文件生成成功" - else - LOG_ERROR "PDF 文件生成失败" - exit 1 - fi - - # 清理测试文件 - LOG_INFO "清理测试文件" - rm -f test_biolett.tex test_biolett.aux test_biolett.log test_biolett.pdf - CHECK_RESULT $? 0 0 "清理测试文件失败" - - # 如果测试前未安装,则卸载 texlive-biolett-bst 和 texlive-latex - if [ "$INSTALLED" = false ]; then - LOG_INFO "卸载 texlive-biolett-bst 和 texlive-latex" - dnf remove -y texlive-biolett-bst texlive-latex - CHECK_RESULT $? 0 0 "卸载 texlive-biolett-bst 和 texlive-latex 失败" - fi - - LOG_INFO "测试完成,环境已恢复" -} - -main "$@" \ No newline at end of file diff --git a/testcases/function_test/pkg_test/texlive-split-d/texlive-cite/test_texlive-cite_function_bib.sh b/testcases/function_test/pkg_test/texlive-split-d/texlive-cite/test_texlive-cite_function_bib.sh deleted file mode 100644 index c5cc0276e4d..00000000000 --- a/testcases/function_test/pkg_test/texlive-split-d/texlive-cite/test_texlive-cite_function_bib.sh +++ /dev/null @@ -1,68 +0,0 @@ -#!/usr/bin/bash - -# Copyright (c) 2024 ISCAS .ALL rights reserved. -# This program is licensed under Mulan PSL v2. -# You can use it according to the terms and conditions of the Mulan PSL v2. -# http://license.coscl.org.cn/MulanPSL2 -# THIS PROGRAM IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, -# EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, -# MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. -# See the Mulan PSL v2 for more details. - -# ############################################# -# @Author : honghua -# @Contact : honghua@iscas.ac.cn -# @Date : 2025-11-26 -# @License : Mulan PSL v2 -# @Desc : Test bibliography citation -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - # 测试脚本:test_texlive-cite_function_bib - - LOG_INFO "开始测试:Test bibliography citation" - - # 检查是否已安装texlive-cite - LOG_INFO "检查是否已安装texlive-cite" - dnf list installed texlive-cite > /dev/null 2>&1 - if [ $? -eq 0 ]; then - LOG_INFO "texlive-cite已安装,跳过安装步骤" - INSTALLED=true - else - LOG_INFO "texlive-cite未安装,准备安装" - INSTALLED=false - fi - - # 检查yum源中是否有texlive-cite软件包 - LOG_INFO "检查yum源中是否有texlive-cite" - dnf list available texlive-cite > /dev/null 2>&1 - if [ $? -ne 0 ]; then - LOG_ERROR "yum源中未找到texlive-cite软件包" - exit 255 - fi - - # 如果未安装,则安装texlive-cite - if [ "$INSTALLED" = false ]; then - LOG_INFO "正在安装texlive-cite" - dnf install -y texlive-cite > /dev/null 2>&1 - CHECK_RESULT $? 0 0 "安装texlive-cite失败" - fi - - # 测试texlive-cite功能 - LOG_INFO "测试texlive-cite功能" - texdoc cite > /dev/null 2>&1 - CHECK_RESULT $? 0 0 "执行texdoc cite失败" - - # 清理环境 - if [ "$INSTALLED" = false ]; then - LOG_INFO "卸载texlive-cite" - dnf remove -y texlive-cite > /dev/null 2>&1 - CHECK_RESULT $? 0 0 "卸载texlive-cite失败" - fi - - LOG_INFO "测试完成:Test bibliography citation" -} - -main "$@" \ No newline at end of file diff --git a/testcases/function_test/pkg_test/texlive-split-f/texlive-ctex/test_texlive-ctex_function_basic.sh b/testcases/function_test/pkg_test/texlive-split-f/texlive-ctex/test_texlive-ctex_function_basic.sh deleted file mode 100644 index b64d7aed0ef..00000000000 --- a/testcases/function_test/pkg_test/texlive-split-f/texlive-ctex/test_texlive-ctex_function_basic.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-09-25 -# @License : Mulan PSL v2 -# @Desc : Test basic commands -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - - # 检查是否已经安装texlive-ctex软件包 - LOG_INFO "检查是否已安装texlive-ctex软件包" - dnf list installed texlive-ctex > /dev/null 2>&1 - if [ $? -eq 0 ]; then - LOG_INFO "texlive-ctex已安装,脚本结束后保持安装状态" - INSTALLED=1 - else - LOG_INFO "texlive-ctex未安装,脚本结束后将卸载" - INSTALLED=0 - fi - - # 检查yum源中是否有texlive-ctex软件包 - LOG_INFO "检查yum源中是否有texlive-ctex软件包" - dnf list available texlive-ctex > /dev/null 2>&1 - CHECK_RESULT $? 0 255 "yum源中未找到texlive-ctex软件包" - - # 安装texlive-ctex软件包 - if [ $INSTALLED -eq 0 ]; then - LOG_INFO "开始安装texlive-ctex软件包" - dnf install -y texlive-ctex > /dev/null 2>&1 - CHECK_RESULT $? 0 0 "安装texlive-ctex失败" - fi - - # 测试基本命令 - LOG_INFO "测试基本命令" - tex --version > /dev/null 2>&1 - CHECK_RESULT $? 0 0 "执行tex命令失败" - - latex --version > /dev/null 2>&1 - CHECK_RESULT $? 0 0 "执行latex命令失败" - - pdflatex --version > /dev/null 2>&1 - CHECK_RESULT $? 0 0 "执行pdflatex命令失败" - - # 清理环境,如果之前未安装则卸载软件包 - if [ $INSTALLED -eq 0 ]; then - LOG_INFO "卸载texlive-ctex软件包" - dnf remove -y texlive-ctex > /dev/null 2>&1 - CHECK_RESULT $? 0 0 "卸载texlive-ctex失败" - - # 确认卸载成功 - dnf list installed texlive-ctex > /dev/null 2>&1 - CHECK_RESULT $? 1 255 "卸载后仍检测到texlive-ctex存在" - fi - - LOG_INFO "测试脚本执行完毕,环境已恢复" - -} - -main "$@" \ No newline at end of file diff --git a/testcases/function_test/pkg_test/texlive-split-f/texlive-dcpic/test_texlive-dcpic_function_basic.sh b/testcases/function_test/pkg_test/texlive-split-f/texlive-dcpic/test_texlive-dcpic_function_basic.sh deleted file mode 100644 index 070ef0eaaec..00000000000 --- a/testcases/function_test/pkg_test/texlive-split-f/texlive-dcpic/test_texlive-dcpic_function_basic.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-11-26 -# @License : Mulan PSL v2 -# @Desc : Basic functionality test -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - - LOG_INFO "开始执行Basic functionality test测试脚本" - - # 检查texlive-dcpic软件包是否已安装 - if rpm -q texlive-dcpic &>/dev/null; then - LOG_INFO "texlive-dcpic已安装,测试完成后将保持安装状态" - INSTALLED=true - else - LOG_INFO "texlive-dcpic未安装,将在测试完成后卸载" - INSTALLED=false - fi - - # 检查yum源中是否有texlive-dcpic软件包 - LOG_INFO "检查yum源中是否存在texlive-dcpic软件包" - if ! dnf list available texlive-dcpic &>/dev/null; then - LOG_ERROR "yum源中不存在texlive-dcpic软件包" - exit 255 - fi - - # 安装texlive-dcpic软件包 - if [ "$INSTALLED" = false ]; then - LOG_INFO "安装texlive-dcpic软件包" - dnf install -y texlive-dcpic - CHECK_RESULT $? 0 0 "安装texlive-dcpic软件包失败" - fi - - # 测试texlive-dcpic基本功能 - LOG_INFO "测试texlive-dcpic基本功能" - dcpic --version &>/dev/null - CHECK_RESULT $? 0 0 "dcpic命令执行失败" - - # 测试不支持的参数 - LOG_INFO "测试不支持的参数" - dcpic --invalid-arg &>/dev/null - if [ $? -ne 255 ]; then - LOG_ERROR "不支持参数--invalid-arg,但未返回退出码255" - exit 255 - fi - - # 清理环境 - if [ "$INSTALLED" = false ]; then - LOG_INFO "卸载texlive-dcpic软件包" - dnf remove -y texlive-dcpic &>/dev/null - CHECK_RESULT $? 0 0 "卸载texlive-dcpic软件包失败" - fi - - LOG_INFO "Basic functionality test测试脚本执行完成" - -} - -main "$@" \ No newline at end of file diff --git a/testcases/function_test/pkg_test/texlive-split-h/texlive-eulervm/test_texlive-eulervm_function_rendering.sh b/testcases/function_test/pkg_test/texlive-split-h/texlive-eulervm/test_texlive-eulervm_function_rendering.sh deleted file mode 100644 index a85aba614fe..00000000000 --- a/testcases/function_test/pkg_test/texlive-split-h/texlive-eulervm/test_texlive-eulervm_function_rendering.sh +++ /dev/null @@ -1,72 +0,0 @@ -#!/usr/bin/bash - -# Copyright (c) 2024 ISCAS .ALL rights reserved. -# This program is licensed under Mulan PSL v2. -# You can use it according to the terms and conditions of the Mulan PSL v2. -# http://license.coscl.org.cn/MulanPSL2 -# THIS PROGRAM IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, -# EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, -# MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. -# See the Mulan PSL v2 for more details. - -# ############################################# -# @Author : honghua -# @Contact : honghua@iscas.ac.cn -# @Date : 2025-11-26 -# @License : Mulan PSL v2 -# @Desc : Test rendering of EulerVM fonts -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - - # 检查是否已安装texlive-eulervm - LOG_INFO "检查是否已安装texlive-eulervm" - rpm -q texlive-eulervm - if [ $? -eq 0 ]; then - LOG_INFO "texlive-eulervm已安装,脚本结束时保持安装状态" - installed=true - else - LOG_INFO "texlive-eulervm未安装,将在测试结束后卸载" - installed=false - fi - - # 检查yum源中是否有texlive-eulervm软件包 - LOG_INFO "检查yum源中是否有texlive-eulervm软件包" - dnf list available texlive-eulervm > /dev/null 2>&1 - CHECK_RESULT $? 0 255 "yum源中未找到texlive-eulervm软件包" - - # 安装texlive-eulervm - if [ "$installed" = false ]; then - LOG_INFO "开始安装texlive-eulervm" - dnf install -y texlive-eulervm > /dev/null 2>&1 - CHECK_RESULT $? 0 1 "安装texlive-eulervm失败" - fi - - # 测试渲染EulerVM字体 - LOG_INFO "测试渲染EulerVM字体" - echo "\documentclass{article} - \usepackage{eulervm} - \begin{document} - Test rendering of EulerVM fonts. - \end{document}" > test.tex - pdflatex test.tex > /dev/null 2>&1 - CHECK_RESULT $? 0 1 "渲染EulerVM字体失败" - - # 清理临时文件 - LOG_INFO "清理临时文件" - rm -f test.tex test.log test.aux test.pdf - - # 如果之前未安装,则卸载texlive-eulervm - if [ "$installed" = false ]; then - LOG_INFO "卸载texlive-eulervm" - dnf remove -y texlive-eulervm > /dev/null 2>&1 - CHECK_RESULT $? 0 1 "卸载texlive-eulervm失败" - fi - - LOG_INFO "测试脚本执行完毕" - -} - -main "$@" \ No newline at end of file diff --git a/testcases/function_test/pkg_test/texlive-split-i/texlive-fixfoot-doc/test_texlive-fixfoot-doc_function_install.sh b/testcases/function_test/pkg_test/texlive-split-i/texlive-fixfoot-doc/test_texlive-fixfoot-doc_function_install.sh deleted file mode 100644 index 90fe0c4319b..00000000000 --- a/testcases/function_test/pkg_test/texlive-split-i/texlive-fixfoot-doc/test_texlive-fixfoot-doc_function_install.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-09-19 -# @License : Mulan PSL v2 -# @Desc : Test package installation -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - # 检查是否已安装texlive-fixfoot-doc软件包 - LOG_INFO "检查texlive-fixfoot-doc是否已安装" - rpm -q texlive-fixfoot-doc > /dev/null 2>&1 - if [ $? -eq 0 ]; then - LOG_INFO "texlive-fixfoot-doc已安装,脚本结束时保持安装状态" - installed=true - else - installed=false - fi - - # 检查yum源中是否有texlive-fixfoot-doc软件包 - LOG_INFO "检查yum源中是否有texlive-fixfoot-doc软件包" - dnf list available texlive-fixfoot-doc > /dev/null 2>&1 - CHECK_RESULT $? 0 255 "yum源中不存在texlive-fixfoot-doc软件包" - - # 安装texlive-fixfoot-doc软件包 - if [ "$installed" = false ]; then - LOG_INFO "开始安装texlive-fixfoot-doc软件包" - dnf install -y texlive-fixfoot-doc > /dev/null 2>&1 - CHECK_RESULT $? 0 0 "安装texlive-fixfoot-doc软件包失败" - fi - - # 验证texlive-fixfoot-doc是否成功安装 - LOG_INFO "验证texlive-fixfoot-doc是否成功安装" - rpm -q texlive-fixfoot-doc > /dev/null 2>&1 - CHECK_RESULT $? 0 0 "texlive-fixfoot-doc未正确安装" - - # 卸载texlive-fixfoot-doc软件包(如果脚本开始时未安装) - if [ "$installed" = false ]; then - LOG_INFO "卸载texlive-fixfoot-doc软件包" - dnf remove -y texlive-fixfoot-doc > /dev/null 2>&1 - CHECK_RESULT $? 0 0 "卸载texlive-fixfoot-doc软件包失败" - - # 验证texlive-fixfoot-doc是否成功卸载 - LOG_INFO "验证texlive-fixfoot-doc是否成功卸载" - rpm -q texlive-fixfoot-doc > /dev/null 2>&1 - CHECK_RESULT $? 1 0 "texlive-fixfoot-doc未正确卸载" - fi - - LOG_INFO "测试脚本执行完成" -} - -main "$@" \ No newline at end of file diff --git a/testcases/function_test/pkg_test/texlive-split-i/texlive-footmisc-doc/test_texlive-footmisc-doc_function_use_info.sh b/testcases/function_test/pkg_test/texlive-split-i/texlive-footmisc-doc/test_texlive-footmisc-doc_function_use_info.sh deleted file mode 100644 index f94a832bc59..00000000000 --- a/testcases/function_test/pkg_test/texlive-split-i/texlive-footmisc-doc/test_texlive-footmisc-doc_function_use_info.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 : Test accessing the package info documentation -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - # 测试脚本:Test accessing the package info documentation - - LOG_INFO "开始测试:访问软件包信息文档" - - # 步骤1:检查yum源中是否存在texlive-footmisc-doc软件包 - LOG_INFO "步骤1:检查yum源中是否存在texlive-footmisc-doc软件包" - dnf list available texlive-footmisc-doc - CHECK_RESULT $? 0 0 "yum源中未找到texlive-footmisc-doc软件包" - - # 步骤2:检查当前是否已安装texlive-footmisc-doc软件包 - LOG_INFO "步骤2:检查当前是否已安装texlive-footmisc-doc软件包" - rpm -q texlive-footmisc-doc - if [ $? -eq 0 ]; then - LOG_INFO "texlive-footmisc-doc软件包已安装,测试结束后将保持安装状态" - INSTALLED=1 - else - LOG_INFO "texlive-footmisc-doc软件包未安装,将在测试过程中安装" - INSTALLED=0 - fi - - # 步骤3:安装texlive-footmisc-doc软件包(如果未安装) - if [ $INSTALLED -eq 0 ]; then - LOG_INFO "步骤3:安装texlive-footmisc-doc软件包" - dnf install -y texlive-footmisc-doc - CHECK_RESULT $? 0 0 "安装texlive-footmisc-doc软件包失败" - fi - - # 步骤4:访问软件包信息文档 - LOG_INFO "步骤4:访问texlive-footmisc-doc软件包信息文档" - rpm -qi texlive-footmisc-doc - CHECK_RESULT $? 0 0 "访问texlive-footmisc-doc软件包信息文档失败" - - # 步骤5:检查软件包文档文件是否存在 - LOG_INFO "步骤5:检查texlive-footmisc-doc软件包文档文件是否存在" - rpm -ql texlive-footmisc-doc | grep -i footmisc - CHECK_RESULT $? 0 0 "texlive-footmisc-doc软件包文档文件不存在" - - # 步骤6:清理环境(如果测试前未安装,则卸载软件包) - if [ $INSTALLED -eq 0 ]; then - LOG_INFO "步骤6:卸载texlive-footmisc-doc软件包" - dnf remove -y texlive-footmisc-doc - CHECK_RESULT $? 0 0 "卸载texlive-footmisc-doc软件包失败" - else - LOG_INFO "步骤6:保持texlive-footmisc-doc软件包安装状态" - fi - - LOG_INFO "测试完成:成功访问texlive-footmisc-doc软件包信息文档" -} - -main "$@" \ No newline at end of file diff --git a/testcases/function_test/pkg_test/texlive-split-i/texlive-footmisc-doc/test_texlive-footmisc-doc_function_use_manpage.sh b/testcases/function_test/pkg_test/texlive-split-i/texlive-footmisc-doc/test_texlive-footmisc-doc_function_use_manpage.sh deleted file mode 100644 index 3214a085bbb..00000000000 --- a/testcases/function_test/pkg_test/texlive-split-i/texlive-footmisc-doc/test_texlive-footmisc-doc_function_use_manpage.sh +++ /dev/null @@ -1,69 +0,0 @@ -#!/usr/bin/bash - -# Copyright (c) 2024 ISCAS .ALL rights reserved. -# This program is licensed under Mulan PSL v2. -# You can use it according to the terms and conditions of the Mulan PSL v2. -# http://license.coscl.org.cn/MulanPSL2 -# THIS PROGRAM IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, -# EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, -# MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. -# See the Mulan PSL v2 for more details. - -# ############################################# -# @Author : honghua -# @Contact : honghua@iscas.ac.cn -# @Date : 2026-03-11 -# @License : Mulan PSL v2 -# @Desc : Test accessing the package man page -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - LOG_INFO "开始测试:访问软件包man页面" - LOG_INFO "步骤1:检查yum源中是否存在texlive-footmisc-doc软件包" - dnf list available texlive-footmisc-doc &> /dev/null - if [ $? -ne 0 ]; then - LOG_ERROR "yum源中未找到texlive-footmisc-doc软件包" - exit 255 - fi - CHECK_RESULT $? 0 0 "检查texlive-footmisc-doc软件包是否在yum源中失败" - - LOG_INFO "步骤2:检查系统是否已安装texlive-footmisc-doc" - rpm -q texlive-footmisc-doc &> /dev/null - if [ $? -eq 0 ]; then - LOG_INFO "texlive-footmisc-doc已安装,测试后将保持安装状态" - INSTALLED=true - else - LOG_INFO "texlive-footmisc-doc未安装,将在测试后卸载" - INSTALLED=false - fi - - if [ "$INSTALLED" = "false" ]; then - LOG_INFO "步骤3:安装texlive-footmisc-doc软件包" - dnf install -y texlive-footmisc-doc - CHECK_RESULT $? 0 0 "安装texlive-footmisc-doc失败" - fi - - LOG_INFO "步骤4:访问texlive-footmisc-doc的man页面" - man -w texlive-footmisc-doc &> /dev/null - if [ $? -ne 0 ]; then - LOG_ERROR "texlive-footmisc-doc的man页面不存在或命令不支持" - exit 255 - fi - man texlive-footmisc-doc > /dev/null 2>&1 - CHECK_RESULT $? 0 0 "访问texlive-footmisc-doc的man页面失败" - - LOG_INFO "步骤5:清理测试环境" - if [ "$INSTALLED" = "false" ]; then - LOG_INFO "卸载texlive-footmisc-doc软件包" - dnf remove -y texlive-footmisc-doc - CHECK_RESULT $? 0 0 "卸载texlive-footmisc-doc失败" - else - LOG_INFO "测试前已安装texlive-footmisc-doc,保持安装状态" - fi - - LOG_INFO "测试完成:成功访问texlive-footmisc-doc的man页面" -} - -main "$@" \ No newline at end of file diff --git a/testcases/function_test/pkg_test/texlive-split-i/texlive-footmisc-doc/test_texlive-footmisc-doc_function_verify_files.sh b/testcases/function_test/pkg_test/texlive-split-i/texlive-footmisc-doc/test_texlive-footmisc-doc_function_verify_files.sh deleted file mode 100644 index d00c43e6cbf..00000000000 --- a/testcases/function_test/pkg_test/texlive-split-i/texlive-footmisc-doc/test_texlive-footmisc-doc_function_verify_files.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 : Verify the existence of key documentation files -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - # 环境检查:判断是否已安装texlive-footmisc-doc - LOG_INFO "步骤1:检查texlive-footmisc-doc是否已安装" - rpm -q texlive-footmisc-doc - if [ $? -eq 0 ]; then - LOG_INFO "texlive-footmisc-doc已安装,测试结束将保持安装状态" - already_installed=1 - else - LOG_INFO "texlive-footmisc-doc未安装,将在测试过程中安装" - already_installed=0 - fi - - # 检查yum源中是否存在texlive-footmisc-doc软件包 - LOG_INFO "步骤2:检查yum源中是否存在texlive-footmisc-doc软件包" - dnf list available texlive-footmisc-doc - CHECK_RESULT $? 0 0 "yum源中未找到texlive-footmisc-doc软件包" - if [ $? -ne 0 ]; then - LOG_ERROR "yum源中未找到texlive-footmisc-doc软件包,退出" - exit 255 - fi - - # 安装texlive-footmisc-doc软件包(如果未安装) - if [ $already_installed -eq 0 ]; then - LOG_INFO "步骤3:安装texlive-footmisc-doc软件包" - dnf install -y texlive-footmisc-doc - CHECK_RESULT $? 0 0 "安装texlive-footmisc-doc失败" - fi - - # 验证关键文档文件的存在性 - LOG_INFO "步骤4:验证关键文档文件的存在性" - rpm -ql texlive-footmisc-doc | grep -E "\.pdf$|\.html$|\.txt$|README" - CHECK_RESULT $? 0 0 "未找到关键文档文件" - - # 具体检查几个关键文档文件 - LOG_INFO "步骤5:检查特定文档文件是否存在" - rpm -ql texlive-footmisc-doc | grep -q "README" - CHECK_RESULT $? 0 0 "README文件不存在" - rpm -ql texlive-footmisc-doc | grep -q "footmisc.pdf" - CHECK_RESULT $? 0 0 "footmisc.pdf文件不存在" - - # 清理环境:如果测试前未安装,则卸载软件包 - if [ $already_installed -eq 0 ]; then - LOG_INFO "步骤6:清理环境,卸载texlive-footmisc-doc软件包" - dnf remove -y texlive-footmisc-doc - CHECK_RESULT $? 0 0 "卸载texlive-footmisc-doc失败" - else - LOG_INFO "步骤6:测试前已安装texlive-footmisc-doc,保持安装状态" - fi - - LOG_INFO "测试完成,环境已恢复" -} - -main "$@" \ No newline at end of file diff --git a/testcases/function_test/pkg_test/texlive-split-l/texlive-hyphen-basque/test_texlive-hyphen-basque_function_usage.sh b/testcases/function_test/pkg_test/texlive-split-l/texlive-hyphen-basque/test_texlive-hyphen-basque_function_usage.sh deleted file mode 100644 index fde2a2a2c13..00000000000 --- a/testcases/function_test/pkg_test/texlive-split-l/texlive-hyphen-basque/test_texlive-hyphen-basque_function_usage.sh +++ /dev/null @@ -1,144 +0,0 @@ -#!/usr/bin/bash - -# Copyright (c) 2024 ISCAS .ALL rights reserved. -# This program is licensed under Mulan PSL v2. -# You can use it according to the terms and conditions of the Mulan PSL v2. -# http://license.coscl.org.cn/MulanPSL2 -# THIS PROGRAM IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, -# EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, -# MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. -# See the Mulan PSL v2 for more details. - -# ############################################# -# @Author : honghua -# @Contact : honghua@iscas.ac.cn -# @Date : 2026-04-02 -# @License : Mulan PSL v2 -# @Desc : Test basic LaTeX hyphenation usage -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - # 测试LaTeX连字符基本用法 - LOG_INFO "开始测试LaTeX连字符基本用法" - - # 定义软件包名称 - PACKAGE_NAME="texlive-hyphen-basque" - - # 步骤1: 检查yum源中是否有该软件包 - LOG_INFO "步骤1: 检查yum源中是否有${PACKAGE_NAME}软件包" - dnf list available ${PACKAGE_NAME} &> /dev/null - if [ $? -ne 0 ]; then - LOG_ERROR "yum源中未找到${PACKAGE_NAME}软件包" - exit 255 - fi - - # 步骤2: 检查软件包是否已安装 - LOG_INFO "步骤2: 检查${PACKAGE_NAME}是否已安装" - rpm -q ${PACKAGE_NAME} &> /dev/null - PACKAGE_INSTALLED=$? - - # 步骤3: 如果未安装,则安装软件包 - if [ ${PACKAGE_INSTALLED} -ne 0 ]; then - LOG_INFO "步骤3: 安装${PACKAGE_NAME}软件包" - dnf install -y ${PACKAGE_NAME} - CHECK_RESULT $? 0 0 "安装${PACKAGE_NAME}失败" - # 标记为测试期间安装 - TEST_INSTALLED=1 - else - LOG_INFO "步骤3: ${PACKAGE_NAME}已安装,跳过安装步骤" - TEST_INSTALLED=0 - fi - - # 步骤4: 验证软件包安装成功 - LOG_INFO "步骤4: 验证${PACKAGE_NAME}安装成功" - rpm -q ${PACKAGE_NAME} - CHECK_RESULT $? 0 0 "${PACKAGE_NAME}安装验证失败" - - # 步骤5: 测试LaTeX连字符基本功能 - LOG_INFO "步骤5: 测试LaTeX连字符基本功能" - - # 创建测试LaTeX文件 - TEST_FILE="test_hyphenation.tex" - cat > ${TEST_FILE} << "EOF" - \documentclass{article} - \usepackage[basque]{babel} - \begin{document} - This is a test for Basque hyphenation patterns: Euskal Herriko Unibertsitatea. - \end{document} - EOF - - # 检查文件是否创建成功 - if [ ! -f "${TEST_FILE}" ]; then - LOG_ERROR "测试文件创建失败" - if [ ${TEST_INSTALLED} -eq 1 ]; then - dnf remove -y ${PACKAGE_NAME} - fi - exit 1 - fi - - # 步骤6: 测试hyphenate命令(如果可用) - LOG_INFO "步骤6: 测试连字符相关命令" - - # 检查是否有hyphenate命令或相关工具 - which latex &> /dev/null - if [ $? -eq 0 ]; then - # 尝试编译测试文件(不要求成功,只检查命令是否存在) - LOG_INFO "尝试编译测试LaTeX文件" - latex -interaction=nonstopmode ${TEST_FILE} &> /dev/null - # 不检查结果,因为可能缺少其他LaTeX包 - LOG_INFO "LaTeX编译尝试完成" - else - LOG_INFO "未找到latex命令,跳过编译测试" - fi - - # 步骤7: 检查连字符模式文件 - LOG_INFO "步骤7: 检查连字符模式文件" - # 查找与巴斯克语相关的连字符文件 - find /usr/share/texlive/ -name "*basque*" -o -name "*eus*" 2>/dev/null | head -5 - if [ $? -ne 0 ]; then - find /usr/share/texmf/ -name "*basque*" -o -name "*eus*" 2>/dev/null | head -5 - fi - - # 步骤8: 测试特定命令参数(示例) - LOG_INFO "步骤8: 测试命令参数" - # 这里使用一个假设的命令示例,实际应根据软件包提供的命令调整 - if command -v kpsewhich &> /dev/null; then - # 测试有效参数 - kpsewhich --help &> /dev/null - CHECK_RESULT $? 0 0 "kpsewhich命令执行失败" - - # 测试无效参数(应失败) - kpsewhich --invalid-parameter &> /dev/null 2>&1 - if [ $? -ne 255 ] && [ $? -ne 1 ]; then - LOG_ERROR "无效参数检查失败" - # 清理测试文件 - rm -f ${TEST_FILE} test_hyphenation.aux test_hyphenation.log test_hyphenation.dvi - if [ ${TEST_INSTALLED} -eq 1 ]; then - dnf remove -y ${PACKAGE_NAME} - fi - exit 255 - fi - else - LOG_INFO "未找到kpsewhich命令,跳过参数测试" - fi - - # 步骤9: 清理测试文件 - LOG_INFO "步骤9: 清理测试文件" - rm -f ${TEST_FILE} test_hyphenation.aux test_hyphenation.log test_hyphenation.dvi test_hyphenation.synctex.gz - - # 步骤10: 环境恢复 - LOG_INFO "步骤10: 恢复测试环境" - if [ ${TEST_INSTALLED} -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 "LaTeX连字符基本用法测试完成" -} - -main "$@" \ No newline at end of file diff --git a/testcases/function_test/pkg_test/texlive-split-o/texlive-mattens/test_texlive-mattens_function_install.sh b/testcases/function_test/pkg_test/texlive-split-o/texlive-mattens/test_texlive-mattens_function_install.sh deleted file mode 100644 index ebe82081898..00000000000 --- a/testcases/function_test/pkg_test/texlive-split-o/texlive-mattens/test_texlive-mattens_function_install.sh +++ /dev/null @@ -1,65 +0,0 @@ -#!/usr/bin/bash - -# Copyright (c) 2024 ISCAS .ALL rights reserved. -# This program is licensed under Mulan PSL v2. -# You can use it according to the terms and conditions of the Mulan PSL v2. -# http://license.coscl.org.cn/MulanPSL2 -# THIS PROGRAM IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, -# EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, -# MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. -# See the Mulan PSL v2 for more details. - -# ############################################# -# @Author : honghua -# @Contact : honghua@iscas.ac.cn -# @Date : 2025-11-26 -# @License : Mulan PSL v2 -# @Desc : Test package installation -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - # 测试脚本:test_texlive-mattens_function_install - - LOG_INFO "开始测试:Test package installation" - - # 检查软件包是否已安装 - if dnf list installed texlive-mattens &>/dev/null; then - LOG_INFO "软件包 texlive-mattens 已安装,跳过安装步骤" - INSTALLED=true - else - LOG_INFO "软件包 texlive-mattens 未安装,将进行安装测试" - INSTALLED=false - fi - - # 检查yum源中是否存在该软件包 - LOG_INFO "检查yum源中是否存在 texlive-mattens 软件包" - if ! dnf list available texlive-mattens &>/dev/null; then - LOG_ERROR "yum源中不存在 texlive-mattens 软件包" - exit 255 - fi - - # 如果未安装,则安装软件包 - if [ "$INSTALLED" = false ]; then - LOG_INFO "正在安装 texlive-mattens 软件包" - dnf install -y texlive-mattens - CHECK_RESULT $? 0 0 "安装 texlive-mattens 失败" - fi - - # 测试命令参数是否支持(假设命令为texlive-mattens --version) - LOG_INFO "测试命令参数是否支持" - texlive-mattens --version &>/dev/null - CHECK_RESULT $? 0 0 "命令参数不支持或命令执行失败" - - # 如果之前未安装,则在测试完成后卸载软件包 - if [ "$INSTALLED" = false ]; then - LOG_INFO "卸载 texlive-mattens 软件包" - dnf remove -y texlive-mattens - CHECK_RESULT $? 0 0 "卸载 texlive-mattens 失败" - 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-mattens/test_texlive-mattens_function_usage.sh b/testcases/function_test/pkg_test/texlive-split-o/texlive-mattens/test_texlive-mattens_function_usage.sh deleted file mode 100644 index b7a811a6788..00000000000 --- a/testcases/function_test/pkg_test/texlive-split-o/texlive-mattens/test_texlive-mattens_function_usage.sh +++ /dev/null @@ -1,116 +0,0 @@ -#!/usr/bin/bash - -# Copyright (c) 2024 ISCAS .ALL rights reserved. -# This program is licensed under Mulan PSL v2. -# You can use it according to the terms and conditions of the Mulan PSL v2. -# http://license.coscl.org.cn/MulanPSL2 -# THIS PROGRAM IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, -# EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, -# 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-23 -# @License : Mulan PSL v2 -# @Desc : Test LaTeX document compile -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - # 测试LaTeX文档编译功能 - - LOG_INFO "开始测试LaTeX文档编译功能" - - # 检查是否已经安装texlive-mattens - LOG_INFO "检查texlive-mattens是否已安装" - if dnf list installed texlive-mattens &>/dev/null; then - LOG_INFO "texlive-mattens已安装,测试后将保持安装状态" - INSTALLED_BEFORE_TEST=true - else - LOG_INFO "texlive-mattens未安装,将在测试中安装" - INSTALLED_BEFORE_TEST=false - fi - - # 检查yum源中是否有texlive-mattens软件包 - LOG_INFO "检查yum源中是否有texlive-mattens软件包" - if ! dnf list available texlive-mattens &>/dev/null; then - LOG_ERROR "yum源中未找到texlive-mattens软件包" - exit 255 - fi - - # 如果未安装,则安装texlive-mattens - if [ "$INSTALLED_BEFORE_TEST" = false ]; then - LOG_INFO "安装texlive-mattens软件包" - dnf install -y texlive-mattens - CHECK_RESULT $? 0 0 "安装texlive-mattens失败" - fi - - # 检查pdflatex命令是否可用 - LOG_INFO "检查pdflatex命令是否可用" - if ! command -v pdflatex &>/dev/null; then - LOG_ERROR "pdflatex命令不存在" - if [ "$INSTALLED_BEFORE_TEST" = false ]; then - LOG_INFO "清理安装的软件包" - dnf remove -y texlive-mattens - fi - exit 255 - fi - - # 创建测试LaTeX文档 - LOG_INFO "创建测试LaTeX文档" - TEST_DIR="/tmp/test_latex_$(date +%s)" - mkdir -p "$TEST_DIR" - cat > "$TEST_DIR/test.tex" << "EOF" - \documentclass{article} - \begin{document} - Hello, LaTeX World! - \end{document} - EOF - CHECK_RESULT $? 0 0 "创建测试LaTeX文档失败" - - # 编译LaTeX文档 - LOG_INFO "编译LaTeX文档" - cd "$TEST_DIR" - pdflatex -interaction=nonstopmode test.tex - CHECK_RESULT $? 0 0 "编译LaTeX文档失败" - - # 检查生成的PDF文件 - LOG_INFO "检查生成的PDF文件" - if [ -f "test.pdf" ]; then - LOG_INFO "PDF文件生成成功" - # 检查PDF文件大小 - PDF_SIZE=$(stat -c%s test.pdf) - if [ "$PDF_SIZE" -gt 0 ]; then - LOG_INFO "PDF文件大小正常: ${PDF_SIZE}字节" - else - LOG_ERROR "PDF文件大小为0" - CHECK_RESULT 1 0 0 "PDF文件大小异常" - fi - else - LOG_ERROR "PDF文件未生成" - CHECK_RESULT 1 0 0 "PDF文件未生成" - fi - - # 清理测试文件 - LOG_INFO "清理测试文件" - cd / - rm -rf "$TEST_DIR" - CHECK_RESULT $? 0 0 "清理测试文件失败" - - # 如果测试前未安装,则卸载软件包 - if [ "$INSTALLED_BEFORE_TEST" = false ]; then - LOG_INFO "卸载texlive-mattens软件包" - dnf remove -y texlive-mattens - CHECK_RESULT $? 0 0 "卸载texlive-mattens失败" - LOG_INFO "环境已恢复到测试前状态" - else - LOG_INFO "保持texlive-mattens安装状态" - fi - - LOG_INFO "LaTeX文档编译测试完成" -} - -main "$@" \ No newline at end of file diff --git a/testcases/function_test/pkg_test/texlive-split-p/texlive-nkarta/test_texlive-nkarta_function_basic.sh b/testcases/function_test/pkg_test/texlive-split-p/texlive-nkarta/test_texlive-nkarta_function_basic.sh deleted file mode 100644 index de692fcea8b..00000000000 --- a/testcases/function_test/pkg_test/texlive-split-p/texlive-nkarta/test_texlive-nkarta_function_basic.sh +++ /dev/null @@ -1,66 +0,0 @@ -#!/usr/bin/bash - -# Copyright (c) 2024 ISCAS .ALL rights reserved. -# This program is licensed under Mulan PSL v2. -# You can use it according to the terms and conditions of the Mulan PSL v2. -# http://license.coscl.org.cn/MulanPSL2 -# THIS PROGRAM IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, -# EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, -# MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. -# See the Mulan PSL v2 for more details. - -# ############################################# -# @Author : honghua -# @Contact : honghua@iscas.ac.cn -# @Date : 2025-09-27 -# @License : Mulan PSL v2 -# @Desc : Test basic functionality -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - - LOG_INFO "开始测试:Test basic functionality" - - # 检查是否已安装texlive-nkarta - LOG_INFO "检查texlive-nkarta是否已安装" - dnf list installed texlive-nkarta &> /dev/null - if [ $? -eq 0 ]; then - LOG_INFO "texlive-nkarta已安装,测试结束后保持安装状态" - installed=true - else - LOG_INFO "texlive-nkarta未安装,将在测试结束后卸载" - installed=false - fi - - # 检查yum源中是否有texlive-nkarta包 - LOG_INFO "检查yum源中是否有texlive-nkarta包" - dnf list available texlive-nkarta &> /dev/null - CHECK_RESULT $? 0 255 "yum源中未找到texlive-nkarta包" - - # 安装texlive-nkarta包 - if [ "$installed" = false ]; then - LOG_INFO "开始安装texlive-nkarta" - dnf install -y texlive-nkarta &> /dev/null - CHECK_RESULT $? 0 0 "安装texlive-nkarta失败" - fi - - # 测试基本功能 - LOG_INFO "测试texlive-nkarta基本功能" - # 假设有一个基本命令test-command用于测试 - test-command --version &> /dev/null - CHECK_RESULT $? 0 255 "不支持--version参数或命令不存在" - - # 清理环境(如果之前未安装) - if [ "$installed" = false ]; then - LOG_INFO "卸载texlive-nkarta以恢复环境" - dnf remove -y texlive-nkarta &> /dev/null - CHECK_RESULT $? 0 0 "卸载texlive-nkarta失败" - fi - - LOG_INFO "测试完成:Test basic functionality" - -} - -main "$@" \ No newline at end of file diff --git a/testcases/function_test/pkg_test/texlive-split-u/texlive-sectionbreak/test_texlive-sectionbreak_function_sectionbreak.sh b/testcases/function_test/pkg_test/texlive-split-u/texlive-sectionbreak/test_texlive-sectionbreak_function_sectionbreak.sh deleted file mode 100644 index 4c2f7192c5b..00000000000 --- a/testcases/function_test/pkg_test/texlive-split-u/texlive-sectionbreak/test_texlive-sectionbreak_function_sectionbreak.sh +++ /dev/null @@ -1,66 +0,0 @@ -#!/usr/bin/bash - -# Copyright (c) 2024 ISCAS .ALL rights reserved. -# This program is licensed under Mulan PSL v2. -# You can use it according to the terms and conditions of the Mulan PSL v2. -# http://license.coscl.org.cn/MulanPSL2 -# THIS PROGRAM IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, -# EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, -# MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. -# See the Mulan PSL v2 for more details. - -# ############################################# -# @Author : honghua -# @Contact : honghua@iscas.ac.cn -# @Date : 2025-11-26 -# @License : Mulan PSL v2 -# @Desc : Test the section break functionality in texlive-sectionbreak -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - - # 检查texlive-sectionbreak是否已安装 - LOG_INFO "检查texlive-sectionbreak是否已安装" - rpm -q texlive-sectionbreak > /dev/null 2>&1 - if [ $? -eq 0 ]; then - LOG_INFO "texlive-sectionbreak已安装,脚本结束时将保持安装状态" - INSTALLED=true - else - LOG_INFO "texlive-sectionbreak未安装,将在测试结束后卸载" - INSTALLED=false - fi - - # 检查yum源中是否有texlive-sectionbreak软件包 - LOG_INFO "检查yum源中是否有texlive-sectionbreak软件包" - dnf list available texlive-sectionbreak > /dev/null 2>&1 - if [ $? -ne 0 ]; then - LOG_ERROR "yum源中未找到texlive-sectionbreak软件包" - exit 255 - fi - - # 安装texlive-sectionbreak - if [ "$INSTALLED" = false ]; then - LOG_INFO "安装texlive-sectionbreak" - dnf install -y texlive-sectionbreak - CHECK_RESULT $? 0 0 "安装texlive-sectionbreak失败" - fi - - # 测试section break功能 - LOG_INFO "测试section break功能" - texlive-sectionbreak --test-section-break - CHECK_RESULT $? 0 0 "section break功能测试失败" - - # 清理环境 - if [ "$INSTALLED" = false ]; then - LOG_INFO "卸载texlive-sectionbreak" - dnf remove -y texlive-sectionbreak - CHECK_RESULT $? 0 0 "卸载texlive-sectionbreak失败" - fi - - LOG_INFO "测试完成,环境已恢复" - -} - -main "$@" \ No newline at end of file diff --git a/testcases/function_test/pkg_test/texlive-split-y/texlive-dpcircling/test_texlive-dpcircling_function_basic.sh b/testcases/function_test/pkg_test/texlive-split-y/texlive-dpcircling/test_texlive-dpcircling_function_basic.sh deleted file mode 100644 index d0cb13ae45c..00000000000 --- a/testcases/function_test/pkg_test/texlive-split-y/texlive-dpcircling/test_texlive-dpcircling_function_basic.sh +++ /dev/null @@ -1,72 +0,0 @@ -#!/usr/bin/bash - -# Copyright (c) 2024 ISCAS .ALL rights reserved. -# This program is licensed under Mulan PSL v2. -# You can use it according to the terms and conditions of the Mulan PSL v2. -# http://license.coscl.org.cn/MulanPSL2 -# THIS PROGRAM IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, -# EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, -# MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. -# See the Mulan PSL v2 for more details. - -# ############################################# -# @Author : honghua -# @Contact : honghua@iscas.ac.cn -# @Date : 2025-11-26 -# @License : Mulan PSL v2 -# @Desc : Basic functionality test -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - # 检查是否已安装texlive-dpcircling - LOG_INFO "检查是否已安装texlive-dpcircling" - dnf list installed texlive-dpcircling > /dev/null 2>&1 - if [ $? -eq 0 ]; then - LOG_INFO "texlive-dpcircling已安装,脚本结束时保持安装状态" - installed=true - else - LOG_INFO "texlive-dpcircling未安装,将在测试后卸载" - installed=false - fi - - # 检查yum源中是否有texlive-dpcircling - LOG_INFO "检查yum源中是否有texlive-dpcircling" - dnf list available texlive-dpcircling > /dev/null 2>&1 - if [ $? -ne 0 ]; then - LOG_ERROR "yum源中未找到texlive-dpcircle,退出" - exit 255 - fi - - # 安装texlive-dpcircling(如果未安装) - if [ "$installed" = false ]; then - LOG_INFO "安装texlive-dpcircling" - dnf install -y texlive-dpcircling - CHECK_RESULT $? 0 0 "安装texlive-dpcircling失败" - fi - - # 测试基本功能 - LOG_INFO "测试基本功能" - texlive-dpcircling --version > /dev/null 2>&1 - CHECK_RESULT $? 0 0 "texlive-dpcircling版本检查失败" - - # 测试不支持参数的情况 - LOG_INFO "测试不支持参数的情况" - texlive-dpcircling --invalid-arg > /dev/null 2>&1 - if [ $? -ne 255 ]; then - LOG_ERROR "不支持参数测试失败" - exit 255 - fi - - # 清理环境(如果之前未安装) - if [ "$installed" = false ]; then - LOG_INFO "卸载texlive-dpcircle" - dnf remove -y texlive-dpcircle - CHECK_RESULT $? 0 0 “卸载texlive-dpcircle失败” - fi - - LOG_INFO “Basic functionality test完成” -} - -main "$@" \ No newline at end of file diff --git a/testcases/function_test/pkg_test/texlive-split-y/texlive-dpcircling/test_texlive-dpcircling_function_basic_cmd.sh b/testcases/function_test/pkg_test/texlive-split-y/texlive-dpcircling/test_texlive-dpcircling_function_basic_cmd.sh deleted file mode 100644 index 12bac003cc1..00000000000 --- a/testcases/function_test/pkg_test/texlive-split-y/texlive-dpcircling/test_texlive-dpcircling_function_basic_cmd.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-19 -# @License : Mulan PSL v2 -# @Desc : Test basic circling command usage -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - LOG_INFO "开始测试:Test basic circling command usage" - - # 检查是否已安装texlive-dpcircling包 - LOG_INFO "步骤1:检查texlive-dpcircling包是否已安装" - if rpm -q texlive-dpcircling &>/dev/null; then - LOG_INFO "texlive-dpcircling已安装,测试结束后将保持安装状态" - INSTALLED=true - else - LOG_INFO "texlive-dpcircling未安装,将在测试过程中安装并在结束后卸载" - INSTALLED=false - fi - - # 检查yum源中是否有texlive-dpcircling包 - LOG_INFO "步骤2:检查yum源中是否存在texlive-dpcircling包" - if ! dnf list available texlive-dpcircling &>/dev/null; then - LOG_ERROR "yum源中未找到texlive-dpcircling包" - exit 255 - fi - - # 如果未安装,则安装texlive-dpcircling包 - if [ "$INSTALLED" = false ]; then - LOG_INFO "步骤3:安装texlive-dpcircling包" - dnf install -y texlive-dpcircling - CHECK_RESULT $? 0 0 "安装texlive-dpcircling包失败" - fi - - # 检查命令是否存在 - LOG_INFO "步骤4:检查circling命令是否存在" - if ! command -v circling &>/dev/null; then - LOG_ERROR "circling命令不存在" - exit 255 - fi - - # 测试circling命令的基本用法 - LOG_INFO "步骤5:测试circling命令的基本用法" - circling --help - CHECK_RESULT $? 0 0 "circling命令--help参数执行失败" - - # 测试circling命令的无效参数 - LOG_INFO "步骤6:测试circling命令的无效参数" - circling --invalid-option 2>/dev/null - if [ $? -ne 255 ]; then - LOG_ERROR "circling命令不支持--invalid-option参数,但未返回255退出码" - exit 255 - fi - - # 如果测试开始时未安装,则在测试结束后卸载texlive-dpcircling包 - if [ "$INSTALLED" = false ]; then - LOG_INFO "步骤7:卸载texlive-dpcircling包" - dnf remove -y texlive-dpcircling - CHECK_RESULT $? 0 0 "卸载texlive-dpcircling包失败" - fi - - LOG_INFO "测试完成:Test basic circling command usage" -} - -main "$@" \ No newline at end of file diff --git a/testcases/function_test/pkg_test/texlive-split-y/texlive-dpcircling/test_texlive-dpcircling_function_install.sh b/testcases/function_test/pkg_test/texlive-split-y/texlive-dpcircling/test_texlive-dpcircling_function_install.sh deleted file mode 100644 index 1b89c623ad0..00000000000 --- a/testcases/function_test/pkg_test/texlive-split-y/texlive-dpcircling/test_texlive-dpcircling_function_install.sh +++ /dev/null @@ -1,85 +0,0 @@ -#!/usr/bin/bash - -# Copyright (c) 2024 ISCAS .ALL rights reserved. -# This program is licensed under Mulan PSL v2. -# You can use it according to the terms and conditions of the Mulan PSL v2. -# http://license.coscl.org.cn/MulanPSL2 -# THIS PROGRAM IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, -# EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, -# MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. -# See the Mulan PSL v2 for more details. - -# ############################################# -# @Author : honghua -# @Contact : honghua@iscas.ac.cn -# @Date : 2026-03-19 -# @License : Mulan PSL v2 -# @Desc : Test installation of the texlive-dpcircling package -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - LOG_INFO "开始测试:Test installation of the texlive-dpcircling package" - - LOG_INFO "步骤1:检查texlive-dpcircling软件包是否在yum源中" - dnf list available texlive-dpcircling > /dev/null 2>&1 - CHECK_RESULT $? 0 0 "yum源中未找到texlive-dpcircling软件包,退出测试" - if [ $? -eq 255 ]; then - LOG_ERROR "yum源中未找到texlive-dpcircling软件包" - exit 255 - fi - - LOG_INFO "步骤2:检查当前环境是否已安装texlive-dpcircling" - if rpm -q texlive-dpcircling > /dev/null 2>&1; then - LOG_INFO "texlive-dpcircling已安装,测试后保持安装状态" - INSTALLED=true - else - LOG_INFO "texlive-dpcircling未安装,将在测试中安装" - INSTALLED=false - fi - - LOG_INFO "步骤3:安装texlive-dpcircling软件包" - if [ "$INSTALLED" = false ]; then - dnf install -y texlive-dpcircling - CHECK_RESULT $? 0 0 "安装texlive-dpcircling失败" - if [ $? -ne 0 ]; then - LOG_ERROR "安装texlive-dpcircling失败" - exit $? - fi - fi - - LOG_INFO "步骤4:验证texlive-dpcircling安装成功" - rpm -q texlive-dpcircling > /dev/null 2>&1 - CHECK_RESULT $? 0 0 "texlive-dpcircling安装验证失败" - - LOG_INFO "步骤5:测试texlive-dpcircling功能(示例:检查相关命令)" - # 此处假设texlive-dpcircling安装后会提供某个命令,例如"dpcircling",请根据实际软件包调整 - if command -v dpcircling > /dev/null 2>&1; then - LOG_INFO "找到dpcircling命令,执行测试" - dpcircling --help > /dev/null 2>&1 - CHECK_RESULT $? 0 0 "dpcircling命令执行失败" - else - LOG_INFO "未找到dpcircling命令,跳过命令测试" - fi - - LOG_INFO "步骤6:清理环境" - if [ "$INSTALLED" = false ]; then - LOG_INFO "卸载texlive-dpcircling软件包" - dnf remove -y texlive-dpcircling - CHECK_RESULT $? 0 0 "卸载texlive-dpcircling失败" - rpm -q texlive-dpcircling > /dev/null 2>&1 - if [ $? -eq 0 ]; then - LOG_ERROR "texlive-dpcircling卸载失败" - exit 1 - else - LOG_INFO "texlive-dpcircling卸载成功" - fi - else - LOG_INFO "测试前已安装texlive-dpcircling,保持安装状态" - fi - - LOG_INFO "测试完成:Test installation of the texlive-dpcircling package" -} - -main "$@" \ No newline at end of file diff --git a/testcases/function_test/pkg_test/texlive-split-y/texlive-dpcircling/test_texlive-dpcircling_function_remove.sh b/testcases/function_test/pkg_test/texlive-split-y/texlive-dpcircling/test_texlive-dpcircling_function_remove.sh deleted file mode 100644 index d68ce4ba1f7..00000000000 --- a/testcases/function_test/pkg_test/texlive-split-y/texlive-dpcircling/test_texlive-dpcircling_function_remove.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-19 -# @License : Mulan PSL v2 -# @Desc : Test removal of the texlive-dpcircling package -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - LOG_INFO "测试开始:Test removal of the texlive-dpcircling package" - - # 检查是否已经安装了 texlive-dpcircling 包 - LOG_INFO "步骤1:检查当前环境是否已安装 texlive-dpcircling 包" - if dnf list installed texlive-dpcircling &> /dev/null; then - LOG_INFO "texlive-dpcircling 包已安装,标记为已存在安装" - INSTALLED_BEFORE="true" - else - LOG_INFO "texlive-dpcircling 包未安装,标记为未安装" - INSTALLED_BEFORE="false" - fi - - # 检查 yum 源中是否存在 texlive-dpcircling 包 - LOG_INFO "步骤2:检查 yum 源中是否存在 texlive-dpcircling 包" - if ! dnf list available texlive-dpcircling &> /dev/null; then - LOG_ERROR "yum 源中不存在 texlive-dpcircling 包,退出测试" - exit 255 - fi - - # 如果之前未安装,则安装 texlive-dpcircling 包 - if [ "$INSTALLED_BEFORE" = "false" ]; then - LOG_INFO "步骤3:安装 texlive-dpcircling 包" - dnf install -y texlive-dpcircling - CHECK_RESULT $? 0 0 "安装 texlive-dpcircling 包失败" - fi - - # 测试移除 texlive-dpcircling 包 - LOG_INFO "步骤4:测试移除 texlive-dpcircling 包" - dnf remove -y texlive-dpcircling - CHECK_RESULT $? 0 0 "移除 texlive-dpcircling 包失败" - - # 验证 texlive-dpcircling 包是否已成功移除 - LOG_INFO "步骤5:验证 texlive-dpcircling 包是否已成功移除" - if dnf list installed texlive-dpcircling &> /dev/null; then - LOG_ERROR "texlive-dpcircling 包移除失败,仍存在于系统中" - CHECK_RESULT 1 0 0 "texlive-dpcircling 包移除失败" - else - LOG_INFO "texlive-dpcircling 包已成功移除" - fi - - # 环境恢复:如果之前未安装,则重新安装 texlive-dpcircling 包;如果之前已安装,则重新安装以保持原状态 - LOG_INFO "步骤6:环境恢复" - if [ "$INSTALLED_BEFORE" = "false" ]; then - LOG_INFO "环境恢复:由于之前未安装,无需重新安装 texlive-dpcircling 包" - else - LOG_INFO "环境恢复:重新安装 texlive-dpcircling 包以保持原安装状态" - dnf install -y texlive-dpcircling - CHECK_RESULT $? 0 0 "重新安装 texlive-dpcircling 包失败" - fi - - LOG_INFO "测试结束:Test removal of the texlive-dpcircling package" -} - -main "$@" \ No newline at end of file diff --git a/testcases/function_test/pkg_test/texlive-split-y/texlive-wordlike-doc/test_texlive-wordlike-doc_function_install.sh b/testcases/function_test/pkg_test/texlive-split-y/texlive-wordlike-doc/test_texlive-wordlike-doc_function_install.sh deleted file mode 100644 index 9884bc17209..00000000000 --- a/testcases/function_test/pkg_test/texlive-split-y/texlive-wordlike-doc/test_texlive-wordlike-doc_function_install.sh +++ /dev/null @@ -1,66 +0,0 @@ -#!/usr/bin/bash - -# Copyright (c) 2024 ISCAS .ALL rights reserved. -# This program is licensed under Mulan PSL v2. -# You can use it according to the terms and conditions of the Mulan PSL v2. -# http://license.coscl.org.cn/MulanPSL2 -# THIS PROGRAM IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, -# EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, -# MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. -# See the Mulan PSL v2 for more details. - -# ############################################# -# @Author : honghua -# @Contact : honghua@iscas.ac.cn -# @Date : 2025-11-26 -# @License : Mulan PSL v2 -# @Desc : Test installation of texlive-wordlike-doc -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - - # 检查是否已经安装了texlive-wordlike-doc - if dnf list installed texlive-wordlike-doc &>/dev/null; then - LOG_INFO "texlive-wordlike-doc已经安装,脚本结束时将保持安装状态" - installed=true - else - LOG_INFO "texlive-wordlike-doc未安装,将在测试后卸载" - installed=false - fi - - # 检查yum源中是否有texlive-wordlike-doc软件包 - LOG_INFO "检查yum源中是否存在texlive-wordlike-doc软件包" - if ! dnf list available texlive-wordlike-doc &>/dev/null; then - LOG_ERROR "yum源中不存在texlive-wordlike-doc软件包" - exit 255 - fi - - # 安装texlive-wordlike-doc软件包 - LOG_INFO "开始安装texlive-wordlike-doc软件包" - dnf install -y texlive-wordlike-doc - CHECK_RESULT $? 0 0 "安装texlive-wordlike-doc失败" - - # 验证安装是否成功 - LOG_INFO "验证texlive-wordlike-doc是否安装成功" - dnf list installed texlive-wordlike-doc &>/dev/null - CHECK_RESULT $? 0 0 "验证texlive-wordlike-doc安装失败" - - # 执行测试命令(假设测试命令为某个特定功能) - LOG_INFO "执行测试命令" - test_command_output=$(some_test_command_related_to_texlive_wordlike_doc) - CHECK_RESULT $? 0 0 "测试命令执行失败" - - # 如果之前未安装,则在脚本结束前卸载软件包 - if [ "$installed" = false ]; then - LOG_INFO "卸载texlive-wordlike-doc软件包" - dnf remove -y texlive-wordlike-doc - CHECK_RESULT $? 0 0 "卸载texlive-wordlike-doc失败" - fi - - LOG_INFO "测试脚本执行完毕,环境已恢复" - -} - -main "$@" \ No newline at end of file diff --git a/testcases/function_test/pkg_test/texlive-split-z/texlive-zxjatype/test_texlive-zxjatype_function_install.sh b/testcases/function_test/pkg_test/texlive-split-z/texlive-zxjatype/test_texlive-zxjatype_function_install.sh deleted file mode 100644 index f0eb3e53e90..00000000000 --- a/testcases/function_test/pkg_test/texlive-split-z/texlive-zxjatype/test_texlive-zxjatype_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-05 -# @License : Mulan PSL v2 -# @Desc : Test package installation -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - # 检查是否已经安装texlive-zxjatype包 - LOG_INFO "检查是否已经安装texlive-zxjatype包" - rpm -q texlive-zxjatype > /dev/null 2>&1 - if [ $? -eq 0 ]; then - LOG_INFO "texlive-zxjatype已经安装,脚本结束后保持安装状态" - INSTALLED=1 - else - LOG_INFO "texlive-zxjatype未安装,脚本结束后将卸载" - INSTALLED=0 - fi - - # 检查yum源中是否有texlive-zxjatype包 - LOG_INFO "检查yum源中是否有texlive-zxjatype包" - dnf list available texlive-zxjatype > /dev/null 2>&1 - CHECK_RESULT $? 0 255 "yum源中没有texlive-zxjatype包" - - # 安装texlive-zxjatype包 - LOG_INFO "安装texlive-zxjatype包" - dnf install -y texlive-zxjatype > /dev/null 2>&1 - CHECK_RESULT $? 0 0 "安装texlive-zxjatype包失败" - - # 验证安装是否成功 - LOG_INFO "验证texlive-zxjatype包是否安装成功" - rpm -q texlive-zxjatype > /dev/null 2>&1 - CHECK_RESULT $? 0 0 "验证texlive-zxjatype包安装失败" - - # 执行测试命令(示例命令) - LOG_INFO "执行测试命令" - tex --version > /dev/null 2>&1 - CHECK_RESULT $? 0 255 "tex命令不存在或不支持" - - # 清理环境:如果脚本开始时未安装,则卸载 - if [ $INSTALLED -eq 0 ]; then - LOG_INFO "卸载texlive-zxjatype包" - dnf remove -y texlive-zxjatype > /dev/null 2>&1 - CHECK_RESULT $? 0 0 "卸载texlive-zxjatype包失败" - fi - - LOG_INFO "测试完成,环境已恢复" -} - -main "$@" \ No newline at end of file