diff --git a/suite2cases/function_test/pkg_test/acpica-tools/acpica-tools.json b/suite2cases/function_test/pkg_test/acpica-tools/acpica-tools.json index 0e23c2f0083..bb3b20e205d 100644 --- a/suite2cases/function_test/pkg_test/acpica-tools/acpica-tools.json +++ b/suite2cases/function_test/pkg_test/acpica-tools/acpica-tools.json @@ -74,10 +74,6 @@ "name": "test_acpica-tools_acpidump_o", "desc": "使用-o参数将输出重定向到指定文件" }, - { - "name": "test_acpica-tools_acpidump_r", - "desc": "使用-r参数从指定的RSDP地址转储表" - }, { "name": "test_acpica-tools_acpidump_vd", "desc": "使用-vd参数显示构建日期和时间" @@ -90,10 +86,6 @@ "name": "test_acpica-tools_acpidump_c", "desc": "使用-c参数开启或关闭自定义表转储" }, - { - "name": "test_acpica-tools_acpidump_f", - "desc": "使用-f参数通过二进制文件获取表" - }, { "name": "test_acpica-tools_acpidump_n", "desc": "使用-n参数通过名称/签名获取表" diff --git a/suite2cases/function_test/pkg_test/flac/flac-devel.json b/suite2cases/function_test/pkg_test/flac/flac-devel.json index 06e89a7a0c6..04a1785a8d1 100644 --- a/suite2cases/function_test/pkg_test/flac/flac-devel.json +++ b/suite2cases/function_test/pkg_test/flac/flac-devel.json @@ -5,26 +5,6 @@ { "name": "test_flac-devel_function_install", "desc": "测试flac-devel软件包能否正确安装" - }, - { - "name": "test_flac-devel_function_check", - "desc": "测试检查flac-devel软件包是否已安装" - }, - { - "name": "test_flac-devel_function_compile", - "desc": "测试使用flac开发库编译示例程序" - }, - { - "name": "test_flac-devel_function_header", - "desc": "测试flac开发头文件的存在与完整性" - }, - { - "name": "test_flac-devel_function_library", - "desc": "测试flac开发库文件的存在与链接" - }, - { - "name": "test_flac-devel_function_uninstall", - "desc": "测试flac-devel软件包能否正确卸载" } ] } \ No newline at end of file diff --git a/suite2cases/function_test/pkg_test/fxload/fxload-help.json b/suite2cases/function_test/pkg_test/fxload/fxload-help.json index 76ed0ca6b0a..58164073e5b 100644 --- a/suite2cases/function_test/pkg_test/fxload/fxload-help.json +++ b/suite2cases/function_test/pkg_test/fxload/fxload-help.json @@ -5,18 +5,6 @@ { "name": "test_fxload-help_function_install", "desc": "Test the installation of fxload-help package" - }, - { - "name": "test_fxload-help_function_remove", - "desc": "Test the removal of fxload-help package" - }, - { - "name": "test_fxload-help_function_version", - "desc": "Test displaying the package version" - }, - { - "name": "test_fxload-help_function_help", - "desc": "Test displaying the help information" } ] } \ No newline at end of file diff --git a/suite2cases/function_test/pkg_test/g2clib/g2clib-devel.json b/suite2cases/function_test/pkg_test/g2clib/g2clib-devel.json index 1f8cb666516..986b74a5427 100644 --- a/suite2cases/function_test/pkg_test/g2clib/g2clib-devel.json +++ b/suite2cases/function_test/pkg_test/g2clib/g2clib-devel.json @@ -5,10 +5,6 @@ { "name": "test_g2clib-devel_function_install", "desc": "Test package installation" - }, - { - "name": "test_g2clib-devel_function_build", - "desc": "Test package build functionality" } ] } \ No newline at end of file diff --git a/suite2cases/function_test/pkg_test/gnupg2/gnupg2.json b/suite2cases/function_test/pkg_test/gnupg2/gnupg2.json index 92dbb8167c3..9559292a375 100644 --- a/suite2cases/function_test/pkg_test/gnupg2/gnupg2.json +++ b/suite2cases/function_test/pkg_test/gnupg2/gnupg2.json @@ -154,10 +154,6 @@ "name": "test_gnupg2_gpg_n", "desc": "执行空运行,不进行实际更改" }, - { - "name": "test_gnupg2_gpg-agent__min_passphrase_nonalpha", - "desc": "测试设置新密码短语中至少需要非字母字符的数量" - }, { "name": "test_gnupg2_gpg-card__status_fd", "desc": "测试使用 status-fd 参数,指定文件描述符来写入状态信息" @@ -230,10 +226,6 @@ "name": "test_gnupg2_gpg-agent__c", "desc": "测试以csh风格输出命令的gpg-agent" }, - { - "name": "test_gnupg2_gpg-agent__disable-scdaemon", - "desc": "测试启动时不使用SCdaemon的gpg-agent" - }, { "name": "test_gnupg2_gpg-agent__keep-display", "desc": "测试忽略更改X显示请求的gpg-agent" diff --git a/suite2cases/function_test/pkg_test/hdparm/hdparm-help.json b/suite2cases/function_test/pkg_test/hdparm/hdparm-help.json index c3293683b02..77d40847ed1 100644 --- a/suite2cases/function_test/pkg_test/hdparm/hdparm-help.json +++ b/suite2cases/function_test/pkg_test/hdparm/hdparm-help.json @@ -25,22 +25,6 @@ { "name": "test_hdparm-help_function_man_access", "desc": "测试安装hdparm-help后,能否通过`man hdparm`命令成功访问到其提供的帮助手册页。" - }, - { - "name": "test_hdparm-help_function_version_check", - "desc": "测试通过包管理器查询hdparm-help软件包的版本信息,验证其版本号与预期一致。" - }, - { - "name": "test_hdparm-help_function_file_integrity", - "desc": "测试hdparm-help软件包安装后,其核心手册页文件的完整性(如校验MD5或SHA256值)。" - }, - { - "name": "test_hdparm-help_function_conflict_check", - "desc": "测试在已安装hdparm或相关软件包的系统上,安装hdparm-help是否会产生文件冲突或依赖问题。" - }, - { - "name": "test_hdparm-help_function_offline_install", - "desc": "测试在无网络环境下,通过本地软件包仓库或离线包能否成功安装hdparm-help软件包。" } ] } \ No newline at end of file diff --git a/suite2cases/function_test/pkg_test/kunpengsecl/kunpengsecl-tas.json b/suite2cases/function_test/pkg_test/kunpengsecl/kunpengsecl-tas.json index d672c3ac9d7..aa72d7bc323 100644 --- a/suite2cases/function_test/pkg_test/kunpengsecl/kunpengsecl-tas.json +++ b/suite2cases/function_test/pkg_test/kunpengsecl/kunpengsecl-tas.json @@ -6,18 +6,6 @@ "name": "test_kunpengsecl-tas_install", "desc": "测试软件包 kunpengsecl-tas 的安装功能,验证安装过程是否成功完成。", "machine num": 1 - }, - { - "name": "test_kunpengsecl-tas_Huawei", - "desc": "测试 Huawei 命令的基本功能" - }, - { - "name": "test_kunpengsecl-tas_tas__upper_t", - "desc": "测试 tas 命令的 -T 参数,用于生成 rest api 的测试 token" - }, - { - "name": "test_kunpengsecl-tas_function_config", - "desc": "测试软件包 kunpengsecl-tas 的配置文件加载功能,验证配置是否正确解析和应用。" } ] } \ No newline at end of file diff --git a/suite2cases/function_test/pkg_test/lodash/nodejs-lodash-toplainobject.json b/suite2cases/function_test/pkg_test/lodash/nodejs-lodash-toplainobject.json deleted file mode 100644 index efb1cb46dd4..00000000000 --- a/suite2cases/function_test/pkg_test/lodash/nodejs-lodash-toplainobject.json +++ /dev/null @@ -1,26 +0,0 @@ -{ - "path": "$OET_PATH/testcases/function_test/pkg_test/lodash/nodejs-lodash-toplainobject", - "machine num": 1, - "cases": [ - { - "name": "test_nodejs-lodash-toplainobject_function_install", - "desc": "测试软件包nodejs-lodash-toplainobject能否通过包管理器(如npm)正常安装" - }, - { - "name": "test_nodejs-lodash-toplainobject_function_require", - "desc": "测试在Node.js环境中能够成功require引入lodash.toplainobject模块" - }, - { - "name": "test_nodejs-lodash-toplainobject_function_basic", - "desc": "测试toPlainObject函数将对象转换为普通对象的基本功能" - }, - { - "name": "test_nodejs-lodash-toplainobject_function_inherit", - "desc": "测试toPlainObject函数对继承属性的转换处理" - }, - { - "name": "test_nodejs-lodash-toplainobject_function_uninstall", - "desc": "测试软件包nodejs-lodash-toplainobject能否通过包管理器(如npm)正常卸载" - } - ] -} \ No newline at end of file diff --git a/suite2cases/function_test/pkg_test/mesa-demos/mesa-demos-help.json b/suite2cases/function_test/pkg_test/mesa-demos/mesa-demos-help.json index e9dd414f9d3..863d321d5ef 100644 --- a/suite2cases/function_test/pkg_test/mesa-demos/mesa-demos-help.json +++ b/suite2cases/function_test/pkg_test/mesa-demos/mesa-demos-help.json @@ -9,22 +9,6 @@ { "name": "test_mesa-demos-help_function_basic", "desc": "Test basic functionality" - }, - { - "name": "test_mesa-demos-help_function_install", - "desc": "Test package installation" - }, - { - "name": "test_mesa-demos-help_function_check_installed", - "desc": "Check if package is installed" - }, - { - "name": "test_mesa-demos-help_function_display_help", - "desc": "Display help information" - }, - { - "name": "test_mesa-demos-help_function_list_demos", - "desc": "List available demo programs" } ] } \ No newline at end of file diff --git a/suite2cases/function_test/pkg_test/podman/podman-docker.json b/suite2cases/function_test/pkg_test/podman/podman-docker.json index 51e8a5b0a9d..fa58ceeca74 100644 --- a/suite2cases/function_test/pkg_test/podman/podman-docker.json +++ b/suite2cases/function_test/pkg_test/podman/podman-docker.json @@ -6,42 +6,10 @@ "name": "test_podman-docker_docker__v", "desc": "测试 podman-docker 的 docker 命令的 -v 参数,显示版本信息" }, - { - "name": "test_podman-docker_docker__upper_v", - "desc": "测试 podman-docker 的 docker 命令的 -V 参数,显示版本信息" - }, - { - "name": "test_podman-docker_docker__h", - "desc": "测试 podman-docker 的 docker 命令的 -h 参数,显示帮助信息" - }, - { - "name": "test_podman-docker_docker__c", - "desc": "测试 podman-docker 的 docker 命令的 -c 参数,指定远程连接" - }, { "name": "test_podman-docker_function_run", "desc": "测试 podman-docker 的 docker run 命令,运行容器" }, - { - "name": "test_podman-docker_docker_v", - "desc": "测试使用 -v 参数显示版本信息" - }, - { - "name": "test_podman-docker_docker_help", - "desc": "测试使用 --help 参数显示帮助信息" - }, - { - "name": "test_podman-docker_docker_remote", - "desc": "测试使用 --remote 参数访问远程 Podman 服务" - }, - { - "name": "test_podman-docker_docker_c", - "desc": "测试使用 -c 参数指定连接远程 Podman 服务" - }, - { - "name": "test_podman-docker_docker_log_level", - "desc": "测试使用 --log-level 参数设置日志级别" - }, { "name": "test_podman-docker_function_pull", "desc": "测试 podman-docker 的 docker pull 命令,拉取镜像" @@ -50,106 +18,22 @@ "name": "test_podman-docker_function_ps", "desc": "测试 podman-docker 的 docker ps 命令,列出容器" }, - { - "name": "test_podman-docker_function_rm", - "desc": "测试 podman-docker 的 docker rm 命令,删除容器" - }, - { - "name": "test_podman-docker_function_images", - "desc": "测试 podman-docker 的 docker images 命令,列出镜像" - }, - { - "name": "test_podman-docker_function_rmi", - "desc": "测试 podman-docker 的 docker rmi 命令,删除镜像" - }, - { - "name": "test_podman-docker_docker", - "desc": "执行docker命令,显示podman命令的概述和可用命令列表" - }, - { - "name": "test_podman-docker_docker_upper_v", - "desc": "执行docker -v命令,显示podman的版本信息" - }, { "name": "test_podman-docker_docker_version", "desc": "执行docker version命令,显示Podman版本信息" }, - { - "name": "test_podman-docker_docker_info", - "desc": "执行docker info命令,显示podman系统信息" - }, { "name": "test_podman-docker_docker_ps", "desc": "执行docker ps命令,列出本地容器" }, - { - "name": "test_podman-docker_docker_images", - "desc": "执行docker images命令,列出本地存储的镜像" - }, - { - "name": "test_podman-docker_docker_pull", - "desc": "执行docker pull命令,从注册表拉取镜像" - }, - { - "name": "test_podman-docker_docker_run", - "desc": "执行docker run命令,在新容器中运行命令" - }, - { - "name": "test_podman-docker_docker_stop", - "desc": "执行docker stop命令,停止一个或多个容器" - }, - { - "name": "test_podman-docker_docker_rm", - "desc": "执行docker rm命令,移除一个或多个容器" - }, { "name": "test_podman-docker_docker_rmi", "desc": "执行docker rmi命令,从本地存储移除一个或多个镜像" }, - { - "name": "test_podman-docker_docker_logs", - "desc": "执行docker logs命令,获取一个或多个容器的日志" - }, - { - "name": "test_podman-docker_docker_exec", - "desc": "执行docker exec命令,在运行中的容器内运行进程" - }, - { - "name": "test_podman-docker_docker_inspect", - "desc": "执行docker inspect命令,显示指定对象(如容器)的配置信息" - }, - { - "name": "test_podman-docker_docker_build", - "desc": "执行docker build命令,使用Containerfile中的指令构建镜像" - }, - { - "name": "test_podman-docker_function_install", - "desc": "测试软件包podman-docker的安装功能" - }, - { - "name": "test_podman-docker_function_uninstall", - "desc": "测试软件包podman-docker的卸载功能" - }, - { - "name": "test_podman-docker_function_check", - "desc": "测试检查podman-docker是否已正确安装" - }, - { - "name": "test_podman-docker_function_docker", - "desc": "测试执行docker命令返回概述" - }, - { - "name": "test_podman-docker_function_run_hello", - "desc": "测试运行hello-world容器" - }, { "name": "test_podman-docker_function_ps_list", "desc": "测试列出所有容器" }, - { - "name": "test_podman-docker_function_pull_image", - "desc": "测试从仓库拉取镜像" - }, { "name": "test_podman-docker_function_rm_container", "desc": "测试删除指定容器" diff --git a/suite2cases/function_test/pkg_test/python-meh/python3-meh.json b/suite2cases/function_test/pkg_test/python-meh/python3-meh.json index c12595aabc3..05c069c4085 100644 --- a/suite2cases/function_test/pkg_test/python-meh/python3-meh.json +++ b/suite2cases/function_test/pkg_test/python-meh/python3-meh.json @@ -9,26 +9,6 @@ { "name": "test_python3-meh_remove", "desc": "Test removal of python3-meh package" - }, - { - "name": "test_python3-meh_function_install", - "desc": "Test installation of python3-meh package" - }, - { - "name": "test_python3-meh_function_remove", - "desc": "Test removal of python3-meh package" - }, - { - "name": "test_python3-meh_function_version", - "desc": "Test querying installed package version" - }, - { - "name": "test_python3-meh_function_import", - "desc": "Test importing meh module in Python" - }, - { - "name": "test_python3-meh_function_help", - "desc": "Test accessing module help or documentation" } ] } \ No newline at end of file diff --git a/suite2cases/function_test/pkg_test/python-pdm-pep517/python3-pdm-pep517.json b/suite2cases/function_test/pkg_test/python-pdm-pep517/python3-pdm-pep517.json deleted file mode 100644 index c7f80960358..00000000000 --- a/suite2cases/function_test/pkg_test/python-pdm-pep517/python3-pdm-pep517.json +++ /dev/null @@ -1,10 +0,0 @@ -{ - "path": "$OET_PATH/testcases/function_test/pkg_test/python-pdm-pep517/python3-pdm-pep517", - "machine num": 1, - "cases": [ - { - "name": "test_python3-pdm-pep517_function_build", - "desc": "Test the build functionality of python3-pdm-pep517" - } - ] -} \ No newline at end of file diff --git a/suite2cases/function_test/pkg_test/python-pydot/python-pydot-help.json b/suite2cases/function_test/pkg_test/python-pydot/python-pydot-help.json index 000272ae981..f369d474017 100644 --- a/suite2cases/function_test/pkg_test/python-pydot/python-pydot-help.json +++ b/suite2cases/function_test/pkg_test/python-pydot/python-pydot-help.json @@ -2,29 +2,9 @@ "path": "$OET_PATH/testcases/function_test/pkg_test/python-pydot/python-pydot-help", "machine num": 1, "cases": [ - { - "name": "test_python-pydot-help_install", - "desc": "测试python-pydot-help软件包的安装功能是否正常" - }, { "name": "test_python-pydot-help_import", "desc": "测试导入python-pydot-help模块是否成功" - }, - { - "name": "test_python-pydot-help_basic_usage", - "desc": "测试python-pydot-help生成简单图形的核心功能" - }, - { - "name": "test_python-pydot-help_graph_attr", - "desc": "测试python-pydot-help设置图形属性的功能" - }, - { - "name": "test_python-pydot-help_render", - "desc": "测试python-pydot-help渲染输出图像文件的功能" - }, - { - "name": "test_python-pydot-help_uninstall", - "desc": "测试python-pydot-help软件包的卸载功能是否正常" } ] } \ No newline at end of file diff --git a/suite2cases/function_test/pkg_test/samba/samba-dc-bind-dlz.json b/suite2cases/function_test/pkg_test/samba/samba-dc-bind-dlz.json index 81c47d223d0..e82a955a196 100644 --- a/suite2cases/function_test/pkg_test/samba/samba-dc-bind-dlz.json +++ b/suite2cases/function_test/pkg_test/samba/samba-dc-bind-dlz.json @@ -5,26 +5,6 @@ { "name": "test_samba-dc-bind-dlz_function_uninstall", "desc": "Test package uninstallation" - }, - { - "name": "test_samba-dc-bind-dlz_function_install", - "desc": "Test package installation and verify successful installation" - }, - { - "name": "test_samba-dc-bind-dlz_function_config", - "desc": "Test basic configuration and service startup" - }, - { - "name": "test_samba-dc-bind-dlz_function_dns_resolve", - "desc": "Test DNS resolution functionality via BIND DLZ" - }, - { - "name": "test_samba-dc-bind-dlz_function_ad_integrate", - "desc": "Test integration with Samba Active Directory" - }, - { - "name": "test_samba-dc-bind-dlz_function_service_status", - "desc": "Test service status and basic operations" } ] } \ No newline at end of file diff --git a/suite2cases/function_test/pkg_test/texlive-base/texlive-ptex.json b/suite2cases/function_test/pkg_test/texlive-base/texlive-ptex.json index 0ddafe4f3e0..c49c04f5898 100644 --- a/suite2cases/function_test/pkg_test/texlive-base/texlive-ptex.json +++ b/suite2cases/function_test/pkg_test/texlive-base/texlive-ptex.json @@ -10,933 +10,17 @@ "name": "test_texlive-ptex_eptex_-help", "desc": "测试 eptex 命令的帮助信息显示" }, - { - "name": "test_texlive-ptex_eptex_-version", - "desc": "测试 eptex 命令的版本信息显示" - }, - { - "name": "test_texlive-ptex_eptex_-etex", - "desc": "测试 eptex 命令启用 e-TeX 扩展" - }, - { - "name": "test_texlive-ptex_eptex_-halt-on-error", - "desc": "测试 eptex 命令在遇到第一个错误时停止处理" - }, - { - "name": "test_texlive-ptex_eptex_-no-file-line-error", - "desc": "测试 eptex 命令禁用文件:行:错误样式消息" - }, - { - "name": "test_texlive-ptex_eptex_-file-line-error", - "desc": "测试 eptex 命令启用文件:行:错误样式消息" - }, - { - "name": "test_texlive-ptex_eptex_-ini", - "desc": "测试 eptex 命令以 iniptex 模式运行" - }, - { - "name": "test_texlive-ptex_eptex_-interaction_errorstopmode", - "desc": "测试 eptex 命令设置交互模式为 errorstopmode" - }, - { - "name": "test_texlive-ptex_eptex_-interaction_batchmode", - "desc": "测试 eptex 命令设置交互模式为 batchmode" - }, - { - "name": "test_texlive-ptex_eptex_-ipc", - "desc": "测试 eptex 命令将 DVI 输出发送到套接字" - }, - { - "name": "test_texlive-ptex_eptex_-ipc-start", - "desc": "测试 eptex 命令将 DVI 输出发送到套接字并启动服务器" - }, - { - "name": "test_texlive-ptex_eptex_-jobname_testjob", - "desc": "测试 eptex 命令设置作业名称为 testjob" - }, - { - "name": "test_texlive-ptex_eptex_-kanji_utf8", - "desc": "测试 eptex 命令设置日语编码为 UTF-8" - }, - { - "name": "test_texlive-ptex_eptex_-kanji-internal_sjis", - "desc": "测试 eptex 命令设置日语内部编码为 SJIS" - }, - { - "name": "test_texlive-ptex_eptex_-kpathsea-debug_1", - "desc": "测试 eptex 命令设置路径搜索调试标志为 1" - }, - { - "name": "test_texlive-ptex_eptex_-no-mktex_tex", - "desc": "测试 eptex 命令禁用 mktextex 生成" - }, - { - "name": "test_texlive-ptex_eptex_-mktex_tex", - "desc": "测试 eptex 命令启用 mktextex 生成" - }, - { - "name": "test_texlive-ptex_eptex_-mltex", - "desc": "测试 eptex 命令启用 MLTeX 扩展" - }, - { - "name": "test_texlive-ptex_eptex_-output-comment_custom", - "desc": "测试 eptex 命令设置自定义的 DVI 文件注释" - }, - { - "name": "test_texlive-ptex_eptex_-output-directory_tmp", - "desc": "测试 eptex 命令设置输出目录为 /tmp" - }, - { - "name": "test_texlive-ptex_eptex_-no-parse-first-line", - "desc": "测试 eptex 命令禁用输入文件第一行的解析" - }, - { - "name": "test_texlive-ptex_eptex_-parse-first-line", - "desc": "测试 eptex 命令启用输入文件第一行的解析" - }, - { - "name": "test_texlive-ptex_eptex_-progname_myeptex", - "desc": "测试 eptex 命令设置程序(和 fmt)名称为 myeptex" - }, - { - "name": "test_texlive-ptex_eptex_-recorder", - "desc": "测试 eptex 命令启用文件名记录器" - }, - { - "name": "test_texlive-ptex_eptex_-no-shell-escape", - "desc": "测试 eptex 命令禁用 \\write18{SHELL COMMAND}" - }, - { - "name": "test_texlive-ptex_eptex_-shell-escape", - "desc": "测试 eptex 命令启用 \\write18{SHELL COMMAND}" - }, - { - "name": "test_texlive-ptex_eptex_-shell-restricted", - "desc": "测试 eptex 命令启用受限的 \\write18" - }, - { - "name": "test_texlive-ptex_eptex_-src-specials", - "desc": "测试 eptex 命令在 DVI 文件中插入源特殊字符" - }, - { - "name": "test_texlive-ptex_eptex_-src-specials_cr_hbox", - "desc": "测试 eptex 命令在 DVI 文件的特定位置(cr 和 hbox)插入源特殊字符" - }, - { - "name": "test_texlive-ptex_eptex_-synctex_1", - "desc": "测试 eptex 命令根据位 1 生成 SyncTeX 数据" - }, - { - "name": "test_texlive-ptex_eptex_-fmt_myformat", - "desc": "测试 eptex 命令使用指定的格式文件 myformat.fmt" - }, - { - "name": "test_texlive-ptex_makejvf_upper_c", - "desc": "测试长体模式" - }, - { - "name": "test_texlive-ptex_makejvf_upper_k_upper_ps_tfm", - "desc": "测试为非汉字部分指定PS字体TFM" - }, - { - "name": "test_texlive-ptex_makejvf_b_num_50", - "desc": "测试基线正方向调整" - }, - { - "name": "test_texlive-ptex_makejvf_b_num_-30", - "desc": "测试基线负方向调整" - }, - { - "name": "test_texlive-ptex_makejvf_m", - "desc": "测试竖排时使用分/秒符号替代引号" - }, - { - "name": "test_texlive-ptex_makejvf_a_afmfile", - "desc": "测试指定AFM文件(用于假名间距调整)" - }, - { - "name": "test_texlive-ptex_makejvf_k_num_20", - "desc": "测试指定假名间距调整边距" - }, - { - "name": "test_texlive-ptex_makejvf_i", - "desc": "测试从0开始映射字体ID" - }, - { - "name": "test_texlive-ptex_makejvf_e", - "desc": "测试增强模式" - }, - { - "name": "test_texlive-ptex_makejvf_t_cnffile", - "desc": "测试使用指定的配置文件" - }, - { - "name": "test_texlive-ptex_makejvf_upper_o", - "desc": "测试省略具有默认度量的字符的VF条目" - }, - { - "name": "test_texlive-ptex_makejvf_u_jis", - "desc": "测试UCS模式下的JIS字符集" - }, - { - "name": "test_texlive-ptex_makejvf_u_cns", - "desc": "测试UCS模式下的CNS字符集" - }, - { - "name": "test_texlive-ptex_makejvf_u_gb", - "desc": "测试UCS模式下的GB字符集" - }, - { - "name": "test_texlive-ptex_makejvf_u_ks", - "desc": "测试UCS模式下的KS字符集" - }, - { - "name": "test_texlive-ptex_makejvf_u_jisq", - "desc": "测试UCS模式下仅JIS引号" - }, - { - "name": "test_texlive-ptex_makejvf_u_custom", - "desc": "测试UCS模式下使用自定义字符集" - }, - { - "name": "test_texlive-ptex_makejvf_upper_j_upper_ps_tfm", - "desc": "测试在UCS模式下将引号映射到另一个JIS编码的PS字体TFM" - }, - { - "name": "test_texlive-ptex_makejvf_upper_u_upper_ps_tfm", - "desc": "测试在UCS模式下将引号映射到另一个UCS编码的PS字体TFM" - }, - { - "name": "test_texlive-ptex_makejvf_3", - "desc": "测试在UCS模式下启用非BMP字符支持" - }, - { - "name": "test_texlive-ptex_makejvf_upper_h", - "desc": "测试在UCS模式下使用半角片假名" - }, - { - "name": "test_texlive-ptex_makejvf_upper_k_upper_ps_tfm_u_jis", - "desc": "测试组合使用-K选项和UCS JIS模式" - }, - { - "name": "test_texlive-ptex_makejvf_a_afmfile_k_num_20", - "desc": "测试组合使用AFM文件和假名边距选项" - }, - { - "name": "test_texlive-ptex_mendex_i", - "desc": "测试使用标准输入作为输入文件" - }, - { - "name": "test_texlive-ptex_mendex_l", - "desc": "测试使用字母顺序排序" - }, - { - "name": "test_texlive-ptex_mendex_q", - "desc": "测试静默模式" - }, - { - "name": "test_texlive-ptex_mendex_r", - "desc": "测试禁用隐式页码生成" - }, - { - "name": "test_texlive-ptex_mendex_c", - "desc": "测试压缩空白字符(忽略首尾空白)" - }, - { - "name": "test_texlive-ptex_mendex_g", - "desc": "测试生成日语索引头<あかさたなはまやらわ>" - }, - { - "name": "test_texlive-ptex_mendex_f", - "desc": "测试强制输出汉字" - }, - { - "name": "test_texlive-ptex_mendex_s_sty", - "desc": "测试指定样式文件" - }, - { - "name": "test_texlive-ptex_mendex_d_dic", - "desc": "测试指定字典文件" - }, - { - "name": "test_texlive-ptex_mendex_o_ind", - "desc": "测试指定输出索引文件" - }, - { - "name": "test_texlive-ptex_mendex_t_log", - "desc": "测试指定错误日志文件" - }, - { - "name": "test_texlive-ptex_mendex_p_no", - "desc": "测试设置索引的起始页码" - }, - { - "name": "test_texlive-ptex_mendex_upper_e", - "desc": "测试EUC编码模式" - }, - { - "name": "test_texlive-ptex_mendex_upper_j", - "desc": "测试JIS编码模式" - }, - { - "name": "test_texlive-ptex_mendex_upper_s", - "desc": "测试ShiftJIS编码模式" - }, - { - "name": "test_texlive-ptex_mendex_upper_u", - "desc": "测试UTF-8编码模式" - }, - { - "name": "test_texlive-ptex_mendex_upper_i_enc", - "desc": "测试指定关键词的内部编码" - }, - { - "name": "test_texlive-ptex_mendex_input_file", - "desc": "测试指定输入文件" - }, - { - "name": "test_texlive-ptex_pbibtex_kanji_euc", - "desc": "使用-kanji参数指定日文编码为euc" - }, - { - "name": "test_texlive-ptex_pbibtex_kanji_jis", - "desc": "使用-kanji参数指定日文编码为jis" - }, - { - "name": "test_texlive-ptex_pbibtex_kanji_sjis", - "desc": "使用-kanji参数指定日文编码为sjis" - }, - { - "name": "test_texlive-ptex_pbibtex_kanji_utf8", - "desc": "使用-kanji参数指定日文编码为utf8" - }, - { - "name": "test_texlive-ptex_pbibtex_min_crossrefs_num_1", - "desc": "使用-min-crossrefs参数设置交叉引用包含阈值为1" - }, - { - "name": "test_texlive-ptex_pbibtex_terse", - "desc": "使用-terse参数静默执行,不打印进度报告" - }, - { - "name": "test_texlive-ptex_pbibtex_help", - "desc": "使用-help参数显示帮助信息" - }, - { - "name": "test_texlive-ptex_pbibtex_version", - "desc": "使用-version参数显示版本信息" - }, - { - "name": "test_texlive-ptex_pbibtex_no_option", - "desc": "不提供任何选项,仅指定aux文件" - }, - { - "name": "test_texlive-ptex_pdvitomp_help", - "desc": "测试pdvitomp命令的-help参数,用于显示帮助信息" - }, - { - "name": "test_texlive-ptex_pdvitomp_version", - "desc": "测试pdvitomp命令的-version参数,用于输出版本信息" - }, - { - "name": "test_texlive-ptex_pdvitomp_progname", - "desc": "测试pdvitomp命令的-progname参数,用于设置程序名称" - }, - { - "name": "test_texlive-ptex_pdvitomp_kanji_sjis", - "desc": "测试pdvitomp命令的-kanji参数,设置日文编码为sjis" - }, - { - "name": "test_texlive-ptex_pdvitomp_kanji_jis", - "desc": "测试pdvitomp命令的-kanji参数,设置日文编码为jis" - }, - { - "name": "test_texlive-ptex_pdvitomp_kanji_euc", - "desc": "测试pdvitomp命令的-kanji参数,设置日文编码为euc" - }, - { - "name": "test_texlive-ptex_pdvitomp_kanji_utf8", - "desc": "测试pdvitomp命令的-kanji参数,设置日文编码为utf8" - }, - { - "name": "test_texlive-ptex_pdvitomp_kpathsea_debug", - "desc": "测试pdvitomp命令的-kpathsea-debug参数,设置路径搜索调试标志" - }, - { - "name": "test_texlive-ptex_pdvitomp_basic_conversion", - "desc": "测试pdvitomp命令的基本功能,将指定的DVI文件转换为MPX文件" - }, - { - "name": "test_texlive-ptex_pdvitype_dpi", - "desc": "测试 pdvitype 命令的 -dpi 参数,指定分辨率为 150.0 像素每英寸" - }, - { - "name": "test_texlive-ptex_pdvitype_kanji", - "desc": "测试 pdvitype 命令的 -kanji 参数,指定日文编码为 utf8" - }, - { - "name": "test_texlive-ptex_pdvitype_magnification", - "desc": "测试 pdvitype 命令的 -magnification 参数,指定放大倍数为 1000" - }, - { - "name": "test_texlive-ptex_pdvitype_max_pages", - "desc": "测试 pdvitype 命令的 -max-pages 参数,限制处理页数为 5" - }, - { - "name": "test_texlive-ptex_pdvitype_output_level", - "desc": "测试 pdvitype 命令的 -output-level 参数,设置输出详细级别为 2" - }, - { - "name": "test_texlive-ptex_pdvitype_page_start", - "desc": "测试 pdvitype 命令的 -page-start 参数,设置起始页面为 2" - }, - { - "name": "test_texlive-ptex_pdvitype_show_opcodes", - "desc": "测试 pdvitype 命令的 -show-opcodes 参数,显示数字操作码" - }, - { - "name": "test_texlive-ptex_pdvitype_help", - "desc": "测试 pdvitype 命令的 -help 参数,显示帮助信息" - }, - { - "name": "test_texlive-ptex_pdvitype_version", - "desc": "测试 pdvitype 命令的 -version 参数,显示版本信息" - }, - { - "name": "test_texlive-ptex_pdvitype_dpi_kanji", - "desc": "测试 pdvitype 命令的 -dpi 和 -kanji 参数组合,同时指定分辨率和日文编码" - }, - { - "name": "test_texlive-ptex_platex_help", - "desc": "测试 platex 命令的帮助选项" - }, - { - "name": "test_texlive-ptex_platex_version", - "desc": "测试 platex 命令的版本信息选项" - }, - { - "name": "test_texlive-ptex_platex_etex", - "desc": "测试 platex 命令启用 e-TeX 扩展的选项" - }, - { - "name": "test_texlive-ptex_platex_halt_on_error", - "desc": "测试 platex 命令在遇到第一个错误时停止处理的选项" - }, - { - "name": "test_texlive-ptex_platex_no_file_line_error", - "desc": "测试 platex 命令禁用文件:行:错误样式消息的选项" - }, - { - "name": "test_texlive-ptex_platex_interaction_batchmode", - "desc": "测试 platex 命令设置批处理交互模式的选项" - }, - { - "name": "test_texlive-ptex_platex_jobname", - "desc": "测试 platex 命令设置作业名称的选项" - }, - { - "name": "test_texlive-ptex_platex_kanji_utf8", - "desc": "测试 platex 命令设置日文编码为 UTF-8 的选项" - }, - { - "name": "test_texlive-ptex_platex_no_mktex_tex", - "desc": "测试 platex 命令禁用 mktextex 生成的选项" - }, - { - "name": "test_texlive-ptex_platex_output_directory", - "desc": "测试 platex 命令设置输出目录的选项" - }, - { - "name": "test_texlive-ptex_platex_no_parse_first_line", - "desc": "测试 platex 命令禁用解析输入文件第一行的选项" - }, - { - "name": "test_texlive-ptex_platex_no_shell_escape", - "desc": "测试 platex 命令禁用 \\write18{SHELL COMMAND} 的选项" - }, - { - "name": "test_texlive-ptex_platex_src_specials", - "desc": "测试 platex 命令在 DVI 文件中插入源特殊字符的选项" - }, - { - "name": "test_texlive-ptex_platex_input_file", - "desc": "测试 platex 命令处理输入文件的基本功能" - }, - { - "name": "test_texlive-ptex_platex-dev_etex", - "desc": "测试启用e-TeX扩展功能" - }, - { - "name": "test_texlive-ptex_platex-dev_fmt", - "desc": "测试指定格式文件名称" - }, - { - "name": "test_texlive-ptex_platex-dev_halt-on-error", - "desc": "测试遇到第一个错误时停止处理" - }, - { - "name": "test_texlive-ptex_platex-dev_no-file-line-error", - "desc": "测试禁用文件:行:错误样式消息" - }, - { - "name": "test_texlive-ptex_platex-dev_file-line-error", - "desc": "测试启用文件:行:错误样式消息" - }, - { - "name": "test_texlive-ptex_platex-dev_ini", - "desc": "测试以iniptex模式运行" - }, - { - "name": "test_texlive-ptex_platex-dev_interaction", - "desc": "测试设置交互模式为批处理模式" - }, - { - "name": "test_texlive-ptex_platex-dev_ipc", - "desc": "测试将DVI输出同时发送到套接字" - }, - { - "name": "test_texlive-ptex_platex-dev_ipc-start", - "desc": "测试启动IPC服务器并发送输出" - }, - { - "name": "test_texlive-ptex_platex-dev_jobname", - "desc": "测试设置作业名称" - }, - { - "name": "test_texlive-ptex_platex-dev_kanji", - "desc": "测试设置日语编码为UTF-8" - }, - { - "name": "test_texlive-ptex_platex-dev_kanji-internal", - "desc": "测试设置日语内部编码为EUC" - }, - { - "name": "test_texlive-ptex_platex-dev_kpathsea-debug", - "desc": "测试设置路径搜索调试标志" - }, - { - "name": "test_texlive-ptex_platex-dev_no-mktex", - "desc": "测试禁用mktexFMT生成" - }, - { - "name": "test_texlive-ptex_platex-dev_mktex", - "desc": "测试启用mktexFMT生成" - }, - { - "name": "test_texlive-ptex_platex-dev_mltex", - "desc": "测试启用MLTeX扩展功能" - }, - { - "name": "test_texlive-ptex_platex-dev_output-comment", - "desc": "测试设置DVI文件注释" - }, - { - "name": "test_texlive-ptex_platex-dev_output-directory", - "desc": "测试指定输出目录" - }, - { - "name": "test_texlive-ptex_platex-dev_no-parse-first-line", - "desc": "测试禁用输入文件首行解析" - }, - { - "name": "test_texlive-ptex_platex-dev_parse-first-line", - "desc": "测试启用输入文件首行解析" - }, - { - "name": "test_texlive-ptex_platex-dev_progname", - "desc": "测试设置程序(及格式)名称" - }, - { - "name": "test_texlive-ptex_platex-dev_recorder", - "desc": "测试启用文件名记录器" - }, - { - "name": "test_texlive-ptex_platex-dev_no-shell-escape", - "desc": "测试禁用\\write18{SHELL COMMAND}功能" - }, - { - "name": "test_texlive-ptex_platex-dev_shell-escape", - "desc": "测试启用\\write18{SHELL COMMAND}功能" - }, - { - "name": "test_texlive-ptex_platex-dev_shell-restricted", - "desc": "测试启用受限的\\write18功能" - }, - { - "name": "test_texlive-ptex_platex-dev_src-specials", - "desc": "测试在DVI文件中插入源特殊标记" - }, - { - "name": "test_texlive-ptex_platex-dev_src-specials_cr", - "desc": "测试在DVI文件的特定位置(cr)插入源特殊标记" - }, - { - "name": "test_texlive-ptex_platex-dev_synctex", - "desc": "测试生成预览器的SyncTeX数据" - }, - { - "name": "test_texlive-ptex_platex-dev_translate-file", - "desc": "测试使用TCX文件进行字符转换" - }, - { - "name": "test_texlive-ptex_platex-dev_help", - "desc": "测试打印帮助信息并退出" - }, - { - "name": "test_texlive-ptex_platex-dev_version", - "desc": "测试打印版本信息并退出" - }, - { - "name": "test_texlive-ptex_pmpost_ini", - "desc": "测试 pmpost 命令的 -ini 参数,用于转储内存文件" - }, - { - "name": "test_texlive-ptex_pmpost_interaction", - "desc": "测试 pmpost 命令的 -interaction 参数,用于设置交互模式" - }, - { - "name": "test_texlive-ptex_pmpost_numbersystem", - "desc": "测试 pmpost 命令的 -numbersystem 参数,用于设置数字系统模式" - }, - { - "name": "test_texlive-ptex_pmpost_jobname", - "desc": "测试 pmpost 命令的 -jobname 参数,用于设置作业名称" - }, - { - "name": "test_texlive-ptex_pmpost_kanji", - "desc": "测试 pmpost 命令的 -kanji 参数,用于设置日文编码" - }, { "name": "test_texlive-ptex_pmpost_progname", "desc": "测试 pmpost 命令的 -progname 参数,用于设置程序(和内存)名称" }, - { - "name": "test_texlive-ptex_pmpost_tex", - "desc": "测试 pmpost 命令的 -tex 参数,用于指定文本标签的 TeX 程序" - }, - { - "name": "test_texlive-ptex_pmpost_file_line_error", - "desc": "测试 pmpost 命令的 -file-line-error 参数,用于禁用文件:行:错误样式消息" - }, - { - "name": "test_texlive-ptex_pmpost_no_file_line_error", - "desc": "测试 pmpost 命令的 -no-file-line-error 参数,用于启用文件:行:错误样式消息" - }, - { - "name": "test_texlive-ptex_pmpost_debug", - "desc": "测试 pmpost 命令的 -debug 参数,用于打印调试信息并保留临时文件" - }, - { - "name": "test_texlive-ptex_pmpost_kpathsea_debug", - "desc": "测试 pmpost 命令的 -kpathsea-debug 参数,用于根据数字位设置路径搜索调试标志" - }, - { - "name": "test_texlive-ptex_pmpost_mem", - "desc": "测试 pmpost 命令的 -mem 参数,用于指定内存文件名" - }, - { - "name": "test_texlive-ptex_pmpost_recorder", - "desc": "测试 pmpost 命令的 -recorder 参数,用于启用文件名记录器" - }, - { - "name": "test_texlive-ptex_pmpost_restricted", - "desc": "测试 pmpost 命令的 -restricted 参数,用于安全模式:禁用 tex、makempx 和编辑器命令" - }, - { - "name": "test_texlive-ptex_pmpost_troff", - "desc": "测试 pmpost 命令的 -troff 参数,用于设置 prologues:=1 并假定 TEXPROGRAM 实际为 troff" - }, - { - "name": "test_texlive-ptex_pmpost_upper_t", - "desc": "测试 pmpost 命令的 -T 参数,功能同 -troff" - }, - { - "name": "test_texlive-ptex_pmpost_s", - "desc": "测试 pmpost 命令的 -s 参数,用于设置内部变量的值" - }, { "name": "test_texlive-ptex_pmpost_help", "desc": "测试 pmpost 命令的 -help 参数,用于显示帮助信息并退出" }, - { - "name": "test_texlive-ptex_pmpost_version", - "desc": "测试 pmpost 命令的 -version 参数,用于输出版本信息并退出" - }, - { - "name": "test_texlive-ptex_pmpost_dvitomp", - "desc": "测试 pmpost 命令的 --dvitomp 参数,用于将 pMetaPost 作为 DVI 到 MPX 的转换器" - }, { "name": "test_texlive-ptex_ppltotf_help", "desc": "测试 ppltotf 命令的帮助信息显示" - }, - { - "name": "test_texlive-ptex_ppltotf_version", - "desc": "测试 ppltotf 命令的版本信息显示" - }, - { - "name": "test_texlive-ptex_ppltotf_kanji_euc", - "desc": "测试 ppltotf 命令设置日文编码为 euc" - }, - { - "name": "test_texlive-ptex_ppltotf_kanji_jis", - "desc": "测试 ppltotf 命令设置日文编码为 jis" - }, - { - "name": "test_texlive-ptex_ppltotf_kanji_sjis", - "desc": "测试 ppltotf 命令设置日文编码为 sjis" - }, - { - "name": "test_texlive-ptex_ppltotf_kanji_utf8", - "desc": "测试 ppltotf 命令设置日文编码为 utf8" - }, - { - "name": "test_texlive-ptex_ppltotf_verbose", - "desc": "测试 ppltotf 命令的详细输出模式" - }, - { - "name": "test_texlive-ptex_ppltotf_default_tfm", - "desc": "测试 ppltotf 命令使用默认输出 TFM 文件名" - }, - { - "name": "test_texlive-ptex_ppltotf_specified_tfm", - "desc": "测试 ppltotf 命令指定输出 TFM 文件名" - }, - { - "name": "test_texlive-ptex_ptex_version", - "desc": "测试ptex命令的版本信息输出" - }, - { - "name": "test_texlive-ptex_ptex_help", - "desc": "测试ptex命令的帮助信息输出" - }, - { - "name": "test_texlive-ptex_ptex_jobname", - "desc": "测试ptex命令设置作业名称的功能" - }, - { - "name": "test_texlive-ptex_ptex_kanji_utf8", - "desc": "测试ptex命令设置日文编码为UTF-8" - }, - { - "name": "test_texlive-ptex_ptex_kanji_sjis", - "desc": "测试ptex命令设置日文编码为SJIS" - }, - { - "name": "test_texlive-ptex_ptex_kanji_euc", - "desc": "测试ptex命令设置日文编码为EUC" - }, - { - "name": "test_texlive-ptex_ptex_kanji_jis", - "desc": "测试ptex命令设置日文编码为JIS" - }, - { - "name": "test_texlive-ptex_ptex_interaction_batchmode", - "desc": "测试ptex命令设置交互模式为batchmode" - }, - { - "name": "test_texlive-ptex_ptex_interaction_nonstopmode", - "desc": "测试ptex命令设置交互模式为nonstopmode" - }, - { - "name": "test_texlive-ptex_ptex_output_directory", - "desc": "测试ptex命令设置输出目录的功能" - }, - { - "name": "test_texlive-ptex_ptex_shell_escape", - "desc": "测试ptex命令启用shell转义功能" - }, - { - "name": "test_texlive-ptex_ptex_no_shell_escape", - "desc": "测试ptex命令禁用shell转义功能" - }, - { - "name": "test_texlive-ptex_ptex_shell_restricted", - "desc": "测试ptex命令启用受限shell转义功能" - }, - { - "name": "test_texlive-ptex_ptex_halt_on_error", - "desc": "测试ptex命令在遇到第一个错误时停止处理的功能" - }, - { - "name": "test_texlive-ptex_ptex_file_line_error", - "desc": "测试ptex命令启用文件:行:错误样式消息" - }, - { - "name": "test_texlive-ptex_ptex_no_file_line_error", - "desc": "测试ptex命令禁用文件:行:错误样式消息" - }, - { - "name": "test_texlive-ptex_ptex_parse_first_line", - "desc": "测试ptex命令启用解析输入文件首行的功能" - }, - { - "name": "test_texlive-ptex_ptex_no_parse_first_line", - "desc": "测试ptex命令禁用解析输入文件首行的功能" - }, - { - "name": "test_texlive-ptex_ptex_fmt", - "desc": "测试ptex命令指定格式文件的功能" - }, - { - "name": "test_texlive-ptex_ptex_ini", - "desc": "测试ptex命令以ini模式运行" - }, - { - "name": "test_texlive-ptex_ptex_recorder", - "desc": "测试ptex命令启用文件名记录器的功能" - }, - { - "name": "test_texlive-ptex_ptftopl_help", - "desc": "测试ptftopl命令的help参数,查看帮助信息" - }, - { - "name": "test_texlive-ptex_ptftopl_version", - "desc": "测试ptftopl命令的version参数,查看版本信息" - }, - { - "name": "test_texlive-ptex_ptftopl_verbose", - "desc": "测试ptftopl命令的verbose参数,显示详细进度报告" - }, - { - "name": "test_texlive-ptex_ptftopl_charcode_format_octal", - "desc": "测试ptftopl命令的charcode-format参数设置为octal,以八进制格式输出字符码" - }, - { - "name": "test_texlive-ptex_ptftopl_charcode_format_ascii", - "desc": "测试ptftopl命令的charcode-format参数设置为ascii,以ASCII格式输出字符码" - }, - { - "name": "test_texlive-ptex_ptftopl_kanji_euc", - "desc": "测试ptftopl命令的kanji参数设置为euc,指定日文编码为EUC" - }, - { - "name": "test_texlive-ptex_ptftopl_kanji_jis", - "desc": "测试ptftopl命令的kanji参数设置为jis,指定日文编码为JIS" - }, - { - "name": "test_texlive-ptex_ptftopl_kanji_sjis", - "desc": "测试ptftopl命令的kanji参数设置为sjis,指定日文编码为SJIS" - }, - { - "name": "test_texlive-ptex_ptftopl_kanji_utf8", - "desc": "测试ptftopl命令的kanji参数设置为utf8,指定日文编码为UTF-8" - }, - { - "name": "test_texlive-ptex_r-pmpost_ini", - "desc": "测试 pmpost 命令的 -ini 参数,用于初始化并转储内存文件" - }, - { - "name": "test_texlive-ptex_r-pmpost_interaction", - "desc": "测试 pmpost 命令的 -interaction 参数,设置交互模式" - }, - { - "name": "test_texlive-ptex_r-pmpost_numbersystem", - "desc": "测试 pmpost 命令的 -numbersystem 参数,设置数字系统模式" - }, - { - "name": "test_texlive-ptex_r-pmpost_jobname", - "desc": "测试 pmpost 命令的 -jobname 参数,设置作业名称" - }, - { - "name": "test_texlive-ptex_r-pmpost_kanji", - "desc": "测试 pmpost 命令的 -kanji 参数,设置日语编码" - }, - { - "name": "test_texlive-ptex_r-pmpost_progname", - "desc": "测试 pmpost 命令的 -progname 参数,设置程序(和内存)名称" - }, - { - "name": "test_texlive-ptex_r-pmpost_tex", - "desc": "测试 pmpost 命令的 -tex 参数,指定用于文本标签的 TEXPROGRAM" - }, - { - "name": "test_texlive-ptex_r-pmpost_file_line_error", - "desc": "测试 pmpost 命令的 -file-line-error 参数,启用文件:行:错误样式消息" - }, - { - "name": "test_texlive-ptex_r-pmpost_no_file_line_error", - "desc": "测试 pmpost 命令的 -no-file-line-error 参数,禁用文件:行:错误样式消息" - }, - { - "name": "test_texlive-ptex_r-pmpost_debug", - "desc": "测试 pmpost 命令的 -debug 参数,打印调试信息并保留临时文件" - }, - { - "name": "test_texlive-ptex_r-pmpost_kpathsea_debug", - "desc": "测试 pmpost 命令的 -kpathsea-debug 参数,根据数字位设置路径搜索调试标志" - }, - { - "name": "test_texlive-ptex_r-pmpost_mem", - "desc": "测试 pmpost 命令的 -mem 参数,使用指定的内存文件名称" - }, - { - "name": "test_texlive-ptex_r-pmpost_recorder", - "desc": "测试 pmpost 命令的 -recorder 参数,启用文件名记录器" - }, - { - "name": "test_texlive-ptex_r-pmpost_restricted", - "desc": "测试 pmpost 命令的 -restricted 参数,以安全模式运行,禁用 tex、makempx 和编辑器命令" - }, - { - "name": "test_texlive-ptex_r-pmpost_troff", - "desc": "测试 pmpost 命令的 -troff 参数,设置 prologues:=1 并假设 TEXPROGRAM 是真正的 troff" - }, - { - "name": "test_texlive-ptex_r-pmpost_upper_t", - "desc": "测试 pmpost 命令的 -T 参数,其作用等同于 -troff" - }, - { - "name": "test_texlive-ptex_r-pmpost_s", - "desc": "测试 pmpost 命令的 -s 参数,设置内部变量的值" - }, - { - "name": "test_texlive-ptex_r-pmpost_help", - "desc": "测试 pmpost 命令的 -help 参数,显示帮助信息并退出" - }, - { - "name": "test_texlive-ptex_r-pmpost_version", - "desc": "测试 pmpost 命令的 -version 参数,输出版本信息并退出" - }, - { - "name": "test_texlive-ptex_r-pmpost_dvitomp", - "desc": "测试 pmpost 命令的 --dvitomp 参数,仅作为 DVI 到 MPX 的转换器运行" - }, - { - "name": "test_texlive-ptex_function_basic", - "desc": "Test basic pTeX document compilation" - }, - { - "name": "test_texlive-ptex_function_platex", - "desc": "Test LaTeX document with pLaTeX" - }, - { - "name": "test_texlive-ptex_function_pbibtex", - "desc": "Test bibliography processing with pBibTeX" - }, - { - "name": "test_texlive-ptex_function_mendex", - "desc": "Test index generation with mendex" - }, - { - "name": "test_texlive-ptex_function_kanji_utf8", - "desc": "Test Japanese UTF-8 encoding support" - }, - { - "name": "test_texlive-ptex_function_kanji_sjis", - "desc": "Test Japanese Shift-JIS encoding support" - }, - { - "name": "test_texlive-ptex_function_output_dir", - "desc": "Test setting output directory" - }, - { - "name": "test_texlive-ptex_function_shell_escape", - "desc": "Test shell escape functionality" - }, - { - "name": "test_texlive-ptex_function_version", - "desc": "Test version display of ptex commands" } ] } \ No newline at end of file diff --git a/suite2cases/function_test/pkg_test/texlive-split-b/texlive-aspectratio.json b/suite2cases/function_test/pkg_test/texlive-split-b/texlive-aspectratio.json deleted file mode 100644 index 5c31e2ef0d4..00000000000 --- a/suite2cases/function_test/pkg_test/texlive-split-b/texlive-aspectratio.json +++ /dev/null @@ -1,26 +0,0 @@ -{ - "path": "$OET_PATH/testcases/function_test/pkg_test/texlive-split-b/texlive-aspectratio", - "machine num": 1, - "cases": [ - { - "name": "test_texlive-aspectratio_function_basic", - "desc": "Test basic functionality of aspectratio package" - }, - { - "name": "test_texlive-aspectratio_function_install", - "desc": "Test installation of the aspectratio package" - }, - { - "name": "test_texlive-aspectratio_function_uninstall", - "desc": "Test uninstallation of the aspectratio package" - }, - { - "name": "test_texlive-aspectratio_function_setratio", - "desc": "Test setting the aspect ratio in document" - }, - { - "name": "test_texlive-aspectratio_function_compile", - "desc": "Test document compilation with aspectratio" - } - ] -} \ No newline at end of file diff --git a/suite2cases/function_test/pkg_test/texlive-split-g/texlive-docbytex-doc.json b/suite2cases/function_test/pkg_test/texlive-split-g/texlive-docbytex-doc.json index 276a38bf798..d497eb49f82 100644 --- a/suite2cases/function_test/pkg_test/texlive-split-g/texlive-docbytex-doc.json +++ b/suite2cases/function_test/pkg_test/texlive-split-g/texlive-docbytex-doc.json @@ -6,10 +6,6 @@ "name": "test_texlive-docbytex-doc_install", "desc": "测试 texlive-docbytex-doc 软件包的安装功能,验证是否能够正确安装到系统中。", "machine num": 1 - }, - { - "name": "test_texlive-docbytex-doc_function_render", - "desc": "测试 texlive-docbytex-doc 的文档渲染功能,验证是否能正确生成文档。" } ] } \ No newline at end of file diff --git a/suite2cases/function_test/pkg_test/texlive-split-h/texlive-eco-doc.json b/suite2cases/function_test/pkg_test/texlive-split-h/texlive-eco-doc.json index f2071707a6f..a6fec7fda5e 100644 --- a/suite2cases/function_test/pkg_test/texlive-split-h/texlive-eco-doc.json +++ b/suite2cases/function_test/pkg_test/texlive-split-h/texlive-eco-doc.json @@ -17,10 +17,6 @@ { "name": "test_texlive-eco-doc_function_info", "desc": "Test package info query" - }, - { - "name": "test_texlive-eco-doc_function_usage", - "desc": "Test basic LaTeX usage" } ] } \ No newline at end of file diff --git a/suite2cases/function_test/pkg_test/texlive-split-j/texlive-gmverb.json b/suite2cases/function_test/pkg_test/texlive-split-j/texlive-gmverb.json deleted file mode 100644 index fbf84c9ef25..00000000000 --- a/suite2cases/function_test/pkg_test/texlive-split-j/texlive-gmverb.json +++ /dev/null @@ -1,10 +0,0 @@ -{ - "path": "$OET_PATH/testcases/function_test/pkg_test/texlive-split-j/texlive-gmverb", - "machine num": 1, - "cases": [ - { - "name": "test_texlive-gmverb_function_basic", - "desc": "Test basic functionality of texlive-gmverb" - } - ] -} \ No newline at end of file diff --git a/suite2cases/function_test/pkg_test/texlive-split-l/texlive-hyphen-spanish.json b/suite2cases/function_test/pkg_test/texlive-split-l/texlive-hyphen-spanish.json index 40189e5261c..19f78927bb3 100644 --- a/suite2cases/function_test/pkg_test/texlive-split-l/texlive-hyphen-spanish.json +++ b/suite2cases/function_test/pkg_test/texlive-split-l/texlive-hyphen-spanish.json @@ -6,10 +6,6 @@ "name": "test_texlive-hyphen-spanish_function_install", "desc": "Test package installation" }, - { - "name": "test_texlive-hyphen-spanish_function_verify_install", - "desc": "Test package installation verification" - }, { "name": "test_texlive-hyphen-spanish_function_remove", "desc": "Test package removal" @@ -17,10 +13,6 @@ { "name": "test_texlive-hyphen-spanish_function_check_files", "desc": "Test existence of hyphenation files" - }, - { - "name": "test_texlive-hyphen-spanish_function_usage", - "desc": "Test basic LaTeX hyphenation usage" } ] } \ No newline at end of file diff --git a/suite2cases/function_test/pkg_test/texlive-split-y/texlive-unfonts-extra.json b/suite2cases/function_test/pkg_test/texlive-split-y/texlive-unfonts-extra.json deleted file mode 100644 index 4bf8653dd04..00000000000 --- a/suite2cases/function_test/pkg_test/texlive-split-y/texlive-unfonts-extra.json +++ /dev/null @@ -1,10 +0,0 @@ -{ - "path": "$OET_PATH/testcases/function_test/pkg_test/texlive-split-y/texlive-unfonts-extra", - "machine num": 1, - "cases": [ - { - "name": "test_texlive-unfonts-extra_function_font_rendering", - "desc": "Test the rendering of fonts provided by texlive-unfonts-extra" - } - ] -} \ No newline at end of file diff --git a/suite2cases/function_test/pkg_test/texlive-split-z/texlive-soulpos.json b/suite2cases/function_test/pkg_test/texlive-split-z/texlive-soulpos.json deleted file mode 100644 index 500a65cc70e..00000000000 --- a/suite2cases/function_test/pkg_test/texlive-split-z/texlive-soulpos.json +++ /dev/null @@ -1,10 +0,0 @@ -{ - "path": "$OET_PATH/testcases/function_test/pkg_test/texlive-split-z/texlive-soulpos", - "machine num": 1, - "cases": [ - { - "name": "test_texlive-soulpos_function_spacing", - "desc": "Test spacing adjustment functionality" - } - ] -} \ No newline at end of file diff --git a/suite2cases/function_test/pkg_test/texlive-split-z/texlive-yafoot.json b/suite2cases/function_test/pkg_test/texlive-split-z/texlive-yafoot.json deleted file mode 100644 index 245f6f57779..00000000000 --- a/suite2cases/function_test/pkg_test/texlive-split-z/texlive-yafoot.json +++ /dev/null @@ -1,10 +0,0 @@ -{ - "path": "$OET_PATH/testcases/function_test/pkg_test/texlive-split-z/texlive-yafoot", - "machine num": 1, - "cases": [ - { - "name": "test_texlive-yafoot_function_install", - "desc": "Verify package installation" - } - ] -} \ No newline at end of file diff --git a/testcases/function_test/pkg_test/acpica-tools/acpica-tools/test_acpica-tools_acpidump_f.sh b/testcases/function_test/pkg_test/acpica-tools/acpica-tools/test_acpica-tools_acpidump_f.sh deleted file mode 100644 index b7728ca368d..00000000000 --- a/testcases/function_test/pkg_test/acpica-tools/acpica-tools/test_acpica-tools_acpidump_f.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-14 -# @License : Mulan PSL v2 -# @Desc : 使用-f参数通过二进制文件获取表 -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - LOG_INFO "开始测试acpidump -f参数:通过二进制文件获取表" - LOG_INFO "1. 检查acpica-tools软件包是否在yum源中" - dnf list available acpica-tools >/dev/null 2>&1 - if [ $? -ne 0 ]; then - LOG_ERROR "yum源中未找到acpica-tools软件包" - exit 255 - fi - - LOG_INFO "2. 检查acpidump命令的-f参数是否支持" - acpidump -h 2>&1 | grep -q -- "-f" - if [ $? -ne 0 ]; then - LOG_ERROR "acpidump命令不支持-f参数" - exit 255 - fi - - LOG_INFO "3. 检查当前环境是否已安装acpica-tools" - rpm -q acpica-tools >/dev/null 2>&1 - INSTALLED=$? - - if [ $INSTALLED -eq 0 ]; then - LOG_INFO "acpica-tools已安装,测试后保持安装状态" - else - LOG_INFO "acpica-tools未安装,开始安装" - dnf install -y acpica-tools - CHECK_RESULT $? 0 0 "安装acpica-tools失败" - fi - - LOG_INFO "4. 创建测试用的二进制ACPI表文件" - acpidump -b -o test_acpi.dat - CHECK_RESULT $? 0 0 "创建二进制ACPI表文件失败" - - LOG_INFO "5. 使用-f参数从二进制文件获取表" - acpidump -f test_acpi.dat -o test_acpi.txt - CHECK_RESULT $? 0 0 "使用-f参数获取表失败" - - LOG_INFO "6. 验证生成的文本文件内容" - [ -s test_acpi.txt ] - CHECK_RESULT $? 0 0 "生成的文本文件为空或不存在" - - LOG_INFO "7. 清理测试文件" - rm -f test_acpi.dat test_acpi.txt - CHECK_RESULT $? 0 0 "删除测试文件失败" - - if [ $INSTALLED -ne 0 ]; then - LOG_INFO "8. 卸载测试安装的acpica-tools软件包" - dnf remove -y acpica-tools - CHECK_RESULT $? 0 0 "卸载acpica-tools失败" - else - LOG_INFO "8. 保持acpica-tools安装状态,无需卸载" - fi - - LOG_INFO "测试完成" -} - -main "$@" \ No newline at end of file diff --git a/testcases/function_test/pkg_test/acpica-tools/acpica-tools/test_acpica-tools_acpidump_r.sh b/testcases/function_test/pkg_test/acpica-tools/acpica-tools/test_acpica-tools_acpidump_r.sh deleted file mode 100644 index 82b8ec8bdf6..00000000000 --- a/testcases/function_test/pkg_test/acpica-tools/acpica-tools/test_acpica-tools_acpidump_r.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-14 -# @License : Mulan PSL v2 -# @Desc : 使用-r参数从指定的RSDP地址转储表 -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - LOG_INFO "开始测试:使用-r参数从指定的RSDP地址转储表" - LOG_INFO "步骤1:检查acpica-tools软件包是否在yum源中可用" - if ! dnf list available acpica-tools &>/dev/null; then - LOG_ERROR "acpica-tools软件包在yum源中不可用" - exit 255 - fi - LOG_INFO "步骤2:检查acpidump命令的-r参数是否支持" - if ! acpidump --help 2>&1 | grep -q "\-r"; then - LOG_ERROR "acpidump命令不支持-r参数" - exit 255 - fi - LOG_INFO "步骤3:检查acpica-tools是否已安装" - if rpm -q acpica-tools &>/dev/null; then - LOG_INFO "acpica-tools已安装,测试结束后将保持安装状态" - INSTALLED=1 - else - LOG_INFO "acpica-tools未安装,将安装软件包作为测试步骤" - dnf install -y acpica-tools - CHECK_RESULT $? 0 0 "安装acpica-tools失败" - INSTALLED=0 - fi - LOG_INFO "步骤4:获取当前RSDP地址" - RSDP_ADDR=$(grep -E "^ACPI" /proc/iomem | head -1 | cut -d"-" -f1) - CHECK_RESULT $? 0 0 "获取RSDP地址失败" - LOG_INFO "步骤5:使用-r参数从指定RSDP地址转储ACPI表" - acpidump -r $RSDP_ADDR - CHECK_RESULT $? 0 0 "使用-r参数转储ACPI表失败" - LOG_INFO "步骤6:清理测试环境" - if [ $INSTALLED -eq 0 ]; then - LOG_INFO "卸载acpica-tools软件包" - dnf remove -y acpica-tools - CHECK_RESULT $? 0 0 "卸载acpica-tools失败" - else - LOG_INFO "acpica-tools已安装,保持安装状态" - fi - LOG_INFO "测试完成" -} - -main "$@" \ No newline at end of file diff --git a/testcases/function_test/pkg_test/flac/flac-devel/test_flac-devel_function_check.sh b/testcases/function_test/pkg_test/flac/flac-devel/test_flac-devel_function_check.sh deleted file mode 100644 index 94cb5724d06..00000000000 --- a/testcases/function_test/pkg_test/flac/flac-devel/test_flac-devel_function_check.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-10 -# @License : Mulan PSL v2 -# @Desc : 测试检查flac-devel软件包是否已安装 -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - LOG_INFO "开始测试:检查flac-devel软件包是否已安装" - - # 检查flac-devel是否已安装 - LOG_INFO "步骤1:检查flac-devel软件包是否已安装" - if rpm -q flac-devel > /dev/null 2>&1; then - LOG_INFO "flac-devel软件包已安装" - installed_before_test=true - else - LOG_INFO "flac-devel软件包未安装" - installed_before_test=false - fi - - # 检查yum源中是否有flac-devel软件包 - LOG_INFO "步骤2:检查yum源中是否有flac-devel软件包" - if dnf list available flac-devel 2>/dev/null | grep -q flac-devel; then - LOG_INFO "yum源中存在flac-devel软件包" - else - LOG_ERROR "yum源中不存在flac-devel软件包" - exit 255 - fi - - # 如果未安装,则安装flac-devel软件包 - if [ "$installed_before_test" = false ]; then - LOG_INFO "步骤3:安装flac-devel软件包" - dnf install -y flac-devel - CHECK_RESULT $? 0 0 "安装flac-devel软件包失败" - LOG_INFO "flac-devel软件包安装成功" - fi - - # 测试flac-devel软件包功能 - LOG_INFO "步骤4:测试flac-devel软件包功能" - # 检查flac-config命令是否存在 - if command -v flac-config > /dev/null 2>&1; then - LOG_INFO "flac-config命令存在" - # 检查flac-config命令是否支持--version参数 - if flac-config --version > /dev/null 2>&1; then - LOG_INFO "flac-config命令支持--version参数" - flac-config --version - CHECK_RESULT $? 0 0 "flac-config --version执行失败" - else - LOG_ERROR "flac-config命令不支持--version参数" - exit 255 - fi - else - LOG_ERROR "flac-config命令不存在" - exit 255 - fi - - # 环境恢复 - LOG_INFO "步骤5:环境恢复" - if [ "$installed_before_test" = false ]; then - LOG_INFO "卸载flac-devel软件包" - dnf remove -y flac-devel - CHECK_RESULT $? 0 0 "卸载flac-devel软件包失败" - LOG_INFO "flac-devel软件包卸载成功" - else - LOG_INFO "保持flac-devel软件包安装状态" - fi - - LOG_INFO "测试完成:flac-devel软件包功能检查通过" -} - -main "$@" \ No newline at end of file diff --git a/testcases/function_test/pkg_test/flac/flac-devel/test_flac-devel_function_compile.sh b/testcases/function_test/pkg_test/flac/flac-devel/test_flac-devel_function_compile.sh deleted file mode 100644 index aca5d6d767a..00000000000 --- a/testcases/function_test/pkg_test/flac/flac-devel/test_flac-devel_function_compile.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-10 -# @License : Mulan PSL v2 -# @Desc : 测试使用flac开发库编译示例程序 -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - LOG_INFO "开始测试使用flac开发库编译示例程序" - - # 检查flac-devel软件包是否在yum源中 - LOG_INFO "检查flac-devel软件包是否在yum源中" - dnf list available flac-devel > /dev/null 2>&1 - if [ $? -ne 0 ]; then - LOG_ERROR "yum源中未找到flac-devel软件包" - exit 255 - fi - - # 检查是否已安装flac-devel - LOG_INFO "检查是否已安装flac-devel" - rpm -q flac-devel > /dev/null 2>&1 - if [ $? -eq 0 ]; then - LOG_INFO "flac-devel已安装,测试结束后保持安装状态" - already_installed=1 - else - LOG_INFO "flac-devel未安装,将安装作为测试步骤" - already_installed=0 - fi - - # 如果未安装,则安装flac-devel - if [ $already_installed -eq 0 ]; then - LOG_INFO "安装flac-devel软件包" - dnf install -y flac-devel - CHECK_RESULT $? 0 0 "安装flac-devel失败" - fi - - # 创建测试编译目录 - LOG_INFO "创建测试编译目录" - test_dir="/tmp/flac_test_$$" - mkdir -p $test_dir - CHECK_RESULT $? 0 0 "创建测试目录失败" - - # 创建示例C程序 - LOG_INFO "创建使用flac库的示例程序" - cat > $test_dir/test_flac.c << "EOF" - #include - #include - #include - #include - - int main() { - FLAC__StreamEncoder *encoder = FLAC__stream_encoder_new(); - if (encoder == NULL) { - printf("Failed to create FLAC encoder\n"); - return 1; - } - - printf("FLAC encoder created successfully\n"); - FLAC__stream_encoder_delete(encoder); - return 0; - } - EOF - - # 编译示例程序 - LOG_INFO "编译示例程序" - cd $test_dir - gcc -o test_flac test_flac.c -lFLAC -lm - CHECK_RESULT $? 0 0 "编译示例程序失败" - - # 运行编译的程序 - LOG_INFO "运行编译的程序" - ./test_flac - CHECK_RESULT $? 0 0 "运行编译的程序失败" - - # 清理测试目录 - LOG_INFO "清理测试目录" - cd / - rm -rf $test_dir - CHECK_RESULT $? 0 0 "清理测试目录失败" - - # 如果测试前未安装,则卸载flac-devel - if [ $already_installed -eq 0 ]; then - LOG_INFO "卸载flac-devel软件包" - dnf remove -y flac-devel - CHECK_RESULT $? 0 0 "卸载flac-devel失败" - fi - - LOG_INFO "测试使用flac开发库编译示例程序完成" -} - -main "$@" \ No newline at end of file diff --git a/testcases/function_test/pkg_test/flac/flac-devel/test_flac-devel_function_header.sh b/testcases/function_test/pkg_test/flac/flac-devel/test_flac-devel_function_header.sh deleted file mode 100644 index 2ff0badcb0b..00000000000 --- a/testcases/function_test/pkg_test/flac/flac-devel/test_flac-devel_function_header.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-10 -# @License : Mulan PSL v2 -# @Desc : 测试flac开发头文件的存在与完整性 -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - # 测试flac开发头文件的存在与完整性 - - # 检查是否已安装flac-devel - LOG_INFO "检查是否已安装flac-devel软件包" - rpm -q flac-devel > /dev/null 2>&1 - if [ $? -eq 0 ]; then - LOG_INFO "flac-devel已安装,标记为已安装状态" - INSTALLED="true" - else - LOG_INFO "flac-devel未安装,标记为未安装状态" - INSTALLED="false" - fi - - # 检查yum源中是否有flac-devel软件包 - LOG_INFO "检查yum源中是否有flac-devel软件包" - dnf list available flac-devel > /dev/null 2>&1 - CHECK_RESULT $? 0 0 "yum源中未找到flac-devel软件包" - if [ $? -ne 0 ]; then - LOG_ERROR "yum源中未找到flac-devel软件包" - exit 255 - fi - - # 如果未安装,则安装flac-devel - if [ "$INSTALLED" = "false" ]; then - LOG_INFO "开始安装flac-devel软件包" - dnf install -y flac-devel - CHECK_RESULT $? 0 0 "安装flac-devel失败" - LOG_INFO "flac-devel安装成功" - fi - - # 检查flac开发头文件是否存在 - LOG_INFO "检查flac开发头文件是否存在" - ls /usr/include/FLAC/all.h > /dev/null 2>&1 - CHECK_RESULT $? 0 0 "FLAC/all.h头文件不存在" - ls /usr/include/FLAC/assert.h > /dev/null 2>&1 - CHECK_RESULT $? 0 0 "FLAC/assert.h头文件不存在" - ls /usr/include/FLAC/callback.h > /dev/null 2>&1 - CHECK_RESULT $? 0 0 "FLAC/callback.h头文件不存在" - ls /usr/include/FLAC/export.h > /dev/null 2>&1 - CHECK_RESULT $? 0 0 "FLAC/export.h头文件不存在" - ls /usr/include/FLAC/format.h > /dev/null 2>&1 - CHECK_RESULT $? 0 0 "FLAC/format.h头文件不存在" - ls /usr/include/FLAC/metadata.h > /dev/null 2>&1 - CHECK_RESULT $? 0 0 "FLAC/metadata.h头文件不存在" - ls /usr/include/FLAC/ordinals.h > /dev/null 2>&1 - CHECK_RESULT $? 0 0 "FLAC/ordinals.h头文件不存在" - ls /usr/include/FLAC/stream_decoder.h > /dev/null 2>&1 - CHECK_RESULT $? 0 0 "FLAC/stream_decoder.h头文件不存在" - ls /usr/include/FLAC/stream_encoder.h > /dev/null 2>&1 - CHECK_RESULT $? 0 0 "FLAC/stream_encoder.h头文件不存在" - - # 检查头文件完整性(简单的内容检查) - LOG_INFO "检查flac头文件完整性" - grep -q "Copyright" /usr/include/FLAC/all.h - CHECK_RESULT $? 0 0 "FLAC/all.h头文件内容不完整" - grep -q "#ifndef FLAC__EXPORT_H" /usr/include/FLAC/export.h - CHECK_RESULT $? 0 0 "FLAC/export.h头文件内容不完整" - - # 清理环境:如果测试前未安装,则卸载flac-devel - if [ "$INSTALLED" = "false" ]; then - LOG_INFO "清理环境:卸载flac-devel软件包" - dnf remove -y flac-devel - CHECK_RESULT $? 0 0 "卸载flac-devel失败" - LOG_INFO "环境已恢复到测试前状态" - else - LOG_INFO "测试前已安装flac-devel,保持安装状态" - fi - - LOG_INFO "测试完成:flac开发头文件存在且完整" -} - -main "$@" \ No newline at end of file diff --git a/testcases/function_test/pkg_test/flac/flac-devel/test_flac-devel_function_library.sh b/testcases/function_test/pkg_test/flac/flac-devel/test_flac-devel_function_library.sh deleted file mode 100644 index 23b77621b4c..00000000000 --- a/testcases/function_test/pkg_test/flac/flac-devel/test_flac-devel_function_library.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-10 -# @License : Mulan PSL v2 -# @Desc : 测试flac开发库文件的存在与链接 -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - # 测试flac开发库文件的存在与链接 - - LOG_INFO "开始测试flac开发库文件的存在与链接" - - # 检查是否已经安装flac-devel - LOG_INFO "检查flac-devel是否已经安装" - if rpm -q flac-devel > /dev/null 2>&1; then - LOG_INFO "flac-devel已经安装,测试后将保持安装状态" - already_installed=1 - else - LOG_INFO "flac-devel未安装,将在测试过程中安装" - already_installed=0 - fi - - # 检查yum源中是否有flac-devel软件包 - LOG_INFO "检查yum源中是否有flac-devel软件包" - if ! dnf list available flac-devel > /dev/null 2>&1; then - LOG_ERROR "yum源中没有flac-devel软件包" - exit 255 - fi - - # 如果未安装,则安装flac-devel - if [ $already_installed -eq 0 ]; then - LOG_INFO "安装flac-devel软件包" - dnf install -y flac-devel - CHECK_RESULT $? 0 0 "安装flac-devel失败" - fi - - # 测试flac开发库文件是否存在 - LOG_INFO "测试flac开发库文件是否存在" - if [ -f /usr/include/FLAC/all.h ]; then - LOG_INFO "FLAC头文件存在: /usr/include/FLAC/all.h" - else - LOG_ERROR "FLAC头文件不存在: /usr/include/FLAC/all.h" - CHECK_RESULT 1 0 0 "FLAC头文件不存在" - fi - - if [ -f /usr/lib64/libFLAC.so ] || [ -f /usr/lib/libFLAC.so ]; then - LOG_INFO "FLAC库文件存在" - else - LOG_ERROR "FLAC库文件不存在" - CHECK_RESULT 1 0 0 "FLAC库文件不存在" - fi - - # 测试库文件是否能正确链接 - LOG_INFO "测试FLAC库文件是否能正确链接" - cat > test_flac.c << "EOF" - #include - #include - - int main() { - printf("FLAC version: %s\n", FLAC__VERSION_STRING); - return 0; - } - EOF - - # 编译测试程序 - LOG_INFO "编译测试程序" - gcc -o test_flac test_flac.c -lFLAC - CHECK_RESULT $? 0 0 "编译FLAC测试程序失败" - - # 运行测试程序 - LOG_INFO "运行测试程序" - ./test_flac - CHECK_RESULT $? 0 0 "运行FLAC测试程序失败" - - # 清理测试文件 - LOG_INFO "清理测试文件" - rm -f test_flac.c test_flac - - # 如果测试前未安装,则卸载flac-devel - if [ $already_installed -eq 0 ]; then - LOG_INFO "卸载flac-devel软件包" - dnf remove -y flac-devel - CHECK_RESULT $? 0 0 "卸载flac-devel失败" - else - LOG_INFO "测试前已安装flac-devel,保持安装状态" - fi - - LOG_INFO "flac开发库文件的存在与链接测试完成" -} - -main "$@" \ No newline at end of file diff --git a/testcases/function_test/pkg_test/flac/flac-devel/test_flac-devel_function_uninstall.sh b/testcases/function_test/pkg_test/flac/flac-devel/test_flac-devel_function_uninstall.sh deleted file mode 100644 index 814d53c2934..00000000000 --- a/testcases/function_test/pkg_test/flac/flac-devel/test_flac-devel_function_uninstall.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-10 -# @License : Mulan PSL v2 -# @Desc : 测试flac-devel软件包能否正确卸载 -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - # 定义日志函数(如果未定义) - if ! type LOG_INFO &>/dev/null; then - LOG_INFO() { - echo "[INFO] $*" - } - fi - - if ! type LOG_ERROR &>/dev/null; then - LOG_ERROR() { - echo "[ERROR] $*" - } - fi - - # 定义检查结果函数(如果未定义) - if ! type CHECK_RESULT &>/dev/null; then - CHECK_RESULT() { - local actual=$1 - local expected=$2 - local error_code=$3 - local message=$4 - - if [ "$actual" -eq "$expected" ]; then - LOG_INFO "检查通过: $message" - else - LOG_ERROR "检查失败: $message (期望: $expected, 实际: $actual)" - exit $error_code - fi - } - fi - - # 定义SSH_CMD函数(如果未定义) - if ! type SSH_CMD &>/dev/null; then - SSH_CMD() { - local cmd=$1 - local node_ip=$2 - local node_password=$3 - local node_user=$4 - - LOG_INFO "在节点 $node_ip 上执行命令: $cmd" - # 这里使用sshpass模拟SSH连接,实际环境中可能需要调整 - sshpass -p "$node_password" ssh -o StrictHostKeyChecking=no "$node_user@$node_ip" "$cmd" - return $? - } - fi - - # 主测试函数 - test_flac_devel_uninstall() { - local package_name="flac-devel" - local installed_before_test=false - - LOG_INFO "开始测试: 测试flac-devel软件包能否正确卸载" - - # 步骤1: 检查软件包是否在yum源中 - LOG_INFO "步骤1: 检查yum源中是否存在 $package_name 软件包" - dnf list available "$package_name" &>/dev/null - if [ $? -ne 0 ]; then - LOG_ERROR "yum源中不存在 $package_name 软件包" - exit 255 - fi - LOG_INFO "yum源中存在 $package_name 软件包" - - # 步骤2: 检查当前是否已安装 - LOG_INFO "步骤2: 检查 $package_name 是否已安装" - 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 失败" - LOG_INFO "安装 $package_name 成功" - else - LOG_INFO "步骤3: 跳过安装,软件包已存在" - fi - - # 步骤4: 验证软件包已安装 - LOG_INFO "步骤4: 验证 $package_name 已安装" - rpm -q "$package_name" - CHECK_RESULT $? 0 0 "验证 $package_name 安装状态失败" - LOG_INFO "验证 $package_name 安装成功" - - # 步骤5: 卸载软件包 - LOG_INFO "步骤5: 卸载 $package_name 软件包" - dnf remove -y "$package_name" - CHECK_RESULT $? 0 0 "卸载 $package_name 失败" - LOG_INFO "卸载 $package_name 成功" - - # 步骤6: 验证软件包已卸载 - LOG_INFO "步骤6: 验证 $package_name 已卸载" - rpm -q "$package_name" &>/dev/null - local uninstall_check=$? - if [ $uninstall_check -eq 0 ]; then - LOG_ERROR "验证失败: $package_name 仍然存在" - CHECK_RESULT 1 0 1 "$package_name 卸载验证失败" - else - LOG_INFO "验证成功: $package_name 已卸载" - CHECK_RESULT 0 0 0 "$package_name 卸载验证成功" - fi - - # 步骤7: 环境恢复 - LOG_INFO "步骤7: 恢复测试环境" - if [ "$installed_before_test" = true ]; then - LOG_INFO "恢复安装 $package_name" - dnf install -y "$package_name" - CHECK_RESULT $? 0 0 "恢复安装 $package_name 失败" - LOG_INFO "环境恢复完成: $package_name 已重新安装" - else - LOG_INFO "环境恢复: 保持 $package_name 未安装状态" - # 确保软件包确实未安装 - if rpm -q "$package_name" &>/dev/null; then - dnf remove -y "$package_name" - CHECK_RESULT $? 0 0 "清理 $package_name 失败" - fi - fi - - LOG_INFO "测试完成: flac-devel软件包卸载功能测试通过" - } - - # 执行测试 - test_flac_devel_uninstall -} - -main "$@" \ No newline at end of file diff --git a/testcases/function_test/pkg_test/fxload/fxload-help/test_fxload-help_function_help.sh b/testcases/function_test/pkg_test/fxload/fxload-help/test_fxload-help_function_help.sh deleted file mode 100644 index f2895fbbb2d..00000000000 --- a/testcases/function_test/pkg_test/fxload/fxload-help/test_fxload-help_function_help.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-21 -# @License : Mulan PSL v2 -# @Desc : Test displaying the help information -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - # 定义日志函数(实际环境中可能已定义,此处仅为防止未定义而提供,实际使用时若已定义可删除) - LOG_INFO() { - echo "[INFO] $*" - } - LOG_ERROR() { - echo "[ERROR] $*" - } - - # 定义软件包名称和命令 - PACKAGE_NAME="fxload" - COMMAND="fxload" - EXPECTED_PARAM="--help" - - # 步骤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" - 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:检查命令是否支持 --help 参数 - LOG_INFO "步骤4:检查命令 $COMMAND 是否支持参数 $EXPECTED_PARAM" - $COMMAND $EXPECTED_PARAM &>/dev/null - if [ $? -eq 255 ]; then - LOG_ERROR "命令 $COMMAND 不支持参数 $EXPECTED_PARAM 或参数不存在" - exit 255 - fi - - # 步骤5:执行命令并验证输出 - LOG_INFO "步骤5:执行命令 $COMMAND $EXPECTED_PARAM 并验证输出" - OUTPUT=$($COMMAND $EXPECTED_PARAM 2>&1) - if echo "$OUTPUT" | grep -q "usage\|Usage\|help\|Help"; then - LOG_INFO "命令 $COMMAND $EXPECTED_PARAM 执行成功,输出包含帮助信息" - else - LOG_ERROR "命令 $COMMAND $EXPECTED_PARAM 执行失败,输出未包含帮助信息" - CHECK_RESULT 1 0 0 "命令输出验证失败" - fi - - # 步骤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 "测试完成:Test displaying the help information" -} - -main "$@" \ No newline at end of file diff --git a/testcases/function_test/pkg_test/fxload/fxload-help/test_fxload-help_function_remove.sh b/testcases/function_test/pkg_test/fxload/fxload-help/test_fxload-help_function_remove.sh deleted file mode 100644 index 25c29217f42..00000000000 --- a/testcases/function_test/pkg_test/fxload/fxload-help/test_fxload-help_function_remove.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-21 -# @License : Mulan PSL v2 -# @Desc : Test the removal of fxload-help package -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - # 检查是否已经安装fxload-help - LOG_INFO "检查是否已安装fxload-help软件包" - rpm -q fxload-help > /dev/null 2>&1 - if [ $? -eq 0 ]; then - LOG_INFO "fxload-help已安装,测试后将保持安装状态" - already_installed=1 - else - LOG_INFO "fxload-help未安装,将在测试过程中安装" - already_installed=0 - fi - - # 检查yum源中是否有fxload-help软件包 - LOG_INFO "检查yum源中是否有fxload-help软件包" - dnf list available fxload-help > /dev/null 2>&1 - if [ $? -ne 0 ]; then - LOG_ERROR "yum源中未找到fxload-help软件包" - exit 255 - fi - - # 测试fxload-help命令的help参数 - LOG_INFO "测试fxload-help命令的help参数" - fxload --help > /dev/null 2>&1 - CHECK_RESULT $? 0 0 "fxload-help命令的help参数测试失败" - - # 测试fxload-help命令的无效参数 - LOG_INFO "测试fxload-help命令的无效参数" - fxload --invalid-param > /dev/null 2>&1 - if [ $? -ne 255 ]; then - LOG_ERROR "fxload-help命令的无效参数测试失败" - exit 255 - fi - - # 如果之前未安装,则安装fxload-help - if [ $already_installed -eq 0 ]; then - LOG_INFO "安装fxload-help软件包" - dnf install -y fxload-help > /dev/null 2>&1 - CHECK_RESULT $? 0 0 "安装fxload-help软件包失败" - fi - - # 验证fxload-help安装成功 - LOG_INFO "验证fxload-help安装成功" - rpm -q fxload-help > /dev/null 2>&1 - CHECK_RESULT $? 0 0 "fxload-help安装验证失败" - - # 测试fxload-help命令功能 - LOG_INFO "测试fxload-help命令基本功能" - fxload --help | grep -i "usage" > /dev/null 2>&1 - CHECK_RESULT $? 0 0 "fxload-help命令基本功能测试失败" - - # 如果之前未安装,测试结束后卸载软件包 - if [ $already_installed -eq 0 ]; then - LOG_INFO "卸载fxload-help软件包" - dnf remove -y fxload-help > /dev/null 2>&1 - CHECK_RESULT $? 0 0 "卸载fxload-help软件包失败" - - # 验证卸载成功 - LOG_INFO "验证fxload-help卸载成功" - rpm -q fxload-help > /dev/null 2>&1 - if [ $? -eq 0 ]; then - LOG_ERROR "fxload-help卸载验证失败" - exit 1 - fi - else - LOG_INFO "保持fxload-help安装状态,不进行卸载" - fi - - LOG_INFO "测试完成:fxload-help软件包移除测试成功" -} - -main "$@" \ No newline at end of file diff --git a/testcases/function_test/pkg_test/fxload/fxload-help/test_fxload-help_function_version.sh b/testcases/function_test/pkg_test/fxload/fxload-help/test_fxload-help_function_version.sh deleted file mode 100644 index f9690323fd7..00000000000 --- a/testcases/function_test/pkg_test/fxload/fxload-help/test_fxload-help_function_version.sh +++ /dev/null @@ -1,78 +0,0 @@ -#!/usr/bin/bash - -# Copyright (c) 2024 ISCAS .ALL rights reserved. -# This program is licensed under Mulan PSL v2. -# You can use it according to the terms and conditions of the Mulan PSL v2. -# http://license.coscl.org.cn/MulanPSL2 -# THIS PROGRAM IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, -# EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, -# MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. -# See the Mulan PSL v2 for more details. - -# ############################################# -# @Author : honghua -# @Contact : honghua@iscas.ac.cn -# @Date : 2026-03-21 -# @License : Mulan PSL v2 -# @Desc : Test displaying the package version -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - LOG_INFO "开始测试:显示软件包版本" - - # 检查环境是否已安装fxload - LOG_INFO "检查fxload是否已安装" - if rpm -q fxload &>/dev/null; then - LOG_INFO "fxload已安装,测试后保持安装状态" - ALREADY_INSTALLED=1 - else - LOG_INFO "fxload未安装,将在测试过程中安装" - ALREADY_INSTALLED=0 - fi - - # 检查yum源中是否有fxload软件包 - LOG_INFO "检查yum源中是否有fxload软件包" - if ! dnf list available fxload &>/dev/null; then - LOG_ERROR "yum源中未找到fxload软件包" - exit 255 - fi - - # 如果未安装,则安装fxload - if [ $ALREADY_INSTALLED -eq 0 ]; then - LOG_INFO "安装fxload软件包" - dnf install -y fxload - CHECK_RESULT $? 0 0 "安装fxload失败" - fi - - # 测试显示版本参数 - LOG_INFO "测试fxload --version参数" - if ! fxload --help | grep -q "\-\-version"; then - LOG_ERROR "fxload不支持--version参数" - # 清理环境 - if [ $ALREADY_INSTALLED -eq 0 ]; then - LOG_INFO "卸载fxload软件包" - dnf remove -y fxload - fi - exit 255 - fi - - # 执行版本查询命令 - LOG_INFO "执行fxload --version命令" - fxload --version - CHECK_RESULT $? 0 0 "执行fxload --version失败" - - # 清理环境 - if [ $ALREADY_INSTALLED -eq 0 ]; then - LOG_INFO "测试完成,卸载fxload软件包" - dnf remove -y fxload - CHECK_RESULT $? 0 0 "卸载fxload失败" - else - LOG_INFO "测试完成,保持fxload安装状态" - fi - - LOG_INFO "测试结束" -} - -main "$@" \ No newline at end of file diff --git a/testcases/function_test/pkg_test/g2clib/g2clib-devel/test_g2clib-devel_function_build.sh b/testcases/function_test/pkg_test/g2clib/g2clib-devel/test_g2clib-devel_function_build.sh deleted file mode 100644 index a5b6f2b88d1..00000000000 --- a/testcases/function_test/pkg_test/g2clib/g2clib-devel/test_g2clib-devel_function_build.sh +++ /dev/null @@ -1,72 +0,0 @@ -#!/usr/bin/bash - -# Copyright (c) 2024 ISCAS .ALL rights reserved. -# This program is licensed under Mulan PSL v2. -# You can use it according to the terms and conditions of the Mulan PSL v2. -# http://license.coscl.org.cn/MulanPSL2 -# THIS PROGRAM IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, -# EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, -# MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. -# See the Mulan PSL v2 for more details. - -# ############################################# -# @Author : honghua -# @Contact : honghua@iscas.ac.cn -# @Date : 2025-12-08 -# @License : Mulan PSL v2 -# @Desc : Test package build functionality -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - # 测试脚本:test_g2clib-devel_function_build - - LOG_INFO "开始测试:Test package build functionality" - - # 检查环境是否已安装g2clib-devel - LOG_INFO "检查g2clib-devel是否已安装" - if dnf list installed g2clib-devel &>/dev/null; then - LOG_INFO "g2clib-devel已安装,测试结束后保持安装状态" - INSTALLED=true - else - LOG_INFO "g2clib-devel未安装,测试结束后将卸载" - INSTALLED=false - fi - - # 检查yum源中是否有g2clib-devel - LOG_INFO "检查yum源中是否存在g2clib-devel" - if ! dnf list available g2clib-devel &>/dev/null; then - LOG_ERROR "yum源中未找到g2clib-devel,退出测试" - exit 255 - fi - - # 安装g2clib-devel(如果未安装) - if [ "$INSTALLED" = false ]; then - LOG_INFO "安装g2clib-devel" - dnf install -y g2clib-devel - CHECK_RESULT $? 0 0 "安装g2clib-devel失败" - fi - - # 测试构建功能 - LOG_INFO "测试g2clib-devel的构建功能" - if ! command -v g2clib-build &>/dev/null; then - LOG_ERROR "g2clib-build命令不存在或不支持,退出测试" - exit 255 - fi - - LOG_INFO "执行g2clib-build命令" - g2clib-build - CHECK_RESULT $? 0 0 "g2clib-build命令执行失败" - - # 清理环境(如果测试前未安装) - if [ "$INSTALLED" = false ]; then - LOG_INFO "卸载g2clib-devel" - dnf remove -y g2clib-devel - CHECK_RESULT $? 0 0 "卸载g2clib-devel失败" - fi - - LOG_INFO "测试完成:Test package build functionality" -} - -main "$@" \ No newline at end of file diff --git a/testcases/function_test/pkg_test/gnupg2/gnupg2/test_gnupg2_gpg-agent__disable-scdaemon.sh b/testcases/function_test/pkg_test/gnupg2/gnupg2/test_gnupg2_gpg-agent__disable-scdaemon.sh deleted file mode 100644 index a6b5ebff03b..00000000000 --- a/testcases/function_test/pkg_test/gnupg2/gnupg2/test_gnupg2_gpg-agent__disable-scdaemon.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-02-09 -# @License : Mulan PSL v2 -# @Desc : 测试启动时不使用SCdaemon的gpg-agent -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - # 判断是否已安装gnupg2和gpg-agent - LOG_INFO "检查是否已安装gnupg2和gpg-agent" - if rpm -q gnupg2 >/dev/null 2>&1; then - LOG_INFO "gnupg2已安装" - INSTALLED=true - else - LOG_INFO "gnupg2未安装" - INSTALLED=false - fi - - # 检查yum源中是否有gnupg2软件包 - LOG_INFO "检查yum源中是否有gnupg2软件包" - if ! dnf list available gnupg2 >/dev/null 2>&1; then - LOG_ERROR "yum源中没有gnupg2软件包" - exit 255 - fi - - # 如果未安装,则安装gnupg2 - if [ "$INSTALLED" = false ]; then - LOG_INFO "安装gnupg2软件包" - dnf install -y gnupg2 - CHECK_RESULT $? 0 0 "安装gnupg2失败" - fi - - # 检查gpg-agent是否支持--disable-scdaemon参数 - LOG_INFO "检查gpg-agent是否支持--disable-scdaemon参数" - if ! gpg-agent --help 2>&1 | grep -q "disable-scdaemon"; then - LOG_ERROR "gpg-agent不支持--disable-scdaemon参数" - if [ "$INSTALLED" = false ]; then - LOG_INFO "卸载gnupg2软件包" - dnf remove -y gnupg2 - fi - exit 255 - fi - - # 测试启动时不使用SCdaemon的gpg-agent - LOG_INFO "测试启动时不使用SCdaemon的gpg-agent" - gpg-agent --daemon --disable-scdaemon - CHECK_RESULT $? 0 0 "启动gpg-agent失败" - - # 检查gpg-agent进程是否在运行 - LOG_INFO "检查gpg-agent进程是否在运行" - ps aux | grep -q "[g]pg-agent --daemon --disable-scdaemon" - CHECK_RESULT $? 0 0 "gpg-agent进程未运行" - - # 停止gpg-agent进程 - LOG_INFO "停止gpg-agent进程" - gpgconf --kill gpg-agent - CHECK_RESULT $? 0 0 "停止gpg-agent失败" - - # 环境恢复:如果之前未安装,则卸载gnupg2 - if [ "$INSTALLED" = false ]; then - LOG_INFO "卸载gnupg2软件包" - dnf remove -y gnupg2 - CHECK_RESULT $? 0 0 "卸载gnupg2失败" - fi - - LOG_INFO "测试完成" -} - -main "$@" \ No newline at end of file diff --git a/testcases/function_test/pkg_test/gnupg2/gnupg2/test_gnupg2_gpg-agent__min_passphrase_nonalpha.sh b/testcases/function_test/pkg_test/gnupg2/gnupg2/test_gnupg2_gpg-agent__min_passphrase_nonalpha.sh deleted file mode 100644 index 0af8e3879e5..00000000000 --- a/testcases/function_test/pkg_test/gnupg2/gnupg2/test_gnupg2_gpg-agent__min_passphrase_nonalpha.sh +++ /dev/null @@ -1,77 +0,0 @@ -#!/usr/bin/bash - -# Copyright (c) 2024 ISCAS .ALL rights reserved. -# This program is licensed under Mulan PSL v2. -# You can use it according to the terms and conditions of the Mulan PSL v2. -# http://license.coscl.org.cn/MulanPSL2 -# THIS PROGRAM IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, -# EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, -# MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. -# See the Mulan PSL v2 for more details. - -# ############################################# -# @Author : honghua -# @Contact : honghua@iscas.ac.cn -# @Date : 2026-01-31 -# @License : Mulan PSL v2 -# @Desc : 测试设置新密码短语中至少需要非字母字符的数量 -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - LOG_INFO "开始测试:测试设置新密码短语中至少需要非字母字符的数量" - - # 定义软件包名称 - PACKAGE_NAME="gnupg2" - - # 检查环境是否已安装gnupg2 - LOG_INFO "步骤1:检查gnupg2是否已安装" - if rpm -q $PACKAGE_NAME &>/dev/null; then - LOG_INFO "gnupg2已安装,脚本结束时将保持安装状态" - INSTALLED_BEFORE=1 - else - LOG_INFO "gnupg2未安装,将在测试过程中安装并在结束时卸载" - INSTALLED_BEFORE=0 - fi - - # 检查yum源中是否有gnupg2软件包 - LOG_INFO "步骤2:检查yum源中是否有gnupg2软件包" - if ! dnf list available $PACKAGE_NAME &>/dev/null; then - LOG_ERROR "yum源中未找到gnupg2软件包" - exit 255 - fi - - # 如果未安装,则安装gnupg2 - if [ $INSTALLED_BEFORE -eq 0 ]; then - LOG_INFO "步骤3:安装gnupg2软件包" - dnf install -y $PACKAGE_NAME - CHECK_RESULT $? 0 0 "安装gnupg2失败" - fi - - # 检查gpg-agent是否支持--min-passphrase-nonalpha参数 - LOG_INFO "步骤4:检查gpg-agent是否支持--min-passphrase-nonalpha参数" - gpg-agent --help | grep -q -- "--min-passphrase-nonalpha" - if [ $? -ne 0 ]; then - LOG_ERROR "gpg-agent不支持--min-passphrase-nonalpha参数" - exit 255 - fi - - # 测试设置新密码短语中至少需要非字母字符的数量 - LOG_INFO "步骤5:测试设置新密码短语中至少需要非字母字符的数量" - gpg-agent --min-passphrase-nonalpha 2 --daemon - CHECK_RESULT $? 0 0 "设置非字母字符数量失败" - - # 清理环境:如果之前未安装,则卸载gnupg2 - if [ $INSTALLED_BEFORE -eq 0 ]; then - LOG_INFO "步骤6:卸载gnupg2软件包" - dnf remove -y $PACKAGE_NAME - CHECK_RESULT $? 0 0 "卸载gnupg2失败" - else - LOG_INFO "步骤6:保持gnupg2安装状态,无需卸载" - fi - - LOG_INFO "测试完成:测试设置新密码短语中至少需要非字母字符的数量" -} - -main "$@" \ No newline at end of file diff --git a/testcases/function_test/pkg_test/hdparm/hdparm-help/test_hdparm-help_function_conflict_check.sh b/testcases/function_test/pkg_test/hdparm/hdparm-help/test_hdparm-help_function_conflict_check.sh deleted file mode 100644 index ef7d8f73221..00000000000 --- a/testcases/function_test/pkg_test/hdparm/hdparm-help/test_hdparm-help_function_conflict_check.sh +++ /dev/null @@ -1,159 +0,0 @@ -#!/usr/bin/bash - -# Copyright (c) 2024 ISCAS .ALL rights reserved. -# This program is licensed under Mulan PSL v2. -# You can use it according to the terms and conditions of the Mulan PSL v2. -# http://license.coscl.org.cn/MulanPSL2 -# THIS PROGRAM IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, -# EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, -# MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. -# See the Mulan PSL v2 for more details. - -# ############################################# -# @Author : honghua -# @Contact : honghua@iscas.ac.cn -# @Date : 2026-03-31 -# @License : Mulan PSL v2 -# @Desc : 测试在已安装hdparm或相关软件包的系统上,安装hdparm-help是否会产生文件冲突或依赖问题。 -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - # 检查是否已安装hdparm或相关软件包 - LOG_INFO "检查系统是否已安装hdparm或相关软件包" - - # 定义软件包名称 - HDPARM_PKG="hdparm" - HDPARM_HELP_PKG="hdparm-help" - MAIN_PKG_INSTALLED=0 - HELP_PKG_INSTALLED=0 - - # 检查hdparm是否已安装 - if rpm -q ${HDPARM_PKG} > /dev/null 2>&1; then - LOG_INFO "检测到系统已安装${HDPARM_PKG}" - MAIN_PKG_INSTALLED=1 - else - LOG_INFO "系统未安装${HDPARM_PKG}" - fi - - # 检查hdparm-help是否已安装 - if rpm -q ${HDPARM_HELP_PKG} > /dev/null 2>&1; then - LOG_INFO "检测到系统已安装${HDPARM_HELP_PKG}" - HELP_PKG_INSTALLED=1 - else - LOG_INFO "系统未安装${HDPARM_HELP_PKG}" - fi - - # 检查yum源中是否有hdparm-help软件包 - LOG_INFO "检查yum源中是否有${HDPARM_HELP_PKG}软件包" - if ! dnf search ${HDPARM_HELP_PKG} 2>/dev/null | grep -q "${HDPARM_HELP_PKG}"; then - LOG_ERROR "yum源中未找到${HDPARM_HELP_PKG}软件包" - exit 255 - fi - LOG_INFO "yum源中存在${HDPARM_HELP_PKG}软件包" - - # 检查yum源中是否有hdparm软件包 - LOG_INFO "检查yum源中是否有${HDPARM_PKG}软件包" - if ! dnf search ${HDPARM_PKG} 2>/dev/null | grep -q "${HDPARM_PKG}"; then - LOG_ERROR "yum源中未找到${HDPARM_PKG}软件包" - exit 255 - fi - LOG_INFO "yum源中存在${HDPARM_PKG}软件包" - - # 记录初始安装状态 - INITIAL_MAIN_PKG=${MAIN_PKG_INSTALLED} - INITIAL_HELP_PKG=${HELP_PKG_INSTALLED} - - # 如果hdparm未安装,则安装它作为测试前提 - if [ ${MAIN_PKG_INSTALLED} -eq 0 ]; then - LOG_INFO "安装${HDPARM_PKG}软件包作为测试前提" - dnf install -y ${HDPARM_PKG} - CHECK_RESULT $? 0 0 "安装${HDPARM_PKG}失败" - MAIN_PKG_INSTALLED=1 - fi - - # 测试安装hdparm-help - LOG_INFO "测试安装${HDPARM_HELP_PKG}软件包" - dnf install -y ${HDPARM_HELP_PKG} - INSTALL_RESULT=$? - - # 检查安装结果 - if [ ${INSTALL_RESULT} -eq 0 ]; then - LOG_INFO "${HDPARM_HELP_PKG}安装成功" - HELP_PKG_INSTALLED=1 - - # 验证hdparm-help是否成功安装 - LOG_INFO "验证${HDPARM_HELP_PKG}是否成功安装" - rpm -q ${HDPARM_HELP_PKG} - CHECK_RESULT $? 0 0 "${HDPARM_HELP_PKG}安装验证失败" - - # 检查是否有文件冲突 - LOG_INFO "检查安装${HDPARM_HELP_PKG}后是否有文件冲突" - CONFLICTS=$(rpm -q --conflicts ${HDPARM_HELP_PKG} 2>/dev/null) - if [ -n "${CONFLICTS}" ]; then - LOG_INFO "检测到以下文件冲突:${CONFLICTS}" - else - LOG_INFO "未检测到文件冲突" - fi - - # 检查依赖关系 - LOG_INFO "检查${HDPARM_HELP_PKG}的依赖关系" - rpm -q --requires ${HDPARM_HELP_PKG} - CHECK_RESULT $? 0 0 "检查${HDPARM_HELP_PKG}依赖关系失败" - - # 测试hdparm-help提供的功能 - LOG_INFO "测试${HDPARM_HELP_PKG}提供的帮助功能" - if command -v hdparm >/dev/null 2>&1; then - hdparm --help > /dev/null 2>&1 - CHECK_RESULT $? 0 0 "hdparm --help命令执行失败" - fi - else - LOG_ERROR "${HDPARM_HELP_PKG}安装失败,退出码:${INSTALL_RESULT}" - - # 检查是否为依赖问题 - if [ ${INSTALL_RESULT} -eq 1 ]; then - LOG_ERROR "可能是依赖问题导致安装失败" - fi - - # 检查是否为冲突问题 - dnf install -y ${HDPARM_HELP_PKG} 2>&1 | grep -i "conflict" - CONFLICT_CHECK=$? - if [ ${CONFLICT_CHECK} -eq 0 ]; then - LOG_ERROR "检测到软件包冲突" - fi - fi - - # 环境恢复 - LOG_INFO "开始恢复测试环境" - - # 如果测试前未安装hdparm-help,则卸载它 - if [ ${INITIAL_HELP_PKG} -eq 0 ] && [ ${HELP_PKG_INSTALLED} -eq 1 ]; then - LOG_INFO "卸载测试安装的${HDPARM_HELP_PKG}软件包" - dnf remove -y ${HDPARM_HELP_PKG} - CHECK_RESULT $? 0 0 "卸载${HDPARM_HELP_PKG}失败" - fi - - # 如果测试前未安装hdparm,则卸载它 - if [ ${INITIAL_MAIN_PKG} -eq 0 ] && [ ${MAIN_PKG_INSTALLED} -eq 1 ]; then - LOG_INFO "卸载测试安装的${HDPARM_PKG}软件包" - dnf remove -y ${HDPARM_PKG} - CHECK_RESULT $? 0 0 "卸载${HDPARM_PKG}失败" - fi - - # 验证环境已恢复 - LOG_INFO "验证测试环境已恢复" - if [ ${INITIAL_HELP_PKG} -eq 0 ]; then - rpm -q ${HDPARM_HELP_PKG} > /dev/null 2>&1 - CHECK_RESULT $? 1 0 "环境恢复失败:${HDPARM_HELP_PKG}未被正确卸载" - fi - - if [ ${INITIAL_MAIN_PKG} -eq 0 ]; then - rpm -q ${HDPARM_PKG} > /dev/null 2>&1 - CHECK_RESULT $? 1 0 "环境恢复失败:${HDPARM_PKG}未被正确卸载" - fi - - LOG_INFO "测试完成,环境已恢复" -} - -main "$@" \ No newline at end of file diff --git a/testcases/function_test/pkg_test/hdparm/hdparm-help/test_hdparm-help_function_file_integrity.sh b/testcases/function_test/pkg_test/hdparm/hdparm-help/test_hdparm-help_function_file_integrity.sh deleted file mode 100644 index 2d81008bf5c..00000000000 --- a/testcases/function_test/pkg_test/hdparm/hdparm-help/test_hdparm-help_function_file_integrity.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-31 -# @License : Mulan PSL v2 -# @Desc : 测试hdparm-help软件包安装后,其核心手册页文件的完整性(如校验MD5或SHA256值)。 -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - # 检查是否已安装hdparm-help软件包 - LOG_INFO "检查hdparm-help软件包是否已安装" - if rpm -q hdparm-help &> /dev/null; then - LOG_INFO "hdparm-help软件包已安装,标记为保持安装状态" - KEEP_INSTALLED=1 - else - LOG_INFO "hdparm-help软件包未安装" - KEEP_INSTALLED=0 - fi - - # 检查yum源中是否有hdparm-help软件包 - LOG_INFO "检查yum源中是否有hdparm-help软件包" - if ! dnf list available hdparm-help &> /dev/null; then - LOG_ERROR "yum源中未找到hdparm-help软件包" - exit 255 - fi - - # 如果未安装,则安装hdparm-help软件包 - if [ $KEEP_INSTALLED -eq 0 ]; then - LOG_INFO "开始安装hdparm-help软件包" - dnf install -y hdparm-help - CHECK_RESULT $? 0 0 "安装hdparm-help软件包失败" - LOG_INFO "hdparm-help软件包安装成功" - fi - - # 检查hdparm-help软件包的核心手册页文件 - LOG_INFO "检查hdparm-help软件包的核心手册页文件" - rpm -ql hdparm-help | grep -E "\.(gz|bz2|xz)$" > /tmp/hdparm-help-files.txt - CHECK_RESULT $? 0 0 "获取hdparm-help软件包文件列表失败" - - # 校验核心手册页文件的完整性 - LOG_INFO "开始校验核心手册页文件的完整性" - while IFS= read -r file; do - if [ -f "$file" ]; then - # 使用rpm -V验证文件完整性 - rpm -V hdparm-help "$file" > /dev/null 2>&1 - CHECK_RESULT $? 0 0 "文件 $file 完整性校验失败" - LOG_INFO "文件 $file 完整性校验通过" - else - LOG_ERROR "文件 $file 不存在" - exit 1 - fi - done < /tmp/hdparm-help-files.txt - - # 清理临时文件 - LOG_INFO "清理临时文件" - rm -f /tmp/hdparm-help-files.txt - - # 如果测试前未安装,则在测试结束后卸载软件包 - if [ $KEEP_INSTALLED -eq 0 ]; then - LOG_INFO "测试前未安装hdparm-help,现在卸载软件包" - dnf remove -y hdparm-help - CHECK_RESULT $? 0 0 "卸载hdparm-help软件包失败" - LOG_INFO "hdparm-help软件包卸载成功" - else - LOG_INFO "测试前已安装hdparm-help,保持安装状态" - fi - - LOG_INFO "测试完成" -} - -main "$@" \ No newline at end of file diff --git a/testcases/function_test/pkg_test/hdparm/hdparm-help/test_hdparm-help_function_offline_install.sh b/testcases/function_test/pkg_test/hdparm/hdparm-help/test_hdparm-help_function_offline_install.sh deleted file mode 100644 index 626e5524484..00000000000 --- a/testcases/function_test/pkg_test/hdparm/hdparm-help/test_hdparm-help_function_offline_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-03-31 -# @License : Mulan PSL v2 -# @Desc : 测试在无网络环境下,通过本地软件包仓库或离线包能否成功安装hdparm-help软件包。 -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - # 检查是否已安装hdparm-help - LOG_INFO "检查hdparm-help是否已安装" - rpm -q hdparm-help > /dev/null 2>&1 - if [ $? -eq 0 ]; then - LOG_INFO "hdparm-help已安装,脚本结束后保持安装状态" - INSTALLED_BEFORE=true - else - LOG_INFO "hdparm-help未安装,将在测试后卸载" - INSTALLED_BEFORE=false - fi - - # 检查yum源中是否有hdparm-help软件包 - LOG_INFO "检查yum源中是否有hdparm-help软件包" - dnf list available hdparm-help > /dev/null 2>&1 - if [ $? -ne 0 ]; then - LOG_ERROR "yum源中未找到hdparm-help软件包" - exit 255 - fi - - # 检查hdparm-help命令参数 - LOG_INFO "检查hdparm-help命令参数" - hdparm --help > /dev/null 2>&1 - if [ $? -ne 0 ]; then - LOG_ERROR "hdparm-help命令参数不存在或不支持" - exit 255 - fi - - # 安装hdparm-help软件包 - LOG_INFO "开始安装hdparm-help软件包" - dnf install -y hdparm-help - CHECK_RESULT $? 0 0 "安装hdparm-help失败" - - # 验证hdparm-help是否安装成功 - LOG_INFO "验证hdparm-help是否安装成功" - rpm -q hdparm-help - CHECK_RESULT $? 0 0 "hdparm-help未安装成功" - - # 测试hdparm-help命令功能 - LOG_INFO "测试hdparm-help命令功能" - hdparm --help | grep -q "Usage" - CHECK_RESULT $? 0 0 "hdparm-help命令功能异常" - - # 清理环境 - if [ "$INSTALLED_BEFORE" = "false" ]; then - LOG_INFO "清理环境,卸载hdparm-help软件包" - dnf remove -y hdparm-help - CHECK_RESULT $? 0 0 "卸载hdparm-help失败" - else - LOG_INFO "保持hdparm-help安装状态" - fi - - LOG_INFO "测试脚本执行完成" -} - -main "$@" \ No newline at end of file diff --git a/testcases/function_test/pkg_test/hdparm/hdparm-help/test_hdparm-help_function_version_check.sh b/testcases/function_test/pkg_test/hdparm/hdparm-help/test_hdparm-help_function_version_check.sh deleted file mode 100644 index 52673eeb7b2..00000000000 --- a/testcases/function_test/pkg_test/hdparm/hdparm-help/test_hdparm-help_function_version_check.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-31 -# @License : Mulan PSL v2 -# @Desc : 测试通过包管理器查询hdparm-help软件包的版本信息,验证其版本号与预期一致。 -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - # 定义颜色输出(如果LOG_INFO/LOG_ERROR未定义则定义基本版本) - if ! command -v LOG_INFO >/dev/null 2>&1; then - LOG_INFO() { - echo "[INFO] $*" - } - fi - - if ! command -v LOG_ERROR >/dev/null 2>&1; then - LOG_ERROR() { - echo "[ERROR] $*" >&2 - } - fi - - # 定义软件包名称和命令 - PACKAGE_NAME="hdparm" - COMMAND="hdparm" - EXPECTED_VERSION="9.65" # 根据实际需求调整预期版本 - - # 步骤1: 检查环境是否已安装hdparm - LOG_INFO "步骤1: 检查是否已安装hdparm软件包" - if command -v $COMMAND >/dev/null 2>&1; then - LOG_INFO "hdparm已安装,标记为无需清理" - NEED_CLEANUP=0 - else - LOG_INFO "hdparm未安装,标记为需要清理" - NEED_CLEANUP=1 - fi - - # 步骤2: 检查yum源中是否存在hdparm软件包 - LOG_INFO "步骤2: 检查yum源中是否存在hdparm软件包" - if ! dnf list available $PACKAGE_NAME --quiet >/dev/null 2>&1; then - LOG_ERROR "yum源中未找到hdparm软件包" - exit 255 - fi - - # 步骤3: 如果未安装,则安装hdparm - if [ $NEED_CLEANUP -eq 1 ]; then - LOG_INFO "步骤3: 安装hdparm软件包" - dnf install -y $PACKAGE_NAME - CHECK_RESULT $? 0 0 "安装hdparm失败" - fi - - # 步骤4: 检查hdparm命令是否支持--help参数 - LOG_INFO "步骤4: 检查hdparm命令是否支持--help参数" - if ! $COMMAND --help >/dev/null 2>&1; then - LOG_ERROR "hdparm命令不支持--help参数" - # 如果之前安装了软件包,需要卸载 - if [ $NEED_CLEANUP -eq 1 ]; then - dnf remove -y $PACKAGE_NAME - fi - exit 255 - fi - - # 步骤5: 获取hdparm的版本信息 - LOG_INFO "步骤5: 获取hdparm的版本信息" - VERSION_OUTPUT=$($COMMAND --version 2>&1) - if [ $? -ne 0 ]; then - LOG_ERROR "获取hdparm版本信息失败" - if [ $NEED_CLEANUP -eq 1 ]; then - dnf remove -y $PACKAGE_NAME - fi - exit 1 - fi - - # 步骤6: 从版本输出中提取版本号 - LOG_INFO "步骤6: 从版本输出中提取版本号" - VERSION=$(echo "$VERSION_OUTPUT" | grep -oP "v\d+\.\d+" | head -1 | sed "s/v//") - if [ -z "$VERSION" ]; then - LOG_ERROR "无法从输出中提取版本号" - if [ $NEED_CLEANUP -eq 1 ]; then - dnf remove -y $PACKAGE_NAME - fi - exit 1 - fi - - LOG_INFO "提取到的版本号为: $VERSION" - - # 步骤7: 验证版本号是否符合预期 - LOG_INFO "步骤7: 验证版本号是否符合预期" - if [ "$VERSION" = "$EXPECTED_VERSION" ]; then - LOG_INFO "版本号验证通过: 期望 $EXPECTED_VERSION, 实际 $VERSION" - else - LOG_ERROR "版本号验证失败: 期望 $EXPECTED_VERSION, 实际 $VERSION" - if [ $NEED_CLEANUP -eq 1 ]; then - dnf remove -y $PACKAGE_NAME - fi - exit 1 - fi - - # 步骤8: 清理环境(如果之前安装了软件包) - if [ $NEED_CLEANUP -eq 1 ]; then - LOG_INFO "步骤8: 卸载hdparm软件包" - dnf remove -y $PACKAGE_NAME - CHECK_RESULT $? 0 0 "卸载hdparm失败" - fi - - LOG_INFO "测试完成,环境已恢复" -} - -main "$@" \ No newline at end of file diff --git a/testcases/function_test/pkg_test/kunpengsecl/kunpengsecl-tas/test_kunpengsecl-tas_Huawei.sh b/testcases/function_test/pkg_test/kunpengsecl/kunpengsecl-tas/test_kunpengsecl-tas_Huawei.sh deleted file mode 100644 index 775a6b1c1b3..00000000000 --- a/testcases/function_test/pkg_test/kunpengsecl/kunpengsecl-tas/test_kunpengsecl-tas_Huawei.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 : 2025-12-04 -# @License : Mulan PSL v2 -# @Desc : 测试 Huawei 命令的基本功能 -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - - # 检查是否已安装指定软件包 - check_package_installed() { - local package_name=$1 - if dnf list installed "$package_name" &>/dev/null; then - LOG_INFO "软件包 $package_name 已安装" - return 0 - else - LOG_INFO "软件包 $package_name 未安装" - return 1 - fi - } - - # 检查yum源中是否有指定软件包 - check_package_available() { - local package_name=$1 - if dnf list available "$package_name" &>/dev/null; then - LOG_INFO "yum源中存在软件包 $package_name" - return 0 - else - LOG_ERROR "yum源中不存在软件包 $package_name" - exit 255 - fi - } - - # 安装指定软件包 - install_package() { - local package_name=$1 - LOG_INFO "开始安装软件包 $package_name" - dnf install -y "$package_name" - CHECK_RESULT $? 0 0 "安装软件包 $package_name 失败" - } - - # 卸载指定软件包 - uninstall_package() { - local package_name=$1 - LOG_INFO "开始卸载软件包 $package_name" - dnf remove -y "$package_name" - CHECK_RESULT $? 0 0 "卸载软件包 $package_name 失败" - } - - # 执行命令并检查结果,支持参数检查与命令执行结果检查 - execute_command() { - local command=$1 - local expected_exit_code=${2:-0} - - # 检查命令是否存在或参数是否支持 - if ! command -v "${command%% *}" &>/dev/null; then - LOG_ERROR "命令 ${command%% *} 不存在或不支持" - exit 255 - fi - - # 执行命令并检查结果 - eval "$command" - - CHECK_RESULT $? $expected_exit_code 255 \ - "执行命令 $command 失败" - } - - main() { - LOG_INFO "测试 Huawei 命令的基本功能" - - PACKAGE_NAME="kunpengsecl-tas" - - # 判断环境是否已安装 - if check_package_installed "$PACKAGE_NAME"; then - INSTALLED=true - else - INSTALLED=false - fi - - # 如果未安装,则进行安装 - if ! "$INSTALLED"; then - check_package_available "$PACKAGE_NAME" - install_package "$PACKAGE_NAME" - fi - - LOG_INFO "开始执行 Huawei TAS 相关测试命令..." - - execute_command "Huawei --version" 0 - - if [ "$INSTALLED" = false ]; then - uninstall_package "$PACKAGE_NAME" - fi - } - - main "$@" - -} - -main "$@" \ No newline at end of file diff --git a/testcases/function_test/pkg_test/kunpengsecl/kunpengsecl-tas/test_kunpengsecl-tas_function_config.sh b/testcases/function_test/pkg_test/kunpengsecl/kunpengsecl-tas/test_kunpengsecl-tas_function_config.sh deleted file mode 100644 index 0bb19530d1d..00000000000 --- a/testcases/function_test/pkg_test/kunpengsecl/kunpengsecl-tas/test_kunpengsecl-tas_function_config.sh +++ /dev/null @@ -1,72 +0,0 @@ -#!/usr/bin/bash - -# Copyright (c) 2024 ISCAS .ALL rights reserved. -# This program is licensed under Mulan PSL v2. -# You can use it according to the terms and conditions of the Mulan PSL v2. -# http://license.coscl.org.cn/MulanPSL2 -# THIS PROGRAM IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, -# EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, -# MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. -# See the Mulan PSL v2 for more details. - -# ############################################# -# @Author : honghua -# @Contact : honghua@iscas.ac.cn -# @Date : 2025-12-04 -# @License : Mulan PSL v2 -# @Desc : 测试软件包 kunpengsecl-tas 的配置文件加载功能,验证配置是否正确解析和应用。 -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - LOG_INFO "开始测试 kunpengsecl-tas 的配置文件加载功能" - - # 检查是否已安装 kunpengsecl-tas - LOG_INFO "检查 kunpengsecl-tas 是否已安装" - if dnf list installed kunpengsecl-tas &>/dev/null; then - LOG_INFO "kunpengsecl-tas 已安装" - installed=true - else - LOG_INFO "kunpengsecl-tas 未安装" - installed=false - fi - - # 检查 yum 源中是否有 kunpengsecl-tas 软件包 - LOG_INFO "检查 yum 源中是否有 kunpengsecl-tas 软件包" - if ! dnf list available kunpengsecl-tas &>/dev/null; then - LOG_ERROR "yum 源中未找到 kunpengsecl-tas 软件包" - exit 255 - fi - - # 如果未安装,则安装软件包 - if [ "$installed" = false ]; then - LOG_INFO "安装 kunpengsecl-tas 软件包" - dnf install -y kunpengsecl-tas - CHECK_RESULT $? 0 0 "安装 kunpengsecl-tas 失败" - fi - - # 测试配置文件加载功能 - LOG_INFO "测试配置文件加载功能" - tas_config="/etc/kunpengsecl/tas/config.yaml" - if [ ! -f "$tas_config" ]; then - LOG_ERROR "配置文件 $tas_config 不存在" - exit 255 - fi - - # 验证配置是否正确解析和应用 - LOG_INFO "验证配置是否正确解析和应用" - tas_output=$(tas --config "$tas_config" --validate) - CHECK_RESULT $? 0 0 "配置文件验证失败" - - # 清理环境:如果脚本开始时未安装,则卸载软件包 - if [ "$installed" = false ]; then - LOG_INFO "卸载 kunpengsecl-tas 软件包" - dnf remove -y kunpengsecl-tas - CHECK_RESULT $? 0 0 "卸载 kunpengsecl-tas 失败" - fi - - LOG_INFO "测试完成" -} - -main "$@" \ No newline at end of file diff --git a/testcases/function_test/pkg_test/kunpengsecl/kunpengsecl-tas/test_kunpengsecl-tas_tas__upper_t.sh b/testcases/function_test/pkg_test/kunpengsecl/kunpengsecl-tas/test_kunpengsecl-tas_tas__upper_t.sh deleted file mode 100644 index 25e47b564ff..00000000000 --- a/testcases/function_test/pkg_test/kunpengsecl/kunpengsecl-tas/test_kunpengsecl-tas_tas__upper_t.sh +++ /dev/null @@ -1,72 +0,0 @@ -#!/usr/bin/bash - -# Copyright (c) 2024 ISCAS .ALL rights reserved. -# This program is licensed under Mulan PSL v2. -# You can use it according to the terms and conditions of the Mulan PSL v2. -# http://license.coscl.org.cn/MulanPSL2 -# THIS PROGRAM IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, -# EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, -# MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. -# See the Mulan PSL v2 for more details. - -# ############################################# -# @Author : honghua -# @Contact : honghua@iscas.ac.cn -# @Date : 2025-12-04 -# @License : Mulan PSL v2 -# @Desc : 测试 tas 命令的 -T 参数,用于生成 rest api 的测试 token -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - - # 测试 tas 命令的 -T 参数,用于生成 rest api 的测试 token - - LOG_INFO "开始测试 tas 命令的 -T 参数" - - # 检查是否已安装 kunpengsecl-tas 软件包 - LOG_INFO "检查 kunpengsecl-tas 是否已安装" - if rpm -q kunpengsecl-tas &>/dev/null; then - LOG_INFO "kunpengsecl-tas 已安装" - installed=true - else - LOG_INFO "kunpengsecl-tas 未安装" - installed=false - fi - - # 如果未安装,尝试从 yum 源安装 - if ! $installed; then - LOG_INFO "尝试从 yum 源安装 kunpengsecl-tas" - if ! dnf list available kunpengsecl-tas &>/dev/null; then - LOG_ERROR "yum 源中未找到 kunpengsecl-tas 软件包" - exit 255 - fi - dnf install -y kunpengsecl-tas - CHECK_RESULT $? 0 0 "安装 kunpengsecl-tas 失败" - fi - - # 检查 tas 命令是否支持 -T 参数 - LOG_INFO "检查 tas 命令是否支持 -T 参数" - tas -h | grep -q -- "-T" || { - LOG_ERROR "tas 命令不支持 -T 参数" - exit 255 - } - - #执行 tas -T,生成测试 token - LOG_INFO "执行 tas -T 生成测试 token" - tas -T - CHECK_RESULT $? 0 0 "tas -T 执行失败" - - #清理环境 - if ! $installed; then - LOG_INFO "卸载 kunpengsecl-tas" - dnf remove -y kunpengsecl-tas - CHECK_RESULT $? 0 0 "卸载 kunpengsecl-tas失败" - fi - - LOG_INFO "测试完成" - -} - -main "$@" \ No newline at end of file diff --git a/testcases/function_test/pkg_test/lodash/nodejs-lodash-toplainobject/test_nodejs-lodash-toplainobject_function_basic.sh b/testcases/function_test/pkg_test/lodash/nodejs-lodash-toplainobject/test_nodejs-lodash-toplainobject_function_basic.sh deleted file mode 100644 index c683fd58945..00000000000 --- a/testcases/function_test/pkg_test/lodash/nodejs-lodash-toplainobject/test_nodejs-lodash-toplainobject_function_basic.sh +++ /dev/null @@ -1,147 +0,0 @@ -#!/usr/bin/bash - -# Copyright (c) 2024 ISCAS .ALL rights reserved. -# This program is licensed under Mulan PSL v2. -# You can use it according to the terms and conditions of the Mulan PSL v2. -# http://license.coscl.org.cn/MulanPSL2 -# THIS PROGRAM IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, -# EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, -# 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-22 -# @License : Mulan PSL v2 -# @Desc : 测试toPlainObject函数将对象转换为普通对象的基本功能 -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - # 测试环境准备 - LOG_INFO "开始测试nodejs-lodash的toPlainObject函数基本功能" - - # 定义软件包名称 - PACKAGE_NAME="nodejs-lodash" - LOG_INFO "检查${PACKAGE_NAME}软件包是否在yum源中" - - # 检查yum源中是否存在该软件包 - if ! dnf list available ${PACKAGE_NAME} &>/dev/null; then - LOG_ERROR "yum源中未找到${PACKAGE_NAME}软件包" - exit 255 - fi - - LOG_INFO "检查当前环境是否已安装${PACKAGE_NAME}" - - # 检查是否已安装 - INSTALLED=false - if rpm -q ${PACKAGE_NAME} &>/dev/null; then - LOG_INFO "${PACKAGE_NAME}已安装" - INSTALLED=true - else - 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 - - # 测试toPlainObject函数基本功能 - LOG_INFO "测试toPlainObject函数将对象转换为普通对象的基本功能" - - # 创建测试脚本 - TEST_SCRIPT="/tmp/test_lodash.js" - cat > ${TEST_SCRIPT} << "EOF" - const _ = require("lodash"); - - // 测试1:普通对象转换 - function testBasicObject() { - const obj = { a: 1, b: 2 }; - const plainObj = _.toPlainObject(obj); - console.log("Test 1 - Basic object conversion:"); - console.log("Original:", obj); - console.log("Result:", plainObj); - console.log("Type of result:", typeof plainObj); - console.log("Is plain object?", _.isPlainObject(plainObj)); - console.log(""); - } - - // 测试2:嵌套对象转换 - function testNestedObject() { - const obj = { a: 1, b: { c: 2, d: { e: 3 } } }; - const plainObj = _.toPlainObject(obj); - console.log("Test 2 - Nested object conversion:"); - console.log("Original:", obj); - console.log("Result:", plainObj); - console.log("Is plain object?", _.isPlainObject(plainObj)); - console.log("Is nested object plain?", _.isPlainObject(plainObj.b.d)); - console.log(""); - } - - // 测试3:数组转换 - function testArrayConversion() { - const arr = [1, 2, 3]; - const plainObj = _.toPlainObject(arr); - console.log("Test 3 - Array conversion:"); - console.log("Original array:", arr); - console.log("Result:", plainObj); - console.log("Is plain object?", _.isPlainObject(plainObj)); - console.log(""); - } - - // 测试4:函数参数转换 - function testFunctionArguments() { - function testFunc(a, b) { - const plainObj = _.toPlainObject(arguments); - console.log("Test 4 - Function arguments conversion:"); - console.log("Arguments:", arguments); - console.log("Result:", plainObj); - console.log("Is plain object?", _.isPlainObject(plainObj)); - console.log(""); - } - testFunc("x", "y"); - } - - // 执行所有测试 - try { - testBasicObject(); - testNestedObject(); - testArrayConversion(); - testFunctionArguments(); - console.log("All tests completed successfully"); - process.exit(0); - } catch (error) { - console.error("Test failed:", error); - process.exit(1); - } - EOF - - LOG_INFO "执行toPlainObject函数测试" - node ${TEST_SCRIPT} - CHECK_RESULT $? 0 0 "toPlainObject函数基本功能测试失败" - - # 清理测试脚本 - LOG_INFO "清理测试脚本" - rm -f ${TEST_SCRIPT} - - # 环境恢复 - 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/lodash/nodejs-lodash-toplainobject/test_nodejs-lodash-toplainobject_function_inherit.sh b/testcases/function_test/pkg_test/lodash/nodejs-lodash-toplainobject/test_nodejs-lodash-toplainobject_function_inherit.sh deleted file mode 100644 index b82960bc209..00000000000 --- a/testcases/function_test/pkg_test/lodash/nodejs-lodash-toplainobject/test_nodejs-lodash-toplainobject_function_inherit.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-22 -# @License : Mulan PSL v2 -# @Desc : 测试toPlainObject函数对继承属性的转换处理 -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - # 环境初始化 - LOG_INFO "开始测试:测试toPlainObject函数对继承属性的转换处理" - LOG_INFO "步骤1:检查是否已安装nodejs和lodash" - if dnf list installed nodejs > /dev/null 2>&1 && dnf list installed nodejs-lodash > /dev/null 2>&1; then - LOG_INFO "nodejs和lodash已安装,测试结束后将保持安装状态" - INSTALLED=1 - else - LOG_INFO "nodejs和lodash未安装,将在测试前安装" - INSTALLED=0 - fi - - # 检查软件包是否在yum源中 - LOG_INFO "步骤2:检查yum源中是否有nodejs和nodejs-lodash软件包" - if ! dnf list available nodejs > /dev/null 2>&1; then - LOG_ERROR "yum源中未找到nodejs软件包" - exit 255 - fi - if ! dnf list available nodejs-lodash > /dev/null 2>&1; then - LOG_ERROR "yum源中未找到nodejs-lodash软件包" - exit 255 - fi - - # 安装软件包(如果未安装) - if [ $INSTALLED -eq 0 ]; then - LOG_INFO "步骤3:安装nodejs和nodejs-lodash" - dnf install -y nodejs nodejs-lodash - CHECK_RESULT $? 0 0 "安装nodejs和nodejs-lodash失败" - fi - - # 创建测试脚本 - LOG_INFO "步骤4:创建测试脚本test_lodash.js" - cat > /tmp/test_lodash.js << "EOF" - const _ = require("lodash"); - // 创建一个父类 - function Parent() { - this.parentProp = "parentValue"; - } - // 创建一个子类 - function Child() { - this.childProp = "childValue"; - } - // 设置继承 - Child.prototype = new Parent(); - Child.prototype.constructor = Child; - - // 创建子类实例 - const childInstance = new Child(); - // 使用toPlainObject转换 - const plainObject = _.toPlainObject(childInstance); - - console.log("parentProp in plainObject:", plainObject.parentProp); - console.log("childProp in plainObject:", plainObject.childProp); - EOF - CHECK_RESULT $? 0 0 "创建测试脚本失败" - - # 执行测试 - LOG_INFO "步骤5:执行测试脚本" - node /tmp/test_lodash.js > /tmp/test_output.txt 2>&1 - CHECK_RESULT $? 0 0 "执行测试脚本失败" - - # 检查测试结果 - LOG_INFO "步骤6:检查测试结果" - if grep -q "parentProp in plainObject: parentValue" /tmp/test_output.txt && grep -q "childProp in plainObject: childValue" /tmp/test_output.txt; then - LOG_INFO "测试通过:toPlainObject正确转换了继承属性" - else - LOG_ERROR "测试失败:toPlainObject未能正确转换继承属性" - cat /tmp/test_output.txt - exit 1 - fi - - # 环境清理 - LOG_INFO "步骤7:清理临时文件" - rm -f /tmp/test_lodash.js /tmp/test_output.txt - CHECK_RESULT $? 0 0 "清理临时文件失败" - - # 卸载软件包(如果测试前未安装) - if [ $INSTALLED -eq 0 ]; then - LOG_INFO "步骤8:卸载nodejs和nodejs-lodash" - dnf remove -y nodejs nodejs-lodash - CHECK_RESULT $? 0 0 "卸载nodejs和nodejs-lodash失败" - else - LOG_INFO "步骤8:保持nodejs和nodejs-lodash安装状态" - fi - - LOG_INFO "测试完成:测试toPlainObject函数对继承属性的转换处理" -} - -main "$@" \ No newline at end of file diff --git a/testcases/function_test/pkg_test/lodash/nodejs-lodash-toplainobject/test_nodejs-lodash-toplainobject_function_install.sh b/testcases/function_test/pkg_test/lodash/nodejs-lodash-toplainobject/test_nodejs-lodash-toplainobject_function_install.sh deleted file mode 100644 index bf038b8d272..00000000000 --- a/testcases/function_test/pkg_test/lodash/nodejs-lodash-toplainobject/test_nodejs-lodash-toplainobject_function_install.sh +++ /dev/null @@ -1,129 +0,0 @@ -#!/usr/bin/bash - -# Copyright (c) 2024 ISCAS .ALL rights reserved. -# This program is licensed under Mulan PSL v2. -# You can use it according to the terms and conditions of the Mulan PSL v2. -# http://license.coscl.org.cn/MulanPSL2 -# THIS PROGRAM IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, -# EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, -# MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. -# See the Mulan PSL v2 for more details. - -# ############################################# -# @Author : honghua -# @Contact : honghua@iscas.ac.cn -# @Date : 2026-02-22 -# @License : Mulan PSL v2 -# @Desc : 测试软件包nodejs-lodash-toplainobject能否通过包管理器(如npm)正常安装 -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - # 检查当前环境是否已安装nodejs-lodash-toplainobject - LOG_INFO "开始测试:验证nodejs-lodash-toplainobject能否通过包管理器正常安装" - LOG_INFO "步骤1:检查当前环境是否已安装nodejs-lodash-toplainobject软件包" - if rpm -q nodejs-lodash-toplainobject &>/dev/null; then - LOG_INFO "检测到nodejs-lodash-toplainobject已安装,脚本结束时将保持安装状态" - INSTALLED_BEFORE=true - else - LOG_INFO "当前环境未安装nodejs-lodash-toplainobject,将在测试过程中安装" - INSTALLED_BEFORE=false - fi - - # 检查yum源中是否存在nodejs-lodash-toplainobject软件包 - LOG_INFO "步骤2:检查yum源中是否存在nodejs-lodash-toplainobject软件包" - if ! dnf list available nodejs-lodash-toplainobject &>/dev/null; then - LOG_ERROR "yum源中未找到nodejs-lodash-toplainobject软件包" - exit 255 - fi - LOG_INFO "yum源中存在nodejs-lodash-toplainobject软件包" - - # 安装nodejs-lodash-toplainobject软件包(如果未安装) - if [ "$INSTALLED_BEFORE" = false ]; then - LOG_INFO "步骤3:通过dnf安装nodejs-lodash-toplainobject软件包" - dnf install -y nodejs-lodash-toplainobject - CHECK_RESULT $? 0 0 "安装nodejs-lodash-toplainobject失败" - LOG_INFO "nodejs-lodash-toplainobject软件包安装成功" - fi - - # 验证nodejs-lodash-toplainobject软件包是否已正确安装 - LOG_INFO "步骤4:验证nodejs-lodash-toplainobject软件包是否已正确安装" - rpm -q nodejs-lodash-toplainobject - CHECK_RESULT $? 0 0 "验证nodejs-lodash-toplainobject软件包安装状态失败" - - # 测试通过包管理器(如npm)正常安装lodash的toplainobject功能 - LOG_INFO "步骤5:测试通过npm安装lodash并验证toplainobject功能" - # 检查npm命令是否可用 - if ! command -v npm &>/dev/null; then - LOG_ERROR "npm命令未找到,无法进行包管理器安装测试" - exit 255 - fi - - # 创建一个临时目录用于测试 - TEST_DIR=$(mktemp -d) - cd "$TEST_DIR" || exit 1 - - # 初始化npm项目 - LOG_INFO "在临时目录中初始化npm项目" - npm init -y - CHECK_RESULT $? 0 0 "npm初始化失败" - - # 安装lodash软件包 - LOG_INFO "通过npm安装lodash软件包" - npm install lodash - CHECK_RESULT $? 0 0 "npm安装lodash失败" - - # 创建一个简单的测试脚本来验证toplainobject功能 - LOG_INFO "创建测试脚本验证lodash的toplainobject功能" - cat > test_toplainobject.js << "EOF" - const _ = require("lodash"); - - function Foo() { - this.a = 1; - } - - Foo.prototype.b = 2; - - const foo = new Foo(); - const plainObj = _.toPlainObject(foo); - - console.log("Testing toPlainObject function..."); - console.log("Original object:", foo); - console.log("Plain object:", plainObj); - - if (plainObj.a === 1 && !plainObj.hasOwnProperty("b")) { - console.log("SUCCESS: toPlainObject function works correctly"); - process.exit(0); - } else { - console.log("FAILURE: toPlainObject function does not work as expected"); - process.exit(1); - } - EOF - - # 执行测试脚本 - LOG_INFO "执行测试脚本验证toplainobject功能" - node test_toplainobject.js - CHECK_RESULT $? 0 0 "lodash的toplainobject功能测试失败" - - LOG_INFO "lodash的toplainobject功能测试成功" - - # 清理临时测试目录 - LOG_INFO "清理临时测试目录" - cd /tmp || exit 1 - rm -rf "$TEST_DIR" - - # 环境恢复:如果测试前未安装,则卸载软件包 - if [ "$INSTALLED_BEFORE" = false ]; then - LOG_INFO "步骤6:恢复测试环境,卸载测试安装的nodejs-lodash-toplainobject软件包" - dnf remove -y nodejs-lodash-toplainobject - CHECK_RESULT $? 0 0 "卸载nodejs-lodash-toplainobject失败" - LOG_INFO "nodejs-lodash-toplainobject软件包已成功卸载" - else - LOG_INFO "步骤6:测试前已安装nodejs-lodash-toplainobject,保持安装状态不变" - fi - - LOG_INFO "测试完成:nodejs-lodash-toplainobject能通过包管理器正常安装" -} - -main "$@" \ No newline at end of file diff --git a/testcases/function_test/pkg_test/lodash/nodejs-lodash-toplainobject/test_nodejs-lodash-toplainobject_function_require.sh b/testcases/function_test/pkg_test/lodash/nodejs-lodash-toplainobject/test_nodejs-lodash-toplainobject_function_require.sh deleted file mode 100644 index 6d4e0670555..00000000000 --- a/testcases/function_test/pkg_test/lodash/nodejs-lodash-toplainobject/test_nodejs-lodash-toplainobject_function_require.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-02-22 -# @License : Mulan PSL v2 -# @Desc : 测试在Node.js环境中能够成功require引入lodash.toplainobject模块 -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - # 环境检查:检查Node.js是否已安装 - LOG_INFO "检查Node.js是否已安装" - if command -v node &> /dev/null; then - LOG_INFO "Node.js已安装,脚本结束后将保持安装状态" - NODEJS_INSTALLED=true - else - LOG_INFO "Node.js未安装,将在测试步骤中安装" - NODEJS_INSTALLED=false - fi - - # 检查yum源中是否有Node.js软件包 - LOG_INFO "检查yum源中是否有Node.js软件包" - if ! dnf list available nodejs &> /dev/null; then - LOG_ERROR "yum源中未找到Node.js软件包" - exit 255 - fi - - # 如果Node.js未安装,则安装Node.js - if [ "$NODEJS_INSTALLED" = false ]; then - LOG_INFO "安装Node.js" - dnf install -y nodejs - CHECK_RESULT $? 0 0 "安装Node.js失败" - fi - - # 检查Node.js环境 - LOG_INFO "检查Node.js环境" - node --version - CHECK_RESULT $? 0 0 "Node.js环境检查失败" - - # 创建测试目录 - LOG_INFO "创建测试目录" - mkdir -p /tmp/test_nodejs_lodash - cd /tmp/test_nodejs_lodash - CHECK_RESULT $? 0 0 "创建测试目录失败" - - # 初始化npm项目 - LOG_INFO "初始化npm项目" - npm init -y - CHECK_RESULT $? 0 0 "初始化npm项目失败" - - # 安装lodash.toplainobject模块 - LOG_INFO "安装lodash.toplainobject模块" - npm install lodash.toplainobject - CHECK_RESULT $? 0 0 "安装lodash.toplainobject模块失败" - - # 创建测试脚本 - LOG_INFO "创建测试脚本" - cat > test_require.js << "EOF" - const toPlainObject = require("lodash.toplainobject"); - if (typeof toPlainObject === "function") { - console.log("SUCCESS: lodash.toplainobject模块成功引入"); - process.exit(0); - } else { - console.error("FAILURE: lodash.toplainobject模块引入失败"); - process.exit(1); - } - EOF - CHECK_RESULT $? 0 0 "创建测试脚本失败" - - # 执行测试脚本 - LOG_INFO "执行测试脚本" - node test_require.js - CHECK_RESULT $? 0 0 "测试脚本执行失败,无法成功require引入lodash.toplainobject模块" - - # 清理测试目录 - LOG_INFO "清理测试目录" - cd / - rm -rf /tmp/test_nodejs_lodash - CHECK_RESULT $? 0 0 "清理测试目录失败" - - # 如果Node.js是本次脚本安装的,则卸载Node.js - if [ "$NODEJS_INSTALLED" = false ]; then - LOG_INFO "卸载Node.js" - dnf remove -y nodejs - CHECK_RESULT $? 0 0 "卸载Node.js失败" - fi - - LOG_INFO "测试完成:Node.js环境中能够成功require引入lodash.toplainobject模块" -} - -main "$@" \ No newline at end of file diff --git a/testcases/function_test/pkg_test/mesa-demos/mesa-demos-help/test_mesa-demos-help_function_check_installed.sh b/testcases/function_test/pkg_test/mesa-demos/mesa-demos-help/test_mesa-demos-help_function_check_installed.sh deleted file mode 100644 index e13b4676946..00000000000 --- a/testcases/function_test/pkg_test/mesa-demos/mesa-demos-help/test_mesa-demos-help_function_check_installed.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 : Check if package is installed -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - # 检查软件包是否已安装 - - LOG_INFO "开始检查mesa-demos-help软件包安装状态" - - # 定义软件包名称 - PACKAGE_NAME="mesa-demos-help" - - # 步骤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 - LOG_INFO "软件包 $PACKAGE_NAME 在yum源中" - - # 步骤2:检查软件包当前安装状态 - LOG_INFO "步骤2:检查软件包当前安装状态" - rpm -q $PACKAGE_NAME > /dev/null 2>&1 - PACKAGE_INSTALLED=$? - - if [ $PACKAGE_INSTALLED -eq 0 ]; then - LOG_INFO "软件包 $PACKAGE_NAME 已安装" - INITIAL_STATE="installed" - else - LOG_INFO "软件包 $PACKAGE_NAME 未安装" - INITIAL_STATE="not_installed" - fi - - # 步骤3:如果未安装,则安装软件包 - if [ "$INITIAL_STATE" = "not_installed" ]; then - LOG_INFO "步骤3:安装软件包 $PACKAGE_NAME" - dnf install -y $PACKAGE_NAME - CHECK_RESULT $? 0 0 "安装软件包 $PACKAGE_NAME 失败" - LOG_INFO "软件包 $PACKAGE_NAME 安装成功" - fi - - # 步骤4:验证软件包已正确安装 - LOG_INFO "步骤4:验证软件包已正确安装" - rpm -q $PACKAGE_NAME > /dev/null 2>&1 - CHECK_RESULT $? 0 0 "软件包 $PACKAGE_NAME 未正确安装" - - # 步骤5:检查软件包功能(如果有帮助功能) - LOG_INFO "步骤5:检查软件包功能" - if command -v glxinfo &> /dev/null; then - LOG_INFO "检查glxinfo命令是否可用" - glxinfo --help > /dev/null 2>&1 - CHECK_RESULT $? 0 0 "glxinfo命令执行失败" - else - LOG_INFO "glxinfo命令不可用,跳过功能检查" - fi - - # 步骤6:环境恢复 - LOG_INFO "步骤6:恢复环境状态" - if [ "$INITIAL_STATE" = "not_installed" ]; then - LOG_INFO "卸载测试安装的软件包 $PACKAGE_NAME" - dnf remove -y $PACKAGE_NAME - CHECK_RESULT $? 0 0 "卸载软件包 $PACKAGE_NAME 失败" - LOG_INFO "软件包 $PACKAGE_NAME 已卸载" - - # 验证软件包已卸载 - rpm -q $PACKAGE_NAME > /dev/null 2>&1 - if [ $? -eq 0 ]; then - LOG_ERROR "软件包 $PACKAGE_NAME 卸载后仍存在" - exit 1 - fi - else - LOG_INFO "保持软件包 $PACKAGE_NAME 的安装状态" - fi - - LOG_INFO "测试完成:软件包 $PACKAGE_NAME 安装状态检查通过" -} - -main "$@" \ No newline at end of file diff --git a/testcases/function_test/pkg_test/mesa-demos/mesa-demos-help/test_mesa-demos-help_function_display_help.sh b/testcases/function_test/pkg_test/mesa-demos/mesa-demos-help/test_mesa-demos-help_function_display_help.sh deleted file mode 100644 index 418d1e44175..00000000000 --- a/testcases/function_test/pkg_test/mesa-demos/mesa-demos-help/test_mesa-demos-help_function_display_help.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-24 -# @License : Mulan PSL v2 -# @Desc : Display help information -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - LOG_INFO "开始测试: Display help information" - - # 检查软件包是否在yum源中 - LOG_INFO "检查mesa-demos软件包是否在yum源中" - dnf list mesa-demos >/dev/null 2>&1 - if [ $? -ne 0 ]; then - LOG_ERROR "yum源中未找到mesa-demos软件包" - exit 255 - fi - - # 检查是否已安装 - LOG_INFO "检查mesa-demos是否已安装" - rpm -q mesa-demos >/dev/null 2>&1 - if [ $? -eq 0 ]; then - LOG_INFO "mesa-demos已安装,测试结束后保持安装状态" - already_installed=1 - else - LOG_INFO "mesa-demos未安装,将在测试前安装" - already_installed=0 - fi - - # 如果未安装,则安装软件包 - if [ $already_installed -eq 0 ]; then - LOG_INFO "安装mesa-demos软件包" - dnf install -y mesa-demos - CHECK_RESULT $? 0 0 "安装mesa-demos失败" - fi - - # 测试help参数 - LOG_INFO "测试glxgears --help命令" - glxgears --help >/dev/null 2>&1 - CHECK_RESULT $? 0 0 "glxgears --help命令执行失败" - - # 测试不支持的参数 - LOG_INFO "测试glxgears不存在的参数" - glxgears --invalid-param >/dev/null 2>&1 - if [ $? -eq 255 ]; then - LOG_ERROR "glxgears不支持--invalid-param参数" - exit 255 - fi - - # 测试其他命令的help - LOG_INFO "测试glxinfo --help命令" - glxinfo --help >/dev/null 2>&1 - CHECK_RESULT $? 0 0 "glxinfo --help命令执行失败" - - # 清理环境 - LOG_INFO "清理测试环境" - if [ $already_installed -eq 0 ]; then - LOG_INFO "卸载mesa-demos软件包" - dnf remove -y mesa-demos - CHECK_RESULT $? 0 0 "卸载mesa-demos失败" - else - LOG_INFO "保持mesa-demos安装状态" - fi - - LOG_INFO "测试完成: Display help information" -} - -main "$@" \ No newline at end of file diff --git a/testcases/function_test/pkg_test/mesa-demos/mesa-demos-help/test_mesa-demos-help_function_install.sh b/testcases/function_test/pkg_test/mesa-demos/mesa-demos-help/test_mesa-demos-help_function_install.sh deleted file mode 100644 index d2ea4a7aea6..00000000000 --- a/testcases/function_test/pkg_test/mesa-demos/mesa-demos-help/test_mesa-demos-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-24 -# @License : Mulan PSL v2 -# @Desc : Test package installation -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - # 测试包安装功能 - LOG_INFO "开始测试包安装功能" - - # 定义软件包名称 - PACKAGE_NAME="mesa-demos-help-function" - - # 检查软件包是否已安装 - LOG_INFO "检查软件包是否已安装" - if dnf list installed "$PACKAGE_NAME" &>/dev/null; then - LOG_INFO "软件包已安装,测试后将保持安装状态" - ALREADY_INSTALLED=1 - else - LOG_INFO "软件包未安装,将在测试后卸载" - 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 - - # 安装软件包 - LOG_INFO "安装软件包: $PACKAGE_NAME" - dnf install -y "$PACKAGE_NAME" - CHECK_RESULT $? 0 0 "安装软件包失败" - - # 验证软件包已安装 - LOG_INFO "验证软件包已安装" - dnf list installed "$PACKAGE_NAME" - CHECK_RESULT $? 0 0 "软件包安装验证失败" - - # 检查软件包功能 - LOG_INFO "检查软件包功能" - if command -v mesa-demo-help &>/dev/null; then - LOG_INFO "软件包功能检查通过" - else - LOG_INFO "软件包功能检查:未找到特定命令,但包已安装" - fi - - # 清理环境 - LOG_INFO "清理测试环境" - if [ $ALREADY_INSTALLED -eq 0 ]; then - LOG_INFO "卸载测试安装的软件包" - dnf remove -y "$PACKAGE_NAME" - CHECK_RESULT $? 0 0 "卸载软件包失败" - - # 验证软件包已卸载 - LOG_INFO "验证软件包已卸载" - if dnf list installed "$PACKAGE_NAME" &>/dev/null; then - LOG_ERROR "软件包卸载失败" - exit 1 - else - LOG_INFO "软件包已成功卸载" - fi - else - LOG_INFO "保持软件包安装状态" - fi - - LOG_INFO "测试包安装功能完成" -} - -main "$@" \ No newline at end of file diff --git a/testcases/function_test/pkg_test/mesa-demos/mesa-demos-help/test_mesa-demos-help_function_list_demos.sh b/testcases/function_test/pkg_test/mesa-demos/mesa-demos-help/test_mesa-demos-help_function_list_demos.sh deleted file mode 100644 index 938201b307e..00000000000 --- a/testcases/function_test/pkg_test/mesa-demos/mesa-demos-help/test_mesa-demos-help_function_list_demos.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-02-24 -# @License : Mulan PSL v2 -# @Desc : List available demo programs -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - LOG_INFO "开始测试:List available demo programs" - - # 检查yum源中是否有mesa-demos软件包 - LOG_INFO "检查yum源中是否存在mesa-demos软件包" - if ! dnf list available mesa-demos &>/dev/null; then - LOG_ERROR "yum源中未找到mesa-demos软件包" - exit 255 - fi - - # 判断环境是否已安装mesa-demos - LOG_INFO "检查是否已安装mesa-demos软件包" - if rpm -q mesa-demos &>/dev/null; then - LOG_INFO "mesa-demos已安装,测试结束后将保持安装状态" - INSTALLED_BEFORE_TEST=true - else - LOG_INFO "mesa-demos未安装,将在测试过程中安装" - INSTALLED_BEFORE_TEST=false - fi - - # 如果未安装,则安装mesa-demos - if [ "$INSTALLED_BEFORE_TEST" = false ]; then - LOG_INFO "安装mesa-demos软件包" - dnf install -y mesa-demos - CHECK_RESULT $? 0 0 "安装mesa-demos失败" - fi - - # 测试glxinfo命令是否存在 - LOG_INFO "检查glxinfo命令是否存在" - if ! command -v glxinfo &>/dev/null; then - LOG_ERROR "glxinfo命令不存在" - exit 255 - fi - - # 测试glxgears命令是否存在 - LOG_INFO "检查glxgears命令是否存在" - if ! command -v glxgears &>/dev/null; then - LOG_ERROR "glxgears命令不存在" - exit 255 - fi - - # 测试glxgears命令的-help参数是否支持 - LOG_INFO "测试glxgears命令的-help参数" - glxgears -help 2>&1 | grep -q "usage" - CHECK_RESULT $? 0 0 "glxgears命令不支持-help参数" - - # 测试glxinfo命令的-help参数是否支持 - LOG_INFO "测试glxinfo命令的-help参数" - glxinfo -help 2>&1 | grep -q "usage" - CHECK_RESULT $? 0 0 "glxinfo命令不支持-help参数" - - # 如果测试前未安装,则在测试结束后卸载mesa-demos - if [ "$INSTALLED_BEFORE_TEST" = false ]; then - LOG_INFO "卸载mesa-demos软件包" - dnf remove -y mesa-demos - CHECK_RESULT $? 0 0 "卸载mesa-demos失败" - fi - - LOG_INFO "测试完成:List available demo programs" -} - -main "$@" \ No newline at end of file diff --git a/testcases/function_test/pkg_test/podman/podman-docker/test_podman-docker_docker.sh b/testcases/function_test/pkg_test/podman/podman-docker/test_podman-docker_docker.sh deleted file mode 100644 index e7514e66a76..00000000000 --- a/testcases/function_test/pkg_test/podman/podman-docker/test_podman-docker_docker.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-01 -# @License : Mulan PSL v2 -# @Desc : 执行docker命令,显示podman命令的概述和可用命令列表 -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - # 检查是否已安装podman-docker - LOG_INFO "检查是否已安装podman-docker软件包" - if dnf list installed podman-docker >/dev/null 2>&1; then - LOG_INFO "podman-docker已安装,脚本结束后将保持安装状态" - INSTALLED_BEFORE=1 - else - LOG_INFO "podman-docker未安装,将在测试过程中安装并在结束时卸载" - INSTALLED_BEFORE=0 - fi - - # 检查yum源中是否有podman-docker软件包 - LOG_INFO "检查yum源中是否有podman-docker软件包" - if ! dnf list available podman-docker >/dev/null 2>&1; then - LOG_ERROR "yum源中未找到podman-docker软件包" - exit 255 - fi - - # 如果未安装则安装podman-docker - if [ ${INSTALLED_BEFORE} -eq 0 ]; then - LOG_INFO "安装podman-docker软件包" - dnf install -y podman-docker - CHECK_RESULT $? 0 0 "安装podman-docker失败" - fi - - # 执行docker命令,显示podman命令的概述和可用命令列表 - LOG_INFO "执行docker命令,显示podman命令的概述和可用命令列表" - docker --help - CHECK_RESULT $? 0 0 "执行docker --help命令失败" - - # 检查docker命令是否显示podman相关内容 - LOG_INFO "验证docker命令输出包含podman相关信息" - docker --help | grep -q "podman" - CHECK_RESULT $? 0 0 "docker命令输出未包含podman相关信息" - - # 清理环境:如果之前未安装,则卸载podman-docker - if [ ${INSTALLED_BEFORE} -eq 0 ]; then - LOG_INFO "卸载podman-docker软件包" - dnf remove -y podman-docker - CHECK_RESULT $? 0 0 "卸载podman-docker失败" - LOG_INFO "环境已恢复,podman-docker已卸载" - else - LOG_INFO "保持podman-docker安装状态,不进行卸载" - fi - - LOG_INFO "测试脚本执行完成" -} - -main "$@" \ No newline at end of file diff --git a/testcases/function_test/pkg_test/podman/podman-docker/test_podman-docker_docker__c.sh b/testcases/function_test/pkg_test/podman/podman-docker/test_podman-docker_docker__c.sh deleted file mode 100644 index b5e7485f11e..00000000000 --- a/testcases/function_test/pkg_test/podman/podman-docker/test_podman-docker_docker__c.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-30 -# @License : Mulan PSL v2 -# @Desc : 测试 podman-docker 的 docker 命令的 -c 参数,指定远程连接 -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - - # 检查是否已安装podman-docker - LOG_INFO "检查是否已安装podman-docker" - if dnf list installed podman-docker &>/dev/null; then - LOG_INFO "podman-docker已安装,脚本结束后保持安装状态" - INSTALLED=true - else - LOG_INFO "podman-docker未安装,将在测试结束后卸载" - INSTALLED=false - fi - - # 检查yum源中是否有podman-docker软件包 - LOG_INFO "检查yum源中是否有podman-docker软件包" - if ! dnf list available podman-docker &>/dev/null; then - LOG_ERROR "yum源中未找到podman-docker软件包" - exit 255 - fi - - # 如果未安装,则安装podman-docker - if [ "$INSTALLED" = false ]; then - LOG_INFO "开始安装podman-docker" - dnf install -y podman-docker - CHECK_RESULT $? 0 0 "安装podman-docker失败" - fi - - # 测试docker命令的-c参数 - LOG_INFO "测试docker命令的-c参数,指定远程连接" - docker -c remote_server ps &>/dev/null - CHECK_RESULT $? 0 0 "docker命令的-c参数不支持或执行失败" - - # 清理环境:如果脚本开始时未安装,则卸载podman-docker - if [ "$INSTALLED" = false ]; then - LOG_INFO "清理环境:卸载podman-docker" - dnf remove -y podman-docker - CHECK_RESULT $? 0 0 "卸载podman-docker失败" - fi - - LOG_INFO "测试脚本执行完毕,环境已恢复" - -} - -main "$@" \ No newline at end of file diff --git a/testcases/function_test/pkg_test/podman/podman-docker/test_podman-docker_docker__h.sh b/testcases/function_test/pkg_test/podman/podman-docker/test_podman-docker_docker__h.sh deleted file mode 100644 index ce057b8d3d7..00000000000 --- a/testcases/function_test/pkg_test/podman/podman-docker/test_podman-docker_docker__h.sh +++ /dev/null @@ -1,64 +0,0 @@ -#!/usr/bin/bash - -# Copyright (c) 2024 ISCAS .ALL rights reserved. -# This program is licensed under Mulan PSL v2. -# You can use it according to the terms and conditions of the Mulan PSL v2. -# http://license.coscl.org.cn/MulanPSL2 -# THIS PROGRAM IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, -# EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, -# MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. -# See the Mulan PSL v2 for more details. - -# ############################################# -# @Author : honghua -# @Contact : honghua@iscas.ac.cn -# @Date : 2025-11-30 -# @License : Mulan PSL v2 -# @Desc : 测试 podman-docker 的 docker 命令的 -h 参数,显示帮助信息 -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - - # 检查是否已安装podman-docker - LOG_INFO "检查是否已安装podman-docker" - if ! dnf list installed podman-docker &>/dev/null; then - LOG_INFO "podman-docker未安装,将进行安装" - INSTALLED=0 - else - LOG_INFO "podman-docker已安装" - INSTALLED=1 - fi - - # 检查yum源中是否有podman-docker软件包 - LOG_INFO "检查yum源中是否有podman-docker软件包" - if ! dnf list available podman-docker &>/dev/null; then - LOG_ERROR "yum源中未找到podman-docker软件包" - exit 255 - fi - - # 如果未安装,则安装podman-docker - if [ $INSTALLED -eq 0 ]; then - LOG_INFO "开始安装podman-docker" - dnf install -y podman-docker - CHECK_RESULT $? 0 0 "安装podman-docker失败" - fi - - # 测试docker命令的-h参数 - LOG_INFO "测试docker命令的-h参数" - docker -h &>/dev/null - CHECK_RESULT $? 0 0 "docker命令的-h参数不支持或执行失败" - - # 清理环境:如果脚本安装了podman-docker,则卸载 - if [ $INSTALLED -eq 0 ]; then - LOG_INFO "卸载podman-docker" - dnf remove -y podman-docker - CHECK_RESULT $? 0 0 "卸载podman-docker失败" - fi - - LOG_INFO "测试脚本执行完毕,环境已恢复" - -} - -main "$@" \ No newline at end of file diff --git a/testcases/function_test/pkg_test/podman/podman-docker/test_podman-docker_docker__upper_v.sh b/testcases/function_test/pkg_test/podman/podman-docker/test_podman-docker_docker__upper_v.sh deleted file mode 100644 index 884f6103c67..00000000000 --- a/testcases/function_test/pkg_test/podman/podman-docker/test_podman-docker_docker__upper_v.sh +++ /dev/null @@ -1,62 +0,0 @@ -#!/usr/bin/bash - -# Copyright (c) 2024 ISCAS .ALL rights reserved. -# This program is licensed under Mulan PSL v2. -# You can use it according to the terms and conditions of the Mulan PSL v2. -# http://license.coscl.org.cn/MulanPSL2 -# THIS PROGRAM IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, -# EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, -# MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. -# See the Mulan PSL v2 for more details. - -# ############################################# -# @Author : honghua -# @Contact : honghua@iscas.ac.cn -# @Date : 2025-11-30 -# @License : Mulan PSL v2 -# @Desc : 测试 podman-docker 的 docker 命令的 -V 参数,显示版本信息 -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - - LOG_INFO "开始测试 podman-docker 的 docker 命令的 -V 参数,显示版本信息" - - # 检查是否已安装 podman-docker - LOG_INFO "检查 podman-docker 是否已安装" - if ! dnf list installed podman-docker &>/dev/null; then - LOG_INFO "podman-docker 未安装,将进行安装" - # 检查 yum 源中是否有 podman-docker - LOG_INFO "检查 yum 源中是否有 podman-docker" - if ! dnf list available podman-docker &>/dev/null; then - LOG_ERROR "yum 源中未找到 podman-docker,退出测试" - exit 255 - fi - # 安装 podman-docker - LOG_INFO "安装 podman-docker" - dnf install -y podman-docker - CHECK_RESULT $? 0 0 "安装 podman-docker 失败" - else - LOG_INFO "podman-docker 已安装,跳过安装步骤" - fi - - # 测试 docker -V 命令 - LOG_INFO "测试 docker -V 命令,显示版本信息" - docker -V - CHECK_RESULT $? 0 0 "执行 docker -V 命令失败" - - # 清理环境 - if ! dnf list installed podman-docker &>/dev/null; then - LOG_INFO "podman-docker 是本次测试安装的,将进行卸载" - dnf remove -y podman-docker - CHECK_RESULT $? 0 0 "卸载 podman-docker 失败" - else - LOG_INFO "podman-docker 是之前已安装的,无需卸载" - fi - - LOG_INFO "测试完成,环境已恢复" - -} - -main "$@" \ No newline at end of file diff --git a/testcases/function_test/pkg_test/podman/podman-docker/test_podman-docker_docker_build.sh b/testcases/function_test/pkg_test/podman/podman-docker/test_podman-docker_docker_build.sh deleted file mode 100644 index 717295d8ff5..00000000000 --- a/testcases/function_test/pkg_test/podman/podman-docker/test_podman-docker_docker_build.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-04-01 -# @License : Mulan PSL v2 -# @Desc : 执行docker build命令,使用Containerfile中的指令构建镜像 -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - # 定义颜色和日志函数(假设已存在) - # 使用LOG_INFO和LOG_ERROR打印日志 - - # 检查是否已经安装podman-docker和docker - LOG_INFO "检查podman-docker和docker是否已安装" - if command -v docker &> /dev/null && rpm -q podman-docker &> /dev/null; then - LOG_INFO "podman-docker和docker已经安装,脚本结束后将保持安装状态" - already_installed=true - else - LOG_INFO "podman-docker和docker未安装,将在测试步骤中安装" - already_installed=false - fi - - # 检查yum源中是否有podman-docker软件包 - LOG_INFO "检查yum源中是否有podman-docker软件包" - if ! dnf list available podman-docker &> /dev/null; then - LOG_ERROR "yum源中没有podman-docker软件包" - exit 255 - fi - - # 如果未安装,则安装podman-docker - if [ "$already_installed" = false ]; then - LOG_INFO "安装podman-docker" - dnf install -y podman-docker - CHECK_RESULT $? 0 0 "安装podman-docker失败" - fi - - # 检查docker命令是否存在 - LOG_INFO "检查docker命令是否存在" - if ! command -v docker &> /dev/null; then - LOG_ERROR "docker命令不存在" - exit 255 - fi - - # 检查docker build命令参数支持 - LOG_INFO "检查docker build命令参数支持" - docker build --help | grep -q "Usage:" - CHECK_RESULT $? 0 0 "docker build命令参数不支持" - - # 准备Containerfile内容 - LOG_INFO "准备Containerfile内容" - cat > /tmp/Containerfile << "EOF" - FROM alpine:latest - RUN echo "Hello, OpenEuler!" > /tmp/hello.txt - EOF - CHECK_RESULT $? 0 0 "创建Containerfile失败" - - # 执行docker build命令构建镜像 - LOG_INFO "执行docker build命令构建镜像" - docker build -t test-image:latest -f /tmp/Containerfile /tmp - CHECK_RESULT $? 0 0 "docker build构建镜像失败" - - # 检查构建的镜像是否存在 - LOG_INFO "检查构建的镜像是否存在" - docker images | grep -q "test-image" - CHECK_RESULT $? 0 0 "构建的镜像不存在" - - # 清理构建的镜像 - LOG_INFO "清理构建的镜像" - docker rmi test-image:latest - CHECK_RESULT $? 0 0 "清理构建的镜像失败" - - # 清理Containerfile文件 - LOG_INFO "清理Containerfile文件" - rm -f /tmp/Containerfile - CHECK_RESULT $? 0 0 "清理Containerfile文件失败" - - # 如果脚本开始时未安装,则卸载podman-docker - if [ "$already_installed" = false ]; then - LOG_INFO "卸载podman-docker" - dnf remove -y podman-docker - CHECK_RESULT $? 0 0 "卸载podman-docker失败" - fi - - LOG_INFO "测试脚本执行完成,环境已恢复" -} - -main "$@" \ No newline at end of file diff --git a/testcases/function_test/pkg_test/podman/podman-docker/test_podman-docker_docker_c.sh b/testcases/function_test/pkg_test/podman/podman-docker/test_podman-docker_docker_c.sh deleted file mode 100644 index 62dc2a74097..00000000000 --- a/testcases/function_test/pkg_test/podman/podman-docker/test_podman-docker_docker_c.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-05 -# @License : Mulan PSL v2 -# @Desc : 测试使用 -c 参数指定连接远程 Podman 服务 -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - - # 检查是否已安装podman-docker - LOG_INFO "检查是否已安装podman-docker" - rpm -q podman-docker > /dev/null 2>&1 - if [ $? -eq 0 ]; then - installed=true - LOG_INFO "podman-docker已安装" - else - installed=false - LOG_INFO "podman-docker未安装" - fi - - # 检查yum源中是否存在podman-docker - LOG_INFO "检查yum源中是否存在podman-docker" - dnf list available podman-docker > /dev/null 2>&1 - if [ $? -ne 0 ]; then - LOG_ERROR "yum源中不存在podman-docker" - exit 255 - fi - - # 如果未安装,则安装podman-docker作为测试步骤 - if [ "$installed" = false ]; then - LOG_INFO "开始安装podman-docker" - dnf install -y podman-docker > /dev/null 2>&1 - CHECK_RESULT $? 0 0 "安装podman-docker失败" - fi - - # 测试使用 -c 参数指定连接远程 Podman 服务 - LOG_INFO "测试使用 -c 参数指定连接远程 Podman 服务" - docker -c remote_podman info > /dev/null 2>&1 - CHECK_RESULT $? 0 0 "-c 参数不支持或连接远程Podman服务失败" - - # 恢复环境:如果脚本开始时未安装,则卸载podman-docker;否则保持原状 - if [ "$installed" = false ]; then - LOG_INFO "卸载podman-docker" - dnf remove -y podman-docker > /dev/null 2>&1 - CHECK_RESULT $? 0 0 "卸载podman-docker失败" - - -} - -main "$@" \ No newline at end of file diff --git a/testcases/function_test/pkg_test/podman/podman-docker/test_podman-docker_docker_exec.sh b/testcases/function_test/pkg_test/podman/podman-docker/test_podman-docker_docker_exec.sh deleted file mode 100644 index 977ba13c405..00000000000 --- a/testcases/function_test/pkg_test/podman/podman-docker/test_podman-docker_docker_exec.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-04-01 -# @License : Mulan PSL v2 -# @Desc : 执行docker exec命令,在运行中的容器内运行进程 -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - # 定义颜色变量 - LOG_INFO() { - echo -e "\033[32m[INFO]\033[0m $1" - } - - LOG_ERROR() { - echo -e "\033[31m[ERROR]\033[0m $1" - } - - # 检查软件包是否在yum源中 - check_package_in_repo() { - local package_name=$1 - dnf list available "$package_name" &> /dev/null - if [ $? -ne 0 ]; then - LOG_ERROR "软件包 $package_name 不在yum源中" - exit 255 - fi - } - - # 检查命令参数是否支持 - check_command_option() { - local command=$1 - local option=$2 - $command --help 2>&1 | grep -q "$option" - if [ $? -ne 0 ]; then - LOG_ERROR "命令 $command 不支持参数 $option" - exit 255 - fi - } - - # 主函数 - main() { - LOG_INFO "开始测试docker exec命令" - - # 检查是否已安装podman-docker - LOG_INFO "检查podman-docker是否已安装" - if rpm -q podman-docker &> /dev/null; then - LOG_INFO "podman-docker已安装,测试后保持安装状态" - already_installed=true - else - LOG_INFO "podman-docker未安装,将在测试中安装" - already_installed=false - - # 检查软件包是否在yum源中 - LOG_INFO "检查podman-docker是否在yum源中" - check_package_in_repo "podman-docker" - - # 安装podman-docker - LOG_INFO "安装podman-docker" - dnf install -y podman-docker - CHECK_RESULT $? 0 0 "安装podman-docker失败" - fi - - # 检查docker命令是否存在 - LOG_INFO "检查docker命令是否存在" - which docker &> /dev/null - CHECK_RESULT $? 0 0 "docker命令不存在" - - # 检查docker exec参数是否支持 - LOG_INFO "检查docker exec命令参数是否支持" - check_command_option "docker exec" "-it" - - # 启动一个测试容器 - LOG_INFO "启动测试容器" - docker run -d --name test_container alpine sleep 3600 - CHECK_RESULT $? 0 0 "启动测试容器失败" - - # 等待容器启动 - sleep 2 - - # 检查容器是否在运行 - LOG_INFO "检查测试容器是否在运行" - docker ps | grep -q test_container - CHECK_RESULT $? 0 0 "测试容器未运行" - - # 测试docker exec命令 - LOG_INFO "执行docker exec命令,在容器内运行进程" - docker exec test_container echo "Hello from container" - CHECK_RESULT $? 0 0 "docker exec命令执行失败" - - # 测试docker exec -it命令(模拟交互式) - LOG_INFO "测试docker exec -it命令" - echo "echo "Interactive test"" | docker exec -i test_container sh - CHECK_RESULT $? 0 0 "docker exec -it命令执行失败" - - # 清理测试容器 - LOG_INFO "清理测试容器" - docker stop test_container - docker rm test_container - - # 如果测试前未安装,则卸载软件包 - if [ "$already_installed" = false ]; then - LOG_INFO "卸载podman-docker" - dnf remove -y podman-docker - CHECK_RESULT $? 0 0 "卸载podman-docker失败" - fi - - LOG_INFO "docker exec命令测试完成" - } - - # 执行主函数 - main -} - -main "$@" \ No newline at end of file diff --git a/testcases/function_test/pkg_test/podman/podman-docker/test_podman-docker_docker_help.sh b/testcases/function_test/pkg_test/podman/podman-docker/test_podman-docker_docker_help.sh deleted file mode 100644 index 16701c6e582..00000000000 --- a/testcases/function_test/pkg_test/podman/podman-docker/test_podman-docker_docker_help.sh +++ /dev/null @@ -1,63 +0,0 @@ -#!/usr/bin/bash - -# Copyright (c) 2024 ISCAS .ALL rights reserved. -# This program is licensed under Mulan PSL v2. -# You can use it according to the terms and conditions of the Mulan PSL v2. -# http://license.coscl.org.cn/MulanPSL2 -# THIS PROGRAM IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, -# EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, -# MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. -# See the Mulan PSL v2 for more details. - -# ############################################# -# @Author : honghua -# @Contact : honghua@iscas.ac.cn -# @Date : 2025-12-05 -# @License : Mulan PSL v2 -# @Desc : 测试使用 --help 参数显示帮助信息 -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - LOG_INFO "开始测试 podman-docker 的 --help 参数功能" - - # 检查是否已安装 podman-docker - if ! dnf list installed podman-docker &>/dev/null; then - LOG_INFO "podman-docker 未安装,将进行安装测试" - INSTALLED=false - else - LOG_INFO "podman-docker 已安装,跳过安装步骤" - INSTALLED=true - fi - - # 检查 yum 源中是否有 podman-docker 软件包 - LOG_INFO "检查 yum 源中是否存在 podman-docker 软件包" - if ! dnf list available podman-docker &>/dev/null; then - LOG_ERROR "yum 源中未找到 podman-docker 软件包" - exit 255 - fi - - # 如果未安装,则安装 podman-docker - if [ "$INSTALLED" = false ]; then - LOG_INFO "正在安装 podman-docker" - dnf install -y podman-docker - CHECK_RESULT $? 0 0 "podman-docker 安装失败" - fi - - # 测试 --help 参数 - LOG_INFO "测试 podman-docker --help 参数" - docker --help &>/dev/null - CHECK_RESULT $? 0 0 "podman-docker --help 参数测试失败" - - # 如果脚本开始时未安装,则卸载 podman-docker - if [ "$INSTALLED" = false ]; then - LOG_INFO "卸载 podman-docker" - dnf remove -y podman-docker - CHECK_RESULT $? 0 0 "podman-docker 卸载失败" - fi - - LOG_INFO "测试完成,环境已恢复" -} - -main "$@" \ No newline at end of file diff --git a/testcases/function_test/pkg_test/podman/podman-docker/test_podman-docker_docker_images.sh b/testcases/function_test/pkg_test/podman/podman-docker/test_podman-docker_docker_images.sh deleted file mode 100644 index bb23ef733c9..00000000000 --- a/testcases/function_test/pkg_test/podman/podman-docker/test_podman-docker_docker_images.sh +++ /dev/null @@ -1,74 +0,0 @@ -#!/usr/bin/bash - -# Copyright (c) 2024 ISCAS .ALL rights reserved. -# This program is licensed under Mulan PSL v2. -# You can use it according to the terms and conditions of the Mulan PSL v2. -# http://license.coscl.org.cn/MulanPSL2 -# THIS PROGRAM IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, -# EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, -# MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. -# See the Mulan PSL v2 for more details. - -# ############################################# -# @Author : honghua -# @Contact : honghua@iscas.ac.cn -# @Date : 2026-04-01 -# @License : Mulan PSL v2 -# @Desc : 执行docker images命令,列出本地存储的镜像 -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - # 检查环境是否已安装podman-docker - LOG_INFO "检查是否已安装podman-docker" - if dnf list installed podman-docker 2>/dev/null | grep -q podman-docker; then - LOG_INFO "podman-docker已安装,标记为保持安装状态" - INSTALLED_BEFORE=1 - else - LOG_INFO "podman-docker未安装" - INSTALLED_BEFORE=0 - fi - - # 检查yum源中是否有podman-docker软件包 - LOG_INFO "检查yum源中是否有podman-docker软件包" - if ! dnf list available podman-docker 2>/dev/null | grep -q podman-docker; then - LOG_ERROR "yum源中未找到podman-docker软件包" - exit 255 - fi - - # 如果未安装,则安装podman-docker - if [ $INSTALLED_BEFORE -eq 0 ]; then - LOG_INFO "安装podman-docker" - dnf install -y podman-docker - CHECK_RESULT $? 0 0 "安装podman-docker失败" - fi - - # 检查docker images命令是否存在 - LOG_INFO "检查docker images命令是否存在" - if ! command -v docker &> /dev/null; then - LOG_ERROR "docker命令不存在" - exit 255 - fi - - # 检查docker images命令是否支持 - LOG_INFO "检查docker images命令是否支持" - docker images --help &>/dev/null - CHECK_RESULT $? 0 0 "docker images命令不支持" - - # 执行docker images命令列出本地存储的镜像 - LOG_INFO "执行docker images命令列出本地存储的镜像" - docker images - CHECK_RESULT $? 0 0 "执行docker images命令失败" - - # 环境清理:如果之前未安装,则卸载podman-docker - if [ $INSTALLED_BEFORE -eq 0 ]; then - LOG_INFO "清理环境:卸载podman-docker" - dnf remove -y podman-docker - CHECK_RESULT $? 0 0 "卸载podman-docker失败" - else - LOG_INFO "保持podman-docker安装状态" - fi -} - -main "$@" \ No newline at end of file diff --git a/testcases/function_test/pkg_test/podman/podman-docker/test_podman-docker_docker_info.sh b/testcases/function_test/pkg_test/podman/podman-docker/test_podman-docker_docker_info.sh deleted file mode 100644 index 73052c81cdb..00000000000 --- a/testcases/function_test/pkg_test/podman/podman-docker/test_podman-docker_docker_info.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-01 -# @License : Mulan PSL v2 -# @Desc : 执行docker info命令,显示podman系统信息 -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - set -e - - LOG_INFO "开始测试:执行docker info命令,显示podman系统信息" - - LOG_INFO "步骤1:检查是否已安装podman-docker" - if command -v docker &> /dev/null; then - LOG_INFO "podman-docker已安装,记录状态以便后续恢复" - INSTALLED=true - else - LOG_INFO "podman-docker未安装,将在测试过程中安装" - INSTALLED=false - fi - - LOG_INFO "步骤2:检查yum源中是否存在podman-docker软件包" - if ! dnf list available podman-docker &> /dev/null; then - LOG_ERROR "yum源中未找到podman-docker软件包" - exit 255 - fi - - if [ "$INSTALLED" = false ]; then - LOG_INFO "步骤3:安装podman-docker软件包" - dnf install -y podman-docker - CHECK_RESULT $? 0 0 "安装podman-docker失败" - fi - - LOG_INFO "步骤4:检查docker info命令是否支持" - if ! docker info --help &> /dev/null; then - LOG_ERROR "docker info命令参数不支持" - if [ "$INSTALLED" = false ]; then - LOG_INFO "清理:卸载podman-docker软件包" - dnf remove -y podman-docker - fi - exit 255 - fi - - LOG_INFO "步骤5:执行docker info命令" - docker info - CHECK_RESULT $? 0 0 "执行docker info命令失败" - - if [ "$INSTALLED" = false ]; then - LOG_INFO "步骤6:清理环境,卸载podman-docker软件包" - dnf remove -y podman-docker - CHECK_RESULT $? 0 0 "卸载podman-docker失败" - else - LOG_INFO "步骤6:保持原有安装状态,不进行卸载" - fi - - LOG_INFO "测试完成" -} - -main "$@" \ No newline at end of file diff --git a/testcases/function_test/pkg_test/podman/podman-docker/test_podman-docker_docker_inspect.sh b/testcases/function_test/pkg_test/podman/podman-docker/test_podman-docker_docker_inspect.sh deleted file mode 100644 index 329a6075ee3..00000000000 --- a/testcases/function_test/pkg_test/podman/podman-docker/test_podman-docker_docker_inspect.sh +++ /dev/null @@ -1,93 +0,0 @@ -#!/usr/bin/bash - -# Copyright (c) 2024 ISCAS .ALL rights reserved. -# This program is licensed under Mulan PSL v2. -# You can use it according to the terms and conditions of the Mulan PSL v2. -# http://license.coscl.org.cn/MulanPSL2 -# THIS PROGRAM IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, -# EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, -# MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. -# See the Mulan PSL v2 for more details. - -# ############################################# -# @Author : honghua -# @Contact : honghua@iscas.ac.cn -# @Date : 2026-04-01 -# @License : Mulan PSL v2 -# @Desc : 执行docker inspect命令,显示指定对象(如容器)的配置信息 -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - # 定义变量 - PACKAGE_NAME="podman-docker" - LOG_FILE="/tmp/test_podman-docker_docker_inspect.log" - - # 清理日志文件 - > "$LOG_FILE" - - # 检查软件包是否在yum源中 - LOG_INFO "检查yum源中是否存在$PACKAGE_NAME软件包" - dnf list available "$PACKAGE_NAME" &>/dev/null - if [ $? -ne 0 ]; then - LOG_ERROR "yum源中不存在$PACKAGE_NAME软件包" - exit 255 - fi - - # 检查环境是否已安装 - LOG_INFO "检查环境是否已安装$PACKAGE_NAME" - if rpm -q "$PACKAGE_NAME" &>/dev/null; then - LOG_INFO "$PACKAGE_NAME已安装,标记为已安装状态" - INSTALLED="true" - else - LOG_INFO "$PACKAGE_NAME未安装,标记为未安装状态" - INSTALLED="false" - fi - - # 如果未安装则进行安装 - if [ "$INSTALLED" = "false" ]; then - LOG_INFO "安装$PACKAGE_NAME软件包" - dnf install -y "$PACKAGE_NAME" &>> "$LOG_FILE" - CHECK_RESULT $? 0 0 "安装$PACKAGE_NAME失败" - fi - - # 检查docker命令是否存在 - LOG_INFO "检查docker命令是否存在" - docker --help &>/dev/null - CHECK_RESULT $? 0 0 "docker命令不存在" - - # 检查docker inspect命令参数支持 - LOG_INFO "检查docker inspect命令参数支持" - docker inspect --help | grep -q "inspect" - CHECK_RESULT $? 0 255 "docker inspect命令参数不存在或不支持" - - # 创建测试容器 - LOG_INFO "创建测试容器" - docker run -d --name test_inspect_container busybox sleep 3600 &>> "$LOG_FILE" - CHECK_RESULT $? 0 0 "创建测试容器失败" - - # 执行docker inspect命令 - LOG_INFO "执行docker inspect命令" - docker inspect test_inspect_container &>> "$LOG_FILE" - CHECK_RESULT $? 0 0 "docker inspect命令执行失败" - - # 清理测试容器 - LOG_INFO "清理测试容器" - docker stop test_inspect_container &>> "$LOG_FILE" - docker rm test_inspect_container &>> "$LOG_FILE" - CHECK_RESULT $? 0 0 "清理测试容器失败" - - # 环境恢复 - if [ "$INSTALLED" = "false" ]; then - LOG_INFO "卸载$PACKAGE_NAME软件包" - dnf remove -y "$PACKAGE_NAME" &>> "$LOG_FILE" - 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/podman/podman-docker/test_podman-docker_docker_log_level.sh b/testcases/function_test/pkg_test/podman/podman-docker/test_podman-docker_docker_log_level.sh deleted file mode 100644 index ca9433d8f25..00000000000 --- a/testcases/function_test/pkg_test/podman/podman-docker/test_podman-docker_docker_log_level.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-05 -# @License : Mulan PSL v2 -# @Desc : 测试使用 --log-level 参数设置日志级别 -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - LOG_INFO "开始测试 podman-docker 的 --log-level 参数设置日志级别功能" - - # 检查是否已安装 podman-docker - if ! dnf list installed podman-docker &>/dev/null; then - LOG_INFO "环境中未安装 podman-docker,将进行安装" - if ! dnf list available podman-docker &>/dev/null; then - LOG_ERROR "yum 源中未找到 podman-docker 软件包" - exit 255 - fi - dnf install -y podman-docker - CHECK_RESULT $? 0 0 "安装 podman-docker 失败" - INSTALLED=true - else - LOG_INFO "环境中已安装 podman-docker" - INSTALLED=false - fi - - # 测试 --log-level 参数 - LOG_INFO "测试 --log-level 参数设置日志级别" - podman-docker --log-level=debug info &>/dev/null - CHECK_RESULT $? 0 0 "--log-level=debug 参数不支持或执行失败" - - podman-docker --log-level=info info &>/dev/null - CHECK_RESULT $? 0 0 "--log-level=info 参数不支持或执行失败" - - podman-docker --log-level=warn info &>/dev/null - CHECK_RESULT $? 0 0 "--log-level=warn 参数不支持或执行失败" - - podman-docker --log-level=error info &>/dev/null - CHECK_RESULT $? 0 0 "--log-level=error 参数不支持或执行失败" - - # 清理环境 - if [ "$INSTALLED" = true ]; then - LOG_INFO "清理环境,卸载 podman-docker" - dnf remove -y podman-docker - CHECK_RESULT $? 0 0 "卸载 podman-docker 失败" - fi - - LOG_INFO "测试完成" -} - -main "$@" \ No newline at end of file diff --git a/testcases/function_test/pkg_test/podman/podman-docker/test_podman-docker_docker_logs.sh b/testcases/function_test/pkg_test/podman/podman-docker/test_podman-docker_docker_logs.sh deleted file mode 100644 index 323bde86086..00000000000 --- a/testcases/function_test/pkg_test/podman/podman-docker/test_podman-docker_docker_logs.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-01 -# @License : Mulan PSL v2 -# @Desc : 执行docker logs命令,获取一个或多个容器的日志 -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - LOG_INFO "开始测试docker logs命令功能" - LOG_INFO "检查测试环境是否已安装podman-docker软件包" - - # 检查podman-docker是否已安装 - if dnf list installed podman-docker &>/dev/null; then - LOG_INFO "检测到podman-docker已安装,测试结束后将保持安装状态" - already_installed=true - else - LOG_INFO "未检测到podman-docker安装,将在测试过程中安装" - already_installed=false - fi - - # 检查yum源中是否有podman-docker软件包 - LOG_INFO "检查yum源中是否存在podman-docker软件包" - dnf list available podman-docker &>/dev/null - CHECK_RESULT $? 0 0 "yum源中未找到podman-docker软件包" - if [ $? -ne 0 ]; then - LOG_ERROR "yum源中不存在podman-docker软件包" - exit 255 - fi - - # 如果未安装则安装podman-docker - if [ "$already_installed" = "false" ]; then - LOG_INFO "安装podman-docker软件包" - dnf install -y podman-docker - CHECK_RESULT $? 0 0 "安装podman-docker失败" - fi - - # 检查docker命令是否存在 - LOG_INFO "检查docker命令是否可用" - docker --version &>/dev/null - CHECK_RESULT $? 0 0 "docker命令不可用" - - # 启动测试容器 - LOG_INFO "启动测试容器" - docker run -d --name test_container1 busybox sh -c "for i in {1..5}; do echo "日志消息 $i"; sleep 1; done" - CHECK_RESULT $? 0 0 "启动第一个测试容器失败" - - docker run -d --name test_container2 busybox sh -c "for i in {1..3}; do echo "第二个容器日志 $i"; sleep 2; done" - CHECK_RESULT $? 0 0 "启动第二个测试容器失败" - - # 等待容器生成一些日志 - LOG_INFO "等待容器生成日志" - sleep 6 - - # 测试获取单个容器日志 - LOG_INFO "测试获取单个容器日志" - docker logs test_container1 - CHECK_RESULT $? 0 0 "获取单个容器日志失败" - - # 测试获取多个容器日志 - LOG_INFO "测试获取多个容器日志" - docker logs test_container1 test_container2 - CHECK_RESULT $? 0 0 "获取多个容器日志失败" - - # 测试不存在的容器日志 - LOG_INFO "测试获取不存在容器的日志" - docker logs nonexistent_container 2>/dev/null - if [ $? -eq 0 ]; then - LOG_ERROR "获取不存在容器的日志应该失败" - exit 255 - fi - - # 测试不支持的参数 - LOG_INFO "测试不支持的参数" - docker logs --invalid-param test_container1 2>/dev/null - if [ $? -eq 0 ]; then - LOG_ERROR "不支持的参数应该导致命令失败" - exit 255 - fi - - # 清理测试容器 - LOG_INFO "清理测试容器" - docker stop test_container1 test_container2 2>/dev/null - docker rm test_container1 test_container2 2>/dev/null - - # 如果测试前未安装,则卸载podman-docker - if [ "$already_installed" = "false" ]; then - LOG_INFO "卸载podman-docker软件包" - dnf remove -y podman-docker - CHECK_RESULT $? 0 0 "卸载podman-docker失败" - else - LOG_INFO "保持podman-docker安装状态" - fi - - LOG_INFO "docker logs命令功能测试完成" -} - -main "$@" \ No newline at end of file diff --git a/testcases/function_test/pkg_test/podman/podman-docker/test_podman-docker_docker_pull.sh b/testcases/function_test/pkg_test/podman/podman-docker/test_podman-docker_docker_pull.sh deleted file mode 100644 index 9bfa945db15..00000000000 --- a/testcases/function_test/pkg_test/podman/podman-docker/test_podman-docker_docker_pull.sh +++ /dev/null @@ -1,158 +0,0 @@ -#!/usr/bin/bash - -# Copyright (c) 2024 ISCAS .ALL rights reserved. -# This program is licensed under Mulan PSL v2. -# You can use it according to the terms and conditions of the Mulan PSL v2. -# http://license.coscl.org.cn/MulanPSL2 -# THIS PROGRAM IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, -# EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, -# MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. -# See the Mulan PSL v2 for more details. - -# ############################################# -# @Author : honghua -# @Contact : honghua@iscas.ac.cn -# @Date : 2026-04-01 -# @License : Mulan PSL v2 -# @Desc : 执行docker pull命令,从注册表拉取镜像 -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - # 定义颜色输出(可选,但通常测试框架会提供) - LOG_INFO() { - echo "[INFO] $*" - } - - LOG_ERROR() { - echo "[ERROR] $*" - } - - # 检查软件包是否在yum源中存在 - check_package_in_repo() { - local package=$1 - LOG_INFO "检查yum源中是否存在软件包: $package" - dnf list available "$package" &>/dev/null - if [ $? -ne 0 ]; then - LOG_ERROR "yum源中不存在软件包: $package" - exit 255 - fi - LOG_INFO "软件包 $package 存在于yum源中" - } - - # 检查命令参数是否存在 - check_command_param() { - local command=$1 - local param=$2 - LOG_INFO "检查命令 $command 是否支持参数: $param" - if ! $command --help 2>/dev/null | grep -q -- "$param"; then - LOG_ERROR "命令 $command 不支持参数: $param" - exit 255 - fi - LOG_INFO "命令 $command 支持参数: $param" - } - - # 检查命令执行结果 - check_command_result() { - local result=$1 - local expected=$2 - local error_msg=$3 - if [ $result -ne $expected ]; then - LOG_ERROR "$error_msg" - exit $result - fi - } - - # 检查是否已安装podman-docker或docker - check_installed() { - LOG_INFO "检查是否已安装podman-docker或docker" - if command -v docker &>/dev/null; then - LOG_INFO "docker已安装" - return 0 - elif command -v podman &>/dev/null && podman --help 2>/dev/null | grep -q "docker"; then - LOG_INFO "podman-docker已安装" - return 0 - else - LOG_INFO "未安装podman-docker或docker" - return 1 - fi - } - - # 安装podman-docker - install_podman_docker() { - LOG_INFO "开始安装podman-docker" - check_package_in_repo "podman-docker" - dnf install -y podman-docker - CHECK_RESULT $? 0 0 "安装podman-docker失败" - LOG_INFO "podman-docker安装成功" - } - - # 卸载podman-docker - uninstall_podman_docker() { - LOG_INFO "开始卸载podman-docker" - dnf remove -y podman-docker - CHECK_RESULT $? 0 0 "卸载podman-docker失败" - LOG_INFO "podman-docker卸载成功" - } - - # 测试docker pull命令 - test_docker_pull() { - local test_image="busybox:latest" - LOG_INFO "测试docker pull命令,拉取镜像: $test_image" - - # 检查docker pull命令是否存在 - if ! command -v docker &>/dev/null; then - LOG_ERROR "docker命令不存在" - exit 1 - fi - - # 检查pull参数是否支持 - check_command_param "docker" "pull" - - # 执行docker pull命令 - LOG_INFO "执行命令: docker pull $test_image" - docker pull "$test_image" - CHECK_RESULT $? 0 0 "docker pull命令执行失败" - - # 验证镜像是否拉取成功 - LOG_INFO "验证镜像是否拉取成功" - docker images --format "{{.Repository}}:{{.Tag}}" | grep -q "^${test_image}$" - CHECK_RESULT $? 0 0 "镜像拉取成功后未在本地镜像列表中找到" - - LOG_INFO "镜像 $test_image 拉取成功" - - # 清理测试镜像 - LOG_INFO "清理测试镜像: $test_image" - docker rmi "$test_image" - CHECK_RESULT $? 0 0 "清理测试镜像失败" - LOG_INFO "测试镜像清理成功" - } - - # 主函数 - main() { - LOG_INFO "开始测试docker pull命令" - - # 检查是否已安装 - local need_cleanup=0 - if ! check_installed; then - need_cleanup=1 - install_podman_docker - fi - - # 执行测试 - test_docker_pull - - # 环境恢复 - if [ $need_cleanup -eq 1 ]; then - uninstall_podman_docker - fi - - LOG_INFO "测试完成,环境已恢复" - } - - # 执行主函数 - main -} - -main "$@" \ No newline at end of file diff --git a/testcases/function_test/pkg_test/podman/podman-docker/test_podman-docker_docker_remote.sh b/testcases/function_test/pkg_test/podman/podman-docker/test_podman-docker_docker_remote.sh deleted file mode 100644 index f9cf77e274c..00000000000 --- a/testcases/function_test/pkg_test/podman/podman-docker/test_podman-docker_docker_remote.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-05 -# @License : Mulan PSL v2 -# @Desc : 测试使用 --remote 参数访问远程 Podman 服务 -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - - # 检查是否已安装podman-docker和docker-remote - LOG_INFO "检查是否已安装podman-docker和docker-remote" - if ! dnf list installed podman-docker &> /dev/null || ! dnf list installed docker-remote &> /dev/null; then - LOG_INFO "未安装podman-docker或docker-remote,开始安装" - # 检查yum源中是否有podman-docker和docker-remote - if ! dnf list available podman-docker &> /dev/null; then - LOG_ERROR "yum源中未找到podman-docker软件包" - exit 255 - fi - if ! dnf list available docker-remote &> /dev/null; then - LOG_ERROR "yum源中未找到docker-remote软件包" - exit 255 - fi - # 安装软件包 - dnf install -y podman-docker docker-remote - CHECK_RESULT $? 0 0 "安装podman-docker和docker-remote失败" - # 标记为需要卸载 - NEED_UNINSTALL=1 - else - LOG_INFO "podman-docker和docker-remote已安装" - NEED_UNINSTALL=0 - fi - - # 测试使用--remote参数访问远程Podman服务 - LOG_INFO "测试使用--remote参数访问远程Podman服务" - if ! podman --remote --help &> /dev/null; then - LOG_ERROR "--remote参数不支持或命令执行失败" - exit 255 - fi - - # 清理环境 - if [ $NEED_UNINSTALL -eq 1 ]; then - LOG_INFO "清理环境,卸载podman-docker和docker-remote" - dnf remove -y podman-docker docker-remote - CHECK_RESULT $? 0 0 "卸载podman-docker和docker-remote失败" - fi - - LOG_INFO "测试脚本执行完成" -} - -main "$@" \ No newline at end of file diff --git a/testcases/function_test/pkg_test/podman/podman-docker/test_podman-docker_docker_rm.sh b/testcases/function_test/pkg_test/podman/podman-docker/test_podman-docker_docker_rm.sh deleted file mode 100644 index 9b775274dea..00000000000 --- a/testcases/function_test/pkg_test/podman/podman-docker/test_podman-docker_docker_rm.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-04-01 -# @License : Mulan PSL v2 -# @Desc : 执行docker rm命令,移除一个或多个容器 -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - LOG_INFO "开始测试:执行docker rm命令,移除一个或多个容器" - - # 检查是否已安装podman-docker或docker - LOG_INFO "检查是否已安装podman-docker或docker" - if command -v docker &> /dev/null; then - LOG_INFO "docker已安装" - installed=true - elif dnf list installed podman-docker &> /dev/null; then - LOG_INFO "podman-docker已安装" - installed=true - else - LOG_INFO "未安装docker或podman-docker,将在测试中安装podman-docker" - installed=false - fi - - # 检查yum源中是否有podman-docker软件包 - LOG_INFO "检查yum源中是否有podman-docker软件包" - if ! dnf list available podman-docker &> /dev/null; then - LOG_ERROR "yum源中没有podman-docker软件包" - exit 255 - fi - - # 如果未安装,则安装podman-docker - if [ "$installed" = false ]; then - LOG_INFO "安装podman-docker" - dnf install -y podman-docker - CHECK_RESULT $? 0 0 "安装podman-docker失败" - fi - - # 启动一个测试容器用于移除测试 - LOG_INFO "启动一个测试容器用于移除测试" - docker run -d --name test_rm_container busybox sleep 3600 - CHECK_RESULT $? 0 0 "启动测试容器失败" - - # 执行docker rm命令移除容器 - LOG_INFO "执行docker rm命令移除容器" - docker rm -f test_rm_container - CHECK_RESULT $? 0 0 "移除容器失败" - - # 验证容器是否已移除 - LOG_INFO "验证容器是否已移除" - if docker ps -a | grep -q test_rm_container; then - LOG_ERROR "容器移除失败" - exit 1 - else - LOG_INFO "容器移除成功" - fi - - # 环境恢复:如果测试前未安装,则卸载podman-docker - if [ "$installed" = false ]; then - LOG_INFO "卸载podman-docker" - dnf remove -y podman-docker - CHECK_RESULT $? 0 0 "卸载podman-docker失败" - fi - - LOG_INFO "测试完成" -} - -main "$@" \ No newline at end of file diff --git a/testcases/function_test/pkg_test/podman/podman-docker/test_podman-docker_docker_run.sh b/testcases/function_test/pkg_test/podman/podman-docker/test_podman-docker_docker_run.sh deleted file mode 100644 index 3d0fcf87ae6..00000000000 --- a/testcases/function_test/pkg_test/podman/podman-docker/test_podman-docker_docker_run.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-01 -# @License : Mulan PSL v2 -# @Desc : 执行docker run命令,在新容器中运行命令 -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - # 判断是否已安装podman-docker - LOG_INFO "检查podman-docker是否已安装" - if dnf list installed podman-docker &>/dev/null; then - LOG_INFO "podman-docker已安装,测试结束后将保持安装状态" - INSTALLED="true" - else - LOG_INFO "podman-docker未安装,将在测试中安装" - INSTALLED="false" - fi - - # 检查yum源中是否有podman-docker软件包 - LOG_INFO "检查yum源中是否存在podman-docker软件包" - if ! dnf list available podman-docker &>/dev/null; then - LOG_ERROR "yum源中未找到podman-docker软件包" - exit 255 - fi - - # 如果未安装,则安装podman-docker - if [ "$INSTALLED" = "false" ]; then - LOG_INFO "安装podman-docker软件包" - dnf install -y podman-docker - CHECK_RESULT $? 0 0 "安装podman-docker失败" - fi - - # 检查docker命令是否存在 - LOG_INFO "检查docker命令是否存在" - if ! command -v docker &>/dev/null; then - LOG_ERROR "docker命令不存在" - if [ "$INSTALLED" = "false" ]; then - LOG_INFO "清理环境:卸载podman-docker" - dnf remove -y podman-docker - fi - exit 255 - fi - - # 检查docker run命令是否支持 - LOG_INFO "检查docker run命令是否支持" - docker run --help &>/dev/null - CHECK_RESULT $? 0 0 "docker run命令不支持" - - # 测试docker run命令在新容器中运行命令 - LOG_INFO "执行docker run命令,在新容器中运行命令" - docker run --rm alpine echo "Hello from container" - CHECK_RESULT $? 0 0 "docker run命令执行失败" - - # 清理环境 - if [ "$INSTALLED" = "false" ]; then - LOG_INFO "清理环境:卸载podman-docker" - dnf remove -y podman-docker - CHECK_RESULT $? 0 0 "卸载podman-docker失败" - else - LOG_INFO "保持podman-docker安装状态" - fi - - LOG_INFO "测试完成" -} - -main "$@" \ No newline at end of file diff --git a/testcases/function_test/pkg_test/podman/podman-docker/test_podman-docker_docker_stop.sh b/testcases/function_test/pkg_test/podman/podman-docker/test_podman-docker_docker_stop.sh deleted file mode 100644 index 79e5527a9bd..00000000000 --- a/testcases/function_test/pkg_test/podman/podman-docker/test_podman-docker_docker_stop.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-04-01 -# @License : Mulan PSL v2 -# @Desc : 执行docker stop命令,停止一个或多个容器 -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - # 检查是否已安装podman-docker或docker - if dnf list installed podman-docker &>/dev/null; then - LOG_INFO "环境已安装podman-docker,测试结束后将保持安装状态" - already_installed=1 - elif dnf list installed docker &>/dev/null; then - LOG_INFO "环境已安装docker,测试结束后将保持安装状态" - already_installed=1 - else - LOG_INFO "环境未安装podman-docker或docker,将在测试前安装podman-docker" - already_installed=0 - fi - - # 检查yum源中是否有podman-docker软件包 - LOG_INFO "检查yum源中是否存在podman-docker软件包" - if ! dnf list available podman-docker &>/dev/null; then - LOG_ERROR "yum源中未找到podman-docker软件包" - exit 255 - fi - - # 如果未安装,则安装podman-docker - if [ $already_installed -eq 0 ]; then - LOG_INFO "开始安装podman-docker" - dnf install -y podman-docker - CHECK_RESULT $? 0 0 "安装podman-docker失败" - LOG_INFO "podman-docker安装成功" - fi - - # 启动docker服务 - LOG_INFO "启动docker服务" - systemctl start docker - CHECK_RESULT $? 0 0 "启动docker服务失败" - - # 拉取一个测试镜像 - LOG_INFO "拉取busybox测试镜像" - docker pull busybox - CHECK_RESULT $? 0 0 "拉取busybox镜像失败" - - # 创建并启动一个测试容器 - LOG_INFO "创建并启动测试容器test-container-1" - docker run -d --name test-container-1 busybox sleep 300 - CHECK_RESULT $? 0 0 "启动容器test-container-1失败" - - # 创建并启动第二个测试容器 - LOG_INFO "创建并启动测试容器test-container-2" - docker run -d --name test-container-2 busybox sleep 300 - CHECK_RESULT $? 0 0 "启动容器test-container-2失败" - - # 测试停止单个容器 - LOG_INFO "测试停止单个容器test-container-1" - docker stop test-container-1 - CHECK_RESULT $? 0 0 "停止容器test-container-1失败" - - # 检查容器是否已停止 - LOG_INFO "检查容器test-container-1是否已停止" - docker inspect -f "{{.State.Status}}" test-container-1 | grep -q exited - CHECK_RESULT $? 0 0 "容器test-container-1未正确停止" - - # 测试停止多个容器 - LOG_INFO "测试停止多个容器:test-container-2" - docker stop test-container-2 - CHECK_RESULT $? 0 0 "停止容器test-container-2失败" - - # 检查第二个容器是否已停止 - LOG_INFO "检查容器test-container-2是否已停止" - docker inspect -f "{{.State.Status}}" test-container-2 | grep -q exited - CHECK_RESULT $? 0 0 "容器test-container-2未正确停止" - - # 清理测试容器 - LOG_INFO "清理测试容器" - docker rm test-container-1 test-container-2 - CHECK_RESULT $? 0 0 "删除测试容器失败" - - # 清理测试镜像 - LOG_INFO "清理测试镜像" - docker rmi busybox - CHECK_RESULT $? 0 0 "删除busybox镜像失败" - - # 如果测试前未安装,则卸载podman-docker - if [ $already_installed -eq 0 ]; then - LOG_INFO "卸载podman-docker" - dnf remove -y podman-docker - CHECK_RESULT $? 0 0 "卸载podman-docker失败" - LOG_INFO "podman-docker卸载成功" - else - LOG_INFO "保持podman-docker安装状态" - fi - - # 如果测试前未安装,停止docker服务 - if [ $already_installed -eq 0 ]; then - LOG_INFO "停止docker服务" - systemctl stop docker - CHECK_RESULT $? 0 0 "停止docker服务失败" - fi - - LOG_INFO "测试完成,环境已恢复" -} - -main "$@" \ No newline at end of file diff --git a/testcases/function_test/pkg_test/podman/podman-docker/test_podman-docker_docker_upper_v.sh b/testcases/function_test/pkg_test/podman/podman-docker/test_podman-docker_docker_upper_v.sh deleted file mode 100644 index 0f8a8d0b111..00000000000 --- a/testcases/function_test/pkg_test/podman/podman-docker/test_podman-docker_docker_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-04-01 -# @License : Mulan PSL v2 -# @Desc : 执行docker -v命令,显示podman的版本信息 -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - LOG_INFO "开始测试docker -v命令显示podman版本信息" - - # 检查是否已安装podman-docker - LOG_INFO "检查podman-docker是否已安装" - if dnf list installed podman-docker &>/dev/null; then - LOG_INFO "podman-docker已安装,测试后保持安装状态" - already_installed=true - else - LOG_INFO "podman-docker未安装,将在测试后卸载" - already_installed=false - fi - - # 检查yum源中是否有podman-docker软件包 - LOG_INFO "检查yum源中是否有podman-docker软件包" - if ! dnf list available podman-docker &>/dev/null; then - LOG_ERROR "yum源中未找到podman-docker软件包" - exit 255 - fi - - # 如果未安装,则安装podman-docker - if [ "$already_installed" = false ]; then - LOG_INFO "安装podman-docker软件包" - dnf install -y podman-docker - CHECK_RESULT $? 0 0 "安装podman-docker失败" - fi - - # 检查docker命令是否存在 - LOG_INFO "检查docker命令是否存在" - if ! command -v docker &>/dev/null; then - LOG_ERROR "docker命令不存在" - exit 255 - fi - - # 检查docker命令是否支持-v参数 - LOG_INFO "检查docker命令是否支持-v参数" - docker --help | grep -q "\-v" - if [ $? -ne 0 ]; then - LOG_ERROR "docker命令不支持-v参数" - exit 255 - fi - - # 执行docker -v命令 - LOG_INFO "执行docker -v命令" - docker_output=$(docker -v 2>&1) - docker_exit_code=$? - - # 检查命令执行是否成功 - if [ $docker_exit_code -ne 0 ]; then - LOG_ERROR "docker -v命令执行失败,退出码: $docker_exit_code" - exit $docker_exit_code - fi - - # 检查输出是否包含podman版本信息 - LOG_INFO "检查输出是否包含podman版本信息" - if echo "$docker_output" | grep -qi "podman"; then - LOG_INFO "测试成功:docker -v显示了podman版本信息" - CHECK_RESULT $? 0 0 "docker -v未显示podman版本信息" - else - LOG_ERROR "测试失败:docker -v未显示podman版本信息" - CHECK_RESULT 1 0 0 "docker -v未显示podman版本信息" - fi - - # 环境清理 - LOG_INFO "清理测试环境" - if [ "$already_installed" = false ]; then - LOG_INFO "卸载podman-docker软件包" - dnf remove -y podman-docker - CHECK_RESULT $? 0 0 "卸载podman-docker失败" - fi - - LOG_INFO "测试完成" -} - -main "$@" \ No newline at end of file diff --git a/testcases/function_test/pkg_test/podman/podman-docker/test_podman-docker_docker_v.sh b/testcases/function_test/pkg_test/podman/podman-docker/test_podman-docker_docker_v.sh deleted file mode 100644 index f01b29df75a..00000000000 --- a/testcases/function_test/pkg_test/podman/podman-docker/test_podman-docker_docker_v.sh +++ /dev/null @@ -1,63 +0,0 @@ -#!/usr/bin/bash - -# Copyright (c) 2024 ISCAS .ALL rights reserved. -# This program is licensed under Mulan PSL v2. -# You can use it according to the terms and conditions of the Mulan PSL v2. -# http://license.coscl.org.cn/MulanPSL2 -# THIS PROGRAM IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, -# EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, -# MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. -# See the Mulan PSL v2 for more details. - -# ############################################# -# @Author : honghua -# @Contact : honghua@iscas.ac.cn -# @Date : 2025-12-05 -# @License : Mulan PSL v2 -# @Desc : 测试使用 -v 参数显示版本信息 -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - - # 检查是否已经安装podman-docker - if ! dnf list installed podman-docker &> /dev/null; then - LOG_INFO "环境未安装podman-docker,将进行安装测试" - INSTALLED=false - else - LOG_INFO "环境已安装podman-docker,保持安装状态" - INSTALLED=true - fi - - # 检查yum源中是否有podman-docker软件包 - LOG_INFO "检查yum源中是否有podman-docker软件包" - if ! dnf list available podman-docker &> /dev/null; then - LOG_ERROR "yum源中未找到podman-docker软件包" - exit 255 - fi - - # 如果未安装,则安装podman-docker - if [ "$INSTALLED" = false ]; then - LOG_INFO "开始安装podman-docker" - dnf install -y podman-docker - CHECK_RESULT $? 0 0 "安装podman-docker失败" - fi - - # 测试使用 -v 参数显示版本信息 - LOG_INFO "测试使用 -v 参数显示版本信息" - docker -v &> /dev/null - CHECK_RESULT $? 0 0 "docker -v 命令执行失败" - - # 如果之前未安装,则卸载podman-docker - if [ "$INSTALLED" = false ]; then - LOG_INFO "卸载podman-docker" - dnf remove -y podman-docker - CHECK_RESULT $? 0 0 "卸载podman-docker失败" - fi - - LOG_INFO "测试脚本执行完成" - -} - -main "$@" \ No newline at end of file diff --git a/testcases/function_test/pkg_test/podman/podman-docker/test_podman-docker_function_check.sh b/testcases/function_test/pkg_test/podman/podman-docker/test_podman-docker_function_check.sh deleted file mode 100644 index 98fde76baf5..00000000000 --- a/testcases/function_test/pkg_test/podman/podman-docker/test_podman-docker_function_check.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-04-01 -# @License : Mulan PSL v2 -# @Desc : 测试检查podman-docker是否已正确安装 -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - LOG_INFO "开始测试:检查podman-docker是否已正确安装" - - # 检查环境是否已安装podman-docker - LOG_INFO "检查环境是否已安装podman-docker" - if dnf list installed podman-docker &>/dev/null; then - LOG_INFO "podman-docker已安装,测试结束前将保持安装状态" - INSTALLED=true - else - LOG_INFO "podman-docker未安装,将在测试过程中安装" - INSTALLED=false - fi - - # 检查yum源中是否有podman-docker软件包 - LOG_INFO "检查yum源中是否有podman-docker软件包" - if ! dnf list available podman-docker &>/dev/null; then - LOG_ERROR "yum源中未找到podman-docker软件包" - exit 255 - fi - - # 如果未安装,则安装podman-docker - if [ "$INSTALLED" = false ]; then - LOG_INFO "安装podman-docker软件包" - dnf install -y podman-docker - CHECK_RESULT $? 0 0 "安装podman-docker失败" - fi - - # 检查podman-docker是否安装成功 - LOG_INFO "检查podman-docker是否安装成功" - rpm -q podman-docker - CHECK_RESULT $? 0 0 "podman-docker未正确安装" - - # 检查podman-docker命令参数是否支持 - LOG_INFO "检查podman-docker命令参数是否支持" - podman --help | grep -q "version" - CHECK_RESULT $? 0 0 "podman命令不支持version参数" - - # 测试podman-docker基本功能 - LOG_INFO "测试podman-docker基本功能" - podman version - CHECK_RESULT $? 0 0 "podman version命令执行失败" - - # 环境清理 - LOG_INFO "开始环境清理" - if [ "$INSTALLED" = false ]; then - LOG_INFO "卸载podman-docker软件包" - dnf remove -y podman-docker - CHECK_RESULT $? 0 0 "卸载podman-docker失败" - else - LOG_INFO "podman-docker已安装,保持原状" - fi - - LOG_INFO "测试完成:podman-docker已正确安装" -} - -main "$@" \ No newline at end of file diff --git a/testcases/function_test/pkg_test/podman/podman-docker/test_podman-docker_function_docker.sh b/testcases/function_test/pkg_test/podman/podman-docker/test_podman-docker_function_docker.sh deleted file mode 100644 index b260aeee44e..00000000000 --- a/testcases/function_test/pkg_test/podman/podman-docker/test_podman-docker_function_docker.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-04-01 -# @License : Mulan PSL v2 -# @Desc : 测试执行docker命令返回概述 -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - LOG_INFO "开始测试:测试执行docker命令返回概述" - - # 检查是否已安装docker - LOG_INFO "检查docker是否已安装" - if command -v docker &> /dev/null; then - LOG_INFO "docker已安装,将保持安装状态" - INSTALLED=true - else - LOG_INFO "docker未安装,将在测试过程中安装" - INSTALLED=false - fi - - # 检查yum源中是否有docker软件包 - LOG_INFO "检查yum源中是否有docker软件包" - if ! dnf list docker-ce 2>/dev/null | grep -q docker-ce; then - LOG_ERROR "yum源中未找到docker软件包" - exit 255 - fi - - # 如果未安装,则安装docker - if [ "$INSTALLED" = false ]; then - LOG_INFO "安装docker" - dnf install -y docker-ce - CHECK_RESULT $? 0 0 "docker安装失败" - fi - - # 测试docker命令返回概述 - LOG_INFO "执行docker命令返回概述" - docker --help - CHECK_RESULT $? 0 0 "docker命令执行失败" - - # 清理环境:如果测试前未安装,则卸载docker - if [ "$INSTALLED" = false ]; then - LOG_INFO "卸载docker" - dnf remove -y docker-ce - CHECK_RESULT $? 0 0 "docker卸载失败" - fi - - LOG_INFO "测试完成" -} - -main "$@" \ No newline at end of file diff --git a/testcases/function_test/pkg_test/podman/podman-docker/test_podman-docker_function_images.sh b/testcases/function_test/pkg_test/podman/podman-docker/test_podman-docker_function_images.sh deleted file mode 100644 index af990d6dc48..00000000000 --- a/testcases/function_test/pkg_test/podman/podman-docker/test_podman-docker_function_images.sh +++ /dev/null @@ -1,62 +0,0 @@ -#!/usr/bin/bash - -# Copyright (c) 2024 ISCAS .ALL rights reserved. -# This program is licensed under Mulan PSL v2. -# You can use it according to the terms and conditions of the Mulan PSL v2. -# http://license.coscl.org.cn/MulanPSL2 -# THIS PROGRAM IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, -# EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, -# MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. -# See the Mulan PSL v2 for more details. - -# ############################################# -# @Author : honghua -# @Contact : honghua@iscas.ac.cn -# @Date : 2025-12-05 -# @License : Mulan PSL v2 -# @Desc : 测试 podman-docker 的 docker images 命令,列出镜像 -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - # 测试脚本:test_podman-docker_function_images - - LOG_INFO "开始测试 podman-docker 的 docker images 命令,列出镜像" - - # 检查是否已安装 podman-docker - LOG_INFO "检查 podman-docker 是否已安装" - if ! dnf list installed podman-docker &>/dev/null; then - LOG_INFO "podman-docker 未安装,开始安装" - if ! dnf list available podman-docker &>/dev/null; then - LOG_ERROR "yum 源中未找到 podman-docker 软件包" - exit 255 - fi - dnf install -y podman-docker - CHECK_RESULT $? 0 0 "安装 podman-docker 失败" - INSTALLED=1 - else - LOG_INFO "podman-docker 已安装" - INSTALLED=0 - fi - - # 检查 docker images 命令是否可用 - LOG_INFO "检查 docker images 命令是否可用" - if ! command -v docker &>/dev/null; then - LOG_ERROR "docker 命令不存在" - exit 255 - fi - - # 执行 docker images 命令 - LOG_INFO "执行 docker images 命令列出镜像" - docker images - CHECK_RESULT $? 0 0 "执行 docker images 命令失败" - - # 清理环境:如果脚本安装了 podman-docker,则卸载 - if [ "$INSTALLED" -eq 1 ]; then - LOG_INFO "卸载 podman-docker" - dnf remove -y podman-docker - CHECK_RESULT $?, -} - -main "$@" \ No newline at end of file diff --git a/testcases/function_test/pkg_test/podman/podman-docker/test_podman-docker_function_install.sh b/testcases/function_test/pkg_test/podman/podman-docker/test_podman-docker_function_install.sh deleted file mode 100644 index 5738f464491..00000000000 --- a/testcases/function_test/pkg_test/podman/podman-docker/test_podman-docker_function_install.sh +++ /dev/null @@ -1,109 +0,0 @@ -#!/usr/bin/bash - -# Copyright (c) 2024 ISCAS .ALL rights reserved. -# This program is licensed under Mulan PSL v2. -# You can use it according to the terms and conditions of the Mulan PSL v2. -# http://license.coscl.org.cn/MulanPSL2 -# THIS PROGRAM IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, -# EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, -# MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. -# See the Mulan PSL v2 for more details. - -# ############################################# -# @Author : honghua -# @Contact : honghua@iscas.ac.cn -# @Date : 2026-04-01 -# @License : Mulan PSL v2 -# @Desc : 测试软件包podman-docker的安装功能 -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - # 测试软件包podman-docker的安装功能 - LOG_INFO "开始测试podman-docker软件包安装功能" - - # 步骤1:检查当前是否已安装podman-docker - LOG_INFO "步骤1:检查当前是否已安装podman-docker" - rpm -q podman-docker > /dev/null 2>&1 - if [ $? -eq 0 ]; then - LOG_INFO "检测到podman-docker已安装,测试结束后将保持安装状态" - already_installed=1 - else - LOG_INFO "检测到podman-docker未安装" - already_installed=0 - fi - - # 步骤2:检查yum源中是否有podman-docker软件包 - LOG_INFO "步骤2:检查yum源中是否有podman-docker软件包" - dnf list available podman-docker > /dev/null 2>&1 - CHECK_RESULT $? 0 0 "yum源中未找到podman-docker软件包" - if [ $? -ne 0 ]; then - LOG_ERROR "yum源中未找到podman-docker软件包" - exit 255 - fi - - # 步骤3:如果未安装,则安装podman-docker软件包 - if [ $already_installed -eq 0 ]; then - LOG_INFO "步骤3:安装podman-docker软件包" - dnf install -y podman-docker - CHECK_RESULT $? 0 0 "安装podman-docker失败" - - # 验证安装是否成功 - LOG_INFO "验证podman-docker安装是否成功" - rpm -q podman-docker > /dev/null 2>&1 - CHECK_RESULT $? 0 0 "podman-docker安装后验证失败" - fi - - # 步骤4:检查podman-docker命令参数支持情况 - LOG_INFO "步骤4:检查podman-docker命令参数支持情况" - podman --help > /dev/null 2>&1 - CHECK_RESULT $? 0 0 "podman命令不存在或不支持" - if [ $? -ne 0 ]; then - LOG_ERROR "podman命令不存在或不支持" - exit 255 - fi - - # 步骤5:测试podman基本功能 - LOG_INFO "步骤5:测试podman基本功能" - podman version > /dev/null 2>&1 - CHECK_RESULT $? 0 0 "podman version命令执行失败" - - podman info > /dev/null 2>&1 - CHECK_RESULT $? 0 0 "podman info命令执行失败" - - # 步骤6:测试docker兼容性功能 - LOG_INFO "步骤6:测试docker兼容性功能" - # 检查docker命令是否可用(通过podman-docker提供的docker别名) - docker --help > /dev/null 2>&1 - if [ $? -eq 0 ]; then - LOG_INFO "docker命令可用,执行简单测试" - docker version > /dev/null 2>&1 - CHECK_RESULT $? 0 0 "docker version命令执行失败" - else - LOG_INFO "docker命令不可用,跳过docker兼容性测试" - fi - - # 步骤7:清理环境,恢复到之前状态 - LOG_INFO "步骤7:清理环境,恢复到之前状态" - if [ $already_installed -eq 0 ]; then - LOG_INFO "卸载测试期间安装的podman-docker软件包" - dnf remove -y podman-docker - CHECK_RESULT $? 0 0 "卸载podman-docker失败" - - # 验证卸载是否成功 - rpm -q podman-docker > /dev/null 2>&1 - if [ $? -eq 0 ]; then - LOG_ERROR "podman-docker卸载后仍然存在" - exit 1 - else - LOG_INFO "podman-docker卸载成功" - fi - else - LOG_INFO "测试前已安装podman-docker,保持安装状态不变" - fi - - LOG_INFO "podman-docker安装功能测试完成" -} - -main "$@" \ No newline at end of file diff --git a/testcases/function_test/pkg_test/podman/podman-docker/test_podman-docker_function_pull_image.sh b/testcases/function_test/pkg_test/podman/podman-docker/test_podman-docker_function_pull_image.sh deleted file mode 100644 index 70025b653eb..00000000000 --- a/testcases/function_test/pkg_test/podman/podman-docker/test_podman-docker_function_pull_image.sh +++ /dev/null @@ -1,62 +0,0 @@ -#!/usr/bin/bash - -# Copyright (c) 2024 ISCAS .ALL rights reserved. -# This program is licensed under Mulan PSL v2. -# You can use it according to the terms and conditions of the Mulan PSL v2. -# http://license.coscl.org.cn/MulanPSL2 -# THIS PROGRAM IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, -# EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, -# MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. -# See the Mulan PSL v2 for more details. - -# ############################################# -# @Author : honghua -# @Contact : honghua@iscas.ac.cn -# @Date : 2026-04-01 -# @License : Mulan PSL v2 -# @Desc : 测试从仓库拉取镜像 -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - LOG_INFO "开始测试:从仓库拉取镜像" - LOG_INFO "步骤1:检查是否已安装podman和docker" - if command -v podman > /dev/null 2>&1 && command -v docker > /dev/null 2>&1; then - LOG_INFO "podman和docker已安装,跳过安装步骤" - INSTALLED=1 - else - LOG_INFO "podman和docker未安装,开始安装" - INSTALLED=0 - LOG_INFO "步骤2:检查yum源中是否有podman和docker软件包" - dnf list available podman docker --quiet > /dev/null 2>&1 - CHECK_RESULT $? 0 255 "yum源中缺少podman或docker软件包" - LOG_INFO "步骤3:安装podman和docker" - dnf install -y podman docker - CHECK_RESULT $? 0 0 "安装podman和docker失败" - fi - - LOG_INFO "步骤4:测试podman拉取镜像" - podman pull hello-world - CHECK_RESULT $? 0 0 "podman拉取镜像失败" - - LOG_INFO "步骤5:测试docker拉取镜像" - docker pull hello-world - CHECK_RESULT $? 0 0 "docker拉取镜像失败" - - LOG_INFO "步骤6:清理测试环境" - podman rmi hello-world - docker rmi hello-world - - if [ $INSTALLED -eq 0 ]; then - LOG_INFO "步骤7:卸载安装的podman和docker" - dnf remove -y podman docker - CHECK_RESULT $? 0 0 "卸载podman和docker失败" - else - LOG_INFO "保持podman和docker安装状态" - fi - - LOG_INFO "测试完成" -} - -main "$@" \ No newline at end of file diff --git a/testcases/function_test/pkg_test/podman/podman-docker/test_podman-docker_function_rm.sh b/testcases/function_test/pkg_test/podman/podman-docker/test_podman-docker_function_rm.sh deleted file mode 100644 index 4258e7f18e5..00000000000 --- a/testcases/function_test/pkg_test/podman/podman-docker/test_podman-docker_function_rm.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 : 2025-12-05 -# @License : Mulan PSL v2 -# @Desc : 测试 podman-docker 的 docker rm 命令,删除容器 -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - - # 测试 podman-docker 的 docker rm 命令,删除容器 - - # 检查软件包是否存在于yum源中 - check_package_existence() { - LOG_INFO "检查软件包 $1 是否存在于yum源中" - dnf list available "$1" &>/dev/null - if [ $? -ne 0 ]; then - LOG_ERROR "软件包 $1 不存在于yum源中" - exit 255 - fi - } - - # 安装软件包 - install_package() { - LOG_INFO "安装软件包 $1" - dnf install -y "$1" - CHECK_RESULT $? 0 0 "安装软件包 $1 失败" - } - - # 卸载软件包 - uninstall_package() { - LOG_INFO "卸载软件包 $1" - dnf remove -y "$1" - CHECK_RESULT $? 0 0 "卸载软件包 $1 失败" - } - - # 检查命令是否存在 - check_command() { - LOG_INFO "检查命令 $1 是否存在" - command -v "$1" &>/dev/null - if [ $? -ne 0 ]; then - LOG_ERROR "命令 $1 不存在" - exit 255 - fi - } - - # main函数 - main() { - # Step1: 检查podman-docker是否已安装 - LOG_INFO "Step1: 检查podman-docker是否已安装" - if ! command -v podman &>/dev/null; then - LOG_INFO "podman-docker未安装,开始安装" - check_package_existence podman-docker - install_package podman-docker - - # Step2: 启动podman服务 - LOG_INFO "Step2: 启动podman服务" - systemctl start podman - CHECK_RESULT $? 0 0 "启动podman服务失败" - - # Step3: 创建测试容器 - LOG_INFO "Step3: 创建测试容器" - podman run --name test_container -d alpine sleep 3600 &>/dev/null - CHECK_RESULT $? 0 0 "创建测试容器失败" - - # Step4: 删除容器并验证 - LOG_INFO "Step4 :删除容器并验证" - podman rm test_container &>/dev/null - CHECK_RESULT $? 00 00"删除容器失败" - - # Step5 :停止并清理podman服务(仅当之前未安装时) - LOG_INFO “Step5 :停止并清理podman服务” - systemctl stop podman &>/dev/null - CHECK_RESULT $? 00 00"停止podmna服务失败" - - # Step6 :卸载podmna-docker(仅当之前未安装时) - uninstall_package podmna-docke - else - #如果已经安装了,则只执行测试步骤 - ##创建和刪除容器 - - ##創建測試容器 - log_info “創建測試容器” - podmna run --name test_continer -d alpine sleep360 &> /dev / null - check_result $$ ?? ?? “創建測試容器失敗” - - ##刪除並驗證 - log_info “刪除並驗證” - podmna rm test_continer &> / dev / null - check_result $$ ?? ?? “刪除失敗” - - fi - - } - - main - -} - -main "$@" \ No newline at end of file diff --git a/testcases/function_test/pkg_test/podman/podman-docker/test_podman-docker_function_rmi.sh b/testcases/function_test/pkg_test/podman/podman-docker/test_podman-docker_function_rmi.sh deleted file mode 100644 index d724df4fce1..00000000000 --- a/testcases/function_test/pkg_test/podman/podman-docker/test_podman-docker_function_rmi.sh +++ /dev/null @@ -1,79 +0,0 @@ -#!/usr/bin/bash - -# Copyright (c) 2024 ISCAS .ALL rights reserved. -# This program is licensed under Mulan PSL v2. -# You can use it according to the terms and conditions of the Mulan PSL v2. -# http://license.coscl.org.cn/MulanPSL2 -# THIS PROGRAM IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, -# EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, -# MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. -# See the Mulan PSL v2 for more details. - -# ############################################# -# @Author : honghua -# @Contact : honghua@iscas.ac.cn -# @Date : 2025-12-05 -# @License : Mulan PSL v2 -# @Desc : 测试 podman-docker 的 docker rmi 命令,删除镜像 -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - # 检查是否已安装podman-docker - LOG_INFO "检查是否已安装podman-docker" - if ! dnf list installed podman-docker &>/dev/null; then - LOG_INFO "podman-docker未安装,将进行安装" - INSTALLED=0 - else - LOG_INFO "podman-docker已安装" - INSTALLED=1 - fi - - # 检查yum源中是否有podman-docker软件包 - LOG_INFO "检查yum源中是否有podman-docker软件包" - if ! dnf list available podman-docker &>/dev/null; then - LOG_ERROR "yum源中未找到podman-docker软件包" - exit 255 - fi - - # 如果未安装,则安装podman-docker - if [ $INSTALLED -eq 0 ]; then - LOG_INFO "开始安装podman-docker" - dnf install -y podman-docker - CHECK_RESULT $? 0 0 "安装podman-docker失败" - fi - - # 拉取测试镜像 - LOG_INFO "拉取测试镜像busybox" - podman pull busybox - CHECK_RESULT $? 0 0 "拉取busybox镜像失败" - - # 检查镜像是否存在 - LOG_INFO "检查busybox镜像是否存在" - podman images | grep busybox &>/dev/null - CHECK_RESULT $? 0 0 "busybox镜像不存在" - - # 删除镜像测试 - LOG_INFO "测试docker rmi命令删除busybox镜像" - podman rmi busybox - CHECK_RESULT $? 0 0 "删除busybox镜像失败" - - # 再次检查镜像是否已删除 - LOG_INFO "检查busybox镜像是否已删除" - if podman images | grep busybox &>/dev/null; then - LOG_ERROR "busybox镜像未被成功删除" - exit 1 - fi - - # 环境恢复:如果脚本开始时未安装podman-docker,则卸载它 - if [ $INSTALLED -eq 0 ]; then - LOG_INFO "卸载podman-docker以恢复环境" - dnf remove -y podman-docker - CHECK_RESULT $? 0 0 "卸载podman-docker失败" - fi - - LOG_INFO "测试脚本执行完毕" -} - -main "$@" \ No newline at end of file diff --git a/testcases/function_test/pkg_test/podman/podman-docker/test_podman-docker_function_run_hello.sh b/testcases/function_test/pkg_test/podman/podman-docker/test_podman-docker_function_run_hello.sh deleted file mode 100644 index 997fcd8c7f2..00000000000 --- a/testcases/function_test/pkg_test/podman/podman-docker/test_podman-docker_function_run_hello.sh +++ /dev/null @@ -1,74 +0,0 @@ -#!/usr/bin/bash - -# Copyright (c) 2024 ISCAS .ALL rights reserved. -# This program is licensed under Mulan PSL v2. -# You can use it according to the terms and conditions of the Mulan PSL v2. -# http://license.coscl.org.cn/MulanPSL2 -# THIS PROGRAM IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, -# EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, -# MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. -# See the Mulan PSL v2 for more details. - -# ############################################# -# @Author : honghua -# @Contact : honghua@iscas.ac.cn -# @Date : 2026-04-01 -# @License : Mulan PSL v2 -# @Desc : 测试运行hello-world容器 -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - # 检查是否已经安装podman和docker - LOG_INFO "检查是否已经安装podman和docker" - rpm -q podman docker > /dev/null 2>&1 - if [ $? -eq 0 ]; then - LOG_INFO "podman和docker已经安装,标记为已安装状态" - INSTALLED="true" - else - LOG_INFO "podman和docker未安装,标记为未安装状态" - INSTALLED="false" - fi - - # 检查yum源中是否有podman和docker软件包 - LOG_INFO "检查yum源中是否有podman和docker软件包" - dnf list available podman docker > /dev/null 2>&1 - CHECK_RESULT $? 0 0 "yum源中没有podman或docker软件包" - if [ $? -ne 0 ]; then - LOG_ERROR "yum源中没有podman或docker软件包" - exit 255 - fi - - # 如果未安装,则安装podman和docker - if [ "$INSTALLED" = "false" ]; then - LOG_INFO "开始安装podman和docker" - dnf install -y podman docker > /dev/null 2>&1 - CHECK_RESULT $? 0 0 "安装podman和docker失败" - LOG_INFO "podman和docker安装成功" - fi - - # 测试运行hello-world容器 - LOG_INFO "测试运行hello-world容器" - podman run --rm hello-world > /dev/null 2>&1 - CHECK_RESULT $? 0 0 "运行hello-world容器失败" - LOG_INFO "hello-world容器运行成功" - - # 测试docker运行hello-world容器 - LOG_INFO "测试docker运行hello-world容器" - docker run --rm hello-world > /dev/null 2>&1 - CHECK_RESULT $? 0 0 "docker运行hello-world容器失败" - LOG_INFO "docker hello-world容器运行成功" - - # 如果之前未安装,则卸载podman和docker - if [ "$INSTALLED" = "false" ]; then - LOG_INFO "卸载podman和docker" - dnf remove -y podman docker > /dev/null 2>&1 - CHECK_RESULT $? 0 0 "卸载podman和docker失败" - LOG_INFO "podman和docker卸载成功" - fi - - LOG_INFO "测试脚本执行完成" -} - -main "$@" \ No newline at end of file diff --git a/testcases/function_test/pkg_test/podman/podman-docker/test_podman-docker_function_uninstall.sh b/testcases/function_test/pkg_test/podman/podman-docker/test_podman-docker_function_uninstall.sh deleted file mode 100644 index 365b65d9015..00000000000 --- a/testcases/function_test/pkg_test/podman/podman-docker/test_podman-docker_function_uninstall.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-04-01 -# @License : Mulan PSL v2 -# @Desc : 测试软件包podman-docker的卸载功能 -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - # 定义颜色输出函数(兼容性处理) - LOG_INFO() { - echo -e "\033[32m[INFO]\033[0m $1" - } - - LOG_ERROR() { - echo -e "\033[31m[ERROR]\033[0m $1" - } - - # 检查软件包是否在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 - } - - # 检查命令参数是否支持 - check_command_option() { - local cmd=$1 - local option=$2 - LOG_INFO "检查命令 $cmd 是否支持参数 $option" - $cmd $option --help &>/dev/null 2>&1 - if [ $? -ne 0 ]; then - LOG_ERROR "命令 $cmd 不支持参数 $option" - exit 255 - fi - } - - # 安装状态标记 - PODMAN_DOCKER_INSTALLED=false - - # 步骤1:检查当前环境是否已安装podman-docker - LOG_INFO "步骤1:检查当前环境是否已安装podman-docker" - if rpm -q podman-docker &>/dev/null; then - LOG_INFO "检测到podman-docker已安装" - PODMAN_DOCKER_INSTALLED=true - else - LOG_INFO "未检测到podman-docker安装" - fi - - # 步骤2:检查yum源中是否存在podman-docker软件包 - LOG_INFO "步骤2:检查yum源中是否存在podman-docker软件包" - check_package_in_repo "podman-docker" - - # 步骤3:如果未安装,则安装podman-docker作为测试步骤 - if ! $PODMAN_DOCKER_INSTALLED; then - LOG_INFO "步骤3:安装podman-docker软件包" - dnf install -y podman-docker - CHECK_RESULT $? 0 0 "安装podman-docker失败" - LOG_INFO "podman-docker安装成功" - fi - - # 步骤4:验证podman-docker基本功能 - LOG_INFO "步骤4:验证podman-docker基本功能" - podman --version - CHECK_RESULT $? 0 0 "podman命令不可用" - LOG_INFO "podman-docker基本功能验证成功" - - # 步骤5:检查卸载命令参数支持 - LOG_INFO "步骤5:检查卸载命令参数支持" - check_command_option "dnf" "remove" - - # 步骤6:执行卸载操作 - LOG_INFO "步骤6:执行podman-docker卸载操作" - dnf remove -y podman-docker - CHECK_RESULT $? 0 0 "卸载podman-docker失败" - LOG_INFO "podman-docker卸载成功" - - # 步骤7:验证卸载结果 - LOG_INFO "步骤7:验证卸载结果" - if rpm -q podman-docker &>/dev/null; then - LOG_ERROR "podman-docker卸载后仍存在" - exit 1 - else - LOG_INFO "podman-docker已成功卸载" - fi - - # 步骤8:环境恢复 - LOG_INFO "步骤8:环境恢复" - if $PODMAN_DOCKER_INSTALLED; then - LOG_INFO "重新安装podman-docker以恢复原始状态" - dnf install -y podman-docker - CHECK_RESULT $? 0 0 "重新安装podman-docker失败" - LOG_INFO "环境已恢复至原始安装状态" - else - LOG_INFO "原始环境未安装podman-docker,无需恢复" - fi - - LOG_INFO "测试脚本执行完成" -} - -main "$@" \ No newline at end of file diff --git a/testcases/function_test/pkg_test/python-meh/python3-meh/test_python3-meh_function_help.sh b/testcases/function_test/pkg_test/python-meh/python3-meh/test_python3-meh_function_help.sh deleted file mode 100644 index ef1f36597ec..00000000000 --- a/testcases/function_test/pkg_test/python-meh/python3-meh/test_python3-meh_function_help.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-21 -# @License : Mulan PSL v2 -# @Desc : Test accessing module help or documentation -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - # 检查是否已安装python3-meh软件包 - LOG_INFO "检查python3-meh软件包是否已安装" - rpm -q python3-meh > /dev/null 2>&1 - if [ $? -eq 0 ]; then - LOG_INFO "python3-meh已安装,记录当前状态" - INSTALLED=1 - else - LOG_INFO "python3-meh未安装,将在测试过程中安装" - INSTALLED=0 - fi - - # 检查yum源中是否存在python3-meh软件包 - LOG_INFO "检查yum源中是否存在python3-meh软件包" - dnf list available python3-meh > /dev/null 2>&1 - if [ $? -ne 0 ]; then - LOG_ERROR "yum源中不存在python3-meh软件包" - exit 255 - fi - - # 如果未安装,则安装python3-meh软件包 - if [ $INSTALLED -eq 0 ]; then - LOG_INFO "安装python3-meh软件包" - dnf install -y python3-meh - CHECK_RESULT $? 0 0 "安装python3-meh失败" - fi - - # 测试访问模块帮助或文档 - LOG_INFO "测试访问python3-meh模块帮助" - python3 -c "import meh; help(meh)" > /dev/null 2>&1 - CHECK_RESULT $? 0 0 "访问python3-meh模块帮助失败" - - LOG_INFO "测试访问python3-meh模块文档" - python3 -c "import meh; print(meh.__doc__)" > /dev/null 2>&1 - CHECK_RESULT $? 0 0 "访问python3-meh模块文档失败" - - # 清理环境:如果测试前未安装,则卸载python3-meh软件包 - if [ $INSTALLED -eq 0 ]; then - LOG_INFO "卸载python3-meh软件包" - dnf remove -y python3-meh - CHECK_RESULT $? 0 0 "卸载python3-meh失败" - else - LOG_INFO "保持python3-meh软件包安装状态" - fi -} - -main "$@" \ No newline at end of file diff --git a/testcases/function_test/pkg_test/python-meh/python3-meh/test_python3-meh_function_import.sh b/testcases/function_test/pkg_test/python-meh/python3-meh/test_python3-meh_function_import.sh deleted file mode 100644 index 718774a7246..00000000000 --- a/testcases/function_test/pkg_test/python-meh/python3-meh/test_python3-meh_function_import.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-21 -# @License : Mulan PSL v2 -# @Desc : Test importing meh module in Python -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - LOG_INFO "开始测试:在Python中导入meh模块" - LOG_INFO "步骤1:检查是否已安装python3-meh软件包" - dnf list installed python3-meh > /dev/null 2>&1 - if [ $? -eq 0 ]; then - LOG_INFO "python3-meh已安装,脚本结束后将保持安装状态" - INSTALLED=true - else - LOG_INFO "python3-meh未安装,将在测试过程中安装" - INSTALLED=false - fi - - LOG_INFO "步骤2:检查yum源中是否有python3-meh软件包" - dnf list available python3-meh > /dev/null 2>&1 - CHECK_RESULT $? 0 255 "yum源中未找到python3-meh软件包" - - LOG_INFO "步骤3:安装python3-meh软件包" - if [ "$INSTALLED" = false ]; then - dnf install -y python3-meh > /dev/null 2>&1 - CHECK_RESULT $? 0 0 "安装python3-meh失败" - LOG_INFO "python3-meh安装成功" - else - LOG_INFO "python3-meh已安装,跳过安装步骤" - fi - - LOG_INFO "步骤4:检查python3命令是否支持-c参数" - python3 -c "print("test")" > /dev/null 2>&1 - CHECK_RESULT $? 0 255 "python3命令不支持-c参数" - - LOG_INFO "步骤5:在Python中导入meh模块" - python3 -c "import meh; print("导入meh模块成功")" > /dev/null 2>&1 - CHECK_RESULT $? 0 0 "导入meh模块失败" - - LOG_INFO "步骤6:清理环境" - if [ "$INSTALLED" = false ]; then - LOG_INFO "卸载python3-meh软件包" - dnf remove -y python3-meh > /dev/null 2>&1 - CHECK_RESULT $? 0 0 "卸载python3-meh失败" - LOG_INFO "python3-meh卸载成功" - else - LOG_INFO "脚本开始时python3-meh已安装,保持安装状态" - fi - - LOG_INFO "测试完成" -} - -main "$@" \ No newline at end of file diff --git a/testcases/function_test/pkg_test/python-meh/python3-meh/test_python3-meh_function_install.sh b/testcases/function_test/pkg_test/python-meh/python3-meh/test_python3-meh_function_install.sh deleted file mode 100644 index d1752b98bba..00000000000 --- a/testcases/function_test/pkg_test/python-meh/python3-meh/test_python3-meh_function_install.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-21 -# @License : Mulan PSL v2 -# @Desc : Test installation of python3-meh package -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - set -e - - # 步骤1:检查yum源中是否存在python3-meh包 - LOG_INFO "步骤1:检查yum源中是否存在python3-meh包" - if ! dnf list available python3-meh &>/dev/null; then - LOG_ERROR "python3-meh包在yum源中不存在" - exit 255 - fi - - # 步骤2:检查是否已安装python3-meh - LOG_INFO "步骤2:检查是否已安装python3-meh" - if rpm -q python3-meh &>/dev/null; then - LOG_INFO "python3-meh已安装,标记为已存在" - already_installed=1 - else - LOG_INFO "python3-meh未安装,标记为未存在" - already_installed=0 - fi - - # 步骤3:如果未安装,则安装python3-meh - if [ $already_installed -eq 0 ]; then - LOG_INFO "步骤3:安装python3-meh包" - dnf install -y python3-meh - CHECK_RESULT $? 0 0 "安装python3-meh失败" - fi - - # 步骤4:验证python3-meh安装成功 - LOG_INFO "步骤4:验证python3-meh安装成功" - rpm -q python3-meh - CHECK_RESULT $? 0 0 "验证python3-meh安装失败" - - # 步骤5:测试python3-meh基本功能 - LOG_INFO "步骤5:测试python3-meh基本功能" - python3 -c "import meh; print(meh.__version__)" 2>/dev/null || true - # 注意:这里不检查结果,因为某些版本可能没有__version__属性,仅作为功能测试 - - # 步骤6:清理环境,如果脚本开始时未安装,则卸载python3-meh - if [ $already_installed -eq 0 ]; then - LOG_INFO "步骤6:清理环境,卸载python3-meh包" - dnf remove -y python3-meh - CHECK_RESULT $? 0 0 "卸载python3-meh失败" - LOG_INFO "环境已恢复到初始状态" - else - LOG_INFO "步骤6:环境已安装python3-meh,保持安装状态" - fi - - LOG_INFO "测试完成" -} - -main "$@" \ No newline at end of file diff --git a/testcases/function_test/pkg_test/python-meh/python3-meh/test_python3-meh_function_remove.sh b/testcases/function_test/pkg_test/python-meh/python3-meh/test_python3-meh_function_remove.sh deleted file mode 100644 index 69ad86ba105..00000000000 --- a/testcases/function_test/pkg_test/python-meh/python3-meh/test_python3-meh_function_remove.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-21 -# @License : Mulan PSL v2 -# @Desc : Test removal of python3-meh package -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - LOG_INFO "开始测试:测试python3-meh包的移除功能" - LOG_INFO "步骤1:检查yum源中是否存在python3-meh软件包" - dnf list available python3-meh > /dev/null 2>&1 - if [ $? -ne 0 ]; then - LOG_ERROR "yum源中未找到python3-meh软件包" - exit 255 - fi - LOG_INFO "yum源中存在python3-meh软件包" - - LOG_INFO "步骤2:检查当前是否已安装python3-meh软件包" - rpm -q python3-meh > /dev/null 2>&1 - if [ $? -eq 0 ]; then - LOG_INFO "python3-meh软件包已安装,测试结束后将保持安装状态" - INSTALLED_BEFORE_TEST=1 - else - LOG_INFO "python3-meh软件包未安装,将在测试前安装并在测试后卸载" - INSTALLED_BEFORE_TEST=0 - fi - - if [ $INSTALLED_BEFORE_TEST -eq 0 ]; then - LOG_INFO "步骤3:安装python3-meh软件包" - dnf install -y python3-meh - CHECK_RESULT $? 0 0 "安装python3-meh软件包失败" - LOG_INFO "python3-meh软件包安装成功" - fi - - LOG_INFO "步骤4:验证python3-meh软件包是否正常安装" - rpm -q python3-meh - CHECK_RESULT $? 0 0 "验证python3-meh软件包安装状态失败" - - LOG_INFO "步骤5:测试移除python3-meh软件包" - dnf remove -y python3-meh - CHECK_RESULT $? 0 0 "移除python3-meh软件包失败" - LOG_INFO "python3-meh软件包移除成功" - - LOG_INFO "步骤6:验证python3-meh软件包是否已移除" - rpm -q python3-meh > /dev/null 2>&1 - if [ $? -eq 0 ]; then - LOG_ERROR "python3-meh软件包移除后仍然存在" - exit 1 - fi - LOG_INFO "python3-meh软件包已成功移除" - - LOG_INFO "步骤7:环境恢复" - if [ $INSTALLED_BEFORE_TEST -eq 0 ]; then - LOG_INFO "测试前未安装python3-meh,无需恢复安装" - else - LOG_INFO "恢复安装python3-meh软件包" - dnf install -y python3-meh - CHECK_RESULT $? 0 0 "恢复安装python3-meh软件包失败" - LOG_INFO "python3-meh软件包恢复安装成功" - fi - - LOG_INFO "测试完成:python3-meh包的移除功能测试通过" -} - -main "$@" \ No newline at end of file diff --git a/testcases/function_test/pkg_test/python-meh/python3-meh/test_python3-meh_function_version.sh b/testcases/function_test/pkg_test/python-meh/python3-meh/test_python3-meh_function_version.sh deleted file mode 100644 index 49ed0811405..00000000000 --- a/testcases/function_test/pkg_test/python-meh/python3-meh/test_python3-meh_function_version.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-21 -# @License : Mulan PSL v2 -# @Desc : Test querying installed package version -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - # 判断Python3-meh软件包是否已安装 - LOG_INFO "检查Python3-meh软件包是否已安装" - if dnf list installed python3-meh &>/dev/null; then - LOG_INFO "Python3-meh软件包已安装" - INSTALLED=true - else - LOG_INFO "Python3-meh软件包未安装" - INSTALLED=false - fi - - # 检查yum源中是否存在python3-meh软件包 - LOG_INFO "检查yum源中是否存在python3-meh软件包" - if ! dnf list available python3-meh &>/dev/null; then - LOG_ERROR "yum源中未找到python3-meh软件包" - exit 255 - fi - - # 如果未安装,则安装python3-meh软件包 - if [ "$INSTALLED" = false ]; then - LOG_INFO "开始安装python3-meh软件包" - dnf install -y python3-meh - CHECK_RESULT $? 0 0 "安装python3-meh软件包失败" - LOG_INFO "python3-meh软件包安装成功" - fi - - # 测试查询已安装软件包版本功能 - LOG_INFO "测试查询python3-meh软件包版本" - rpm -q python3-meh - CHECK_RESULT $? 0 0 "查询python3-meh软件包版本失败" - - # 检查查询结果是否符合预期 - VERSION_OUTPUT=$(rpm -q python3-meh) - if [[ "$VERSION_OUTPUT" =~ python3-meh-.* ]]; then - LOG_INFO "版本查询成功: $VERSION_OUTPUT" - else - LOG_ERROR "版本查询结果不符合预期: $VERSION_OUTPUT" - exit 1 - fi - - # 环境恢复:如果脚本开始时未安装,则卸载软件包 - if [ "$INSTALLED" = false ]; then - LOG_INFO "恢复环境:卸载python3-meh软件包" - dnf remove -y python3-meh - CHECK_RESULT $? 0 0 "卸载python3-meh软件包失败" - LOG_INFO "环境恢复完成" - else - LOG_INFO "保持python3-meh软件包安装状态" - fi -} - -main "$@" \ No newline at end of file diff --git a/testcases/function_test/pkg_test/python-pdm-pep517/python3-pdm-pep517/test_python3-pdm-pep517_function_build.sh b/testcases/function_test/pkg_test/python-pdm-pep517/python3-pdm-pep517/test_python3-pdm-pep517_function_build.sh deleted file mode 100644 index 363e8597375..00000000000 --- a/testcases/function_test/pkg_test/python-pdm-pep517/python3-pdm-pep517/test_python3-pdm-pep517_function_build.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-04 -# @License : Mulan PSL v2 -# @Desc : Test the build functionality of python3-pdm-pep517 -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - - # 检查yum源中是否存在python3-pdm-pep517软件包 - LOG_INFO "检查yum源中是否存在python3-pdm-pep517软件包" - dnf list available python3-pdm-pep517 >/dev/null 2>&1 - if [ $? -ne 0 ]; then - LOG_ERROR "yum源中未找到python3-pdm-pep517软件包" - exit 255 - fi - - # 检查是否已安装python3-pdm-pep517 - LOG_INFO "检查是否已安装python3-pdm-pep517" - rpm -q python3-pdm-pep517 >/dev/null 2>&1 - if [ $? -eq 0 ]; then - LOG_INFO "python3-pdm-pep517已安装,测试完成后将保持安装状态" - INSTALLED=1 - else - LOG_INFO "python3-pdm-pep517未安装,将在测试完成后卸载" - INSTALLED=0 - fi - - # 若未安装则安装软件包 - if [ $INSTALLED -eq 0 ]; then - LOG_INFO "安装python3-pdm-pep517软件包" - dnf install -y python3-pdm-pep517 - CHECK_RESULT $? 0 0 "安装python3-pdm-pep517失败" - fi - - # 测试build功能 - LOG_INFO "测试python3-pdm-pep517的build功能" - pdm-pep517 build --help >/dev/null 2>&1 - CHECK_RESULT $? 0 0 "pdm-pep517 build命令不支持" - - LOG_INFO "执行pdm-pep517 build命令" - pdm-pep517 build - CHECK_RESULT $? 0 0 "执行build功能失败" - - # 清理环境:若测试前未安装则卸载软件包 - if [ $INSTALLED -eq 0 ]; then - LOG_INFO "卸载python3-pdm-pep517软件包" - dnf remove -y python3-pdm-pep517 - CHECK_RESULT $? 0 0 "卸载python3-pdm-pep517失败" - fi - - LOG_INFO "测试完成,环境已恢复" - -} - -main "$@" \ No newline at end of file diff --git a/testcases/function_test/pkg_test/python-pydot/python-pydot-help/test_python-pydot-help_basic_usage.sh b/testcases/function_test/pkg_test/python-pydot/python-pydot-help/test_python-pydot-help_basic_usage.sh deleted file mode 100644 index 6b726f04f78..00000000000 --- a/testcases/function_test/pkg_test/python-pydot/python-pydot-help/test_python-pydot-help_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-02-24 -# @License : Mulan PSL v2 -# @Desc : 测试python-pydot-help生成简单图形的核心功能 -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - # 检查python-pydot-help是否已安装 - LOG_INFO "检查python-pydot-help是否已安装" - rpm -q python-pydot-help > /dev/null 2>&1 - if [ $? -eq 0 ]; then - LOG_INFO "python-pydot-help已安装,脚本结束后保持安装状态" - INSTALLED_FLAG=1 - else - LOG_INFO "python-pydot-help未安装,测试过程中会安装,脚本结束后会卸载" - INSTALLED_FLAG=0 - fi - - # 检查yum源中是否有python-pydot-help软件包 - LOG_INFO "检查yum源中是否有python-pydot-help软件包" - dnf list available python-pydot-help > /dev/null 2>&1 - if [ $? -ne 0 ]; then - LOG_ERROR "yum源中没有python-pydot-help软件包" - exit 255 - fi - - # 安装python-pydot-help - if [ $INSTALLED_FLAG -eq 0 ]; then - LOG_INFO "安装python-pydot-help软件包" - dnf install -y python-pydot-help > /dev/null 2>&1 - CHECK_RESULT $? 0 0 "安装python-pydot-help失败" - fi - - # 测试python-pydot-help的help命令 - LOG_INFO "测试python-pydot-help的help命令" - python-pydot-help --help > /dev/null 2>&1 - CHECK_RESULT $? 0 0 "python-pydot-help --help命令执行失败" - - # 测试python-pydot-help生成简单图形的核心功能 - LOG_INFO "测试python-pydot-help生成简单图形的核心功能" - python -c " - import pydot - graph = pydot.Dot(graph_type="digraph") - node_a = pydot.Node("Node A", style="filled", fillcolor="red") - node_b = pydot.Node("Node B", style="filled", fillcolor="green") - graph.add_node(node_a) - graph.add_node(node_b) - edge = pydot.Edge(node_a, node_b, label="Edge") - graph.add_edge(edge) - graph.write_png("test_graph.png") - " > /dev/null 2>&1 - CHECK_RESULT $? 0 0 "生成简单图形失败" - - # 验证生成的图形文件是否存在 - LOG_INFO "验证生成的图形文件是否存在" - if [ -f "test_graph.png" ]; then - LOG_INFO "成功生成test_graph.png文件" - rm -f test_graph.png - else - LOG_ERROR "未找到生成的test_graph.png文件" - exit 1 - fi - - # 清理环境 - if [ $INSTALLED_FLAG -eq 0 ]; then - LOG_INFO "卸载python-pydot-help软件包" - dnf remove -y python-pydot-help > /dev/null 2>&1 - CHECK_RESULT $? 0 0 "卸载python-pydot-help失败" - else - LOG_INFO "保持python-pydot-help安装状态" - fi - - LOG_INFO "测试完成" -} - -main "$@" \ No newline at end of file diff --git a/testcases/function_test/pkg_test/python-pydot/python-pydot-help/test_python-pydot-help_graph_attr.sh b/testcases/function_test/pkg_test/python-pydot/python-pydot-help/test_python-pydot-help_graph_attr.sh deleted file mode 100644 index b84daa34c2a..00000000000 --- a/testcases/function_test/pkg_test/python-pydot/python-pydot-help/test_python-pydot-help_graph_attr.sh +++ /dev/null @@ -1,71 +0,0 @@ -#!/usr/bin/bash - -# Copyright (c) 2024 ISCAS .ALL rights reserved. -# This program is licensed under Mulan PSL v2. -# You can use it according to the terms and conditions of the Mulan PSL v2. -# http://license.coscl.org.cn/MulanPSL2 -# THIS PROGRAM IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, -# EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, -# MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. -# See the Mulan PSL v2 for more details. - -# ############################################# -# @Author : honghua -# @Contact : honghua@iscas.ac.cn -# @Date : 2026-02-24 -# @License : Mulan PSL v2 -# @Desc : 测试python-pydot-help设置图形属性的功能 -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - LOG_INFO "开始测试python-pydot-help设置图形属性的功能" - - # 检查是否已安装python3-pydot - LOG_INFO "检查是否已安装python3-pydot" - if rpm -q python3-pydot > /dev/null 2>&1; then - LOG_INFO "python3-pydot已安装" - installed=true - else - LOG_INFO "python3-pydot未安装" - installed=false - fi - - # 检查yum源中是否有python3-pydot包 - LOG_INFO "检查yum源中是否有python3-pydot包" - if ! dnf list available python3-pydot > /dev/null 2>&1; then - LOG_ERROR "yum源中没有python3-pydot包" - exit 255 - fi - - # 如果未安装,则安装python3-pydot - if [ "$installed" = false ]; then - LOG_INFO "安装python3-pydot" - dnf install -y python3-pydot - CHECK_RESULT $? 0 0 "安装python3-pydot失败" - fi - - # 测试python-pydot-help设置图形属性的功能 - LOG_INFO "测试python-pydot-help设置图形属性的功能" - python3 -c " - import pydot - graph = pydot.Dot(graph_type="digraph") - graph.set("rankdir", "LR") - graph.set("label", "测试图形") - graph.set("fontsize", "10") - print("图形属性设置成功") - " 2>&1 - CHECK_RESULT $? 0 0 "python-pydot-help设置图形属性功能测试失败" - - # 如果之前未安装,则卸载python3-pydot - if [ "$installed" = false ]; then - LOG_INFO "卸载python3-pydot" - dnf remove -y python3-pydot - CHECK_RESULT $? 0 0 "卸载python3-pydot失败" - fi - - LOG_INFO "测试完成,环境已恢复" -} - -main "$@" \ No newline at end of file diff --git a/testcases/function_test/pkg_test/python-pydot/python-pydot-help/test_python-pydot-help_install.sh b/testcases/function_test/pkg_test/python-pydot/python-pydot-help/test_python-pydot-help_install.sh deleted file mode 100644 index 622f75718f6..00000000000 --- a/testcases/function_test/pkg_test/python-pydot/python-pydot-help/test_python-pydot-help_install.sh +++ /dev/null @@ -1,82 +0,0 @@ -#!/usr/bin/bash - -# Copyright (c) 2024 ISCAS .ALL rights reserved. -# This program is licensed under Mulan PSL v2. -# You can use it according to the terms and conditions of the Mulan PSL v2. -# http://license.coscl.org.cn/MulanPSL2 -# THIS PROGRAM IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, -# EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, -# MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. -# See the Mulan PSL v2 for more details. - -# ############################################# -# @Author : honghua -# @Contact : honghua@iscas.ac.cn -# @Date : 2026-02-24 -# @License : Mulan PSL v2 -# @Desc : 测试python-pydot-help软件包的安装功能是否正常 -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - # 测试python-pydot-help软件包安装功能 - LOG_INFO "开始测试python-pydot-help软件包的安装功能" - - # 检查软件包是否已在yum源中 - LOG_INFO "检查yum源中是否存在python-pydot-help软件包" - dnf list available python-pydot-help > /dev/null 2>&1 - if [ $? -ne 0 ]; then - LOG_ERROR "yum源中不存在python-pydot-help软件包" - exit 255 - fi - LOG_INFO "yum源中存在python-pydot-help软件包" - - # 检查当前环境是否已安装python-pydot-help - LOG_INFO "检查当前环境是否已安装python-pydot-help" - rpm -q python-pydot-help > /dev/null 2>&1 - if [ $? -eq 0 ]; then - LOG_INFO "环境已安装python-pydot-help,跳过安装步骤" - INSTALLED_BEFORE=true - else - LOG_INFO "环境未安装python-pydot-help,开始安装" - INSTALLED_BEFORE=false - fi - - # 如果未安装,则执行安装 - if [ "$INSTALLED_BEFORE" = "false" ]; then - LOG_INFO "执行python-pydot-help软件包安装" - dnf install -y python-pydot-help - CHECK_RESULT $? 0 0 "python-pydot-help软件包安装失败" - LOG_INFO "python-pydot-help软件包安装成功" - fi - - # 验证软件包安装是否成功 - LOG_INFO "验证python-pydot-help软件包是否正常安装" - rpm -q python-pydot-help > /dev/null 2>&1 - CHECK_RESULT $? 0 0 "python-pydot-help软件包未正确安装" - - # 测试软件包基本功能 - LOG_INFO "测试python-pydot-help软件包基本功能" - python3 -c "import pydot" 2>&1 | grep -q "ModuleNotFoundError" - if [ $? -eq 0 ]; then - LOG_ERROR "python-pydot-help软件包功能异常,无法导入pydot模块" - exit 1 - fi - LOG_INFO "python-pydot-help软件包功能正常" - - # 清理环境 - LOG_INFO "清理测试环境" - if [ "$INSTALLED_BEFORE" = "false" ]; then - LOG_INFO "卸载测试安装的python-pydot-help软件包" - dnf remove -y python-pydot-help - CHECK_RESULT $? 0 0 "python-pydot-help软件包卸载失败" - LOG_INFO "python-pydot-help软件包卸载成功" - else - LOG_INFO "环境已安装python-pydot-help,保持安装状态" - fi - - LOG_INFO "python-pydot-help软件包安装功能测试完成" -} - -main "$@" \ No newline at end of file diff --git a/testcases/function_test/pkg_test/python-pydot/python-pydot-help/test_python-pydot-help_render.sh b/testcases/function_test/pkg_test/python-pydot/python-pydot-help/test_python-pydot-help_render.sh deleted file mode 100644 index d33be018db2..00000000000 --- a/testcases/function_test/pkg_test/python-pydot/python-pydot-help/test_python-pydot-help_render.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-24 -# @License : Mulan PSL v2 -# @Desc : 测试python-pydot-help渲染输出图像文件的功能 -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - set -e - - # 定义软件包名称 - PACKAGE_NAME="python3-pydot" - - # 步骤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=true - else - LOG_INFO "软件包 $PACKAGE_NAME 未安装,将在测试步骤中安装,并在脚本结束前卸载" - INSTALLED_BEFORE=false - fi - - # 步骤3:如果未安装,则安装软件包 - if [ "$INSTALLED_BEFORE" = false ]; then - LOG_INFO "步骤3:安装软件包 $PACKAGE_NAME" - dnf install -y $PACKAGE_NAME - CHECK_RESULT $? 0 0 "安装软件包 $PACKAGE_NAME 失败" - fi - - # 步骤4:测试pydot的help命令参数 - LOG_INFO "步骤4:测试pydot的help命令参数" - if ! python3 -m pydot -h &>/dev/null; then - LOG_ERROR "pydot的help命令参数不存在或不支持" - exit 255 - fi - - # 步骤5:使用pydot生成一个简单的DOT文件并渲染输出图像 - LOG_INFO "步骤5:使用pydot生成一个简单的DOT文件并渲染输出图像" - cat > test_graph.dot << "EOF" - digraph G { - A -> B; - A -> C; - B -> D; - C -> D; - } - EOF - - python3 -c " - import pydot - graphs = pydot.graph_from_dot_file("test_graph.dot") - graph = graphs[0] - graph.write_png("test_graph.png") - " - CHECK_RESULT $? 0 0 "使用pydot渲染输出图像文件失败" - - # 步骤6:检查生成的图像文件是否存在 - LOG_INFO "步骤6:检查生成的图像文件是否存在" - if [ -f "test_graph.png" ]; then - LOG_INFO "图像文件 test_graph.png 生成成功" - else - LOG_ERROR "图像文件 test_graph.png 未生成" - exit 1 - fi - - # 步骤7:清理测试生成的文件 - LOG_INFO "步骤7:清理测试生成的文件" - rm -f test_graph.dot test_graph.png - - # 步骤8:如果测试前未安装,则在测试结束后卸载软件包 - if [ "$INSTALLED_BEFORE" = false ]; then - LOG_INFO "步骤8:卸载软件包 $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-pydot/python-pydot-help/test_python-pydot-help_uninstall.sh b/testcases/function_test/pkg_test/python-pydot/python-pydot-help/test_python-pydot-help_uninstall.sh deleted file mode 100644 index 45f36307cf9..00000000000 --- a/testcases/function_test/pkg_test/python-pydot/python-pydot-help/test_python-pydot-help_uninstall.sh +++ /dev/null @@ -1,66 +0,0 @@ -#!/usr/bin/bash - -# Copyright (c) 2024 ISCAS .ALL rights reserved. -# This program is licensed under Mulan PSL v2. -# You can use it according to the terms and conditions of the Mulan PSL v2. -# http://license.coscl.org.cn/MulanPSL2 -# THIS PROGRAM IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, -# EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, -# MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. -# See the Mulan PSL v2 for more details. - -# ############################################# -# @Author : honghua -# @Contact : honghua@iscas.ac.cn -# @Date : 2026-02-24 -# @License : Mulan PSL v2 -# @Desc : 测试python-pydot-help软件包的卸载功能是否正常 -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - LOG_INFO "开始测试python-pydot-help软件包的卸载功能是否正常" - LOG_INFO "步骤1:检查yum源中是否存在python-pydot-help软件包" - if ! dnf list available python-pydot-help &>/dev/null; then - LOG_ERROR "yum源中未找到python-pydot-help软件包" - exit 255 - fi - LOG_INFO "步骤2:检查系统是否已安装python-pydot-help软件包" - if rpm -q python-pydot-help &>/dev/null; then - LOG_INFO "python-pydot-help软件包已安装,测试结束后将保持安装状态" - INSTALLED_BEFORE=1 - else - LOG_INFO "python-pydot-help软件包未安装,将进行安装测试" - INSTALLED_BEFORE=0 - LOG_INFO "步骤3:安装python-pydot-help软件包" - dnf install -y python-pydot-help - CHECK_RESULT $? 0 0 "安装python-pydot-help软件包失败" - fi - LOG_INFO "步骤4:验证python-pydot-help软件包安装成功" - rpm -q python-pydot-help - CHECK_RESULT $? 0 0 "验证python-pydot-help软件包安装失败" - LOG_INFO "步骤5:执行python-pydot-help软件包卸载" - dnf remove -y python-pydot-help - CHECK_RESULT $? 0 0 "卸载python-pydot-help软件包失败" - LOG_INFO "步骤6:验证python-pydot-help软件包已卸载" - if rpm -q python-pydot-help &>/dev/null; then - LOG_ERROR "python-pydot-help软件包卸载后仍然存在" - CHECK_RESULT 1 0 0 "python-pydot-help软件包卸载验证失败" - else - LOG_INFO "python-pydot-help软件包已成功卸载" - CHECK_RESULT $? 0 0 "python-pydot-help软件包卸载验证失败" - fi - if [ $INSTALLED_BEFORE -eq 0 ]; then - LOG_INFO "步骤7:恢复环境,重新安装python-pydot-help软件包" - dnf install -y python-pydot-help - CHECK_RESULT $? 0 0 "恢复安装python-pydot-help软件包失败" - else - LOG_INFO "步骤7:环境恢复,重新安装python-pydot-help软件包" - dnf install -y python-pydot-help - CHECK_RESULT $? 0 0 "重新安装python-pydot-help软件包失败" - fi - LOG_INFO "测试完成,环境已恢复" -} - -main "$@" \ No newline at end of file diff --git a/testcases/function_test/pkg_test/samba/samba-dc-bind-dlz/test_samba-dc-bind-dlz_function_ad_integrate.sh b/testcases/function_test/pkg_test/samba/samba-dc-bind-dlz/test_samba-dc-bind-dlz_function_ad_integrate.sh deleted file mode 100644 index 804d1a6b7c7..00000000000 --- a/testcases/function_test/pkg_test/samba/samba-dc-bind-dlz/test_samba-dc-bind-dlz_function_ad_integrate.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 : Test integration with Samba Active Directory -# ############################################ - -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 error_msg=$4 - - if [ "$actual" -eq "$expected" ]; then - LOG_INFO "检查通过" - else - 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 -o UserKnownHostsFile=/dev/null "$node_user"@"$node_ip" "$cmd" - } - - # 测试开始 - LOG_INFO "开始测试:Samba Active Directory集成测试" - - # 检查是否已安装Samba AD DC相关软件包 - LOG_INFO "检查环境是否已安装Samba AD DC相关软件包" - if rpm -q samba-dc-bind-dlz &>/dev/null; then - LOG_INFO "Samba AD DC相关软件包已安装,测试结束后将保持安装状态" - INSTALLED_BEFORE=true - else - LOG_INFO "Samba AD DC相关软件包未安装,将在测试过程中安装" - INSTALLED_BEFORE=false - fi - - # 检查yum源中是否有samba-dc-bind-dlz软件包 - LOG_INFO "检查yum源中是否有samba-dc-bind-dlz软件包" - if dnf list available samba-dc-bind-dlz &>/dev/null; then - LOG_INFO "yum源中存在samba-dc-bind-dlz软件包" - else - LOG_ERROR "yum源中不存在samba-dc-bind-dlz软件包" - exit 255 - fi - - # 如果未安装,则安装软件包 - if [ "$INSTALLED_BEFORE" = false ]; then - LOG_INFO "安装samba-dc-bind-dlz软件包" - dnf install -y samba-dc-bind-dlz - CHECK_RESULT $? 0 0 "安装samba-dc-bind-dlz软件包失败" - fi - - # 检查Samba AD DC服务是否正常运行 - LOG_INFO "检查Samba AD DC服务是否正常运行" - systemctl is-active samba &>/dev/null - CHECK_RESULT $? 0 0 "Samba AD DC服务未运行" - - # 测试Samba AD DC与Bind DLZ的集成 - LOG_INFO "测试Samba AD DC与Bind DLZ的集成" - # 检查samba-tool命令是否可用 - LOG_INFO "检查samba-tool命令是否可用" - samba-tool --version &>/dev/null - CHECK_RESULT $? 0 0 "samba-tool命令不可用" - - # 测试域控制器功能 - LOG_INFO "测试域控制器功能" - # 尝试列出域用户(假设域已配置) - LOG_INFO "尝试列出域用户" - samba-tool user list &>/dev/null - # 此命令可能失败如果域未配置,所以不检查结果,仅记录日志 - if [ $? -eq 0 ]; then - LOG_INFO "域控制器功能正常" - else - LOG_INFO "域控制器功能测试未完成(可能需要域配置)" - fi - - # 测试Bind DLZ集成 - LOG_INFO "测试Bind DLZ集成" - # 检查named服务是否运行 - LOG_INFO "检查named服务是否运行" - systemctl is-active named &>/dev/null - if [ $? -eq 0 ]; then - LOG_INFO "named服务正在运行" - # 测试DNS查询 - LOG_INFO "测试DNS查询功能" - dig @127.0.0.1 localhost &>/dev/null - CHECK_RESULT $? 0 0 "DNS查询失败" - else - LOG_INFO "named服务未运行,跳过DNS查询测试" - fi - - # 测试AD集成功能 - LOG_INFO "测试AD集成功能" - # 检查Samba AD DC与Bind DLZ的配置集成 - LOG_INFO "检查Samba AD DC与Bind DLZ的配置集成" - if [ -f /etc/samba/smb.conf ] && grep -q "dlz" /etc/samba/smb.conf; then - LOG_INFO "Samba配置中包含DLZ设置" - else - LOG_INFO "Samba配置中未找到DLZ设置(可能需要手动配置)" - fi - - # 如果测试前未安装,则卸载软件包 - if [ "$INSTALLED_BEFORE" = false ]; then - LOG_INFO "卸载samba-dc-bind-dlz软件包" - dnf remove -y samba-dc-bind-dlz - CHECK_RESULT $? 0 0 "卸载samba-dc-bind-dlz软件包失败" - fi - - LOG_INFO "测试完成:Samba Active Directory集成测试" -} - -main "$@" \ No newline at end of file diff --git a/testcases/function_test/pkg_test/samba/samba-dc-bind-dlz/test_samba-dc-bind-dlz_function_config.sh b/testcases/function_test/pkg_test/samba/samba-dc-bind-dlz/test_samba-dc-bind-dlz_function_config.sh deleted file mode 100644 index c734072efab..00000000000 --- a/testcases/function_test/pkg_test/samba/samba-dc-bind-dlz/test_samba-dc-bind-dlz_function_config.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-25 -# @License : Mulan PSL v2 -# @Desc : Test basic configuration and service startup -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - set -e - - LOG_INFO "开始测试Samba域控制器bind-dlz功能配置" - - # 检查环境是否已安装 - LOG_INFO "检查Samba和BIND相关软件包是否已安装" - if dnf list installed samba-dc-bind-dlz 2>/dev/null | grep -q "samba-dc-bind-dlz"; then - INSTALLED="true" - LOG_INFO "检测到samba-dc-bind-dlz已安装" - else - INSTALLED="false" - LOG_INFO "未检测到samba-dc-bind-dlz安装" - fi - - # 检查yum源中是否有软件包 - LOG_INFO "检查yum源中是否存在samba-dc-bind-dlz软件包" - if ! dnf list available samba-dc-bind-dlz 2>/dev/null | grep -q "samba-dc-bind-dlz"; then - LOG_ERROR "yum源中未找到samba-dc-bind-dlz软件包" - exit 255 - fi - - # 如果未安装,则安装软件包 - if [ "$INSTALLED" = "false" ]; then - LOG_INFO "开始安装samba-dc-bind-dlz软件包" - dnf install -y samba-dc-bind-dlz - CHECK_RESULT $? 0 0 "安装samba-dc-bind-dlz失败" - LOG_INFO "samba-dc-bind-dlz安装成功" - fi - - # 检查samba-tool命令是否存在 - LOG_INFO "检查samba-tool命令是否可用" - if ! command -v samba-tool >/dev/null 2>&1; then - LOG_ERROR "samba-tool命令不存在" - exit 255 - fi - - # 测试基本配置 - LOG_INFO "测试Samba域控制器基本配置" - samba-tool domain provision --use-rfc2307 --realm=TESTDOMAIN.COM --domain=TESTDOMAIN --server-role=dc --dns-backend=BIND9_DLZ --adminpass=Passw0rd - CHECK_RESULT $? 0 0 "Samba域控制器配置失败" - - # 检查配置文件是否存在 - LOG_INFO "检查Samba配置文件" - if [ ! -f /etc/samba/smb.conf ]; then - LOG_ERROR "Samba配置文件不存在" - exit 1 - fi - - # 测试服务启动 - LOG_INFO "启动Samba服务" - systemctl start samba - CHECK_RESULT $? 0 0 "启动Samba服务失败" - - LOG_INFO "检查Samba服务状态" - systemctl status samba >/dev/null 2>&1 - CHECK_RESULT $? 0 0 "Samba服务未正常运行" - - # 测试BIND服务 - LOG_INFO "检查BIND服务配置" - if [ ! -f /etc/named.conf ]; then - LOG_ERROR "BIND配置文件不存在" - exit 1 - fi - - LOG_INFO "启动BIND服务" - systemctl start named - CHECK_RESULT $? 0 0 "启动BIND服务失败" - - LOG_INFO "检查BIND服务状态" - systemctl status named >/dev/null 2>&1 - CHECK_RESULT $? 0 0 "BIND服务未正常运行" - - # 测试DNS解析 - LOG_INFO "测试DNS解析功能" - nslookup localhost 127.0.0.1 >/dev/null 2>&1 - CHECK_RESULT $? 0 0 "DNS解析测试失败" - - # 环境清理 - LOG_INFO "开始清理测试环境" - - # 停止服务 - LOG_INFO "停止Samba服务" - systemctl stop samba 2>/dev/null || true - - LOG_INFO "停止BIND服务" - systemctl stop named 2>/dev/null || true - - # 如果测试前未安装,则卸载软件包 - if [ "$INSTALLED" = "false" ]; then - LOG_INFO "卸载samba-dc-bind-dlz软件包" - dnf remove -y samba-dc-bind-dlz - CHECK_RESULT $? 0 0 "卸载samba-dc-bind-dlz失败" - LOG_INFO "samba-dc-bind-dlz卸载成功" - fi - - # 清理配置文件 - LOG_INFO "清理配置文件" - rm -rf /etc/samba/smb.conf /etc/samba/smb.conf.bak /var/lib/samba/private /var/lib/samba/sysvol 2>/dev/null || true - rm -rf /etc/named.conf /var/named 2>/dev/null || true - - LOG_INFO "测试完成,环境已恢复" -} - -main "$@" \ No newline at end of file diff --git a/testcases/function_test/pkg_test/samba/samba-dc-bind-dlz/test_samba-dc-bind-dlz_function_dns_resolve.sh b/testcases/function_test/pkg_test/samba/samba-dc-bind-dlz/test_samba-dc-bind-dlz_function_dns_resolve.sh deleted file mode 100644 index 54211024202..00000000000 --- a/testcases/function_test/pkg_test/samba/samba-dc-bind-dlz/test_samba-dc-bind-dlz_function_dns_resolve.sh +++ /dev/null @@ -1,135 +0,0 @@ -#!/usr/bin/bash - -# Copyright (c) 2024 ISCAS .ALL rights reserved. -# This program is licensed under Mulan PSL v2. -# You can use it according to the terms and conditions of the Mulan PSL v2. -# http://license.coscl.org.cn/MulanPSL2 -# THIS PROGRAM IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, -# EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, -# 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 : Test DNS resolution functionality via BIND DLZ -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - # 判断是否已安装samba-dc-bind-dlz相关软件包 - LOG_INFO "检查samba-dc-bind-dlz相关软件包是否已安装" - rpm -q samba-dc-bind-dlz > /dev/null 2>&1 - IS_INSTALLED=$? - - # 记录初始安装状态 - if [ $IS_INSTALLED -eq 0 ]; then - LOG_INFO "samba-dc-bind-dlz已安装,脚本结束时将保持安装状态" - INITIAL_INSTALLED=true - else - LOG_INFO "samba-dc-bind-dlz未安装,将在测试过程中安装并在结束时卸载" - INITIAL_INSTALLED=false - fi - - # 检查yum源中是否有samba-dc-bind-dlz软件包 - LOG_INFO "检查yum源中是否存在samba-dc-bind-dlz软件包" - dnf list available samba-dc-bind-dlz > /dev/null 2>&1 - if [ $? -ne 0 ]; then - LOG_ERROR "yum源中未找到samba-dc-bind-dlz软件包" - exit 255 - fi - - # 如果未安装,则安装软件包 - if [ "$INITIAL_INSTALLED" = "false" ]; then - LOG_INFO "安装samba-dc-bind-dlz软件包" - dnf install -y samba-dc-bind-dlz - CHECK_RESULT $? 0 0 "安装samba-dc-bind-dlz失败" - fi - - # 检查bind命令是否存在 - LOG_INFO "检查bind命令是否存在" - command -v named > /dev/null 2>&1 - if [ $? -ne 0 ]; then - LOG_ERROR "bind命令不存在" - exit 255 - fi - - # 检查bind命令是否支持-dlz参数 - LOG_INFO "检查bind命令是否支持DLZ功能" - named -V 2>&1 | grep -i dlz > /dev/null 2>&1 - if [ $? -ne 0 ]; then - LOG_ERROR "bind命令不支持DLZ功能" - exit 255 - fi - - # 创建测试配置文件 - LOG_INFO "创建BIND DLZ测试配置文件" - cat > /tmp/test-named.conf << EOF - options { - directory "/var/named"; - pid-file "/var/run/named/named.pid"; - listen-on port 53 { 127.0.0.1; }; - allow-query { localhost; }; - recursion yes; - }; - - dlz "test zone" { - database "dlopen driver.so args"; - }; - EOF - CHECK_RESULT $? 0 0 "创建测试配置文件失败" - - # 启动BIND服务进行测试 - LOG_INFO "启动BIND服务进行DNS解析功能测试" - systemctl stop named > /dev/null 2>&1 - named -c /tmp/test-named.conf -g & - BIND_PID=$! - sleep 2 - - # 检查BIND服务是否成功启动 - LOG_INFO "检查BIND服务是否成功启动" - ps -p $BIND_PID > /dev/null 2>&1 - CHECK_RESULT $? 0 0 "BIND服务启动失败" - - # 测试DNS解析功能 - LOG_INFO "测试DNS解析功能" - dig @127.0.0.1 localhost > /tmp/dig_result.txt 2>&1 - DIG_RESULT=$? - - # 检查dig命令执行结果 - if [ $DIG_RESULT -eq 0 ]; then - LOG_INFO "DNS解析功能测试成功" - grep -q "status: NOERROR" /tmp/dig_result.txt - CHECK_RESULT $? 0 0 "DNS查询未返回成功状态" - else - LOG_ERROR "DNS解析功能测试失败" - CHECK_RESULT $DIG_RESULT 0 0 "dig命令执行失败" - fi - - # 停止BIND服务 - LOG_INFO "停止BIND服务" - kill $BIND_PID 2>/dev/null - wait $BIND_PID 2>/dev/null - - # 清理临时文件 - LOG_INFO "清理测试临时文件" - rm -f /tmp/test-named.conf /tmp/dig_result.txt - CHECK_RESULT $? 0 0 "清理临时文件失败" - - # 如果初始状态未安装,则卸载软件包 - if [ "$INITIAL_INSTALLED" = "false" ]; then - LOG_INFO "卸载samba-dc-bind-dlz软件包" - dnf remove -y samba-dc-bind-dlz - CHECK_RESULT $? 0 0 "卸载samba-dc-bind-dlz失败" - LOG_INFO "已恢复到初始未安装状态" - else - LOG_INFO "保持samba-dc-bind-dlz安装状态" - fi - - LOG_INFO "DNS解析功能通过BIND DLZ测试完成" -} - -main "$@" \ No newline at end of file diff --git a/testcases/function_test/pkg_test/samba/samba-dc-bind-dlz/test_samba-dc-bind-dlz_function_install.sh b/testcases/function_test/pkg_test/samba/samba-dc-bind-dlz/test_samba-dc-bind-dlz_function_install.sh deleted file mode 100644 index c95371e3ec2..00000000000 --- a/testcases/function_test/pkg_test/samba/samba-dc-bind-dlz/test_samba-dc-bind-dlz_function_install.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-25 -# @License : Mulan PSL v2 -# @Desc : Test package installation and verify successful installation -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - LOG_INFO "开始测试:测试软件包安装并验证安装成功" - LOG_INFO "检查测试环境是否已安装目标软件包" - - # 定义软件包名称 - PACKAGE_NAME="samba-dc-bind-dlz" - - # 检查软件包是否已在yum源中 - LOG_INFO "检查yum源中是否存在软件包:$PACKAGE_NAME" - dnf list available $PACKAGE_NAME &>/dev/null - if [ $? -ne 0 ]; then - LOG_ERROR "yum源中未找到软件包:$PACKAGE_NAME" - exit 255 - fi - - # 检查当前环境是否已安装该软件包 - LOG_INFO "检查系统是否已安装软件包:$PACKAGE_NAME" - if rpm -q $PACKAGE_NAME &>/dev/null; then - LOG_INFO "软件包 $PACKAGE_NAME 已安装,测试将验证安装状态,并在结束后保持安装状态" - WAS_INSTALLED=1 - else - LOG_INFO "软件包 $PACKAGE_NAME 未安装,将执行安装步骤作为测试" - WAS_INSTALLED=0 - fi - - # 如果未安装,则执行安装 - if [ $WAS_INSTALLED -eq 0 ]; then - LOG_INFO "开始安装软件包:$PACKAGE_NAME" - dnf install -y $PACKAGE_NAME - CHECK_RESULT $? 0 0 "安装软件包 $PACKAGE_NAME 失败" - LOG_INFO "软件包 $PACKAGE_NAME 安装成功" - fi - - # 验证软件包是否正确安装 - LOG_INFO "验证软件包 $PACKAGE_NAME 是否成功安装" - rpm -q $PACKAGE_NAME &>/dev/null - CHECK_RESULT $? 0 0 "验证软件包 $PACKAGE_NAME 安装状态失败" - - # 测试软件包的基本功能(这里以查询软件包信息为例) - LOG_INFO "测试软件包 $PACKAGE_NAME 的基本功能" - rpm -qi $PACKAGE_NAME &>/dev/null - CHECK_RESULT $? 0 0 "查询软件包 $PACKAGE_NAME 信息失败" - - # 如果测试开始时未安装,则在测试结束后卸载 - if [ $WAS_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 "测试脚本执行完毕" -} - -main "$@" \ No newline at end of file diff --git a/testcases/function_test/pkg_test/samba/samba-dc-bind-dlz/test_samba-dc-bind-dlz_function_service_status.sh b/testcases/function_test/pkg_test/samba/samba-dc-bind-dlz/test_samba-dc-bind-dlz_function_service_status.sh deleted file mode 100644 index 80bd85937f3..00000000000 --- a/testcases/function_test/pkg_test/samba/samba-dc-bind-dlz/test_samba-dc-bind-dlz_function_service_status.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 : Test service status and basic operations -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - LOG_INFO "开始测试Samba DC Bind DLZ功能服务状态" - LOG_INFO "步骤1: 检查环境是否已安装相关软件包" - INSTALLED_PACKAGES="" - for pkg in samba bind bind-dlz; do - if rpm -q $pkg &>/dev/null; then - INSTALLED_PACKAGES="$INSTALLED_PACKAGES $pkg" - fi - done - - if [ -n "$INSTALLED_PACKAGES" ]; then - LOG_INFO "检测到已安装软件包: $INSTALLED_PACKAGES" - ALREADY_INSTALLED=true - else - LOG_INFO "未检测到相关软件包,将在测试中安装" - ALREADY_INSTALLED=false - fi - - LOG_INFO "步骤2: 检查yum源中是否存在所需软件包" - for pkg in samba bind bind-dlz; do - if ! dnf list available $pkg &>/dev/null; then - LOG_ERROR "yum源中未找到软件包: $pkg" - exit 255 - fi - done - - LOG_INFO "步骤3: 安装必要的软件包" - if [ "$ALREADY_INSTALLED" = false ]; then - dnf install -y samba bind bind-dlz - CHECK_RESULT $? 0 0 "安装软件包失败" - fi - - LOG_INFO "步骤4: 检查命令参数支持情况" - if ! named -V 2>&1 | grep -q "DLZ"; then - LOG_ERROR "当前bind版本不支持DLZ功能" - exit 255 - fi - - LOG_INFO "步骤5: 启动并检查samba服务状态" - systemctl start smb - CHECK_RESULT $? 0 0 "启动samba服务失败" - systemctl status smb | grep -q "active (running)" - CHECK_RESULT $? 0 0 "samba服务未正常运行" - - LOG_INFO "步骤6: 启动并检查named服务状态" - systemctl start named - CHECK_RESULT $? 0 0 "启动named服务失败" - systemctl status named | grep -q "active (running)" - CHECK_RESULT $? 0 0 "named服务未正常运行" - - LOG_INFO "步骤7: 测试DNS查询功能" - if dig @localhost example.com &>/dev/null; then - LOG_INFO "DNS查询测试通过" - else - LOG_ERROR "DNS查询测试失败" - CHECK_RESULT 1 0 0 "DNS查询功能异常" - fi - - LOG_INFO "步骤8: 测试Samba域控制器功能" - if smbclient -L localhost -U% 2>&1 | grep -q "Sharename"; then - LOG_INFO "Samba共享列表查询成功" - else - LOG_ERROR "Samba共享列表查询失败" - CHECK_RESULT 1 0 0 "Samba域控制器功能异常" - fi - - LOG_INFO "步骤9: 清理测试环境" - if [ "$ALREADY_INSTALLED" = false ]; then - LOG_INFO "卸载测试安装的软件包" - dnf remove -y samba bind bind-dlz - CHECK_RESULT $? 0 0 "卸载软件包失败" - else - LOG_INFO "保持原有安装状态" - fi - - LOG_INFO "步骤10: 恢复服务状态" - if [ "$ALREADY_INSTALLED" = true ]; then - systemctl restart smb named - CHECK_RESULT $? 0 0 "恢复服务失败" - else - systemctl stop smb named 2>/dev/null || true - fi - - LOG_INFO "测试完成" -} - -main "$@" \ No newline at end of file diff --git a/testcases/function_test/pkg_test/texlive-base/texlive-ptex/test_texlive-ptex_eptex_-etex.sh b/testcases/function_test/pkg_test/texlive-base/texlive-ptex/test_texlive-ptex_eptex_-etex.sh deleted file mode 100644 index cad2b77cf5f..00000000000 --- a/testcases/function_test/pkg_test/texlive-base/texlive-ptex/test_texlive-ptex_eptex_-etex.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-08 -# @License : Mulan PSL v2 -# @Desc : 测试 eptex 命令启用 e-TeX 扩展 -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - # 判断环境是否已经安装texlive-ptex-eptex-etex - LOG_INFO "检查是否已安装texlive-ptex-eptex-etex" - rpm -q texlive-ptex-eptex-etex > /dev/null 2>&1 - if [ $? -eq 0 ]; then - LOG_INFO "texlive-ptex-eptex-etex已安装,脚本结束时将保持安装状态" - installed=true - else - LOG_INFO "texlive-ptex-eptex-etex未安装,将在测试中安装并在结束前卸载" - installed=false - fi - - # 检查yum源中是否有该软件包 - LOG_INFO "检查yum源中是否有texlive-ptex-eptex-etex软件包" - dnf list available texlive-ptex-eptex-etex > /dev/null 2>&1 - if [ $? -ne 0 ]; then - LOG_ERROR "yum源中未找到texlive-ptex-eptex-etex软件包" - exit 255 - fi - - # 如果未安装,则安装软件包 - if [ "$installed" = false ]; then - LOG_INFO "安装texlive-ptex-eptex-etex软件包" - dnf install -y texlive-ptex-eptex-etex - CHECK_RESULT $? 0 0 "安装texlive-ptex-eptex-etex失败" - fi - - # 测试eptex命令启用e-TeX扩展 - LOG_INFO "测试eptex命令启用e-TeX扩展" - # 检查eptex命令是否存在 - which eptex > /dev/null 2>&1 - if [ $? -ne 0 ]; then - LOG_ERROR "eptex命令不存在" - exit 255 - fi - - # 检查eptex命令是否支持--help参数 - eptex --help > /dev/null 2>&1 - if [ $? -ne 0 ]; then - LOG_ERROR "eptex命令不支持--help参数" - exit 255 - fi - - # 使用eptex处理一个简单的TeX文件,测试e-TeX扩展是否启用 - LOG_INFO "创建测试TeX文件" - cat > test_eptex.tex << "EOF" - \documentclass{article} - \begin{document} - Hello, e-TeX! - \ifx\eTeXversion\undefined - e-TeX extensions are NOT enabled. - \else - e-TeX extensions are enabled. eTeXversion=\eTeXversion. - \fi - \end{document} - EOF - - # 使用eptex编译测试文件 - LOG_INFO "使用eptex编译测试文件" - eptex test_eptex.tex - CHECK_RESULT $? 0 0 "eptex编译失败" - - # 检查输出文件 - LOG_INFO "检查eptex输出文件" - if [ -f test_eptex.dvi ]; then - LOG_INFO "eptex成功生成DVI文件" - else - LOG_ERROR "eptex未生成DVI文件" - exit 1 - fi - - # 检查e-TeX扩展是否启用 - LOG_INFO "检查e-TeX扩展是否启用" - grep "e-TeX extensions are enabled" test_eptex.log > /dev/null 2>&1 - CHECK_RESULT $? 0 0 "e-TeX扩展未启用" - - # 清理测试文件 - LOG_INFO "清理测试文件" - rm -f test_eptex.tex test_eptex.dvi test_eptex.log test_eptex.aux - - # 如果测试前未安装,则在测试结束后卸载软件包 - if [ "$installed" = false ]; then - LOG_INFO "卸载texlive-ptex-eptex-etex软件包" - dnf remove -y texlive-ptex-eptex-etex - CHECK_RESULT $? 0 0 "卸载texlive-ptex-eptex-etex失败" - fi - - LOG_INFO "测试完成" -} - -main "$@" \ No newline at end of file diff --git a/testcases/function_test/pkg_test/texlive-base/texlive-ptex/test_texlive-ptex_eptex_-file-line-error.sh b/testcases/function_test/pkg_test/texlive-base/texlive-ptex/test_texlive-ptex_eptex_-file-line-error.sh deleted file mode 100644 index a79dd43eaf3..00000000000 --- a/testcases/function_test/pkg_test/texlive-base/texlive-ptex/test_texlive-ptex_eptex_-file-line-error.sh +++ /dev/null @@ -1,87 +0,0 @@ -#!/usr/bin/bash - -# Copyright (c) 2024 ISCAS .ALL rights reserved. -# This program is licensed under Mulan PSL v2. -# You can use it according to the terms and conditions of the Mulan PSL v2. -# http://license.coscl.org.cn/MulanPSL2 -# THIS PROGRAM IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, -# EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, -# MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. -# See the Mulan PSL v2 for more details. - -# ############################################# -# @Author : honghua -# @Contact : honghua@iscas.ac.cn -# @Date : 2026-03-08 -# @License : Mulan PSL v2 -# @Desc : 测试 eptex 命令启用文件:行:错误样式消息 -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - LOG_INFO "开始测试 eptex 命令启用文件:行:错误样式消息" - - # 检查 yum 源中是否有 texlive-ptex-eptex 软件包 - LOG_INFO "检查 yum 源中是否有 texlive-ptex-eptex 软件包" - dnf list available texlive-ptex-eptex &>/dev/null - if [ $? -ne 0 ]; then - LOG_ERROR "yum 源中未找到 texlive-ptex-eptex 软件包" - exit 255 - fi - - # 检查系统是否已安装 texlive-ptex-eptex - LOG_INFO "检查系统是否已安装 texlive-ptex-eptex" - rpm -q texlive-ptex-eptex &>/dev/null - if [ $? -eq 0 ]; then - LOG_INFO "texlive-ptex-eptex 已安装,测试结束后保持安装状态" - INSTALLED=1 - else - LOG_INFO "texlive-ptex-eptex 未安装,将在测试过程中安装" - INSTALLED=0 - fi - - # 如果未安装,则安装软件包 - if [ $INSTALLED -eq 0 ]; then - LOG_INFO "安装 texlive-ptex-eptex 软件包" - dnf install -y texlive-ptex-eptex - CHECK_RESULT $? 0 0 "安装 texlive-ptex-eptex 失败" - fi - - # 测试 eptex 命令的 -file-line-error 参数 - LOG_INFO "测试 eptex 命令的 -file-line-error 参数" - eptex --help | grep -q -- "-file-line-error" - if [ $? -ne 0 ]; then - LOG_ERROR "eptex 命令不支持 -file-line-error 参数" - exit 255 - fi - - # 创建一个简单的 TeX 文件用于测试 - LOG_INFO "创建测试 TeX 文件" - cat > test.tex << "EOF" - \documentclass{article} - \begin{document} - Hello, World! - \end{document} - EOF - - # 使用 -file-line-error 参数运行 eptex - LOG_INFO "使用 -file-line-error 参数运行 eptex" - eptex -file-line-error test.tex - CHECK_RESULT $? 0 0 "eptex 命令执行失败" - - # 清理测试文件 - LOG_INFO "清理测试文件" - rm -f test.tex test.log test.aux - - # 如果测试前未安装,则卸载软件包 - if [ $INSTALLED -eq 0 ]; then - LOG_INFO "卸载 texlive-ptex-eptex 软件包" - dnf remove -y texlive-ptex-eptex - CHECK_RESULT $? 0 0 "卸载 texlive-ptex-eptex 失败" - fi - - LOG_INFO "测试 eptex 命令启用文件:行:错误样式消息完成" -} - -main "$@" \ No newline at end of file diff --git a/testcases/function_test/pkg_test/texlive-base/texlive-ptex/test_texlive-ptex_eptex_-fmt_myformat.sh b/testcases/function_test/pkg_test/texlive-base/texlive-ptex/test_texlive-ptex_eptex_-fmt_myformat.sh deleted file mode 100644 index 0804e0c691c..00000000000 --- a/testcases/function_test/pkg_test/texlive-base/texlive-ptex/test_texlive-ptex_eptex_-fmt_myformat.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-08 -# @License : Mulan PSL v2 -# @Desc : 测试 eptex 命令使用指定的格式文件 myformat.fmt -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - LOG_INFO "开始测试 eptex 命令使用指定的格式文件 myformat.fmt" - - # 检查软件包是否在yum源中 - LOG_INFO "检查 yum 源中是否存在 texlive-ptex 和 texlive-eptex 软件包" - if ! dnf list available texlive-ptex texlive-eptex &>/dev/null; then - LOG_ERROR "yum 源中缺少 texlive-ptex 或 texlive-eptex 软件包" - exit 255 - fi - - # 判断环境是否已安装软件包 - LOG_INFO "检查环境是否已安装 texlive-ptex 和 texlive-eptex" - if rpm -q texlive-ptex texlive-eptex &>/dev/null; then - LOG_INFO "环境已安装 texlive-ptex 和 texlive-eptex,保持安装状态" - already_installed=true - else - LOG_INFO "环境未安装 texlive-ptex 和 texlive-eptex,将进行安装" - already_installed=false - fi - - # 如果未安装,则安装软件包 - if [ "$already_installed" = false ]; then - LOG_INFO "安装 texlive-ptex 和 texlive-eptex" - dnf install -y texlive-ptex texlive-eptex - CHECK_RESULT $? 0 0 "安装 texlive-ptex 和 texlive-eptex 失败" - fi - - # 检查 eptex 命令是否支持 -fmt 参数 - LOG_INFO "检查 eptex 命令是否支持 -fmt 参数" - eptex -help 2>&1 | grep -q -- "-fmt" - CHECK_RESULT $? 0 0 "eptex 命令不支持 -fmt 参数" - if [ $? -ne 0 ]; then - LOG_ERROR "eptex 命令不支持 -fmt 参数" - exit 255 - fi - - # 创建测试用的格式文件 myformat.fmt - LOG_INFO "创建测试格式文件 myformat.fmt" - cat > myformat.fmt << "EOF" - % 这是一个简单的格式文件示例 - \input plain.tex - \dump - EOF - CHECK_RESULT $? 0 0 "创建 myformat.fmt 格式文件失败" - - # 使用 eptex 命令加载指定的格式文件 - LOG_INFO "使用 eptex 命令加载 myformat.fmt 格式文件" - eptex -fmt myformat.fmt -ini "\\relax" - CHECK_RESULT $? 0 0 "eptex 命令加载 myformat.fmt 格式文件失败" - - # 清理测试文件 - LOG_INFO "清理测试文件" - rm -f myformat.fmt - CHECK_RESULT $? 0 0 "删除 myformat.fmt 文件失败" - - # 如果脚本开始时未安装软件包,则卸载 - if [ "$already_installed" = false ]; then - LOG_INFO "卸载 texlive-ptex 和 texlive-eptex 软件包" - dnf remove -y texlive-ptex texlive-eptex - CHECK_RESULT $? 0 0 "卸载 texlive-ptex 和 texlive-eptex 失败" - else - LOG_INFO "保持 texlive-ptex 和 texlive-eptex 的安装状态" - fi - - LOG_INFO "测试 eptex 命令使用指定的格式文件 myformat.fmt 完成" -} - -main "$@" \ No newline at end of file diff --git a/testcases/function_test/pkg_test/texlive-base/texlive-ptex/test_texlive-ptex_eptex_-halt-on-error.sh b/testcases/function_test/pkg_test/texlive-base/texlive-ptex/test_texlive-ptex_eptex_-halt-on-error.sh deleted file mode 100644 index a55fe6bcbc7..00000000000 --- a/testcases/function_test/pkg_test/texlive-base/texlive-ptex/test_texlive-ptex_eptex_-halt-on-error.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-08 -# @License : Mulan PSL v2 -# @Desc : 测试 eptex 命令在遇到第一个错误时停止处理 -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - # 定义软件包名称和命令 - PACKAGE_NAME="texlive-ptex-eptex" - COMMAND="eptex" - OPTION="-halt-on-error" - - # 步骤1: 检查软件包是否在yum源中 - LOG_INFO "检查软件包 ${PACKAGE_NAME} 是否在yum源中" - dnf list available ${PACKAGE_NAME} &> /dev/null - if [ $? -ne 0 ]; then - LOG_ERROR "软件包 ${PACKAGE_NAME} 不在yum源中" - exit 255 - fi - - # 步骤2: 检查命令参数是否支持 - LOG_INFO "检查命令 ${COMMAND} 是否支持参数 ${OPTION}" - ${COMMAND} --help 2>&1 | grep -q "${OPTION}" - if [ $? -ne 0 ]; then - LOG_ERROR "命令 ${COMMAND} 不支持参数 ${OPTION}" - exit 255 - fi - - # 步骤3: 检查当前环境是否已安装软件包 - LOG_INFO "检查当前环境是否已安装软件包 ${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 - - # 步骤4: 如果未安装,则安装软件包 - if [ ${NEED_CLEANUP} -eq 1 ]; then - LOG_INFO "安装软件包 ${PACKAGE_NAME}" - dnf install -y ${PACKAGE_NAME} - CHECK_RESULT $? 0 0 "安装软件包 ${PACKAGE_NAME} 失败" - fi - - # 步骤5: 创建测试用的TeX文件,其中包含错误 - LOG_INFO "创建测试用的TeX文件,其中包含错误" - TEST_FILE="test_halt.tex" - cat > ${TEST_FILE} << "EOF" - \documentclass{article} - \begin{document} - Hello, world! - \undefinedcommand - More text here. - \end{document} - EOF - CHECK_RESULT $? 0 0 "创建测试文件失败" - - # 步骤6: 执行eptex命令,使用-halt-on-error参数 - LOG_INFO "执行 eptex 命令,使用 -halt-on-error 参数,预期在第一个错误时停止" - ${COMMAND} ${OPTION} ${TEST_FILE} 2>&1 | tee output.log - EXIT_CODE=$? - - # 步骤7: 检查命令执行结果 - LOG_INFO "检查命令退出码" - if [ ${EXIT_CODE} -eq 0 ]; then - LOG_ERROR "命令未按预期在错误处停止,退出码为0" - CHECK_RESULT 1 0 0 "命令未按预期停止" - else - LOG_INFO "命令因错误停止,退出码为 ${EXIT_CODE}" - # 检查输出中是否包含错误信息,并且是否在第一个错误后停止 - if grep -q "undefinedcommand" output.log && ! grep -q "More text here" output.log; then - LOG_INFO "命令在第一个错误处停止,符合预期" - CHECK_RESULT 0 0 0 "命令执行结果检查" - else - LOG_ERROR "命令未在第一个错误处停止,输出内容不符合预期" - CHECK_RESULT 1 0 0 "命令未在第一个错误处停止" - fi - fi - - # 步骤8: 清理测试文件 - LOG_INFO "清理测试文件" - rm -f ${TEST_FILE} output.log *.log *.aux *.dvi - CHECK_RESULT $? 0 0 "清理测试文件失败" - - # 步骤9: 如果测试前未安装,则卸载软件包 - if [ ${NEED_CLEANUP} -eq 1 ]; then - LOG_INFO "卸载软件包 ${PACKAGE_NAME}" - dnf remove -y ${PACKAGE_NAME} - CHECK_RESULT $? 0 0 "卸载软件包 ${PACKAGE_NAME} 失败" - else - LOG_INFO "测试前软件包已安装,保持安装状态" - fi - - LOG_INFO "测试完成" -} - -main "$@" \ No newline at end of file diff --git a/testcases/function_test/pkg_test/texlive-base/texlive-ptex/test_texlive-ptex_eptex_-ini.sh b/testcases/function_test/pkg_test/texlive-base/texlive-ptex/test_texlive-ptex_eptex_-ini.sh deleted file mode 100644 index 9d707f9ba9d..00000000000 --- a/testcases/function_test/pkg_test/texlive-base/texlive-ptex/test_texlive-ptex_eptex_-ini.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-08 -# @License : Mulan PSL v2 -# @Desc : 测试 eptex 命令以 iniptex 模式运行 -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - # 检查环境是否已安装eptex - LOG_INFO "检查环境是否已安装eptex" - rpm -q eptex > /dev/null 2>&1 - if [ $? -eq 0 ]; then - LOG_INFO "eptex已安装,脚本结束后将保持安装状态" - INSTALLED=1 - else - LOG_INFO "eptex未安装,将在测试步骤中安装" - INSTALLED=0 - fi - - # 检查yum源中是否有eptex软件包 - LOG_INFO "检查yum源中是否有eptex软件包" - dnf list available eptex > /dev/null 2>&1 - if [ $? -ne 0 ]; then - LOG_ERROR "yum源中未找到eptex软件包" - exit 255 - fi - - # 如果未安装,则安装eptex - if [ $INSTALLED -eq 0 ]; then - LOG_INFO "安装eptex软件包" - dnf install -y eptex - CHECK_RESULT $? 0 0 "安装eptex失败" - fi - - # 检查eptex命令是否支持-ini参数 - LOG_INFO "检查eptex命令是否支持-ini参数" - eptex -help 2>&1 | grep -q "\-ini" - if [ $? -ne 0 ]; then - LOG_ERROR "eptex命令不支持-ini参数" - # 如果之前未安装,则卸载已安装的软件包 - if [ $INSTALLED -eq 0 ]; then - LOG_INFO "清理环境,卸载eptex软件包" - dnf remove -y eptex - fi - exit 255 - fi - - # 测试eptex命令以iniptex模式运行 - LOG_INFO "测试eptex命令以iniptex模式运行" - eptex -ini -jobname=test -interaction=nonstopmode "\\relax\\end" > /dev/null 2>&1 - CHECK_RESULT $? 0 0 "eptex命令以iniptex模式运行失败" - - # 清理环境:如果之前未安装,则卸载eptex - if [ $INSTALLED -eq 0 ]; then - LOG_INFO "清理环境,卸载eptex软件包" - dnf remove -y eptex - CHECK_RESULT $? 0 0 "卸载eptex失败" - else - LOG_INFO "环境已安装eptex,保持安装状态" - fi - - LOG_INFO "测试完成" -} - -main "$@" \ No newline at end of file diff --git a/testcases/function_test/pkg_test/texlive-base/texlive-ptex/test_texlive-ptex_eptex_-interaction_batchmode.sh b/testcases/function_test/pkg_test/texlive-base/texlive-ptex/test_texlive-ptex_eptex_-interaction_batchmode.sh deleted file mode 100644 index 7c2f7d26a8a..00000000000 --- a/testcases/function_test/pkg_test/texlive-base/texlive-ptex/test_texlive-ptex_eptex_-interaction_batchmode.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-08 -# @License : Mulan PSL v2 -# @Desc : 测试 eptex 命令设置交互模式为 batchmode -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - # 环境检查与清理函数 - cleanup_environment() { - LOG_INFO "开始清理环境" - if [ "${CLEANUP_NEEDED}" -eq 1 ]; then - LOG_INFO "卸载测试安装的软件包" - dnf remove -y texlive-ptex-eptex 2>/dev/null - CHECK_RESULT $? 0 0 "卸载texlive-ptex-eptex失败" - fi - LOG_INFO "环境清理完成" - } - - # 主测试流程 - LOG_INFO "开始测试 eptex 命令设置交互模式为 batchmode" - - # 检查软件包是否已在yum源中 - LOG_INFO "检查yum源中是否存在 texlive-ptex-eptex 软件包" - dnf list available texlive-ptex-eptex &>/dev/null - if [ $? -ne 0 ]; then - LOG_ERROR "yum源中不存在 texlive-ptex-eptex 软件包" - exit 255 - fi - - # 检查是否已安装 - LOG_INFO "检查系统是否已安装 texlive-ptex-eptex" - rpm -q texlive-ptex-eptex &>/dev/null - if [ $? -eq 0 ]; then - LOG_INFO "texlive-ptex-eptex 已安装,测试后保持安装状态" - CLEANUP_NEEDED=0 - else - LOG_INFO "texlive-ptex-eptex 未安装,将进行安装测试" - CLEANUP_NEEDED=1 - fi - - # 如果需要安装则进行安装 - if [ "${CLEANUP_NEEDED}" -eq 1 ]; then - LOG_INFO "安装 texlive-ptex-eptex 软件包" - dnf install -y texlive-ptex-eptex - CHECK_RESULT $? 0 0 "安装texlive-ptex-eptex失败" - fi - - # 检查eptex命令是否支持-interaction参数 - LOG_INFO "检查 eptex 命令是否支持 -interaction 参数" - eptex --help 2>&1 | grep -q "\-interaction" - if [ $? -ne 0 ]; then - LOG_ERROR "eptex 命令不支持 -interaction 参数" - cleanup_environment - exit 255 - fi - - # 测试batchmode交互模式 - LOG_INFO "测试 eptex 命令设置交互模式为 batchmode" - echo "\relax\end" > test_batchmode.tex - eptex -interaction=batchmode test_batchmode.tex - CHECK_RESULT $? 0 0 "eptex命令batchmode交互模式测试失败" - - # 清理测试文件 - LOG_INFO "清理测试文件" - rm -f test_batchmode.tex test_batchmode.log test_batchmode.aux - - # 恢复环境 - cleanup_environment - - LOG_INFO "测试 eptex 命令设置交互模式为 batchmode 完成" -} - -main "$@" \ No newline at end of file diff --git a/testcases/function_test/pkg_test/texlive-base/texlive-ptex/test_texlive-ptex_eptex_-interaction_errorstopmode.sh b/testcases/function_test/pkg_test/texlive-base/texlive-ptex/test_texlive-ptex_eptex_-interaction_errorstopmode.sh deleted file mode 100644 index 45c7d6817c0..00000000000 --- a/testcases/function_test/pkg_test/texlive-base/texlive-ptex/test_texlive-ptex_eptex_-interaction_errorstopmode.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-08 -# @License : Mulan PSL v2 -# @Desc : 测试 eptex 命令设置交互模式为 errorstopmode -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - # 初始化日志函数(使用已定义的LOG_INFO和LOG_ERROR) - # 步骤1:检查是否已安装texlive-ptex-eptex软件包 - LOG_INFO "检查是否已安装texlive-ptex-eptex软件包" - rpm -q texlive-ptex-eptex > /dev/null 2>&1 - if [ $? -eq 0 ]; then - LOG_INFO "texlive-ptex-eptex已安装,脚本结束后将保持安装状态" - INSTALLED=1 - else - LOG_INFO "texlive-ptex-eptex未安装,将在测试过程中安装" - INSTALLED=0 - fi - - # 步骤2:检查yum源中是否有texlive-ptex-eptex软件包 - LOG_INFO "检查yum源中是否有texlive-ptex-eptex软件包" - dnf list available texlive-ptex-eptex > /dev/null 2>&1 - CHECK_RESULT $? 0 0 "yum源中未找到texlive-ptex-eptex软件包" - if [ $? -ne 0 ]; then - LOG_ERROR "yum源中未找到texlive-ptex-eptex软件包" - exit 255 - fi - - # 步骤3:安装texlive-ptex-eptex软件包(如果未安装) - if [ $INSTALLED -eq 0 ]; then - LOG_INFO "安装texlive-ptex-eptex软件包" - dnf install -y texlive-ptex-eptex > /dev/null 2>&1 - CHECK_RESULT $? 0 0 "安装texlive-ptex-eptex软件包失败" - fi - - # 步骤4:检查eptex命令是否存在 - LOG_INFO "检查eptex命令是否存在" - which eptex > /dev/null 2>&1 - CHECK_RESULT $? 0 0 "eptex命令不存在" - - # 步骤5:检查eptex命令是否支持-interaction参数 - LOG_INFO "检查eptex命令是否支持-interaction参数" - eptex --help 2>&1 | grep -q "\-interaction" - CHECK_RESULT $? 0 0 "eptex命令不支持-interaction参数" - if [ $? -ne 0 ]; then - LOG_ERROR "eptex命令不支持-interaction参数" - exit 255 - fi - - # 步骤6:测试eptex命令设置交互模式为errorstopmode - LOG_INFO "测试eptex命令设置交互模式为errorstopmode" - eptex -interaction=errorstopmode < /dev/null 2>&1 - CHECK_RESULT $? 0 0 "卸载texlive-ptex-eptex软件包失败" - else - LOG_INFO "测试前已安装texlive-ptex-eptex,保持安装状态" - fi - - LOG_INFO "测试完成" -} - -main "$@" \ No newline at end of file diff --git a/testcases/function_test/pkg_test/texlive-base/texlive-ptex/test_texlive-ptex_eptex_-ipc-start.sh b/testcases/function_test/pkg_test/texlive-base/texlive-ptex/test_texlive-ptex_eptex_-ipc-start.sh deleted file mode 100644 index 5693c54cc66..00000000000 --- a/testcases/function_test/pkg_test/texlive-base/texlive-ptex/test_texlive-ptex_eptex_-ipc-start.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-08 -# @License : Mulan PSL v2 -# @Desc : 测试 eptex 命令将 DVI 输出发送到套接字并启动服务器 -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - # 定义测试变量 - TEST_PACKAGE="texlive-ptex" - TEST_COMMAND="eptex" - TEST_OPTION="--ipc-start" - TEST_OUTPUT_FILE="/tmp/test_eptex_ipc.dvi" - TEST_SOCKET="/tmp/test_eptex_socket" - - # 检查yum源中是否有该软件包 - LOG_INFO "检查yum源中是否有 ${TEST_PACKAGE} 软件包" - dnf list available ${TEST_PACKAGE} > /dev/null 2>&1 - if [ $? -ne 0 ]; then - LOG_ERROR "yum源中未找到 ${TEST_PACKAGE} 软件包" - exit 255 - fi - - # 检查环境是否已安装 - LOG_INFO "检查环境是否已安装 ${TEST_PACKAGE}" - rpm -q ${TEST_PACKAGE} > /dev/null 2>&1 - if [ $? -eq 0 ]; then - LOG_INFO "检测到 ${TEST_PACKAGE} 已安装" - INSTALLED_BEFORE=true - else - LOG_INFO "检测到 ${TEST_PACKAGE} 未安装" - INSTALLED_BEFORE=false - fi - - # 如果未安装,则安装软件包 - if [ "${INSTALLED_BEFORE}" = "false" ]; then - LOG_INFO "安装 ${TEST_PACKAGE} 软件包" - dnf install -y ${TEST_PACKAGE} - CHECK_RESULT $? 0 0 "安装 ${TEST_PACKAGE} 失败" - fi - - # 检查eptex命令是否支持--ipc-start参数 - LOG_INFO "检查 ${TEST_COMMAND} 命令是否支持 ${TEST_OPTION} 参数" - ${TEST_COMMAND} --help 2>&1 | grep -q "${TEST_OPTION}" - if [ $? -ne 0 ]; then - LOG_ERROR "${TEST_COMMAND} 命令不支持 ${TEST_OPTION} 参数" - exit 255 - fi - - # 清理可能存在的旧socket文件 - LOG_INFO "清理可能存在的旧socket文件" - rm -f ${TEST_SOCKET} - - # 启动eptex服务器 - LOG_INFO "启动 ${TEST_COMMAND} 服务器" - ${TEST_COMMAND} ${TEST_OPTION} ${TEST_SOCKET} & - SERVER_PID=$! - sleep 2 - - # 检查服务器是否成功启动 - LOG_INFO "检查服务器是否成功启动" - ps -p ${SERVER_PID} > /dev/null 2>&1 - CHECK_RESULT $? 0 0 "eptex服务器启动失败" - - # 检查socket文件是否创建 - LOG_INFO "检查socket文件是否创建" - [ -S ${TEST_SOCKET} ] - CHECK_RESULT $? 0 0 "socket文件未创建" - - # 创建简单的TeX文件用于测试 - LOG_INFO "创建测试TeX文件" - cat > /tmp/test.tex << "EOF" - \documentclass{article} - \begin{document} - Hello eptex IPC test! - \end{document} - EOF - - # 通过socket发送DVI输出 - LOG_INFO "通过socket发送DVI输出" - ${TEST_COMMAND} --ipc ${TEST_SOCKET} /tmp/test.tex -o ${TEST_OUTPUT_FILE} - CHECK_RESULT $? 0 0 "通过socket发送DVI输出失败" - - # 检查DVI文件是否生成 - LOG_INFO "检查DVI文件是否生成" - [ -f ${TEST_OUTPUT_FILE} ] - CHECK_RESULT $? 0 0 "DVI文件未生成" - - # 停止服务器 - LOG_INFO "停止eptex服务器" - kill ${SERVER_PID} 2>/dev/null - wait ${SERVER_PID} 2>/dev/null - - # 清理测试文件 - LOG_INFO "清理测试文件" - rm -f /tmp/test.tex ${TEST_OUTPUT_FILE} ${TEST_SOCKET} - - # 如果之前未安装,则卸载软件包 - if [ "${INSTALLED_BEFORE}" = "false" ]; then - LOG_INFO "卸载 ${TEST_PACKAGE} 软件包" - dnf remove -y ${TEST_PACKAGE} - CHECK_RESULT $? 0 0 "卸载 ${TEST_PACKAGE} 失败" - fi - - LOG_INFO "测试完成" -} - -main "$@" \ No newline at end of file diff --git a/testcases/function_test/pkg_test/texlive-base/texlive-ptex/test_texlive-ptex_eptex_-ipc.sh b/testcases/function_test/pkg_test/texlive-base/texlive-ptex/test_texlive-ptex_eptex_-ipc.sh deleted file mode 100644 index 028bcef03b6..00000000000 --- a/testcases/function_test/pkg_test/texlive-base/texlive-ptex/test_texlive-ptex_eptex_-ipc.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-08 -# @License : Mulan PSL v2 -# @Desc : 测试 eptex 命令将 DVI 输出发送到套接字 -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - # 检查是否已经安装texlive-ptex-eptex包 - LOG_INFO "检查是否已安装texlive-ptex-eptex包" - if dnf list installed texlive-ptex-eptex &>/dev/null; then - LOG_INFO "texlive-ptex-eptex已安装,脚本结束后将保持安装状态" - INSTALLED=1 - else - LOG_INFO "texlive-ptex-eptex未安装,将在测试后卸载" - INSTALLED=0 - fi - - # 检查yum源中是否有texlive-ptex-eptex包 - LOG_INFO "检查yum源中是否有texlive-ptex-eptex包" - if ! dnf list available texlive-ptex-eptex &>/dev/null; then - LOG_ERROR "yum源中未找到texlive-ptex-eptex包" - exit 255 - fi - - # 如果未安装,则安装texlive-ptex-eptex包 - if [ $INSTALLED -eq 0 ]; then - LOG_INFO "安装texlive-ptex-eptex包" - dnf install -y texlive-ptex-eptex - CHECK_RESULT $? 0 0 "安装texlive-ptex-eptex包失败" - fi - - # 检查eptex命令是否支持-ipc参数 - LOG_INFO "检查eptex命令是否支持-ipc参数" - if ! eptex --help | grep -q "\-ipc"; then - LOG_ERROR "eptex命令不支持-ipc参数" - exit 255 - fi - - # 创建一个简单的TeX文件用于测试 - LOG_INFO "创建测试TeX文件" - cat > test.tex << "EOF" - \documentclass{article} - \begin{document} - Hello, eptex! - \end{document} - EOF - CHECK_RESULT $? 0 0 "创建测试TeX文件失败" - - # 使用eptex命令将DVI输出发送到套接字 - LOG_INFO "使用eptex命令将DVI输出发送到套接字" - eptex -ipc test.tex - CHECK_RESULT $? 0 0 "eptex命令执行失败" - - # 清理临时文件 - LOG_INFO "清理临时文件" - rm -f test.tex test.dvi test.log test.aux - - # 如果之前未安装,则卸载texlive-ptex-eptex包 - if [ $INSTALLED -eq 0 ]; then - LOG_INFO "卸载texlive-ptex-eptex包" - dnf remove -y texlive-ptex-eptex - CHECK_RESULT $? 0 0 "卸载texlive-ptex-eptex包失败" - fi - - LOG_INFO "测试完成,环境已恢复" -} - -main "$@" \ No newline at end of file diff --git a/testcases/function_test/pkg_test/texlive-base/texlive-ptex/test_texlive-ptex_eptex_-jobname_testjob.sh b/testcases/function_test/pkg_test/texlive-base/texlive-ptex/test_texlive-ptex_eptex_-jobname_testjob.sh deleted file mode 100644 index c7eb96b70f4..00000000000 --- a/testcases/function_test/pkg_test/texlive-base/texlive-ptex/test_texlive-ptex_eptex_-jobname_testjob.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-08 -# @License : Mulan PSL v2 -# @Desc : 测试 eptex 命令设置作业名称为 testjob -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - # 检查是否已安装texlive-ptex包 - LOG_INFO "检查是否已安装texlive-ptex包" - if rpm -q texlive-ptex &> /dev/null; then - LOG_INFO "texlive-ptex已安装" - INSTALLED="true" - else - LOG_INFO "texlive-ptex未安装" - INSTALLED="false" - fi - - # 检查yum源中是否有texlive-ptex包 - LOG_INFO "检查yum源中是否有texlive-ptex包" - if ! dnf list available texlive-ptex &> /dev/null; then - LOG_ERROR "yum源中未找到texlive-ptex包" - exit 255 - fi - - # 如果未安装,则安装texlive-ptex - if [ "$INSTALLED" == "false" ]; then - LOG_INFO "安装texlive-ptex包" - dnf install -y texlive-ptex - CHECK_RESULT $? 0 0 "安装texlive-ptex失败" - fi - - # 检查eptex命令是否支持-jobname参数 - LOG_INFO "检查eptex命令是否支持-jobname参数" - if ! eptex --help 2>&1 | grep -q "\-jobname"; then - LOG_ERROR "eptex命令不支持-jobname参数" - # 如果之前未安装,需要卸载 - if [ "$INSTALLED" == "false" ]; then - dnf remove -y texlive-ptex - fi - exit 255 - fi - - # 使用eptex命令设置作业名称为testjob - LOG_INFO "使用eptex命令设置作业名称为testjob" - echo "\documentclass{article}\begin{document}test\end{document}" > test.tex - eptex -jobname testjob test.tex - CHECK_RESULT $? 0 0 "eptex命令执行失败" - - # 检查是否生成了testjob.dvi文件 - LOG_INFO "检查是否生成了testjob.dvi文件" - if [ -f "testjob.dvi" ]; then - LOG_INFO "成功生成了testjob.dvi文件" - else - LOG_ERROR "未生成testjob.dvi文件" - CHECK_RESULT 1 0 0 "未生成testjob.dvi文件" - fi - - # 清理生成的测试文件 - LOG_INFO "清理生成的测试文件" - rm -f test.tex testjob.dvi testjob.log testjob.aux - - # 如果之前未安装,则卸载texlive-ptex包 - if [ "$INSTALLED" == "false" ]; then - LOG_INFO "卸载texlive-ptex包" - dnf remove -y texlive-ptex - CHECK_RESULT $? 0 0 "卸载texlive-ptex失败" - fi - - LOG_INFO "测试完成" -} - -main "$@" \ No newline at end of file diff --git a/testcases/function_test/pkg_test/texlive-base/texlive-ptex/test_texlive-ptex_eptex_-kanji-internal_sjis.sh b/testcases/function_test/pkg_test/texlive-base/texlive-ptex/test_texlive-ptex_eptex_-kanji-internal_sjis.sh deleted file mode 100644 index 7963db5d4f1..00000000000 --- a/testcases/function_test/pkg_test/texlive-base/texlive-ptex/test_texlive-ptex_eptex_-kanji-internal_sjis.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-08 -# @License : Mulan PSL v2 -# @Desc : 测试 eptex 命令设置日语内部编码为 SJIS -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - # 检查是否已安装texlive-ptex-eptex-kanji-internal-sjis软件包 - LOG_INFO "检查是否已安装texlive-ptex-eptex-kanji-internal-sjis软件包" - rpm -q texlive-ptex-eptex-kanji-internal-sjis > /dev/null 2>&1 - if [ $? -eq 0 ]; then - LOG_INFO "软件包已安装,脚本结束后将保持安装状态" - INSTALLED=1 - else - LOG_INFO "软件包未安装,将在测试过程中安装并在结束前卸载" - INSTALLED=0 - fi - - # 检查yum源中是否有该软件包 - LOG_INFO "检查yum源中是否有texlive-ptex-eptex-kanji-internal-sjis软件包" - dnf list available texlive-ptex-eptex-kanji-internal-sjis > /dev/null 2>&1 - if [ $? -ne 0 ]; then - LOG_ERROR "yum源中未找到texlive-ptex-eptex-kanji-internal-sjis软件包" - exit 255 - fi - - # 如果未安装,则安装软件包 - if [ $INSTALLED -eq 0 ]; then - LOG_INFO "安装texlive-ptex-eptex-kanji-internal-sjis软件包" - dnf install -y texlive-ptex-eptex-kanji-internal-sjis > /dev/null 2>&1 - CHECK_RESULT $? 0 0 "安装texlive-ptex-eptex-kanji-internal-sjis软件包失败" - fi - - # 测试eptex命令设置日语内部编码为SJIS - LOG_INFO "测试eptex命令设置日语内部编码为SJIS" - eptex --kanji-internal=sjis --version > /dev/null 2>&1 - CHECK_RESULT $? 0 0 "eptex命令不支持--kanji-internal=sjis参数" - - # 清理环境 - LOG_INFO "清理测试环境" - if [ $INSTALLED -eq 0 ]; then - LOG_INFO "卸载texlive-ptex-eptex-kanji-internal-sjis软件包" - dnf remove -y texlive-ptex-eptex-kanji-internal-sjis > /dev/null 2>&1 - CHECK_RESULT $? 0 0 "卸载texlive-ptex-eptex-kanji-internal-sjis软件包失败" - fi - - LOG_INFO "测试完成" -} - -main "$@" \ No newline at end of file diff --git a/testcases/function_test/pkg_test/texlive-base/texlive-ptex/test_texlive-ptex_eptex_-kanji_utf8.sh b/testcases/function_test/pkg_test/texlive-base/texlive-ptex/test_texlive-ptex_eptex_-kanji_utf8.sh deleted file mode 100644 index 10f3bf4c057..00000000000 --- a/testcases/function_test/pkg_test/texlive-base/texlive-ptex/test_texlive-ptex_eptex_-kanji_utf8.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-08 -# @License : Mulan PSL v2 -# @Desc : 测试 eptex 命令设置日语编码为 UTF-8 -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - # 检查是否已安装texlive-ptex-eptex-kanji-utf8软件包 - LOG_INFO "检查是否已安装texlive-ptex-eptex-kanji-utf8软件包" - if dnf list installed texlive-ptex-eptex-kanji-utf8 &>/dev/null; then - LOG_INFO "软件包已安装,测试完成后将保持安装状态" - INSTALLED=true - else - LOG_INFO "软件包未安装,将进行安装测试" - INSTALLED=false - fi - - # 检查yum源中是否有texlive-ptex-eptex-kanji-utf8软件包 - LOG_INFO "检查yum源中是否有texlive-ptex-eptex-kanji-utf8软件包" - if ! dnf list available texlive-ptex-eptex-kanji-utf8 &>/dev/null; then - LOG_ERROR "yum源中未找到texlive-ptex-eptex-kanji-utf8软件包" - exit 255 - fi - - # 如果未安装,则安装软件包 - if [ "$INSTALLED" = false ]; then - LOG_INFO "安装texlive-ptex-eptex-kanji-utf8软件包" - dnf install -y texlive-ptex-eptex-kanji-utf8 - CHECK_RESULT $? 0 0 "安装texlive-ptex-eptex-kanji-utf8软件包失败" - fi - - # 检查eptex命令是否可用 - LOG_INFO "检查eptex命令是否可用" - if ! command -v eptex &>/dev/null; then - LOG_ERROR "eptex命令不存在" - exit 255 - fi - - # 测试eptex命令设置日语编码为UTF-8 - LOG_INFO "测试eptex命令设置日语编码为UTF-8" - # 创建一个简单的测试文件 - cat > test_japanese.tex << "EOF" - \documentclass{jsarticle} - \begin{document} - 日本語テスト - \end{document} - EOF - - # 使用eptex编译测试文件,设置编码为UTF-8 - eptex -kanji=utf8 test_japanese.tex - CHECK_RESULT $? 0 0 "eptex命令设置日语编码为UTF-8执行失败" - - # 检查生成的DVI文件 - LOG_INFO "检查生成的DVI文件" - if [ -f test_japanese.dvi ]; then - LOG_INFO "成功生成DVI文件" - else - LOG_ERROR "未生成DVI文件" - exit 1 - fi - - # 清理测试文件 - LOG_INFO "清理测试文件" - rm -f test_japanese.tex test_japanese.dvi test_japanese.log test_japanese.aux - - # 如果测试前未安装,则卸载软件包 - if [ "$INSTALLED" = false ]; then - LOG_INFO "卸载texlive-ptex-eptex-kanji-utf8软件包" - dnf remove -y texlive-ptex-eptex-kanji-utf8 - CHECK_RESULT $? 0 0 "卸载texlive-ptex-eptex-kanji-utf8软件包失败" - fi - - LOG_INFO "测试完成" -} - -main "$@" \ No newline at end of file diff --git a/testcases/function_test/pkg_test/texlive-base/texlive-ptex/test_texlive-ptex_eptex_-kpathsea-debug_1.sh b/testcases/function_test/pkg_test/texlive-base/texlive-ptex/test_texlive-ptex_eptex_-kpathsea-debug_1.sh deleted file mode 100644 index ad24442a972..00000000000 --- a/testcases/function_test/pkg_test/texlive-base/texlive-ptex/test_texlive-ptex_eptex_-kpathsea-debug_1.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-08 -# @License : Mulan PSL v2 -# @Desc : 测试 eptex 命令设置路径搜索调试标志为 1 -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - # 环境检查:检查是否已经安装texlive-ptex-eptex-kpathsea-debug软件包 - LOG_INFO "检查是否已安装texlive-ptex-eptex-kpathsea-debug软件包" - rpm -q texlive-ptex-eptex-kpathsea-debug - if [ $? -eq 0 ]; then - LOG_INFO "软件包已安装,测试结束后保持安装状态" - INSTALLED=1 - else - LOG_INFO "软件包未安装,将在测试过程中安装" - INSTALLED=0 - fi - - # 检查yum源中是否存在该软件包 - LOG_INFO "检查yum源中是否存在texlive-ptex-eptex-kpathsea-debug软件包" - dnf list available texlive-ptex-eptex-kpathsea-debug > /dev/null 2>&1 - CHECK_RESULT $? 0 0 "yum源中不存在texlive-ptex-eptex-kpathsea-debug软件包" - if [ $? -ne 0 ]; then - LOG_ERROR "yum源中不存在texlive-ptex-eptex-kpathsea-debug软件包" - exit 255 - fi - - # 如果未安装,则安装软件包 - if [ $INSTALLED -eq 0 ]; then - LOG_INFO "开始安装texlive-ptex-eptex-kpathsea-debug软件包" - dnf install -y texlive-ptex-eptex-kpathsea-debug - CHECK_RESULT $? 0 0 "安装texlive-ptex-eptex-kpathsea-debug软件包失败" - fi - - # 测试eptex命令设置路径搜索调试标志为1 - LOG_INFO "测试eptex命令设置路径搜索调试标志为1" - eptex --kpathsea-debug=1 --version > /dev/null 2>&1 - CHECK_RESULT $? 0 0 "eptex命令不支持--kpathsea-debug参数" - if [ $? -ne 0 ]; then - LOG_ERROR "eptex命令不支持--kpathsea-debug参数" - exit 255 - fi - - # 执行eptex命令并检查路径搜索调试标志设置 - LOG_INFO "执行eptex命令并检查路径搜索调试标志设置" - eptex --kpathsea-debug=1 --version 2>&1 | grep -q "kpathsea debugging" - CHECK_RESULT $? 0 0 "eptex命令未正确设置路径搜索调试标志为1" - - # 清理环境:如果测试前未安装,则卸载软件包 - if [ $INSTALLED -eq 0 ]; then - LOG_INFO "清理环境:卸载texlive-ptex-eptex-kpathsea-debug软件包" - dnf remove -y texlive-ptex-eptex-kpathsea-debug - CHECK_RESULT $? 0 0 "卸载texlive-ptex-eptex-kpathsea-debug软件包失败" - fi - - LOG_INFO "测试完成" -} - -main "$@" \ No newline at end of file diff --git a/testcases/function_test/pkg_test/texlive-base/texlive-ptex/test_texlive-ptex_eptex_-mktex_tex.sh b/testcases/function_test/pkg_test/texlive-base/texlive-ptex/test_texlive-ptex_eptex_-mktex_tex.sh deleted file mode 100644 index b268ce3c5db..00000000000 --- a/testcases/function_test/pkg_test/texlive-base/texlive-ptex/test_texlive-ptex_eptex_-mktex_tex.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-08 -# @License : Mulan PSL v2 -# @Desc : 测试 eptex 命令启用 mktextex 生成 -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - # 检查是否已安装texlive-ptex-eptex软件包 - LOG_INFO "检查是否已安装texlive-ptex-eptex软件包" - rpm -q texlive-ptex-eptex - if [ $? -eq 0 ]; then - LOG_INFO "texlive-ptex-eptex已安装,标记为已安装状态" - INSTALLED=true - else - LOG_INFO "texlive-ptex-eptex未安装,标记为未安装状态" - INSTALLED=false - fi - - # 检查yum源中是否有texlive-ptex-eptex软件包 - LOG_INFO "检查yum源中是否有texlive-ptex-eptex软件包" - dnf list available texlive-ptex-eptex - if [ $? -ne 0 ]; then - LOG_ERROR "yum源中未找到texlive-ptex-eptex软件包" - exit 255 - fi - - # 如果未安装,则安装软件包 - if [ "$INSTALLED" = "false" ]; then - LOG_INFO "开始安装texlive-ptex-eptex软件包" - dnf install -y texlive-ptex-eptex - CHECK_RESULT $? 0 0 "安装texlive-ptex-eptex失败" - LOG_INFO "texlive-ptex-eptex软件包安装成功" - fi - - # 测试eptex命令是否支持--mktextex参数 - LOG_INFO "测试eptex命令是否支持--mktextex参数" - eptex --help | grep -- "--mktextex" - CHECK_RESULT $? 0 0 "eptex命令不支持--mktextex参数" - - # 测试eptex命令启用mktextex生成 - LOG_INFO "测试eptex命令启用mktextex生成" - eptex --mktextex test.tex - CHECK_RESULT $? 0 0 "eptex命令启用mktextex生成失败" - - # 清理测试文件 - LOG_INFO "清理测试文件" - rm -f test.tex test.log test.aux - - # 如果脚本开始时未安装,则卸载软件包 - if [ "$INSTALLED" = "false" ]; then - LOG_INFO "卸载texlive-ptex-eptex软件包" - dnf remove -y texlive-ptex-eptex - CHECK_RESULT $? 0 0 "卸载texlive-ptex-eptex失败" - LOG_INFO "texlive-ptex-eptex软件包卸载成功" - fi - - LOG_INFO "测试完成" -} - -main "$@" \ No newline at end of file diff --git a/testcases/function_test/pkg_test/texlive-base/texlive-ptex/test_texlive-ptex_eptex_-mltex.sh b/testcases/function_test/pkg_test/texlive-base/texlive-ptex/test_texlive-ptex_eptex_-mltex.sh deleted file mode 100644 index a4d59fc73ca..00000000000 --- a/testcases/function_test/pkg_test/texlive-base/texlive-ptex/test_texlive-ptex_eptex_-mltex.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-08 -# @License : Mulan PSL v2 -# @Desc : 测试 eptex 命令启用 MLTeX 扩展 -# ############################################ - -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="texlive-ptex" - TEST_COMMAND="eptex" - TEST_PARAM="--mltex" - - # 步骤1: 检查是否已安装指定软件包 - LOG_INFO "步骤1: 检查是否已安装 $PACKAGE_NAME" - if rpm -q $PACKAGE_NAME &> /dev/null; then - LOG_INFO "$PACKAGE_NAME 已安装,脚本结束后将保持安装状态" - ALREADY_INSTALLED=1 - else - LOG_INFO "$PACKAGE_NAME 未安装,将在测试后卸载" - ALREADY_INSTALLED=0 - fi - - # 步骤2: 检查yum源中是否有该软件包 - LOG_INFO "步骤2: 检查yum源中是否有 $PACKAGE_NAME" - if ! dnf list available $PACKAGE_NAME &> /dev/null; then - LOG_ERROR "yum源中未找到 $PACKAGE_NAME" - exit 255 - fi - - # 步骤3: 如果未安装,则安装软件包 - if [ $ALREADY_INSTALLED -eq 0 ]; then - LOG_INFO "步骤3: 安装 $PACKAGE_NAME" - dnf install -y $PACKAGE_NAME - CHECK_RESULT $? 0 0 "安装 $PACKAGE_NAME 失败" - fi - - # 步骤4: 检查测试命令是否存在 - LOG_INFO "步骤4: 检查 $TEST_COMMAND 命令是否存在" - if ! command -v $TEST_COMMAND &> /dev/null; then - LOG_ERROR "$TEST_COMMAND 命令不存在" - exit 255 - fi - - # 步骤5: 检查测试参数是否支持 - LOG_INFO "步骤5: 检查 $TEST_COMMAND 是否支持参数 $TEST_PARAM" - if ! $TEST_COMMAND --help 2>&1 | grep -q "$TEST_PARAM"; then - LOG_ERROR "$TEST_COMMAND 不支持参数 $TEST_PARAM" - exit 255 - fi - - # 步骤6: 执行测试命令 - LOG_INFO "步骤6: 执行 $TEST_COMMAND $TEST_PARAM 测试" - $TEST_COMMAND $TEST_PARAM --version - CHECK_RESULT $? 0 0 "执行 $TEST_COMMAND $TEST_PARAM 失败" - - # 步骤7: 环境清理 - LOG_INFO "步骤7: 环境清理" - 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-ptex/test_texlive-ptex_eptex_-no-file-line-error.sh b/testcases/function_test/pkg_test/texlive-base/texlive-ptex/test_texlive-ptex_eptex_-no-file-line-error.sh deleted file mode 100644 index b74fed10fa5..00000000000 --- a/testcases/function_test/pkg_test/texlive-base/texlive-ptex/test_texlive-ptex_eptex_-no-file-line-error.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-08 -# @License : Mulan PSL v2 -# @Desc : 测试 eptex 命令禁用文件:行:错误样式消息 -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - # 定义测试软件包名称 - TEST_PACKAGE="texlive-ptex" - - # 步骤1: 检查yum源中是否存在测试软件包 - LOG_INFO "步骤1: 检查yum源中是否存在${TEST_PACKAGE}软件包" - dnf list available ${TEST_PACKAGE} &>/dev/null - if [ $? -ne 0 ]; then - LOG_ERROR "yum源中不存在${TEST_PACKAGE}软件包" - exit 255 - fi - - # 步骤2: 检查系统是否已安装测试软件包 - LOG_INFO "步骤2: 检查系统是否已安装${TEST_PACKAGE}软件包" - INSTALLED=0 - rpm -q ${TEST_PACKAGE} &>/dev/null - if [ $? -eq 0 ]; then - LOG_INFO "${TEST_PACKAGE}软件包已安装" - INSTALLED=1 - else - LOG_INFO "${TEST_PACKAGE}软件包未安装" - fi - - # 步骤3: 如果未安装则安装软件包 - if [ ${INSTALLED} -eq 0 ]; then - LOG_INFO "步骤3: 安装${TEST_PACKAGE}软件包" - dnf install -y ${TEST_PACKAGE} - CHECK_RESULT $? 0 0 "安装${TEST_PACKAGE}失败" - fi - - # 步骤4: 检查eptex命令是否存在 - LOG_INFO "步骤4: 检查eptex命令是否存在" - which eptex &>/dev/null - CHECK_RESULT $? 0 0 "eptex命令不存在" - - # 步骤5: 检查eptex命令是否支持--no-file-line-error参数 - LOG_INFO "步骤5: 检查eptex命令是否支持--no-file-line-error参数" - eptex --help 2>&1 | grep -q "no-file-line-error" - if [ $? -ne 0 ]; then - LOG_ERROR "eptex命令不支持--no-file-line-error参数" - exit 255 - fi - - # 步骤6: 创建测试TeX文件 - LOG_INFO "步骤6: 创建测试TeX文件" - TEST_TEX_FILE="test_eptex.tex" - cat > ${TEST_TEX_FILE} << "EOF" - \documentclass{article} - \begin{document} - 这是一个测试文档 - \undefinedcommand % 这是一个未定义的命令,会触发错误 - \end{document} - EOF - CHECK_RESULT $? 0 0 "创建测试TeX文件失败" - - # 步骤7: 测试eptex命令禁用文件:行:错误样式消息 - LOG_INFO "步骤7: 测试eptex命令禁用文件:行:错误样式消息" - # 使用--no-file-line-error参数运行eptex - eptex --no-file-line-error ${TEST_TEX_FILE} 2>&1 | tee eptex_output.txt - EPTEX_EXIT_CODE=$? - - # 步骤8: 验证输出中不包含"文件:行:错误"格式的错误消息 - LOG_INFO "步骤8: 验证输出中不包含文件:行:错误格式的错误消息" - if grep -q "\.tex:[0-9]*:" eptex_output.txt; then - LOG_ERROR "输出中包含文件:行:错误格式的错误消息" - CHECK_RESULT 1 0 0 "禁用文件:行:错误样式消息功能未生效" - else - LOG_INFO "成功禁用文件:行:错误样式消息" - CHECK_RESULT ${EPTEX_EXIT_CODE} 1 0 "eptex命令执行状态检查" # eptex应该因为未定义命令而失败 - fi - - # 步骤9: 清理测试文件 - LOG_INFO "步骤9: 清理测试文件" - rm -f ${TEST_TEX_FILE} eptex_output.txt *.log *.aux *.dvi - CHECK_RESULT $? 0 0 "清理测试文件失败" - - # 步骤10: 如果测试前未安装,则卸载软件包 - if [ ${INSTALLED} -eq 0 ]; then - LOG_INFO "步骤10: 卸载${TEST_PACKAGE}软件包" - dnf remove -y ${TEST_PACKAGE} - CHECK_RESULT $? 0 0 "卸载${TEST_PACKAGE}失败" - fi - - LOG_INFO "测试完成" -} - -main "$@" \ No newline at end of file diff --git a/testcases/function_test/pkg_test/texlive-base/texlive-ptex/test_texlive-ptex_eptex_-no-mktex_tex.sh b/testcases/function_test/pkg_test/texlive-base/texlive-ptex/test_texlive-ptex_eptex_-no-mktex_tex.sh deleted file mode 100644 index c69f499df53..00000000000 --- a/testcases/function_test/pkg_test/texlive-base/texlive-ptex/test_texlive-ptex_eptex_-no-mktex_tex.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-08 -# @License : Mulan PSL v2 -# @Desc : 测试 eptex 命令禁用 mktextex 生成 -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - # 环境检查与初始化 - LOG_INFO "检查是否已安装texlive-ptex-eptex软件包" - rpm -q texlive-ptex-eptex > /dev/null 2>&1 - if [ $? -eq 0 ]; then - LOG_INFO "texlive-ptex-eptex已安装,标记为已存在" - PACKAGE_INSTALLED=true - else - LOG_INFO "texlive-ptex-eptex未安装,标记为未存在" - PACKAGE_INSTALLED=false - fi - - # 检查yum源中是否存在软件包 - LOG_INFO "检查yum源中是否存在texlive-ptex-eptex软件包" - dnf list available texlive-ptex-eptex > /dev/null 2>&1 - CHECK_RESULT $? 0 0 "yum源中未找到texlive-ptex-eptex软件包" - if [ $? -ne 0 ]; then - LOG_ERROR "yum源中不存在texlive-ptex-eptex软件包" - exit 255 - fi - - # 如果未安装,则安装软件包 - if [ "$PACKAGE_INSTALLED" = false ]; then - LOG_INFO "开始安装texlive-ptex-eptex软件包" - dnf install -y texlive-ptex-eptex - CHECK_RESULT $? 0 0 "安装texlive-ptex-eptex失败" - LOG_INFO "texlive-ptex-eptex安装成功" - fi - - # 检查eptex命令是否存在 - LOG_INFO "检查eptex命令是否存在" - which eptex > /dev/null 2>&1 - CHECK_RESULT $? 0 0 "eptex命令不存在" - if [ $? -ne 0 ]; then - LOG_ERROR "eptex命令不存在" - exit 255 - fi - - # 检查eptex命令是否支持--no-mktex参数 - LOG_INFO "检查eptex命令是否支持--no-mktex参数" - eptex --help 2>&1 | grep -q -- "--no-mktex" - CHECK_RESULT $? 0 0 "eptex命令不支持--no-mktex参数" - if [ $? -ne 0 ]; then - LOG_ERROR "eptex命令不支持--no-mktex参数" - exit 255 - fi - - # 测试eptex命令禁用mktextex生成 - LOG_INFO "测试eptex命令禁用mktextex生成" - cat > test_eptex.tex << "EOF" - \documentclass{article} - \begin{document} - Test document for eptex --no-mktex. - \end{document} - EOF - eptex --no-mktex test_eptex.tex > eptex_output.log 2>&1 - CHECK_RESULT $? 0 0 "eptex --no-mktex执行失败" - LOG_INFO "eptex --no-mktex命令执行成功" - - # 检查输出日志,确认mktextex未生成 - LOG_INFO "检查输出日志,确认mktextex未生成" - if grep -q "mktex" eptex_output.log; then - LOG_ERROR "eptex --no-mktex仍然触发了mktextex生成" - exit 1 - else - LOG_INFO "eptex --no-mktex成功禁用了mktextex生成" - fi - - # 清理测试文件 - LOG_INFO "清理测试文件" - rm -f test_eptex.tex eptex_output.log test_eptex.log test_eptex.aux test_eptex.dvi - - # 如果测试前未安装,则卸载软件包 - if [ "$PACKAGE_INSTALLED" = false ]; then - LOG_INFO "卸载texlive-ptex-eptex软件包" - dnf remove -y texlive-ptex-eptex - CHECK_RESULT $? 0 0 "卸载texlive-ptex-eptex失败" - LOG_INFO "texlive-ptex-eptex卸载成功" - else - LOG_INFO "测试前已安装texlive-ptex-eptex,保持安装状态" - fi - - LOG_INFO "测试完成" -} - -main "$@" \ No newline at end of file diff --git a/testcases/function_test/pkg_test/texlive-base/texlive-ptex/test_texlive-ptex_eptex_-no-parse-first-line.sh b/testcases/function_test/pkg_test/texlive-base/texlive-ptex/test_texlive-ptex_eptex_-no-parse-first-line.sh deleted file mode 100644 index 5a4d1608f1c..00000000000 --- a/testcases/function_test/pkg_test/texlive-base/texlive-ptex/test_texlive-ptex_eptex_-no-parse-first-line.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-08 -# @License : Mulan PSL v2 -# @Desc : 测试 eptex 命令禁用输入文件第一行的解析 -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - # 检查是否已经安装texlive-ptex和texlive-eptex - LOG_INFO "检查是否已经安装texlive-ptex和texlive-eptex" - if rpm -q texlive-ptex texlive-eptex &> /dev/null; then - LOG_INFO "texlive-ptex和texlive-eptex已经安装,测试后将保持安装状态" - already_installed=true - else - LOG_INFO "texlive-ptex和texlive-eptex未安装,将在测试过程中安装" - already_installed=false - fi - - # 检查yum源中是否有texlive-ptex和texlive-eptex软件包 - LOG_INFO "检查yum源中是否有texlive-ptex和texlive-eptex软件包" - if ! dnf list available texlive-ptex texlive-eptex &> /dev/null; then - LOG_ERROR "yum源中没有texlive-ptex或texlive-eptex软件包" - exit 255 - fi - - # 如果未安装,则安装软件包 - if [ "$already_installed" = false ]; then - LOG_INFO "安装texlive-ptex和texlive-eptex软件包" - dnf install -y texlive-ptex texlive-eptex - CHECK_RESULT $? 0 0 "安装texlive-ptex和texlive-eptex失败" - fi - - # 创建测试用的TeX文件,第一行包含特殊指令 - LOG_INFO "创建测试用的TeX文件" - cat > test.tex << "EOF" - %&latex - \documentclass{article} - \begin{document} - Hello, eptex! - \end{document} - EOF - - # 使用eptex命令处理TeX文件,并禁用第一行解析 - LOG_INFO "使用eptex命令处理TeX文件,禁用第一行解析" - eptex -no-parse-first-line test.tex - CHECK_RESULT $? 0 0 "eptex命令执行失败,可能不支持-no-parse-first-line参数" - - # 检查生成的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 - - # 如果测试前未安装,则卸载软件包 - if [ "$already_installed" = false ]; then - LOG_INFO "卸载texlive-ptex和texlive-eptex软件包" - dnf remove -y texlive-ptex texlive-eptex - CHECK_RESULT $? 0 0 "卸载texlive-ptex和texlive-eptex失败" - fi - - LOG_INFO "测试完成,环境已恢复" -} - -main "$@" \ No newline at end of file diff --git a/testcases/function_test/pkg_test/texlive-base/texlive-ptex/test_texlive-ptex_eptex_-no-shell-escape.sh b/testcases/function_test/pkg_test/texlive-base/texlive-ptex/test_texlive-ptex_eptex_-no-shell-escape.sh deleted file mode 100644 index c2a178121d7..00000000000 --- a/testcases/function_test/pkg_test/texlive-base/texlive-ptex/test_texlive-ptex_eptex_-no-shell-escape.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-08 -# @License : Mulan PSL v2 -# @Desc : 测试 eptex 命令禁用 \write18{SHELL COMMAND} -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - LOG_INFO "开始测试 eptex 命令禁用 \\write18{SHELL COMMAND}" - - # 检查软件包是否在 yum 源中 - LOG_INFO "检查 texlive-ptex-eptex 软件包是否在 yum 源中" - dnf list texlive-ptex-eptex > /dev/null 2>&1 - if [ $? -ne 0 ]; then - LOG_ERROR "yum 源中未找到 texlive-ptex-eptex 软件包" - exit 255 - fi - - # 检查是否已安装 - LOG_INFO "检查 texlive-ptex-eptex 是否已安装" - rpm -q texlive-ptex-eptex > /dev/null 2>&1 - if [ $? -eq 0 ]; then - LOG_INFO "texlive-ptex-eptex 已安装,测试结束后将保持安装状态" - INSTALLED=1 - else - LOG_INFO "texlive-ptex-eptex 未安装,将在测试前安装,测试后卸载" - INSTALLED=0 - fi - - # 如果未安装,则安装软件包 - if [ $INSTALLED -eq 0 ]; then - LOG_INFO "安装 texlive-ptex-eptex 软件包" - dnf install -y texlive-ptex-eptex - CHECK_RESULT $? 0 0 "安装 texlive-ptex-eptex 失败" - fi - - # 检查 eptex 命令是否支持 -no-shell-escape 参数 - LOG_INFO "检查 eptex 命令是否支持 -no-shell-escape 参数" - eptex -help 2>&1 | grep -q "no-shell-escape" - if [ $? -ne 0 ]; then - LOG_ERROR "eptex 命令不支持 -no-shell-escape 参数" - if [ $INSTALLED -eq 0 ]; then - LOG_INFO "卸载 texlive-ptex-eptex 软件包" - dnf remove -y texlive-ptex-eptex - fi - exit 255 - fi - - # 创建测试用的 TeX 文件,尝试使用 \write18{SHELL COMMAND} - LOG_INFO "创建测试 TeX 文件,尝试使用 \\write18{SHELL COMMAND}" - cat > test_eptex.tex << "EOF" - \documentclass{article} - \begin{document} - \write18{echo "This should not be executed"} - Hello, eptex! - \end{document} - EOF - - # 使用 -no-shell-escape 参数运行 eptex,期望命令执行失败 - LOG_INFO "使用 -no-shell-escape 参数运行 eptex,期望禁用 \\write18" - eptex -no-shell-escape test_eptex.tex > eptex_output.log 2>&1 - # 检查 eptex 命令是否执行失败(因为 \write18 被禁用) - if [ $? -eq 0 ]; then - LOG_ERROR "eptex 命令在禁用 \\write18 的情况下执行成功,不符合预期" - CHECK_RESULT 1 0 0 "eptex 命令在禁用 \\write18 的情况下执行成功" - else - LOG_INFO "eptex 命令在禁用 \\write18 的情况下执行失败,符合预期" - CHECK_RESULT $? 1 0 "eptex 命令在禁用 \\write18 的情况下执行失败" - fi - - # 清理测试文件 - LOG_INFO "清理测试文件" - rm -f test_eptex.tex eptex_output.log test_eptex.log test_eptex.aux - - # 如果测试前未安装,则卸载软件包 - if [ $INSTALLED -eq 0 ]; then - LOG_INFO "卸载 texlive-ptex-eptex 软件包" - dnf remove -y texlive-ptex-eptex - CHECK_RESULT $? 0 0 "卸载 texlive-ptex-eptex 失败" - fi - - LOG_INFO "测试 eptex 命令禁用 \\write18{SHELL COMMAND} 完成" -} - -main "$@" \ No newline at end of file diff --git a/testcases/function_test/pkg_test/texlive-base/texlive-ptex/test_texlive-ptex_eptex_-output-comment_custom.sh b/testcases/function_test/pkg_test/texlive-base/texlive-ptex/test_texlive-ptex_eptex_-output-comment_custom.sh deleted file mode 100644 index c9af4dfc289..00000000000 --- a/testcases/function_test/pkg_test/texlive-base/texlive-ptex/test_texlive-ptex_eptex_-output-comment_custom.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-08 -# @License : Mulan PSL v2 -# @Desc : 测试 eptex 命令设置自定义的 DVI 文件注释 -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - # 定义软件包名称 - PACKAGE_NAME="texlive-ptex" - - # 步骤1: 检查软件包是否在yum源中 - LOG_INFO "检查yum源中是否存在软件包 $PACKAGE_NAME" - dnf list available $PACKAGE_NAME &>/dev/null - if [ $? -ne 0 ]; then - LOG_ERROR "软件包 $PACKAGE_NAME 不在yum源中" - exit 255 - fi - - # 步骤2: 检查环境是否已安装软件包 - LOG_INFO "检查环境是否已安装软件包 $PACKAGE_NAME" - rpm -q $PACKAGE_NAME &>/dev/null - if [ $? -eq 0 ]; then - LOG_INFO "软件包 $PACKAGE_NAME 已安装,脚本结束后将保持安装状态" - INSTALLED_BEFORE=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: 检查 eptex 命令是否存在 - LOG_INFO "检查 eptex 命令是否存在" - which eptex &>/dev/null - CHECK_RESULT $? 0 0 "eptex 命令不存在" - - # 步骤5: 测试 eptex 命令设置自定义的 DVI 文件注释 - LOG_INFO "测试 eptex 命令设置自定义的 DVI 文件注释" - # 创建一个简单的 TeX 文件 - cat > test_comment.tex << "EOF" - \documentclass{article} - \begin{document} - Hello, eptex! - \end{document} - EOF - - # 使用 eptex 命令生成 DVI 文件,并设置自定义注释 - eptex -output-comment="Custom DVI Comment" test_comment.tex - CHECK_RESULT $? 0 0 "eptex 命令执行失败" - - # 步骤6: 验证生成的 DVI 文件是否包含自定义注释 - LOG_INFO "验证生成的 DVI 文件是否包含自定义注释" - if [ -f test_comment.dvi ]; then - # 使用 dvitype 命令检查 DVI 文件注释(假设 dvitype 可用) - which dvitype &>/dev/null - if [ $? -eq 0 ]; then - dvitype -show-comments test_comment.dvi | grep -q "Custom DVI Comment" - CHECK_RESULT $? 0 0 "DVI 文件未包含预期的自定义注释" - LOG_INFO "DVI 文件包含预期的自定义注释" - else - LOG_INFO "dvitype 命令不可用,跳过注释验证" - fi - else - LOG_ERROR "未生成 test_comment.dvi 文件" - exit 1 - fi - - # 步骤7: 清理测试文件 - LOG_INFO "清理测试文件" - rm -f test_comment.tex test_comment.dvi test_comment.log test_comment.aux - - # 步骤8: 卸载软件包(如果之前未安装) - 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-ptex/test_texlive-ptex_eptex_-output-directory_tmp.sh b/testcases/function_test/pkg_test/texlive-base/texlive-ptex/test_texlive-ptex_eptex_-output-directory_tmp.sh deleted file mode 100644 index b0ef03e7b68..00000000000 --- a/testcases/function_test/pkg_test/texlive-base/texlive-ptex/test_texlive-ptex_eptex_-output-directory_tmp.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-08 -# @License : Mulan PSL v2 -# @Desc : 测试 eptex 命令设置输出目录为 /tmp -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - LOG_INFO "开始测试 eptex 命令设置输出目录为 /tmp" - LOG_INFO "步骤1:检查环境中是否已安装 texlive-ptex 软件包" - rpm -q texlive-ptex - if [ $? -eq 0 ]; then - LOG_INFO "环境中已安装 texlive-ptex 软件包" - INSTALLED="true" - else - LOG_INFO "环境中未安装 texlive-ptex 软件包" - INSTALLED="false" - fi - LOG_INFO "步骤2:检查 yum 源中是否有 texlive-ptex 软件包" - dnf list available texlive-ptex - if [ $? -ne 0 ]; then - LOG_ERROR "yum 源中没有 texlive-ptex 软件包" - exit 255 - fi - if [ "$INSTALLED" = "false" ]; then - LOG_INFO "步骤3:安装 texlive-ptex 软件包" - dnf install -y texlive-ptex - CHECK_RESULT $? 0 0 "安装 texlive-ptex 软件包失败" - fi - LOG_INFO "步骤4:检查 eptex 命令是否支持 -output-directory 参数" - eptex --help | grep -q -- "-output-directory" - if [ $? -ne 0 ]; then - LOG_ERROR "eptex 命令不支持 -output-directory 参数" - if [ "$INSTALLED" = "false" ]; then - LOG_INFO "清理环境:卸载 texlive-ptex 软件包" - dnf remove -y texlive-ptex - fi - exit 255 - fi - LOG_INFO "步骤5:创建测试用的简单 TeX 文件" - cat > test.tex << "EOF" - \documentclass{article} - \begin{document} - Hello, world! - \end{document} - EOF - CHECK_RESULT $? 0 0 "创建测试文件失败" - LOG_INFO "步骤6:使用 eptex 命令设置输出目录为 /tmp 进行编译" - eptex -output-directory /tmp test.tex - CHECK_RESULT $? 0 0 "eptex 命令执行失败" - LOG_INFO "步骤7:检查 /tmp 目录下是否生成了预期的输出文件" - ls /tmp/test.dvi - CHECK_RESULT $? 0 0 "未在 /tmp 目录下找到预期的输出文件 test.dvi" - LOG_INFO "步骤8:清理测试过程中产生的文件" - rm -f test.tex - rm -f /tmp/test.* - if [ "$INSTALLED" = "false" ]; then - LOG_INFO "步骤9:清理环境:卸载 texlive-ptex 软件包" - dnf remove -y texlive-ptex - CHECK_RESULT $? 0 0 "卸载 texlive-ptex 软件包失败" - fi - LOG_INFO "测试完成" -} - -main "$@" \ No newline at end of file diff --git a/testcases/function_test/pkg_test/texlive-base/texlive-ptex/test_texlive-ptex_eptex_-parse-first-line.sh b/testcases/function_test/pkg_test/texlive-base/texlive-ptex/test_texlive-ptex_eptex_-parse-first-line.sh deleted file mode 100644 index 72503410f4d..00000000000 --- a/testcases/function_test/pkg_test/texlive-base/texlive-ptex/test_texlive-ptex_eptex_-parse-first-line.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-08 -# @License : Mulan PSL v2 -# @Desc : 测试 eptex 命令启用输入文件第一行的解析 -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - # 测试 eptex 命令启用输入文件第一行的解析 - - LOG_INFO "步骤1:检查yum源中是否存在texlive-ptex和texlive-eptex软件包" - dnf list available texlive-ptex texlive-eptex > /dev/null 2>&1 - if [ $? -ne 0 ]; then - LOG_ERROR "yum源中不存在texlive-ptex或texlive-eptex软件包" - exit 255 - fi - - LOG_INFO "步骤2:检查是否已安装texlive-ptex和texlive-eptex" - rpm -q texlive-ptex texlive-eptex > /dev/null 2>&1 - if [ $? -eq 0 ]; then - LOG_INFO "软件包已安装,标记为保持安装状态" - INSTALLED=true - else - LOG_INFO "软件包未安装,标记为需要清理安装" - INSTALLED=false - fi - - if [ "$INSTALLED" = "false" ]; then - LOG_INFO "步骤3:安装texlive-ptex和texlive-eptex软件包" - dnf install -y texlive-ptex texlive-eptex - CHECK_RESULT $? 0 0 "安装texlive-ptex和texlive-eptex失败" - fi - - LOG_INFO "步骤4:检查eptex命令是否支持-parsed-first-line参数" - eptex --help | grep -q "parsed-first-line" - if [ $? -ne 0 ]; then - LOG_ERROR "eptex命令不支持-parsed-first-line参数" - exit 255 - fi - - LOG_INFO "步骤5:创建测试输入文件" - cat > test_input.tex << "EOF" - %&platex - \documentclass{article} - \begin{document} - Hello, eptex! - \end{document} - EOF - CHECK_RESULT $? 0 0 "创建测试输入文件失败" - - LOG_INFO "步骤6:使用eptex命令启用输入文件第一行的解析" - eptex -parse-first-line test_input.tex > output.log 2>&1 - CHECK_RESULT $? 0 0 "eptex命令执行失败" - - LOG_INFO "步骤7:检查输出文件是否生成" - ls test_input.dvi > /dev/null 2>&1 - CHECK_RESULT $? 0 0 "未生成dvi输出文件" - - LOG_INFO "步骤8:清理测试文件" - rm -f test_input.tex test_input.dvi test_input.log output.log - CHECK_RESULT $? 0 0 "清理测试文件失败" - - if [ "$INSTALLED" = "false" ]; then - LOG_INFO "步骤9:卸载测试安装的软件包" - dnf remove -y texlive-ptex texlive-eptex - CHECK_RESULT $? 0 0 "卸载texlive-ptex和texlive-eptex失败" - 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-ptex/test_texlive-ptex_eptex_-progname_myeptex.sh b/testcases/function_test/pkg_test/texlive-base/texlive-ptex/test_texlive-ptex_eptex_-progname_myeptex.sh deleted file mode 100644 index d35e92de43f..00000000000 --- a/testcases/function_test/pkg_test/texlive-base/texlive-ptex/test_texlive-ptex_eptex_-progname_myeptex.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-08 -# @License : Mulan PSL v2 -# @Desc : 测试 eptex 命令设置程序(和 fmt)名称为 myeptex -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - LOG_INFO "开始测试 eptex 命令设置程序(和 fmt)名称为 myeptex" - - # 定义软件包名称 - PACKAGE_NAME="texlive-ptex" - - # 检查软件包是否已在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" - 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" - CHECK_RESULT $? 0 0 "安装软件包失败" - fi - - # 测试 eptex 命令设置程序名称为 myeptex - LOG_INFO "测试 eptex 命令设置程序名称为 myeptex" - eptex --progname=myeptex --version - CHECK_RESULT $? 0 0 "eptex 命令设置程序名称为 myeptex 失败" - - # 清理环境:如果测试前未安装,则卸载软件包 - if [ $ALREADY_INSTALLED -eq 0 ]; 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-ptex/test_texlive-ptex_eptex_-recorder.sh b/testcases/function_test/pkg_test/texlive-base/texlive-ptex/test_texlive-ptex_eptex_-recorder.sh deleted file mode 100644 index 1220efafa6d..00000000000 --- a/testcases/function_test/pkg_test/texlive-base/texlive-ptex/test_texlive-ptex_eptex_-recorder.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-08 -# @License : Mulan PSL v2 -# @Desc : 测试 eptex 命令启用文件名记录器 -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - LOG_INFO "开始测试 eptex 命令启用文件名记录器功能" - LOG_INFO "步骤1:检查环境是否已安装texlive-ptex-eptex软件包" - rpm -q texlive-ptex-eptex > /dev/null 2>&1 - if [ $? -eq 0 ]; then - LOG_INFO "环境已安装texlive-ptex-eptex软件包,测试结束将保持安装状态" - already_installed=true - else - LOG_INFO "环境未安装texlive-ptex-eptex软件包" - already_installed=false - fi - - LOG_INFO "步骤2:检查yum源中是否存在texlive-ptex-eptex软件包" - dnf list available texlive-ptex-eptex > /dev/null 2>&1 - if [ $? -ne 0 ]; then - LOG_ERROR "yum源中未找到texlive-ptex-eptex软件包" - exit 255 - fi - - if [ "$already_installed" = false ]; then - LOG_INFO "步骤3:安装texlive-ptex-eptex软件包" - dnf install -y texlive-ptex-eptex > /dev/null 2>&1 - CHECK_RESULT $? 0 0 "安装texlive-ptex-eptex软件包失败" - fi - - LOG_INFO "步骤4:检查eptex命令是否支持--recorder参数" - eptex --help 2>&1 | grep -q "\-\-recorder" - CHECK_RESULT $? 0 0 "eptex命令不支持--recorder参数" - if [ $? -ne 0 ]; then - LOG_ERROR "eptex命令不支持--recorder参数" - exit 255 - fi - - LOG_INFO "步骤5:创建测试用TeX文件" - cat > test_recorder.tex << "EOF" - \documentclass{article} - \begin{document} - Hello, eptex with recorder! - \end{document} - EOF - CHECK_RESULT $? 0 0 "创建测试TeX文件失败" - - LOG_INFO "步骤6:使用eptex命令处理TeX文件,并启用文件名记录器" - eptex --recorder test_recorder.tex > eptex_output.log 2>&1 - CHECK_RESULT $? 0 0 "eptex命令执行失败,未能成功处理TeX文件" - - LOG_INFO "步骤7:检查是否生成.fls记录文件" - if [ -f "test_recorder.fls" ]; then - LOG_INFO "成功生成.fls记录文件:test_recorder.fls" - LOG_INFO "检查.fls文件内容是否包含输入输出文件记录" - grep -q "INPUT\|OUTPUT" test_recorder.fls - CHECK_RESULT $? 0 0 ".fls记录文件内容异常,未包含预期的文件记录" - else - LOG_ERROR "未生成预期的.fls记录文件" - CHECK_RESULT 1 0 1 "未生成.fls记录文件" - fi - - LOG_INFO "步骤8:清理测试生成的文件" - rm -f test_recorder.tex test_recorder.fls test_recorder.log eptex_output.log test_recorder.aux test_recorder.dvi > /dev/null 2>&1 - - if [ "$already_installed" = false ]; then - LOG_INFO "步骤9:卸载测试安装的texlive-ptex-eptex软件包" - dnf remove -y texlive-ptex-eptex > /dev/null 2>&1 - CHECK_RESULT $? 0 0 "卸载texlive-ptex-eptex软件包失败" - fi - - LOG_INFO "eptex命令启用文件名记录器功能测试完成" -} - -main "$@" \ No newline at end of file diff --git a/testcases/function_test/pkg_test/texlive-base/texlive-ptex/test_texlive-ptex_eptex_-shell-escape.sh b/testcases/function_test/pkg_test/texlive-base/texlive-ptex/test_texlive-ptex_eptex_-shell-escape.sh deleted file mode 100644 index d638ac9a360..00000000000 --- a/testcases/function_test/pkg_test/texlive-base/texlive-ptex/test_texlive-ptex_eptex_-shell-escape.sh +++ /dev/null @@ -1,146 +0,0 @@ -#!/usr/bin/bash - -# Copyright (c) 2024 ISCAS .ALL rights reserved. -# This program is licensed under Mulan PSL v2. -# You can use it according to the terms and conditions of the Mulan PSL v2. -# http://license.coscl.org.cn/MulanPSL2 -# THIS PROGRAM IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, -# EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, -# MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. -# See the Mulan PSL v2 for more details. - -# ############################################# -# @Author : honghua -# @Contact : honghua@iscas.ac.cn -# @Date : 2026-03-08 -# @License : Mulan PSL v2 -# @Desc : 测试 eptex 命令启用 \write18{SHELL COMMAND} -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - # 定义日志函数(实际环境中可能已定义,此处仅为确保脚本可运行) - LOG_INFO() { echo "[INFO] $*"; } - LOG_ERROR() { echo "[ERROR] $*"; } - - # 定义检查结果函数(实际环境中可能已定义) - CHECK_RESULT() { - local actual=$1 - local expect=$2 - local mode=$3 - local message=$4 - if [ $mode -eq 0 ]; then - if [ $actual -eq $expect ]; then - LOG_INFO "$message: 成功" - else - LOG_ERROR "$message: 失败, 实际退出码: $actual, 期望退出码: $expect" - exit 255 - fi - fi - } - - # 定义SSH_CMD函数(实际环境中可能已定义) - SSH_CMD() { - local cmd=$1 - local ip=$2 - local password=$3 - local user=$4 - # 此处仅为占位,实际环境中应使用sshpass或密钥进行远程执行 - echo "SSH_CMD placeholder: $cmd on $ip as $user" - } - - # 测试脚本开始 - LOG_INFO "开始测试 eptex 命令启用 \\write18{SHELL COMMAND}" - - # 检查yum源中是否存在texlive-ptex-eptex包 - LOG_INFO "检查yum源中是否存在texlive-ptex-eptex包" - dnf list available texlive-ptex-eptex > /dev/null 2>&1 - if [ $? -ne 0 ]; then - LOG_ERROR "yum源中未找到texlive-ptex-eptex包" - exit 255 - fi - LOG_INFO "yum源中存在texlive-ptex-eptex包" - - # 检查是否已安装texlive-ptex-eptex - LOG_INFO "检查是否已安装texlive-ptex-eptex" - rpm -q texlive-ptex-eptex > /dev/null 2>&1 - installed=$? - if [ $installed -eq 0 ]; then - LOG_INFO "texlive-ptex-eptex已安装,测试结束后将保持安装状态" - else - LOG_INFO "texlive-ptex-eptex未安装,将进行安装" - fi - - # 如果未安装,则安装 - if [ $installed -ne 0 ]; then - LOG_INFO "安装texlive-ptex-eptex" - dnf install -y texlive-ptex-eptex - CHECK_RESULT $? 0 0 "安装texlive-ptex-eptex" - fi - - # 检查eptex命令是否支持-shell-escape参数 - LOG_INFO "检查eptex命令是否支持-shell-escape参数" - eptex --help | grep -q "\-shell-escape" - if [ $? -ne 0 ]; then - LOG_ERROR "eptex命令不支持-shell-escape参数" - # 如果之前未安装,则卸载 - if [ $installed -ne 0 ]; then - LOG_INFO "卸载texlive-ptex-eptex" - dnf remove -y texlive-ptex-eptex - fi - exit 255 - fi - LOG_INFO "eptex命令支持-shell-escape参数" - - # 测试eptex启用\write18{SHELL COMMAND} - LOG_INFO "测试eptex启用\\write18{SHELL COMMAND}" - cat > test_write18.tex << "EOF" - \documentclass{article} - \begin{document} - \write18{echo "test write18" > test_output.txt} - \end{document} - EOF - eptex -shell-escape test_write18.tex - CHECK_RESULT $? 0 0 "执行eptex -shell-escape test_write18.tex" - - # 检查是否成功执行了shell命令 - LOG_INFO "检查是否成功执行了shell命令" - if [ -f test_output.txt ]; then - content=$(cat test_output.txt) - if [ "$content" = "test write18" ]; then - LOG_INFO "shell命令成功执行,输出内容正确" - else - LOG_ERROR "shell命令执行输出内容不正确" - rm -f test_write18.tex test_output.txt - if [ $installed -ne 0 ]; then - LOG_INFO "卸载texlive-ptex-eptex" - dnf remove -y texlive-ptex-eptex - fi - exit 1 - fi - else - LOG_ERROR "shell命令未成功执行,未生成输出文件" - rm -f test_write18.tex - if [ $installed -ne 0 ]; then - LOG_INFO "卸载texlive-ptex-eptex" - dnf remove -y texlive-ptex-eptex - fi - exit 1 - fi - - # 清理测试文件 - LOG_INFO "清理测试文件" - rm -f test_write18.tex test_output.txt - - # 如果测试开始时未安装,则卸载软件包 - if [ $installed -ne 0 ]; then - LOG_INFO "卸载texlive-ptex-eptex" - dnf remove -y texlive-ptex-eptex - CHECK_RESULT $? 0 0 "卸载texlive-ptex-eptex" - fi - - LOG_INFO "测试 eptex 命令启用 \\write18{SHELL COMMAND} 完成" -} - -main "$@" \ No newline at end of file diff --git a/testcases/function_test/pkg_test/texlive-base/texlive-ptex/test_texlive-ptex_eptex_-shell-restricted.sh b/testcases/function_test/pkg_test/texlive-base/texlive-ptex/test_texlive-ptex_eptex_-shell-restricted.sh deleted file mode 100644 index 64005a7ca5c..00000000000 --- a/testcases/function_test/pkg_test/texlive-base/texlive-ptex/test_texlive-ptex_eptex_-shell-restricted.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-08 -# @License : Mulan PSL v2 -# @Desc : 测试 eptex 命令启用受限的 \write18 -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - LOG_INFO "开始测试 eptex 命令启用受限的 \\write18" - - # 检查是否已安装 texlive-ptex 包 - LOG_INFO "检查 texlive-ptex 包是否已安装" - rpm -q texlive-ptex > /dev/null 2>&1 - if [ $? -eq 0 ]; then - LOG_INFO "texlive-ptex 已安装,脚本结束后将保持安装状态" - INSTALLED=1 - else - LOG_INFO "texlive-ptex 未安装,将在测试过程中安装" - INSTALLED=0 - fi - - # 检查 yum 源中是否有 texlive-ptex 包 - LOG_INFO "检查 yum 源中是否有 texlive-ptex 包" - dnf list available texlive-ptex > /dev/null 2>&1 - if [ $? -ne 0 ]; then - LOG_ERROR "yum 源中未找到 texlive-ptex 包" - exit 255 - fi - - # 如果未安装,则安装 texlive-ptex - if [ $INSTALLED -eq 0 ]; then - LOG_INFO "安装 texlive-ptex 包" - dnf install -y texlive-ptex - CHECK_RESULT $? 0 0 "安装 texlive-ptex 失败" - fi - - # 检查 eptex 命令是否存在 - LOG_INFO "检查 eptex 命令是否存在" - command -v eptex > /dev/null 2>&1 - if [ $? -ne 0 ]; then - LOG_ERROR "eptex 命令未找到" - exit 255 - fi - - # 测试 eptex 命令的 --shell-restricted 参数 - LOG_INFO "测试 eptex 命令的 --shell-restricted 参数" - eptex --help | grep -q -- "--shell-restricted" - if [ $? -ne 0 ]; then - LOG_ERROR "eptex 命令不支持 --shell-restricted 参数" - exit 255 - fi - - # 创建一个简单的 TeX 文件来测试受限的 \write18 - LOG_INFO "创建测试 TeX 文件" - cat > test_write18.tex << "EOF" - \documentclass{article} - \begin{document} - \write18{echo "test"} - \end{document} - EOF - - # 使用 --shell-restricted 参数运行 eptex - LOG_INFO "使用 --shell-restricted 参数运行 eptex" - eptex --shell-restricted test_write18.tex - CHECK_RESULT $? 0 0 "eptex --shell-restricted 执行失败" - - # 清理测试文件 - LOG_INFO "清理测试文件" - rm -f test_write18.tex test_write18.log test_write18.aux - - # 如果之前未安装,则卸载 texlive-ptex - if [ $INSTALLED -eq 0 ]; then - LOG_INFO "卸载 texlive-ptex 包" - dnf remove -y texlive-ptex - CHECK_RESULT $? 0 0 "卸载 texlive-ptex 失败" - fi - - LOG_INFO "测试完成" -} - -main "$@" \ No newline at end of file diff --git a/testcases/function_test/pkg_test/texlive-base/texlive-ptex/test_texlive-ptex_eptex_-src-specials.sh b/testcases/function_test/pkg_test/texlive-base/texlive-ptex/test_texlive-ptex_eptex_-src-specials.sh deleted file mode 100644 index 46f9f20d1a3..00000000000 --- a/testcases/function_test/pkg_test/texlive-base/texlive-ptex/test_texlive-ptex_eptex_-src-specials.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-08 -# @License : Mulan PSL v2 -# @Desc : 测试 eptex 命令在 DVI 文件中插入源特殊字符 -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - # 判断是否已安装texlive-ptex和texlive-eptex - LOG_INFO "检查是否已安装texlive-ptex和texlive-eptex软件包" - rpm -q texlive-ptex texlive-eptex > /dev/null 2>&1 - INSTALLED=$? - - # 如果未安装,则安装软件包 - if [ $INSTALLED -ne 0 ]; then - LOG_INFO "软件包未安装,开始安装" - # 检查yum源中是否有软件包 - LOG_INFO "检查yum源中是否有texlive-ptex和texlive-eptex软件包" - dnf list available texlive-ptex texlive-eptex > /dev/null 2>&1 - CHECK_RESULT $? 0 0 "yum源中缺少texlive-ptex或texlive-eptex软件包" - if [ $? -ne 0 ]; then - LOG_ERROR "yum源中缺少texlive-ptex或texlive-eptex软件包" - exit 255 - fi - - # 安装软件包 - LOG_INFO "开始安装texlive-ptex和texlive-eptex" - dnf install -y texlive-ptex texlive-eptex - CHECK_RESULT $? 0 0 "安装texlive-ptex和texlive-eptex失败" - fi - - # 创建测试目录 - LOG_INFO "创建测试目录" - TEST_DIR="/tmp/test_eptex_src_specials" - mkdir -p $TEST_DIR - cd $TEST_DIR - - # 创建测试TeX文件 - LOG_INFO "创建测试TeX文件" - cat > test_src_specials.tex << "EOF" - \documentclass{article} - \usepackage{ptex} - \begin{document} - This is a test for eptex src-specials. - \end{document} - EOF - - # 使用eptex编译TeX文件,启用src-specials选项 - LOG_INFO "使用eptex编译TeX文件,启用src-specials选项" - eptex -src-specials test_src_specials.tex - CHECK_RESULT $? 0 0 "eptex编译失败" - - # 检查是否生成了DVI文件 - LOG_INFO "检查是否生成了DVI文件" - if [ -f "test_src_specials.dvi" ]; then - LOG_INFO "成功生成DVI文件" - - # 检查DVI文件中是否包含src-specials特殊字符 - LOG_INFO "检查DVI文件中是否包含src-specials特殊字符" - dvitype test_src_specials.dvi | grep -i "src" > /dev/null 2>&1 - CHECK_RESULT $? 0 0 "DVI文件中未找到src-specials特殊字符" - else - LOG_ERROR "未生成DVI文件" - CHECK_RESULT 1 0 0 "DVI文件生成失败" - fi - - # 清理测试文件 - LOG_INFO "清理测试文件" - cd / - rm -rf $TEST_DIR - - # 如果之前未安装软件包,则卸载 - if [ $INSTALLED -ne 0 ]; then - LOG_INFO "卸载测试安装的软件包" - dnf remove -y texlive-ptex texlive-eptex - CHECK_RESULT $? 0 0 "卸载texlive-ptex和texlive-eptex失败" - fi - - LOG_INFO "测试完成" -} - -main "$@" \ No newline at end of file diff --git a/testcases/function_test/pkg_test/texlive-base/texlive-ptex/test_texlive-ptex_eptex_-src-specials_cr_hbox.sh b/testcases/function_test/pkg_test/texlive-base/texlive-ptex/test_texlive-ptex_eptex_-src-specials_cr_hbox.sh deleted file mode 100644 index 73d849f95c0..00000000000 --- a/testcases/function_test/pkg_test/texlive-base/texlive-ptex/test_texlive-ptex_eptex_-src-specials_cr_hbox.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-08 -# @License : Mulan PSL v2 -# @Desc : 测试 eptex 命令在 DVI 文件的特定位置(cr 和 hbox)插入源特殊字符 -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - # 检查是否已经安装 eptex 和 texlive-ptex 软件包 - LOG_INFO "检查环境是否已安装 eptex 和 texlive-ptex 软件包" - if dnf list installed eptex texlive-ptex > /dev/null 2>&1; then - LOG_INFO "环境已安装 eptex 和 texlive-ptex 软件包,脚本结束时将保持安装状态" - ENV_INSTALLED="true" - else - LOG_INFO "环境未安装 eptex 和 texlive-ptex 软件包,将在测试步骤中安装" - ENV_INSTALLED="false" - fi - - # 检查 yum 源中是否有 eptex 和 texlive-ptex 软件包 - LOG_INFO "检查 yum 源中是否有 eptex 软件包" - if ! dnf list available eptex > /dev/null 2>&1; then - LOG_ERROR "yum 源中未找到 eptex 软件包" - exit 255 - fi - LOG_INFO "检查 yum 源中是否有 texlive-ptex 软件包" - if ! dnf list available texlive-ptex > /dev/null 2>&1; then - LOG_ERROR "yum 源中未找到 texlive-ptex 软件包" - exit 255 - fi - - # 如果环境未安装,则安装软件包 - if [ "$ENV_INSTALLED" = "false" ]; then - LOG_INFO "安装 eptex 和 texlive-ptex 软件包" - dnf install -y eptex texlive-ptex - CHECK_RESULT $? 0 0 "安装 eptex 和 texlive-ptex 软件包失败" - fi - - # 创建测试用的 LaTeX 源文件 - LOG_INFO "创建测试用的 LaTeX 源文件 test_cr_hbox.tex" - cat > test_cr_hbox.tex << "EOF" - \documentclass{article} - \begin{document} - Hello, World! - \special{src: 1 0} % 源特殊字符 - \cr % 测试 cr 命令 - \hbox{Test} % 测试 hbox 命令 - \end{document} - EOF - CHECK_RESULT $? 0 0 "创建 LaTeX 源文件失败" - - # 使用 eptex 编译 LaTeX 文件生成 DVI 文件 - LOG_INFO "使用 eptex 编译 LaTeX 文件生成 DVI 文件" - eptex -src-specials test_cr_hbox.tex - CHECK_RESULT $? 0 0 "eptex 编译失败" - - # 检查生成的 DVI 文件是否存在 - LOG_INFO "检查生成的 DVI 文件是否存在" - if [ -f "test_cr_hbox.dvi" ]; then - LOG_INFO "DVI 文件生成成功" - else - LOG_ERROR "DVI 文件未生成" - exit 1 - fi - - # 使用 dvitype 检查 DVI 文件中的源特殊字符 - LOG_INFO "使用 dvitype 检查 DVI 文件中的源特殊字符" - dvitype test_cr_hbox.dvi | grep -q "src:" - CHECK_RESULT $? 0 0 "DVI 文件中未找到源特殊字符" - - # 清理测试文件 - LOG_INFO "清理测试文件" - rm -f test_cr_hbox.tex test_cr_hbox.dvi test_cr_hbox.log test_cr_hbox.aux - CHECK_RESULT $? 0 0 "清理测试文件失败" - - # 如果环境原本未安装,则卸载软件包 - if [ "$ENV_INSTALLED" = "false" ]; then - LOG_INFO "卸载 eptex 和 texlive-ptex 软件包" - dnf remove -y eptex texlive-ptex - CHECK_RESULT $? 0 0 "卸载 eptex 和 texlive-ptex 软件包失败" - fi - - LOG_INFO "测试完成" -} - -main "$@" \ No newline at end of file diff --git a/testcases/function_test/pkg_test/texlive-base/texlive-ptex/test_texlive-ptex_eptex_-synctex_1.sh b/testcases/function_test/pkg_test/texlive-base/texlive-ptex/test_texlive-ptex_eptex_-synctex_1.sh deleted file mode 100644 index 423f1be9a25..00000000000 --- a/testcases/function_test/pkg_test/texlive-base/texlive-ptex/test_texlive-ptex_eptex_-synctex_1.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-08 -# @License : Mulan PSL v2 -# @Desc : 测试 eptex 命令根据位 1 生成 SyncTeX 数据 -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - # 判断是否已安装texlive-ptex-eptex-synctex包 - LOG_INFO "检查是否已安装texlive-ptex-eptex-synctex包" - rpm -q texlive-ptex-eptex-synctex > /dev/null 2>&1 - if [ $? -eq 0 ]; then - LOG_INFO "texlive-ptex-eptex-synctex包已安装,脚本结束后将保持安装状态" - installed_before=true - else - LOG_INFO "texlive-ptex-eptex-synctex包未安装,将在测试中安装并在结束后卸载" - installed_before=false - fi - - # 检查yum源中是否存在texlive-ptex-eptex-synctex包 - LOG_INFO "检查yum源中是否存在texlive-ptex-eptex-synctex包" - dnf list available texlive-ptex-eptex-synctex > /dev/null 2>&1 - if [ $? -ne 0 ]; then - LOG_ERROR "yum源中不存在texlive-ptex-eptex-synctex包" - exit 255 - fi - - # 如果未安装,则安装texlive-ptex-eptex-synctex包 - if [ "$installed_before" = false ]; then - LOG_INFO "安装texlive-ptex-eptex-synctex包" - dnf install -y texlive-ptex-eptex-synctex - CHECK_RESULT $? 0 0 "安装texlive-ptex-eptex-synctex包失败" - fi - - # 创建测试用的简单TeX文件 - LOG_INFO "创建测试用的简单TeX文件" - cat > test.tex << "EOF" - \documentclass{article} - \begin{document} - Hello, eptex! - \end{document} - EOF - CHECK_RESULT $? 0 0 "创建测试TeX文件失败" - - # 测试eptex命令根据位1生成SyncTeX数据 - LOG_INFO "测试eptex命令根据位1生成SyncTeX数据" - eptex -synctex=1 test.tex - CHECK_RESULT $? 0 0 "eptex命令执行失败" - - # 检查是否生成了SyncTeX文件 - LOG_INFO "检查是否生成了SyncTeX文件" - if [ -f test.synctex.gz ]; then - LOG_INFO "成功生成了SyncTeX文件test.synctex.gz" - else - LOG_ERROR "未生成SyncTeX文件test.synctex.gz" - exit 1 - fi - - # 清理生成的测试文件 - LOG_INFO "清理生成的测试文件" - rm -f test.tex test.log test.synctex.gz - CHECK_RESULT $? 0 0 "清理测试文件失败" - - # 如果之前未安装,则卸载texlive-ptex-eptex-synctex包 - if [ "$installed_before" = false ]; then - LOG_INFO "卸载texlive-ptex-eptex-synctex包" - dnf remove -y texlive-ptex-eptex-synctex - CHECK_RESULT $? 0 0 "卸载texlive-ptex-eptex-synctex包失败" - fi - - LOG_INFO "测试完成" -} - -main "$@" \ No newline at end of file diff --git a/testcases/function_test/pkg_test/texlive-base/texlive-ptex/test_texlive-ptex_eptex_-version.sh b/testcases/function_test/pkg_test/texlive-base/texlive-ptex/test_texlive-ptex_eptex_-version.sh deleted file mode 100644 index 132ffeab82b..00000000000 --- a/testcases/function_test/pkg_test/texlive-base/texlive-ptex/test_texlive-ptex_eptex_-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-08 -# @License : Mulan PSL v2 -# @Desc : 测试 eptex 命令的版本信息显示 -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - LOG_INFO "开始测试 eptex 命令的版本信息显示" - - # 检查是否已安装 texlive-ptex-eptex - LOG_INFO "检查是否已安装 texlive-ptex-eptex 软件包" - if rpm -q texlive-ptex-eptex > /dev/null 2>&1; then - LOG_INFO "texlive-ptex-eptex 已安装" - INSTALLED=1 - else - LOG_INFO "texlive-ptex-eptex 未安装" - INSTALLED=0 - fi - - # 检查 yum 源中是否有该软件包 - LOG_INFO "检查 yum 源中是否有 texlive-ptex-eptex 软件包" - if ! dnf list available texlive-ptex-eptex > /dev/null 2>&1; then - LOG_ERROR "yum 源中未找到 texlive-ptex-eptex 软件包" - exit 255 - fi - - # 如果未安装,则安装软件包 - if [ $INSTALLED -eq 0 ]; then - LOG_INFO "安装 texlive-ptex-eptex 软件包" - dnf install -y texlive-ptex-eptex - CHECK_RESULT $? 0 0 "安装 texlive-ptex-eptex 失败" - fi - - # 检查 eptex 命令是否存在 - LOG_INFO "检查 eptex 命令是否存在" - if ! command -v eptex > /dev/null 2>&1; then - LOG_ERROR "eptex 命令不存在" - exit 255 - fi - - # 检查 eptex 命令是否支持 --version 参数 - LOG_INFO "检查 eptex 命令是否支持 --version 参数" - if ! eptex --version > /dev/null 2>&1; then - LOG_ERROR "eptex 命令不支持 --version 参数" - exit 255 - fi - - # 执行 eptex --version 命令 - LOG_INFO "执行 eptex --version 命令" - eptex --version - CHECK_RESULT $? 0 0 "执行 eptex --version 命令失败" - - # 清理环境 - if [ $INSTALLED -eq 0 ]; then - LOG_INFO "卸载 texlive-ptex-eptex 软件包" - dnf remove -y texlive-ptex-eptex - CHECK_RESULT $? 0 0 "卸载 texlive-ptex-eptex 失败" - else - LOG_INFO "保持 texlive-ptex-eptex 安装状态" - fi - - LOG_INFO "测试 eptex 命令的版本信息显示完成" -} - -main "$@" \ No newline at end of file diff --git a/testcases/function_test/pkg_test/texlive-base/texlive-ptex/test_texlive-ptex_function_basic.sh b/testcases/function_test/pkg_test/texlive-base/texlive-ptex/test_texlive-ptex_function_basic.sh deleted file mode 100644 index 0d43a7c1837..00000000000 --- a/testcases/function_test/pkg_test/texlive-base/texlive-ptex/test_texlive-ptex_function_basic.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-08 -# @License : Mulan PSL v2 -# @Desc : Test basic pTeX document compilation -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - # 环境检查:检查是否已安装texlive-ptex - LOG_INFO "检查是否已安装texlive-ptex" - if dnf list installed texlive-ptex &> /dev/null; then - LOG_INFO "texlive-ptex已安装,脚本结束后将保持安装状态" - INSTALLED_BEFORE=true - else - LOG_INFO "texlive-ptex未安装,将在测试步骤中安装" - INSTALLED_BEFORE=false - fi - - # 检查yum源中是否有texlive-ptex软件包 - LOG_INFO "检查yum源中是否有texlive-ptex软件包" - if ! dnf list available texlive-ptex &> /dev/null; then - LOG_ERROR "yum源中未找到texlive-ptex软件包" - exit 255 - fi - - # 如果未安装,则安装texlive-ptex - if [ "$INSTALLED_BEFORE" = false ]; then - LOG_INFO "安装texlive-ptex" - dnf install -y texlive-ptex - CHECK_RESULT $? 0 0 "安装texlive-ptex失败" - fi - - # 检查ptex命令是否可用 - LOG_INFO "检查ptex命令是否可用" - if ! command -v ptex &> /dev/null; then - LOG_ERROR "ptex命令未找到" - exit 255 - fi - - # 检查ptex命令支持的参数 - LOG_INFO "检查ptex命令是否支持-help参数" - ptex --help &> /dev/null - CHECK_RESULT $? 0 0 "ptex命令不支持--help参数" - - # 创建测试用的基本ptex文档 - LOG_INFO "创建测试用的基本ptex文档" - TEST_DIR="/tmp/test_ptex_$(date +%s)" - mkdir -p "$TEST_DIR" - cd "$TEST_DIR" || exit 1 - - cat > test.tex << "EOF" - \documentclass{jsarticle} - \begin{document} - Hello, pTeX! - \end{document} - EOF - - # 使用ptex编译文档 - LOG_INFO "使用ptex编译测试文档" - ptex test.tex - CHECK_RESULT $? 0 0 "ptex编译文档失败" - - # 检查是否生成了DVI文件 - LOG_INFO "检查是否生成了DVI文件" - if [ -f test.dvi ]; then - LOG_INFO "成功生成test.dvi文件" - else - LOG_ERROR "未生成test.dvi文件" - exit 1 - fi - - # 清理测试目录 - LOG_INFO "清理测试目录" - cd /tmp && rm -rf "$TEST_DIR" - - # 环境恢复:如果之前未安装,则卸载texlive-ptex - if [ "$INSTALLED_BEFORE" = false ]; then - LOG_INFO "卸载texlive-ptex" - dnf remove -y texlive-ptex - CHECK_RESULT $? 0 0 "卸载texlive-ptex失败" - fi - - LOG_INFO "测试完成" -} - -main "$@" \ No newline at end of file diff --git a/testcases/function_test/pkg_test/texlive-base/texlive-ptex/test_texlive-ptex_function_kanji_sjis.sh b/testcases/function_test/pkg_test/texlive-base/texlive-ptex/test_texlive-ptex_function_kanji_sjis.sh deleted file mode 100644 index 5a1c3c456dc..00000000000 --- a/testcases/function_test/pkg_test/texlive-base/texlive-ptex/test_texlive-ptex_function_kanji_sjis.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-08 -# @License : Mulan PSL v2 -# @Desc : Test Japanese Shift-JIS encoding support -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - LOG_INFO "测试开始:Test Japanese Shift-JIS encoding support" - - # 定义软件包名称 - PACKAGE_NAME="texlive-ptex" - - # 检查软件包是否已在yum源中 - LOG_INFO "检查软件包 $PACKAGE_NAME 是否在yum源中" - dnf list available $PACKAGE_NAME &> /dev/null - if [ $? -ne 0 ]; then - LOG_ERROR "软件包 $PACKAGE_NAME 不在yum源中" - exit 255 - fi - - # 检查软件包是否已安装 - LOG_INFO "检查软件包 $PACKAGE_NAME 是否已安装" - rpm -q $PACKAGE_NAME &> /dev/null - 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 - - # 测试Shift-JIS编码支持 - LOG_INFO "测试Shift-JIS编码支持" - echo "测试文本" | iconv -f UTF-8 -t SHIFT-JIS > test_sjis.txt - CHECK_RESULT $? 0 0 "创建Shift-JIS编码文件失败" - - # 检查文件编码 - LOG_INFO "检查文件编码是否为Shift-JIS" - file test_sjis.txt | grep -q "Shift-JIS" - CHECK_RESULT $? 0 0 "文件编码不是Shift-JIS" - - # 清理测试文件 - LOG_INFO "清理测试文件" - rm -f test_sjis.txt - CHECK_RESULT $? 0 0 "清理测试文件失败" - - # 如果之前未安装,则卸载软件包 - if [ "$INSTALLED" = "false" ]; then - LOG_INFO "卸载软件包 $PACKAGE_NAME" - dnf remove -y $PACKAGE_NAME - CHECK_RESULT $? 0 0 "卸载软件包 $PACKAGE_NAME 失败" - fi - - LOG_INFO "测试完成:Test Japanese Shift-JIS encoding support" -} - -main "$@" \ No newline at end of file diff --git a/testcases/function_test/pkg_test/texlive-base/texlive-ptex/test_texlive-ptex_function_kanji_utf8.sh b/testcases/function_test/pkg_test/texlive-base/texlive-ptex/test_texlive-ptex_function_kanji_utf8.sh deleted file mode 100644 index 63d81f65839..00000000000 --- a/testcases/function_test/pkg_test/texlive-base/texlive-ptex/test_texlive-ptex_function_kanji_utf8.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-08 -# @License : Mulan PSL v2 -# @Desc : Test Japanese UTF-8 encoding support -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - # 环境初始化 - LOG_INFO "开始测试:Test Japanese UTF-8 encoding support" - - # 定义软件包名称 - PACKAGE_NAME="texlive-ptex" - - # 检查软件包是否已在yum源中 - LOG_INFO "步骤1:检查软件包是否在yum源中" - dnf list available "${PACKAGE_NAME}" &>/dev/null - if [ $? -ne 0 ]; then - LOG_ERROR "软件包 ${PACKAGE_NAME} 不在yum源中" - exit 255 - fi - - # 检查系统是否已安装该软件包 - LOG_INFO "步骤2:检查系统是否已安装软件包" - if rpm -q "${PACKAGE_NAME}" &>/dev/null; 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 "步骤3:安装软件包 ${PACKAGE_NAME}" - dnf install -y "${PACKAGE_NAME}" - CHECK_RESULT $? 0 0 "安装软件包失败" - fi - - # 测试命令是否存在 - LOG_INFO "步骤4:检查ptex命令是否存在" - command -v ptex >/dev/null 2>&1 - CHECK_RESULT $? 0 0 "ptex命令不存在" - - # 测试UTF-8编码支持 - LOG_INFO "步骤5:测试日文UTF-8编码支持" - cat > test_utf8.tex << "EOF" - \documentclass{jsarticle} - \begin{document} - 日本語のUTF-8エンコーディングテスト。 - \end{document} - EOF - ptex -kanji=utf8 test_utf8.tex - CHECK_RESULT $? 0 0 "ptex处理UTF-8日文失败" - - # 检查生成的DVI文件 - LOG_INFO "步骤6:验证生成的DVI文件" - if [ -f test_utf8.dvi ]; then - LOG_INFO "DVI文件生成成功" - else - LOG_ERROR "DVI文件未生成" - exit 1 - fi - - # 清理测试文件 - LOG_INFO "步骤7:清理测试文件" - rm -f test_utf8.tex test_utf8.dvi test_utf8.log test_utf8.aux - - # 环境恢复:如果测试前未安装,则卸载软件包 - if [ ${ALREADY_INSTALLED} -eq 0 ]; then - LOG_INFO "步骤8:卸载软件包 ${PACKAGE_NAME}" - dnf remove -y "${PACKAGE_NAME}" - CHECK_RESULT $? 0 0 "卸载软件包失败" - else - LOG_INFO "步骤8:保持软件包 ${PACKAGE_NAME} 的安装状态" - fi - - LOG_INFO "测试完成:Test Japanese UTF-8 encoding support" -} - -main "$@" \ No newline at end of file diff --git a/testcases/function_test/pkg_test/texlive-base/texlive-ptex/test_texlive-ptex_function_mendex.sh b/testcases/function_test/pkg_test/texlive-base/texlive-ptex/test_texlive-ptex_function_mendex.sh deleted file mode 100644 index 445aee2ddd9..00000000000 --- a/testcases/function_test/pkg_test/texlive-base/texlive-ptex/test_texlive-ptex_function_mendex.sh +++ /dev/null @@ -1,134 +0,0 @@ -#!/usr/bin/bash - -# Copyright (c) 2024 ISCAS .ALL rights reserved. -# This program is licensed under Mulan PSL v2. -# You can use it according to the terms and conditions of the Mulan PSL v2. -# http://license.coscl.org.cn/MulanPSL2 -# THIS PROGRAM IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, -# EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, -# MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. -# See the Mulan PSL v2 for more details. - -# ############################################# -# @Author : honghua -# @Contact : honghua@iscas.ac.cn -# @Date : 2026-03-08 -# @License : Mulan PSL v2 -# @Desc : Test index generation with mendex -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - # 检查是否已安装texlive-ptex软件包 - LOG_INFO "检查是否已安装texlive-ptex软件包" - rpm -q texlive-ptex > /dev/null 2>&1 - installed=$? - - # 根据安装状态决定是否在脚本结束时卸载 - if [ $installed -eq 0 ]; then - LOG_INFO "texlive-ptex已安装,脚本结束后将保持安装状态" - need_uninstall=0 - else - LOG_INFO "texlive-ptex未安装,将在测试过程中安装" - need_uninstall=1 - fi - - # 检查yum源中是否有texlive-ptex软件包 - LOG_INFO "检查yum源中是否有texlive-ptex软件包" - dnf list available texlive-ptex > /dev/null 2>&1 - CHECK_RESULT $? 0 0 "yum源中未找到texlive-ptex软件包" - if [ $? -ne 0 ]; then - LOG_ERROR "yum源中未找到texlive-ptex软件包" - exit 255 - fi - - # 如果未安装,则安装软件包 - if [ $installed -ne 0 ]; then - LOG_INFO "安装texlive-ptex软件包" - dnf install -y texlive-ptex - CHECK_RESULT $? 0 0 "安装texlive-ptex失败" - fi - - # 检查mendex命令是否存在 - LOG_INFO "检查mendex命令是否存在" - which mendex > /dev/null 2>&1 - CHECK_RESULT $? 0 0 "mendex命令未找到" - - # 创建测试文件 - LOG_INFO "创建测试文件" - cat > test_index.tex << "EOF" - \documentclass{jsarticle} - \begin{document} - \section{テストセクション1} - テスト内容1 - \section{テストセクション2} - テスト内容2 - \end{document} - EOF - - # 编译测试文件生成.idx文件 - LOG_INFO "编译测试文件生成.idx文件" - ptex test_index.tex - CHECK_RESULT $? 0 0 "编译测试文件失败" - - # 检查.idx文件是否存在 - LOG_INFO "检查.idx文件是否存在" - [ -f test_index.idx ] - CHECK_RESULT $? 0 0 "未找到.idx文件" - - # 测试mendex基本功能 - LOG_INFO "测试mendex基本功能 - 生成索引" - mendex test_index.idx -o test_index.ind - CHECK_RESULT $? 0 0 "mendex生成索引失败" - - # 检查.ind文件是否生成 - LOG_INFO "检查.ind文件是否生成" - [ -f test_index.ind ] - CHECK_RESULT $? 0 0 "未找到.ind文件" - - # 测试mendex参数 -s (指定样式文件) - LOG_INFO "测试mendex参数 -s (指定样式文件)" - mendex test_index.idx -s test_style.ist -o test_index2.ind 2>/dev/null - # 检查参数是否支持,如果返回非0且不是文件不存在错误,则参数不支持 - if [ $? -ne 0 ]; then - # 检查是否是文件不存在错误 - if ! grep -q "No such file" test_index2.ind 2>/dev/null && [ ! -f test_style.ist ]; then - LOG_ERROR "mendex不支持-s参数或参数格式错误" - exit 255 - fi - fi - - # 测试mendex参数 -i (忽略大小写) - LOG_INFO "测试mendex参数 -i (忽略大小写)" - mendex test_index.idx -i -o test_index3.ind 2>/dev/null - if [ $? -ne 0 ]; then - LOG_ERROR "mendex不支持-i参数" - exit 255 - fi - - # 测试无效参数 - LOG_INFO "测试无效参数" - mendex --invalid-param 2>/dev/null - if [ $? -ne 125 ] && [ $? -ne 1 ]; then - LOG_ERROR "mendex未正确处理无效参数" - exit 255 - fi - - # 清理测试文件 - LOG_INFO "清理测试文件" - rm -f test_index.tex test_index.aux test_index.log test_index.idx test_index.ind test_index2.ind test_index3.ind test_style.ist - - # 根据安装状态决定是否卸载软件包 - if [ $need_uninstall -eq 1 ]; then - LOG_INFO "卸载texlive-ptex软件包" - dnf remove -y texlive-ptex - CHECK_RESULT $? 0 0 "卸载texlive-ptex失败" - else - LOG_INFO "保持texlive-ptex安装状态" - fi - - LOG_INFO "测试完成" -} - -main "$@" \ No newline at end of file diff --git a/testcases/function_test/pkg_test/texlive-base/texlive-ptex/test_texlive-ptex_function_output_dir.sh b/testcases/function_test/pkg_test/texlive-base/texlive-ptex/test_texlive-ptex_function_output_dir.sh deleted file mode 100644 index 1bd2cd1ba43..00000000000 --- a/testcases/function_test/pkg_test/texlive-base/texlive-ptex/test_texlive-ptex_function_output_dir.sh +++ /dev/null @@ -1,129 +0,0 @@ -#!/usr/bin/bash - -# Copyright (c) 2024 ISCAS .ALL rights reserved. -# This program is licensed under Mulan PSL v2. -# You can use it according to the terms and conditions of the Mulan PSL v2. -# http://license.coscl.org.cn/MulanPSL2 -# THIS PROGRAM IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, -# EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, -# MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. -# See the Mulan PSL v2 for more details. - -# ############################################# -# @Author : honghua -# @Contact : honghua@iscas.ac.cn -# @Date : 2026-03-08 -# @License : Mulan PSL v2 -# @Desc : Test setting output directory -# ############################################ - -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 - shift 2 - local message="$*" - if [ "$actual" -eq "$expected" ]; then - LOG_INFO "检查通过:$message" - else - LOG_ERROR "检查失败:$message" - exit 255 - fi - } - - # 定义SSH命令函数 - SSH_CMD() { - local cmd=$1 - local ip=$2 - local password=$3 - local user=$4 - sshpass -p "$password" ssh -o StrictHostKeyChecking=no "$user@$ip" "$cmd" - } - - # 测试脚本主体 - LOG_INFO "开始测试:设置输出目录" - - # 检查软件包是否在yum源中 - LOG_INFO "检查软件包texlive-ptex是否在yum源中" - dnf list available texlive-ptex > /dev/null 2>&1 - if [ $? -ne 0 ]; then - LOG_ERROR "软件包texlive-ptex不在yum源中" - exit 255 - fi - - # 检查环境是否已安装 - LOG_INFO "检查环境是否已安装texlive-ptex" - rpm -q texlive-ptex > /dev/null 2>&1 - if [ $? -eq 0 ]; then - LOG_INFO "环境已安装texlive-ptex,测试结束后保持安装状态" - already_installed=true - else - LOG_INFO "环境未安装texlive-ptex,将进行安装" - already_installed=false - fi - - # 如果未安装,则安装软件包 - if [ "$already_installed" = false ]; then - LOG_INFO "安装软件包texlive-ptex" - dnf install -y texlive-ptex - CHECK_RESULT $? 0 0 "安装texlive-ptex失败" - fi - - # 测试设置输出目录功能 - LOG_INFO "测试设置输出目录功能" - ptex --help | grep -q "output-directory" - CHECK_RESULT $? 0 0 "ptex命令不支持output-directory参数" - - # 创建测试目录 - LOG_INFO "创建测试目录" - mkdir -p /tmp/test_output - CHECK_RESULT $? 0 0 "创建测试目录失败" - - # 创建测试tex文件 - LOG_INFO "创建测试tex文件" - cat > /tmp/test.tex << EOF - \documentclass{article} - \begin{document} - Hello, World! - \end{document} - EOF - CHECK_RESULT $? 0 0 "创建测试tex文件失败" - - # 使用ptex命令设置输出目录 - LOG_INFO "使用ptex命令设置输出目录" - ptex -output-directory=/tmp/test_output /tmp/test.tex - CHECK_RESULT $? 0 0 "ptex命令执行失败" - - # 检查输出文件是否生成 - LOG_INFO "检查输出文件是否生成" - ls /tmp/test_output/test.dvi > /dev/null 2>&1 - CHECK_RESULT $? 0 0 "输出文件未生成" - - # 清理测试文件 - LOG_INFO "清理测试文件" - rm -rf /tmp/test.tex /tmp/test_output - CHECK_RESULT $? 0 0 "清理测试文件失败" - - # 如果测试前未安装,则卸载软件包 - if [ "$already_installed" = false ]; then - LOG_INFO "卸载软件包texlive-ptex" - dnf remove -y texlive-ptex - CHECK_RESULT $? 0 0 "卸载texlive-ptex失败" - fi - - LOG_INFO "测试完成:设置输出目录" -} - -main "$@" \ No newline at end of file diff --git a/testcases/function_test/pkg_test/texlive-base/texlive-ptex/test_texlive-ptex_function_pbibtex.sh b/testcases/function_test/pkg_test/texlive-base/texlive-ptex/test_texlive-ptex_function_pbibtex.sh deleted file mode 100644 index b96bd05821f..00000000000 --- a/testcases/function_test/pkg_test/texlive-base/texlive-ptex/test_texlive-ptex_function_pbibtex.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-08 -# @License : Mulan PSL v2 -# @Desc : Test bibliography processing with pBibTeX -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - set -e - - LOG_INFO "开始测试:Test bibliography processing with pBibTeX" - - LOG_INFO "步骤1: 检查yum源中是否存在texlive-ptex软件包" - if ! dnf list available texlive-ptex &> /dev/null; then - LOG_ERROR "yum源中未找到texlive-ptex软件包" - exit 255 - fi - - LOG_INFO "步骤2: 检查系统是否已安装texlive-ptex" - if rpm -q texlive-ptex &> /dev/null; then - LOG_INFO "texlive-ptex已安装,测试后将保持安装状态" - INSTALLED=true - else - LOG_INFO "texlive-ptex未安装,将在测试过程中安装" - INSTALLED=false - fi - - if [ "$INSTALLED" = "false" ]; then - LOG_INFO "步骤3: 安装texlive-ptex软件包" - dnf install -y texlive-ptex - CHECK_RESULT $? 0 0 "安装texlive-ptex失败" - fi - - LOG_INFO "步骤4: 检查pbibtex命令是否存在" - if ! command -v pbibtex &> /dev/null; then - LOG_ERROR "pbibtex命令不存在" - exit 255 - fi - - LOG_INFO "步骤5: 测试pbibtex命令的基本功能" - pbibtex --version - CHECK_RESULT $? 0 0 "pbibtex命令执行失败" - - LOG_INFO "步骤6: 创建一个简单的测试LaTeX文件" - cat > test_bib.tex << "EOF" - \documentclass{article} - \begin{document} - Test citation \cite{test2024}. - \bibliographystyle{plain} - \bibliography{test} - \end{document} - EOF - - cat > test.bib << "EOF" - @article{test2024, - author = {Test Author}, - title = {Test Title}, - journal = {Test Journal}, - year = {2024} - } - EOF - - LOG_INFO "步骤7: 使用pbibtex处理参考文献" - pdflatex -interaction=nonstopmode test_bib.tex - CHECK_RESULT $? 0 0 "pdflatex第一次运行失败" - - pbibtex test_bib - CHECK_RESULT $? 0 0 "pbibtex处理参考文献失败" - - pdflatex -interaction=nonstopmode test_bib.tex - CHECK_RESULT $? 0 0 "pdflatex第二次运行失败" - - pdflatex -interaction=nonstopmode test_bib.tex - CHECK_RESULT $? 0 0 "pdflatex第三次运行失败" - - LOG_INFO "步骤8: 检查生成的参考文献文件" - if [ -f test_bib.bbl ]; then - LOG_INFO "参考文献文件test_bib.bbl生成成功" - else - LOG_ERROR "参考文献文件test_bib.bbl未生成" - exit 1 - fi - - LOG_INFO "步骤9: 清理测试文件" - rm -f test_bib.tex test.bib test_bib.aux test_bib.bbl test_bib.blg test_bib.log test_bib.out test_bib.pdf - - if [ "$INSTALLED" = "false" ]; then - LOG_INFO "步骤10: 卸载texlive-ptex软件包" - dnf remove -y texlive-ptex - CHECK_RESULT $? 0 0 "卸载texlive-ptex失败" - else - LOG_INFO "步骤10: 保持texlive-ptex安装状态" - fi - - LOG_INFO "测试完成:Test bibliography processing with pBibTeX" -} - -main "$@" \ No newline at end of file diff --git a/testcases/function_test/pkg_test/texlive-base/texlive-ptex/test_texlive-ptex_function_platex.sh b/testcases/function_test/pkg_test/texlive-base/texlive-ptex/test_texlive-ptex_function_platex.sh deleted file mode 100644 index 72ddbe08bc3..00000000000 --- a/testcases/function_test/pkg_test/texlive-base/texlive-ptex/test_texlive-ptex_function_platex.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-08 -# @License : Mulan PSL v2 -# @Desc : Test LaTeX document with pLaTeX -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - # 检查是否以root用户运行 - if [ $(id -u) -ne 0 ]; then - LOG_ERROR "请以root用户运行此脚本" - exit 1 - fi - - # 定义软件包名称 - PACKAGE_NAME="texlive-ptex" - LOG_INFO "测试LaTeX文档使用pLaTeX" - LOG_INFO "检查软件包是否已在YUM源中可用" - - # 检查软件包是否在YUM源中可用 - if ! dnf list available $PACKAGE_NAME &>/dev/null; then - LOG_ERROR "软件包 $PACKAGE_NAME 在YUM源中不可用" - exit 255 - fi - - # 检查系统是否已安装软件包 - if rpm -q $PACKAGE_NAME &>/dev/null; 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 - CHECK_RESULT $? 0 0 "安装软件包 $PACKAGE_NAME 失败" - fi - - # 检查platex命令是否可用 - LOG_INFO "检查platex命令是否可用" - if ! command -v platex &>/dev/null; then - LOG_ERROR "platex命令未找到" - exit 255 - fi - - # 创建测试LaTeX文档 - LOG_INFO "创建测试LaTeX文档" - cat > test_document.tex << "EOF" - \documentclass{article} - \begin{document} - Hello, pLaTeX! - \end{document} - EOF - CHECK_RESULT $? 0 0 "创建测试LaTeX文档失败" - - # 使用platex编译LaTeX文档 - LOG_INFO "使用platex编译LaTeX文档" - platex test_document.tex - CHECK_RESULT $? 0 0 "使用platex编译LaTeX文档失败" - - # 检查是否生成了DVI文件 - LOG_INFO "检查是否生成了DVI文件" - if [ -f test_document.dvi ]; then - LOG_INFO "成功生成DVI文件" - else - LOG_ERROR "未生成DVI文件" - exit 1 - fi - - # 清理生成的临时文件 - LOG_INFO "清理生成的临时文件" - rm -f test_document.aux test_document.log test_document.dvi test_document.tex - 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 失败" - fi - - LOG_INFO "测试完成" -} - -main "$@" \ No newline at end of file diff --git a/testcases/function_test/pkg_test/texlive-base/texlive-ptex/test_texlive-ptex_function_shell_escape.sh b/testcases/function_test/pkg_test/texlive-base/texlive-ptex/test_texlive-ptex_function_shell_escape.sh deleted file mode 100644 index 5c47a6b5941..00000000000 --- a/testcases/function_test/pkg_test/texlive-base/texlive-ptex/test_texlive-ptex_function_shell_escape.sh +++ /dev/null @@ -1,97 +0,0 @@ -#!/usr/bin/bash - -# Copyright (c) 2024 ISCAS .ALL rights reserved. -# This program is licensed under Mulan PSL v2. -# You can use it according to the terms and conditions of the Mulan PSL v2. -# http://license.coscl.org.cn/MulanPSL2 -# THIS PROGRAM IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, -# EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, -# MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. -# See the Mulan PSL v2 for more details. - -# ############################################# -# @Author : honghua -# @Contact : honghua@iscas.ac.cn -# @Date : 2026-03-08 -# @License : Mulan PSL v2 -# @Desc : Test shell escape functionality -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - # 判断是否已安装texlive-ptex - LOG_INFO "检查是否已安装texlive-ptex" - if dnf list installed texlive-ptex &>/dev/null; then - LOG_INFO "texlive-ptex已安装,标记为已安装状态" - INSTALLED="true" - else - LOG_INFO "texlive-ptex未安装,标记为未安装状态" - INSTALLED="false" - fi - - # 检查yum源中是否有该软件包 - LOG_INFO "检查yum源中是否有texlive-ptex软件包" - if ! dnf list available texlive-ptex &>/dev/null; then - LOG_ERROR "yum源中未找到texlive-ptex软件包" - exit 255 - fi - - # 如果未安装,则安装软件包 - if [ "$INSTALLED" = "false" ]; then - LOG_INFO "开始安装texlive-ptex软件包" - dnf install -y texlive-ptex - CHECK_RESULT $? 0 0 "安装texlive-ptex失败" - LOG_INFO "texlive-ptex安装成功" - fi - - # 测试shell escape功能 - LOG_INFO "测试shell escape功能" - # 创建一个简单的tex文件测试shell escape - TEST_TEX_FILE="test_shell_escape.tex" - cat > "$TEST_TEX_FILE" << "EOF" - \documentclass{article} - \begin{document} - Testing shell escape: \write18{echo "Hello from shell escape"} - \end{document} - EOF - - # 检查ptex命令是否支持-shell-escape参数 - LOG_INFO "检查ptex命令是否支持-shell-escape参数" - if ! ptex --help | grep -q "\-shell-escape"; then - LOG_ERROR "ptex命令不支持-shell-escape参数" - exit 255 - fi - - # 使用shell escape功能编译tex文件 - LOG_INFO "使用shell escape功能编译tex文件" - ptex -shell-escape "$TEST_TEX_FILE" 2>&1 | tee compile_output.txt - CHECK_RESULT $? 0 0 "使用shell escape编译失败" - - # 检查编译输出中是否包含shell escape的执行结果 - LOG_INFO "检查shell escape是否成功执行" - if grep -q "Hello from shell escape" compile_output.txt; then - LOG_INFO "shell escape功能测试成功" - else - LOG_ERROR "shell escape功能测试失败,未找到预期输出" - exit 1 - fi - - # 清理测试文件 - LOG_INFO "清理测试文件" - rm -f "$TEST_TEX_FILE" compile_output.txt test_shell_escape.log test_shell_escape.aux test_shell_escape.dvi - - # 如果之前未安装,则卸载软件包 - if [ "$INSTALLED" = "false" ]; then - LOG_INFO "卸载texlive-ptex软件包" - dnf remove -y texlive-ptex - CHECK_RESULT $? 0 0 "卸载texlive-ptex失败" - LOG_INFO "texlive-ptex卸载成功" - else - LOG_INFO "保持texlive-ptex安装状态" - fi - - LOG_INFO "测试完成" -} - -main "$@" \ No newline at end of file diff --git a/testcases/function_test/pkg_test/texlive-base/texlive-ptex/test_texlive-ptex_function_version.sh b/testcases/function_test/pkg_test/texlive-base/texlive-ptex/test_texlive-ptex_function_version.sh deleted file mode 100644 index d62f43685ee..00000000000 --- a/testcases/function_test/pkg_test/texlive-base/texlive-ptex/test_texlive-ptex_function_version.sh +++ /dev/null @@ -1,129 +0,0 @@ -#!/usr/bin/bash - -# Copyright (c) 2024 ISCAS .ALL rights reserved. -# This program is licensed under Mulan PSL v2. -# You can use it according to the terms and conditions of the Mulan PSL v2. -# http://license.coscl.org.cn/MulanPSL2 -# THIS PROGRAM IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, -# EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, -# MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. -# See the Mulan PSL v2 for more details. - -# ############################################# -# @Author : honghua -# @Contact : honghua@iscas.ac.cn -# @Date : 2026-03-08 -# @License : Mulan PSL v2 -# @Desc : Test version display of ptex commands -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - # 判断是否已安装ptex相关软件包 - LOG_INFO "检查ptex相关软件包是否已安装" - rpm -q ptex > /dev/null 2>&1 - PTEX_INSTALLED=$? - - # 记录初始安装状态 - if [ $PTEX_INSTALLED -eq 0 ]; then - LOG_INFO "检测到ptex已安装,测试后将保持安装状态" - INITIAL_INSTALLED=true - else - LOG_INFO "检测到ptex未安装,将在测试后卸载" - INITIAL_INSTALLED=false - fi - - # 检查yum源中是否有ptex软件包 - LOG_INFO "检查yum源中是否有ptex软件包" - dnf list available ptex > /dev/null 2>&1 - if [ $? -ne 0 ]; then - LOG_ERROR "yum源中未找到ptex软件包" - exit 255 - fi - - # 如果未安装,则安装ptex - if [ $PTEX_INSTALLED -ne 0 ]; then - LOG_INFO "开始安装ptex软件包" - dnf install -y ptex - CHECK_RESULT $? 0 0 "安装ptex软件包失败" - fi - - # 测试ptex命令版本显示 - LOG_INFO "测试ptex命令版本显示" - ptex --version > /dev/null 2>&1 - CHECK_RESULT $? 0 0 "ptex命令版本显示失败" - - # 测试eptex命令版本显示 - LOG_INFO "测试eptex命令版本显示" - eptex --version > /dev/null 2>&1 - CHECK_RESULT $? 0 0 "eptex命令版本显示失败" - - # 测试uptex命令版本显示 - LOG_INFO "测试uptex命令版本显示" - uptex --version > /dev/null 2>&1 - CHECK_RESULT $? 0 0 "uptex命令版本显示失败" - - # 测试euptex命令版本显示 - LOG_INFO "测试euptex命令版本显示" - euptex --version > /dev/null 2>&1 - CHECK_RESULT $? 0 0 "euptex命令版本显示失败" - - # 测试platex命令版本显示 - LOG_INFO "测试platex命令版本显示" - platex --version > /dev/null 2>&1 - CHECK_RESULT $? 0 0 "platex命令版本显示失败" - - # 测试uplatex命令版本显示 - LOG_INFO "测试uplatex命令版本显示" - uplatex --version > /dev/null 2>&1 - CHECK_RESULT $? 0 0 "uplatex命令版本显示失败" - - # 测试dvipdfmx命令版本显示 - LOG_INFO "测试dvipdfmx命令版本显示" - dvipdfmx --version > /dev/null 2>&1 - CHECK_RESULT $? 0 0 "dvipdfmx命令版本显示失败" - - # 测试pbibtex命令版本显示 - LOG_INFO "测试pbibtex命令版本显示" - pbibtex --version > /dev/null 2>&1 - CHECK_RESULT $? 0 0 "pbibtex命令版本显示失败" - - # 测试upbibtex命令版本显示 - LOG_INFO "测试upbibtex命令版本显示" - upbibtex --version > /dev/null 2>&1 - CHECK_RESULT $? 0 0 "upbibtex命令版本显示失败" - - # 测试ptex2pdf命令版本显示 - LOG_INFO "测试ptex2pdf命令版本显示" - ptex2pdf --version > /dev/null 2>&1 - CHECK_RESULT $? 0 0 "ptex2pdf命令版本显示失败" - - # 测试eptex2pdf命令版本显示 - LOG_INFO "测试eptex2pdf命令版本显示" - eptex2pdf --version > /dev/null 2>&1 - CHECK_RESULT $? 0 0 "eptex2pdf命令版本显示失败" - - # 测试uptex2pdf命令版本显示 - LOG_INFO "测试uptex2pdf命令版本显示" - uptex2pdf --version > /dev/null 2>&1 - CHECK_RESULT $? 0 0 "uptex2pdf命令版本显示失败" - - # 测试euptex2pdf命令版本显示 - LOG_INFO "测试euptex2pdf命令版本显示" - euptex2pdf --version > /dev/null 2>&1 - CHECK_RESULT $? 0 0 "euptex2pdf命令版本显示失败" - - # 环境清理:如果初始未安装,则卸载ptex - if [ "$INITIAL_INSTALLED" = "false" ]; then - LOG_INFO "清理环境:卸载ptex软件包" - dnf remove -y ptex - CHECK_RESULT $? 0 0 "卸载ptex软件包失败" - else - LOG_INFO "保持ptex安装状态,无需清理" - fi - - LOG_INFO "ptex命令版本显示测试完成" -} - -main "$@" \ No newline at end of file diff --git a/testcases/function_test/pkg_test/texlive-base/texlive-ptex/test_texlive-ptex_makejvf_3.sh b/testcases/function_test/pkg_test/texlive-base/texlive-ptex/test_texlive-ptex_makejvf_3.sh deleted file mode 100644 index 551219b3f52..00000000000 --- a/testcases/function_test/pkg_test/texlive-base/texlive-ptex/test_texlive-ptex_makejvf_3.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-08 -# @License : Mulan PSL v2 -# @Desc : 测试在UCS模式下启用非BMP字符支持 -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - # 检查是否已安装texlive-ptex包 - LOG_INFO "检查是否已安装texlive-ptex包" - rpm -q texlive-ptex - if [ $? -eq 0 ]; then - LOG_INFO "texlive-ptex已安装,脚本结束后将保持安装状态" - INSTALLED=1 - else - LOG_INFO "texlive-ptex未安装,将进行安装" - INSTALLED=0 - fi - - # 检查yum源中是否有texlive-ptex包 - LOG_INFO "检查yum源中是否有texlive-ptex包" - dnf list available texlive-ptex > /dev/null 2>&1 - CHECK_RESULT $? 0 0 "yum源中不存在texlive-ptex包" - if [ $? -ne 0 ]; then - LOG_ERROR "yum源中不存在texlive-ptex包" - exit 255 - fi - - # 如果未安装,则安装texlive-ptex - if [ $INSTALLED -eq 0 ]; then - LOG_INFO "安装texlive-ptex包" - dnf install -y texlive-ptex - CHECK_RESULT $? 0 0 "安装texlive-ptex失败" - fi - - # 测试在UCS模式下启用非BMP字符支持 - LOG_INFO "测试在UCS模式下启用非BMP字符支持" - # 检查makejvf命令是否存在 - which makejvf > /dev/null 2>&1 - if [ $? -ne 0 ]; then - LOG_ERROR "makejvf命令不存在" - if [ $INSTALLED -eq 0 ]; then - dnf remove -y texlive-ptex - fi - exit 255 - fi - - # 检查makejvf命令是否支持-U参数 - LOG_INFO "检查makejvf命令是否支持-U参数" - makejvf -h 2>&1 | grep -q "\-U" - if [ $? -ne 0 ]; then - LOG_ERROR "makejvf命令不支持-U参数" - if [ $INSTALLED -eq 0 ]; then - dnf remove -y texlive-ptex - fi - exit 255 - fi - - # 创建测试文件 - LOG_INFO "创建测试文件" - cat > test_input.txt << EOF - test content - EOF - CHECK_RESULT $? 0 0 "创建测试文件失败" - - # 执行makejvf命令测试UCS模式 - LOG_INFO "执行makejvf命令测试UCS模式" - makejvf -U test_input.txt test_output.jvf 2>&1 - CHECK_RESULT $? 0 0 "makejvf命令执行失败" - - # 检查输出文件是否存在 - LOG_INFO "检查输出文件是否存在" - [ -f test_output.jvf ] - CHECK_RESULT $? 0 0 "输出文件未生成" - - # 清理测试文件 - LOG_INFO "清理测试文件" - rm -f test_input.txt test_output.jvf - CHECK_RESULT $? 0 0 "清理测试文件失败" - - # 如果脚本开始前未安装,则卸载texlive-ptex - if [ $INSTALLED -eq 0 ]; then - LOG_INFO "卸载texlive-ptex包" - dnf remove -y texlive-ptex - CHECK_RESULT $? 0 0 "卸载texlive-ptex失败" - else - LOG_INFO "保持texlive-ptex安装状态" - fi - - LOG_INFO "测试完成" -} - -main "$@" \ No newline at end of file diff --git a/testcases/function_test/pkg_test/texlive-base/texlive-ptex/test_texlive-ptex_makejvf_a_afmfile.sh b/testcases/function_test/pkg_test/texlive-base/texlive-ptex/test_texlive-ptex_makejvf_a_afmfile.sh deleted file mode 100644 index e9c6ecd42eb..00000000000 --- a/testcases/function_test/pkg_test/texlive-base/texlive-ptex/test_texlive-ptex_makejvf_a_afmfile.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-08 -# @License : Mulan PSL v2 -# @Desc : 测试指定AFM文件(用于假名间距调整) -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - LOG_INFO "开始测试:测试指定AFM文件(用于假名间距调整)" - - # 检查是否已安装texlive-ptex - LOG_INFO "检查是否已安装texlive-ptex软件包" - if dnf list installed texlive-ptex &>/dev/null; then - LOG_INFO "texlive-ptex已安装,测试结束后保持安装状态" - INSTALLED=true - else - LOG_INFO "texlive-ptex未安装,将在测试过程中安装" - INSTALLED=false - fi - - # 检查yum源中是否有texlive-ptex软件包 - LOG_INFO "检查yum源中是否有texlive-ptex软件包" - if ! dnf list available texlive-ptex &>/dev/null; then - LOG_ERROR "yum源中未找到texlive-ptex软件包" - exit 255 - fi - - # 如果未安装,则安装软件包 - if [ "$INSTALLED" = false ]; then - LOG_INFO "安装texlive-ptex软件包" - dnf install -y texlive-ptex - CHECK_RESULT $? 0 0 "安装texlive-ptex失败" - fi - - # 测试指定AFM文件(用于假名间距调整) - LOG_INFO "测试指定AFM文件(用于假名间距调整)" - # 假设使用makejvf命令测试AFM文件,这里以检查命令参数为例 - # 检查makejvf命令是否支持指定AFM文件 - LOG_INFO "检查makejvf命令是否支持指定AFM文件参数" - makejvf --help 2>&1 | grep -q "afm" - if [ $? -ne 0 ]; then - LOG_ERROR "makejvf命令不支持指定AFM文件参数" - exit 255 - fi - - # 假设有一个测试用的AFM文件test.afm,这里仅模拟测试 - # 实际测试中需要准备具体的AFM文件 - LOG_INFO "执行makejvf命令测试AFM文件" - # 这里使用虚拟命令模拟,实际应根据具体命令替换 - echo "模拟执行:makejvf -afm test.afm test.jvf" - CHECK_RESULT $? 0 0 "makejvf命令执行失败" - - # 清理环境:如果测试前未安装,则卸载软件包 - if [ "$INSTALLED" = false ]; then - LOG_INFO "卸载texlive-ptex软件包" - dnf remove -y texlive-ptex - CHECK_RESULT $? 0 0 "卸载texlive-ptex失败" - fi - - LOG_INFO "测试完成,环境已恢复" -} - -main "$@" \ No newline at end of file diff --git a/testcases/function_test/pkg_test/texlive-base/texlive-ptex/test_texlive-ptex_makejvf_a_afmfile_k_num_20.sh b/testcases/function_test/pkg_test/texlive-base/texlive-ptex/test_texlive-ptex_makejvf_a_afmfile_k_num_20.sh deleted file mode 100644 index bd8d5f3359f..00000000000 --- a/testcases/function_test/pkg_test/texlive-base/texlive-ptex/test_texlive-ptex_makejvf_a_afmfile_k_num_20.sh +++ /dev/null @@ -1,162 +0,0 @@ -#!/usr/bin/bash - -# Copyright (c) 2024 ISCAS .ALL rights reserved. -# This program is licensed under Mulan PSL v2. -# You can use it according to the terms and conditions of the Mulan PSL v2. -# http://license.coscl.org.cn/MulanPSL2 -# THIS PROGRAM IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, -# EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, -# MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. -# See the Mulan PSL v2 for more details. - -# ############################################# -# @Author : honghua -# @Contact : honghua@iscas.ac.cn -# @Date : 2026-03-08 -# @License : Mulan PSL v2 -# @Desc : 测试组合使用AFM文件和假名边距选项 -# ############################################ - -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 - dnf list available "$pkg" >/dev/null 2>&1 - if [ $? -ne 0 ]; then - LOG_ERROR "软件包 $pkg 不在yum源中" - exit 255 - fi - } - - # 检查命令参数是否支持 - check_command_option() { - local cmd=$1 - local option=$2 - $cmd --help 2>&1 | grep -q -- "$option" - if [ $? -ne 0 ]; then - LOG_ERROR "命令 $cmd 不支持参数 $option" - exit 255 - fi - } - - # 主测试函数 - main() { - LOG_INFO "开始测试组合使用AFM文件和假名边距选项" - - # 定义软件包名称 - PACKAGE="texlive-ptex" - - # 步骤1:检查软件包是否在yum源中 - LOG_INFO "步骤1:检查软件包是否在yum源中" - check_package_in_repo "$PACKAGE" - CHECK_RESULT $? 0 0 "检查软件包在yum源中失败" - - # 步骤2:检查系统是否已安装该软件包 - LOG_INFO "步骤2:检查系统是否已安装该软件包" - if rpm -q "$PACKAGE" >/dev/null 2>&1; then - LOG_INFO "软件包 $PACKAGE 已安装,测试后保持安装状态" - ALREADY_INSTALLED=1 - else - LOG_INFO "软件包 $PACKAGE 未安装,将在测试中安装" - ALREADY_INSTALLED=0 - fi - - # 步骤3:如果未安装,则安装软件包 - if [ $ALREADY_INSTALLED -eq 0 ]; then - LOG_INFO "步骤3:安装软件包 $PACKAGE" - dnf install -y "$PACKAGE" - CHECK_RESULT $? 0 0 "安装软件包失败" - fi - - # 步骤4:检查makejvf命令是否支持所需参数 - LOG_INFO "步骤4:检查makejvf命令是否支持所需参数" - check_command_option "makejvf" "-a" - check_command_option "makejvf" "-k" - - # 步骤5:准备测试文件 - LOG_INFO "步骤5:准备测试文件" - TEST_AFM_FILE="test.afm" - TEST_OUTPUT="test_output" - - # 创建测试AFM文件(示例内容) - cat > "$TEST_AFM_FILE" << "EOF" - StartFontMetrics 4.1 - Comment Generated by test script - FontName TestFont - EncodingScheme FontSpecific - FullName Test Font - FamilyName Test - Weight Medium - ItalicAngle 0 - IsFixedPitch false - UnderlinePosition -100 - UnderlineThickness 50 - Version 001.000 - Notice Test notice - Comment This is a test AFM file - StartCharMetrics 1 - C 32 ; WX 500 ; N space ; B 0 0 0 0 ; - EndCharMetrics - EndFontMetrics - EOF - CHECK_RESULT $? 0 0 "创建测试AFM文件失败" - - # 步骤6:执行makejvf命令测试组合参数 - LOG_INFO "步骤6:执行makejvf命令测试组合参数" - LOG_INFO "测试命令:makejvf -a $TEST_AFM_FILE -k 20 $TEST_OUTPUT" - - # 注意:这里使用示例命令,实际应根据makejvf命令的实际用法调整 - # 假设makejvf命令支持 -a 指定AFM文件,-k 指定假名边距,最后是输出文件名 - makejvf -a "$TEST_AFM_FILE" -k 20 "$TEST_OUTPUT" 2>&1 - local cmd_result=$? - - # 检查命令执行结果 - if [ $cmd_result -eq 0 ]; then - LOG_INFO "makejvf命令执行成功" - # 检查输出文件是否存在 - if [ -f "${TEST_OUTPUT}.jvf" ] || [ -f "$TEST_OUTPUT" ]; then - LOG_INFO "输出文件生成成功" - else - LOG_ERROR "输出文件未生成" - cmd_result=1 - fi - else - LOG_ERROR "makejvf命令执行失败,退出码:$cmd_result" - fi - - # 步骤7:清理测试文件 - LOG_INFO "步骤7:清理测试文件" - rm -f "$TEST_AFM_FILE" "${TEST_OUTPUT}"* 2>/dev/null - CHECK_RESULT $? 0 0 "清理测试文件失败" - - # 步骤8:如果测试前未安装,则卸载软件包 - if [ $ALREADY_INSTALLED -eq 0 ]; then - LOG_INFO "步骤8:卸载测试安装的软件包" - dnf remove -y "$PACKAGE" - CHECK_RESULT $? 0 0 "卸载软件包失败" - else - LOG_INFO "步骤8:保持软件包安装状态,不卸载" - fi - - # 步骤9:最终结果检查 - LOG_INFO "步骤9:检查最终测试结果" - if [ $cmd_result -eq 0 ]; then - LOG_INFO "测试组合使用AFM文件和假名边距选项成功" - exit 0 - else - LOG_ERROR "测试组合使用AFM文件和假名边距选项失败" - exit $cmd_result - fi - } - - # 执行主函数 - main -} - -main "$@" \ No newline at end of file diff --git a/testcases/function_test/pkg_test/texlive-base/texlive-ptex/test_texlive-ptex_makejvf_b_num_-30.sh b/testcases/function_test/pkg_test/texlive-base/texlive-ptex/test_texlive-ptex_makejvf_b_num_-30.sh deleted file mode 100644 index b6ef3799c49..00000000000 --- a/testcases/function_test/pkg_test/texlive-base/texlive-ptex/test_texlive-ptex_makejvf_b_num_-30.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-08 -# @License : Mulan PSL v2 -# @Desc : 测试基线负方向调整 -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - # 测试脚本:测试基线负方向调整 - - LOG_INFO "开始测试基线负方向调整功能" - - # 定义软件包名称 - PACKAGE_NAME="texlive-ptex" - - # 步骤1:检查软件包是否已在yum源中 - LOG_INFO "步骤1:检查yum源中是否存在${PACKAGE_NAME}软件包" - dnf list available ${PACKAGE_NAME} > /dev/null 2>&1 - if [ $? -ne 0 ]; then - LOG_ERROR "yum源中不存在${PACKAGE_NAME}软件包" - exit 255 - fi - - # 步骤2:检查系统是否已安装该软件包 - LOG_INFO "步骤2:检查系统是否已安装${PACKAGE_NAME}软件包" - rpm -q ${PACKAGE_NAME} > /dev/null 2>&1 - if [ $? -eq 0 ]; then - LOG_INFO "系统已安装${PACKAGE_NAME}软件包,测试后保持安装状态" - ALREADY_INSTALLED=1 - else - LOG_INFO "系统未安装${PACKAGE_NAME}软件包,将在测试过程中安装" - ALREADY_INSTALLED=0 - fi - - # 步骤3:检查makejvf命令的-b参数是否支持-30值 - LOG_INFO "步骤3:检查makejvf命令的-b参数是否支持-30值" - 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 - - # 步骤4:验证makejvf命令是否存在 - LOG_INFO "步骤4:验证makejvf命令是否存在" - which makejvf > /dev/null 2>&1 - CHECK_RESULT $? 0 0 "makejvf命令不存在" - - # 步骤5:测试makejvf命令的-b参数是否支持-30值 - LOG_INFO "步骤5:测试makejvf命令的-b参数是否支持-30值" - # 创建一个临时测试文件 - TEST_FILE="/tmp/test_makejvf.txt" - echo "Test content for makejvf" > ${TEST_FILE} - - # 尝试使用-b -30参数执行makejvf命令 - makejvf -b -30 ${TEST_FILE} /tmp/test_output.jvf 2>&1 | grep -q "invalid\|不支持\|不支持\|不支持" - if [ $? -eq 0 ]; then - LOG_ERROR "makejvf命令的-b参数不支持-30值" - # 清理临时文件 - rm -f ${TEST_FILE} /tmp/test_output.jvf 2>/dev/null - - # 如果之前未安装,则卸载软件包 - if [ ${ALREADY_INSTALLED} -eq 0 ]; then - LOG_INFO "清理环境:卸载${PACKAGE_NAME}软件包" - dnf remove -y ${PACKAGE_NAME} > /dev/null 2>&1 - fi - - exit 255 - fi - - # 检查命令执行结果 - CHECK_RESULT $? 0 0 "makejvf命令执行失败" - - # 步骤6:验证生成的输出文件 - LOG_INFO "步骤6:验证makejvf命令生成的输出文件" - if [ -f "/tmp/test_output.jvf" ]; then - LOG_INFO "成功生成jvf文件" - # 检查文件大小是否合理 - FILE_SIZE=$(stat -c%s "/tmp/test_output.jvf" 2>/dev/null || echo "0") - if [ ${FILE_SIZE} -gt 0 ]; then - LOG_INFO "生成的jvf文件大小合理:${FILE_SIZE}字节" - else - LOG_ERROR "生成的jvf文件大小为0" - CHECK_RESULT 1 0 0 "生成的jvf文件无效" - fi - else - LOG_ERROR "未生成jvf输出文件" - CHECK_RESULT 1 0 0 "未生成输出文件" - fi - - # 步骤7:清理临时文件 - LOG_INFO "步骤7:清理测试过程中创建的临时文件" - rm -f ${TEST_FILE} /tmp/test_output.jvf 2>/dev/null - CHECK_RESULT $? 0 0 "清理临时文件失败" - - # 步骤8:恢复环境 - LOG_INFO "步骤8:恢复测试环境" - 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}软件包失败" - 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-ptex/test_texlive-ptex_makejvf_b_num_50.sh b/testcases/function_test/pkg_test/texlive-base/texlive-ptex/test_texlive-ptex_makejvf_b_num_50.sh deleted file mode 100644 index 511f09949fc..00000000000 --- a/testcases/function_test/pkg_test/texlive-base/texlive-ptex/test_texlive-ptex_makejvf_b_num_50.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-08 -# @License : Mulan PSL v2 -# @Desc : 测试基线正方向调整 -# ############################################ - -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_CMD函数(虽然题目说直接使用,但实际环境中可能没有,这里定义以确保脚本可运行) - SSH_CMD() { - local cmd=$1 - local node_ip=$2 - local node_password=$3 - local node_user=$4 - # 实际实现应使用sshpass或密钥认证,这里仅作示例 - ssh $node_user@$node_ip "$cmd" - } - - # 定义软件包名称 - PACKAGE_NAME="texlive-ptex" - - # 步骤1:检查yum源中是否有该软件包 - LOG_INFO "步骤1:检查yum源中是否有软件包 $PACKAGE_NAME" - dnf list available $PACKAGE_NAME &>/dev/null - if [ $? -ne 0 ]; then - LOG_ERROR "yum源中没有找到软件包 $PACKAGE_NAME" - exit 255 - fi - - # 步骤2:检查环境是否已经安装该软件包 - LOG_INFO "步骤2:检查环境是否已经安装软件包 $PACKAGE_NAME" - if rpm -q $PACKAGE_NAME &>/dev/null; then - LOG_INFO "软件包 $PACKAGE_NAME 已经安装,脚本结束时将保持安装状态" - ALREADY_INSTALLED=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 255 "安装软件包 $PACKAGE_NAME 失败" - fi - - # 步骤4:测试基线正方向调整 - LOG_INFO "步骤4:测试基线正方向调整" - # 这里假设测试基线正方向调整的命令是 makejvf,参数 -b 50 - # 检查命令是否存在 - command -v makejvf &>/dev/null - CHECK_RESULT $? 0 255 "命令 makejvf 不存在或不支持" - - # 检查参数是否支持 - makejvf --help 2>&1 | grep -q "\-b" - CHECK_RESULT $? 0 255 "命令 makejvf 不支持参数 -b" - - # 执行命令 - makejvf -b 50 - CHECK_RESULT $? 0 1 "执行 makejvf -b 50 失败" - - # 步骤5:清理环境 - LOG_INFO "步骤5:清理环境" - if [ "$ALREADY_INSTALLED" = "false" ]; then - LOG_INFO "卸载软件包 $PACKAGE_NAME" - dnf remove -y $PACKAGE_NAME - CHECK_RESULT $? 0 1 "卸载软件包 $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-ptex/test_texlive-ptex_makejvf_e.sh b/testcases/function_test/pkg_test/texlive-base/texlive-ptex/test_texlive-ptex_makejvf_e.sh deleted file mode 100644 index b11ccd32b7a..00000000000 --- a/testcases/function_test/pkg_test/texlive-base/texlive-ptex/test_texlive-ptex_makejvf_e.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-08 -# @License : Mulan PSL v2 -# @Desc : 测试增强模式 -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - # 环境检查:检查是否已安装texlive-ptex_makejvf软件包 - LOG_INFO "开始检查texlive-ptex_makejvf软件包是否已安装" - if dnf list installed texlive-ptex_makejvf &>/dev/null; then - LOG_INFO "texlive-ptex_makejvf软件包已安装" - INSTALLED=true - else - LOG_INFO "texlive-ptex_makejvf软件包未安装" - INSTALLED=false - fi - - # 检查yum源中是否存在texlive-ptex_makejvf软件包 - LOG_INFO "检查yum源中是否存在texlive-ptex_makejvf软件包" - if ! dnf list available texlive-ptex_makejvf &>/dev/null; then - LOG_ERROR "yum源中不存在texlive-ptex_makejvf软件包" - exit 255 - fi - - # 如果未安装,则安装软件包 - if [ "$INSTALLED" = false ]; then - LOG_INFO "开始安装texlive-ptex_makejvf软件包" - dnf install -y texlive-ptex_makejvf - CHECK_RESULT $? 0 0 "安装texlive-ptex_makejvf软件包失败" - LOG_INFO "texlive-ptex_makejvf软件包安装成功" - fi - - # 测试增强模式 - LOG_INFO "开始测试增强模式" - # 检查命令参数是否存在 - LOG_INFO "检查命令参数" - if ! makejvf -h &>/dev/null; then - LOG_ERROR "makejvf命令不支持-h参数或命令不存在" - exit 255 - fi - - # 执行增强模式测试 - LOG_INFO "执行增强模式测试" - makejvf -e test_input.txt test_output.jvf - CHECK_RESULT $? 0 0 "增强模式测试失败" - - LOG_INFO "增强模式测试成功" - - # 环境清理:如果之前未安装,则卸载软件包 - if [ "$INSTALLED" = false ]; then - LOG_INFO "开始卸载texlive-ptex_makejvf软件包" - dnf remove -y texlive-ptex_makejvf - CHECK_RESULT $? 0 0 "卸载texlive-ptex_makejvf软件包失败" - LOG_INFO "texlive-ptex_makejvf软件包卸载成功" - else - LOG_INFO "保持texlive-ptex_makejvf软件包安装状态" - fi - - LOG_INFO "测试脚本执行完毕" -} - -main "$@" \ No newline at end of file diff --git a/testcases/function_test/pkg_test/texlive-base/texlive-ptex/test_texlive-ptex_makejvf_i.sh b/testcases/function_test/pkg_test/texlive-base/texlive-ptex/test_texlive-ptex_makejvf_i.sh deleted file mode 100644 index d575f30b707..00000000000 --- a/testcases/function_test/pkg_test/texlive-base/texlive-ptex/test_texlive-ptex_makejvf_i.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-08 -# @License : Mulan PSL v2 -# @Desc : 测试从0开始映射字体ID -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - # 检查是否已安装texlive-ptex包 - LOG_INFO "检查是否已安装texlive-ptex软件包" - if dnf list installed texlive-ptex &>/dev/null; then - LOG_INFO "texlive-ptex已安装,标记为保持安装状态" - KEEP_INSTALLED=1 - else - LOG_INFO "texlive-ptex未安装,标记为测试安装" - KEEP_INSTALLED=0 - fi - - # 检查yum源中是否有texlive-ptex包 - LOG_INFO "检查yum源中是否有texlive-ptex软件包" - if ! dnf list available texlive-ptex &>/dev/null; then - LOG_ERROR "yum源中没有texlive-ptex软件包" - exit 255 - fi - - # 如果未安装,则安装texlive-ptex - if [ $KEEP_INSTALLED -eq 0 ]; then - LOG_INFO "安装texlive-ptex软件包" - dnf install -y texlive-ptex - CHECK_RESULT $? 0 0 "安装texlive-ptex失败" - fi - - # 测试从0开始映射字体ID - LOG_INFO "测试从0开始映射字体ID" - if ! command -v makejvf &>/dev/null; then - LOG_ERROR "makejvf命令不存在" - exit 255 - fi - - # 检查makejvf是否支持-m参数 - LOG_INFO "检查makejvf命令是否支持-m参数" - makejvf --help | grep -q "\-m" - CHECK_RESULT $? 0 0 "makejvf命令不支持-m参数" - - # 创建测试输入文件 - LOG_INFO "创建测试输入文件" - cat > test_input.txt << "EOF" - % This is a test file for makejvf - test content - EOF - CHECK_RESULT $? 0 0 "创建测试输入文件失败" - - # 执行makejvf命令测试从0开始映射字体ID - LOG_INFO "执行makejvf命令,测试从0开始映射字体ID" - makejvf -m 0 test_input.txt test_output.jvf 2>&1 - CHECK_RESULT $? 0 0 "makejvf命令执行失败" - - # 检查输出文件是否生成 - LOG_INFO "检查输出文件是否生成" - [ -f test_output.jvf ] - CHECK_RESULT $? 0 0 "输出文件未生成" - - # 清理测试文件 - LOG_INFO "清理测试文件" - rm -f test_input.txt test_output.jvf - CHECK_RESULT $? 0 0 "清理测试文件失败" - - # 如果测试前未安装,则卸载软件包 - if [ $KEEP_INSTALLED -eq 0 ]; then - LOG_INFO "卸载texlive-ptex软件包" - dnf remove -y texlive-ptex - CHECK_RESULT $? 0 0 "卸载texlive-ptex失败" - else - LOG_INFO "保持texlive-ptex安装状态" - fi - - LOG_INFO "测试完成" -} - -main "$@" \ No newline at end of file diff --git a/testcases/function_test/pkg_test/texlive-base/texlive-ptex/test_texlive-ptex_makejvf_k_num_20.sh b/testcases/function_test/pkg_test/texlive-base/texlive-ptex/test_texlive-ptex_makejvf_k_num_20.sh deleted file mode 100644 index 2d9ba21c73c..00000000000 --- a/testcases/function_test/pkg_test/texlive-base/texlive-ptex/test_texlive-ptex_makejvf_k_num_20.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-08 -# @License : Mulan PSL v2 -# @Desc : 测试指定假名间距调整边距 -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - # 定义软件包名称和命令 - PACKAGE_NAME="texlive-ptex" - COMMAND="makejvf" - PARAMETER="-k" - TEST_VALUE="20" - - # 检查软件包是否存在于yum源中 - LOG_INFO "步骤1: 检查软件包是否存在于yum源中" - dnf list available "$PACKAGE_NAME" &>/dev/null - if [ $? -ne 0 ]; then - LOG_ERROR "软件包 $PACKAGE_NAME 不在yum源中" - exit 255 - fi - - # 检查当前是否已安装软件包 - LOG_INFO "步骤2: 检查软件包是否已安装" - dnf list installed "$PACKAGE_NAME" &>/dev/null - INSTALLED=$? - - # 记录初始安装状态 - if [ $INSTALLED -eq 0 ]; then - LOG_INFO "软件包 $PACKAGE_NAME 已安装" - ORIGINAL_STATE="installed" - else - LOG_INFO "软件包 $PACKAGE_NAME 未安装" - ORIGINAL_STATE="not_installed" - fi - - # 如果未安装,则安装软件包 - if [ "$ORIGINAL_STATE" = "not_installed" ]; then - LOG_INFO "步骤3: 安装软件包 $PACKAGE_NAME" - dnf install -y "$PACKAGE_NAME" - CHECK_RESULT $? 0 0 "安装软件包失败" - fi - - # 检查命令是否存在 - LOG_INFO "步骤4: 检查命令 $COMMAND 是否存在" - command -v "$COMMAND" &>/dev/null - if [ $? -ne 0 ]; then - LOG_ERROR "命令 $COMMAND 不存在" - exit 255 - fi - - # 检查参数是否支持 - LOG_INFO "步骤5: 检查参数 $PARAMETER 是否支持" - "$COMMAND" --help 2>&1 | grep -q -- "$PARAMETER" - if [ $? -ne 0 ]; then - LOG_ERROR "参数 $PARAMETER 不被命令 $COMMAND 支持" - exit 255 - fi - - # 执行测试命令 - LOG_INFO "步骤6: 执行测试命令 $COMMAND $PARAMETER $TEST_VALUE" - "$COMMAND" "$PARAMETER" "$TEST_VALUE" &>/dev/null - CHECK_RESULT $? 0 0 "执行命令失败,参数或值不正确" - - # 环境清理 - LOG_INFO "步骤7: 清理环境" - if [ "$ORIGINAL_STATE" = "not_installed" ]; 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/texlive-base/texlive-ptex/test_texlive-ptex_makejvf_m.sh b/testcases/function_test/pkg_test/texlive-base/texlive-ptex/test_texlive-ptex_makejvf_m.sh deleted file mode 100644 index f476cff3a11..00000000000 --- a/testcases/function_test/pkg_test/texlive-base/texlive-ptex/test_texlive-ptex_makejvf_m.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-08 -# @License : Mulan PSL v2 -# @Desc : 测试竖排时使用分/秒符号替代引号 -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - # 检查是否已经安装了texlive-ptex软件包 - LOG_INFO "检查是否已经安装了texlive-ptex软件包" - rpm -q texlive-ptex - installed=$? - if [ $installed -eq 0 ]; then - LOG_INFO "texlive-ptex软件包已经安装,测试完成后将保持安装状态" - already_installed=true - else - LOG_INFO "texlive-ptex软件包未安装,将在测试过程中安装" - already_installed=false - fi - - # 检查yum源中是否有texlive-ptex软件包 - LOG_INFO "检查yum源中是否有texlive-ptex软件包" - dnf list available texlive-ptex - CHECK_RESULT $? 0 0 "yum源中没有texlive-ptex软件包" - if [ $? -ne 0 ]; then - LOG_ERROR "yum源中没有texlive-ptex软件包" - exit 255 - fi - - # 如果未安装,则安装texlive-ptex软件包 - if [ "$already_installed" = false ]; then - LOG_INFO "安装texlive-ptex软件包" - dnf install -y texlive-ptex - CHECK_RESULT $? 0 0 "安装texlive-ptex软件包失败" - fi - - # 检查makejvf命令是否存在 - LOG_INFO "检查makejvf命令是否存在" - which makejvf - CHECK_RESULT $? 0 0 "makejvf命令不存在" - if [ $? -ne 0 ]; then - LOG_ERROR "makejvf命令不存在" - exit 255 - fi - - # 测试竖排时使用分/秒符号替代引号 - LOG_INFO "测试竖排时使用分/秒符号替代引号" - echo "test" | makejvf -vertical -kanji=utf8 -output=/tmp/test.jvf - CHECK_RESULT $? 0 0 "makejvf命令执行失败" - - # 检查生成的jvf文件是否存在 - LOG_INFO "检查生成的jvf文件是否存在" - [ -f /tmp/test.jvf ] - CHECK_RESULT $? 0 0 "未生成jvf文件" - - # 清理测试文件 - LOG_INFO "清理测试文件" - rm -f /tmp/test.jvf - - # 如果测试前未安装,则在测试结束后卸载软件包 - if [ "$already_installed" = false ]; then - LOG_INFO "卸载texlive-ptex软件包" - dnf remove -y texlive-ptex - CHECK_RESULT $? 0 0 "卸载texlive-ptex软件包失败" - fi - - LOG_INFO "测试完成" -} - -main "$@" \ No newline at end of file diff --git a/testcases/function_test/pkg_test/texlive-base/texlive-ptex/test_texlive-ptex_makejvf_t_cnffile.sh b/testcases/function_test/pkg_test/texlive-base/texlive-ptex/test_texlive-ptex_makejvf_t_cnffile.sh deleted file mode 100644 index 54c584bbd34..00000000000 --- a/testcases/function_test/pkg_test/texlive-base/texlive-ptex/test_texlive-ptex_makejvf_t_cnffile.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-08 -# @License : Mulan PSL v2 -# @Desc : 测试使用指定的配置文件 -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - LOG_INFO "开始测试:测试使用指定的配置文件" - LOG_INFO "步骤1:检查环境中是否已安装texlive-ptex软件包" - rpm -q texlive-ptex > /dev/null 2>&1 - if [ $? -eq 0 ]; then - LOG_INFO "texlive-ptex已安装,将保持安装状态" - INSTALLED=true - else - LOG_INFO "texlive-ptex未安装,将在测试过程中安装" - INSTALLED=false - fi - - LOG_INFO "步骤2:检查yum源中是否存在texlive-ptex软件包" - dnf list available texlive-ptex > /dev/null 2>&1 - CHECK_RESULT $? 0 0 "yum源中不存在texlive-ptex软件包" - if [ $? -ne 0 ]; then - LOG_ERROR "yum源中不存在texlive-ptex软件包" - exit 255 - fi - - if [ "$INSTALLED" = false ]; then - LOG_INFO "步骤3:安装texlive-ptex软件包" - dnf install -y texlive-ptex - CHECK_RESULT $? 0 0 "安装texlive-ptex软件包失败" - fi - - LOG_INFO "步骤4:检查makejvf命令是否存在" - command -v makejvf > /dev/null 2>&1 - CHECK_RESULT $? 0 0 "makejvf命令不存在" - if [ $? -ne 0 ]; then - LOG_ERROR "makejvf命令不存在" - if [ "$INSTALLED" = false ]; then - LOG_INFO "清理环境:卸载texlive-ptex软件包" - dnf remove -y texlive-ptex - fi - exit 255 - fi - - LOG_INFO "步骤5:检查makejvf命令是否支持-c参数" - makejvf -h 2>&1 | grep -q "\-c" - CHECK_RESULT $? 0 0 "makejvf命令不支持-c参数" - if [ $? -ne 0 ]; then - LOG_ERROR "makejvf命令不支持-c参数" - if [ "$INSTALLED" = false ]; then - LOG_INFO "清理环境:卸载texlive-ptex软件包" - dnf remove -y texlive-ptex - fi - exit 255 - fi - - LOG_INFO "步骤6:创建测试配置文件" - cat > test_config.cnf << EOF - # 测试配置文件 - FontName TestFont - Encoding Unicode - EOF - CHECK_RESULT $? 0 0 "创建测试配置文件失败" - - LOG_INFO "步骤7:使用指定的配置文件执行makejvf命令" - makejvf -c test_config.cnf - CHECK_RESULT $? 0 0 "使用指定的配置文件执行makejvf命令失败" - - LOG_INFO "步骤8:清理测试配置文件" - rm -f test_config.cnf - CHECK_RESULT $? 0 0 "清理测试配置文件失败" - - if [ "$INSTALLED" = false ]; then - LOG_INFO "步骤9:清理环境:卸载texlive-ptex软件包" - dnf remove -y texlive-ptex - CHECK_RESULT $? 0 0 "卸载texlive-ptex软件包失败" - fi - - LOG_INFO "测试完成:测试使用指定的配置文件" -} - -main "$@" \ No newline at end of file diff --git a/testcases/function_test/pkg_test/texlive-base/texlive-ptex/test_texlive-ptex_makejvf_u_cns.sh b/testcases/function_test/pkg_test/texlive-base/texlive-ptex/test_texlive-ptex_makejvf_u_cns.sh deleted file mode 100644 index 9c63ece8fe3..00000000000 --- a/testcases/function_test/pkg_test/texlive-base/texlive-ptex/test_texlive-ptex_makejvf_u_cns.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 : 2026-03-08 -# @License : Mulan PSL v2 -# @Desc : 测试UCS模式下的CNS字符集 -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - LOG_INFO "开始测试UCS模式下的CNS字符集" - LOG_INFO "步骤1:检查环境是否已安装texlive-ptex软件包" - rpm -q texlive-ptex - if [ $? -eq 0 ]; then - LOG_INFO "texlive-ptex已安装,测试结束后保持安装状态" - INSTALLED=true - else - LOG_INFO "texlive-ptex未安装,将在测试过程中安装" - INSTALLED=false - fi - LOG_INFO "步骤2:检查yum源中是否有texlive-ptex软件包" - dnf list available texlive-ptex - CHECK_RESULT $? 0 0 "yum源中不存在texlive-ptex软件包" - if [ $? -ne 0 ]; then - LOG_ERROR "yum源中不存在texlive-ptex软件包" - exit 255 - fi - if [ "$INSTALLED" = false ]; then - LOG_INFO "步骤3:安装texlive-ptex软件包" - dnf install -y texlive-ptex - CHECK_RESULT $? 0 0 "安装texlive-ptex失败" - fi - LOG_INFO "步骤4:检查makejvf命令是否支持-U参数" - makejvf -h 2>&1 | grep -q "\-U" - CHECK_RESULT $? 0 0 "makejvf命令不支持-U参数" - if [ $? -ne 0 ]; then - LOG_ERROR "makejvf命令不支持-U参数" - exit 255 - fi - LOG_INFO "步骤5:执行makejvf -U cns命令测试UCS模式下的CNS字符集" - makejvf -U cns - CHECK_RESULT $? 0 0 "makejvf -U cns命令执行失败" - if [ "$INSTALLED" = false ]; then - LOG_INFO "步骤6:卸载texlive-ptex软件包" - dnf remove -y texlive-ptex - CHECK_RESULT $? 0 0 "卸载texlive-ptex失败" - fi - LOG_INFO "测试完成,环境已恢复" -} - -main "$@" \ No newline at end of file diff --git a/testcases/function_test/pkg_test/texlive-base/texlive-ptex/test_texlive-ptex_makejvf_u_custom.sh b/testcases/function_test/pkg_test/texlive-base/texlive-ptex/test_texlive-ptex_makejvf_u_custom.sh deleted file mode 100644 index 625de30a677..00000000000 --- a/testcases/function_test/pkg_test/texlive-base/texlive-ptex/test_texlive-ptex_makejvf_u_custom.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-03-08 -# @License : Mulan PSL v2 -# @Desc : 测试UCS模式下使用自定义字符集 -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - # 检查是否已安装texlive-ptex软件包 - LOG_INFO "检查是否已安装texlive-ptex软件包" - if dnf list installed texlive-ptex &>/dev/null; then - LOG_INFO "texlive-ptex已安装,测试结束将保持安装状态" - INSTALLED=1 - else - LOG_INFO "texlive-ptex未安装,测试将安装并测试后卸载" - INSTALLED=0 - fi - - # 检查yum源中是否有texlive-ptex软件包 - LOG_INFO "检查yum源中是否有texlive-ptex软件包" - if ! dnf list texlive-ptex &>/dev/null; then - LOG_ERROR "yum源中未找到texlive-ptex软件包" - exit 255 - fi - - # 如果未安装则安装软件包 - if [ $INSTALLED -eq 0 ]; then - LOG_INFO "安装texlive-ptex软件包" - dnf install -y texlive-ptex - CHECK_RESULT $? 0 0 "安装texlive-ptex失败" - fi - - # 测试UCS模式下使用自定义字符集 - LOG_INFO "测试UCS模式下使用自定义字符集" - - # 创建测试目录 - LOG_INFO "创建测试目录" - mkdir -p /tmp/texlive_test - cd /tmp/texlive_test || exit 1 - - # 创建自定义字符集文件 - LOG_INFO "创建自定义字符集文件" - cat > custom.map << "EOF" - % Custom character set mapping - jis-cjk Unicode-UTF8 - jis Unicode-UTF8 - EOF - - # 检查makejvf命令是否支持-c参数 - LOG_INFO "检查makejvf命令是否支持-c参数" - if ! makejvf --help 2>&1 | grep -q "\-c"; then - LOG_ERROR "makejvf命令不支持-c参数" - if [ $INSTALLED -eq 0 ]; then - LOG_INFO "卸载texlive-ptex软件包" - dnf remove -y texlive-ptex - fi - exit 255 - fi - - # 创建测试输入文件 - LOG_INFO "创建测试输入文件" - cat > test.tex << "EOF" - \documentclass{article} - \usepackage{ptex} - \begin{document} - 测试UCS模式下使用自定义字符集 - \end{document} - EOF - - # 使用自定义字符集运行makejvf命令 - LOG_INFO "使用自定义字符集运行makejvf命令" - makejvf -c custom.map test.tex - CHECK_RESULT $? 0 0 "makejvf在UCS模式下使用自定义字符集失败" - - # 检查生成的jvf文件 - LOG_INFO "检查生成的jvf文件" - if [ -f "test.jvf" ]; then - LOG_INFO "成功生成jvf文件" - file test.jvf - CHECK_RESULT $? 0 0 "生成的jvf文件无效" - else - LOG_ERROR "未生成jvf文件" - CHECK_RESULT 1 0 0 "未生成jvf文件" - fi - - # 清理测试文件 - LOG_INFO "清理测试文件" - cd /tmp && rm -rf texlive_test - - # 如果测试前未安装,则卸载软件包 - if [ $INSTALLED -eq 0 ]; then - LOG_INFO "卸载texlive-ptex软件包" - dnf remove -y texlive-ptex - CHECK_RESULT $? 0 0 "卸载texlive-ptex失败" - fi - - LOG_INFO "测试完成" -} - -main "$@" \ No newline at end of file diff --git a/testcases/function_test/pkg_test/texlive-base/texlive-ptex/test_texlive-ptex_makejvf_u_gb.sh b/testcases/function_test/pkg_test/texlive-base/texlive-ptex/test_texlive-ptex_makejvf_u_gb.sh deleted file mode 100644 index c962da58ccc..00000000000 --- a/testcases/function_test/pkg_test/texlive-base/texlive-ptex/test_texlive-ptex_makejvf_u_gb.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-08 -# @License : Mulan PSL v2 -# @Desc : 测试UCS模式下的GB字符集 -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - LOG_INFO "开始测试UCS模式下的GB字符集" - - LOG_INFO "步骤1: 检查是否已安装texlive-ptex软件包" - if dnf list installed texlive-ptex &>/dev/null; then - LOG_INFO "texlive-ptex已安装,测试结束后将保持安装状态" - INSTALLED=true - else - LOG_INFO "texlive-ptex未安装,将在测试中安装" - INSTALLED=false - fi - - LOG_INFO "步骤2: 检查yum源中是否有texlive-ptex软件包" - if ! dnf list available texlive-ptex &>/dev/null; then - LOG_ERROR "yum源中未找到texlive-ptex软件包" - exit 255 - fi - - if [ "$INSTALLED" = "false" ]; then - LOG_INFO "步骤3: 安装texlive-ptex软件包" - dnf install -y texlive-ptex - CHECK_RESULT $? 0 0 "安装texlive-ptex失败" - fi - - LOG_INFO "步骤4: 检查makejvf命令是否支持-G参数" - makejvf -h 2>&1 | grep -q "\-G" - CHECK_RESULT $? 0 0 "makejvf命令不支持-G参数" - if [ $? -ne 0 ]; then - LOG_ERROR "makejvf命令不支持-G参数" - exit 255 - fi - - LOG_INFO "步骤5: 测试UCS模式下的GB字符集" - TEST_FILE="test_gb.tex" - cat > "$TEST_FILE" << "EOF" - \documentclass{jsarticle} - \begin{document} - 测试GB字符集 - \end{document} - EOF - - makejvf -G gb "$TEST_FILE" - CHECK_RESULT $? 0 0 "makejvf在UCS模式下处理GB字符集失败" - - LOG_INFO "步骤6: 验证生成的jvf文件" - if [ -f "test_gb.jvf" ]; then - LOG_INFO "成功生成jvf文件" - else - LOG_ERROR "未生成jvf文件" - exit 1 - fi - - LOG_INFO "步骤7: 清理测试文件" - rm -f "$TEST_FILE" "test_gb.jvf" "test_gb.tfm" - - if [ "$INSTALLED" = "false" ]; then - LOG_INFO "步骤8: 卸载texlive-ptex软件包" - dnf remove -y texlive-ptex - CHECK_RESULT $? 0 0 "卸载texlive-ptex失败" - fi - - LOG_INFO "测试完成" -} - -main "$@" \ No newline at end of file diff --git a/testcases/function_test/pkg_test/texlive-base/texlive-ptex/test_texlive-ptex_makejvf_u_jis.sh b/testcases/function_test/pkg_test/texlive-base/texlive-ptex/test_texlive-ptex_makejvf_u_jis.sh deleted file mode 100644 index adf52802dd5..00000000000 --- a/testcases/function_test/pkg_test/texlive-base/texlive-ptex/test_texlive-ptex_makejvf_u_jis.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-08 -# @License : Mulan PSL v2 -# @Desc : 测试UCS模式下的JIS字符集 -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - # 环境初始化 - LOG_INFO "开始测试UCS模式下的JIS字符集" - - # 定义软件包名称 - PACKAGE_NAME="texlive-ptex" - - # 步骤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 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 "步骤3:安装软件包 $PACKAGE_NAME" - dnf install -y "$PACKAGE_NAME" - CHECK_RESULT $? 0 0 "安装软件包失败" - fi - - # 步骤4:检查makejvf命令是否支持UCS模式和JIS字符集参数 - LOG_INFO "步骤4:检查makejvf命令参数支持" - if ! makejvf --help 2>&1 | grep -q "UCS\|JIS"; then - LOG_ERROR "makejvf命令不支持UCS模式或JIS字符集参数" - exit 255 - fi - - # 步骤5:创建测试文件 - LOG_INFO "步骤5:创建测试文件" - TEST_FILE="test_jis.tex" - cat > "$TEST_FILE" << "EOF" - \documentclass{jsarticle} - \begin{document} - テスト用日本語テキスト - \end{document} - EOF - CHECK_RESULT $? 0 0 "创建测试文件失败" - - # 步骤6:使用makejvf命令处理测试文件 - LOG_INFO "步骤6:使用makejvf命令处理测试文件" - makejvf -kanji=jis "$TEST_FILE" - CHECK_RESULT $? 0 0 "makejvf命令执行失败" - - # 步骤7:验证生成的JIS字符集文件 - LOG_INFO "步骤7:验证生成的JIS字符集文件" - OUTPUT_FILE="${TEST_FILE%.tex}.jvf" - if [ -f "$OUTPUT_FILE" ]; then - LOG_INFO "成功生成JIS字符集文件: $OUTPUT_FILE" - # 可以添加进一步的验证,例如文件内容检查 - else - LOG_ERROR "未生成预期的JIS字符集文件" - exit 1 - fi - - # 步骤8:清理测试文件 - LOG_INFO "步骤8:清理测试文件" - rm -f "$TEST_FILE" "$OUTPUT_FILE" "${TEST_FILE%.tex}.dvi" - CHECK_RESULT $? 0 0 "清理测试文件失败" - - # 步骤9:环境恢复(卸载软件包,如果测试前未安装) - if [ "$INSTALLED_BEFORE" = false ]; then - LOG_INFO "步骤9:卸载软件包 $PACKAGE_NAME" - dnf remove -y "$PACKAGE_NAME" - CHECK_RESULT $? 0 0 "卸载软件包失败" - else - LOG_INFO "步骤9:保持软件包 $PACKAGE_NAME 安装状态" - fi - - LOG_INFO "测试UCS模式下的JIS字符集完成" -} - -main "$@" \ No newline at end of file diff --git a/testcases/function_test/pkg_test/texlive-base/texlive-ptex/test_texlive-ptex_makejvf_u_jisq.sh b/testcases/function_test/pkg_test/texlive-base/texlive-ptex/test_texlive-ptex_makejvf_u_jisq.sh deleted file mode 100644 index 7c5a0b05426..00000000000 --- a/testcases/function_test/pkg_test/texlive-base/texlive-ptex/test_texlive-ptex_makejvf_u_jisq.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-08 -# @License : Mulan PSL v2 -# @Desc : 测试UCS模式下仅JIS引号 -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - LOG_INFO "开始测试UCS模式下仅JIS引号" - LOG_INFO "步骤1: 检查texlive-ptex软件包是否在yum源中" - dnf list available texlive-ptex > /dev/null 2>&1 - if [ $? -ne 0 ]; then - LOG_ERROR "yum源中未找到texlive-ptex软件包" - exit 255 - fi - LOG_INFO "texlive-ptex软件包在yum源中存在" - - LOG_INFO "步骤2: 检查环境是否已安装texlive-ptex" - rpm -q texlive-ptex > /dev/null 2>&1 - if [ $? -eq 0 ]; then - LOG_INFO "texlive-ptex已安装,测试结束后将保持安装状态" - INSTALLED=true - else - LOG_INFO "texlive-ptex未安装,将在测试步骤中安装" - INSTALLED=false - fi - - if [ "$INSTALLED" = false ]; then - LOG_INFO "步骤3: 安装texlive-ptex软件包" - dnf install -y texlive-ptex - CHECK_RESULT $? 0 0 "安装texlive-ptex失败" - LOG_INFO "texlive-ptex安装成功" - fi - - LOG_INFO "步骤4: 执行测试命令,验证UCS模式下仅JIS引号" - command_to_test="makejvf -u -jisq test_input.txt test_output.jvf" - LOG_INFO "执行命令: $command_to_test" - $command_to_test - CHECK_RESULT $? 0 0 "执行makejvf命令失败,可能参数不存在或不支持" - LOG_INFO "测试命令执行成功" - - LOG_INFO "步骤5: 清理测试生成的文件" - if [ -f test_output.jvf ]; then - rm -f test_output.jvf - LOG_INFO "已删除test_output.jvf文件" - fi - - if [ "$INSTALLED" = false ]; then - LOG_INFO "步骤6: 卸载texlive-ptex软件包,恢复环境" - dnf remove -y texlive-ptex - CHECK_RESULT $? 0 0 "卸载texlive-ptex失败" - LOG_INFO "texlive-ptex卸载成功,环境已恢复" - else - LOG_INFO "步骤6: 环境已安装texlive-ptex,保持安装状态,无需卸载" - fi - - LOG_INFO "测试UCS模式下仅JIS引号完成" -} - -main "$@" \ No newline at end of file diff --git a/testcases/function_test/pkg_test/texlive-base/texlive-ptex/test_texlive-ptex_makejvf_u_ks.sh b/testcases/function_test/pkg_test/texlive-base/texlive-ptex/test_texlive-ptex_makejvf_u_ks.sh deleted file mode 100644 index f2da053ecb2..00000000000 --- a/testcases/function_test/pkg_test/texlive-base/texlive-ptex/test_texlive-ptex_makejvf_u_ks.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-08 -# @License : Mulan PSL v2 -# @Desc : 测试UCS模式下的KS字符集 -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - LOG_INFO "开始测试UCS模式下的KS字符集" - LOG_INFO "步骤1:检查环境是否已安装texlive-ptex软件包" - if dnf list installed texlive-ptex &> /dev/null; then - LOG_INFO "texlive-ptex已安装,脚本结束时将保持安装状态" - INSTALLED=true - else - LOG_INFO "texlive-ptex未安装,将在测试过程中安装" - INSTALLED=false - fi - - LOG_INFO "步骤2:检查yum源中是否有texlive-ptex软件包" - if ! dnf list available texlive-ptex &> /dev/null; then - LOG_ERROR "yum源中未找到texlive-ptex软件包" - exit 255 - fi - - LOG_INFO "步骤3:安装texlive-ptex软件包" - if [ "$INSTALLED" = false ]; then - dnf install -y texlive-ptex - CHECK_RESULT $? 0 0 "安装texlive-ptex失败" - fi - - LOG_INFO "步骤4:检查makejvf命令是否支持-U参数" - makejvf -h 2>&1 | grep -q "\-U" - CHECK_RESULT $? 0 0 "makejvf命令不支持-U参数" - - LOG_INFO "步骤5:检查makejvf命令是否支持-ks参数" - makejvf -h 2>&1 | grep -q "\-ks" - CHECK_RESULT $? 0 0 "makejvf命令不支持-ks参数" - - LOG_INFO "步骤6:执行makejvf命令测试UCS模式下的KS字符集" - echo "test" > test.txt - makejvf -U -ks test.txt test.vf 2>&1 - CHECK_RESULT $? 0 0 "makejvf命令执行失败" - - LOG_INFO "步骤7:验证生成的.vf文件" - if [ -f test.vf ]; then - LOG_INFO "成功生成test.vf文件" - else - LOG_ERROR "未生成test.vf文件" - exit 1 - fi - - LOG_INFO "步骤8:清理测试文件" - rm -f test.txt test.vf - - LOG_INFO "步骤9:根据初始状态决定是否卸载软件包" - if [ "$INSTALLED" = false ]; then - LOG_INFO "卸载texlive-ptex软件包" - dnf remove -y texlive-ptex - CHECK_RESULT $? 0 0 "卸载texlive-ptex失败" - fi - - LOG_INFO "测试完成" -} - -main "$@" \ No newline at end of file diff --git a/testcases/function_test/pkg_test/texlive-base/texlive-ptex/test_texlive-ptex_makejvf_upper_c.sh b/testcases/function_test/pkg_test/texlive-base/texlive-ptex/test_texlive-ptex_makejvf_upper_c.sh deleted file mode 100644 index e13d329cb7b..00000000000 --- a/testcases/function_test/pkg_test/texlive-base/texlive-ptex/test_texlive-ptex_makejvf_upper_c.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-08 -# @License : Mulan PSL v2 -# @Desc : 测试长体模式 -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - # 检查环境是否已安装texlive-ptex - LOG_INFO "检查环境是否已安装texlive-ptex" - rpm -qa | grep -q texlive-ptex - if [ $? -eq 0 ]; then - LOG_INFO "环境已安装texlive-ptex,测试结束后将保持安装状态" - INSTALLED=true - else - LOG_INFO "环境未安装texlive-ptex,测试结束后将卸载" - INSTALLED=false - fi - - # 检查yum源中是否有texlive-ptex软件包 - LOG_INFO "检查yum源中是否有texlive-ptex软件包" - dnf list available texlive-ptex &> /dev/null - if [ $? -ne 0 ]; then - LOG_ERROR "yum源中未找到texlive-ptex软件包" - exit 255 - fi - - # 如果未安装,则安装texlive-ptex - if [ "$INSTALLED" = false ]; then - LOG_INFO "安装texlive-ptex软件包" - dnf install -y texlive-ptex - CHECK_RESULT $? 0 0 "安装texlive-ptex失败" - fi - - # 测试长体模式 - LOG_INFO "测试长体模式" - makejvf -l testfont 10 - CHECK_RESULT $? 0 0 "长体模式测试失败" - - # 清理环境:如果测试前未安装,则卸载软件包 - if [ "$INSTALLED" = false ]; then - LOG_INFO "卸载texlive-ptex软件包" - dnf remove -y texlive-ptex - CHECK_RESULT $? 0 0 "卸载texlive-ptex失败" - fi - - LOG_INFO "测试完成" -} - -main "$@" \ No newline at end of file diff --git a/testcases/function_test/pkg_test/texlive-base/texlive-ptex/test_texlive-ptex_makejvf_upper_h.sh b/testcases/function_test/pkg_test/texlive-base/texlive-ptex/test_texlive-ptex_makejvf_upper_h.sh deleted file mode 100644 index b7ee4966088..00000000000 --- a/testcases/function_test/pkg_test/texlive-base/texlive-ptex/test_texlive-ptex_makejvf_upper_h.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-08 -# @License : Mulan PSL v2 -# @Desc : 测试在UCS模式下使用半角片假名 -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - LOG_INFO "开始测试:在UCS模式下使用半角片假名" - - # 定义软件包名称 - PACKAGE_NAME="texlive-ptex" - LOG_INFO "步骤1:检查软件包 ${PACKAGE_NAME} 是否已在系统中安装" - if dnf list installed ${PACKAGE_NAME} &>/dev/null; then - LOG_INFO "软件包 ${PACKAGE_NAME} 已安装,脚本结束前将保持安装状态" - INSTALLED_BEFORE=1 - else - LOG_INFO "软件包 ${PACKAGE_NAME} 未安装,将在测试过程中安装" - INSTALLED_BEFORE=0 - fi - - LOG_INFO "步骤2:检查yum源中是否存在软件包 ${PACKAGE_NAME}" - if ! dnf list available ${PACKAGE_NAME} &>/dev/null; then - LOG_ERROR "yum源中未找到软件包 ${PACKAGE_NAME}" - exit 255 - fi - - # 如果之前未安装,则安装软件包 - if [ ${INSTALLED_BEFORE} -eq 0 ]; then - LOG_INFO "步骤3:安装软件包 ${PACKAGE_NAME}" - dnf install -y ${PACKAGE_NAME} - CHECK_RESULT $? 0 0 "安装软件包 ${PACKAGE_NAME} 失败" - fi - - LOG_INFO "步骤4:检查 makejvf 命令是否可用" - if ! command -v makejvf &>/dev/null; then - LOG_ERROR "makejvf 命令不存在" - exit 255 - fi - - LOG_INFO "步骤5:测试 makejvf 命令是否支持 -u 参数" - makejvf -h 2>&1 | grep -q "\-u" - CHECK_RESULT $? 0 0 "makejvf 命令不支持 -u 参数" - - LOG_INFO "步骤6:测试在UCS模式下使用半角片假名" - TEST_INPUT="アイウエオ" - EXPECTED_OUTPUT="半角片假名测试" - LOG_INFO "测试输入:${TEST_INPUT}" - LOG_INFO "预期输出包含:${EXPECTED_OUTPUT}" - - # 由于实际测试需要具体的输入文件,这里使用一个简单的测试命令 - # 实际应根据测试用例要求构造输入文件并调用 makejvf -u - echo "${TEST_INPUT}" > test_input.txt - makejvf -u test_input.txt test_output.jvf 2>&1 | grep -q "${EXPECTED_OUTPUT}" - CHECK_RESULT $? 0 0 "在UCS模式下使用半角片假名测试失败" - - LOG_INFO "步骤7:清理测试文件" - rm -f test_input.txt test_output.jvf - - # 如果之前未安装,则卸载软件包 - if [ ${INSTALLED_BEFORE} -eq 0 ]; then - LOG_INFO "步骤8:卸载软件包 ${PACKAGE_NAME}" - dnf remove -y ${PACKAGE_NAME} - CHECK_RESULT $? 0 0 "卸载软件包 ${PACKAGE_NAME} 失败" - else - LOG_INFO "步骤8:软件包 ${PACKAGE_NAME} 在测试前已安装,保持安装状态" - fi - - LOG_INFO "测试完成:在UCS模式下使用半角片假名" -} - -main "$@" \ No newline at end of file diff --git a/testcases/function_test/pkg_test/texlive-base/texlive-ptex/test_texlive-ptex_makejvf_upper_j_upper_ps_tfm.sh b/testcases/function_test/pkg_test/texlive-base/texlive-ptex/test_texlive-ptex_makejvf_upper_j_upper_ps_tfm.sh deleted file mode 100644 index 8f178a2166f..00000000000 --- a/testcases/function_test/pkg_test/texlive-base/texlive-ptex/test_texlive-ptex_makejvf_upper_j_upper_ps_tfm.sh +++ /dev/null @@ -1,123 +0,0 @@ -#!/usr/bin/bash - -# Copyright (c) 2024 ISCAS .ALL rights reserved. -# This program is licensed under Mulan PSL v2. -# You can use it according to the terms and conditions of the Mulan PSL v2. -# http://license.coscl.org.cn/MulanPSL2 -# THIS PROGRAM IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, -# EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, -# MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. -# See the Mulan PSL v2 for more details. - -# ############################################# -# @Author : honghua -# @Contact : honghua@iscas.ac.cn -# @Date : 2026-03-08 -# @License : Mulan PSL v2 -# @Desc : 测试在UCS模式下将引号映射到另一个JIS编码的PS字体TFM -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - # 判断是否已安装texlive-ptex - LOG_INFO "检查是否已安装texlive-ptex" - rpm -q texlive-ptex - if [ $? -eq 0 ]; then - LOG_INFO "texlive-ptex已安装,测试结束后保持安装状态" - INSTALLED=1 - else - LOG_INFO "texlive-ptex未安装,将在测试过程中安装" - INSTALLED=0 - fi - - # 检查yum源中是否有texlive-ptex软件包 - LOG_INFO "检查yum源中是否有texlive-ptex软件包" - dnf list available texlive-ptex > /dev/null 2>&1 - if [ $? -ne 0 ]; then - LOG_ERROR "yum源中未找到texlive-ptex软件包" - exit 255 - fi - - # 如果未安装,则安装texlive-ptex - if [ $INSTALLED -eq 0 ]; then - LOG_INFO "安装texlive-ptex" - dnf install -y texlive-ptex - CHECK_RESULT $? 0 0 "安装texlive-ptex失败" - fi - - # 检查makejvf命令是否存在 - LOG_INFO "检查makejvf命令是否存在" - which makejvf > /dev/null 2>&1 - if [ $? -ne 0 ]; then - LOG_ERROR "makejvf命令不存在" - if [ $INSTALLED -eq 0 ]; then - dnf remove -y texlive-ptex - fi - exit 255 - fi - - # 测试makejvf命令的-U和-P参数是否存在 - LOG_INFO "检查makejvf命令是否支持-U和-P参数" - makejvf --help | grep -q -- "-U" - if [ $? -ne 0 ]; then - LOG_ERROR "makejvf命令不支持-U参数" - if [ $INSTALLED -eq 0 ]; then - dnf remove -y texlive-ptex - fi - exit 255 - fi - - makejvf --help | grep -q -- "-P" - if [ $? -ne 0 ]; then - LOG_ERROR "makejvf命令不支持-P参数" - if [ $INSTALLED -eq 0 ]; then - dnf remove -y texlive-ptex - fi - exit 255 - fi - - # 创建测试目录和文件 - LOG_INFO "创建测试目录和文件" - TEST_DIR=$(mktemp -d) - cd $TEST_DIR - - # 创建测试输入文件 - LOG_INFO "创建测试输入文件" - cat > test_input.txt << EOF - test content for makejvf - EOF - - # 执行makejvf命令测试UCS模式下将引号映射到另一个JIS编码的PS字体TFM - LOG_INFO "执行makejvf命令测试UCS模式下将引号映射到另一个JIS编码的PS字体TFM" - makejvf -U -P test_output test_input.txt - CHECK_RESULT $? 0 0 "makejvf命令执行失败" - - # 检查输出文件是否生成 - LOG_INFO "检查输出文件是否生成" - if [ -f "test_output.tfm" ]; then - LOG_INFO "成功生成TFM文件" - else - LOG_ERROR "未生成TFM文件" - if [ $INSTALLED -eq 0 ]; then - dnf remove -y texlive-ptex - fi - exit 1 - fi - - # 清理测试目录 - LOG_INFO "清理测试目录" - cd / - rm -rf $TEST_DIR - - # 如果测试前未安装,则卸载texlive-ptex - if [ $INSTALLED -eq 0 ]; then - LOG_INFO "卸载texlive-ptex" - dnf remove -y texlive-ptex - CHECK_RESULT $? 0 0 "卸载texlive-ptex失败" - fi - - LOG_INFO "测试完成" -} - -main "$@" \ No newline at end of file diff --git a/testcases/function_test/pkg_test/texlive-base/texlive-ptex/test_texlive-ptex_makejvf_upper_k_upper_ps_tfm.sh b/testcases/function_test/pkg_test/texlive-base/texlive-ptex/test_texlive-ptex_makejvf_upper_k_upper_ps_tfm.sh deleted file mode 100644 index 368e72aafd8..00000000000 --- a/testcases/function_test/pkg_test/texlive-base/texlive-ptex/test_texlive-ptex_makejvf_upper_k_upper_ps_tfm.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-08 -# @License : Mulan PSL v2 -# @Desc : 测试为非汉字部分指定PS字体TFM -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - LOG_INFO "开始测试为非汉字部分指定PS字体TFM" - LOG_INFO "步骤1:检查环境中是否已安装texlive-ptex软件包" - rpm -q texlive-ptex > /dev/null 2>&1 - if [ $? -eq 0 ]; then - LOG_INFO "texlive-ptex已安装,测试结束后将保持安装状态" - already_installed=true - else - LOG_INFO "texlive-ptex未安装,将在测试过程中安装" - already_installed=false - fi - - LOG_INFO "步骤2:检查yum源中是否存在texlive-ptex软件包" - dnf list available texlive-ptex > /dev/null 2>&1 - CHECK_RESULT $? 0 0 "yum源中未找到texlive-ptex软件包" - if [ $? -ne 0 ]; then - LOG_ERROR "yum源中不存在texlive-ptex软件包,退出测试" - exit 255 - fi - - if [ "$already_installed" = false ]; then - LOG_INFO "步骤3:安装texlive-ptex软件包" - dnf install -y texlive-ptex - CHECK_RESULT $? 0 0 "安装texlive-ptex软件包失败" - fi - - LOG_INFO "步骤4:检查makejvf命令是否支持-upper-k-ps-tfm参数" - makejvf --help 2>&1 | grep -q "\-upper-k-ps-tfm" - CHECK_RESULT $? 0 0 "makejvf命令不支持-upper-k-ps-tfm参数" - if [ $? -ne 0 ]; then - LOG_ERROR "makejvf命令不支持-upper-k-ps-tfm参数,退出测试" - if [ "$already_installed" = false ]; then - dnf remove -y texlive-ptex - fi - exit 255 - fi - - LOG_INFO "步骤5:执行makejvf命令为非汉字部分指定PS字体TFM" - makejvf -upper-k-ps-tfm > /dev/null 2>&1 - CHECK_RESULT $? 0 0 "执行makejvf命令失败" - - LOG_INFO "步骤6:清理测试环境" - if [ "$already_installed" = false ]; then - LOG_INFO "卸载在测试过程中安装的texlive-ptex软件包" - dnf remove -y texlive-ptex - CHECK_RESULT $? 0 0 "卸载texlive-ptex软件包失败" - else - LOG_INFO "测试前已安装texlive-ptex,保持安装状态" - fi - - LOG_INFO "测试为非汉字部分指定PS字体TFM完成" -} - -main "$@" \ No newline at end of file diff --git a/testcases/function_test/pkg_test/texlive-base/texlive-ptex/test_texlive-ptex_makejvf_upper_o.sh b/testcases/function_test/pkg_test/texlive-base/texlive-ptex/test_texlive-ptex_makejvf_upper_o.sh deleted file mode 100644 index bcb36e0fdc5..00000000000 --- a/testcases/function_test/pkg_test/texlive-base/texlive-ptex/test_texlive-ptex_makejvf_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-08 -# @License : Mulan PSL v2 -# @Desc : 测试省略具有默认度量的字符的VF条目 -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - LOG_INFO "开始测试:测试省略具有默认度量的字符的VF条目" - LOG_INFO "检查texlive-ptex软件包是否在yum源中" - dnf list available texlive-ptex > /dev/null 2>&1 - if [ $? -ne 0 ]; then - LOG_ERROR "yum源中未找到texlive-ptex软件包" - exit 255 - fi - - LOG_INFO "检查系统是否已安装texlive-ptex" - rpm -q texlive-ptex > /dev/null 2>&1 - if [ $? -eq 0 ]; then - INSTALLED=1 - LOG_INFO "texlive-ptex已安装,测试结束后将保持安装状态" - else - INSTALLED=0 - LOG_INFO "texlive-ptex未安装,将进行安装作为测试步骤" - fi - - if [ $INSTALLED -eq 0 ]; then - LOG_INFO "安装texlive-ptex软件包" - dnf install -y texlive-ptex - CHECK_RESULT $? 0 0 "安装texlive-ptex失败" - fi - - LOG_INFO "检查makejvf命令是否可用" - command -v makejvf > /dev/null 2>&1 - if [ $? -ne 0 ]; then - LOG_ERROR "makejvf命令不存在" - if [ $INSTALLED -eq 0 ]; then - dnf remove -y texlive-ptex - fi - exit 255 - fi - - LOG_INFO "测试makejvf命令的-o参数是否支持" - makejvf --help 2>&1 | grep -q "\-o" - if [ $? -ne 0 ]; then - LOG_ERROR "makejvf命令不支持-o参数" - if [ $INSTALLED -eq 0 ]; then - dnf remove -y texlive-ptex - fi - exit 255 - fi - - LOG_INFO "执行测试命令:makejvf -o test.vf test.tfm" - echo "dummy" > test.tfm - makejvf -o test.vf test.tfm - CHECK_RESULT $? 0 0 "makejvf命令执行失败" - - LOG_INFO "检查生成的test.vf文件" - if [ -f test.vf ]; then - LOG_INFO "成功生成test.vf文件" - else - LOG_ERROR "未生成test.vf文件" - CHECK_RESULT 1 0 1 "VF文件生成失败" - fi - - LOG_INFO "清理测试生成的文件" - rm -f test.tfm test.vf - - if [ $INSTALLED -eq 0 ]; then - LOG_INFO "卸载texlive-ptex软件包" - dnf remove -y texlive-ptex - CHECK_RESULT $? 0 0 "卸载texlive-ptex失败" - fi - - LOG_INFO "测试完成" -} - -main "$@" \ No newline at end of file diff --git a/testcases/function_test/pkg_test/texlive-base/texlive-ptex/test_texlive-ptex_makejvf_upper_u_upper_ps_tfm.sh b/testcases/function_test/pkg_test/texlive-base/texlive-ptex/test_texlive-ptex_makejvf_upper_u_upper_ps_tfm.sh deleted file mode 100644 index f1f3f252952..00000000000 --- a/testcases/function_test/pkg_test/texlive-base/texlive-ptex/test_texlive-ptex_makejvf_upper_u_upper_ps_tfm.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-08 -# @License : Mulan PSL v2 -# @Desc : 测试在UCS模式下将引号映射到另一个UCS编码的PS字体TFM -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - LOG_INFO "开始测试:测试在UCS模式下将引号映射到另一个UCS编码的PS字体TFM" - - # 检查是否已经安装了texlive-ptex软件包 - LOG_INFO "检查texlive-ptex软件包是否已安装" - rpm -q texlive-ptex > /dev/null 2>&1 - if [ $? -eq 0 ]; then - LOG_INFO "texlive-ptex软件包已安装,测试结束后保持安装状态" - already_installed=1 - else - LOG_INFO "texlive-ptex软件包未安装,将在测试过程中安装" - already_installed=0 - fi - - # 检查yum源中是否有texlive-ptex软件包 - LOG_INFO "检查yum源中是否有texlive-ptex软件包" - dnf list available texlive-ptex > /dev/null 2>&1 - CHECK_RESULT $? 0 0 "yum源中未找到texlive-ptex软件包" - if [ $? -ne 0 ]; then - LOG_ERROR "yum源中未找到texlive-ptex软件包,退出测试" - exit 255 - fi - - # 如果未安装,则安装texlive-ptex软件包 - if [ $already_installed -eq 0 ]; then - LOG_INFO "安装texlive-ptex软件包" - dnf install -y texlive-ptex - CHECK_RESULT $? 0 0 "安装texlive-ptex软件包失败" - fi - - # 检查makejvf命令是否支持-upper-u-ps-tfm参数 - LOG_INFO "检查makejvf命令是否支持-upper-u-ps-tfm参数" - makejvf --help 2>&1 | grep -q "\-upper-u-ps-tfm" - CHECK_RESULT $? 0 0 "makejvf命令不支持-upper-u-ps-tfm参数" - if [ $? -ne 0 ]; then - LOG_ERROR "makejvf命令不支持-upper-u-ps-tfm参数,退出测试" - exit 255 - fi - - # 执行测试命令:在UCS模式下将引号映射到另一个UCS编码的PS字体TFM - LOG_INFO "执行测试命令:在UCS模式下将引号映射到另一个UCS编码的PS字体TFM" - makejvf -upper-u-ps-tfm > /dev/null 2>&1 - CHECK_RESULT $? 0 0 "执行makejvf -upper-u-ps-tfm命令失败" - - # 清理环境:如果测试前未安装texlive-ptex,则卸载 - if [ $already_installed -eq 0 ]; then - LOG_INFO "卸载texlive-ptex软件包" - dnf remove -y texlive-ptex - CHECK_RESULT $? 0 0 "卸载texlive-ptex软件包失败" - fi - - LOG_INFO "测试完成:测试在UCS模式下将引号映射到另一个UCS编码的PS字体TFM" -} - -main "$@" \ No newline at end of file diff --git a/testcases/function_test/pkg_test/texlive-base/texlive-ptex/test_texlive-ptex_mendex_c.sh b/testcases/function_test/pkg_test/texlive-base/texlive-ptex/test_texlive-ptex_mendex_c.sh deleted file mode 100644 index 4b36e5b30fc..00000000000 --- a/testcases/function_test/pkg_test/texlive-base/texlive-ptex/test_texlive-ptex_mendex_c.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-08 -# @License : Mulan PSL v2 -# @Desc : 测试压缩空白字符(忽略首尾空白) -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - LOG_INFO "开始测试:压缩空白字符(忽略首尾空白)" - - # 检查软件包是否已在系统中安装 - LOG_INFO "检查系统中是否已安装texlive-ptex_mendex_c" - if rpm -q texlive-ptex_mendex_c &>/dev/null; then - LOG_INFO "软件包已安装,脚本结束后将保持安装状态" - INSTALLED_BEFORE=1 - else - LOG_INFO "软件包未安装,将在测试过程中安装" - INSTALLED_BEFORE=0 - fi - - # 检查yum源中是否存在软件包 - LOG_INFO "检查yum源中是否有texlive-ptex_mendex_c软件包" - if ! dnf list available texlive-ptex_mendex_c &>/dev/null; then - LOG_ERROR "yum源中未找到texlive-ptex_mendex_c软件包" - exit 255 - fi - - # 如果未安装,则安装软件包 - if [ $INSTALLED_BEFORE -eq 0 ]; then - LOG_INFO "安装texlive-ptex_mendex_c软件包" - dnf install -y texlive-ptex_mendex_c - CHECK_RESULT $? 0 0 "安装texlive-ptex_mendex_c失败" - fi - - # 测试压缩空白字符功能 - LOG_INFO "测试mendex命令的压缩空白字符参数" - # 创建测试输入文件 - cat > test_input.idx << EOF - test entry 1 - test entry 2 - test entry 3 - EOF - - # 检查mendex命令是否支持压缩空白字符参数 - LOG_INFO "检查mendex命令参数支持" - mendex -h 2>&1 | grep -q "compress" - if [ $? -ne 0 ]; then - LOG_ERROR "mendex命令不支持压缩空白字符参数" - # 清理临时文件 - rm -f test_input.idx - # 如果之前未安装,则卸载软件包 - if [ $INSTALLED_BEFORE -eq 0 ]; then - LOG_INFO "卸载texlive-ptex_mendex_c软件包" - dnf remove -y texlive-ptex_mendex_c - fi - exit 255 - fi - - # 执行mendex命令压缩空白字符 - LOG_INFO "执行mendex命令进行空白字符压缩" - mendex -c test_input.idx -o test_output.idx - CHECK_RESULT $? 0 0 "mendex命令执行失败" - - # 验证输出文件是否创建成功 - LOG_INFO "验证输出文件" - if [ -f test_output.idx ]; then - LOG_INFO "输出文件创建成功" - # 检查文件内容,验证空白字符是否被压缩 - original_lines=$(wc -l < test_input.idx) - compressed_lines=$(wc -l < test_output.idx) - LOG_INFO "原始文件行数:$original_lines,压缩后行数:$compressed_lines" - else - LOG_ERROR "输出文件未创建" - CHECK_RESULT 1 0 0 "输出文件验证失败" - fi - - # 清理临时文件 - LOG_INFO "清理临时文件" - rm -f test_input.idx test_output.idx - CHECK_RESULT $? 0 0 "临时文件清理失败" - - # 恢复环境:如果之前未安装,则卸载软件包 - if [ $INSTALLED_BEFORE -eq 0 ]; then - LOG_INFO "卸载texlive-ptex_mendex_c软件包" - dnf remove -y texlive-ptex_mendex_c - CHECK_RESULT $? 0 0 "卸载texlive-ptex_mendex_c失败" - else - LOG_INFO "保持软件包安装状态" - fi - - LOG_INFO "测试完成:压缩空白字符(忽略首尾空白)" -} - -main "$@" \ No newline at end of file diff --git a/testcases/function_test/pkg_test/texlive-base/texlive-ptex/test_texlive-ptex_mendex_d_dic.sh b/testcases/function_test/pkg_test/texlive-base/texlive-ptex/test_texlive-ptex_mendex_d_dic.sh deleted file mode 100644 index c7108e20e25..00000000000 --- a/testcases/function_test/pkg_test/texlive-base/texlive-ptex/test_texlive-ptex_mendex_d_dic.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-08 -# @License : Mulan PSL v2 -# @Desc : 测试指定字典文件 -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - # 检查是否已安装texlive-ptex-mendex-d-dic软件包 - LOG_INFO "检查texlive-ptex-mendex-d-dic软件包是否已安装" - if dnf list installed texlive-ptex-mendex-d-dic &> /dev/null; then - LOG_INFO "texlive-ptex-mendex-d-dic软件包已安装,脚本结束时将保持安装状态" - already_installed=true - else - LOG_INFO "texlive-ptex-mendex-d-dic软件包未安装,将在测试过程中安装" - already_installed=false - fi - - # 检查yum源中是否有texlive-ptex-mendex-d-dic软件包 - LOG_INFO "检查yum源中是否存在texlive-ptex-mendex-d-dic软件包" - if ! dnf list available texlive-ptex-mendex-d-dic &> /dev/null; then - LOG_ERROR "yum源中不存在texlive-ptex-mendex-d-dic软件包" - exit 255 - fi - - # 如果未安装,则安装软件包 - if [ "$already_installed" = false ]; then - LOG_INFO "安装texlive-ptex-mendex-d-dic软件包" - dnf install -y texlive-ptex-mendex-d-dic - CHECK_RESULT $? 0 0 "安装texlive-ptex-mendex-d-dic软件包失败" - fi - - # 测试指定字典文件 - LOG_INFO "测试指定字典文件功能" - # 检查mendex命令是否支持-d参数 - LOG_INFO "检查mendex命令是否支持-d参数" - mendex -h 2>&1 | grep -q -- "-d" - CHECK_RESULT $? 0 0 "mendex命令不支持-d参数" - - # 创建测试字典文件 - LOG_INFO "创建测试字典文件" - cat > test_dict.dic << EOF - word1 - word2 - word3 - EOF - CHECK_RESULT $? 0 0 "创建测试字典文件失败" - - # 创建测试索引文件 - LOG_INFO "创建测试索引文件" - cat > test.idx << EOF - \indexentry{word1}{1} - \indexentry{word2}{2} - \indexentry{word3}{3} - EOF - CHECK_RESULT $? 0 0 "创建测试索引文件失败" - - # 使用指定字典文件运行mendex命令 - LOG_INFO "使用指定字典文件运行mendex命令" - mendex -d test_dict.dic -o test.ind test.idx - CHECK_RESULT $? 0 0 "使用指定字典文件运行mendex命令失败" - - # 检查生成的索引文件 - LOG_INFO "检查生成的索引文件" - if [ -f test.ind ]; then - LOG_INFO "成功生成索引文件test.ind" - # 检查索引文件内容 - grep -q "word1" test.ind - CHECK_RESULT $? 0 0 "生成的索引文件内容不正确" - else - LOG_ERROR "未生成索引文件test.ind" - exit 1 - fi - - # 清理测试文件 - LOG_INFO "清理测试文件" - rm -f test_dict.dic test.idx test.ind - CHECK_RESULT $? 0 0 "清理测试文件失败" - - # 恢复环境:如果脚本开始时未安装,则卸载软件包 - if [ "$already_installed" = false ]; then - LOG_INFO "卸载texlive-ptex-mendex-d-dic软件包" - dnf remove -y texlive-ptex-mendex-d-dic - CHECK_RESULT $? 0 0 "卸载texlive-ptex-mendex-d-dic软件包失败" - LOG_INFO "环境已恢复到初始状态" - else - LOG_INFO "保持texlive-ptex-mendex-d-dic软件包安装状态" - fi - - LOG_INFO "测试指定字典文件功能完成" -} - -main "$@" \ No newline at end of file diff --git a/testcases/function_test/pkg_test/texlive-base/texlive-ptex/test_texlive-ptex_mendex_f.sh b/testcases/function_test/pkg_test/texlive-base/texlive-ptex/test_texlive-ptex_mendex_f.sh deleted file mode 100644 index f4857e286f8..00000000000 --- a/testcases/function_test/pkg_test/texlive-base/texlive-ptex/test_texlive-ptex_mendex_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-08 -# @License : Mulan PSL v2 -# @Desc : 测试强制输出汉字 -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - LOG_INFO "开始测试:测试强制输出汉字" - - # 检查yum源中是否存在texlive-ptex和mendex软件包 - LOG_INFO "检查yum源中是否存在texlive-ptex和mendex软件包" - dnf list available texlive-ptex 2>/dev/null | grep -q texlive-ptex - if [ $? -ne 0 ]; then - LOG_ERROR "yum源中不存在texlive-ptex软件包" - exit 255 - fi - - dnf list available mendex 2>/dev/null | grep -q mendex - if [ $? -ne 0 ]; then - LOG_ERROR "yum源中不存在mendex软件包" - exit 255 - fi - - # 检查是否已经安装texlive-ptex和mendex - LOG_INFO "检查是否已经安装texlive-ptex和mendex" - rpm -q texlive-ptex > /dev/null 2>&1 - texlive_installed=$? - rpm -q mendex > /dev/null 2>&1 - mendex_installed=$? - - # 如果未安装,则进行安装 - if [ $texlive_installed -ne 0 ] || [ $mendex_installed -ne 0 ]; then - LOG_INFO "未完全安装,开始安装texlive-ptex和mendex" - dnf install -y texlive-ptex mendex - CHECK_RESULT $? 0 0 "安装texlive-ptex和mendex失败" - # 标记为测试安装,需要在测试结束后卸载 - test_install=1 - else - LOG_INFO "texlive-ptex和mendex已经安装" - test_install=0 - fi - - # 测试强制输出汉字 - LOG_INFO "测试强制输出汉字" - # 创建一个简单的TeX文件来测试强制输出汉字 - cat > test_hanzi.tex << "EOF" - \documentclass{article} - \usepackage{CJKutf8} - \begin{document} - \begin{CJK}{UTF8}{gbsn} - 这是一个测试,强制输出汉字。 - \end{CJK} - \end{document} - EOF - - # 使用ptex命令处理TeX文件 - ptex test_hanzi.tex - CHECK_RESULT $? 0 0 "ptex处理TeX文件失败" - - # 检查生成的DVI文件 - if [ -f test_hanzi.dvi ]; then - LOG_INFO "成功生成DVI文件" - else - LOG_ERROR "未生成DVI文件" - exit 1 - fi - - # 清理测试文件 - LOG_INFO "清理测试文件" - rm -f test_hanzi.tex test_hanzi.dvi test_hanzi.log test_hanzi.aux - - # 恢复环境:如果测试前未安装,则卸载安装的软件包 - if [ $test_install -eq 1 ]; then - LOG_INFO "卸载测试安装的texlive-ptex和mendex" - dnf remove -y texlive-ptex mendex - CHECK_RESULT $? 0 0 "卸载texlive-ptex和mendex失败" - else - LOG_INFO "保持原有安装状态,不卸载软件包" - fi - - LOG_INFO "测试完成:测试强制输出汉字" -} - -main "$@" \ No newline at end of file diff --git a/testcases/function_test/pkg_test/texlive-base/texlive-ptex/test_texlive-ptex_mendex_g.sh b/testcases/function_test/pkg_test/texlive-base/texlive-ptex/test_texlive-ptex_mendex_g.sh deleted file mode 100644 index b86a9c8d638..00000000000 --- a/testcases/function_test/pkg_test/texlive-base/texlive-ptex/test_texlive-ptex_mendex_g.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-08 -# @License : Mulan PSL v2 -# @Desc : 测试生成日语索引头<あかさたなはまやらわ> -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - # 环境初始化检查 - LOG_INFO "检查是否已安装texlive-ptex-mendex-g软件包" - rpm -q texlive-ptex-mendex-g > /dev/null 2>&1 - if [ $? -eq 0 ]; then - LOG_INFO "检测到texlive-ptex-mendex-g已安装,脚本结束后将保持安装状态" - INSTALLED_BEFORE="yes" - else - LOG_INFO "未检测到texlive-ptex-mendex-g安装,将在测试后卸载" - INSTALLED_BEFORE="no" - fi - - # 检查yum源中是否存在软件包 - LOG_INFO "检查yum源中是否存在texlive-ptex-mendex-g软件包" - dnf list available texlive-ptex-mendex-g > /dev/null 2>&1 - if [ $? -ne 0 ]; then - LOG_ERROR "yum源中未找到texlive-ptex-mendex-g软件包" - exit 255 - fi - - # 如果未安装则安装软件包 - if [ "$INSTALLED_BEFORE" = "no" ]; then - LOG_INFO "开始安装texlive-ptex-mendex-g软件包" - dnf install -y texlive-ptex-mendex-g - CHECK_RESULT $? 0 0 "安装texlive-ptex-mendex-g失败" - fi - - # 测试mendex命令是否存在 - LOG_INFO "检查mendex命令是否可用" - which mendex > /dev/null 2>&1 - CHECK_RESULT $? 0 0 "mendex命令不存在" - - # 测试生成日语索引头<あかさたなはまやらわ> - LOG_INFO "测试生成日语索引头<あかさたなはまやらわ>" - - # 创建测试输入文件 - cat > test_input.idx << EOF - \indexentry{あいうえお}{1} - \indexentry{かきくけこ}{2} - \indexentry{さしすせそ}{3} - \indexentry{たちつてと}{4} - \indexentry{なにぬねの}{5} - \indexentry{はひふへほ}{6} - \indexentry{まみむめも}{7} - \indexentry{やゆよ}{8} - \indexentry{らりるれろ}{9} - \indexentry{わをん}{10} - EOF - - # 执行mendex命令生成索引 - mendex -s test.ist -o test_output.ind test_input.idx - CHECK_RESULT $? 0 0 "mendex命令执行失败" - - # 检查生成的输出文件 - LOG_INFO "检查生成的索引文件" - if [ -f test_output.ind ]; then - LOG_INFO "成功生成索引文件test_output.ind" - - # 检查是否包含日语索引头 - grep -q "あかさたなはまやらわ" test_output.ind - CHECK_RESULT $? 0 0 "生成的索引文件不包含日语索引头<あかさたなはまやらわ>" - else - LOG_ERROR "未找到生成的索引文件test_output.ind" - exit 1 - fi - - # 清理测试文件 - LOG_INFO "清理测试文件" - rm -f test_input.idx test_output.ind test.ist - - # 环境恢复 - if [ "$INSTALLED_BEFORE" = "no" ]; then - LOG_INFO "卸载texlive-ptex-mendex-g软件包" - dnf remove -y texlive-ptex-mendex-g - CHECK_RESULT $? 0 0 "卸载texlive-ptex-mendex-g失败" - else - LOG_INFO "保持texlive-ptex-mendex-g安装状态" - fi -} - -main "$@" \ No newline at end of file diff --git a/testcases/function_test/pkg_test/texlive-base/texlive-ptex/test_texlive-ptex_mendex_i.sh b/testcases/function_test/pkg_test/texlive-base/texlive-ptex/test_texlive-ptex_mendex_i.sh deleted file mode 100644 index 05d7b7c08cf..00000000000 --- a/testcases/function_test/pkg_test/texlive-base/texlive-ptex/test_texlive-ptex_mendex_i.sh +++ /dev/null @@ -1,81 +0,0 @@ -#!/usr/bin/bash - -# Copyright (c) 2024 ISCAS .ALL rights reserved. -# This program is licensed under Mulan PSL v2. -# You can use it according to the terms and conditions of the Mulan PSL v2. -# http://license.coscl.org.cn/MulanPSL2 -# THIS PROGRAM IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, -# EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, -# MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. -# See the Mulan PSL v2 for more details. - -# ############################################# -# @Author : honghua -# @Contact : honghua@iscas.ac.cn -# @Date : 2026-03-08 -# @License : Mulan PSL v2 -# @Desc : 测试使用标准输入作为输入文件 -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - # 检查是否已安装texlive-ptex-mendex软件包 - LOG_INFO "检查texlive-ptex-mendex是否已安装" - rpm -q texlive-ptex-mendex > /dev/null 2>&1 - if [ $? -eq 0 ]; then - LOG_INFO "texlive-ptex-mendex已安装" - installed=true - else - LOG_INFO "texlive-ptex-mendex未安装" - installed=false - fi - - # 检查yum源中是否有该软件包 - LOG_INFO "检查yum源中是否有texlive-ptex-mendex软件包" - dnf list available texlive-ptex-mendex > /dev/null 2>&1 - CHECK_RESULT $? 0 0 "yum源中未找到texlive-ptex-mendex软件包" - - # 如果未安装,则安装软件包 - if [ "$installed" = "false" ]; then - LOG_INFO "开始安装texlive-ptex-mendex" - dnf install -y texlive-ptex-mendex - CHECK_RESULT $? 0 0 "安装texlive-ptex-mendex失败" - LOG_INFO "安装texlive-ptex-mendex成功" - fi - - # 测试使用标准输入作为输入文件 - LOG_INFO "测试mendex命令使用标准输入作为输入文件" - echo "test1\ntest2\ntest3" | mendex -o test.idx > /dev/null 2>&1 - CHECK_RESULT $? 0 0 "mendex命令使用标准输入作为输入文件失败" - - # 检查生成的索引文件 - LOG_INFO "检查生成的索引文件" - if [ -f test.idx ]; then - LOG_INFO "成功生成索引文件test.idx" - # 检查文件内容是否符合预期 - grep -q "test1" test.idx - CHECK_RESULT $? 0 0 "索引文件内容不符合预期" - LOG_INFO "索引文件内容符合预期" - else - LOG_ERROR "未生成索引文件test.idx" - exit 1 - fi - - # 清理测试文件 - LOG_INFO "清理测试文件" - rm -f test.idx - CHECK_RESULT $? 0 0 "清理测试文件失败" - - # 如果测试前未安装,则卸载软件包 - if [ "$installed" = "false" ]; then - LOG_INFO "开始卸载texlive-ptex-mendex" - dnf remove -y texlive-ptex-mendex - CHECK_RESULT $? 0 0 "卸载texlive-ptex-mendex失败" - LOG_INFO "卸载texlive-ptex-mendex成功" - fi - - LOG_INFO "测试完成" -} - -main "$@" \ No newline at end of file diff --git a/testcases/function_test/pkg_test/texlive-base/texlive-ptex/test_texlive-ptex_mendex_input_file.sh b/testcases/function_test/pkg_test/texlive-base/texlive-ptex/test_texlive-ptex_mendex_input_file.sh deleted file mode 100644 index ccae01c6651..00000000000 --- a/testcases/function_test/pkg_test/texlive-base/texlive-ptex/test_texlive-ptex_mendex_input_file.sh +++ /dev/null @@ -1,81 +0,0 @@ -#!/usr/bin/bash - -# Copyright (c) 2024 ISCAS .ALL rights reserved. -# This program is licensed under Mulan PSL v2. -# You can use it according to the terms and conditions of the Mulan PSL v2. -# http://license.coscl.org.cn/MulanPSL2 -# THIS PROGRAM IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, -# EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, -# MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. -# See the Mulan PSL v2 for more details. - -# ############################################# -# @Author : honghua -# @Contact : honghua@iscas.ac.cn -# @Date : 2026-03-08 -# @License : Mulan PSL v2 -# @Desc : 测试指定输入文件 -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - LOG_INFO "开始测试:测试指定输入文件" - LOG_INFO "步骤1:检查环境是否已安装texlive-ptex_mendex软件包" - if dnf list installed texlive-ptex_mendex &>/dev/null; then - LOG_INFO "环境已安装texlive-ptex_mendex,测试后保持安装状态" - already_installed=true - else - LOG_INFO "环境未安装texlive-ptex_mendex,将在测试中安装" - already_installed=false - fi - - LOG_INFO "步骤2:检查yum源中是否有texlive-ptex_mendex软件包" - if ! dnf list available texlive-ptex_mendex &>/dev/null; then - LOG_ERROR "yum源中未找到texlive-ptex_mendex软件包" - exit 255 - fi - - if [ "$already_installed" = false ]; then - LOG_INFO "步骤3:安装texlive-ptex_mendex软件包" - dnf install -y texlive-ptex_mendex - CHECK_RESULT $? 0 0 "安装texlive-ptex_mendex失败" - fi - - LOG_INFO "步骤4:检查mendex命令是否支持指定输入文件参数" - mendex --help 2>&1 | grep -q "\-i" - CHECK_RESULT $? 0 0 "mendex命令不支持指定输入文件参数" - - LOG_INFO "步骤5:创建测试输入文件" - cat > test_input.txt << "EOF" - \index{测试条目1} - \index{测试条目2} - EOF - CHECK_RESULT $? 0 0 "创建测试输入文件失败" - - LOG_INFO "步骤6:执行mendex命令指定输入文件" - mendex -i test_input.txt -o test_output.idx - CHECK_RESULT $? 0 0 "mendex命令执行失败" - - LOG_INFO "步骤7:验证输出文件是否生成" - [ -f test_output.idx ] - CHECK_RESULT $? 0 0 "输出文件未生成" - - LOG_INFO "步骤8:验证输出文件内容" - grep -q "测试条目1" test_output.idx - CHECK_RESULT $? 0 0 "输出文件内容不正确" - - LOG_INFO "步骤9:清理测试文件" - rm -f test_input.txt test_output.idx - CHECK_RESULT $? 0 0 "清理测试文件失败" - - if [ "$already_installed" = false ]; then - LOG_INFO "步骤10:卸载texlive-ptex_mendex软件包" - dnf remove -y texlive-ptex_mendex - CHECK_RESULT $? 0 0 "卸载texlive-ptex_mendex失败" - fi - - LOG_INFO "测试完成:测试指定输入文件" -} - -main "$@" \ No newline at end of file diff --git a/testcases/function_test/pkg_test/texlive-base/texlive-ptex/test_texlive-ptex_mendex_l.sh b/testcases/function_test/pkg_test/texlive-base/texlive-ptex/test_texlive-ptex_mendex_l.sh deleted file mode 100644 index ef1f50df49e..00000000000 --- a/testcases/function_test/pkg_test/texlive-base/texlive-ptex/test_texlive-ptex_mendex_l.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-08 -# @License : Mulan PSL v2 -# @Desc : 测试使用字母顺序排序 -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - # 初始化日志函数(直接使用,无需定义) - LOG_INFO() { - echo "[INFO] $*" - } - LOG_ERROR() { - echo "[ERROR] $*" - } - - # 定义软件包名称 - PACKAGE_NAME="texlive-ptex_mendex" - - # 步骤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 "安装软件包失败" - fi - - # 步骤4:测试使用字母顺序排序功能 - LOG_INFO "步骤4:测试使用字母顺序排序功能" - # 创建测试文件 - TEST_FILE="test_index.txt" - cat > "$TEST_FILE" << EOF - apple - zebra - banana - orange - EOF - - # 使用mendex进行字母顺序排序 - mendex -s "$TEST_FILE" -o sorted_index.txt - CHECK_RESULT $? 0 0 "mendex排序失败" - - # 步骤5:验证排序结果 - LOG_INFO "步骤5:验证排序结果" - EXPECTED_SORTED="apple\nbanana\norange\nzebra" - ACTUAL_SORTED=$(cat sorted_index.txt | tr -d "\r") - if [ "$(echo -e "$EXPECTED_SORTED")" = "$ACTUAL_SORTED" ]; then - LOG_INFO "排序结果正确" - else - LOG_ERROR "排序结果不正确" - LOG_ERROR "期望结果:" - echo -e "$EXPECTED_SORTED" - LOG_ERROR "实际结果:" - echo "$ACTUAL_SORTED" - exit 1 - fi - - # 步骤6:清理测试文件 - LOG_INFO "步骤6:清理测试文件" - rm -f "$TEST_FILE" sorted_index.txt - CHECK_RESULT $? 0 0 "清理测试文件失败" - - # 步骤7:如果脚本开始前未安装,则卸载软件包 - if [ $INSTALLED -eq 0 ]; then - LOG_INFO "步骤7:卸载软件包 $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-ptex/test_texlive-ptex_mendex_o_ind.sh b/testcases/function_test/pkg_test/texlive-base/texlive-ptex/test_texlive-ptex_mendex_o_ind.sh deleted file mode 100644 index 92c11c2592e..00000000000 --- a/testcases/function_test/pkg_test/texlive-base/texlive-ptex/test_texlive-ptex_mendex_o_ind.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-08 -# @License : Mulan PSL v2 -# @Desc : 测试指定输出索引文件 -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - LOG_INFO "开始测试:测试指定输出索引文件" - LOG_INFO "步骤1:检查系统中是否已安装texlive-ptex_mendex_o_ind软件包" - rpm -q texlive-ptex_mendex_o_ind - if [ $? -eq 0 ]; then - LOG_INFO "软件包已安装,测试结束后将保持安装状态" - INSTALLED=true - else - LOG_INFO "软件包未安装,将在测试过程中安装" - INSTALLED=false - fi - - LOG_INFO "步骤2:检查yum源中是否有texlive-ptex_mendex_o_ind软件包" - dnf list texlive-ptex_mendex_o_ind - if [ $? -ne 0 ]; then - LOG_ERROR "yum源中未找到texlive-ptex_mendex_o_ind软件包" - exit 255 - fi - - if [ "$INSTALLED" = false ]; then - LOG_INFO "步骤3:安装texlive-ptex_mendex_o_ind软件包" - dnf install -y texlive-ptex_mendex_o_ind - CHECK_RESULT $? 0 0 "安装软件包失败" - fi - - LOG_INFO "步骤4:检查mendex命令是否支持-o参数" - mendex --help | grep -q "\-o" - if [ $? -ne 0 ]; then - LOG_ERROR "mendex命令不支持-o参数" - exit 255 - fi - - LOG_INFO "步骤5:创建测试输入文件" - cat > test_input.idx << EOF - \indexentry{测试条目1}{1} - \indexentry{测试条目2}{2} - EOF - CHECK_RESULT $? 0 0 "创建测试输入文件失败" - - LOG_INFO "步骤6:执行mendex命令,指定输出索引文件" - mendex -o test_output.ind test_input.idx - CHECK_RESULT $? 0 0 "执行mendex命令失败" - - LOG_INFO "步骤7:检查输出文件是否生成" - [ -f test_output.ind ] - CHECK_RESULT $? 0 0 "输出索引文件未生成" - - LOG_INFO "步骤8:检查输出文件内容是否符合预期" - grep -q "测试条目1" test_output.ind - CHECK_RESULT $? 0 0 "输出文件内容不符合预期" - - LOG_INFO "步骤9:清理测试文件" - rm -f test_input.idx test_output.ind - CHECK_RESULT $? 0 0 "清理测试文件失败" - - if [ "$INSTALLED" = false ]; then - LOG_INFO "步骤10:卸载texlive-ptex_mendex_o_ind软件包" - dnf remove -y texlive-ptex_mendex_o_ind - 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-ptex/test_texlive-ptex_mendex_p_no.sh b/testcases/function_test/pkg_test/texlive-base/texlive-ptex/test_texlive-ptex_mendex_p_no.sh deleted file mode 100644 index b142dbdfdd5..00000000000 --- a/testcases/function_test/pkg_test/texlive-base/texlive-ptex/test_texlive-ptex_mendex_p_no.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-08 -# @License : Mulan PSL v2 -# @Desc : 测试设置索引的起始页码 -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - # 定义软件包名称 - PACKAGE_NAME="texlive-ptex" - - # 步骤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" - INSTALLED=0 - if rpm -q $PACKAGE_NAME &>/dev/null; then - LOG_INFO "软件包已安装,脚本结束后将保持安装状态" - INSTALLED=1 - else - LOG_INFO "软件包未安装,将在测试过程中安装" - fi - - # 步骤3:如果未安装,则安装软件包 - if [ $INSTALLED -eq 0 ]; then - LOG_INFO "安装软件包: $PACKAGE_NAME" - dnf install -y $PACKAGE_NAME - CHECK_RESULT $? 0 0 "安装软件包失败" - fi - - # 步骤4:检查mendex命令是否存在 - LOG_INFO "检查mendex命令是否存在" - which mendex &>/dev/null - if [ $? -ne 0 ]; then - LOG_ERROR "mendex命令不存在" - if [ $INSTALLED -eq 0 ]; then - dnf remove -y $PACKAGE_NAME - fi - exit 255 - fi - - # 步骤5:测试设置索引的起始页码功能 - LOG_INFO "测试设置索引的起始页码功能" - # 创建一个简单的测试文件 - TEST_FILE="test_index.tex" - cat > $TEST_FILE << EOF - \documentclass{article} - \usepackage{ptex} - \begin{document} - 测试索引\index{测试} - \printindex - \end{document} - EOF - - # 生成索引文件 - LOG_INFO "生成索引文件" - ptex -kanji=utf8 $TEST_FILE - CHECK_RESULT $? 0 0 "ptex命令执行失败" - - # 测试mendex命令的-p参数(设置起始页码) - LOG_INFO "使用mendex命令设置起始页码为10" - mendex -p 10 test_index.idx 2>&1 - # 检查-p参数是否支持 - if [ $? -eq 255 ]; then - LOG_ERROR "mendex命令不支持-p参数" - if [ $INSTALLED -eq 0 ]; then - dnf remove -y $PACKAGE_NAME - fi - rm -f $TEST_FILE test_index.* - exit 255 - fi - CHECK_RESULT $? 0 0 "mendex命令执行失败" - - # 步骤6:验证输出文件是否存在 - LOG_INFO "验证索引输出文件" - if [ -f "test_index.ind" ]; then - LOG_INFO "索引文件生成成功" - # 检查文件内容是否包含页码设置 - if grep -q "起始页码" test_index.ind || grep -q "page 10" test_index.ind; then - LOG_INFO "起始页码设置成功" - else - LOG_INFO "起始页码设置可能未生效,但命令执行成功" - fi - else - LOG_ERROR "索引文件未生成" - CHECK_RESULT 1 0 0 "索引文件生成失败" - fi - - # 步骤7:清理测试文件 - LOG_INFO "清理测试文件" - rm -f $TEST_FILE test_index.* - - # 步骤8:如果测试前未安装,则卸载软件包 - if [ $INSTALLED -eq 0 ]; then - LOG_INFO "卸载软件包: $PACKAGE_NAME" - dnf remove -y $PACKAGE_NAME - CHECK_RESULT $? 0 0 "卸载软件包失败" - else - LOG_INFO "保持软件包安装状态" - fi - - LOG_INFO "测试完成" -} - -main "$@" \ No newline at end of file diff --git a/testcases/function_test/pkg_test/texlive-base/texlive-ptex/test_texlive-ptex_mendex_q.sh b/testcases/function_test/pkg_test/texlive-base/texlive-ptex/test_texlive-ptex_mendex_q.sh deleted file mode 100644 index e13db28880d..00000000000 --- a/testcases/function_test/pkg_test/texlive-base/texlive-ptex/test_texlive-ptex_mendex_q.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-08 -# @License : Mulan PSL v2 -# @Desc : 测试静默模式 -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - # 检查是否已安装texlive-ptex_mendex_q - LOG_INFO "检查是否已安装texlive-ptex_mendex_q软件包" - if dnf list installed texlive-ptex_mendex_q &>/dev/null; then - LOG_INFO "texlive-ptex_mendex_q已安装,脚本结束后保持安装状态" - INSTALLED_ALREADY=true - else - LOG_INFO "texlive-ptex_mendex_q未安装,将在测试中安装" - INSTALLED_ALREADY=false - fi - - # 检查yum源中是否有该软件包 - LOG_INFO "检查yum源中是否有texlive-ptex_mendex_q软件包" - if ! dnf list available texlive-ptex_mendex_q &>/dev/null; then - LOG_ERROR "yum源中未找到texlive-ptex_mendex_q软件包" - exit 255 - fi - - # 如果未安装,则安装软件包 - if [ "$INSTALLED_ALREADY" = "false" ]; then - LOG_INFO "安装texlive-ptex_mendex_q软件包" - dnf install -y texlive-ptex_mendex_q - CHECK_RESULT $? 0 0 "安装texlive-ptex_mendex_q失败" - fi - - # 检查mendex命令是否支持-s参数(静默模式) - LOG_INFO "检查mendex命令是否支持-s参数" - mendex -h 2>&1 | grep -q "\-s" - CHECK_RESULT $? 0 0 "mendex命令不支持-s参数" - if [ $? -ne 0 ]; then - LOG_ERROR "mendex命令不支持-s参数" - exit 255 - fi - - # 创建测试文件 - LOG_INFO "创建测试文件test.tex" - cat > test.tex << EOF - \documentclass{article} - \begin{document} - Test document for mendex. - \end{document} - EOF - CHECK_RESULT $? 0 0 "创建test.tex文件失败" - - # 生成测试索引文件 - LOG_INFO "生成测试索引文件test.idx" - cat > test.idx << EOF - \indexentry{test}{1} - EOF - CHECK_RESULT $? 0 0 "创建test.idx文件失败" - - # 测试静默模式 - LOG_INFO "测试mendex命令的静默模式" - mendex -s test.idx -o test.ind - CHECK_RESULT $? 0 0 "mendex静默模式执行失败" - - # 检查生成的索引文件 - LOG_INFO "检查生成的索引文件test.ind" - if [ -f test.ind ]; then - LOG_INFO "静默模式成功生成test.ind文件" - else - LOG_ERROR "静默模式未能生成test.ind文件" - exit 1 - fi - - # 清理测试文件 - LOG_INFO "清理测试文件" - rm -f test.tex test.idx test.ind - CHECK_RESULT $? 0 0 "清理测试文件失败" - - # 如果测试前未安装,则卸载软件包 - if [ "$INSTALLED_ALREADY" = "false" ]; then - LOG_INFO "卸载texlive-ptex_mendex_q软件包" - dnf remove -y texlive-ptex_mendex_q - CHECK_RESULT $? 0 0 "卸载texlive-ptex_mendex_q失败" - fi - - LOG_INFO "测试静默模式完成" -} - -main "$@" \ No newline at end of file diff --git a/testcases/function_test/pkg_test/texlive-base/texlive-ptex/test_texlive-ptex_mendex_r.sh b/testcases/function_test/pkg_test/texlive-base/texlive-ptex/test_texlive-ptex_mendex_r.sh deleted file mode 100644 index b281dcf82d4..00000000000 --- a/testcases/function_test/pkg_test/texlive-base/texlive-ptex/test_texlive-ptex_mendex_r.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-08 -# @License : Mulan PSL v2 -# @Desc : 测试禁用隐式页码生成 -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - LOG_INFO "开始测试禁用隐式页码生成功能" - - LOG_INFO "步骤1:检查texlive-ptex-mendex软件包是否在yum源中" - dnf list available texlive-ptex-mendex > /dev/null 2>&1 - if [ $? -ne 0 ]; then - LOG_ERROR "yum源中未找到texlive-ptex-mendex软件包" - exit 255 - fi - - LOG_INFO "步骤2:检查环境是否已安装texlive-ptex-mendex" - rpm -q texlive-ptex-mendex > /dev/null 2>&1 - if [ $? -eq 0 ]; then - INSTALLED=true - LOG_INFO "环境已安装texlive-ptex-mendex,测试结束后将保持安装状态" - else - INSTALLED=false - LOG_INFO "环境未安装texlive-ptex-mendex,将进行安装" - fi - - if [ "$INSTALLED" = false ]; then - LOG_INFO "步骤3:安装texlive-ptex-mendex软件包" - dnf install -y texlive-ptex-mendex - CHECK_RESULT $? 0 0 "安装texlive-ptex-mendex失败" - fi - - LOG_INFO "步骤4:检查mendex命令是否存在" - command -v mendex > /dev/null 2>&1 - CHECK_RESULT $? 0 0 "mendex命令未找到" - - LOG_INFO "步骤5:验证mendex命令是否支持--no-auto参数" - mendex --help | grep -q -- "--no-auto" - if [ $? -ne 0 ]; then - LOG_ERROR "mendex命令不支持--no-auto参数" - exit 255 - fi - - LOG_INFO "步骤6:创建测试文件" - cat > test.tex << "EOF" - \documentclass{article} - \begin{document} - Test document for mendex. - \newpage - More content. - \end{document} - EOF - CHECK_RESULT $? 0 0 "创建测试文件失败" - - LOG_INFO "步骤7:生成索引文件" - cat > test.idx << "EOF" - \indexentry{test}{1} - \indexentry{sample}{2} - EOF - CHECK_RESULT $? 0 0 "创建索引文件失败" - - LOG_INFO "步骤8:运行mendex命令禁用隐式页码生成" - mendex --no-auto test.idx -o test.ind - CHECK_RESULT $? 0 0 "mendex命令执行失败" - - LOG_INFO "步骤9:检查生成的索引文件" - if [ -f test.ind ]; then - LOG_INFO "索引文件生成成功" - if grep -q "implicit" test.ind; then - LOG_ERROR "索引文件中包含隐式页码,测试失败" - exit 1 - else - LOG_INFO "索引文件中未包含隐式页码,测试通过" - fi - else - LOG_ERROR "索引文件未生成" - exit 1 - fi - - LOG_INFO "步骤10:清理测试文件" - rm -f test.tex test.idx test.ind - CHECK_RESULT $? 0 0 "清理测试文件失败" - - if [ "$INSTALLED" = false ]; then - LOG_INFO "步骤11:卸载texlive-ptex-mendex软件包" - dnf remove -y texlive-ptex-mendex - CHECK_RESULT $? 0 0 "卸载texlive-ptex-mendex失败" - 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-ptex/test_texlive-ptex_mendex_s_sty.sh b/testcases/function_test/pkg_test/texlive-base/texlive-ptex/test_texlive-ptex_mendex_s_sty.sh deleted file mode 100644 index 6b7aaf1cdd6..00000000000 --- a/testcases/function_test/pkg_test/texlive-base/texlive-ptex/test_texlive-ptex_mendex_s_sty.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-08 -# @License : Mulan PSL v2 -# @Desc : 测试指定样式文件 -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - # 判断环境是否已安装texlive-ptex - LOG_INFO "检查环境是否已安装texlive-ptex" - rpm -q texlive-ptex > /dev/null 2>&1 - if [ $? -eq 0 ]; then - LOG_INFO "环境已安装texlive-ptex,脚本结束时将保持安装状态" - INSTALLED_FLAG=0 - else - LOG_INFO "环境未安装texlive-ptex,测试过程中将安装,脚本结束前会卸载" - INSTALLED_FLAG=1 - fi - - # 检查yum源中是否有texlive-ptex软件包 - LOG_INFO "检查yum源中是否有texlive-ptex软件包" - dnf list available texlive-ptex > /dev/null 2>&1 - if [ $? -ne 0 ]; then - LOG_ERROR "yum源中未找到texlive-ptex软件包" - exit 255 - fi - - # 如果未安装,则安装texlive-ptex - if [ ${INSTALLED_FLAG} -eq 1 ]; then - LOG_INFO "开始安装texlive-ptex" - dnf install -y texlive-ptex - CHECK_RESULT $? 0 0 "安装texlive-ptex失败" - fi - - # 测试指定样式文件 - LOG_INFO "测试指定样式文件" - mendex -s gind.ist > /dev/null 2>&1 - CHECK_RESULT $? 0 0 "mendex命令执行失败,可能不支持-s参数或gind.ist样式文件" - - # 测试不存在的样式文件 - LOG_INFO "测试不存在的样式文件" - mendex -s nonexistent.ist > /dev/null 2>&1 - if [ $? -eq 0 ]; then - LOG_ERROR "mendex命令应返回非零退出码,但实际返回0" - exit 255 - fi - - # 测试不支持的参数 - LOG_INFO "测试不支持的参数" - mendex --invalid-param > /dev/null 2>&1 - if [ $? -ne 255 ]; then - LOG_ERROR "mendex命令应返回255退出码,但实际返回$?" - exit 255 - fi - - # 清理环境:如果脚本开始时未安装,则卸载texlive-ptex - if [ ${INSTALLED_FLAG} -eq 1 ]; then - LOG_INFO "清理环境:卸载texlive-ptex" - dnf remove -y texlive-ptex - CHECK_RESULT $? 0 0 "卸载texlive-ptex失败" - fi - - LOG_INFO "测试脚本执行完成" -} - -main "$@" \ No newline at end of file diff --git a/testcases/function_test/pkg_test/texlive-base/texlive-ptex/test_texlive-ptex_mendex_t_log.sh b/testcases/function_test/pkg_test/texlive-base/texlive-ptex/test_texlive-ptex_mendex_t_log.sh deleted file mode 100644 index 37ba42f1bec..00000000000 --- a/testcases/function_test/pkg_test/texlive-base/texlive-ptex/test_texlive-ptex_mendex_t_log.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-08 -# @License : Mulan PSL v2 -# @Desc : 测试指定错误日志文件 -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - # 检查是否已安装texlive-ptex-mendex - LOG_INFO "检查是否已安装texlive-ptex-mendex软件包" - rpm -q texlive-ptex-mendex > /dev/null 2>&1 - if [ $? -eq 0 ]; then - LOG_INFO "texlive-ptex-mendex已安装,脚本结束时将保持安装状态" - already_installed=1 - else - LOG_INFO "texlive-ptex-mendex未安装,将进行安装和卸载测试" - already_installed=0 - fi - - # 检查yum源中是否有该软件包 - LOG_INFO "检查yum源中是否有texlive-ptex-mendex软件包" - dnf list available texlive-ptex-mendex > /dev/null 2>&1 - if [ $? -ne 0 ]; then - LOG_ERROR "yum源中未找到texlive-ptex-mendex软件包" - exit 255 - fi - - # 如果未安装,则安装软件包 - if [ $already_installed -eq 0 ]; then - LOG_INFO "安装texlive-ptex-mendex软件包" - dnf install -y texlive-ptex-mendex - CHECK_RESULT $? 0 0 "安装texlive-ptex-mendex失败" - fi - - # 测试指定错误日志文件 - LOG_INFO "测试指定错误日志文件" - # 检查mendex命令是否存在 - which mendex > /dev/null 2>&1 - if [ $? -ne 0 ]; then - LOG_ERROR "mendex命令不存在" - exit 255 - fi - - # 创建测试文件 - LOG_INFO "创建测试文件" - cat > test.idx << EOF - \indexentry{测试条目}{1} - EOF - - # 测试指定不存在的错误日志文件参数 - LOG_INFO "测试指定不存在的错误日志文件参数" - mendex -l test.idx -o test.ind -g test.ilg -t test.log - CHECK_RESULT $? 0 0 "mendex命令执行失败" - - # 检查是否生成了日志文件 - LOG_INFO "检查是否生成了日志文件test.log" - if [ -f test.log ]; then - LOG_INFO "成功生成日志文件test.log" - else - LOG_ERROR "未生成日志文件test.log" - exit 1 - fi - - # 测试指定存在的错误日志文件参数 - LOG_INFO "测试指定存在的错误日志文件参数" - mendex -l test.idx -o test2.ind -g test2.ilg -t test.log - CHECK_RESULT $? 0 0 "mendex命令执行失败(指定已存在的日志文件)" - - # 清理测试文件 - LOG_INFO "清理测试文件" - rm -f test.idx test.ind test.ilg test.log test2.ind test2.ilg - - # 如果之前未安装,则卸载软件包 - if [ $already_installed -eq 0 ]; then - LOG_INFO "卸载texlive-ptex-mendex软件包" - dnf remove -y texlive-ptex-mendex - CHECK_RESULT $? 0 0 "卸载texlive-ptex-mendex失败" - fi - - LOG_INFO "测试完成" -} - -main "$@" \ No newline at end of file diff --git a/testcases/function_test/pkg_test/texlive-base/texlive-ptex/test_texlive-ptex_mendex_upper_e.sh b/testcases/function_test/pkg_test/texlive-base/texlive-ptex/test_texlive-ptex_mendex_upper_e.sh deleted file mode 100644 index 35058f13e4a..00000000000 --- a/testcases/function_test/pkg_test/texlive-base/texlive-ptex/test_texlive-ptex_mendex_upper_e.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-08 -# @License : Mulan PSL v2 -# @Desc : 测试EUC编码模式 -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - LOG_INFO "开始测试EUC编码模式" - LOG_INFO "步骤1:检查是否已安装texlive-ptex-mendex-upper-e软件包" - rpm -q texlive-ptex-mendex-upper-e - if [ $? -eq 0 ]; then - LOG_INFO "软件包已安装,测试结束后将保持安装状态" - INSTALLED=true - else - LOG_INFO "软件包未安装,将在测试过程中安装并在测试结束后卸载" - INSTALLED=false - fi - LOG_INFO "步骤2:检查yum源中是否存在texlive-ptex-mendex-upper-e软件包" - dnf list available texlive-ptex-mendex-upper-e - CHECK_RESULT $? 0 0 "yum源中未找到texlive-ptex-mendex-upper-e软件包" - if [ $? -ne 0 ]; then - LOG_ERROR "yum源中未找到texlive-ptex-mendex-upper-e软件包" - exit 255 - fi - if [ "$INSTALLED" = false ]; then - LOG_INFO "步骤3:安装texlive-ptex-mendex-upper-e软件包" - dnf install -y texlive-ptex-mendex-upper-e - CHECK_RESULT $? 0 0 "安装texlive-ptex-mendex-upper-e软件包失败" - fi - LOG_INFO "步骤4:测试mendex命令的EUC编码模式支持" - LOG_INFO "检查mendex命令是否支持-E参数" - mendex -h 2>&1 | grep -q -- "-E" - CHECK_RESULT $? 0 0 "mendex命令不支持-E参数" - if [ $? -ne 0 ]; then - LOG_ERROR "mendex命令不支持-E参数" - exit 255 - fi - LOG_INFO "步骤5:创建测试索引文件" - cat > test.idx << EOF - \indexentry{テスト}{1} - \indexentry{日本語}{2} - EOF - CHECK_RESULT $? 0 0 "创建测试索引文件失败" - LOG_INFO "步骤6:使用EUC编码模式生成索引" - mendex -E -o test.ind test.idx - CHECK_RESULT $? 0 0 "使用EUC编码模式生成索引失败" - LOG_INFO "步骤7:检查生成的索引文件" - if [ -f test.ind ]; then - LOG_INFO "索引文件生成成功" - cat test.ind - else - LOG_ERROR "索引文件生成失败" - exit 1 - fi - LOG_INFO "步骤8:清理测试文件" - rm -f test.idx test.ind - CHECK_RESULT $? 0 0 "清理测试文件失败" - if [ "$INSTALLED" = false ]; then - LOG_INFO "步骤9:卸载texlive-ptex-mendex-upper-e软件包" - dnf remove -y texlive-ptex-mendex-upper-e - CHECK_RESULT $? 0 0 "卸载texlive-ptex-mendex-upper-e软件包失败" - fi - LOG_INFO "测试EUC编码模式完成" -} - -main "$@" \ No newline at end of file diff --git a/testcases/function_test/pkg_test/texlive-base/texlive-ptex/test_texlive-ptex_mendex_upper_i_enc.sh b/testcases/function_test/pkg_test/texlive-base/texlive-ptex/test_texlive-ptex_mendex_upper_i_enc.sh deleted file mode 100644 index 3cdb175bef2..00000000000 --- a/testcases/function_test/pkg_test/texlive-base/texlive-ptex/test_texlive-ptex_mendex_upper_i_enc.sh +++ /dev/null @@ -1,167 +0,0 @@ -#!/usr/bin/bash - -# Copyright (c) 2024 ISCAS .ALL rights reserved. -# This program is licensed under Mulan PSL v2. -# You can use it according to the terms and conditions of the Mulan PSL v2. -# http://license.coscl.org.cn/MulanPSL2 -# THIS PROGRAM IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, -# EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, -# MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. -# See the Mulan PSL v2 for more details. - -# ############################################# -# @Author : honghua -# @Contact : honghua@iscas.ac.cn -# @Date : 2026-03-08 -# @License : Mulan PSL v2 -# @Desc : 测试指定关键词的内部编码 -# ############################################ - -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" - else - LOG_ERROR "检查失败: $message (实际: $actual, 期望: $expect)" - exit $actual - fi - else - if [ $actual -ne $expect ]; then - LOG_INFO "检查成功: $message" - else - LOG_ERROR "检查失败: $message (实际: $actual, 期望: 非 $expect)" - exit 1 - fi - fi - } - - # 清理函数 - cleanup() { - LOG_INFO "开始清理环境" - - # 如果测试前未安装,则卸载测试安装的包 - if [ $originally_installed -eq 0 ]; then - LOG_INFO "卸载测试安装的软件包" - dnf remove -y texlive-ptex-mendex 2>/dev/null - CHECK_RESULT $? 0 0 "卸载texlive-ptex-mendex失败" - fi - - LOG_INFO "环境清理完成" - } - - # 设置trap确保脚本退出时执行清理 - trap cleanup EXIT - - # 检查软件包是否在yum源中 - LOG_INFO "检查texlive-ptex-mendex是否在yum源中" - dnf list available texlive-ptex-mendex 2>/dev/null | grep -q "texlive-ptex-mendex" - if [ $? -ne 0 ]; then - LOG_ERROR "yum源中未找到texlive-ptex-mendex软件包" - exit 255 - fi - LOG_INFO "texlive-ptex-mendex在yum源中可用" - - # 检查是否已安装 - LOG_INFO "检查texlive-ptex-mendex是否已安装" - if rpm -q texlive-ptex-mendex >/dev/null 2>&1; then - LOG_INFO "texlive-ptex-mendex已安装" - originally_installed=1 - else - LOG_INFO "texlive-ptex-mendex未安装" - originally_installed=0 - fi - - # 如果未安装,则安装 - if [ $originally_installed -eq 0 ]; then - LOG_INFO "安装texlive-ptex-mendex软件包" - dnf install -y texlive-ptex-mendex - CHECK_RESULT $? 0 0 "安装texlive-ptex-mendex失败" - fi - - # 测试指定关键词的内部编码 - LOG_INFO "开始测试指定关键词的内部编码" - - # 检查mendex命令是否支持-i参数 - LOG_INFO "检查mendex命令是否支持-i参数" - mendex -h 2>&1 | grep -q -- "-i" - if [ $? -ne 0 ]; then - LOG_ERROR "mendex命令不支持-i参数" - exit 255 - fi - LOG_INFO "mendex命令支持-i参数" - - # 创建测试输入文件 - LOG_INFO "创建测试输入文件" - cat > test_input.idx << "EOF" - \indexentry{テスト}{1} - \indexentry{てすと}{2} - \indexentry{Test}{3} - EOF - CHECK_RESULT $? 0 0 "创建测试输入文件失败" - - # 测试-i enc参数(指定内部编码) - LOG_INFO "测试-i enc参数(指定内部编码为utf8)" - mendex -i enc=utf8 -o test_output.enc.idx test_input.idx - CHECK_RESULT $? 0 0 "使用-i enc=utf8参数执行mendex失败" - - # 验证输出文件是否生成 - LOG_INFO "验证输出文件是否生成" - [ -f test_output.enc.idx ] - CHECK_RESULT $? 0 0 "输出文件未生成" - - # 测试-i enc参数(指定内部编码为euc) - LOG_INFO "测试-i enc参数(指定内部编码为euc)" - mendex -i enc=euc -o test_output.euc.idx test_input.idx - CHECK_RESULT $? 0 0 "使用-i enc=euc参数执行mendex失败" - - # 验证输出文件是否生成 - LOG_INFO "验证输出文件是否生成" - [ -f test_output.euc.idx ] - CHECK_RESULT $? 0 0 "输出文件未生成" - - # 测试-i enc参数(指定内部编码为jis) - LOG_INFO "测试-i enc参数(指定内部编码为jis)" - mendex -i enc=jis -o test_output.jis.idx test_input.idx - CHECK_RESULT $? 0 0 "使用-i enc=jis参数执行mendex失败" - - # 验证输出文件是否生成 - LOG_INFO "验证输出文件是否生成" - [ -f test_output.jis.idx ] - CHECK_RESULT $? 0 0 "输出文件未生成" - - # 测试不支持的编码参数 - LOG_INFO "测试不支持的编码参数(应失败)" - mendex -i enc=unsupported -o test_output.bad.idx test_input.idx 2>/dev/null - if [ $? -eq 0 ]; then - LOG_ERROR "不支持的编码参数应该失败但成功了" - exit 255 - fi - LOG_INFO "不支持的编码参数正确失败" - - # 清理测试文件 - LOG_INFO "清理测试文件" - rm -f test_input.idx test_output.*.idx - CHECK_RESULT $? 0 0 "清理测试文件失败" - - LOG_INFO "测试指定关键词的内部编码完成" -} - -main "$@" \ No newline at end of file diff --git a/testcases/function_test/pkg_test/texlive-base/texlive-ptex/test_texlive-ptex_mendex_upper_j.sh b/testcases/function_test/pkg_test/texlive-base/texlive-ptex/test_texlive-ptex_mendex_upper_j.sh deleted file mode 100644 index d2a9c87d91e..00000000000 --- a/testcases/function_test/pkg_test/texlive-base/texlive-ptex/test_texlive-ptex_mendex_upper_j.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-08 -# @License : Mulan PSL v2 -# @Desc : 测试JIS编码模式 -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - set -e - - LOG_INFO "开始测试JIS编码模式" - - # 检查是否已安装texlive-ptex-mendex-upper-j - LOG_INFO "检查texlive-ptex-mendex-upper-j是否已安装" - if dnf list installed texlive-ptex-mendex-upper-j &>/dev/null; then - LOG_INFO "texlive-ptex-mendex-upper-j已安装,测试完成后保持安装状态" - INSTALLED="true" - else - LOG_INFO "texlive-ptex-mendex-upper-j未安装" - INSTALLED="false" - fi - - # 检查yum源中是否有该软件包 - LOG_INFO "检查yum源中是否有texlive-ptex-mendex-upper-j软件包" - if ! dnf list available texlive-ptex-mendex-upper-j &>/dev/null; then - LOG_ERROR "yum源中未找到texlive-ptex-mendex-upper-j软件包" - exit 255 - fi - - # 如果未安装,则安装 - if [ "$INSTALLED" = "false" ]; then - LOG_INFO "开始安装texlive-ptex-mendex-upper-j" - dnf install -y texlive-ptex-mendex-upper-j - CHECK_RESULT $? 0 0 "安装texlive-ptex-mendex-upper-j失败" - fi - - # 测试JIS编码模式 - LOG_INFO "测试mendex命令的JIS编码模式" - # 创建一个简单的测试索引文件 - cat > test.idx << EOF - \indexentry{テスト}{1} - \indexentry{インデックス}{2} - EOF - - # 测试mendex命令,使用JIS编码 - LOG_INFO "执行mendex -J -o test.ind test.idx" - mendex -J -o test.ind test.idx - CHECK_RESULT $? 0 0 "mendex命令JIS编码模式执行失败" - - # 检查生成的索引文件 - LOG_INFO "检查生成的索引文件test.ind" - if [ -f "test.ind" ]; then - LOG_INFO "索引文件生成成功" - # 简单检查文件内容 - if grep -q "テスト" test.ind; then - LOG_INFO "索引文件包含预期的JIS编码内容" - else - LOG_ERROR "索引文件未包含预期的JIS编码内容" - CHECK_RESULT 1 0 0 "索引文件内容检查失败" - fi - else - LOG_ERROR "索引文件未生成" - CHECK_RESULT 1 0 0 "索引文件生成失败" - fi - - # 清理测试文件 - LOG_INFO "清理测试文件" - rm -f test.idx test.ind - - # 如果测试开始时未安装,则在测试结束后卸载 - if [ "$INSTALLED" = "false" ]; then - LOG_INFO "卸载texlive-ptex-mendex-upper-j" - dnf remove -y texlive-ptex-mendex-upper-j - CHECK_RESULT $? 0 0 "卸载texlive-ptex-mendex-upper-j失败" - fi - - LOG_INFO "JIS编码模式测试完成" -} - -main "$@" \ No newline at end of file diff --git a/testcases/function_test/pkg_test/texlive-base/texlive-ptex/test_texlive-ptex_mendex_upper_s.sh b/testcases/function_test/pkg_test/texlive-base/texlive-ptex/test_texlive-ptex_mendex_upper_s.sh deleted file mode 100644 index dce05b59aae..00000000000 --- a/testcases/function_test/pkg_test/texlive-base/texlive-ptex/test_texlive-ptex_mendex_upper_s.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-08 -# @License : Mulan PSL v2 -# @Desc : 测试ShiftJIS编码模式 -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - LOG_INFO "开始测试ShiftJIS编码模式" - - # 检查环境是否已安装texlive-ptex-mendex-upper-s软件包 - LOG_INFO "检查texlive-ptex-mendex-upper-s是否已安装" - rpm -q texlive-ptex-mendex-upper-s &> /dev/null - if [ $? -eq 0 ]; then - LOG_INFO "texlive-ptex-mendex-upper-s已安装,测试结束后将保持安装状态" - INSTALLED=1 - else - LOG_INFO "texlive-ptex-mendex-upper-s未安装,将在测试前安装,测试后卸载" - INSTALLED=0 - fi - - # 检查yum源中是否有texlive-ptex-mendex-upper-s软件包 - LOG_INFO "检查yum源中是否有texlive-ptex-mendex-upper-s" - dnf list available texlive-ptex-mendex-upper-s &> /dev/null - if [ $? -ne 0 ]; then - LOG_ERROR "yum源中未找到texlive-ptex-mendex-upper-s软件包" - exit 255 - fi - - # 如果未安装,则安装软件包 - if [ $INSTALLED -eq 0 ]; then - LOG_INFO "安装texlive-ptex-mendex-upper-s" - dnf install -y texlive-ptex-mendex-upper-s - CHECK_RESULT $? 0 0 "安装texlive-ptex-mendex-upper-s失败" - fi - - # 测试ShiftJIS编码模式 - LOG_INFO "测试mendex命令的ShiftJIS编码模式" - mendex --help | grep -q "shiftjis" - if [ $? -ne 0 ]; then - LOG_ERROR "mendex命令不支持ShiftJIS编码模式参数" - # 清理环境 - if [ $INSTALLED -eq 0 ]; then - LOG_INFO "卸载texlive-ptex-mendex-upper-s" - dnf remove -y texlive-ptex-mendex-upper-s - CHECK_RESULT $? 0 0 "卸载texlive-ptex-mendex-upper-s失败" - fi - exit 255 - fi - - # 创建测试文件 - LOG_INFO "创建测试文件test.idx" - cat > test.idx << EOF - test entry - EOF - CHECK_RESULT $? 0 0 "创建测试文件失败" - - # 执行mendex命令测试ShiftJIS编码模式 - LOG_INFO "执行mendex命令进行ShiftJIS编码模式测试" - mendex -s shiftjis test.idx -o test.ind - CHECK_RESULT $? 0 0 "mendex命令执行失败" - - # 检查输出文件 - LOG_INFO "检查生成的索引文件" - if [ -f test.ind ]; then - LOG_INFO "成功生成索引文件test.ind" - else - LOG_ERROR "未生成索引文件test.ind" - # 清理测试文件 - rm -f test.idx test.ind 2>/dev/null - # 清理环境 - if [ $INSTALLED -eq 0 ]; then - LOG_INFO "卸载texlive-ptex-mendex-upper-s" - dnf remove -y texlive-ptex-mendex-upper-s - CHECK_RESULT $? 0 0 "卸载texlive-ptex-mendex-upper-s失败" - fi - exit 1 - fi - - # 清理测试文件 - LOG_INFO "清理测试文件" - rm -f test.idx test.ind - - # 如果测试前未安装,则卸载软件包 - if [ $INSTALLED -eq 0 ]; then - LOG_INFO "卸载texlive-ptex-mendex-upper-s" - dnf remove -y texlive-ptex-mendex-upper-s - CHECK_RESULT $? 0 0 "卸载texlive-ptex-mendex-upper-s失败" - fi - - LOG_INFO "ShiftJIS编码模式测试完成" -} - -main "$@" \ No newline at end of file diff --git a/testcases/function_test/pkg_test/texlive-base/texlive-ptex/test_texlive-ptex_mendex_upper_u.sh b/testcases/function_test/pkg_test/texlive-base/texlive-ptex/test_texlive-ptex_mendex_upper_u.sh deleted file mode 100644 index d1879c336e7..00000000000 --- a/testcases/function_test/pkg_test/texlive-base/texlive-ptex/test_texlive-ptex_mendex_upper_u.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-08 -# @License : Mulan PSL v2 -# @Desc : 测试UTF-8编码模式 -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - LOG_INFO "开始测试UTF-8编码模式" - - LOG_INFO "检查yum源中是否存在texlive-ptex-mendex-upper-u软件包" - dnf list texlive-ptex-mendex-upper-u - if [ $? -ne 0 ]; then - LOG_ERROR "yum源中未找到texlive-ptex-mendex-upper-u软件包" - exit 255 - fi - - LOG_INFO "检查当前是否已安装texlive-ptex-mendex-upper-u软件包" - rpm -q texlive-ptex-mendex-upper-u - if [ $? -eq 0 ]; then - LOG_INFO "软件包已安装,标记为无需清理" - NEED_CLEANUP=0 - else - LOG_INFO "软件包未安装,标记为需要清理" - NEED_CLEANUP=1 - fi - - if [ $NEED_CLEANUP -eq 1 ]; then - LOG_INFO "安装texlive-ptex-mendex-upper-u软件包" - dnf install -y texlive-ptex-mendex-upper-u - CHECK_RESULT $? 0 0 "安装texlive-ptex-mendex-upper-u失败" - fi - - LOG_INFO "检查mendex命令是否支持-U参数" - mendex -h 2>&1 | grep -q -- "-U" - if [ $? -ne 0 ]; then - LOG_ERROR "mendex命令不支持-U参数" - exit 255 - fi - - LOG_INFO "创建测试用的UTF-8编码的tex文件" - cat > test_utf8.tex << "EOF" - \documentclass{article} - \usepackage{CJKutf8} - \begin{document} - \begin{CJK}{UTF8}{min} - 测试UTF-8编码 - \end{CJK} - \end{document} - EOF - CHECK_RESULT $? 0 0 "创建测试tex文件失败" - - LOG_INFO "使用ptex编译UTF-8编码的tex文件" - ptex -kanji=utf8 test_utf8.tex - CHECK_RESULT $? 0 0 "ptex编译UTF-8文件失败" - - LOG_INFO "使用mendex -U参数处理UTF-8编码的idx文件" - if [ -f test_utf8.idx ]; then - mendex -U test_utf8.idx - CHECK_RESULT $? 0 0 "mendex处理UTF-8索引文件失败" - else - LOG_INFO "未生成idx文件,跳过mendex测试步骤" - fi - - if [ $NEED_CLEANUP -eq 1 ]; then - LOG_INFO "清理测试环境" - LOG_INFO "卸载texlive-ptex-mendex-upper-u软件包" - dnf remove -y texlive-ptex-mendex-upper-u - CHECK_RESULT $? 0 0 "卸载texlive-ptex-mendex-upper-u失败" - fi - - LOG_INFO "清理测试文件" - rm -f test_utf8.* - CHECK_RESULT $? 0 0 "清理测试文件失败" - - LOG_INFO "测试UTF-8编码模式完成" -} - -main "$@" \ No newline at end of file diff --git a/testcases/function_test/pkg_test/texlive-base/texlive-ptex/test_texlive-ptex_pbibtex_help.sh b/testcases/function_test/pkg_test/texlive-base/texlive-ptex/test_texlive-ptex_pbibtex_help.sh deleted file mode 100644 index 90ccf8963a5..00000000000 --- a/testcases/function_test/pkg_test/texlive-base/texlive-ptex/test_texlive-ptex_pbibtex_help.sh +++ /dev/null @@ -1,77 +0,0 @@ -#!/usr/bin/bash - -# Copyright (c) 2024 ISCAS .ALL rights reserved. -# This program is licensed under Mulan PSL v2. -# You can use it according to the terms and conditions of the Mulan PSL v2. -# http://license.coscl.org.cn/MulanPSL2 -# THIS PROGRAM IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, -# EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, -# MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. -# See the Mulan PSL v2 for more details. - -# ############################################# -# @Author : honghua -# @Contact : honghua@iscas.ac.cn -# @Date : 2026-03-08 -# @License : Mulan PSL v2 -# @Desc : 使用-help参数显示帮助信息 -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - LOG_INFO "开始测试texlive-ptex_pbibtex的-help参数帮助信息显示功能" - - # 检查软件包是否在yum源中 - LOG_INFO "检查yum源中是否存在texlive-ptex-pbibtex软件包" - dnf list available texlive-ptex-pbibtex > /dev/null 2>&1 - if [ $? -ne 0 ]; then - LOG_ERROR "yum源中未找到texlive-ptex-pbibtex软件包" - exit 255 - fi - - # 检查是否已安装 - LOG_INFO "检查texlive-ptex-pbibtex是否已安装" - rpm -q texlive-ptex-pbibtex > /dev/null 2>&1 - installed=$? - - if [ $installed -ne 0 ]; then - LOG_INFO "软件包未安装,开始安装" - dnf install -y texlive-ptex-pbibtex - CHECK_RESULT $? 0 0 "安装texlive-ptex-pbibtex失败" - need_cleanup=1 - else - LOG_INFO "软件包已安装" - need_cleanup=0 - fi - - # 测试-help参数 - LOG_INFO "测试pbibtex命令的-help参数" - pbibtex --help > /dev/null 2>&1 - result1=$? - - pbibtex -help > /dev/null 2>&1 - result2=$? - - if [ $result1 -eq 0 ] || [ $result2 -eq 0 ]; then - LOG_INFO "pbibtex命令支持-help或--help参数" - CHECK_RESULT 0 0 0 "pbibtex命令-help参数测试通过" - else - LOG_ERROR "pbibtex命令不支持-help或--help参数" - exit 255 - fi - - # 清理环境 - LOG_INFO "开始清理测试环境" - if [ $need_cleanup -eq 1 ]; then - LOG_INFO "卸载测试安装的软件包" - dnf remove -y texlive-ptex-pbibtex - CHECK_RESULT $? 0 0 "卸载texlive-ptex-pbibtex失败" - else - LOG_INFO "保持原有安装状态,不卸载软件包" - fi - - LOG_INFO "测试完成" -} - -main "$@" \ No newline at end of file diff --git a/testcases/function_test/pkg_test/texlive-base/texlive-ptex/test_texlive-ptex_pbibtex_kanji_euc.sh b/testcases/function_test/pkg_test/texlive-base/texlive-ptex/test_texlive-ptex_pbibtex_kanji_euc.sh deleted file mode 100644 index ed5b3e572bc..00000000000 --- a/testcases/function_test/pkg_test/texlive-base/texlive-ptex/test_texlive-ptex_pbibtex_kanji_euc.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-08 -# @License : Mulan PSL v2 -# @Desc : 使用-kanji参数指定日文编码为euc -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - # 定义日志函数 - LOG_INFO() { - echo "[INFO] $*" - } - - LOG_ERROR() { - echo "[ERROR] $*" >&2 - } - - # 检查软件包是否存在 - check_package_exists() { - local pkg_name=$1 - dnf list available "$pkg_name" &>/dev/null - if [ $? -ne 0 ]; then - LOG_ERROR "软件包 $pkg_name 在yum源中不存在" - exit 255 - fi - } - - # 检查命令参数是否支持 - check_command_param() { - local cmd=$1 - local param=$2 - if ! $cmd --help 2>&1 | grep -q -- "$param"; then - LOG_ERROR "命令 $cmd 不支持参数 $param" - exit 255 - fi - } - - # 主测试函数 - main() { - local pkg_name="texlive-ptex" - local test_cmd="pbibtex" - local test_param="-kanji=euc" - local test_file="test.aux" - - LOG_INFO "开始测试: 使用-kanji参数指定日文编码为euc" - - # 检查软件包是否存在 - LOG_INFO "检查软件包 $pkg_name 是否存在" - check_package_exists "$pkg_name" - - # 检查pbibtex命令是否支持-kanji参数 - LOG_INFO "检查 $test_cmd 是否支持 $test_param 参数" - if command -v $test_cmd &>/dev/null; then - check_command_param "$test_cmd" "-kanji" - fi - - # 判断是否已安装 - LOG_INFO "检查 $pkg_name 是否已安装" - if rpm -q "$pkg_name" &>/dev/null; then - LOG_INFO "$pkg_name 已安装,测试结束后保持安装状态" - local already_installed=true - else - LOG_INFO "$pkg_name 未安装,将进行安装测试" - local already_installed=false - fi - - # 如果未安装,则安装软件包 - if [ "$already_installed" = "false" ]; then - LOG_INFO "安装 $pkg_name" - dnf install -y "$pkg_name" - CHECK_RESULT $? 0 0 "安装 $pkg_name 失败" - fi - - # 创建测试文件 - LOG_INFO "创建测试文件 $test_file" - cat > "$test_file" << "EOF" - \relax - \citation{test} - \bibstyle{plain} - \bibdata{test} - EOF - CHECK_RESULT $? 0 0 "创建测试文件失败" - - # 执行pbibtex命令测试-kanji=euc参数 - LOG_INFO "执行命令: $test_cmd $test_param $test_file" - $test_cmd $test_param "$test_file" 2>&1 - local cmd_result=$? - - # 检查命令执行结果 - if [ $cmd_result -eq 0 ]; then - LOG_INFO "命令执行成功" - elif [ $cmd_result -eq 255 ]; then - LOG_ERROR "命令参数错误" - exit 255 - else - LOG_ERROR "命令执行失败,退出码: $cmd_result" - exit $cmd_result - fi - - # 清理测试文件 - LOG_INFO "清理测试文件" - rm -f "$test_file" "test.bbl" "test.blg" - - # 如果之前未安装,则卸载软件包 - if [ "$already_installed" = "false" ]; then - LOG_INFO "卸载 $pkg_name" - dnf remove -y "$pkg_name" - CHECK_RESULT $? 0 0 "卸载 $pkg_name 失败" - fi - - LOG_INFO "测试完成" - } - - # 执行主函数 - main "$@" -} - -main "$@" \ No newline at end of file diff --git a/testcases/function_test/pkg_test/texlive-base/texlive-ptex/test_texlive-ptex_pbibtex_kanji_jis.sh b/testcases/function_test/pkg_test/texlive-base/texlive-ptex/test_texlive-ptex_pbibtex_kanji_jis.sh deleted file mode 100644 index 0dde2747055..00000000000 --- a/testcases/function_test/pkg_test/texlive-base/texlive-ptex/test_texlive-ptex_pbibtex_kanji_jis.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-08 -# @License : Mulan PSL v2 -# @Desc : 使用-kanji参数指定日文编码为jis -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - set -e - - LOG_INFO "开始测试pbibtex使用-kanji参数指定日文编码为jis" - - # 检查软件包是否在yum源中 - LOG_INFO "检查texlive-ptex软件包是否在yum源中" - if ! dnf list available texlive-ptex 2>/dev/null | grep -q texlive-ptex; then - LOG_ERROR "texlive-ptex软件包不在yum源中" - exit 255 - fi - - # 检查是否已安装 - LOG_INFO "检查texlive-ptex是否已安装" - if rpm -q texlive-ptex >/dev/null 2>&1; then - already_installed=true - LOG_INFO "texlive-ptex已安装,测试完成后将保持安装状态" - else - already_installed=false - LOG_INFO "texlive-ptex未安装,将进行安装" - fi - - # 如果未安装,则安装软件包 - if ! $already_installed; then - LOG_INFO "安装texlive-ptex软件包" - dnf install -y texlive-ptex - CHECK_RESULT $? 0 0 "安装texlive-ptex失败" - fi - - # 检查pbibtex命令是否支持-kanji参数 - LOG_INFO "检查pbibtex命令是否支持-kanji参数" - pbibtex --help 2>&1 | grep -q -- "-kanji" - CHECK_RESULT $? 0 0 "pbibtex不支持-kanji参数" - - # 测试pbibtex使用-kanji参数指定jis编码 - LOG_INFO "测试pbibtex使用-kanji参数指定日文编码为jis" - pbibtex -kanji=jis --version - CHECK_RESULT $? 0 0 "pbibtex执行失败" - - # 环境清理 - if ! $already_installed; then - LOG_INFO "卸载texlive-ptex软件包" - dnf remove -y texlive-ptex - CHECK_RESULT $? 0 0 "卸载texlive-ptex失败" - fi - - LOG_INFO "测试完成" -} - -main "$@" \ No newline at end of file diff --git a/testcases/function_test/pkg_test/texlive-base/texlive-ptex/test_texlive-ptex_pbibtex_kanji_sjis.sh b/testcases/function_test/pkg_test/texlive-base/texlive-ptex/test_texlive-ptex_pbibtex_kanji_sjis.sh deleted file mode 100644 index 90e4846fb91..00000000000 --- a/testcases/function_test/pkg_test/texlive-base/texlive-ptex/test_texlive-ptex_pbibtex_kanji_sjis.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-08 -# @License : Mulan PSL v2 -# @Desc : 使用-kanji参数指定日文编码为sjis -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - # 检查环境是否已安装texlive-ptex-pbibtex-kanji-sjis - LOG_INFO "检查是否已安装texlive-ptex-pbibtex-kanji-sjis软件包" - rpm -q texlive-ptex-pbibtex-kanji-sjis > /dev/null 2>&1 - if [ $? -eq 0 ]; then - LOG_INFO "检测到texlive-ptex-pbibtex-kanji-sjis已安装,脚本结束时将保持安装状态" - INSTALLED=true - else - LOG_INFO "未检测到texlive-ptex-pbibtex-kanji-sjis安装" - INSTALLED=false - fi - - # 检查yum源中是否存在该软件包 - LOG_INFO "检查yum源中是否存在texlive-ptex-pbibtex-kanji-sjis软件包" - dnf list available texlive-ptex-pbibtex-kanji-sjis > /dev/null 2>&1 - CHECK_RESULT $? 0 0 "yum源中未找到texlive-ptex-pbibtex-kanji-sjis软件包" - if [ $? -ne 0 ]; then - LOG_ERROR "yum源中不存在texlive-ptex-pbibtex-kanji-sjis软件包" - exit 255 - fi - - # 如果未安装,则进行安装 - if [ "$INSTALLED" = "false" ]; then - LOG_INFO "开始安装texlive-ptex-pbibtex-kanji-sjis软件包" - dnf install -y texlive-ptex-pbibtex-kanji-sjis - CHECK_RESULT $? 0 0 "安装texlive-ptex-pbibtex-kanji-sjis软件包失败" - fi - - # 测试pbibtex命令是否支持-kanji参数 - LOG_INFO "测试pbibtex命令是否支持-kanji参数" - pbibtex --help 2>&1 | grep -q "\-kanji" - CHECK_RESULT $? 0 0 "pbibtex命令不支持-kanji参数" - if [ $? -ne 0 ]; then - LOG_ERROR "pbibtex命令不支持-kanji参数" - exit 255 - fi - - # 测试使用-kanji参数指定日文编码为sjis - LOG_INFO "测试使用-kanji参数指定日文编码为sjis" - echo "测试内容" > test.aux - pbibtex -kanji=sjis test 2>&1 - CHECK_RESULT $? 0 0 "使用-kanji=sjis参数执行pbibtex命令失败" - - # 清理测试文件 - LOG_INFO "清理测试生成的临时文件" - rm -f test.aux test.bbl test.blg - - # 如果脚本开始时未安装,则在结束时卸载软件包 - if [ "$INSTALLED" = "false" ]; then - LOG_INFO "卸载texlive-ptex-pbibtex-kanji-sjis软件包" - dnf remove -y texlive-ptex-pbibtex-kanji-sjis - CHECK_RESULT $? 0 0 "卸载texlive-ptex-pbibtex-kanji-sjis软件包失败" - fi - - LOG_INFO "测试脚本执行完毕" -} - -main "$@" \ No newline at end of file diff --git a/testcases/function_test/pkg_test/texlive-base/texlive-ptex/test_texlive-ptex_pbibtex_kanji_utf8.sh b/testcases/function_test/pkg_test/texlive-base/texlive-ptex/test_texlive-ptex_pbibtex_kanji_utf8.sh deleted file mode 100644 index 8cfa4895d1f..00000000000 --- a/testcases/function_test/pkg_test/texlive-base/texlive-ptex/test_texlive-ptex_pbibtex_kanji_utf8.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-08 -# @License : Mulan PSL v2 -# @Desc : 使用-kanji参数指定日文编码为utf8 -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - LOG_INFO "开始测试:使用-kanji参数指定日文编码为utf8" - - # 检查texlive-ptex-pbibtex包是否在yum源中 - LOG_INFO "步骤1:检查texlive-ptex-pbibtex包是否在yum源中" - dnf list available texlive-ptex-pbibtex &>/dev/null - if [ $? -ne 0 ]; then - LOG_ERROR "texlive-ptex-pbibtex包不在yum源中" - exit 255 - fi - - # 检查是否已安装 - LOG_INFO "步骤2:检查texlive-ptex-pbibtex是否已安装" - rpm -q texlive-ptex-pbibtex &>/dev/null - INSTALLED=$? - - if [ $INSTALLED -ne 0 ]; then - LOG_INFO "未安装texlive-ptex-pbibtex,执行安装" - dnf install -y texlive-ptex-pbibtex - CHECK_RESULT $? 0 0 "安装texlive-ptex-pbibtex失败" - else - LOG_INFO "texlive-ptex-pbibtex已安装" - fi - - # 测试pbibtex命令是否存在 - LOG_INFO "步骤3:检查pbibtex命令是否存在" - command -v pbibtex &>/dev/null - CHECK_RESULT $? 0 0 "pbibtex命令不存在" - - # 测试-kanji参数支持情况 - LOG_INFO "步骤4:测试pbibtex命令的-kanji参数支持" - pbibtex -kanji=utf8 --help &>/dev/null - if [ $? -eq 255 ]; then - LOG_ERROR "pbibtex命令不支持-kanji参数" - exit 255 - fi - - # 创建测试文件 - LOG_INFO "步骤5:创建测试文件" - cat > test.tex << "EOF" - \documentclass{article} - \begin{document} - Test document. - \end{document} - EOF - CHECK_RESULT $? 0 0 "创建测试文件失败" - - # 运行pbibtex命令进行测试 - LOG_INFO "步骤6:运行pbibtex命令进行测试" - pbibtex -kanji=utf8 test &>/dev/null - CHECK_RESULT $? 0 0 "pbibtex命令执行失败" - - # 清理测试文件 - LOG_INFO "步骤7:清理测试文件" - rm -f test.tex test.aux test.bbl test.blg test.log - - # 如果测试前未安装,则卸载软件包 - if [ $INSTALLED -ne 0 ]; then - LOG_INFO "步骤8:卸载测试安装的软件包" - dnf remove -y texlive-ptex-pbibtex - CHECK_RESULT $? 0 0 "卸载texlive-ptex-pbibtex失败" - else - LOG_INFO "步骤8:保持原有安装状态" - fi - - LOG_INFO "测试完成" -} - -main "$@" \ No newline at end of file diff --git a/testcases/function_test/pkg_test/texlive-base/texlive-ptex/test_texlive-ptex_pbibtex_min_crossrefs_num_1.sh b/testcases/function_test/pkg_test/texlive-base/texlive-ptex/test_texlive-ptex_pbibtex_min_crossrefs_num_1.sh deleted file mode 100644 index 9785cfc36f7..00000000000 --- a/testcases/function_test/pkg_test/texlive-base/texlive-ptex/test_texlive-ptex_pbibtex_min_crossrefs_num_1.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-08 -# @License : Mulan PSL v2 -# @Desc : 使用-min-crossrefs参数设置交叉引用包含阈值为1 -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - set -e - - # 检查yum源中是否存在texlive-ptex-pbibtex包 - LOG_INFO "检查yum源中是否存在texlive-ptex-pbibtex包" - if ! dnf list texlive-ptex-pbibtex &>/dev/null; then - LOG_ERROR "yum源中未找到texlive-ptex-pbibtex包" - exit 255 - fi - - # 判断环境是否已经安装texlive-ptex-pbibtex - LOG_INFO "判断环境是否已经安装texlive-ptex-pbibtex" - if rpm -q texlive-ptex-pbibtex &>/dev/null; then - LOG_INFO "texlive-ptex-pbibtex已安装,测试结束后将保持安装状态" - INSTALLED_BEFORE=true - else - LOG_INFO "texlive-ptex-pbibtex未安装,将在测试前安装,测试结束后卸载" - INSTALLED_BEFORE=false - fi - - # 如果未安装,则安装软件包 - if [ "$INSTALLED_BEFORE" = false ]; then - LOG_INFO "安装texlive-ptex-pbibtex软件包" - dnf install -y texlive-ptex-pbibtex - CHECK_RESULT $? 0 0 "安装texlive-ptex-pbibtex失败" - fi - - # 检查pbibtex命令是否支持-min-crossrefs参数 - LOG_INFO "检查pbibtex命令是否支持-min-crossrefs参数" - pbibtex --help 2>&1 | grep -q -- "-min-crossrefs" - if [ $? -ne 0 ]; then - LOG_ERROR "pbibtex命令不支持-min-crossrefs参数" - # 如果之前未安装,需要卸载软件包 - if [ "$INSTALLED_BEFORE" = false ]; then - LOG_INFO "卸载texlive-ptex-pbibtex软件包" - dnf remove -y texlive-ptex-pbibtex - fi - exit 255 - fi - - # 创建测试用的.bib文件 - LOG_INFO "创建测试用的.bib文件" - cat > test.bib << "EOF" - @article{article1, - author = {Author One}, - title = {Title One}, - journal = {Journal One}, - year = {2023} - } - @article{article2, - author = {Author Two}, - title = {Title Two}, - journal = {Journal Two}, - year = {2023}, - crossref = {article1} - } - EOF - CHECK_RESULT $? 0 0 "创建test.bib文件失败" - - # 创建测试用的.aux文件 - LOG_INFO "创建测试用的.aux文件" - cat > test.aux << "EOF" - \relax - \citation{article1} - \citation{article2} - \bibstyle{plain} - \bibdata{test} - EOF - CHECK_RESULT $? 0 0 "创建test.aux文件失败" - - # 使用pbibtex命令,设置-min-crossrefs参数为1 - LOG_INFO "使用pbibtex命令,设置-min-crossrefs参数为1" - pbibtex -min-crossrefs=1 test - CHECK_RESULT $? 0 0 "pbibtex命令执行失败" - - # 检查生成的.bbl文件 - LOG_INFO "检查生成的.bbl文件" - if [ -f test.bbl ]; then - LOG_INFO "成功生成test.bbl文件" - # 可以添加更详细的检查内容 - CHECK_RESULT 0 0 0 "检查.bbl文件" - else - LOG_ERROR "未生成test.bbl文件" - CHECK_RESULT 1 0 1 "未生成.bbl文件" - fi - - # 清理测试文件 - LOG_INFO "清理测试文件" - rm -f test.bib test.aux test.bbl test.blg test.log - - # 如果测试前未安装,则卸载软件包 - if [ "$INSTALLED_BEFORE" = false ]; then - LOG_INFO "卸载texlive-ptex-pbibtex软件包" - dnf remove -y texlive-ptex-pbibtex - CHECK_RESULT $? 0 0 "卸载texlive-ptex-pbibtex失败" - fi - - LOG_INFO "测试完成" -} - -main "$@" \ No newline at end of file diff --git a/testcases/function_test/pkg_test/texlive-base/texlive-ptex/test_texlive-ptex_pbibtex_no_option.sh b/testcases/function_test/pkg_test/texlive-base/texlive-ptex/test_texlive-ptex_pbibtex_no_option.sh deleted file mode 100644 index 66ff946d0f1..00000000000 --- a/testcases/function_test/pkg_test/texlive-base/texlive-ptex/test_texlive-ptex_pbibtex_no_option.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-08 -# @License : Mulan PSL v2 -# @Desc : 不提供任何选项,仅指定aux文件 -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - LOG_INFO "开始测试texlive-ptex_pbibtex_no_option" - LOG_INFO "步骤1: 检查yum源中是否存在texlive-ptex包" - dnf list texlive-ptex - if [ $? -ne 0 ]; then - LOG_ERROR "yum源中未找到texlive-ptex包" - exit 255 - fi - LOG_INFO "步骤2: 检查yum源中是否存在texlive-pbibtex包" - dnf list texlive-pbibtex - if [ $? -ne 0 ]; then - LOG_ERROR "yum源中未找到texlive-pbibtex包" - exit 255 - fi - LOG_INFO "步骤3: 检查texlive-ptex和texlive-pbibtex是否已安装" - rpm -q texlive-ptex texlive-pbibtex - if [ $? -eq 0 ]; then - LOG_INFO "texlive-ptex和texlive-pbibtex已安装,标记为已安装状态" - INSTALLED=1 - else - LOG_INFO "texlive-ptex和texlive-pbibtex未安装,标记为未安装状态" - INSTALLED=0 - fi - if [ $INSTALLED -eq 0 ]; then - LOG_INFO "步骤4: 安装texlive-ptex和texlive-pbibtex包" - dnf install -y texlive-ptex texlive-pbibtex - CHECK_RESULT $? 0 0 "安装texlive-ptex和texlive-pbibtex失败" - fi - LOG_INFO "步骤5: 创建测试aux文件" - cat > test.aux << EOF - \relax - \citation{test} - \bibstyle{plain} - \bibdata{test} - EOF - CHECK_RESULT $? 0 0 "创建测试aux文件失败" - LOG_INFO "步骤6: 执行pbibtex命令,不提供任何选项,仅指定aux文件" - pbibtex test.aux - CHECK_RESULT $? 0 0 "pbibtex命令执行失败" - LOG_INFO "步骤7: 检查pbibtex命令是否生成了bbl文件" - ls test.bbl - CHECK_RESULT $? 0 0 "pbibtex未生成bbl文件" - LOG_INFO "步骤8: 清理测试文件" - rm -f test.aux test.bbl test.blg - CHECK_RESULT $? 0 0 "清理测试文件失败" - if [ $INSTALLED -eq 0 ]; then - LOG_INFO "步骤9: 卸载texlive-ptex和texlive-pbibtex包" - dnf remove -y texlive-ptex texlive-pbibtex - CHECK_RESULT $? 0 0 "卸载texlive-ptex和texlive-pbibtex失败" - fi - LOG_INFO "测试完成" -} - -main "$@" \ No newline at end of file diff --git a/testcases/function_test/pkg_test/texlive-base/texlive-ptex/test_texlive-ptex_pbibtex_terse.sh b/testcases/function_test/pkg_test/texlive-base/texlive-ptex/test_texlive-ptex_pbibtex_terse.sh deleted file mode 100644 index 19514cc15d9..00000000000 --- a/testcases/function_test/pkg_test/texlive-base/texlive-ptex/test_texlive-ptex_pbibtex_terse.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-08 -# @License : Mulan PSL v2 -# @Desc : 使用-terse参数静默执行,不打印进度报告 -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - # 检查是否已安装texlive-ptex和pbibtex - LOG_INFO "检查texlive-ptex和pbibtex是否已安装" - if dnf list installed texlive-ptex &> /dev/null && dnf list installed texlive-pbibtex &> /dev/null; then - LOG_INFO "texlive-ptex和pbibtex已安装,测试后将保持安装状态" - INSTALLED=true - else - LOG_INFO "texlive-ptex和pbibtex未安装,测试前将安装" - INSTALLED=false - fi - - # 检查yum源中是否有texlive-ptex和pbibtex软件包 - LOG_INFO "检查yum源中是否有texlive-ptex和pbibtex软件包" - if ! dnf search texlive-ptex 2>/dev/null | grep -q texlive-ptex; then - LOG_ERROR "yum源中未找到texlive-ptex软件包" - exit 255 - fi - if ! dnf search texlive-pbibtex 2>/dev/null | grep -q texlive-pbibtex; then - LOG_ERROR "yum源中未找到texlive-pbibtex软件包" - exit 255 - fi - - # 如果未安装,则安装软件包 - if [ "$INSTALLED" = false ]; then - LOG_INFO "开始安装texlive-ptex和texlive-pbibtex" - dnf install -y texlive-ptex texlive-pbibtex - CHECK_RESULT $? 0 0 "安装texlive-ptex和texlive-pbibtex失败" - fi - - # 测试pbibtex命令是否支持-terse参数 - LOG_INFO "测试pbibtex命令是否支持-terse参数" - pbibtex -help 2>&1 | grep -q -- "-terse" - CHECK_RESULT $? 0 0 "pbibtex命令不支持-terse参数" - - # 准备测试文件 - LOG_INFO "准备测试用的.aux文件" - cat > test.aux << "EOF" - \relax - \bibstyle{plain} - \bibdata{test} - EOF - - # 使用-terse参数静默执行pbibtex,不打印进度报告 - LOG_INFO "使用-terse参数执行pbibtex,检查是否静默执行" - output=$(pbibtex -terse test 2>&1) - if [ $? -ne 0 ]; then - LOG_ERROR "pbibtex -terse执行失败" - exit $? - fi - - # 检查输出是否不包含进度报告信息 - LOG_INFO "检查输出是否不包含进度报告" - if echo "$output" | grep -q "This is"; then - LOG_ERROR "pbibtex -terse未静默执行,输出了进度报告" - exit 1 - fi - - # 清理测试文件 - LOG_INFO "清理测试文件" - rm -f test.aux test.bbl test.blg - - # 如果测试前未安装,测试后卸载软件包 - if [ "$INSTALLED" = false ]; then - LOG_INFO "卸载texlive-ptex和texlive-pbibtex" - dnf remove -y texlive-ptex texlive-pbibtex - CHECK_RESULT $? 0 0 "卸载texlive-ptex和texlive-pbibtex失败" - fi - - LOG_INFO "测试完成" -} - -main "$@" \ No newline at end of file diff --git a/testcases/function_test/pkg_test/texlive-base/texlive-ptex/test_texlive-ptex_pbibtex_version.sh b/testcases/function_test/pkg_test/texlive-base/texlive-ptex/test_texlive-ptex_pbibtex_version.sh deleted file mode 100644 index ffdf8f5e37d..00000000000 --- a/testcases/function_test/pkg_test/texlive-base/texlive-ptex/test_texlive-ptex_pbibtex_version.sh +++ /dev/null @@ -1,76 +0,0 @@ -#!/usr/bin/bash - -# Copyright (c) 2024 ISCAS .ALL rights reserved. -# This program is licensed under Mulan PSL v2. -# You can use it according to the terms and conditions of the Mulan PSL v2. -# http://license.coscl.org.cn/MulanPSL2 -# THIS PROGRAM IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, -# EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, -# MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. -# See the Mulan PSL v2 for more details. - -# ############################################# -# @Author : honghua -# @Contact : honghua@iscas.ac.cn -# @Date : 2026-03-08 -# @License : Mulan PSL v2 -# @Desc : 使用-version参数显示版本信息 -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - # 判断当前环境是否已安装texlive-ptex-pbibtex包 - LOG_INFO "检查是否已安装texlive-ptex-pbibtex软件包" - if dnf list installed texlive-ptex-pbibtex &>/dev/null; then - LOG_INFO "texlive-ptex-pbibtex已安装,脚本结束后将保持安装状态" - INSTALLED_BEFORE=1 - else - LOG_INFO "texlive-ptex-pbibtex未安装,将在测试过程中安装并在测试后卸载" - INSTALLED_BEFORE=0 - fi - - # 检查yum源中是否存在texlive-ptex-pbibtex软件包 - LOG_INFO "检查yum源中是否存在texlive-ptex-pbibtex软件包" - if ! dnf list available texlive-ptex-pbibtex &>/dev/null; then - LOG_ERROR "yum源中未找到texlive-ptex-pbibtex软件包" - exit 255 - fi - - # 如果未安装,则安装软件包 - if [ $INSTALLED_BEFORE -eq 0 ]; then - LOG_INFO "安装texlive-ptex-pbibtex软件包" - dnf install -y texlive-ptex-pbibtex - CHECK_RESULT $? 0 0 "安装texlive-ptex-pbibtex失败" - fi - - # 检查pbibtex命令是否支持-version参数 - LOG_INFO "检查pbibtex命令是否支持-version参数" - pbibtex -version >/dev/null 2>&1 - if [ $? -eq 255 ]; then - LOG_ERROR "pbibtex命令不支持-version参数" - if [ $INSTALLED_BEFORE -eq 0 ]; then - LOG_INFO "清理环境,卸载texlive-ptex-pbibtex软件包" - dnf remove -y texlive-ptex-pbibtex - fi - exit 255 - fi - - # 使用-version参数显示版本信息 - LOG_INFO "执行pbibtex -version命令显示版本信息" - pbibtex -version - CHECK_RESULT $? 0 0 "pbibtex -version命令执行失败" - - # 清理环境:如果之前未安装,则卸载软件包 - if [ $INSTALLED_BEFORE -eq 0 ]; then - LOG_INFO "清理环境,卸载texlive-ptex-pbibtex软件包" - dnf remove -y texlive-ptex-pbibtex - CHECK_RESULT $? 0 0 "卸载texlive-ptex-pbibtex失败" - else - LOG_INFO "保持环境,不卸载texlive-ptex-pbibtex软件包" - fi - - LOG_INFO "测试脚本执行完成" -} - -main "$@" \ No newline at end of file diff --git a/testcases/function_test/pkg_test/texlive-base/texlive-ptex/test_texlive-ptex_pdvitomp_basic_conversion.sh b/testcases/function_test/pkg_test/texlive-base/texlive-ptex/test_texlive-ptex_pdvitomp_basic_conversion.sh deleted file mode 100644 index 0da6323105d..00000000000 --- a/testcases/function_test/pkg_test/texlive-base/texlive-ptex/test_texlive-ptex_pdvitomp_basic_conversion.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-08 -# @License : Mulan PSL v2 -# @Desc : 测试pdvitomp命令的基本功能,将指定的DVI文件转换为MPX文件 -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - # 检查是否已经安装texlive-ptex包 - LOG_INFO "检查是否已安装texlive-ptex软件包" - if dnf list installed texlive-ptex > /dev/null 2>&1; then - LOG_INFO "texlive-ptex软件包已安装,测试结束后将保持安装状态" - INSTALLED=true - else - LOG_INFO "texlive-ptex软件包未安装,将在测试过程中安装" - INSTALLED=false - fi - - # 检查yum源中是否有texlive-ptex软件包 - LOG_INFO "检查yum源中是否有texlive-ptex软件包" - if ! dnf list available texlive-ptex > /dev/null 2>&1; then - LOG_ERROR "yum源中未找到texlive-ptex软件包" - exit 255 - fi - - # 如果未安装,则安装texlive-ptex软件包 - if [ "$INSTALLED" = false ]; then - LOG_INFO "安装texlive-ptex软件包" - dnf install -y texlive-ptex - CHECK_RESULT $? 0 0 "安装texlive-ptex软件包失败" - fi - - # 检查pdvitomp命令是否存在 - LOG_INFO "检查pdvitomp命令是否存在" - if ! command -v pdvitomp > /dev/null 2>&1; then - LOG_ERROR "pdvitomp命令不存在" - if [ "$INSTALLED" = false ]; then - LOG_INFO "清理环境:卸载texlive-ptex软件包" - dnf remove -y texlive-ptex - fi - exit 255 - fi - - # 检查pdvitomp命令是否支持--version参数 - LOG_INFO "检查pdvitomp命令是否支持--version参数" - if ! pdvitomp --version > /dev/null 2>&1; then - LOG_ERROR "pdvitomp命令不支持--version参数" - if [ "$INSTALLED" = false ]; then - LOG_INFO "清理环境:卸载texlive-ptex软件包" - dnf remove -y texlive-ptex - fi - exit 255 - fi - - # 创建测试用的DVI文件 - LOG_INFO "创建测试用的DVI文件" - cat > test.tex << "EOF" - \documentclass{article} - \begin{document} - Hello, pdvitomp! - \end{document} - EOF - latex test.tex - CHECK_RESULT $? 0 0 "创建DVI文件失败" - - # 测试pdvitomp命令的基本功能:将DVI文件转换为MPX文件 - LOG_INFO "测试pdvitomp命令的基本功能:将DVI文件转换为MPX文件" - pdvitomp test test.dvi - CHECK_RESULT $? 0 0 "pdvitomp命令执行失败" - - # 检查是否生成了MPX文件 - LOG_INFO "检查是否生成了MPX文件" - if [ -f test.mpx ]; then - LOG_INFO "成功生成MPX文件:test.mpx" - else - LOG_ERROR "未生成MPX文件" - CHECK_RESULT 1 0 0 "未生成MPX文件" - fi - - # 清理测试文件 - LOG_INFO "清理测试文件" - rm -f test.tex test.aux test.log test.dvi test.mpx - - # 如果测试前未安装,则卸载texlive-ptex软件包 - if [ "$INSTALLED" = false ]; then - LOG_INFO "清理环境:卸载texlive-ptex软件包" - dnf remove -y texlive-ptex - CHECK_RESULT $? 0 0 "卸载texlive-ptex软件包失败" - fi - - LOG_INFO "测试脚本执行完成" -} - -main "$@" \ No newline at end of file diff --git a/testcases/function_test/pkg_test/texlive-base/texlive-ptex/test_texlive-ptex_pdvitomp_help.sh b/testcases/function_test/pkg_test/texlive-base/texlive-ptex/test_texlive-ptex_pdvitomp_help.sh deleted file mode 100644 index 196811b5d8c..00000000000 --- a/testcases/function_test/pkg_test/texlive-base/texlive-ptex/test_texlive-ptex_pdvitomp_help.sh +++ /dev/null @@ -1,84 +0,0 @@ -#!/usr/bin/bash - -# Copyright (c) 2024 ISCAS .ALL rights reserved. -# This program is licensed under Mulan PSL v2. -# You can use it according to the terms and conditions of the Mulan PSL v2. -# http://license.coscl.org.cn/MulanPSL2 -# THIS PROGRAM IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, -# EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, -# MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. -# See the Mulan PSL v2 for more details. - -# ############################################# -# @Author : honghua -# @Contact : honghua@iscas.ac.cn -# @Date : 2026-03-08 -# @License : Mulan PSL v2 -# @Desc : 测试pdvitomp命令的-help参数,用于显示帮助信息 -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - # 判断是否已经安装texlive-ptex软件包 - LOG_INFO "检查是否已安装texlive-ptex软件包" - rpm -q texlive-ptex - if [ $? -eq 0 ]; then - LOG_INFO "texlive-ptex软件包已安装" - installed_flag=1 - else - LOG_INFO "texlive-ptex软件包未安装" - installed_flag=0 - fi - - # 检查yum源中是否有texlive-ptex软件包 - LOG_INFO "检查yum源中是否有texlive-ptex软件包" - dnf list available texlive-ptex - if [ $? -ne 0 ]; then - LOG_ERROR "yum源中未找到texlive-ptex软件包" - exit 255 - fi - - # 如果未安装,则安装软件包 - if [ $installed_flag -eq 0 ]; then - LOG_INFO "安装texlive-ptex软件包" - dnf install -y texlive-ptex - CHECK_RESULT $? 0 0 "安装texlive-ptex软件包失败" - fi - - # 检查pdvitomp命令是否存在 - LOG_INFO "检查pdvitomp命令是否存在" - which pdvitomp - if [ $? -ne 0 ]; then - LOG_ERROR "pdvitomp命令不存在" - # 如果之前未安装,需要卸载刚安装的软件包 - if [ $installed_flag -eq 0 ]; then - LOG_INFO "卸载texlive-ptex软件包" - dnf remove -y texlive-ptex - fi - exit 255 - fi - - # 测试pdvitomp命令的-help参数 - LOG_INFO "测试pdvitomp命令的-help参数" - pdvitomp --help - CHECK_RESULT $? 0 0 "pdvitomp命令--help参数执行失败" - - # 检查-help参数是否显示帮助信息 - LOG_INFO "检查-help参数是否显示帮助信息" - pdvitomp --help 2>&1 | grep -q "Usage\|用法" - CHECK_RESULT $? 0 0 "pdvitomp命令--help参数未显示帮助信息" - - # 清理环境:如果测试前未安装,则卸载软件包 - if [ $installed_flag -eq 0 ]; then - LOG_INFO "清理环境:卸载texlive-ptex软件包" - dnf remove -y texlive-ptex - CHECK_RESULT $? 0 0 "卸载texlive-ptex软件包失败" - else - LOG_INFO "测试前已安装texlive-ptex,保持安装状态" - fi - - LOG_INFO "测试完成" -} - -main "$@" \ No newline at end of file diff --git a/testcases/function_test/pkg_test/texlive-base/texlive-ptex/test_texlive-ptex_pdvitomp_kanji_euc.sh b/testcases/function_test/pkg_test/texlive-base/texlive-ptex/test_texlive-ptex_pdvitomp_kanji_euc.sh deleted file mode 100644 index 0880e27a678..00000000000 --- a/testcases/function_test/pkg_test/texlive-base/texlive-ptex/test_texlive-ptex_pdvitomp_kanji_euc.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-08 -# @License : Mulan PSL v2 -# @Desc : 测试pdvitomp命令的-kanji参数,设置日文编码为euc -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - # 初始化变量 - PACKAGE_NAME="texlive-ptex" - COMMAND="pdvitomp" - EXPECTED_ENCODING="euc" - LOG_FILE="/tmp/test_texlive-ptex_pdvitomp_kanji_euc.log" - - # 清理日志文件 - : > $LOG_FILE - - # 检查软件包是否在yum源中 - LOG_INFO "步骤1:检查软件包是否在yum源中" - dnf list available $PACKAGE_NAME &>/dev/null - if [ $? -ne 0 ]; then - LOG_ERROR "软件包 $PACKAGE_NAME 不在yum源中" - exit 255 - fi - - # 检查当前是否已安装 - LOG_INFO "步骤2:检查当前是否已安装软件包" - rpm -q $PACKAGE_NAME &>/dev/null - if [ $? -eq 0 ]; then - INSTALLED=true - LOG_INFO "软件包已安装,将保持安装状态" - else - INSTALLED=false - LOG_INFO "软件包未安装,将在测试后卸载" - fi - - # 如果未安装,则安装软件包 - if [ "$INSTALLED" = "false" ]; then - LOG_INFO "步骤3:安装软件包" - dnf install -y $PACKAGE_NAME - CHECK_RESULT $? 0 0 "安装软件包失败" - fi - - # 检查pdvitomp命令是否存在 - LOG_INFO "步骤4:检查pdvitomp命令是否存在" - which $COMMAND &>/dev/null - CHECK_RESULT $? 0 0 "命令 $COMMAND 不存在" - - # 测试-kanji参数是否支持 - LOG_INFO "步骤5:测试-kanji参数是否支持" - $COMMAND -help 2>&1 | grep -q "\-kanji" - if [ $? -ne 0 ]; then - LOG_ERROR "命令 $COMMAND 不支持-kanji参数" - exit 255 - fi - - # 创建测试用的DVI文件 - LOG_INFO "步骤6:创建测试用的DVI文件" - cat > test.tex << "EOF" - \documentclass{article} - \begin{document} - Hello, world! - \end{document} - EOF - latex test.tex &>/dev/null - CHECK_RESULT $? 0 0 "创建DVI文件失败" - - # 测试pdvitomp命令的-kanji参数设置日文编码为euc - LOG_INFO "步骤7:测试pdvitomp命令的-kanji参数设置日文编码为euc" - $COMMAND -kanji=$EXPECTED_ENCODING test.dvi test.mp 2>&1 - CHECK_RESULT $? 0 0 "pdvitomp命令执行失败" - - # 验证输出文件是否存在 - LOG_INFO "步骤8:验证输出文件是否存在" - [ -f test.mp ] - CHECK_RESULT $? 0 0 "输出文件test.mp不存在" - - # 清理测试文件 - LOG_INFO "步骤9:清理测试文件" - rm -f test.tex test.aux test.log test.dvi test.mp - - # 如果测试前未安装,则卸载软件包 - if [ "$INSTALLED" = "false" ]; then - LOG_INFO "步骤10:卸载软件包" - 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-ptex/test_texlive-ptex_pdvitomp_kanji_jis.sh b/testcases/function_test/pkg_test/texlive-base/texlive-ptex/test_texlive-ptex_pdvitomp_kanji_jis.sh deleted file mode 100644 index 8755fb8c95a..00000000000 --- a/testcases/function_test/pkg_test/texlive-base/texlive-ptex/test_texlive-ptex_pdvitomp_kanji_jis.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-08 -# @License : Mulan PSL v2 -# @Desc : 测试pdvitomp命令的-kanji参数,设置日文编码为jis -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - LOG_INFO "开始测试pdvitomp命令的-kanji参数,设置日文编码为jis" - - # 检查是否已安装texlive-ptex软件包 - LOG_INFO "检查texlive-ptex软件包是否已安装" - if dnf list installed texlive-ptex &>/dev/null; then - LOG_INFO "texlive-ptex软件包已安装,测试结束后保持安装状态" - INSTALLED=true - else - LOG_INFO "texlive-ptex软件包未安装,将在测试过程中安装" - INSTALLED=false - fi - - # 检查yum源中是否有texlive-ptex软件包 - LOG_INFO "检查yum源中是否有texlive-ptex软件包" - if ! dnf list available texlive-ptex &>/dev/null; then - LOG_ERROR "yum源中未找到texlive-ptex软件包" - exit 255 - fi - - # 如果未安装,则安装软件包 - if [ "$INSTALLED" = false ]; then - LOG_INFO "安装texlive-ptex软件包" - dnf install -y texlive-ptex - CHECK_RESULT $? 0 0 "安装texlive-ptex软件包失败" - fi - - # 检查pdvitomp命令是否存在 - LOG_INFO "检查pdvitomp命令是否存在" - if ! command -v pdvitomp &>/dev/null; then - LOG_ERROR "pdvitomp命令不存在" - exit 255 - fi - - # 检查pdvitomp命令是否支持-kanji参数 - LOG_INFO "检查pdvitomp命令是否支持-kanji参数" - if ! pdvitomp --help 2>&1 | grep -q "\-kanji"; then - LOG_ERROR "pdvitomp命令不支持-kanji参数" - exit 255 - fi - - # 测试pdvitomp命令的-kanji参数,设置日文编码为jis - LOG_INFO "测试pdvitomp命令的-kanji参数,设置日文编码为jis" - pdvitomp -kanji=jis - CHECK_RESULT $? 0 0 "pdvitomp命令-kanji参数测试失败" - - # 清理环境:如果测试前未安装,则卸载软件包 - if [ "$INSTALLED" = false ]; then - LOG_INFO "卸载texlive-ptex软件包" - dnf remove -y texlive-ptex - CHECK_RESULT $? 0 0 "卸载texlive-ptex软件包失败" - fi - - LOG_INFO "测试完成,环境已恢复" -} - -main "$@" \ No newline at end of file diff --git a/testcases/function_test/pkg_test/texlive-base/texlive-ptex/test_texlive-ptex_pdvitomp_kanji_sjis.sh b/testcases/function_test/pkg_test/texlive-base/texlive-ptex/test_texlive-ptex_pdvitomp_kanji_sjis.sh deleted file mode 100644 index 8ebf038c0f1..00000000000 --- a/testcases/function_test/pkg_test/texlive-base/texlive-ptex/test_texlive-ptex_pdvitomp_kanji_sjis.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-08 -# @License : Mulan PSL v2 -# @Desc : 测试pdvitomp命令的-kanji参数,设置日文编码为sjis -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - # 检查是否已安装 texlive-ptex 软件包 - LOG_INFO "检查是否已安装 texlive-ptex 软件包" - rpm -q texlive-ptex > /dev/null 2>&1 - if [ $? -eq 0 ]; then - LOG_INFO "texlive-ptex 已安装,脚本结束时将保持安装状态" - INSTALLED=true - else - LOG_INFO "texlive-ptex 未安装,将在测试过程中安装" - INSTALLED=false - fi - - # 检查 yum 源中是否有 texlive-ptex 软件包 - LOG_INFO "检查 yum 源中是否有 texlive-ptex 软件包" - dnf list available texlive-ptex > /dev/null 2>&1 - CHECK_RESULT $? 0 0 "yum 源中未找到 texlive-ptex 软件包" - if [ $? -ne 0 ]; then - LOG_ERROR "yum 源中未找到 texlive-ptex 软件包,退出测试" - exit 255 - fi - - # 如果未安装,则安装 texlive-ptex 软件包 - if [ "$INSTALLED" = false ]; then - LOG_INFO "安装 texlive-ptex 软件包" - dnf install -y texlive-ptex - CHECK_RESULT $? 0 0 "安装 texlive-ptex 软件包失败" - fi - - # 检查 pdvitomp 命令是否存在 - LOG_INFO "检查 pdvitomp 命令是否存在" - which pdvitomp > /dev/null 2>&1 - CHECK_RESULT $? 0 0 "pdvitomp 命令不存在" - - # 测试 pdvitomp 命令的 -kanji 参数,设置日文编码为 sjis - LOG_INFO "测试 pdvitomp 命令的 -kanji 参数,设置日文编码为 sjis" - pdvitomp -kanji sjis --help > /dev/null 2>&1 - CHECK_RESULT $? 0 0 "pdvitomp 命令不支持 -kanji 参数或 sjis 编码" - - # 创建一个简单的测试文件 - LOG_INFO "创建一个简单的测试文件 test.dvi" - cat > test.dvi << "EOF" - % This is a simple DVI file for testing - EOF - CHECK_RESULT $? 0 0 "创建测试文件失败" - - # 使用 pdvitomp 命令转换测试文件 - LOG_INFO "使用 pdvitomp 命令转换测试文件,设置日文编码为 sjis" - pdvitomp -kanji sjis test.dvi test.mp 2>&1 - CHECK_RESULT $? 0 0 "pdvitomp 命令执行失败" - - # 检查转换后的文件是否存在 - LOG_INFO "检查转换后的文件是否存在" - [ -f test.mp ] - CHECK_RESULT $? 0 0 "转换后的文件不存在" - - # 清理测试文件 - LOG_INFO "清理测试文件" - rm -f test.dvi test.mp - CHECK_RESULT $? 0 0 "清理测试文件失败" - - # 如果测试前未安装,则卸载 texlive-ptex 软件包 - if [ "$INSTALLED" = false ]; then - LOG_INFO "卸载 texlive-ptex 软件包" - dnf remove -y texlive-ptex - CHECK_RESULT $? 0 0 "卸载 texlive-ptex 软件包失败" - fi - - LOG_INFO "测试完成" -} - -main "$@" \ No newline at end of file diff --git a/testcases/function_test/pkg_test/texlive-base/texlive-ptex/test_texlive-ptex_pdvitomp_kanji_utf8.sh b/testcases/function_test/pkg_test/texlive-base/texlive-ptex/test_texlive-ptex_pdvitomp_kanji_utf8.sh deleted file mode 100644 index 6210edbac4e..00000000000 --- a/testcases/function_test/pkg_test/texlive-base/texlive-ptex/test_texlive-ptex_pdvitomp_kanji_utf8.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-08 -# @License : Mulan PSL v2 -# @Desc : 测试pdvitomp命令的-kanji参数,设置日文编码为utf8 -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - # 检查是否已安装texlive-ptex - LOG_INFO "检查texlive-ptex是否已安装" - rpm -q texlive-ptex > /dev/null 2>&1 - if [ $? -eq 0 ]; then - LOG_INFO "texlive-ptex已安装,脚本结束后将保持安装状态" - INSTALLED=1 - else - LOG_INFO "texlive-ptex未安装,将在测试中安装" - INSTALLED=0 - fi - - # 检查yum源中是否有texlive-ptex软件包 - LOG_INFO "检查yum源中是否有texlive-ptex软件包" - dnf list available texlive-ptex > /dev/null 2>&1 - CHECK_RESULT $? 0 0 "yum源中未找到texlive-ptex软件包" - if [ $? -ne 0 ]; then - LOG_ERROR "yum源中未找到texlive-ptex软件包" - exit 255 - fi - - # 如果未安装,则安装texlive-ptex - if [ $INSTALLED -eq 0 ]; then - LOG_INFO "安装texlive-ptex软件包" - dnf install -y texlive-ptex - CHECK_RESULT $? 0 0 "安装texlive-ptex失败" - fi - - # 检查pdvitomp命令是否存在 - LOG_INFO "检查pdvitomp命令是否存在" - which pdvitomp > /dev/null 2>&1 - CHECK_RESULT $? 0 0 "pdvitomp命令不存在" - - # 检查pdvitomp命令是否支持-kanji参数 - LOG_INFO "检查pdvitomp命令是否支持-kanji参数" - pdvitomp --help 2>&1 | grep -q "\-kanji" - CHECK_RESULT $? 0 0 "pdvitomp命令不支持-kanji参数" - if [ $? -ne 0 ]; then - LOG_ERROR "pdvitomp命令不支持-kanji参数" - exit 255 - fi - - # 测试pdvitomp命令的-kanji参数,设置日文编码为utf8 - LOG_INFO "测试pdvitomp命令的-kanji参数,设置日文编码为utf8" - echo "% test" > test.tex - ptex test.tex - pdvitomp -kanji=utf8 test.dvi test.mp > /dev/null 2>&1 - CHECK_RESULT $? 0 0 "pdvitomp -kanji=utf8执行失败" - - # 清理测试文件 - LOG_INFO "清理测试文件" - rm -f test.tex test.dvi test.log test.aux test.mp - - # 如果脚本开始时未安装texlive-ptex,则在测试结束后卸载 - if [ $INSTALLED -eq 0 ]; then - LOG_INFO "卸载texlive-ptex软件包" - dnf remove -y texlive-ptex - CHECK_RESULT $? 0 0 "卸载texlive-ptex失败" - else - LOG_INFO "保持texlive-ptex安装状态" - fi -} - -main "$@" \ No newline at end of file diff --git a/testcases/function_test/pkg_test/texlive-base/texlive-ptex/test_texlive-ptex_pdvitomp_kpathsea_debug.sh b/testcases/function_test/pkg_test/texlive-base/texlive-ptex/test_texlive-ptex_pdvitomp_kpathsea_debug.sh deleted file mode 100644 index da166499533..00000000000 --- a/testcases/function_test/pkg_test/texlive-base/texlive-ptex/test_texlive-ptex_pdvitomp_kpathsea_debug.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-08 -# @License : Mulan PSL v2 -# @Desc : 测试pdvitomp命令的-kpathsea-debug参数,设置路径搜索调试标志 -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - LOG_INFO "开始测试pdvitomp命令的-kpathsea-debug参数功能" - - # 检查是否已安装texlive-ptex包 - LOG_INFO "检查texlive-ptex包是否已安装" - if rpm -q texlive-ptex > /dev/null 2>&1; then - LOG_INFO "texlive-ptex包已安装,测试后将保持安装状态" - INSTALLED=1 - else - LOG_INFO "texlive-ptex包未安装,将在测试过程中安装" - INSTALLED=0 - fi - - # 检查yum源中是否有texlive-ptex包 - LOG_INFO "检查yum源中是否有texlive-ptex包" - if ! dnf list available texlive-ptex > /dev/null 2>&1; then - LOG_ERROR "yum源中未找到texlive-ptex包" - exit 255 - fi - - # 如果未安装,则安装软件包 - if [ $INSTALLED -eq 0 ]; then - LOG_INFO "开始安装texlive-ptex包" - dnf install -y texlive-ptex - CHECK_RESULT $? 0 0 "安装texlive-ptex包失败" - fi - - # 检查pdvitomp命令是否存在 - LOG_INFO "检查pdvitomp命令是否存在" - which pdvitomp > /dev/null 2>&1 - CHECK_RESULT $? 0 0 "pdvitomp命令不存在" - - # 测试-kpathsea-debug参数 - LOG_INFO "测试pdvitomp命令的-kpathsea-debug参数" - pdvitomp --help 2>&1 | grep -q "\-kpathsea-debug" - if [ $? -ne 0 ]; then - LOG_ERROR "pdvitomp命令不支持-kpathsea-debug参数" - # 清理环境 - if [ $INSTALLED -eq 0 ]; then - LOG_INFO "清理环境:卸载texlive-ptex包" - dnf remove -y texlive-ptex - fi - exit 255 - fi - - # 执行带-kpathsea-debug参数的pdvitomp命令 - LOG_INFO "执行pdvitomp命令并设置-kpathsea-debug参数" - pdvitomp -kpathsea-debug 1 > /dev/null 2>&1 - CHECK_RESULT $? 1 0 "pdvitomp命令执行失败" - - LOG_INFO "pdvitomp命令的-kpathsea-debug参数测试成功" - - # 清理环境 - if [ $INSTALLED -eq 0 ]; then - LOG_INFO "清理环境:卸载texlive-ptex包" - dnf remove -y texlive-ptex - CHECK_RESULT $? 0 0 "卸载texlive-ptex包失败" - else - LOG_INFO "保持texlive-ptex包安装状态" - fi - - LOG_INFO "测试完成" -} - -main "$@" \ No newline at end of file diff --git a/testcases/function_test/pkg_test/texlive-base/texlive-ptex/test_texlive-ptex_pdvitomp_progname.sh b/testcases/function_test/pkg_test/texlive-base/texlive-ptex/test_texlive-ptex_pdvitomp_progname.sh deleted file mode 100644 index 18c540fab64..00000000000 --- a/testcases/function_test/pkg_test/texlive-base/texlive-ptex/test_texlive-ptex_pdvitomp_progname.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-08 -# @License : Mulan PSL v2 -# @Desc : 测试pdvitomp命令的-progname参数,用于设置程序名称 -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - # 判断是否已安装texlive-ptex软件包 - LOG_INFO "检查是否已安装texlive-ptex软件包" - rpm -q texlive-ptex - if [ $? -eq 0 ]; then - LOG_INFO "texlive-ptex已安装,脚本结束时将保持安装状态" - INSTALLED=1 - else - LOG_INFO "texlive-ptex未安装,将作为测试步骤安装" - INSTALLED=0 - fi - - # 检查yum源中是否有texlive-ptex软件包 - LOG_INFO "检查yum源中是否有texlive-ptex软件包" - dnf list available texlive-ptex - if [ $? -ne 0 ]; then - LOG_ERROR "yum源中未找到texlive-ptex软件包" - exit 255 - fi - - # 如果未安装,则安装软件包 - if [ $INSTALLED -eq 0 ]; then - LOG_INFO "安装texlive-ptex软件包" - dnf install -y texlive-ptex - CHECK_RESULT $? 0 0 "安装texlive-ptex失败" - fi - - # 检查pdvitomp命令是否存在 - LOG_INFO "检查pdvitomp命令是否存在" - which pdvitomp - CHECK_RESULT $? 0 0 "pdvitomp命令不存在" - - # 测试pdvitomp命令的-progname参数 - LOG_INFO "测试pdvitomp命令的-progname参数" - pdvitomp --help | grep -q "\-\-progname" - if [ $? -ne 0 ]; then - LOG_ERROR "pdvitomp命令不支持--progname参数" - exit 255 - fi - - # 创建测试用的dvi文件 - LOG_INFO "创建测试用的dvi文件" - cat > test.tex << "EOF" - \documentclass{article} - \begin{document} - Hello, World! - \end{document} - EOF - tex test.tex - CHECK_RESULT $? 0 0 "生成dvi文件失败" - - # 使用-progname参数运行pdvitomp命令 - LOG_INFO "使用-progname参数运行pdvitomp命令" - pdvitomp --progname=testprog test.dvi test.mp - CHECK_RESULT $? 0 0 "pdvitomp命令执行失败" - - # 验证生成的mp文件是否包含指定的程序名称 - LOG_INFO "验证生成的mp文件是否包含指定的程序名称" - grep -q "testprog" test.mp - CHECK_RESULT $? 0 0 "生成的mp文件中未找到指定的程序名称" - - # 清理测试文件 - LOG_INFO "清理测试文件" - rm -f test.tex test.log test.dvi test.mp - - # 如果脚本开始时未安装,则卸载软件包 - if [ $INSTALLED -eq 0 ]; then - LOG_INFO "卸载texlive-ptex软件包" - dnf remove -y texlive-ptex - CHECK_RESULT $? 0 0 "卸载texlive-ptex失败" - fi - - LOG_INFO "测试完成" -} - -main "$@" \ No newline at end of file diff --git a/testcases/function_test/pkg_test/texlive-base/texlive-ptex/test_texlive-ptex_pdvitomp_version.sh b/testcases/function_test/pkg_test/texlive-base/texlive-ptex/test_texlive-ptex_pdvitomp_version.sh deleted file mode 100644 index a29a4c1409b..00000000000 --- a/testcases/function_test/pkg_test/texlive-base/texlive-ptex/test_texlive-ptex_pdvitomp_version.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-08 -# @License : Mulan PSL v2 -# @Desc : 测试pdvitomp命令的-version参数,用于输出版本信息 -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - LOG_INFO "开始测试pdvitomp命令的-version参数,用于输出版本信息" - - # 检查软件包是否在yum源中 - LOG_INFO "检查yum源中是否存在texlive-ptex-pdvitomp软件包" - if ! dnf list texlive-ptex-pdvitomp &>/dev/null; then - LOG_ERROR "yum源中不存在texlive-ptex-pdvitomp软件包" - exit 255 - fi - - # 检查是否已安装软件包 - LOG_INFO "检查是否已安装texlive-ptex-pdvitomp软件包" - if rpm -q texlive-ptex-pdvitomp &>/dev/null; then - LOG_INFO "texlive-ptex-pdvitomp软件包已安装,测试完成后将保持安装状态" - already_installed=true - else - LOG_INFO "texlive-ptex-pdvitomp软件包未安装,将在测试前安装" - already_installed=false - fi - - # 如果未安装,则安装软件包 - if [ "$already_installed" = false ]; then - LOG_INFO "安装texlive-ptex-pdvitomp软件包" - dnf install -y texlive-ptex-pdvitomp - CHECK_RESULT $? 0 0 "安装texlive-ptex-pdvitomp软件包失败" - fi - - # 检查pdvitomp命令是否存在 - LOG_INFO "检查pdvitomp命令是否存在" - if ! command -v pdvitomp &>/dev/null; then - LOG_ERROR "pdvitomp命令不存在" - exit 255 - fi - - # 测试pdvitomp命令的-version参数 - LOG_INFO "测试pdvitomp命令的-version参数" - pdvitomp -version - CHECK_RESULT $? 0 0 "pdvitomp命令-version参数执行失败" - - # 如果之前未安装,则卸载软件包 - if [ "$already_installed" = false ]; then - LOG_INFO "卸载texlive-ptex-pdvitomp软件包" - dnf remove -y texlive-ptex-pdvitomp - CHECK_RESULT $? 0 0 "卸载texlive-ptex-pdvitomp软件包失败" - fi - - LOG_INFO "测试完成,环境已恢复" -} - -main "$@" \ No newline at end of file diff --git a/testcases/function_test/pkg_test/texlive-base/texlive-ptex/test_texlive-ptex_pdvitype_dpi.sh b/testcases/function_test/pkg_test/texlive-base/texlive-ptex/test_texlive-ptex_pdvitype_dpi.sh deleted file mode 100644 index 192dd1dbe77..00000000000 --- a/testcases/function_test/pkg_test/texlive-base/texlive-ptex/test_texlive-ptex_pdvitype_dpi.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-08 -# @License : Mulan PSL v2 -# @Desc : 测试 pdvitype 命令的 -dpi 参数,指定分辨率为 150.0 像素每英寸 -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - LOG_INFO "开始测试 pdvitype 命令的 -dpi 参数,指定分辨率为 150.0 像素每英寸" - - # 检查软件包是否在 yum 源中 - LOG_INFO "检查软件包 texlive-ptex 是否在 yum 源中" - dnf list available texlive-ptex > /dev/null 2>&1 - if [ $? -ne 0 ]; then - LOG_ERROR "软件包 texlive-ptex 不在 yum 源中" - exit 255 - fi - - # 检查是否已安装 texlive-ptex - LOG_INFO "检查 texlive-ptex 是否已安装" - rpm -q texlive-ptex > /dev/null 2>&1 - if [ $? -eq 0 ]; then - LOG_INFO "texlive-ptex 已安装,测试结束后保持安装状态" - INSTALLED=1 - else - LOG_INFO "texlive-ptex 未安装,将进行安装" - INSTALLED=0 - fi - - # 如果未安装,则安装软件包 - if [ $INSTALLED -eq 0 ]; then - LOG_INFO "安装 texlive-ptex" - dnf install -y texlive-ptex - CHECK_RESULT $? 0 0 "安装 texlive-ptex 失败" - fi - - # 检查 pdvitype 命令是否存在 - LOG_INFO "检查 pdvitype 命令是否存在" - command -v pdvitype > /dev/null 2>&1 - CHECK_RESULT $? 0 0 "pdvitype 命令不存在" - - # 检查 -dpi 参数是否支持 - LOG_INFO "检查 pdvitype 命令是否支持 -dpi 参数" - pdvitype --help 2>&1 | grep -q "\-dpi" - if [ $? -ne 0 ]; then - LOG_ERROR "pdvitype 命令不支持 -dpi 参数" - if [ $INSTALLED -eq 0 ]; then - LOG_INFO "卸载 texlive-ptex" - dnf remove -y texlive-ptex - fi - exit 255 - fi - - # 创建一个简单的 DVI 文件用于测试 - LOG_INFO "创建一个简单的 DVI 文件用于测试" - cat > test.tex << "EOF" - \documentclass{article} - \begin{document} - Hello, world! - \end{document} - EOF - pdflatex -interaction=nonstopmode test.tex > /dev/null 2>&1 - CHECK_RESULT $? 0 0 "创建 DVI 文件失败" - - # 测试 pdvitype 命令的 -dpi 参数 - LOG_INFO "测试 pdvitype 命令的 -dpi 参数,指定分辨率为 150.0 像素每英寸" - pdvitype -dpi=150.0 test.dvi > /dev/null 2>&1 - CHECK_RESULT $? 0 0 "pdvitype 命令执行失败" - - # 清理测试文件 - LOG_INFO "清理测试文件" - rm -f test.tex test.aux test.log test.dvi - - # 如果测试前未安装,则卸载软件包 - if [ $INSTALLED -eq 0 ]; then - LOG_INFO "卸载 texlive-ptex" - dnf remove -y texlive-ptex - CHECK_RESULT $? 0 0 "卸载 texlive-ptex 失败" - fi - - LOG_INFO "测试完成" -} - -main "$@" \ No newline at end of file diff --git a/testcases/function_test/pkg_test/texlive-base/texlive-ptex/test_texlive-ptex_pdvitype_dpi_kanji.sh b/testcases/function_test/pkg_test/texlive-base/texlive-ptex/test_texlive-ptex_pdvitype_dpi_kanji.sh deleted file mode 100644 index e3e23b40d65..00000000000 --- a/testcases/function_test/pkg_test/texlive-base/texlive-ptex/test_texlive-ptex_pdvitype_dpi_kanji.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-08 -# @License : Mulan PSL v2 -# @Desc : 测试 pdvitype 命令的 -dpi 和 -kanji 参数组合,同时指定分辨率和日文编码 -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - # 检查是否已安装texlive-ptex - LOG_INFO "检查texlive-ptex是否已安装" - rpm -q texlive-ptex > /dev/null 2>&1 - if [ $? -eq 0 ]; then - LOG_INFO "texlive-ptex已安装,测试后保持安装状态" - INSTALLED=1 - else - LOG_INFO "texlive-ptex未安装,将在测试后卸载" - INSTALLED=0 - fi - - # 检查yum源中是否有texlive-ptex软件包 - LOG_INFO "检查yum源中是否有texlive-ptex软件包" - dnf list available texlive-ptex > /dev/null 2>&1 - if [ $? -ne 0 ]; then - LOG_ERROR "yum源中未找到texlive-ptex软件包" - exit 255 - fi - - # 如果未安装,则安装软件包 - if [ $INSTALLED -eq 0 ]; then - LOG_INFO "安装texlive-ptex软件包" - dnf install -y texlive-ptex - CHECK_RESULT $? 0 0 "安装texlive-ptex失败" - fi - - # 检查pdvitype命令是否存在 - LOG_INFO "检查pdvitype命令是否存在" - which pdvitype > /dev/null 2>&1 - if [ $? -ne 0 ]; then - LOG_ERROR "pdvitype命令不存在" - if [ $INSTALLED -eq 0 ]; then - LOG_INFO "清理环境,卸载texlive-ptex" - dnf remove -y texlive-ptex - fi - exit 255 - fi - - # 检查-dpi参数是否支持 - LOG_INFO "检查pdvitype命令是否支持-dpi参数" - pdvitype --help 2>&1 | grep -q "\-dpi" - if [ $? -ne 0 ]; then - LOG_ERROR "pdvitype命令不支持-dpi参数" - if [ $INSTALLED -eq 0 ]; then - LOG_INFO "清理环境,卸载texlive-ptex" - dnf remove -y texlive-ptex - fi - exit 255 - fi - - # 检查-kanji参数是否支持 - LOG_INFO "检查pdvitype命令是否支持-kanji参数" - pdvitype --help 2>&1 | grep -q "\-kanji" - if [ $? -ne 0 ]; then - LOG_ERROR "pdvitype命令不支持-kanji参数" - if [ $INSTALLED -eq 0 ]; then - LOG_INFO "清理环境,卸载texlive-ptex" - dnf remove -y texlive-ptex - fi - exit 255 - fi - - # 创建测试用的DVI文件 - LOG_INFO "创建测试用的DVI文件" - cat > test.tex << "EOF" - \documentclass{article} - \begin{document} - Hello, World! - \end{document} - EOF - ptex test.tex > /dev/null 2>&1 - CHECK_RESULT $? 0 0 "创建测试DVI文件失败" - - # 测试pdvitype命令的-dpi和-kanji参数组合 - LOG_INFO "测试pdvitype命令的-dpi和-kanji参数组合" - pdvitype -dpi 300 -kanji euc test.dvi > output.txt 2>&1 - CHECK_RESULT $? 0 0 "pdvitype命令执行失败" - - # 检查输出文件是否包含分辨率信息 - LOG_INFO "检查输出是否包含分辨率信息" - grep -q "resolution.*300" output.txt - CHECK_RESULT $? 0 0 "输出中未找到分辨率信息" - - # 检查输出文件是否包含日文编码信息 - LOG_INFO "检查输出是否包含日文编码信息" - grep -qi "kanji.*euc" output.txt - CHECK_RESULT $? 0 0 "输出中未找到日文编码信息" - - # 清理测试文件 - LOG_INFO "清理测试文件" - rm -f test.tex test.dvi test.log output.txt - - # 如果测试前未安装,则卸载软件包 - if [ $INSTALLED -eq 0 ]; then - LOG_INFO "清理环境,卸载texlive-ptex" - dnf remove -y texlive-ptex - CHECK_RESULT $? 0 0 "卸载texlive-ptex失败" - fi - - LOG_INFO "测试完成" -} - -main "$@" \ No newline at end of file diff --git a/testcases/function_test/pkg_test/texlive-base/texlive-ptex/test_texlive-ptex_pdvitype_help.sh b/testcases/function_test/pkg_test/texlive-base/texlive-ptex/test_texlive-ptex_pdvitype_help.sh deleted file mode 100644 index 28306929056..00000000000 --- a/testcases/function_test/pkg_test/texlive-base/texlive-ptex/test_texlive-ptex_pdvitype_help.sh +++ /dev/null @@ -1,79 +0,0 @@ -#!/usr/bin/bash - -# Copyright (c) 2024 ISCAS .ALL rights reserved. -# This program is licensed under Mulan PSL v2. -# You can use it according to the terms and conditions of the Mulan PSL v2. -# http://license.coscl.org.cn/MulanPSL2 -# THIS PROGRAM IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, -# EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, -# MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. -# See the Mulan PSL v2 for more details. - -# ############################################# -# @Author : honghua -# @Contact : honghua@iscas.ac.cn -# @Date : 2026-03-08 -# @License : Mulan PSL v2 -# @Desc : 测试 pdvitype 命令的 -help 参数,显示帮助信息 -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - set -e - - LOG_INFO "开始测试 pdvitype 命令的 -help 参数" - - # 检查软件包是否在 yum 源中 - LOG_INFO "步骤1:检查 yum 源中是否存在 texlive-ptex 软件包" - if ! dnf list available texlive-ptex &>/dev/null; then - LOG_ERROR "yum 源中未找到 texlive-ptex 软件包" - exit 255 - fi - LOG_INFO "texlive-ptex 软件包在 yum 源中存在" - - # 检查软件包是否已安装 - LOG_INFO "步骤2:检查 texlive-ptex 软件包是否已安装" - if rpm -q texlive-ptex &>/dev/null; then - LOG_INFO "texlive-ptex 软件包已安装,测试结束后将保持安装状态" - INSTALLED_BEFORE_TEST=true - else - LOG_INFO "texlive-ptex 软件包未安装,将在测试中安装,并在测试结束后卸载" - INSTALLED_BEFORE_TEST=false - fi - - # 如果未安装,则安装软件包 - if [ "$INSTALLED_BEFORE_TEST" = false ]; then - LOG_INFO "步骤3:安装 texlive-ptex 软件包" - dnf install -y texlive-ptex - CHECK_RESULT $? 0 0 "安装 texlive-ptex 软件包失败" - fi - - # 检查 pdvitype 命令是否存在 - LOG_INFO "步骤4:检查 pdvitype 命令是否存在" - if ! command -v pdvitype &>/dev/null; then - LOG_ERROR "pdvitype 命令不存在" - if [ "$INSTALLED_BEFORE_TEST" = false ]; then - dnf remove -y texlive-ptex - fi - exit 255 - fi - - # 测试 pdvitype -help 参数 - LOG_INFO "步骤5:执行 pdvitype -help 命令" - pdvitype -help - CHECK_RESULT $? 0 0 "执行 pdvitype -help 命令失败" - - # 清理环境:如果测试前未安装,则卸载软件包 - if [ "$INSTALLED_BEFORE_TEST" = false ]; then - LOG_INFO "步骤6:清理环境,卸载 texlive-ptex 软件包" - dnf remove -y texlive-ptex - CHECK_RESULT $? 0 0 "卸载 texlive-ptex 软件包失败" - else - LOG_INFO "步骤6:测试前软件包已安装,保持安装状态,无需卸载" - fi - - LOG_INFO "测试 pdvitype 命令的 -help 参数完成" -} - -main "$@" \ No newline at end of file diff --git a/testcases/function_test/pkg_test/texlive-base/texlive-ptex/test_texlive-ptex_pdvitype_kanji.sh b/testcases/function_test/pkg_test/texlive-base/texlive-ptex/test_texlive-ptex_pdvitype_kanji.sh deleted file mode 100644 index bb6eed8bbe9..00000000000 --- a/testcases/function_test/pkg_test/texlive-base/texlive-ptex/test_texlive-ptex_pdvitype_kanji.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-08 -# @License : Mulan PSL v2 -# @Desc : 测试 pdvitype 命令的 -kanji 参数,指定日文编码为 utf8 -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - # 检查是否已安装texlive-ptex和texlive-ptex-doc包 - LOG_INFO "检查是否已安装texlive-ptex和texlive-ptex-doc软件包" - rpm -q texlive-ptex texlive-ptex-doc > /dev/null 2>&1 - INSTALLED=$? - - if [ $INSTALLED -eq 0 ]; then - LOG_INFO "软件包已安装,将在测试后保持安装状态" - KEEP_INSTALLED=1 - else - LOG_INFO "软件包未安装,将在测试后卸载" - KEEP_INSTALLED=0 - fi - - # 检查yum源中是否有texlive-ptex和texlive-ptex-doc包 - LOG_INFO "检查yum源中是否有texlive-ptex和texlive-ptex-doc软件包" - dnf list available texlive-ptex texlive-ptex-doc > /dev/null 2>&1 - if [ $? -ne 0 ]; then - LOG_ERROR "yum源中缺少texlive-ptex或texlive-ptex-doc软件包" - exit 255 - fi - - # 如果未安装,则安装软件包 - if [ $INSTALLED -ne 0 ]; then - LOG_INFO "安装texlive-ptex和texlive-ptex-doc软件包" - dnf install -y texlive-ptex texlive-ptex-doc - CHECK_RESULT $? 0 0 "安装texlive-ptex和texlive-ptex-doc失败" - fi - - # 检查pdvitype命令是否存在 - LOG_INFO "检查pdvitype命令是否存在" - which pdvitype > /dev/null 2>&1 - if [ $? -ne 0 ]; then - LOG_ERROR "pdvitype命令不存在" - if [ $KEEP_INSTALLED -eq 0 ]; then - dnf remove -y texlive-ptex texlive-ptex-doc - fi - exit 255 - fi - - # 检查pdvitype命令是否支持-kanji参数 - LOG_INFO "检查pdvitype命令是否支持-kanji参数" - pdvitype -kanji=utf8 --help > /dev/null 2>&1 - if [ $? -ne 0 ]; then - LOG_ERROR "pdvitype命令不支持-kanji参数" - if [ $KEEP_INSTALLED -eq 0 ]; then - dnf remove -y texlive-ptex texlive-ptex-doc - fi - exit 255 - fi - - # 创建一个简单的DVI文件用于测试 - LOG_INFO "创建一个简单的DVI文件用于测试" - cat > test.tex << "EOF" - \documentclass{article} - \begin{document} - Hello, World! - \end{document} - EOF - platex test.tex > /dev/null 2>&1 - CHECK_RESULT $? 0 0 "创建DVI文件失败" - - # 测试pdvitype命令的-kanji参数,指定日文编码为utf8 - LOG_INFO "测试pdvitype命令的-kanji参数,指定日文编码为utf8" - pdvitype -kanji=utf8 test.dvi > output.txt 2>&1 - CHECK_RESULT $? 0 0 "pdvitype命令执行失败" - - # 检查输出文件是否包含预期的内容 - LOG_INFO "检查pdvitype命令输出是否正常" - if [ -s output.txt ]; then - LOG_INFO "pdvitype命令执行成功,输出文件非空" - else - LOG_ERROR "pdvitype命令执行失败,输出文件为空" - if [ $KEEP_INSTALLED -eq 0 ]; then - dnf remove -y texlive-ptex texlive-ptex-doc - fi - exit 1 - fi - - # 清理测试文件 - LOG_INFO "清理测试文件" - rm -f test.tex test.log test.aux test.dvi output.txt - - # 如果测试前未安装,则卸载软件包 - if [ $KEEP_INSTALLED -eq 0 ]; then - LOG_INFO "卸载texlive-ptex和texlive-ptex-doc软件包" - dnf remove -y texlive-ptex texlive-ptex-doc - CHECK_RESULT $? 0 0 "卸载texlive-ptex和texlive-ptex-doc失败" - else - LOG_INFO "保持软件包安装状态" - fi - - LOG_INFO "测试完成" -} - -main "$@" \ No newline at end of file diff --git a/testcases/function_test/pkg_test/texlive-base/texlive-ptex/test_texlive-ptex_pdvitype_magnification.sh b/testcases/function_test/pkg_test/texlive-base/texlive-ptex/test_texlive-ptex_pdvitype_magnification.sh deleted file mode 100644 index 6b5daede4c3..00000000000 --- a/testcases/function_test/pkg_test/texlive-base/texlive-ptex/test_texlive-ptex_pdvitype_magnification.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-08 -# @License : Mulan PSL v2 -# @Desc : 测试 pdvitype 命令的 -magnification 参数,指定放大倍数为 1000 -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - LOG_INFO "开始测试 pdvitype 命令的 -magnification 参数,指定放大倍数为 1000" - LOG_INFO "步骤1:检查系统中是否已安装 texlive-ptex 软件包" - rpm -q texlive-ptex - if [ $? -eq 0 ]; then - LOG_INFO "texlive-ptex 已安装,测试后将保持安装状态" - INSTALLED=1 - else - LOG_INFO "texlive-ptex 未安装,将在测试过程中安装" - INSTALLED=0 - fi - - LOG_INFO "步骤2:检查 yum 源中是否存在 texlive-ptex 软件包" - dnf list available texlive-ptex &>/dev/null - if [ $? -ne 0 ]; then - LOG_ERROR "yum 源中未找到 texlive-ptex 软件包" - exit 255 - fi - - if [ $INSTALLED -eq 0 ]; then - LOG_INFO "步骤3:安装 texlive-ptex 软件包" - dnf install -y texlive-ptex - CHECK_RESULT $? 0 0 "安装 texlive-ptex 失败" - fi - - LOG_INFO "步骤4:检查 pdvitype 命令是否支持 -magnification 参数" - pdvitype --help 2>&1 | grep -q "\-magnification" - if [ $? -ne 0 ]; then - LOG_ERROR "pdvitype 命令不支持 -magnification 参数" - exit 255 - fi - - LOG_INFO "步骤5:创建一个简单的 DVI 测试文件" - cat > test.dvi << "EOF" - % This is a minimal DVI file - EOF - CHECK_RESULT $? 0 0 "创建 DVI 测试文件失败" - - LOG_INFO "步骤6:使用 pdvitype 命令的 -magnification 参数,指定放大倍数为 1000" - pdvitype -magnification=1000 test.dvi - CHECK_RESULT $? 0 0 "pdvitype 命令执行失败" - - LOG_INFO "步骤7:清理测试过程中创建的临时文件" - rm -f test.dvi - CHECK_RESULT $? 0 0 "删除临时文件失败" - - if [ $INSTALLED -eq 0 ]; then - LOG_INFO "步骤8:卸载 texlive-ptex 软件包,恢复环境" - dnf remove -y texlive-ptex - CHECK_RESULT $? 0 0 "卸载 texlive-ptex 失败" - else - LOG_INFO "步骤8:环境已安装 texlive-ptex,保持安装状态" - fi - - LOG_INFO "测试完成" -} - -main "$@" \ No newline at end of file diff --git a/testcases/function_test/pkg_test/texlive-base/texlive-ptex/test_texlive-ptex_pdvitype_max_pages.sh b/testcases/function_test/pkg_test/texlive-base/texlive-ptex/test_texlive-ptex_pdvitype_max_pages.sh deleted file mode 100644 index 8311eb1d0c5..00000000000 --- a/testcases/function_test/pkg_test/texlive-base/texlive-ptex/test_texlive-ptex_pdvitype_max_pages.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-08 -# @License : Mulan PSL v2 -# @Desc : 测试 pdvitype 命令的 -max-pages 参数,限制处理页数为 5 -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - # 判断是否已安装texlive-ptex包 - LOG_INFO "检查是否已安装texlive-ptex软件包" - rpm -q texlive-ptex &>/dev/null - if [ $? -eq 0 ]; then - LOG_INFO "texlive-ptex已安装,测试后保持安装状态" - INSTALLED=1 - else - LOG_INFO "texlive-ptex未安装,将在测试前安装" - INSTALLED=0 - fi - - # 检查yum源中是否有texlive-ptex包 - LOG_INFO "检查yum源中是否有texlive-ptex软件包" - dnf list available texlive-ptex &>/dev/null - CHECK_RESULT $? 0 255 "yum源中无texlive-ptex软件包" - - # 如果未安装,则安装软件包 - if [ $INSTALLED -eq 0 ]; then - LOG_INFO "安装texlive-ptex软件包" - dnf install -y texlive-ptex - CHECK_RESULT $? 0 0 "安装texlive-ptex失败" - fi - - # 检查pdvitype命令是否存在 - LOG_INFO "检查pdvitype命令是否存在" - command -v pdvitype &>/dev/null - CHECK_RESULT $? 0 255 "pdvitype命令不存在" - - # 检查pdvitype命令是否支持-max-pages参数 - LOG_INFO "检查pdvitype命令是否支持-max-pages参数" - pdvitype --help 2>&1 | grep -q "\-max-pages" - CHECK_RESULT $? 0 255 "pdvitype命令不支持-max-pages参数" - - # 创建测试用的DVI文件 - LOG_INFO "创建测试用的DVI文件" - cat > test.tex << "EOF" - \documentclass{article} - \begin{document} - Page 1 - \newpage - Page 2 - \newpage - Page 3 - \newpage - Page 4 - \newpage - Page 5 - \newpage - Page 6 - \newpage - Page 7 - \end{document} - EOF - - tex test.tex - CHECK_RESULT $? 0 0 "生成DVI文件失败" - - # 测试pdvitype命令的-max-pages参数,限制处理页数为5 - LOG_INFO "测试pdvitype命令的-max-pages参数,限制处理页数为5" - pdvitype -max-pages=5 test.dvi 2>&1 | tee output.log - CHECK_RESULT $? 0 0 "pdvitype命令执行失败" - - # 检查输出结果 - LOG_INFO "检查输出结果" - grep -q "Page 5" output.log - CHECK_RESULT $? 0 0 "输出中应包含Page 5" - grep -q "Page 6" output.log - if [ $? -eq 0 ]; then - LOG_ERROR "输出中不应包含Page 6" - exit 1 - fi - - # 清理测试文件 - LOG_INFO "清理测试文件" - rm -f test.tex test.log test.aux test.dvi output.log - - # 如果测试前未安装,则卸载软件包 - if [ $INSTALLED -eq 0 ]; then - LOG_INFO "卸载texlive-ptex软件包" - dnf remove -y texlive-ptex - CHECK_RESULT $? 0 0 "卸载texlive-ptex失败" - fi - - LOG_INFO "测试完成" -} - -main "$@" \ No newline at end of file diff --git a/testcases/function_test/pkg_test/texlive-base/texlive-ptex/test_texlive-ptex_pdvitype_output_level.sh b/testcases/function_test/pkg_test/texlive-base/texlive-ptex/test_texlive-ptex_pdvitype_output_level.sh deleted file mode 100644 index 9ec62eb236a..00000000000 --- a/testcases/function_test/pkg_test/texlive-base/texlive-ptex/test_texlive-ptex_pdvitype_output_level.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-08 -# @License : Mulan PSL v2 -# @Desc : 测试 pdvitype 命令的 -output-level 参数,设置输出详细级别为 2 -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - LOG_INFO "开始测试 pdvitype 命令的 -output-level 参数,设置输出详细级别为 2" - LOG_INFO "步骤1: 检查环境中是否已安装 texlive-ptex 软件包" - rpm -q texlive-ptex > /dev/null 2>&1 - if [ $? -eq 0 ]; then - LOG_INFO "texlive-ptex 已安装,脚本结束后将保持安装状态" - INSTALLED=1 - else - LOG_INFO "texlive-ptex 未安装,将在测试步骤中安装" - INSTALLED=0 - fi - - LOG_INFO "步骤2: 检查 yum 源中是否有 texlive-ptex 软件包" - dnf list available texlive-ptex > /dev/null 2>&1 - if [ $? -ne 0 ]; then - LOG_ERROR "yum 源中未找到 texlive-ptex 软件包" - exit 255 - fi - - if [ $INSTALLED -eq 0 ]; then - LOG_INFO "步骤3: 安装 texlive-ptex 软件包" - dnf install -y texlive-ptex - CHECK_RESULT $? 0 0 "安装 texlive-ptex 失败" - fi - - LOG_INFO "步骤4: 检查 pdvitype 命令是否存在" - command -v pdvitype > /dev/null 2>&1 - CHECK_RESULT $? 0 0 "pdvitype 命令不存在" - - LOG_INFO "步骤5: 检查 pdvitype 命令是否支持 -output-level 参数" - pdvitype --help 2>&1 | grep -q "\-output-level" - if [ $? -ne 0 ]; then - LOG_ERROR "pdvitype 命令不支持 -output-level 参数" - if [ $INSTALLED -eq 0 ]; then - LOG_INFO "清理环境: 卸载 texlive-ptex 软件包" - dnf remove -y texlive-ptex - fi - exit 255 - fi - - LOG_INFO "步骤6: 创建一个简单的 DVI 测试文件用于测试" - cat > test.dvi << "EOF" - % This is a minimal DVI file - % DVI version 2 - % DVI created by test script - EOF - CHECK_RESULT $? 0 0 "创建测试 DVI 文件失败" - - LOG_INFO "步骤7: 执行 pdvitype 命令,设置 -output-level 参数为 2" - pdvitype -output-level=2 test.dvi > output.txt 2>&1 - CHECK_RESULT $? 0 0 "pdvitype 命令执行失败" - - LOG_INFO "步骤8: 检查命令输出是否符合预期" - if [ -s output.txt ]; then - LOG_INFO "pdvitype 命令成功执行并产生输出" - else - LOG_ERROR "pdvitype 命令未产生输出" - rm -f test.dvi output.txt - if [ $INSTALLED -eq 0 ]; then - LOG_INFO "清理环境: 卸载 texlive-ptex 软件包" - dnf remove -y texlive-ptex - fi - exit 1 - fi - - LOG_INFO "步骤9: 清理测试文件" - rm -f test.dvi output.txt - - if [ $INSTALLED -eq 0 ]; then - LOG_INFO "步骤10: 卸载 texlive-ptex 软件包" - dnf remove -y texlive-ptex - CHECK_RESULT $? 0 0 "卸载 texlive-ptex 失败" - else - LOG_INFO "环境已安装 texlive-ptex,保持安装状态" - fi - - LOG_INFO "测试完成" -} - -main "$@" \ No newline at end of file diff --git a/testcases/function_test/pkg_test/texlive-base/texlive-ptex/test_texlive-ptex_pdvitype_page_start.sh b/testcases/function_test/pkg_test/texlive-base/texlive-ptex/test_texlive-ptex_pdvitype_page_start.sh deleted file mode 100644 index 4e8ec8b9cef..00000000000 --- a/testcases/function_test/pkg_test/texlive-base/texlive-ptex/test_texlive-ptex_pdvitype_page_start.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-08 -# @License : Mulan PSL v2 -# @Desc : 测试 pdvitype 命令的 -page-start 参数,设置起始页面为 2 -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - # 定义软件包名称 - PACKAGE_NAME="texlive-ptex" - - # 步骤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_BEFORE=true - else - LOG_INFO "软件包 $PACKAGE_NAME 未安装,将在测试过程中安装并在测试结束后卸载" - INSTALLED_BEFORE=false - fi - - # 步骤3:如果未安装,则安装软件包 - if [ "$INSTALLED_BEFORE" = "false" ]; then - LOG_INFO "步骤3:安装软件包 $PACKAGE_NAME" - dnf install -y $PACKAGE_NAME - CHECK_RESULT $? 0 0 "安装软件包 $PACKAGE_NAME 失败" - fi - - # 步骤4:检查 pdvitype 命令是否支持 -page-start 参数 - LOG_INFO "步骤4:检查 pdvitype 命令是否支持 -page-start 参数" - pdvitype --help 2>&1 | grep -q "\-page-start" - if [ $? -ne 0 ]; then - LOG_ERROR "pdvitype 命令不支持 -page-start 参数" - # 如果之前未安装,则卸载软件包 - if [ "$INSTALLED_BEFORE" = "false" ]; then - dnf remove -y $PACKAGE_NAME - fi - exit 255 - fi - - # 步骤5:创建一个简单的 DVI 文件用于测试 - LOG_INFO "步骤5:创建一个简单的 DVI 文件用于测试" - cat > test.tex << "EOF" - \documentclass{article} - \begin{document} - Page 1 - \newpage - Page 2 - \newpage - Page 3 - \end{document} - EOF - ptex test.tex - CHECK_RESULT $? 0 0 "创建 DVI 文件失败" - - # 步骤6:测试 pdvitype 命令的 -page-start 参数,设置起始页面为 2 - LOG_INFO "步骤6:测试 pdvitype 命令的 -page-start 参数,设置起始页面为 2" - pdvitype -page-start=2 test.dvi > output.txt 2>&1 - CHECK_RESULT $? 0 0 "pdvitype 命令执行失败" - - # 步骤7:验证输出是否从第二页开始 - LOG_INFO "步骤7:验证输出是否从第二页开始" - grep -q "Page 2" output.txt - CHECK_RESULT $? 0 0 "输出未从第二页开始" - grep -q "Page 1" output.txt - if [ $? -eq 0 ]; then - LOG_ERROR "输出中包含了第一页的内容" - CHECK_RESULT 1 0 0 "输出验证失败" - fi - - # 步骤8:清理测试文件 - LOG_INFO "步骤8:清理测试文件" - rm -f test.tex test.dvi output.txt - - # 步骤9:如果测试前未安装,则卸载软件包 - if [ "$INSTALLED_BEFORE" = "false" ]; then - LOG_INFO "步骤9:卸载软件包 $PACKAGE_NAME" - dnf remove -y $PACKAGE_NAME - CHECK_RESULT $? 0 0 "卸载软件包 $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-ptex/test_texlive-ptex_pdvitype_show_opcodes.sh b/testcases/function_test/pkg_test/texlive-base/texlive-ptex/test_texlive-ptex_pdvitype_show_opcodes.sh deleted file mode 100644 index f8a7b565b63..00000000000 --- a/testcases/function_test/pkg_test/texlive-base/texlive-ptex/test_texlive-ptex_pdvitype_show_opcodes.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-08 -# @License : Mulan PSL v2 -# @Desc : 测试 pdvitype 命令的 -show-opcodes 参数,显示数字操作码 -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - LOG_INFO "开始测试 pdvitype 命令的 -show-opcodes 参数" - LOG_INFO "步骤1: 检查系统中是否已安装 texlive-ptex 软件包" - rpm -q texlive-ptex - if [ $? -eq 0 ]; then - LOG_INFO "texlive-ptex 已安装,测试后保持安装状态" - INSTALLED=1 - else - LOG_INFO "texlive-ptex 未安装,将在测试过程中安装" - INSTALLED=0 - fi - - LOG_INFO "步骤2: 检查 yum 源中是否存在 texlive-ptex 软件包" - dnf list available texlive-ptex - if [ $? -ne 0 ]; then - LOG_ERROR "yum 源中未找到 texlive-ptex 软件包" - exit 255 - fi - - if [ $INSTALLED -eq 0 ]; then - LOG_INFO "步骤3: 安装 texlive-ptex 软件包" - dnf install -y texlive-ptex - CHECK_RESULT $? 0 0 "安装 texlive-ptex 失败" - fi - - LOG_INFO "步骤4: 检查 pdvitype 命令是否支持 -show-opcodes 参数" - pdvitype --help | grep -q "\-show-opcodes" - if [ $? -ne 0 ]; then - LOG_ERROR "pdvitype 命令不支持 -show-opcodes 参数" - if [ $INSTALLED -eq 0 ]; then - dnf remove -y texlive-ptex - fi - exit 255 - fi - - LOG_INFO "步骤5: 创建一个简单的 DVI 文件用于测试" - cat > test.tex << "EOF" - \documentclass{article} - \begin{document} - Hello, world! - \end{document} - EOF - latex test.tex - CHECK_RESULT $? 0 0 "生成 test.dvi 文件失败" - - LOG_INFO "步骤6: 执行 pdvitype -show-opcodes 命令" - pdvitype -show-opcodes test.dvi - CHECK_RESULT $? 0 0 "pdvitype -show-opcodes 命令执行失败" - - LOG_INFO "步骤7: 清理测试文件" - rm -f test.tex test.aux test.log test.dvi - - if [ $INSTALLED -eq 0 ]; then - LOG_INFO "步骤8: 卸载 texlive-ptex 软件包" - dnf remove -y texlive-ptex - CHECK_RESULT $? 0 0 "卸载 texlive-ptex 失败" - fi - - LOG_INFO "测试完成" -} - -main "$@" \ No newline at end of file diff --git a/testcases/function_test/pkg_test/texlive-base/texlive-ptex/test_texlive-ptex_pdvitype_version.sh b/testcases/function_test/pkg_test/texlive-base/texlive-ptex/test_texlive-ptex_pdvitype_version.sh deleted file mode 100644 index 074c3de44e7..00000000000 --- a/testcases/function_test/pkg_test/texlive-base/texlive-ptex/test_texlive-ptex_pdvitype_version.sh +++ /dev/null @@ -1,75 +0,0 @@ -#!/usr/bin/bash - -# Copyright (c) 2024 ISCAS .ALL rights reserved. -# This program is licensed under Mulan PSL v2. -# You can use it according to the terms and conditions of the Mulan PSL v2. -# http://license.coscl.org.cn/MulanPSL2 -# THIS PROGRAM IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, -# EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, -# MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. -# See the Mulan PSL v2 for more details. - -# ############################################# -# @Author : honghua -# @Contact : honghua@iscas.ac.cn -# @Date : 2026-03-08 -# @License : Mulan PSL v2 -# @Desc : 测试 pdvitype 命令的 -version 参数,显示版本信息 -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - # 判断是否已经安装了texlive-ptex包 - LOG_INFO "检查是否已安装texlive-ptex包" - rpm -q texlive-ptex > /dev/null 2>&1 - if [ $? -eq 0 ]; then - LOG_INFO "texlive-ptex已安装,标记为已安装状态" - INSTALLED=true - else - LOG_INFO "texlive-ptex未安装,标记为未安装状态" - INSTALLED=false - fi - - # 检查yum源中是否有texlive-ptex包 - LOG_INFO "检查yum源中是否有texlive-ptex包" - dnf list available texlive-ptex > /dev/null 2>&1 - if [ $? -ne 0 ]; then - LOG_ERROR "yum源中未找到texlive-ptex包" - exit 255 - fi - - # 如果未安装,则安装texlive-ptex包 - if [ "$INSTALLED" = false ]; then - LOG_INFO "开始安装texlive-ptex包" - dnf install -y texlive-ptex - CHECK_RESULT $? 0 0 "安装texlive-ptex包失败" - LOG_INFO "texlive-ptex包安装成功" - fi - - # 测试pdvitype命令的-version参数 - LOG_INFO "测试pdvitype命令的-version参数" - pdvitype -version > /dev/null 2>&1 - if [ $? -eq 255 ]; then - LOG_ERROR "pdvitype命令不支持-version参数" - exit 255 - fi - - # 执行pdvitype -version命令并检查输出 - LOG_INFO "执行pdvitype -version命令" - pdvitype -version 2>&1 | grep -q "pdvitype" - CHECK_RESULT $? 0 0 "pdvitype -version命令执行失败或输出不符合预期" - LOG_INFO "pdvitype -version命令执行成功,版本信息显示正常" - - # 清理环境:如果之前未安装,则卸载texlive-ptex包 - if [ "$INSTALLED" = false ]; then - LOG_INFO "开始卸载texlive-ptex包" - dnf remove -y texlive-ptex - CHECK_RESULT $? 0 0 "卸载texlive-ptex包失败" - LOG_INFO "texlive-ptex包卸载成功,环境已恢复" - else - LOG_INFO "环境保持安装状态,无需卸载" - fi -} - -main "$@" \ No newline at end of file diff --git a/testcases/function_test/pkg_test/texlive-base/texlive-ptex/test_texlive-ptex_platex-dev_etex.sh b/testcases/function_test/pkg_test/texlive-base/texlive-ptex/test_texlive-ptex_platex-dev_etex.sh deleted file mode 100644 index 5ac067428e0..00000000000 --- a/testcases/function_test/pkg_test/texlive-base/texlive-ptex/test_texlive-ptex_platex-dev_etex.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-08 -# @License : Mulan PSL v2 -# @Desc : 测试启用e-TeX扩展功能 -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - LOG_INFO "开始测试启用e-TeX扩展功能" - - # 检查是否已安装texlive-ptex和platex-dev软件包 - LOG_INFO "检查texlive-ptex和platex-dev是否已安装" - if dnf list installed texlive-ptex &>/dev/null && dnf list installed platex-dev &>/dev/null; then - LOG_INFO "texlive-ptex和platex-dev已安装,测试后将保持安装状态" - INSTALLED=1 - else - LOG_INFO "texlive-ptex和platex-dev未安装,将进行安装测试" - INSTALLED=0 - fi - - # 检查yum源中是否存在软件包 - LOG_INFO "检查yum源中是否存在texlive-ptex和platex-dev" - if ! dnf list available texlive-ptex &>/dev/null; then - LOG_ERROR "yum源中不存在texlive-ptex软件包" - exit 255 - fi - if ! dnf list available platex-dev &>/dev/null; then - LOG_ERROR "yum源中不存在platex-dev软件包" - exit 255 - fi - - # 如果未安装,则安装软件包 - if [ $INSTALLED -eq 0 ]; then - LOG_INFO "安装texlive-ptex和platex-dev软件包" - dnf install -y texlive-ptex platex-dev - CHECK_RESULT $? 0 0 "安装texlive-ptex和platex-dev失败" - fi - - # 测试启用e-TeX扩展功能 - LOG_INFO "测试启用e-TeX扩展功能" - # 使用platex命令的-etex选项测试e-TeX扩展 - cat > test_etex.tex << "EOF" - \documentclass{article} - \begin{document} - Hello, e-TeX! - \end{document} - EOF - - platex -etex test_etex.tex - CHECK_RESULT $? 0 0 "启用e-TeX扩展功能失败" - - # 清理测试文件 - LOG_INFO "清理测试文件" - rm -f test_etex.aux test_etex.log test_etex.dvi test_etex.tex - - # 如果测试前未安装,则卸载软件包 - if [ $INSTALLED -eq 0 ]; then - LOG_INFO "卸载texlive-ptex和platex-dev软件包" - dnf remove -y texlive-ptex platex-dev - CHECK_RESULT $? 0 0 "卸载texlive-ptex和platex-dev失败" - fi - - LOG_INFO "测试启用e-TeX扩展功能完成" -} - -main "$@" \ No newline at end of file diff --git a/testcases/function_test/pkg_test/texlive-base/texlive-ptex/test_texlive-ptex_platex-dev_file-line-error.sh b/testcases/function_test/pkg_test/texlive-base/texlive-ptex/test_texlive-ptex_platex-dev_file-line-error.sh deleted file mode 100644 index 1001f0364e6..00000000000 --- a/testcases/function_test/pkg_test/texlive-base/texlive-ptex/test_texlive-ptex_platex-dev_file-line-error.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-08 -# @License : Mulan PSL v2 -# @Desc : 测试启用文件:行:错误样式消息 -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - LOG_INFO "开始测试:测试启用文件:行:错误样式消息" - - # 定义软件包名称 - PACKAGE_NAME="texlive-ptex-platex-dev" - - # 检查软件包是否已在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 - - # 检查系统是否已安装该软件包 - LOG_INFO "步骤2:检查系统是否已安装软件包${PACKAGE_NAME}" - if rpm -q ${PACKAGE_NAME} &>/dev/null; then - LOG_INFO "软件包${PACKAGE_NAME}已安装,测试结束后将保持安装状态" - INSTALLED_BEFORE=true - else - LOG_INFO "软件包${PACKAGE_NAME}未安装,将在测试过程中安装" - INSTALLED_BEFORE=false - fi - - # 如果未安装,则安装软件包 - if [ "${INSTALLED_BEFORE}" = "false" ]; then - LOG_INFO "步骤3:安装软件包${PACKAGE_NAME}" - dnf install -y ${PACKAGE_NAME} - CHECK_RESULT $? 0 0 "安装软件包${PACKAGE_NAME}失败" - fi - - # 测试启用文件:行:错误样式消息 - LOG_INFO "步骤4:测试启用文件:行:错误样式消息" - # 假设测试命令为platex --help,检查是否支持--file-line-error参数 - platex --help 2>&1 | grep -q -- "--file-line-error" - CHECK_RESULT $? 0 0 "platex命令不支持--file-line-error参数" - - # 执行带--file-line-error参数的platex命令 - LOG_INFO "步骤5:执行带--file-line-error参数的platex命令" - platex --file-line-error --version - CHECK_RESULT $? 0 0 "执行platex --file-line-error --version失败" - - # 如果测试前未安装,则卸载软件包 - if [ "${INSTALLED_BEFORE}" = "false" ]; then - LOG_INFO "步骤6:卸载软件包${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-ptex/test_texlive-ptex_platex-dev_fmt.sh b/testcases/function_test/pkg_test/texlive-base/texlive-ptex/test_texlive-ptex_platex-dev_fmt.sh deleted file mode 100644 index 2719cf52180..00000000000 --- a/testcases/function_test/pkg_test/texlive-base/texlive-ptex/test_texlive-ptex_platex-dev_fmt.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-08 -# @License : Mulan PSL v2 -# @Desc : 测试指定格式文件名称 -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - # 检查环境是否已安装指定软件包 - LOG_INFO "检查环境是否已安装texlive-ptex和texlive-platex-dev软件包" - if rpm -q texlive-ptex texlive-platex-dev > /dev/null 2>&1; then - LOG_INFO "环境已安装texlive-ptex和texlive-platex-dev软件包,测试过程中将保持安装状态" - ENV_INSTALLED=true - else - LOG_INFO "环境未安装texlive-ptex和texlive-platex-dev软件包,将在测试过程中安装" - ENV_INSTALLED=false - fi - - # 检查yum源中是否有texlive-ptex和texlive-platex-dev软件包 - LOG_INFO "检查yum源中是否有texlive-ptex和texlive-platex-dev软件包" - if ! dnf list available texlive-ptex texlive-platex-dev > /dev/null 2>&1; then - LOG_ERROR "yum源中没有texlive-ptex或texlive-platex-dev软件包" - exit 255 - fi - - # 如果环境未安装,则安装软件包 - if [ "$ENV_INSTALLED" = false ]; then - LOG_INFO "开始安装texlive-ptex和texlive-platex-dev软件包" - dnf install -y texlive-ptex texlive-platex-dev - CHECK_RESULT $? 0 0 "安装texlive-ptex和texlive-platex-dev软件包失败" - fi - - # 测试指定格式文件名称 - LOG_INFO "测试指定格式文件名称" - # 检查platex命令是否存在 - if ! command -v platex > /dev/null 2>&1; then - LOG_ERROR "platex命令不存在" - exit 255 - fi - - # 创建测试文件 - LOG_INFO "创建测试文件test.tex" - cat > test.tex << "EOF" - \documentclass{article} - \begin{document} - Hello, OpenEuler! - \end{document} - EOF - - # 使用platex命令编译测试文件 - LOG_INFO "使用platex命令编译test.tex文件" - platex test.tex - CHECK_RESULT $? 0 0 "platex命令编译test.tex文件失败" - - # 检查生成的dvi文件是否存在 - LOG_INFO "检查生成的test.dvi文件是否存在" - if [ -f test.dvi ]; then - LOG_INFO "test.dvi文件生成成功" - else - LOG_ERROR "test.dvi文件未生成" - exit 1 - fi - - # 清理测试文件 - LOG_INFO "清理测试文件" - rm -f test.tex test.log test.aux test.dvi - - # 恢复环境状态 - if [ "$ENV_INSTALLED" = false ]; then - LOG_INFO "卸载测试过程中安装的texlive-ptex和texlive-platex-dev软件包" - dnf remove -y texlive-ptex texlive-platex-dev - CHECK_RESULT $? 0 0 "卸载texlive-ptex和texlive-platex-dev软件包失败" - fi - - LOG_INFO "测试脚本执行完成" -} - -main "$@" \ No newline at end of file diff --git a/testcases/function_test/pkg_test/texlive-base/texlive-ptex/test_texlive-ptex_platex-dev_halt-on-error.sh b/testcases/function_test/pkg_test/texlive-base/texlive-ptex/test_texlive-ptex_platex-dev_halt-on-error.sh deleted file mode 100644 index a974878b6e0..00000000000 --- a/testcases/function_test/pkg_test/texlive-base/texlive-ptex/test_texlive-ptex_platex-dev_halt-on-error.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-08 -# @License : Mulan PSL v2 -# @Desc : 测试遇到第一个错误时停止处理 -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - # 定义变量 - PKG_NAME="texlive-ptex-platex-dev" - TEST_COMMAND="platex" - TEST_OPTION="--halt-on-error" - - # 步骤1:检查yum源中是否存在指定的软件包 - LOG_INFO "步骤1:检查yum源中是否存在${PKG_NAME}软件包" - dnf list available "${PKG_NAME}" > /dev/null 2>&1 - if [ $? -ne 0 ]; then - LOG_ERROR "yum源中未找到${PKG_NAME}软件包" - exit 255 - fi - - # 步骤2:检查当前环境是否已安装软件包 - LOG_INFO "步骤2:检查当前环境是否已安装${PKG_NAME}软件包" - rpm -q "${PKG_NAME}" > /dev/null 2>&1 - if [ $? -eq 0 ]; then - LOG_INFO "软件包已安装,标记为无需清理" - NEED_CLEANUP=0 - else - LOG_INFO "软件包未安装,标记为需要清理" - NEED_CLEANUP=1 - fi - - # 步骤3:如果未安装,则安装软件包 - if [ ${NEED_CLEANUP} -eq 1 ]; then - LOG_INFO "步骤3:安装${PKG_NAME}软件包" - dnf install -y "${PKG_NAME}" - CHECK_RESULT $? 0 0 "安装${PKG_NAME}软件包失败" - fi - - # 步骤4:检查测试命令是否支持指定参数 - LOG_INFO "步骤4:检查${TEST_COMMAND}命令是否支持${TEST_OPTION}参数" - ${TEST_COMMAND} ${TEST_OPTION} --help > /dev/null 2>&1 - if [ $? -ne 0 ]; then - LOG_ERROR "${TEST_COMMAND}命令不支持${TEST_OPTION}参数" - exit 255 - fi - - # 步骤5:执行测试命令,测试遇到第一个错误时停止处理 - LOG_INFO "步骤5:执行${TEST_COMMAND} ${TEST_OPTION}命令,测试遇到第一个错误时停止处理" - ${TEST_COMMAND} ${TEST_OPTION} test_input.tex > /dev/null 2>&1 - CHECK_RESULT $? 0 0 "测试命令执行失败" - - # 步骤6:环境清理 - LOG_INFO "步骤6:清理测试环境" - if [ ${NEED_CLEANUP} -eq 1 ]; then - LOG_INFO "卸载${PKG_NAME}软件包" - dnf remove -y "${PKG_NAME}" - CHECK_RESULT $? 0 0 "卸载${PKG_NAME}软件包失败" - else - LOG_INFO "软件包为预安装状态,无需卸载" - fi - - LOG_INFO "测试脚本执行完成" -} - -main "$@" \ No newline at end of file diff --git a/testcases/function_test/pkg_test/texlive-base/texlive-ptex/test_texlive-ptex_platex-dev_help.sh b/testcases/function_test/pkg_test/texlive-base/texlive-ptex/test_texlive-ptex_platex-dev_help.sh deleted file mode 100644 index 626049e79e5..00000000000 --- a/testcases/function_test/pkg_test/texlive-base/texlive-ptex/test_texlive-ptex_platex-dev_help.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-08 -# @License : Mulan PSL v2 -# @Desc : 测试打印帮助信息并退出 -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - # 测试脚本开始 - # 检查环境是否已安装 - LOG_INFO "检查texlive-ptex-platex-dev软件包是否已安装" - rpm -q texlive-ptex-platex-dev > /dev/null 2>&1 - if [ $? -eq 0 ]; then - LOG_INFO "texlive-ptex-platex-dev软件包已安装,测试后保持安装状态" - INSTALLED=true - else - LOG_INFO "texlive-ptex-platex-dev软件包未安装,测试后将卸载" - INSTALLED=false - fi - - # 检查yum源中是否有该软件包 - LOG_INFO "检查yum源中是否有texlive-ptex-platex-dev软件包" - dnf list available texlive-ptex-platex-dev > /dev/null 2>&1 - CHECK_RESULT $? 0 0 "yum源中未找到texlive-ptex-platex-dev软件包" - if [ $? -ne 0 ]; then - LOG_ERROR "yum源中未找到texlive-ptex-platex-dev软件包,退出" - exit 255 - fi - - # 如果未安装,则安装软件包 - if [ "$INSTALLED" = false ]; then - LOG_INFO "开始安装texlive-ptex-platex-dev软件包" - dnf install -y texlive-ptex-platex-dev > /dev/null 2>&1 - CHECK_RESULT $? 0 0 "安装texlive-ptex-platex-dev软件包失败" - if [ $? -ne 0 ]; then - LOG_ERROR "安装texlive-ptex-platex-dev软件包失败,退出" - exit 1 - fi - fi - - # 测试打印帮助信息并退出 - LOG_INFO "测试platex命令的--help参数" - platex --help > /dev/null 2>&1 - CHECK_RESULT $? 0 0 "platex命令不支持--help参数" - if [ $? -ne 0 ]; then - LOG_ERROR "platex命令不支持--help参数,退出" - exit 255 - fi - - LOG_INFO "测试platex命令的-h参数" - platex -h > /dev/null 2>&1 - CHECK_RESULT $? 0 0 "platex命令不支持-h参数" - if [ $? -ne 0 ]; then - LOG_ERROR "platex命令不支持-h参数,退出" - exit 255 - fi - - LOG_INFO "测试ptex命令的--help参数" - ptex --help > /dev/null 2>&1 - CHECK_RESULT $? 0 0 "ptex命令不支持--help参数" - if [ $? -ne 0 ]; then - LOG_ERROR "ptex命令不支持--help参数,退出" - exit 255 - fi - - LOG_INFO "测试ptex命令的-h参数" - ptex -h > /dev/null 2>&1 - CHECK_RESULT $? 0 0 "ptex命令不支持-h参数" - if [ $? -ne 0 ]; then - LOG_ERROR "ptex命令不支持-h参数,退出" - exit 255 - fi - - # 清理环境 - LOG_INFO "清理测试环境" - if [ "$INSTALLED" = false ]; then - LOG_INFO "卸载texlive-ptex-platex-dev软件包" - dnf remove -y texlive-ptex-platex-dev > /dev/null 2>&1 - CHECK_RESULT $? 0 0 "卸载texlive-ptex-platex-dev软件包失败" - if [ $? -ne 0 ]; then - LOG_ERROR "卸载texlive-ptex-platex-dev软件包失败,退出" - exit 1 - fi - else - LOG_INFO "保持texlive-ptex-platex-dev软件包安装状态" - fi - - LOG_INFO "测试完成" -} - -main "$@" \ No newline at end of file diff --git a/testcases/function_test/pkg_test/texlive-base/texlive-ptex/test_texlive-ptex_platex-dev_ini.sh b/testcases/function_test/pkg_test/texlive-base/texlive-ptex/test_texlive-ptex_platex-dev_ini.sh deleted file mode 100644 index 7d9b736a628..00000000000 --- a/testcases/function_test/pkg_test/texlive-base/texlive-ptex/test_texlive-ptex_platex-dev_ini.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-08 -# @License : Mulan PSL v2 -# @Desc : 测试以iniptex模式运行 -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - # 环境检查:是否已安装texlive-ptex和platex-dev - LOG_INFO "检查是否已安装texlive-ptex和platex-dev" - rpm -q texlive-ptex > /dev/null 2>&1 - texlive_ptex_installed=$? - rpm -q platex-dev > /dev/null 2>&1 - platex_dev_installed=$? - - if [ $texlive_ptex_installed -eq 0 ] && [ $platex_dev_installed -eq 0 ]; then - LOG_INFO "texlive-ptex和platex-dev已安装,测试结束后将保持安装状态" - already_installed=1 - else - LOG_INFO "texlive-ptex和platex-dev未安装,将进行安装和测试" - already_installed=0 - fi - - # 步骤1:检查yum源中是否有texlive-ptex和platex-dev软件包 - LOG_INFO "步骤1:检查yum源中是否有texlive-ptex和platex-dev软件包" - dnf list available texlive-ptex 2>&1 | grep -q "texlive-ptex" - CHECK_RESULT $? 0 0 "yum源中未找到texlive-ptex软件包" - dnf list available platex-dev 2>&1 | grep -q "platex-dev" - CHECK_RESULT $? 0 0 "yum源中未找到platex-dev软件包" - - # 如果未安装,则安装软件包 - if [ $already_installed -eq 0 ]; then - LOG_INFO "安装texlive-ptex和platex-dev软件包" - dnf install -y texlive-ptex platex-dev - CHECK_RESULT $? 0 0 "安装texlive-ptex和platex-dev失败" - fi - - # 步骤2:测试以iniptex模式运行 - LOG_INFO "步骤2:测试以iniptex模式运行" - # 检查iniptex命令是否存在 - which iniptex > /dev/null 2>&1 - CHECK_RESULT $? 0 0 "iniptex命令不存在" - - # 检查iniptex命令是否支持--help参数 - iniptex --help > /dev/null 2>&1 - CHECK_RESULT $? 0 0 "iniptex命令不支持--help参数" - - # 创建一个简单的LaTeX测试文件 - LOG_INFO "创建一个简单的LaTeX测试文件" - cat > test.tex << "EOF" - \documentclass{article} - \begin{document} - Hello, iniptex! - \end{document} - EOF - CHECK_RESULT $? 0 0 "创建测试文件失败" - - # 使用iniptex模式处理测试文件 - LOG_INFO "使用iniptex模式处理测试文件" - iniptex test.tex - CHECK_RESULT $? 0 0 "iniptex处理测试文件失败" - - # 检查是否生成了预期的输出文件 - LOG_INFO "检查是否生成了预期的输出文件" - [ -f test.dvi ] || [ -f test.pdf ] - CHECK_RESULT $? 0 0 "未生成预期的输出文件" - - # 清理测试文件 - LOG_INFO "清理测试文件" - rm -f test.tex test.dvi test.pdf test.log test.aux - CHECK_RESULT $? 0 0 "清理测试文件失败" - - # 环境恢复:如果之前未安装,则卸载软件包 - if [ $already_installed -eq 0 ]; then - LOG_INFO "卸载texlive-ptex和platex-dev软件包" - dnf remove -y texlive-ptex platex-dev - CHECK_RESULT $? 0 0 "卸载texlive-ptex和platex-dev失败" - else - LOG_INFO "保持texlive-ptex和platex-dev的安装状态" - fi - - LOG_INFO "测试完成" -} - -main "$@" \ No newline at end of file diff --git a/testcases/function_test/pkg_test/texlive-base/texlive-ptex/test_texlive-ptex_platex-dev_interaction.sh b/testcases/function_test/pkg_test/texlive-base/texlive-ptex/test_texlive-ptex_platex-dev_interaction.sh deleted file mode 100644 index 215003a9041..00000000000 --- a/testcases/function_test/pkg_test/texlive-base/texlive-ptex/test_texlive-ptex_platex-dev_interaction.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-08 -# @License : Mulan PSL v2 -# @Desc : 测试设置交互模式为批处理模式 -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - # 检查是否已安装texlive-ptex和platex-dev软件包 - LOG_INFO "检查texlive-ptex和platex-dev软件包是否已安装" - rpm -q texlive-ptex platex-dev > /dev/null 2>&1 - if [ $? -eq 0 ]; then - LOG_INFO "软件包已安装,标记为已安装状态" - INSTALLED=1 - else - LOG_INFO "软件包未安装,标记为未安装状态" - INSTALLED=0 - fi - - # 检查yum源中是否有texlive-ptex和platex-dev软件包 - LOG_INFO "检查yum源中是否有texlive-ptex和platex-dev软件包" - dnf list available texlive-ptex platex-dev > /dev/null 2>&1 - CHECK_RESULT $? 0 0 "yum源中未找到texlive-ptex或platex-dev软件包" - if [ $? -ne 0 ]; then - LOG_ERROR "yum源中未找到texlive-ptex或platex-dev软件包" - exit 255 - fi - - # 如果未安装,则安装软件包 - if [ $INSTALLED -eq 0 ]; then - LOG_INFO "开始安装texlive-ptex和platex-dev软件包" - dnf install -y texlive-ptex platex-dev - CHECK_RESULT $? 0 0 "安装texlive-ptex和platex-dev软件包失败" - if [ $? -ne 0 ]; then - LOG_ERROR "安装texlive-ptex和platex-dev软件包失败" - exit 1 - fi - LOG_INFO "texlive-ptex和platex-dev软件包安装成功" - fi - - # 测试设置交互模式为批处理模式 - LOG_INFO "测试设置交互模式为批处理模式" - # 假设测试命令为platex --interaction,检查是否支持batch参数 - platex --help 2>&1 | grep -q "batch" - CHECK_RESULT $? 0 0 "platex命令不支持batch参数" - if [ $? -ne 0 ]; then - LOG_ERROR "platex命令不支持batch参数" - if [ $INSTALLED -eq 0 ]; then - LOG_INFO "开始卸载texlive-ptex和platex-dev软件包" - dnf remove -y texlive-ptex platex-dev - CHECK_RESULT $? 0 0 "卸载texlive-ptex和platex-dev软件包失败" - fi - exit 255 - fi - - # 执行测试命令,设置交互模式为批处理模式 - LOG_INFO "执行platex命令,设置交互模式为批处理模式" - echo "\documentclass{article}\begin{document}test\end{document}" > test.tex - platex --interaction=batchmode test.tex - CHECK_RESULT $? 0 0 "设置交互模式为批处理模式失败" - if [ $? -ne 0 ]; then - LOG_ERROR "设置交互模式为批处理模式失败" - rm -f test.tex test.aux test.log test.dvi - if [ $INSTALLED -eq 0 ]; then - LOG_INFO "开始卸载texlive-ptex和platex-dev软件包" - dnf remove -y texlive-ptex platex-dev - CHECK_RESULT $? 0 0 "卸载texlive-ptex和platex-dev软件包失败" - fi - exit 1 - fi - LOG_INFO "设置交互模式为批处理模式成功" - - # 清理测试文件 - LOG_INFO "清理测试文件" - rm -f test.tex test.aux test.log test.dvi - - # 如果之前未安装,则卸载软件包 - if [ $INSTALLED -eq 0 ]; then - LOG_INFO "开始卸载texlive-ptex和platex-dev软件包" - dnf remove -y texlive-ptex platex-dev - CHECK_RESULT $? 0 0 "卸载texlive-ptex和platex-dev软件包失败" - if [ $? -ne 0 ]; then - LOG_ERROR "卸载texlive-ptex和platex-dev软件包失败" - exit 1 - fi - LOG_INFO "texlive-ptex和platex-dev软件包卸载成功" - else - LOG_INFO "保持texlive-ptex和platex-dev软件包安装状态" - fi - - LOG_INFO "测试脚本执行完成" -} - -main "$@" \ No newline at end of file diff --git a/testcases/function_test/pkg_test/texlive-base/texlive-ptex/test_texlive-ptex_platex-dev_ipc-start.sh b/testcases/function_test/pkg_test/texlive-base/texlive-ptex/test_texlive-ptex_platex-dev_ipc-start.sh deleted file mode 100644 index 05be5cc5c4b..00000000000 --- a/testcases/function_test/pkg_test/texlive-base/texlive-ptex/test_texlive-ptex_platex-dev_ipc-start.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-08 -# @License : Mulan PSL v2 -# @Desc : 测试启动IPC服务器并发送输出 -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - set -e - - LOG_INFO "测试用例:测试启动IPC服务器并发送输出" - - # 检查yum源中是否存在texlive-ptex和platex-dev软件包 - LOG_INFO "检查yum源中是否存在texlive-ptex和platex-dev软件包" - dnf list available texlive-ptex 2>/dev/null | grep -q texlive-ptex - CHECK_RESULT $? 0 0 "yum源中不存在texlive-ptex软件包" - dnf list available platex-dev 2>/dev/null | grep -q platex-dev - CHECK_RESULT $? 0 0 "yum源中不存在platex-dev软件包" - - # 检查是否已安装 - LOG_INFO "检查是否已安装texlive-ptex和platex-dev" - if rpm -q texlive-ptex platex-dev >/dev/null 2>&1; then - LOG_INFO "软件包已安装,测试完成后保持安装状态" - INSTALLED=true - else - LOG_INFO "软件包未安装,将在测试前安装" - INSTALLED=false - fi - - # 如果未安装,则安装软件包 - if [ "$INSTALLED" = false ]; then - LOG_INFO "安装texlive-ptex和platex-dev软件包" - dnf install -y texlive-ptex platex-dev - CHECK_RESULT $? 0 0 "安装软件包失败" - fi - - # 检查ipc-start命令是否存在 - LOG_INFO "检查ipc-start命令是否存在" - command -v ipc-start >/dev/null 2>&1 - CHECK_RESULT $? 0 0 "ipc-start命令不存在" - - # 检查ipc-start命令支持的参数 - LOG_INFO "检查ipc-start命令是否支持--output参数" - ipc-start --help 2>&1 | grep -q -- --output - CHECK_RESULT $? 0 0 "ipc-start命令不支持--output参数" - - # 启动IPC服务器并发送输出 - LOG_INFO "启动IPC服务器并发送输出到临时文件" - OUTPUT_FILE=$(mktemp) - ipc-start --output "$OUTPUT_FILE" & - IPC_PID=$! - - # 等待服务器启动 - sleep 2 - - # 检查服务器是否在运行 - LOG_INFO "检查IPC服务器进程是否在运行" - kill -0 $IPC_PID 2>/dev/null - CHECK_RESULT $? 0 0 "IPC服务器进程未在运行" - - # 检查输出文件是否创建并包含内容 - LOG_INFO "检查输出文件是否创建并包含内容" - [ -f "$OUTPUT_FILE" ] - CHECK_RESULT $? 0 0 "输出文件未创建" - [ -s "$OUTPUT_FILE" ] - CHECK_RESULT $? 0 0 "输出文件为空" - - # 停止IPC服务器 - LOG_INFO "停止IPC服务器" - kill $IPC_PID 2>/dev/null - wait $IPC_PID 2>/dev/null - - # 清理临时文件 - LOG_INFO "清理临时文件" - rm -f "$OUTPUT_FILE" - - # 如果测试前未安装,则卸载软件包 - if [ "$INSTALLED" = false ]; then - LOG_INFO "卸载texlive-ptex和platex-dev软件包" - dnf remove -y texlive-ptex platex-dev - 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-ptex/test_texlive-ptex_platex-dev_ipc.sh b/testcases/function_test/pkg_test/texlive-base/texlive-ptex/test_texlive-ptex_platex-dev_ipc.sh deleted file mode 100644 index f63c2aac947..00000000000 --- a/testcases/function_test/pkg_test/texlive-base/texlive-ptex/test_texlive-ptex_platex-dev_ipc.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-08 -# @License : Mulan PSL v2 -# @Desc : 测试将DVI输出同时发送到套接字 -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - LOG_INFO "步骤1:检查yum源中是否存在texlive-ptex和platex-dev软件包" - dnf list texlive-ptex platex-dev 2>/dev/null | grep -E "^texlive-ptex|^platex-dev" >/dev/null - CHECK_RESULT $? 0 0 "yum源中未找到texlive-ptex或platex-dev软件包" - if [ $? -ne 0 ]; then - LOG_ERROR "yum源中未找到texlive-ptex或platex-dev软件包" - exit 255 - fi - - LOG_INFO "步骤2:检查是否已安装texlive-ptex和platex-dev软件包" - rpm -q texlive-ptex platex-dev >/dev/null 2>&1 - if [ $? -eq 0 ]; then - LOG_INFO "软件包已安装,标记为已安装状态" - INSTALLED=1 - else - LOG_INFO "软件包未安装,标记为未安装状态" - INSTALLED=0 - fi - - if [ $INSTALLED -eq 0 ]; then - LOG_INFO "步骤3:安装texlive-ptex和platex-dev软件包" - dnf install -y texlive-ptex platex-dev - CHECK_RESULT $? 0 0 "安装texlive-ptex和platex-dev软件包失败" - if [ $? -ne 0 ]; then - LOG_ERROR "安装软件包失败" - exit 1 - fi - fi - - LOG_INFO "步骤4:创建测试LaTeX文件" - cat > test_ipc.tex << "EOF" - \documentclass{article} - \begin{document} - Hello, IPC test! - \end{document} - EOF - CHECK_RESULT $? 0 0 "创建测试LaTeX文件失败" - - LOG_INFO "步骤5:使用platex编译LaTeX文件生成DVI" - platex -interaction=nonstopmode test_ipc.tex - CHECK_RESULT $? 0 0 "platex编译失败" - - LOG_INFO "步骤6:启动监听套接字以接收DVI输出" - nc -l 12345 > received.dvi & - NC_PID=$! - sleep 2 - - LOG_INFO "步骤7:使用dvipdfmx将DVI输出同时发送到套接字和文件" - dvipdfmx -o test_ipc.pdf -S 127.0.0.1:12345 test_ipc.dvi - CHECK_RESULT $? 0 0 "dvipdfmx命令执行失败,可能参数不支持" - if [ $? -ne 0 ]; then - LOG_ERROR "dvipdfmx命令参数不支持" - kill $NC_PID 2>/dev/null - exit 255 - fi - - wait $NC_PID - CHECK_RESULT $? 0 0 "套接字接收DVI输出失败" - - LOG_INFO "步骤8:检查接收到的DVI文件是否非空" - if [ -s received.dvi ]; then - LOG_INFO "DVI输出成功发送到套接字" - else - LOG_ERROR "DVI输出未成功发送到套接字" - exit 1 - fi - - LOG_INFO "步骤9:清理临时文件" - rm -f test_ipc.tex test_ipc.aux test_ipc.log test_ipc.dvi test_ipc.pdf received.dvi - - if [ $INSTALLED -eq 0 ]; then - LOG_INFO "步骤10:卸载安装的软件包" - dnf remove -y texlive-ptex platex-dev - CHECK_RESULT $? 0 0 "卸载texlive-ptex和platex-dev软件包失败" - fi - - LOG_INFO "测试完成,环境已恢复" -} - -main "$@" \ No newline at end of file diff --git a/testcases/function_test/pkg_test/texlive-base/texlive-ptex/test_texlive-ptex_platex-dev_jobname.sh b/testcases/function_test/pkg_test/texlive-base/texlive-ptex/test_texlive-ptex_platex-dev_jobname.sh deleted file mode 100644 index 65f172891c1..00000000000 --- a/testcases/function_test/pkg_test/texlive-base/texlive-ptex/test_texlive-ptex_platex-dev_jobname.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-08 -# @License : Mulan PSL v2 -# @Desc : 测试设置作业名称 -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - # 测试设置作业名称 - LOG_INFO "开始测试:设置作业名称" - - # 检查是否已安装texlive-ptex和platex-dev软件包 - LOG_INFO "检查texlive-ptex和platex-dev软件包是否已安装" - if dnf list installed texlive-ptex &> /dev/null && dnf list installed platex-dev &> /dev/null; then - LOG_INFO "软件包已安装,测试结束后将保持安装状态" - INSTALLED=true - else - LOG_INFO "软件包未安装,将在测试过程中安装并在结束后卸载" - INSTALLED=false - fi - - # 检查yum源中是否有texlive-ptex和platex-dev软件包 - LOG_INFO "检查yum源中是否有texlive-ptex软件包" - if ! dnf list available texlive-ptex &> /dev/null; then - LOG_ERROR "yum源中没有texlive-ptex软件包" - exit 255 - fi - - LOG_INFO "检查yum源中是否有platex-dev软件包" - if ! dnf list available platex-dev &> /dev/null; then - LOG_ERROR "yum源中没有platex-dev软件包" - exit 255 - fi - - # 如果未安装,则安装软件包 - if [ "$INSTALLED" = false ]; then - LOG_INFO "安装texlive-ptex和platex-dev软件包" - dnf install -y texlive-ptex platex-dev - CHECK_RESULT $? 0 0 "安装texlive-ptex和platex-dev软件包失败" - fi - - # 测试设置作业名称 - LOG_INFO "测试设置作业名称功能" - platex -jobname=testjob test.tex - CHECK_RESULT $? 0 0 "设置作业名称失败" - - # 检查生成的作业名称文件是否存在 - LOG_INFO "检查生成的作业名称文件是否存在" - if [ -f "testjob.dvi" ]; then - LOG_INFO "作业名称文件生成成功" - else - LOG_ERROR "作业名称文件生成失败" - CHECK_RESULT 1 0 0 "作业名称文件生成失败" - fi - - # 清理测试文件 - LOG_INFO "清理测试生成的文件" - rm -f testjob.dvi testjob.log testjob.aux - - # 如果测试前未安装,则卸载软件包 - if [ "$INSTALLED" = false ]; then - LOG_INFO "卸载texlive-ptex和platex-dev软件包" - dnf remove -y texlive-ptex platex-dev - CHECK_RESULT $? 0 0 "卸载texlive-ptex和platex-dev软件包失败" - fi - - LOG_INFO "测试完成:设置作业名称" -} - -main "$@" \ No newline at end of file diff --git a/testcases/function_test/pkg_test/texlive-base/texlive-ptex/test_texlive-ptex_platex-dev_kanji-internal.sh b/testcases/function_test/pkg_test/texlive-base/texlive-ptex/test_texlive-ptex_platex-dev_kanji-internal.sh deleted file mode 100644 index 5d0866918a1..00000000000 --- a/testcases/function_test/pkg_test/texlive-base/texlive-ptex/test_texlive-ptex_platex-dev_kanji-internal.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-08 -# @License : Mulan PSL v2 -# @Desc : 测试设置日语内部编码为EUC -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - set -e - - LOG_INFO "开始测试:设置日语内部编码为EUC" - - # 定义软件包名称 - PACKAGE_NAME="texlive-ptex-platex-dev-kanji-internal" - - # 检查软件包是否已在yum源中 - LOG_INFO "步骤1:检查软件包是否在yum源中" - if ! dnf list available "${PACKAGE_NAME}" &>/dev/null; then - LOG_ERROR "软件包 ${PACKAGE_NAME} 不在yum源中" - exit 255 - fi - - # 检查当前是否已安装 - LOG_INFO "步骤2:检查当前是否已安装 ${PACKAGE_NAME}" - if rpm -q "${PACKAGE_NAME}" &>/dev/null; then - INSTALLED="yes" - LOG_INFO "软件包已安装,测试结束后将保持安装状态" - else - INSTALLED="no" - LOG_INFO "软件包未安装,将在测试步骤中安装" - fi - - # 如果未安装,则安装软件包 - if [ "${INSTALLED}" = "no" ]; then - LOG_INFO "步骤3:安装软件包 ${PACKAGE_NAME}" - dnf install -y "${PACKAGE_NAME}" - CHECK_RESULT $? 0 0 "安装软件包失败" - fi - - # 测试设置日语内部编码为EUC - LOG_INFO "步骤4:测试设置日语内部编码为EUC" - # 假设相关命令为 "kanji-internal-set-euc",这里仅为示例,实际命令需根据软件包确定 - COMMAND="kanji-internal-set-euc" - if ! command -v "${COMMAND}" &>/dev/null; then - LOG_ERROR "命令 ${COMMAND} 不存在或不支持" - exit 255 - fi - - # 执行命令并检查结果 - ${COMMAND} --set euc - CHECK_RESULT $? 0 0 "设置日语内部编码为EUC失败" - - # 验证设置是否生效 - LOG_INFO "步骤5:验证日语内部编码设置是否生效" - # 假设验证命令为 "kanji-internal-get",这里仅为示例,实际命令需根据软件包确定 - VERIFY_COMMAND="kanji-internal-get" - if ! command -v "${VERIFY_COMMAND}" &>/dev/null; then - LOG_ERROR "命令 ${VERIFY_COMMAND} 不存在或不支持" - exit 255 - fi - - RESULT=$(${VERIFY_COMMAND}) - EXPECTED="euc" - if [ "${RESULT}" = "${EXPECTED}" ]; then - LOG_INFO "日语内部编码已成功设置为EUC" - else - LOG_ERROR "日语内部编码设置验证失败,当前为:${RESULT},预期为:${EXPECTED}" - exit 1 - fi - - # 环境恢复 - LOG_INFO "步骤6:恢复测试环境" - if [ "${INSTALLED}" = "no" ]; then - LOG_INFO "卸载软件包 ${PACKAGE_NAME}" - dnf remove -y "${PACKAGE_NAME}" - CHECK_RESULT $? 0 0 "卸载软件包失败" - else - LOG_INFO "软件包已预先安装,保持安装状态" - fi - - LOG_INFO "测试完成:设置日语内部编码为EUC" -} - -main "$@" \ No newline at end of file diff --git a/testcases/function_test/pkg_test/texlive-base/texlive-ptex/test_texlive-ptex_platex-dev_kanji.sh b/testcases/function_test/pkg_test/texlive-base/texlive-ptex/test_texlive-ptex_platex-dev_kanji.sh deleted file mode 100644 index f461625fe57..00000000000 --- a/testcases/function_test/pkg_test/texlive-base/texlive-ptex/test_texlive-ptex_platex-dev_kanji.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-08 -# @License : Mulan PSL v2 -# @Desc : 测试设置日语编码为UTF-8 -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - # 测试脚本:测试设置日语编码为UTF-8 - - # 检查是否已安装texlive-ptex-platex-dev-kanji软件包 - LOG_INFO "检查是否已安装texlive-ptex-platex-dev-kanji软件包" - rpm -q texlive-ptex-platex-dev-kanji - if [ $? -eq 0 ]; then - LOG_INFO "软件包已安装,脚本结束时保持安装状态" - INSTALLED=1 - else - LOG_INFO "软件包未安装,将在测试过程中安装" - INSTALLED=0 - fi - - # 检查yum源中是否有texlive-ptex-platex-dev-kanji软件包 - LOG_INFO "检查yum源中是否有texlive-ptex-platex-dev-kanji软件包" - dnf list available texlive-ptex-platex-dev-kanji - CHECK_RESULT $? 0 0 "yum源中未找到texlive-ptex-platex-dev-kanji软件包" - if [ $? -ne 0 ]; then - LOG_ERROR "yum源中未找到texlive-ptex-platex-dev-kanji软件包" - exit 255 - fi - - # 如果未安装,则安装软件包 - if [ $INSTALLED -eq 0 ]; then - LOG_INFO "安装texlive-ptex-platex-dev-kanji软件包" - dnf install -y texlive-ptex-platex-dev-kanji - CHECK_RESULT $? 0 0 "安装texlive-ptex-platex-dev-kanji软件包失败" - fi - - # 测试设置日语编码为UTF-8 - LOG_INFO "测试设置日语编码为UTF-8" - # 使用platex命令测试日语编码设置 - echo "\documentclass{jsarticle} - \begin{document} - 日本語テスト - \end{document}" > test_japanese.tex - - platex -kanji=utf8 test_japanese.tex - CHECK_RESULT $? 0 0 "设置日语编码为UTF-8失败" - - # 检查生成的DVI文件 - LOG_INFO "检查生成的DVI文件" - if [ -f test_japanese.dvi ]; then - LOG_INFO "成功生成DVI文件,日语编码设置正确" - else - LOG_ERROR "未生成DVI文件,日语编码设置可能有问题" - exit 1 - fi - - # 清理测试文件 - LOG_INFO "清理测试文件" - rm -f test_japanese.tex test_japanese.log test_japanese.aux test_japanese.dvi - - # 如果之前未安装,则卸载软件包 - if [ $INSTALLED -eq 0 ]; then - LOG_INFO "卸载texlive-ptex-platex-dev-kanji软件包" - dnf remove -y texlive-ptex-platex-dev-kanji - CHECK_RESULT $? 0 0 "卸载texlive-ptex-platex-dev-kanji软件包失败" - fi - - LOG_INFO "测试脚本执行完成" -} - -main "$@" \ No newline at end of file diff --git a/testcases/function_test/pkg_test/texlive-base/texlive-ptex/test_texlive-ptex_platex-dev_kpathsea-debug.sh b/testcases/function_test/pkg_test/texlive-base/texlive-ptex/test_texlive-ptex_platex-dev_kpathsea-debug.sh deleted file mode 100644 index 81ee3bc8399..00000000000 --- a/testcases/function_test/pkg_test/texlive-base/texlive-ptex/test_texlive-ptex_platex-dev_kpathsea-debug.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-08 -# @License : Mulan PSL v2 -# @Desc : 测试设置路径搜索调试标志 -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - LOG_INFO "开始测试设置路径搜索调试标志" - - # 检查yum源中是否存在指定的软件包 - LOG_INFO "检查yum源中是否存在软件包texlive-ptex、platex-dev、kpathsea-debug" - if ! dnf list available texlive-ptex platex-dev kpathsea-debug &>/dev/null; then - LOG_ERROR "yum源中缺少一个或多个指定软件包" - exit 255 - fi - - # 检查当前环境是否已安装指定软件包 - LOG_INFO "检查当前环境是否已安装指定软件包" - installed=false - if rpm -q texlive-ptex platex-dev kpathsea-debug &>/dev/null; then - installed=true - LOG_INFO "软件包已安装,测试完成后将保持安装状态" - else - LOG_INFO "软件包未安装,将在测试完成后卸载" - fi - - # 如果未安装,则安装软件包 - if [ "$installed" = false ]; then - LOG_INFO "安装软件包texlive-ptex、platex-dev、kpathsea-debug" - dnf install -y texlive-ptex platex-dev kpathsea-debug - CHECK_RESULT $? 0 0 "安装软件包失败" - fi - - # 测试设置路径搜索调试标志 - LOG_INFO "测试设置路径搜索调试标志" - # 假设使用kpathsea工具测试调试标志,具体命令根据实际工具调整 - # 这里以kpathsea工具为例,检查是否支持--debug参数 - if ! kpsewhich --help 2>&1 | grep -q -- "--debug"; then - LOG_ERROR "命令不支持--debug参数" - exit 255 - fi - - # 执行带--debug参数的命令 - LOG_INFO "执行带--debug参数的命令" - kpsewhich --debug=1 texmf.cnf - CHECK_RESULT $? 0 0 "执行带--debug参数的命令失败" - - # 清理环境:如果测试前未安装,则卸载软件包 - if [ "$installed" = false ]; then - LOG_INFO "卸载测试安装的软件包" - dnf remove -y texlive-ptex platex-dev kpathsea-debug - 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-ptex/test_texlive-ptex_platex-dev_mktex.sh b/testcases/function_test/pkg_test/texlive-base/texlive-ptex/test_texlive-ptex_platex-dev_mktex.sh deleted file mode 100644 index 95709d61a96..00000000000 --- a/testcases/function_test/pkg_test/texlive-base/texlive-ptex/test_texlive-ptex_platex-dev_mktex.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-08 -# @License : Mulan PSL v2 -# @Desc : 测试启用mktexFMT生成 -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - # 环境检查:检查是否已安装texlive-ptex和texlive-platex-dev软件包 - LOG_INFO "检查是否已安装texlive-ptex和texlive-platex-dev软件包" - rpm -q texlive-ptex texlive-platex-dev > /dev/null 2>&1 - if [ $? -eq 0 ]; then - LOG_INFO "软件包已安装,标记为已安装状态" - INSTALLED=1 - else - LOG_INFO "软件包未安装,标记为未安装状态" - INSTALLED=0 - fi - - # 检查yum源中是否存在软件包 - LOG_INFO "检查yum源中是否存在texlive-ptex和texlive-platex-dev软件包" - dnf list available texlive-ptex texlive-platex-dev > /dev/null 2>&1 - if [ $? -ne 0 ]; then - LOG_ERROR "yum源中不存在texlive-ptex或texlive-platex-dev软件包" - exit 255 - fi - - # 如果未安装,则安装软件包 - if [ $INSTALLED -eq 0 ]; then - LOG_INFO "开始安装texlive-ptex和texlive-platex-dev软件包" - dnf install -y texlive-ptex texlive-platex-dev - CHECK_RESULT $? 0 0 "安装texlive-ptex和texlive-platex-dev软件包失败" - LOG_INFO "软件包安装成功" - fi - - # 测试启用mktexFMT生成 - LOG_INFO "开始测试启用mktexFMT生成" - # 检查mktexfmt命令是否存在 - which mktexfmt > /dev/null 2>&1 - if [ $? -ne 0 ]; then - LOG_ERROR "mktexfmt命令不存在" - exit 255 - fi - - # 检查mktexfmt命令是否支持--help参数 - LOG_INFO "检查mktexfmt命令是否支持--help参数" - mktexfmt --help > /dev/null 2>&1 - if [ $? -ne 0 ]; then - LOG_ERROR "mktexfmt命令不支持--help参数" - exit 255 - fi - - # 尝试生成一个fmt文件 - LOG_INFO "尝试使用mktexfmt生成platex.fmt文件" - mktexfmt platex - CHECK_RESULT $? 0 0 "mktexfmt生成platex.fmt文件失败" - - # 检查生成的fmt文件是否存在 - LOG_INFO "检查生成的platex.fmt文件是否存在" - ls /usr/share/texlive/texmf-var/web2c/platex.fmt > /dev/null 2>&1 - CHECK_RESULT $? 0 0 "生成的platex.fmt文件不存在" - - # 清理生成的fmt文件 - LOG_INFO "清理生成的platex.fmt文件" - rm -f /usr/share/texlive/texmf-var/web2c/platex.fmt - CHECK_RESULT $? 0 0 "清理platex.fmt文件失败" - - # 环境恢复:如果脚本开始时未安装,则卸载软件包 - if [ $INSTALLED -eq 0 ]; then - LOG_INFO "卸载texlive-ptex和texlive-platex-dev软件包" - dnf remove -y texlive-ptex texlive-platex-dev - CHECK_RESULT $? 0 0 "卸载texlive-ptex和texlive-platex-dev软件包失败" - 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-ptex/test_texlive-ptex_platex-dev_mltex.sh b/testcases/function_test/pkg_test/texlive-base/texlive-ptex/test_texlive-ptex_platex-dev_mltex.sh deleted file mode 100644 index 92e876de8cd..00000000000 --- a/testcases/function_test/pkg_test/texlive-base/texlive-ptex/test_texlive-ptex_platex-dev_mltex.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-08 -# @License : Mulan PSL v2 -# @Desc : 测试启用MLTeX扩展功能 -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - # 检查是否已经安装了texlive-ptex-platex-dev-mltex软件包 - LOG_INFO "检查是否已安装texlive-ptex-platex-dev-mltex软件包" - rpm -q texlive-ptex-platex-dev-mltex > /dev/null 2>&1 - if [ $? -eq 0 ]; then - LOG_INFO "软件包已安装,测试结束后将保持安装状态" - INSTALLED=true - else - LOG_INFO "软件包未安装,将在测试前安装" - INSTALLED=false - fi - - # 检查yum源中是否有该软件包 - LOG_INFO "检查yum源中是否有texlive-ptex-platex-dev-mltex软件包" - dnf list available texlive-ptex-platex-dev-mltex > /dev/null 2>&1 - if [ $? -ne 0 ]; then - LOG_ERROR "yum源中未找到texlive-ptex-platex-dev-mltex软件包" - exit 255 - fi - - # 如果未安装,则安装软件包 - if [ "$INSTALLED" = false ]; then - LOG_INFO "开始安装texlive-ptex-platex-dev-mltex软件包" - dnf install -y texlive-ptex-platex-dev-mltex - CHECK_RESULT $? 0 0 "安装texlive-ptex-platex-dev-mltex软件包失败" - fi - - # 测试启用MLTeX扩展功能 - LOG_INFO "测试启用MLTeX扩展功能" - # 检查是否支持-MLTeX参数 - tex --help | grep -q "\-MLTeX" - if [ $? -ne 0 ]; then - LOG_ERROR "tex命令不支持-MLTeX参数" - exit 255 - fi - - # 创建一个简单的测试文件 - LOG_INFO "创建测试LaTeX文件" - cat > test_mltex.tex << "EOF" - \documentclass{article} - \begin{document} - Hello, MLTeX! - \end{document} - EOF - - # 使用MLTeX扩展编译测试文件 - LOG_INFO "使用MLTeX扩展编译测试文件" - tex -MLTeX test_mltex.tex - CHECK_RESULT $? 0 0 "使用MLTeX扩展编译测试文件失败" - - # 检查是否生成了预期的输出文件 - LOG_INFO "检查是否生成了DVI文件" - if [ -f test_mltex.dvi ]; then - LOG_INFO "成功生成DVI文件" - else - LOG_ERROR "未生成DVI文件" - exit 1 - fi - - # 清理测试文件 - LOG_INFO "清理测试文件" - rm -f test_mltex.tex test_mltex.log test_mltex.dvi test_mltex.aux - - # 如果测试前未安装,则在测试后卸载软件包 - if [ "$INSTALLED" = false ]; then - LOG_INFO "卸载texlive-ptex-platex-dev-mltex软件包" - dnf remove -y texlive-ptex-platex-dev-mltex - CHECK_RESULT $? 0 0 "卸载texlive-ptex-platex-dev-mltex软件包失败" - fi - - LOG_INFO "测试完成" -} - -main "$@" \ No newline at end of file diff --git a/testcases/function_test/pkg_test/texlive-base/texlive-ptex/test_texlive-ptex_platex-dev_no-file-line-error.sh b/testcases/function_test/pkg_test/texlive-base/texlive-ptex/test_texlive-ptex_platex-dev_no-file-line-error.sh deleted file mode 100644 index 450af8820b8..00000000000 --- a/testcases/function_test/pkg_test/texlive-base/texlive-ptex/test_texlive-ptex_platex-dev_no-file-line-error.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-08 -# @License : Mulan PSL v2 -# @Desc : 测试禁用文件:行:错误样式消息 -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - LOG_INFO "开始测试禁用文件:行:错误样式消息" - - LOG_INFO "步骤1: 检查yum源中是否存在texlive-ptex-platex-dev软件包" - dnf list available texlive-ptex-platex-dev 2>/dev/null | grep -q "texlive-ptex-platex-dev" - if [ $? -ne 0 ]; then - LOG_ERROR "yum源中未找到texlive-ptex-platex-dev软件包" - exit 255 - fi - LOG_INFO "texlive-ptex-platex-dev软件包在yum源中存在" - - LOG_INFO "步骤2: 检查系统是否已安装texlive-ptex-platex-dev" - if rpm -q texlive-ptex-platex-dev >/dev/null 2>&1; then - LOG_INFO "系统已安装texlive-ptex-platex-dev,测试后保持安装状态" - ALREADY_INSTALLED=1 - else - LOG_INFO "系统未安装texlive-ptex-platex-dev,将在测试后卸载" - ALREADY_INSTALLED=0 - fi - - if [ $ALREADY_INSTALLED -eq 0 ]; then - LOG_INFO "步骤3: 安装texlive-ptex-platex-dev软件包" - dnf install -y texlive-ptex-platex-dev - CHECK_RESULT $? 0 0 "安装texlive-ptex-platex-dev失败" - fi - - LOG_INFO "步骤4: 检查platex命令是否支持-no-file-line-error参数" - platex -help 2>&1 | grep -q -- "-no-file-line-error" - CHECK_RESULT $? 0 0 "platex命令不支持-no-file-line-error参数" 255 - - LOG_INFO "步骤5: 创建一个简单的LaTeX测试文件" - cat > test.tex << "EOF" - \documentclass{article} - \begin{document} - Hello, world! - \end{document} - EOF - CHECK_RESULT $? 0 0 "创建测试文件失败" - - LOG_INFO "步骤6: 使用-no-file-line-error参数运行platex命令" - platex -no-file-line-error test.tex > output.log 2>&1 - CHECK_RESULT $? 0 0 "使用-no-file-line-error参数运行platex命令失败" - - LOG_INFO "步骤7: 检查输出中是否不包含"file:line:error"格式的错误消息" - if grep -q ".*:[0-9]*:.*" output.log; then - LOG_ERROR "输出中包含"file:line:error"格式的错误消息" - exit 1 - else - LOG_INFO "输出中未发现"file:line:error"格式的错误消息,测试通过" - fi - - LOG_INFO "步骤8: 清理测试文件" - rm -f test.tex output.log test.aux test.log test.dvi - CHECK_RESULT $? 0 0 "清理测试文件失败" - - if [ $ALREADY_INSTALLED -eq 0 ]; then - LOG_INFO "步骤9: 卸载texlive-ptex-platex-dev软件包" - dnf remove -y texlive-ptex-platex-dev - CHECK_RESULT $? 0 0 "卸载texlive-ptex-platex-dev失败" - else - LOG_INFO "系统原本已安装texlive-ptex-platex-dev,保持安装状态" - fi - - LOG_INFO "测试完成" -} - -main "$@" \ No newline at end of file diff --git a/testcases/function_test/pkg_test/texlive-base/texlive-ptex/test_texlive-ptex_platex-dev_no-mktex.sh b/testcases/function_test/pkg_test/texlive-base/texlive-ptex/test_texlive-ptex_platex-dev_no-mktex.sh deleted file mode 100644 index 6e9f2c508ea..00000000000 --- a/testcases/function_test/pkg_test/texlive-base/texlive-ptex/test_texlive-ptex_platex-dev_no-mktex.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-08 -# @License : Mulan PSL v2 -# @Desc : 测试禁用mktexFMT生成 -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - LOG_INFO "开始测试:测试禁用mktexFMT生成" - - LOG_INFO "步骤1:检查环境中是否已安装texlive-ptex和texlive-platex-dev软件包" - if rpm -q texlive-ptex texlive-platex-dev > /dev/null 2>&1; then - LOG_INFO "texlive-ptex和texlive-platex-dev已安装,测试结束后将保持安装状态" - INSTALLED=1 - else - LOG_INFO "texlive-ptex和texlive-platex-dev未安装,将在测试过程中安装" - INSTALLED=0 - fi - - LOG_INFO "步骤2:检查yum源中是否存在texlive-ptex和texlive-platex-dev软件包" - if ! dnf list available texlive-ptex texlive-platex-dev > /dev/null 2>&1; then - LOG_ERROR "yum源中不存在texlive-ptex或texlive-platex-dev软件包" - exit 255 - fi - - if [ $INSTALLED -eq 0 ]; then - LOG_INFO "步骤3:安装texlive-ptex和texlive-platex-dev软件包" - dnf install -y texlive-ptex texlive-platex-dev - CHECK_RESULT $? 0 0 "安装texlive-ptex和texlive-platex-dev失败" - fi - - LOG_INFO "步骤4:检查mktexfmt命令是否存在" - if ! command -v mktexfmt > /dev/null 2>&1; then - LOG_ERROR "mktexfmt命令不存在" - exit 255 - fi - - LOG_INFO "步骤5:测试禁用mktexFMT生成" - LOG_INFO "执行命令:mktexfmt --help" - mktexfmt --help - CHECK_RESULT $? 0 0 "mktexfmt命令执行失败" - - LOG_INFO "步骤6:检查mktexfmt是否支持禁用选项" - if ! mktexfmt --help | grep -q "disable"; then - LOG_ERROR "mktexfmt命令不支持禁用选项" - exit 255 - fi - - LOG_INFO "步骤7:执行禁用mktexFMT生成的测试命令" - LOG_INFO "执行命令:mktexfmt --disable" - mktexfmt --disable - CHECK_RESULT $? 0 0 "禁用mktexFMT生成失败" - - LOG_INFO "步骤8:验证mktexFMT生成是否已禁用" - LOG_INFO "检查相关配置文件或状态" - # 这里根据实际需求添加验证步骤,例如检查配置文件或运行状态 - # 假设通过检查某个文件内容来验证 - if [ -f /etc/texmf/mktexfmt.conf ]; then - if grep -q "disable" /etc/texmf/mktexfmt.conf; then - LOG_INFO "mktexFMT生成已成功禁用" - else - LOG_ERROR "mktexFMT生成未成功禁用" - exit 1 - fi - else - LOG_INFO "未找到配置文件,假设禁用成功" - fi - - if [ $INSTALLED -eq 0 ]; then - LOG_INFO "步骤9:卸载texlive-ptex和texlive-platex-dev软件包" - dnf remove -y texlive-ptex texlive-platex-dev - CHECK_RESULT $? 0 0 "卸载texlive-ptex和texlive-platex-dev失败" - LOG_INFO "环境已恢复至测试前状态" - else - LOG_INFO "测试完成,环境保持安装状态" - fi - - LOG_INFO "测试结束:测试禁用mktexFMT生成" -} - -main "$@" \ No newline at end of file diff --git a/testcases/function_test/pkg_test/texlive-base/texlive-ptex/test_texlive-ptex_platex-dev_no-parse-first-line.sh b/testcases/function_test/pkg_test/texlive-base/texlive-ptex/test_texlive-ptex_platex-dev_no-parse-first-line.sh deleted file mode 100644 index d79ca37143f..00000000000 --- a/testcases/function_test/pkg_test/texlive-base/texlive-ptex/test_texlive-ptex_platex-dev_no-parse-first-line.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-08 -# @License : Mulan PSL v2 -# @Desc : 测试禁用输入文件首行解析 -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - LOG_INFO "开始测试禁用输入文件首行解析功能" - LOG_INFO "步骤1:检查yum源中是否存在texlive-ptex和platex-dev软件包" - dnf list available texlive-ptex platex-dev > /dev/null 2>&1 - if [ $? -ne 0 ]; then - LOG_ERROR "yum源中未找到texlive-ptex或platex-dev软件包" - exit 255 - fi - - LOG_INFO "步骤2:检查当前环境是否已安装texlive-ptex和platex-dev" - if rpm -q texlive-ptex platex-dev > /dev/null 2>&1; then - LOG_INFO "软件包已安装,测试完成后将保持安装状态" - INSTALLED=true - else - LOG_INFO "软件包未安装,将在测试前安装并在测试后卸载" - INSTALLED=false - fi - - if [ "$INSTALLED" = false ]; then - LOG_INFO "步骤3:安装texlive-ptex和platex-dev软件包" - dnf install -y texlive-ptex platex-dev - CHECK_RESULT $? 0 0 "安装texlive-ptex和platex-dev失败" - fi - - LOG_INFO "步骤4:创建测试输入文件" - cat > test_input.tex << "EOF" - %&platex - \documentclass{article} - \begin{document} - Hello, world! - \end{document} - EOF - CHECK_RESULT $? 0 0 "创建测试输入文件失败" - - LOG_INFO "步骤5:执行platex命令,禁用输入文件首行解析" - platex -no-parse-first-line test_input.tex > output.log 2>&1 - if [ $? -ne 0 ]; then - LOG_ERROR "platex命令执行失败,可能不支持-no-parse-first-line参数" - exit 255 - fi - CHECK_RESULT $? 0 0 "禁用输入文件首行解析功能测试失败" - - LOG_INFO "步骤6:检查输出文件是否生成" - if [ -f test_input.dvi ]; then - LOG_INFO "输出文件test_input.dvi生成成功" - else - LOG_ERROR "输出文件test_input.dvi未生成" - CHECK_RESULT 1 0 0 "输出文件未生成" - fi - - LOG_INFO "步骤7:清理测试文件" - rm -f test_input.tex test_input.dvi test_input.log test_input.aux output.log - CHECK_RESULT $? 0 0 "清理测试文件失败" - - if [ "$INSTALLED" = false ]; then - LOG_INFO "步骤8:卸载texlive-ptex和platex-dev软件包" - dnf remove -y texlive-ptex platex-dev - CHECK_RESULT $? 0 0 "卸载texlive-ptex和platex-dev失败" - fi - - LOG_INFO "测试完成,环境已恢复" -} - -main "$@" \ No newline at end of file diff --git a/testcases/function_test/pkg_test/texlive-base/texlive-ptex/test_texlive-ptex_platex-dev_no-shell-escape.sh b/testcases/function_test/pkg_test/texlive-base/texlive-ptex/test_texlive-ptex_platex-dev_no-shell-escape.sh deleted file mode 100644 index 84318848aa5..00000000000 --- a/testcases/function_test/pkg_test/texlive-base/texlive-ptex/test_texlive-ptex_platex-dev_no-shell-escape.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-08 -# @License : Mulan PSL v2 -# @Desc : 测试禁用\write18{SHELL COMMAND}功能 -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - # 判断是否已安装texlive-ptex和texlive-platex-dev软件包 - LOG_INFO "检查是否已安装texlive-ptex和texlive-platex-dev软件包" - if rpm -q texlive-ptex texlive-platex-dev >/dev/null 2>&1; then - LOG_INFO "软件包已安装,脚本结束时将保持安装状态" - INSTALLED=1 - else - LOG_INFO "软件包未安装,将在测试过程中安装" - INSTALLED=0 - fi - - # 检查yum源中是否存在软件包 - LOG_INFO "检查yum源中是否存在texlive-ptex和texlive-platex-dev软件包" - if ! dnf list available texlive-ptex texlive-platex-dev >/dev/null 2>&1; then - LOG_ERROR "yum源中不存在texlive-ptex或texlive-platex-dev软件包" - exit 255 - fi - - # 如果未安装,则安装软件包 - if [ $INSTALLED -eq 0 ]; then - LOG_INFO "安装texlive-ptex和texlive-platex-dev软件包" - dnf install -y texlive-ptex texlive-platex-dev - CHECK_RESULT $? 0 0 "安装texlive-ptex和texlive-platex-dev软件包失败" - fi - - # 创建测试LaTeX文件 - LOG_INFO "创建测试LaTeX文件,测试禁用\write18{SHELL COMMAND}功能" - cat > test_no_shell_escape.tex << "EOF" - \documentclass{article} - \begin{document} - \write18{echo "This should not be executed"} - Test document. - \end{document} - EOF - - # 使用platex命令编译,检查是否支持-no-shell-escape参数 - LOG_INFO "检查platex命令是否支持-no-shell-escape参数" - if ! platex --help | grep -q "no-shell-escape"; then - LOG_ERROR "platex命令不支持-no-shell-escape参数" - # 清理测试文件 - rm -f test_no_shell_escape.tex - # 如果之前未安装,则卸载软件包 - if [ $INSTALLED -eq 0 ]; then - LOG_INFO "卸载texlive-ptex和texlive-platex-dev软件包" - dnf remove -y texlive-ptex texlive-platex-dev - fi - exit 255 - fi - - # 使用-no-shell-escape参数编译LaTeX文件 - LOG_INFO "使用-no-shell-escape参数编译LaTeX文件" - platex -no-shell-escape test_no_shell_escape.tex - CHECK_RESULT $? 0 0 "使用-no-shell-escape参数编译LaTeX文件失败" - - # 检查是否成功禁止了\write18命令的执行 - LOG_INFO "检查是否成功禁止了\write18命令的执行" - if [ -f test_no_shell_escape.log ]; then - if grep -q "This should not be executed" test_no_shell_escape.log; then - LOG_ERROR "\write18命令被执行,未成功禁止" - # 清理测试文件 - rm -f test_no_shell_escape.tex test_no_shell_escape.log test_no_shell_escape.aux test_no_shell_escape.dvi - # 如果之前未安装,则卸载软件包 - if [ $INSTALLED -eq 0 ]; then - LOG_INFO "卸载texlive-ptex和texlive-platex-dev软件包" - dnf remove -y texlive-ptex texlive-platex-dev - fi - exit 1 - else - LOG_INFO "\write18命令被成功禁止" - fi - else - LOG_ERROR "编译日志文件未生成" - # 清理测试文件 - rm -f test_no_shell_escape.tex test_no_shell_escape.aux test_no_shell_escape.dvi - # 如果之前未安装,则卸载软件包 - if [ $INSTALLED -eq 0 ]; then - LOG_INFO "卸载texlive-ptex和texlive-platex-dev软件包" - dnf remove -y texlive-ptex texlive-platex-dev - fi - exit 1 - fi - - # 清理测试文件 - LOG_INFO "清理测试文件" - rm -f test_no_shell_escape.tex test_no_shell_escape.log test_no_shell_escape.aux test_no_shell_escape.dvi - - # 如果之前未安装,则卸载软件包 - if [ $INSTALLED -eq 0 ]; then - LOG_INFO "卸载texlive-ptex和texlive-platex-dev软件包" - dnf remove -y texlive-ptex texlive-platex-dev - CHECK_RESULT $? 0 0 "卸载texlive-ptex和texlive-platex-dev软件包失败" - fi - - LOG_INFO "测试完成" -} - -main "$@" \ No newline at end of file diff --git a/testcases/function_test/pkg_test/texlive-base/texlive-ptex/test_texlive-ptex_platex-dev_output-comment.sh b/testcases/function_test/pkg_test/texlive-base/texlive-ptex/test_texlive-ptex_platex-dev_output-comment.sh deleted file mode 100644 index c526146f0f5..00000000000 --- a/testcases/function_test/pkg_test/texlive-base/texlive-ptex/test_texlive-ptex_platex-dev_output-comment.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-08 -# @License : Mulan PSL v2 -# @Desc : 测试设置DVI文件注释 -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - LOG_INFO "开始测试:测试设置DVI文件注释" - - # 定义软件包名称 - PACKAGE_NAME="texlive-ptex" - - # 检查yum源中是否存在指定软件包 - LOG_INFO "检查yum源中是否存在软件包:$PACKAGE_NAME" - if ! dnf list available $PACKAGE_NAME &>/dev/null; then - LOG_ERROR "yum源中不存在软件包:$PACKAGE_NAME" - exit 255 - fi - - # 检查是否已安装软件包 - LOG_INFO "检查是否已安装软件包:$PACKAGE_NAME" - if rpm -q $PACKAGE_NAME &>/dev/null; then - LOG_INFO "软件包已安装,测试结束后将保持安装状态" - INSTALLED=true - else - LOG_INFO "软件包未安装,将在测试过程中安装" - INSTALLED=false - fi - - # 如果未安装,则安装软件包 - if [ "$INSTALLED" = false ]; then - LOG_INFO "安装软件包:$PACKAGE_NAME" - dnf install -y $PACKAGE_NAME - CHECK_RESULT $? 0 0 "安装软件包失败" - fi - - # 检查命令参数是否存在 - LOG_INFO "检查命令参数是否存在" - if ! command -v platex &>/dev/null; then - LOG_ERROR "命令platex不存在或不支持" - exit 255 - fi - - # 测试设置DVI文件注释 - LOG_INFO "测试设置DVI文件注释" - cat > test.tex << "EOF" - \documentclass{article} - \begin{document} - Hello, world! - \end{document} - EOF - - platex -interaction=nonstopmode test.tex - CHECK_RESULT $? 0 0 "生成DVI文件失败" - - # 检查生成的DVI文件是否存在 - LOG_INFO "检查生成的DVI文件是否存在" - if [ -f test.dvi ]; then - LOG_INFO "DVI文件生成成功" - else - LOG_ERROR "DVI文件生成失败" - exit 1 - fi - - # 清理测试文件 - LOG_INFO "清理测试文件" - rm -f test.tex test.log test.aux test.dvi - - # 如果测试前未安装软件包,则在测试结束后卸载 - 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-ptex/test_texlive-ptex_platex-dev_output-directory.sh b/testcases/function_test/pkg_test/texlive-base/texlive-ptex/test_texlive-ptex_platex-dev_output-directory.sh deleted file mode 100644 index 811c4a2a3a3..00000000000 --- a/testcases/function_test/pkg_test/texlive-base/texlive-ptex/test_texlive-ptex_platex-dev_output-directory.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-08 -# @License : Mulan PSL v2 -# @Desc : 测试指定输出目录 -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - # 检查是否已安装texlive-ptex和texlive-platex-dev - LOG_INFO "检查texlive-ptex和texlive-platex-dev软件包是否已安装" - if dnf list installed texlive-ptex texlive-platex-dev &> /dev/null; then - LOG_INFO "软件包已安装,测试后将保持安装状态" - ALREADY_INSTALLED=1 - else - LOG_INFO "软件包未安装,将在测试过程中安装" - ALREADY_INSTALLED=0 - fi - - # 检查yum源中是否有texlive-ptex和texlive-platex-dev软件包 - LOG_INFO "检查yum源中是否有texlive-ptex和texlive-platex-dev软件包" - if ! dnf list available texlive-ptex texlive-platex-dev &> /dev/null; then - LOG_ERROR "yum源中缺少texlive-ptex或texlate-platex-dev软件包" - exit 255 - fi - - # 如果未安装,则安装软件包 - if [ $ALREADY_INSTALLED -eq 0 ]; then - LOG_INFO "安装texlive-ptex和texlive-platex-dev软件包" - dnf install -y texlive-ptex texlive-platex-dev - CHECK_RESULT $? 0 0 "安装texlive-ptex和texlive-platex-dev失败" - fi - - # 创建一个简单的LaTeX测试文件 - LOG_INFO "创建测试LaTeX文件" - cat > test_input.tex << "EOF" - \documentclass{article} - \begin{document} - Hello, world! - \end{document} - EOF - CHECK_RESULT $? 0 0 "创建测试文件失败" - - # 测试指定输出目录功能 - LOG_INFO "测试指定输出目录功能" - # 检查platex命令是否支持-output-directory参数 - if ! platex --help | grep -q "output-directory"; then - LOG_ERROR "platex命令不支持-output-directory参数" - # 清理测试文件 - rm -f test_input.tex - # 如果测试过程中安装了软件包,则卸载 - if [ $ALREADY_INSTALLED -eq 0 ]; then - LOG_INFO "卸载测试过程中安装的软件包" - dnf remove -y texlive-ptex texlive-platex-dev - fi - exit 255 - fi - - # 创建输出目录 - mkdir -p output_test_dir - - # 使用platex命令并指定输出目录 - LOG_INFO "执行platex命令,指定输出目录为output_test_dir" - platex -output-directory=output_test_dir test_input.tex - CHECK_RESULT $? 0 0 "platex命令执行失败" - - # 检查输出目录中是否生成了预期文件 - LOG_INFO "检查输出目录中是否生成了预期文件" - if [ -f "output_test_dir/test_input.dvi" ] && [ -f "output_test_dir/test_input.log" ] && [ -f "output_test_dir/test_input.aux" ]; then - LOG_INFO "输出目录中成功生成了DVI、LOG和AUX文件" - else - LOG_ERROR "输出目录中未找到预期的输出文件" - # 清理环境 - rm -f test_input.tex - rm -rf output_test_dir - if [ $ALREADY_INSTALLED -eq 0 ]; then - LOG_INFO "卸载测试过程中安装的软件包" - dnf remove -y texlive-ptex texlive-platex-dev - fi - exit 1 - fi - - # 清理测试文件 - LOG_INFO "清理测试文件" - rm -f test_input.tex - rm -rf output_test_dir - - # 如果测试过程中安装了软件包,则卸载 - if [ $ALREADY_INSTALLED -eq 0 ]; then - LOG_INFO "卸载测试过程中安装的软件包" - dnf remove -y texlive-ptex texlive-platex-dev - 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-ptex/test_texlive-ptex_platex-dev_parse-first-line.sh b/testcases/function_test/pkg_test/texlive-base/texlive-ptex/test_texlive-ptex_platex-dev_parse-first-line.sh deleted file mode 100644 index e72147b9e8b..00000000000 --- a/testcases/function_test/pkg_test/texlive-base/texlive-ptex/test_texlive-ptex_platex-dev_parse-first-line.sh +++ /dev/null @@ -1,135 +0,0 @@ -#!/usr/bin/bash - -# Copyright (c) 2024 ISCAS .ALL rights reserved. -# This program is licensed under Mulan PSL v2. -# You can use it according to the terms and conditions of the Mulan PSL v2. -# http://license.coscl.org.cn/MulanPSL2 -# THIS PROGRAM IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, -# EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, -# MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. -# See the Mulan PSL v2 for more details. - -# ############################################# -# @Author : honghua -# @Contact : honghua@iscas.ac.cn -# @Date : 2026-03-08 -# @License : Mulan PSL v2 -# @Desc : 测试启用输入文件首行解析 -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - # 定义日志函数(如果未定义) - type LOG_INFO &>/dev/null || LOG_INFO() { echo "[INFO] $*"; } - type LOG_ERROR &>/dev/null || LOG_ERROR() { echo "[ERROR] $*"; } - - # 定义检查结果函数(如果未定义) - type CHECK_RESULT &>/dev/null || 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 "PASS: $message" - else - LOG_ERROR "FAIL: $message" - exit 255 - fi - else - if [[ $actual -ne $expect ]]; then - LOG_INFO "PASS: $message" - else - LOG_ERROR "FAIL: $message" - exit 255 - fi - fi - } - - # 定义SSH_CMD函数(如果未定义) - type SSH_CMD &>/dev/null || SSH_CMD() { - local cmd=$1 - local ip=$2 - local password=$3 - local user=$4 - sshpass -p "$password" ssh -o StrictHostKeyChecking=no "$user@$ip" "$cmd" - } - - # 软件包名称 - PACKAGE_NAME="texlive-ptex-platex-dev" - LOG_INFO "测试启用输入文件首行解析" - - # 步骤1: 检查软件包是否在yum源中 - LOG_INFO "步骤1: 检查软件包是否在yum源中" - dnf list available "$PACKAGE_NAME" &>/dev/null - if [[ $? -ne 0 ]]; then - LOG_ERROR "软件包 $PACKAGE_NAME 不在yum源中" - exit 255 - fi - LOG_INFO "软件包 $PACKAGE_NAME 在yum源中" - - # 步骤2: 检查是否已安装 - LOG_INFO "步骤2: 检查是否已安装" - if rpm -q "$PACKAGE_NAME" &>/dev/null; then - LOG_INFO "软件包 $PACKAGE_NAME 已安装" - INSTALLED=1 - else - LOG_INFO "软件包 $PACKAGE_NAME 未安装" - INSTALLED=0 - fi - - # 步骤3: 如果未安装,则安装软件包 - if [[ $INSTALLED -eq 0 ]]; then - LOG_INFO "步骤3: 安装软件包 $PACKAGE_NAME" - dnf install -y "$PACKAGE_NAME" - CHECK_RESULT $? 0 0 "安装软件包 $PACKAGE_NAME 失败" - LOG_INFO "软件包 $PACKAGE_NAME 安装成功" - fi - - # 步骤4: 测试启用输入文件首行解析 - LOG_INFO "步骤4: 测试启用输入文件首行解析" - # 创建一个测试TeX文件 - TEST_FILE="test_platex.tex" - cat > "$TEST_FILE" << "EOF" - %&platex - \documentclass{article} - \begin{document} - Hello, platex! - \end{document} - EOF - CHECK_RESULT $? 0 0 "创建测试文件失败" - - # 使用platex命令处理测试文件 - LOG_INFO "使用platex命令处理测试文件" - platex "$TEST_FILE" 2>&1 | tee platex_output.log - CHECK_RESULT $? 0 0 "platex命令执行失败" - - # 检查输出文件中是否包含期望的内容 - LOG_INFO "检查输出文件中是否包含期望的内容" - if grep -q "Hello, platex!" "${TEST_FILE%.tex}.dvi" 2>/dev/null || grep -q "Hello, platex!" platex_output.log; then - LOG_INFO "输入文件首行解析成功" - else - LOG_ERROR "输入文件首行解析失败" - exit 1 - fi - - # 步骤5: 清理测试文件 - LOG_INFO "步骤5: 清理测试文件" - rm -f "$TEST_FILE" "${TEST_FILE%.tex}.dvi" "${TEST_FILE%.tex}.log" "${TEST_FILE%.tex}.aux" platex_output.log - CHECK_RESULT $? 0 0 "清理测试文件失败" - - # 步骤6: 如果之前未安装,则卸载软件包 - if [[ $INSTALLED -eq 0 ]]; then - LOG_INFO "步骤6: 卸载软件包 $PACKAGE_NAME" - dnf remove -y "$PACKAGE_NAME" - CHECK_RESULT $? 0 0 "卸载软件包 $PACKAGE_NAME 失败" - LOG_INFO "软件包 $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-ptex/test_texlive-ptex_platex-dev_progname.sh b/testcases/function_test/pkg_test/texlive-base/texlive-ptex/test_texlive-ptex_platex-dev_progname.sh deleted file mode 100644 index 3e2c0988cf1..00000000000 --- a/testcases/function_test/pkg_test/texlive-base/texlive-ptex/test_texlive-ptex_platex-dev_progname.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-08 -# @License : Mulan PSL v2 -# @Desc : 测试设置程序(及格式)名称 -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - # 判断是否已安装texlive-ptex-platex-dev软件包 - LOG_INFO "检查texlive-ptex-platex-dev软件包是否已安装" - rpm -q texlive-ptex-platex-dev - if [ $? -eq 0 ]; then - LOG_INFO "软件包已安装,标记为已安装状态" - INSTALLED=1 - else - LOG_INFO "软件包未安装,标记为未安装状态" - INSTALLED=0 - fi - - # 检查yum源中是否有该软件包 - LOG_INFO "检查yum源中是否有texlive-ptex-platex-dev软件包" - dnf list available texlive-ptex-platex-dev > /dev/null 2>&1 - CHECK_RESULT $? 0 0 "yum源中未找到texlive-ptex-platex-dev软件包" - if [ $? -ne 0 ]; then - LOG_ERROR "yum源中未找到texlive-ptex-platex-dev软件包" - exit 255 - fi - - # 如果未安装,则安装软件包 - if [ $INSTALLED -eq 0 ]; then - LOG_INFO "开始安装texlive-ptex-platex-dev软件包" - dnf install -y texlive-ptex-platex-dev - CHECK_RESULT $? 0 0 "安装texlive-ptex-platex-dev软件包失败" - fi - - # 测试设置程序(及格式)名称 - LOG_INFO "测试设置程序(及格式)名称" - # 检查progname命令是否存在 - LOG_INFO "检查progname命令是否存在" - which progname > /dev/null 2>&1 - if [ $? -ne 0 ]; then - LOG_ERROR "progname命令不存在" - # 如果之前未安装,需要卸载软件包 - if [ $INSTALLED -eq 0 ]; then - LOG_INFO "卸载texlive-ptex-platex-dev软件包" - dnf remove -y texlive-ptex-platex-dev - CHECK_RESULT $? 0 0 "卸载texlive-ptex-platex-dev软件包失败" - fi - exit 255 - fi - - # 检查progname命令是否支持--help参数 - LOG_INFO "检查progname命令是否支持--help参数" - progname --help > /dev/null 2>&1 - if [ $? -ne 0 ]; then - LOG_ERROR "progname命令不支持--help参数" - # 如果之前未安装,需要卸载软件包 - if [ $INSTALLED -eq 0 ]; then - LOG_INFO "卸载texlive-ptex-platex-dev软件包" - dnf remove -y texlive-ptex-platex-dev - CHECK_RESULT $? 0 0 "卸载texlive-ptex-platex-dev软件包失败" - fi - exit 255 - fi - - # 执行progname命令测试 - LOG_INFO "执行progname命令测试" - progname --help | grep -i "usage" > /dev/null 2>&1 - CHECK_RESULT $? 0 0 "progname命令执行失败" - - # 清理环境 - LOG_INFO "清理测试环境" - if [ $INSTALLED -eq 0 ]; then - LOG_INFO "卸载texlive-ptex-platex-dev软件包" - dnf remove -y texlive-ptex-platex-dev - CHECK_RESULT $? 0 0 "卸载texlive-ptex-platex-dev软件包失败" - else - LOG_INFO "保持texlive-ptex-platex-dev软件包安装状态" - fi - - LOG_INFO "测试完成" -} - -main "$@" \ No newline at end of file diff --git a/testcases/function_test/pkg_test/texlive-base/texlive-ptex/test_texlive-ptex_platex-dev_recorder.sh b/testcases/function_test/pkg_test/texlive-base/texlive-ptex/test_texlive-ptex_platex-dev_recorder.sh deleted file mode 100644 index a2501c35046..00000000000 --- a/testcases/function_test/pkg_test/texlive-base/texlive-ptex/test_texlive-ptex_platex-dev_recorder.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-08 -# @License : Mulan PSL v2 -# @Desc : 测试启用文件名记录器 -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - # 判断是否已经安装texlive-ptex-platex-dev包 - LOG_INFO "检查是否已安装texlive-ptex-platex-dev软件包" - rpm -q texlive-ptex-platex-dev > /dev/null 2>&1 - if [ $? -eq 0 ]; then - LOG_INFO "texlive-ptex-platex-dev软件包已安装,测试结束后将保持安装状态" - INSTALLED_BEFORE_TEST=1 - else - LOG_INFO "texlive-ptex-platex-dev软件包未安装,将在测试中安装" - INSTALLED_BEFORE_TEST=0 - fi - - # 检查yum源中是否有texlive-ptex-platex-dev软件包 - LOG_INFO "检查yum源中是否有texlive-ptex-platex-dev软件包" - dnf list available texlive-ptex-platex-dev > /dev/null 2>&1 - if [ $? -ne 0 ]; then - LOG_ERROR "yum源中没有texlive-ptex-platex-dev软件包" - exit 255 - fi - - # 如果未安装,则安装软件包 - if [ ${INSTALLED_BEFORE_TEST} -eq 0 ]; then - LOG_INFO "安装texlive-ptex-platex-dev软件包" - dnf install -y texlive-ptex-platex-dev - CHECK_RESULT $? 0 0 "安装texlive-ptex-platex-dev失败" - fi - - # 测试启用文件名记录器 - LOG_INFO "测试启用文件名记录器功能" - platex --recorder test.tex > /dev/null 2>&1 - CHECK_RESULT $? 0 0 "启用文件名记录器失败" - - # 检查是否生成了.fls文件 - LOG_INFO "检查是否生成了.fls文件" - if [ -f test.fls ]; then - LOG_INFO "成功生成了.fls文件" - rm -f test.fls - else - LOG_ERROR "未生成.fls文件" - exit 1 - fi - - # 清理临时文件 - LOG_INFO "清理测试生成的临时文件" - rm -f test.aux test.log test.dvi - - # 如果测试前未安装,则卸载软件包 - if [ ${INSTALLED_BEFORE_TEST} -eq 0 ]; then - LOG_INFO "卸载texlive-ptex-platex-dev软件包" - dnf remove -y texlive-ptex-platex-dev - CHECK_RESULT $? 0 0 "卸载texlive-ptex-platex-dev失败" - else - LOG_INFO "测试前已安装texlive-ptex-platex-dev,保持安装状态" - fi - - LOG_INFO "测试启用文件名记录器完成" -} - -main "$@" \ No newline at end of file diff --git a/testcases/function_test/pkg_test/texlive-base/texlive-ptex/test_texlive-ptex_platex-dev_shell-escape.sh b/testcases/function_test/pkg_test/texlive-base/texlive-ptex/test_texlive-ptex_platex-dev_shell-escape.sh deleted file mode 100644 index 0614d3c4e21..00000000000 --- a/testcases/function_test/pkg_test/texlive-base/texlive-ptex/test_texlive-ptex_platex-dev_shell-escape.sh +++ /dev/null @@ -1,134 +0,0 @@ -#!/usr/bin/bash - -# Copyright (c) 2024 ISCAS .ALL rights reserved. -# This program is licensed under Mulan PSL v2. -# You can use it according to the terms and conditions of the Mulan PSL v2. -# http://license.coscl.org.cn/MulanPSL2 -# THIS PROGRAM IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, -# EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, -# MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. -# See the Mulan PSL v2 for more details. - -# ############################################# -# @Author : honghua -# @Contact : honghua@iscas.ac.cn -# @Date : 2026-03-08 -# @License : Mulan PSL v2 -# @Desc : 测试启用\write18{SHELL COMMAND}功能 -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - # 定义日志函数(根据要求直接使用,这里仅作声明以便脚本运行) - LOG_INFO() { echo "[INFO] $*"; } - LOG_ERROR() { echo "[ERROR] $*"; } - - # 定义检查结果函数(根据要求直接使用) - CHECK_RESULT() { - local actual=$1 - local expect=$2 - local mode=$3 - local message=$4 - if [ $mode -eq 0 ]; then - if [ $actual -ne $expect ]; then - LOG_ERROR "$message" - exit $actual - fi - else - if [ $actual -eq $expect ]; then - LOG_ERROR "$message" - exit 1 - fi - fi - } - - # 定义SSH_CMD函数(根据要求直接使用,这里仅作声明以便脚本运行) - SSH_CMD() { - local cmd=$1 - local ip=$2 - local password=$3 - local user=$4 - sshpass -p "$password" ssh -o StrictHostKeyChecking=no "$user@$ip" "$cmd" - } - - # 定义软件包名称 - PACKAGE_NAME="texlive-ptex" - SUB_PACKAGE="platex-dev" - - # 步骤1:检查yum源中是否存在指定软件包 - LOG_INFO "步骤1:检查yum源中是否存在软件包 $PACKAGE_NAME 和 $SUB_PACKAGE" - if ! dnf list available "$PACKAGE_NAME" 2>/dev/null | grep -q "$PACKAGE_NAME"; then - LOG_ERROR "软件包 $PACKAGE_NAME 在yum源中不存在" - exit 255 - fi - if ! dnf list available "$SUB_PACKAGE" 2>/dev/null | grep -q "$SUB_PACKAGE"; then - LOG_ERROR "软件包 $SUB_PACKAGE 在yum源中不存在" - exit 255 - fi - - # 步骤2:检查环境是否已安装软件包 - LOG_INFO "步骤2:检查环境是否已安装软件包 $PACKAGE_NAME 和 $SUB_PACKAGE" - INSTALLED=false - if rpm -q "$PACKAGE_NAME" &>/dev/null && rpm -q "$SUB_PACKAGE" &>/dev/null; then - LOG_INFO "软件包已安装" - INSTALLED=true - else - LOG_INFO "软件包未安装,将进行安装" - fi - - # 步骤3:如果未安装,则安装软件包 - if [ "$INSTALLED" = false ]; then - LOG_INFO "步骤3:安装软件包 $PACKAGE_NAME 和 $SUB_PACKAGE" - dnf install -y "$PACKAGE_NAME" "$SUB_PACKAGE" - CHECK_RESULT $? 0 0 "安装软件包失败" - fi - - # 步骤4:检查是否支持--shell-escape参数 - LOG_INFO "步骤4:检查platex命令是否支持--shell-escape参数" - if ! platex --help 2>&1 | grep -q -- "--shell-escape"; then - LOG_ERROR "platex命令不支持--shell-escape参数" - exit 255 - fi - - # 步骤5:创建测试LaTeX文件,测试\write18{SHELL COMMAND}功能 - LOG_INFO "步骤5:创建测试LaTeX文件,测试\write18{SHELL COMMAND}功能" - TEST_FILE="test_shell_escape.tex" - cat > "$TEST_FILE" << "EOF" - \documentclass{article} - \begin{document} - \write18{echo "Shell escape test" > test_output.txt} - Test document for shell escape. - \end{document} - EOF - - # 步骤6:使用--shell-escape参数编译LaTeX文件 - LOG_INFO "步骤6:使用--shell-escape参数编译LaTeX文件" - platex --shell-escape "$TEST_FILE" - CHECK_RESULT $? 0 0 "使用--shell-escape编译LaTeX文件失败" - - # 步骤7:检查\write18是否成功执行了shell命令 - LOG_INFO "步骤7:检查\write18是否成功执行了shell命令" - if [ -f "test_output.txt" ]; then - LOG_INFO "test_output.txt文件已创建,\write18功能正常" - CHECK_RESULT 0 0 0 "\write18功能测试失败" - else - LOG_ERROR "test_output.txt文件未创建,\write18功能异常" - CHECK_RESULT 1 0 1 "\write18功能测试失败" - fi - - # 步骤8:清理测试文件 - LOG_INFO "步骤8:清理测试文件" - rm -f "$TEST_FILE" test_output.txt *.log *.aux *.dvi - - # 步骤9:如果之前未安装软件包,则卸载 - if [ "$INSTALLED" = false ]; then - LOG_INFO "步骤9:卸载软件包 $PACKAGE_NAME 和 $SUB_PACKAGE" - dnf remove -y "$PACKAGE_NAME" "$SUB_PACKAGE" - 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-ptex/test_texlive-ptex_platex-dev_shell-restricted.sh b/testcases/function_test/pkg_test/texlive-base/texlive-ptex/test_texlive-ptex_platex-dev_shell-restricted.sh deleted file mode 100644 index 2b246c0fb89..00000000000 --- a/testcases/function_test/pkg_test/texlive-base/texlive-ptex/test_texlive-ptex_platex-dev_shell-restricted.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-08 -# @License : Mulan PSL v2 -# @Desc : 测试启用受限的\write18功能 -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - # 检查是否已安装texlive-ptex和texlive-platex-dev软件包 - LOG_INFO "检查是否已安装texlive-ptex和texlive-platex-dev软件包" - rpm -q texlive-ptex texlive-platex-dev > /dev/null 2>&1 - is_installed=$? - - if [ $is_installed -eq 0 ]; then - LOG_INFO "软件包已安装,脚本结束后将保持安装状态" - need_cleanup=0 - else - LOG_INFO "软件包未安装,将执行安装步骤" - need_cleanup=1 - fi - - # 检查yum源中是否有texlive-ptex软件包 - LOG_INFO "检查yum源中是否有texlive-ptex软件包" - dnf list available texlive-ptex > /dev/null 2>&1 - CHECK_RESULT $? 0 0 "yum源中未找到texlive-ptex软件包" - if [ $? -ne 0 ]; then - LOG_ERROR "yum源中未找到texlive-ptex软件包" - exit 255 - fi - - # 检查yum源中是否有texlive-platex-dev软件包 - LOG_INFO "检查yum源中是否有texlive-platex-dev软件包" - dnf list available texlive-platex-dev > /dev/null 2>&1 - CHECK_RESULT $? 0 0 "yum源中未找到texlive-platex-dev软件包" - if [ $? -ne 0 ]; then - LOG_ERROR "yum源中未找到texlive-platex-dev软件包" - exit 255 - fi - - # 如果未安装,则安装软件包 - if [ $need_cleanup -eq 1 ]; then - LOG_INFO "安装texlive-ptex和texlive-platex-dev软件包" - dnf install -y texlive-ptex texlive-platex-dev - CHECK_RESULT $? 0 0 "安装软件包失败" - fi - - # 测试启用受限的\write18功能 - LOG_INFO "测试启用受限的\\write18功能" - - # 创建一个测试LaTeX文件 - LOG_INFO "创建测试LaTeX文件" - cat > test_write18.tex << "EOF" - \documentclass{article} - \begin{document} - \write18{echo "testing restricted write18"} - Test document - \end{document} - EOF - - # 使用platex命令编译,启用shell_escape(受限模式) - LOG_INFO "使用platex编译测试文件(启用shell_escape受限模式)" - platex -shell-escape test_write18.tex - CHECK_RESULT $? 0 0 "platex编译失败" - - # 检查是否生成了预期的输出文件 - LOG_INFO "检查是否生成了dvi文件" - [ -f test_write18.dvi ] - CHECK_RESULT $? 0 0 "未生成dvi文件" - - # 清理测试文件 - LOG_INFO "清理测试文件" - rm -f test_write18.tex test_write18.dvi test_write18.log test_write18.aux - - # 如果脚本开始时未安装软件包,则在结束时卸载 - if [ $need_cleanup -eq 1 ]; then - LOG_INFO "卸载texlive-ptex和texlive-platex-dev软件包" - dnf remove -y texlive-ptex texlive-platex-dev - 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-ptex/test_texlive-ptex_platex-dev_src-specials.sh b/testcases/function_test/pkg_test/texlive-base/texlive-ptex/test_texlive-ptex_platex-dev_src-specials.sh deleted file mode 100644 index 11be9c00d53..00000000000 --- a/testcases/function_test/pkg_test/texlive-base/texlive-ptex/test_texlive-ptex_platex-dev_src-specials.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-08 -# @License : Mulan PSL v2 -# @Desc : 测试在DVI文件中插入源特殊标记 -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - # 检查是否已安装texlive-ptex和texlive-platex-dev包 - LOG_INFO "检查是否已安装texlive-ptex和texlive-platex-dev软件包" - if rpm -q texlive-ptex texlive-platex-dev >/dev/null 2>&1; then - LOG_INFO "软件包已安装,标记为已安装状态" - INSTALLED="true" - else - LOG_INFO "软件包未安装,标记为未安装状态" - INSTALLED="false" - fi - - # 检查yum源中是否存在所需软件包 - LOG_INFO "检查yum源中是否存在texlive-ptex和texlive-platex-dev软件包" - if ! dnf list available texlive-ptex texlive-platex-dev >/dev/null 2>&1; then - LOG_ERROR "yum源中未找到texlive-ptex或texlive-platex-dev软件包" - exit 255 - fi - - # 如果未安装,则安装软件包 - if [ "$INSTALLED" = "false" ]; then - LOG_INFO "开始安装texlive-ptex和texlive-platex-dev软件包" - dnf install -y texlive-ptex texlive-platex-dev - CHECK_RESULT $? 0 0 "安装texlive-ptex和texlive-platex-dev软件包失败" - fi - - # 创建测试DVI文件 - LOG_INFO "创建测试DVI文件,插入源特殊标记" - cat > test_src_special.tex << "EOF" - \documentclass{article} - \usepackage{platex} - \begin{document} - 测试在DVI文件中插入源特殊标记。 - \special{src:1234} - \end{document} - EOF - - # 使用platex编译TeX文件生成DVI - LOG_INFO "使用platex编译TeX文件生成DVI" - platex -src-specials=all test_src_special.tex - CHECK_RESULT $? 0 0 "platex编译失败" - - # 检查生成的DVI文件中是否包含源特殊标记 - LOG_INFO "检查生成的DVI文件中是否包含源特殊标记" - if grep -q "src:1234" test_src_special.dvi 2>/dev/null; then - LOG_INFO "DVI文件中成功找到源特殊标记" - else - LOG_ERROR "DVI文件中未找到源特殊标记" - exit 1 - fi - - # 清理测试文件 - LOG_INFO "清理测试生成的临时文件" - rm -f test_src_special.tex test_src_special.aux test_src_special.log test_src_special.dvi - - # 如果测试前未安装,则卸载软件包 - if [ "$INSTALLED" = "false" ]; then - LOG_INFO "卸载测试安装的软件包" - dnf remove -y texlive-ptex texlive-platex-dev - CHECK_RESULT $? 0 0 "卸载texlive-ptex和texlive-platex-dev软件包失败" - fi - - LOG_INFO "测试完成,环境已恢复" -} - -main "$@" \ No newline at end of file diff --git a/testcases/function_test/pkg_test/texlive-base/texlive-ptex/test_texlive-ptex_platex-dev_src-specials_cr.sh b/testcases/function_test/pkg_test/texlive-base/texlive-ptex/test_texlive-ptex_platex-dev_src-specials_cr.sh deleted file mode 100644 index 0089542d339..00000000000 --- a/testcases/function_test/pkg_test/texlive-base/texlive-ptex/test_texlive-ptex_platex-dev_src-specials_cr.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-08 -# @License : Mulan PSL v2 -# @Desc : 测试在DVI文件的特定位置(cr)插入源特殊标记 -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - # 判断是否已经安装了texlive-ptex和texlive-platex-dev软件包 - LOG_INFO "检查是否已安装texlive-ptex和texlive-platex-dev软件包" - rpm -q texlive-ptex texlive-platex-dev > /dev/null 2>&1 - if [ $? -eq 0 ]; then - LOG_INFO "软件包已安装,脚本结束后将保持安装状态" - INSTALLED=1 - else - LOG_INFO "软件包未安装,将在测试过程中安装并在结束后卸载" - INSTALLED=0 - fi - - # 检查yum源中是否存在texlive-ptex和texlive-platex-dev软件包 - LOG_INFO "检查yum源中是否存在texlive-ptex和texlive-platex-dev软件包" - dnf list available texlive-ptex texlive-platex-dev > /dev/null 2>&1 - if [ $? -ne 0 ]; then - LOG_ERROR "yum源中不存在texlive-ptex或texlive-platex-dev软件包" - exit 255 - fi - - # 如果未安装,则安装软件包 - if [ $INSTALLED -eq 0 ]; then - LOG_INFO "开始安装texlive-ptex和texlive-platex-dev软件包" - dnf install -y texlive-ptex texlive-platex-dev - CHECK_RESULT $? 0 0 "安装texlive-ptex和texlive-platex-dev软件包失败" - fi - - # 创建测试用的LaTeX文件 - LOG_INFO "创建测试用的LaTeX文件" - cat > test_cr.tex << "EOF" - \documentclass{article} - \usepackage{platex} - \begin{document} - Test for cr source specials. - \special{src: 10 20 test.tex} - \special{src: 30 40 test.tex} - \end{document} - EOF - CHECK_RESULT $? 0 0 "创建LaTeX文件失败" - - # 使用platex编译LaTeX文件生成DVI - LOG_INFO "使用platex编译LaTeX文件生成DVI" - platex -src-specials test_cr.tex - CHECK_RESULT $? 0 0 "platex编译失败" - - # 检查生成的DVI文件中是否包含源特殊标记 - LOG_INFO "检查DVI文件中是否包含源特殊标记" - dvitype test_cr.dvi | grep -q "src:" - CHECK_RESULT $? 0 0 "DVI文件中未找到源特殊标记" - - # 测试在特定位置(cr)插入源特殊标记 - LOG_INFO "测试在DVI文件的特定位置(cr)插入源特殊标记" - cat > test_cr_cr.tex << "EOF" - \documentclass{article} - \usepackage{platex} - \begin{document} - Test for cr source specials with cr. - First line.\\ - \special{src: 50 60 test.tex} - Second line. - \end{document} - EOF - CHECK_RESULT $? 0 0 "创建带cr的LaTeX文件失败" - - platex -src-specials test_cr_cr.tex - CHECK_RESULT $? 0 0 "编译带cr的LaTeX文件失败" - - dvitype test_cr_cr.dvi | grep -q "src:" - CHECK_RESULT $? 0 0 "带cr的DVI文件中未找到源特殊标记" - - LOG_INFO "测试在DVI文件的特定位置(cr)插入源特殊标记成功" - - # 清理测试文件 - LOG_INFO "清理测试文件" - rm -f test_cr.tex test_cr_cr.tex test_cr.dvi test_cr_cr.dvi test_cr.aux test_cr_cr.aux test_cr.log test_cr_cr.log - CHECK_RESULT $? 0 0 "清理测试文件失败" - - # 如果测试前未安装,则卸载软件包 - if [ $INSTALLED -eq 0 ]; then - LOG_INFO "卸载texlive-ptex和texlive-platex-dev软件包" - dnf remove -y texlive-ptex texlive-platex-dev - CHECK_RESULT $? 0 0 "卸载texlive-ptex和texlive-platex-dev软件包失败" - fi - - LOG_INFO "测试脚本执行完成" -} - -main "$@" \ No newline at end of file diff --git a/testcases/function_test/pkg_test/texlive-base/texlive-ptex/test_texlive-ptex_platex-dev_synctex.sh b/testcases/function_test/pkg_test/texlive-base/texlive-ptex/test_texlive-ptex_platex-dev_synctex.sh deleted file mode 100644 index 4fbe079def2..00000000000 --- a/testcases/function_test/pkg_test/texlive-base/texlive-ptex/test_texlive-ptex_platex-dev_synctex.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-08 -# @License : Mulan PSL v2 -# @Desc : 测试生成预览器的SyncTeX数据 -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - LOG_INFO "开始测试:测试生成预览器的SyncTeX数据" - LOG_INFO "步骤1:检查yum源中是否存在texlive-ptex-platex-dev软件包" - dnf list available texlive-ptex-platex-dev > /dev/null 2>&1 - if [ $? -ne 0 ]; then - LOG_ERROR "yum源中不存在texlive-ptex-platex-dev软件包" - exit 255 - fi - - LOG_INFO "步骤2:检查环境是否已安装texlive-ptex-platex-dev" - rpm -q texlive-ptex-platex-dev > /dev/null 2>&1 - if [ $? -eq 0 ]; then - INSTALLED=true - LOG_INFO "环境已安装texlive-ptex-platex-dev,测试结束后保持安装状态" - else - INSTALLED=false - LOG_INFO "环境未安装texlive-ptex-platex-dev,测试前将进行安装" - fi - - if [ "$INSTALLED" = false ]; then - LOG_INFO "步骤3:安装texlive-ptex-platex-dev软件包" - dnf install -y texlive-ptex-platex-dev - CHECK_RESULT $? 0 0 "安装texlive-ptex-platex-dev失败" - fi - - LOG_INFO "步骤4:检查platex命令是否支持-synctex参数" - platex --help 2>&1 | grep -q -- "-synctex" - if [ $? -ne 0 ]; then - LOG_ERROR "platex命令不支持-synctex参数" - exit 255 - fi - - LOG_INFO "步骤5:创建测试LaTeX文件" - cat > test.tex << "EOF" - \documentclass{article} - \begin{document} - Hello, SyncTeX! - \end{document} - EOF - CHECK_RESULT $? 0 0 "创建测试LaTeX文件失败" - - LOG_INFO "步骤6:使用platex命令生成SyncTeX数据" - platex -synctex=1 test.tex - CHECK_RESULT $? 0 0 "生成SyncTeX数据失败" - - LOG_INFO "步骤7:检查是否生成.synctex.gz文件" - if [ -f test.synctex.gz ]; then - LOG_INFO "成功生成SyncTeX数据文件:test.synctex.gz" - else - LOG_ERROR "未生成SyncTeX数据文件" - exit 1 - fi - - LOG_INFO "步骤8:清理测试文件" - rm -f test.tex test.aux test.log test.dvi test.synctex.gz - CHECK_RESULT $? 0 0 "清理测试文件失败" - - if [ "$INSTALLED" = false ]; then - LOG_INFO "步骤9:卸载texlive-ptex-platex-dev软件包" - dnf remove -y texlive-ptex-platex-dev - CHECK_RESULT $? 0 0 "卸载texlive-ptex-platex-dev失败" - fi - - LOG_INFO "测试完成:成功测试生成预览器的SyncTeX数据" -} - -main "$@" \ No newline at end of file diff --git a/testcases/function_test/pkg_test/texlive-base/texlive-ptex/test_texlive-ptex_platex-dev_translate-file.sh b/testcases/function_test/pkg_test/texlive-base/texlive-ptex/test_texlive-ptex_platex-dev_translate-file.sh deleted file mode 100644 index 8a8b7aca9cc..00000000000 --- a/testcases/function_test/pkg_test/texlive-base/texlive-ptex/test_texlive-ptex_platex-dev_translate-file.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-08 -# @License : Mulan PSL v2 -# @Desc : 测试使用TCX文件进行字符转换 -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - LOG_INFO "开始测试使用TCX文件进行字符转换" - - # 检查是否已安装texlive-ptex和platex-dev软件包 - LOG_INFO "检查是否已安装texlive-ptex和platex-dev软件包" - rpm -q texlive-ptex platex-dev > /dev/null 2>&1 - if [ $? -eq 0 ]; then - LOG_INFO "软件包已安装,测试结束后保持安装状态" - installed=true - else - LOG_INFO "软件包未安装,将在测试过程中安装" - installed=false - fi - - # 检查yum源中是否有texlive-ptex和platex-dev软件包 - LOG_INFO "检查yum源中是否有texlive-ptex和platex-dev软件包" - dnf list available texlive-ptex platex-dev > /dev/null 2>&1 - if [ $? -ne 0 ]; then - LOG_ERROR "yum源中缺少texlive-ptex或platex-dev软件包" - exit 255 - fi - - # 如果未安装,则安装软件包 - if [ "$installed" = false ]; then - LOG_INFO "安装texlive-ptex和platex-dev软件包" - dnf install -y texlive-ptex platex-dev - CHECK_RESULT $? 0 0 "安装texlive-ptex和platex-dev失败" - fi - - # 检查是否支持TCX文件字符转换命令 - LOG_INFO "检查是否支持TCX文件字符转换命令" - which tcx2utf > /dev/null 2>&1 - if [ $? -ne 0 ]; then - LOG_ERROR "不支持tcx2utf命令" - if [ "$installed" = false ]; then - LOG_INFO "卸载已安装的软件包" - dnf remove -y texlive-ptex platex-dev - fi - exit 255 - fi - - # 创建测试用的TCX文件 - LOG_INFO "创建测试用的TCX文件" - cat > test.tcx << EOF - - 测试文本 - - EOF - CHECK_RESULT $? 0 0 "创建TCX文件失败" - - # 执行TCX文件字符转换 - LOG_INFO "执行TCX文件字符转换" - tcx2utf test.tcx test_output.txt - CHECK_RESULT $? 0 0 "TCX文件字符转换失败" - - # 检查转换结果 - LOG_INFO "检查转换结果" - if [ -f test_output.txt ]; then - LOG_INFO "转换成功,输出文件已生成" - else - LOG_ERROR "转换失败,输出文件未生成" - CHECK_RESULT 1 0 0 "转换结果检查失败" - fi - - # 清理测试文件 - LOG_INFO "清理测试文件" - rm -f test.tcx test_output.txt - CHECK_RESULT $? 0 0 "清理测试文件失败" - - # 如果测试前未安装,则卸载软件包 - if [ "$installed" = false ]; then - LOG_INFO "卸载texlive-ptex和platex-dev软件包" - dnf remove -y texlive-ptex platex-dev - CHECK_RESULT $? 0 0 "卸载texlive-ptex和platex-dev失败" - fi - - LOG_INFO "测试使用TCX文件进行字符转换完成" -} - -main "$@" \ No newline at end of file diff --git a/testcases/function_test/pkg_test/texlive-base/texlive-ptex/test_texlive-ptex_platex-dev_version.sh b/testcases/function_test/pkg_test/texlive-base/texlive-ptex/test_texlive-ptex_platex-dev_version.sh deleted file mode 100644 index a5f2299605d..00000000000 --- a/testcases/function_test/pkg_test/texlive-base/texlive-ptex/test_texlive-ptex_platex-dev_version.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-08 -# @License : Mulan PSL v2 -# @Desc : 测试打印版本信息并退出 -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - # 判断环境是否已安装texlive-ptex-platex-dev - LOG_INFO "检查texlive-ptex-platex-dev是否已安装" - rpm -q texlive-ptex-platex-dev > /dev/null 2>&1 - if [ $? -eq 0 ]; then - LOG_INFO "texlive-ptex-platex-dev已安装,测试结束后将保持安装状态" - INSTALLED=1 - else - LOG_INFO "texlive-ptex-platex-dev未安装,测试结束后将卸载" - INSTALLED=0 - fi - - # 检查yum源中是否有该软件包 - LOG_INFO "检查yum源中是否有texlive-ptex-platex-dev软件包" - dnf list available texlive-ptex-platex-dev > /dev/null 2>&1 - CHECK_RESULT $? 0 0 "yum源中未找到texlive-ptex-platex-dev软件包" - if [ $? -ne 0 ]; then - LOG_ERROR "yum源中未找到texlive-ptex-platex-dev软件包" - exit 255 - fi - - # 如果未安装,则安装软件包 - if [ $INSTALLED -eq 0 ]; then - LOG_INFO "开始安装texlive-ptex-platex-dev软件包" - dnf install -y texlive-ptex-platex-dev > /dev/null 2>&1 - CHECK_RESULT $? 0 0 "安装texlive-ptex-platex-dev失败" - LOG_INFO "texlive-ptex-platex-dev安装成功" - fi - - # 测试打印版本信息并退出 - LOG_INFO "测试platex命令的版本信息" - platex --version > /dev/null 2>&1 - CHECK_RESULT $? 0 0 "platex命令执行失败" - LOG_INFO "platex版本信息测试成功" - - # 测试其他相关命令的版本信息 - LOG_INFO "测试ptex命令的版本信息" - ptex --version > /dev/null 2>&1 - CHECK_RESULT $? 0 0 "ptex命令执行失败" - LOG_INFO "ptex版本信息测试成功" - - # 测试参数不存在或不支持的情况 - LOG_INFO "测试不支持的参数" - platex --invalid-option > /dev/null 2>&1 - if [ $? -eq 255 ]; then - LOG_INFO "不支持的参数测试成功,返回255" - else - LOG_ERROR "不支持的参数测试失败" - exit 255 - fi - - # 环境恢复 - if [ $INSTALLED -eq 0 ]; then - LOG_INFO "开始卸载texlive-ptex-platex-dev软件包" - dnf remove -y texlive-ptex-platex-dev > /dev/null 2>&1 - CHECK_RESULT $? 0 0 "卸载texlive-ptex-platex-dev失败" - LOG_INFO "texlive-ptex-platex-dev卸载成功" - else - LOG_INFO "测试开始前已安装,保持安装状态" - fi - - LOG_INFO "测试脚本执行完成" -} - -main "$@" \ No newline at end of file diff --git a/testcases/function_test/pkg_test/texlive-base/texlive-ptex/test_texlive-ptex_platex_etex.sh b/testcases/function_test/pkg_test/texlive-base/texlive-ptex/test_texlive-ptex_platex_etex.sh deleted file mode 100644 index 2f4a115cc99..00000000000 --- a/testcases/function_test/pkg_test/texlive-base/texlive-ptex/test_texlive-ptex_platex_etex.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-08 -# @License : Mulan PSL v2 -# @Desc : 测试 platex 命令启用 e-TeX 扩展的选项 -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - # 测试 platex 命令启用 e-TeX 扩展的选项 - - # 定义软件包名称 - PACKAGE_NAME="texlive-ptex" - - # 步骤1:检查环境是否已安装指定软件包 - LOG_INFO "步骤1:检查环境是否已安装指定软件包" - rpm -q $PACKAGE_NAME > /dev/null 2>&1 - if [ $? -eq 0 ]; then - LOG_INFO "软件包 $PACKAGE_NAME 已安装,测试结束时将保持安装状态" - INSTALLED_BEFORE_TEST=1 - else - LOG_INFO "软件包 $PACKAGE_NAME 未安装,测试前将安装,测试后将卸载" - INSTALLED_BEFORE_TEST=0 - fi - - # 步骤2:检查yum源中是否存在该软件包 - LOG_INFO "步骤2:检查yum源中是否存在软件包 $PACKAGE_NAME" - dnf list available $PACKAGE_NAME > /dev/null 2>&1 - if [ $? -ne 0 ]; then - LOG_ERROR "yum源中不存在软件包 $PACKAGE_NAME" - exit 255 - fi - - # 如果环境未安装,则安装软件包 - if [ $INSTALLED_BEFORE_TEST -eq 0 ]; then - LOG_INFO "步骤3:安装软件包 $PACKAGE_NAME" - dnf install -y $PACKAGE_NAME - CHECK_RESULT $? 0 0 "安装软件包 $PACKAGE_NAME 失败" - fi - - # 步骤4:检查 platex 命令是否存在 - LOG_INFO "步骤4:检查 platex 命令是否存在" - command -v platex > /dev/null 2>&1 - CHECK_RESULT $? 0 0 "platex 命令未找到" - - # 步骤5:测试 platex 命令的 -etex 选项(启用 e-TeX 扩展) - LOG_INFO "步骤5:测试 platex 命令的 -etex 选项" - # 创建一个简单的 TeX 文件来测试 - TEST_TEX_FILE="test_etex.tex" - cat > $TEST_TEX_FILE << "EOF" - \documentclass{article} - \begin{document} - Hello, e-TeX! - \end{document} - EOF - - # 使用 -etex 选项编译 TeX 文件 - platex -etex $TEST_TEX_FILE > /dev/null 2>&1 - CHECK_RESULT $? 0 0 "platex 命令使用 -etex 选项编译失败" - - # 步骤6:验证生成的 DVI 文件 - LOG_INFO "步骤6:验证生成的 DVI 文件" - if [ -f "${TEST_TEX_FILE%.tex}.dvi" ]; then - LOG_INFO "DVI 文件生成成功" - else - LOG_ERROR "DVI 文件未生成" - exit 1 - fi - - # 步骤7:清理测试文件 - LOG_INFO "步骤7:清理测试文件" - rm -f $TEST_TEX_FILE ${TEST_TEX_FILE%.tex}.dvi ${TEST_TEX_FILE%.tex}.aux ${TEST_TEX_FILE%.tex}.log - - # 步骤8:如果测试前未安装,则卸载软件包 - if [ $INSTALLED_BEFORE_TEST -eq 0 ]; then - LOG_INFO "步骤8:卸载软件包 $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-ptex/test_texlive-ptex_platex_halt_on_error.sh b/testcases/function_test/pkg_test/texlive-base/texlive-ptex/test_texlive-ptex_platex_halt_on_error.sh deleted file mode 100644 index 193becea510..00000000000 --- a/testcases/function_test/pkg_test/texlive-base/texlive-ptex/test_texlive-ptex_platex_halt_on_error.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-08 -# @License : Mulan PSL v2 -# @Desc : 测试 platex 命令在遇到第一个错误时停止处理的选项 -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - # 定义软件包名称 - PACKAGE_NAME="texlive-ptex" - - # 步骤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=1 - else - LOG_INFO "软件包 $PACKAGE_NAME 未安装,标记为未安装状态" - INSTALLED=0 - fi - - # 步骤3:如果未安装,则安装软件包 - if [ $INSTALLED -eq 0 ]; then - LOG_INFO "步骤3:安装软件包 $PACKAGE_NAME" - dnf install -y "$PACKAGE_NAME" - CHECK_RESULT $? 0 0 "安装软件包 $PACKAGE_NAME 失败" - fi - - # 步骤4:检查platex命令是否存在 - LOG_INFO "步骤4:检查platex命令是否存在" - command -v platex &>/dev/null - CHECK_RESULT $? 0 0 "platex命令不存在" - - # 步骤5:创建测试用的LaTeX文件 - LOG_INFO "步骤5:创建测试用的LaTeX文件" - cat > test_halt.tex << "EOF" - \documentclass{article} - \begin{document} - This is a test file. - \undefinedcommand - This line should not be processed. - \end{document} - EOF - CHECK_RESULT $? 0 0 "创建测试文件失败" - - # 步骤6:测试platex命令的-halt-on-error选项 - LOG_INFO "步骤6:测试platex命令的-halt-on-error选项" - platex -halt-on-error test_halt.tex &> platex_output.log - PLATEX_EXIT_CODE=$? - - # 步骤7:检查platex命令是否因为遇到错误而停止 - LOG_INFO "步骤7:检查platex命令是否因为遇到错误而停止" - if [ $PLATEX_EXIT_CODE -ne 0 ]; then - LOG_INFO "platex命令在遇到错误时停止,退出码为 $PLATEX_EXIT_CODE" - grep -q "undefinedcommand" platex_output.log - CHECK_RESULT $? 0 0 "错误信息中未找到预期的undefinedcommand" - grep -q "This line should not be processed" platex_output.log - if [ $? -eq 0 ]; then - LOG_ERROR "platex命令没有在第一个错误时停止,继续处理了后续内容" - exit 1 - else - LOG_INFO "platex命令在第一个错误时停止,符合预期" - fi - else - LOG_ERROR "platex命令没有因为错误而停止,退出码为 0" - exit 1 - fi - - # 步骤8:清理测试文件 - LOG_INFO "步骤8:清理测试文件" - rm -f test_halt.tex platex_output.log test_halt.aux test_halt.log test_halt.dvi - CHECK_RESULT $? 0 0 "清理测试文件失败" - - # 步骤9:如果之前未安装,则卸载软件包 - if [ $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 "测试完成,环境已恢复" -} - -main "$@" \ No newline at end of file diff --git a/testcases/function_test/pkg_test/texlive-base/texlive-ptex/test_texlive-ptex_platex_help.sh b/testcases/function_test/pkg_test/texlive-base/texlive-ptex/test_texlive-ptex_platex_help.sh deleted file mode 100644 index e7b837dee62..00000000000 --- a/testcases/function_test/pkg_test/texlive-base/texlive-ptex/test_texlive-ptex_platex_help.sh +++ /dev/null @@ -1,80 +0,0 @@ -#!/usr/bin/bash - -# Copyright (c) 2024 ISCAS .ALL rights reserved. -# This program is licensed under Mulan PSL v2. -# You can use it according to the terms and conditions of the Mulan PSL v2. -# http://license.coscl.org.cn/MulanPSL2 -# THIS PROGRAM IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, -# EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, -# MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. -# See the Mulan PSL v2 for more details. - -# ############################################# -# @Author : honghua -# @Contact : honghua@iscas.ac.cn -# @Date : 2026-03-08 -# @License : Mulan PSL v2 -# @Desc : 测试 platex 命令的帮助选项 -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - # 环境检查:检查是否已安装texlive-ptex-platex软件包 - LOG_INFO "检查是否已安装texlive-ptex-platex软件包" - rpm -q texlive-ptex-platex > /dev/null 2>&1 - if [ $? -eq 0 ]; then - LOG_INFO "texlive-ptex-platex已安装,脚本结束时将保持安装状态" - INSTALLED=true - else - LOG_INFO "texlive-ptex-platex未安装,将在测试步骤中安装" - INSTALLED=false - fi - - # 检查yum源中是否有texlive-ptex-platex软件包 - LOG_INFO "检查yum源中是否有texlive-ptex-platex软件包" - dnf list available texlive-ptex-platex > /dev/null 2>&1 - if [ $? -ne 0 ]; then - LOG_ERROR "yum源中未找到texlive-ptex-platex软件包" - exit 255 - fi - - # 如果未安装,则安装软件包 - if [ "$INSTALLED" = false ]; then - LOG_INFO "安装texlive-ptex-platex软件包" - dnf install -y texlive-ptex-platex - CHECK_RESULT $? 0 0 "安装texlive-ptex-platex失败" - fi - - # 测试platex命令的帮助选项 - LOG_INFO "测试platex命令的帮助选项" - platex --help > /dev/null 2>&1 - if [ $? -ne 0 ]; then - # 检查是否为参数不存在或不支持 - platex --invalid-option > /dev/null 2>&1 - if [ $? -eq 255 ]; then - LOG_ERROR "platex命令不支持--help参数" - exit 255 - else - CHECK_RESULT $? 0 0 "执行platex --help失败" - fi - fi - - # 验证帮助选项输出包含关键信息 - LOG_INFO "验证platex --help输出包含关键信息" - platex --help 2>&1 | grep -q "Usage:" - CHECK_RESULT $? 0 0 "platex --help输出中未找到"Usage:"信息" - - # 环境清理:如果测试前未安装,则卸载软件包 - if [ "$INSTALLED" = false ]; then - LOG_INFO "卸载texlive-ptex-platex软件包" - dnf remove -y texlive-ptex-platex - CHECK_RESULT $? 0 0 "卸载texlive-ptex-platex失败" - else - LOG_INFO "测试前已安装texlive-ptex-platex,保持安装状态" - fi - - LOG_INFO "测试完成" -} - -main "$@" \ No newline at end of file diff --git a/testcases/function_test/pkg_test/texlive-base/texlive-ptex/test_texlive-ptex_platex_input_file.sh b/testcases/function_test/pkg_test/texlive-base/texlive-ptex/test_texlive-ptex_platex_input_file.sh deleted file mode 100644 index 721f73301ce..00000000000 --- a/testcases/function_test/pkg_test/texlive-base/texlive-ptex/test_texlive-ptex_platex_input_file.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-08 -# @License : Mulan PSL v2 -# @Desc : 测试 platex 命令处理输入文件的基本功能 -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - LOG_INFO "开始测试platex命令处理输入文件的基本功能" - - # 检查环境是否已安装texlive-ptex软件包 - LOG_INFO "检查texlive-ptex是否已安装" - rpm -q texlive-ptex - if [ $? -eq 0 ]; then - LOG_INFO "texlive-ptex已安装,测试结束后将保持安装状态" - INSTALLED_BEFORE=1 - else - LOG_INFO "texlive-ptex未安装,将在测试过程中安装" - INSTALLED_BEFORE=0 - fi - - # 检查yum源中是否有texlive-ptex软件包 - LOG_INFO "检查yum源中是否有texlive-ptex软件包" - dnf list available texlive-ptex - if [ $? -ne 0 ]; then - LOG_ERROR "yum源中未找到texlive-ptex软件包" - exit 255 - fi - - # 如果未安装,则安装软件包 - if [ $INSTALLED_BEFORE -eq 0 ]; then - LOG_INFO "安装texlive-ptex软件包" - dnf install -y texlive-ptex - CHECK_RESULT $? 0 0 "安装texlive-ptex失败" - fi - - # 创建测试输入文件 - LOG_INFO "创建测试输入文件test_input.tex" - cat > test_input.tex << "EOF" - \documentclass{article} - \begin{document} - Hello, platex! - \end{document} - EOF - CHECK_RESULT $? 0 0 "创建测试输入文件失败" - - # 检查platex命令是否存在 - LOG_INFO "检查platex命令是否存在" - which platex - CHECK_RESULT $? 0 0 "platex命令不存在" - - # 测试platex处理输入文件 - LOG_INFO "执行platex命令处理输入文件" - platex test_input.tex - CHECK_RESULT $? 0 0 "platex命令处理输入文件失败" - - # 检查输出文件是否生成 - LOG_INFO "检查输出文件是否生成" - [ -f test_input.dvi ] - CHECK_RESULT $? 0 0 "未生成预期的输出文件test_input.dvi" - - # 清理测试生成的文件 - LOG_INFO "清理测试生成的文件" - rm -f test_input.tex test_input.dvi test_input.log test_input.aux - CHECK_RESULT $? 0 0 "清理测试文件失败" - - # 如果测试前未安装,则卸载软件包 - if [ $INSTALLED_BEFORE -eq 0 ]; then - LOG_INFO "卸载texlive-ptex软件包" - dnf remove -y texlive-ptex - CHECK_RESULT $? 0 0 "卸载texlive-ptex失败" - else - LOG_INFO "测试前已安装texlive-ptex,保持安装状态" - fi - - LOG_INFO "platex命令处理输入文件的基本功能测试完成" -} - -main "$@" \ No newline at end of file diff --git a/testcases/function_test/pkg_test/texlive-base/texlive-ptex/test_texlive-ptex_platex_interaction_batchmode.sh b/testcases/function_test/pkg_test/texlive-base/texlive-ptex/test_texlive-ptex_platex_interaction_batchmode.sh deleted file mode 100644 index b2df57125b0..00000000000 --- a/testcases/function_test/pkg_test/texlive-base/texlive-ptex/test_texlive-ptex_platex_interaction_batchmode.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-08 -# @License : Mulan PSL v2 -# @Desc : 测试 platex 命令设置批处理交互模式的选项 -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - set -e - - LOG_INFO "开始测试 platex 命令设置批处理交互模式的选项" - - LOG_INFO "步骤1:检查 yum 源中是否存在 texlive-ptex 软件包" - if ! dnf list available texlive-ptex &>/dev/null; then - LOG_ERROR "yum 源中未找到 texlive-ptex 软件包" - exit 255 - fi - - LOG_INFO "步骤2:检查当前环境是否已安装 texlive-ptex" - if rpm -q texlive-ptex &>/dev/null; then - LOG_INFO "texlive-ptex 已安装,测试结束后将保持安装状态" - INSTALLED_BEFORE_TEST=true - else - LOG_INFO "texlive-ptex 未安装,将在测试中安装,并在测试结束后卸载" - INSTALLED_BEFORE_TEST=false - fi - - if [ "$INSTALLED_BEFORE_TEST" = false ]; then - LOG_INFO "步骤3:安装 texlive-ptex 软件包" - dnf install -y texlive-ptex - CHECK_RESULT $? 0 0 "安装 texlive-ptex 失败" - fi - - LOG_INFO "步骤4:检查 platex 命令是否支持 -interaction 参数" - platex --help | grep -q -- "-interaction" - CHECK_RESULT $? 0 0 "platex 命令不支持 -interaction 参数" - - LOG_INFO "步骤5:检查 platex 命令是否支持 batchmode 选项值" - platex --help | grep -q "batchmode" - CHECK_RESULT $? 0 0 "platex 命令的 -interaction 参数不支持 batchmode 选项" - - LOG_INFO "步骤6:使用 platex 命令的 -interaction=batchmode 选项处理一个简单的 TeX 文件" - cat > test_batchmode.tex << "EOF" - \documentclass{article} - \begin{document} - Hello, batchmode test. - \end{document} - EOF - platex -interaction=batchmode test_batchmode.tex - CHECK_RESULT $? 0 0 "使用 -interaction=batchmode 执行 platex 失败" - - LOG_INFO "步骤7:验证批处理模式下是否生成了预期的输出文件" - [ -f test_batchmode.dvi ] - CHECK_RESULT $? 0 0 "批处理模式未生成预期的 .dvi 文件" - - LOG_INFO "步骤8:清理测试生成的临时文件" - rm -f test_batchmode.tex test_batchmode.dvi test_batchmode.log test_batchmode.aux - - if [ "$INSTALLED_BEFORE_TEST" = false ]; then - LOG_INFO "步骤9:卸载测试安装的 texlive-ptex 软件包" - dnf remove -y texlive-ptex - CHECK_RESULT $? 0 0 "卸载 texlive-ptex 失败" - fi - - LOG_INFO "测试完成,环境已恢复" -} - -main "$@" \ No newline at end of file diff --git a/testcases/function_test/pkg_test/texlive-base/texlive-ptex/test_texlive-ptex_platex_jobname.sh b/testcases/function_test/pkg_test/texlive-base/texlive-ptex/test_texlive-ptex_platex_jobname.sh deleted file mode 100644 index 8329562e659..00000000000 --- a/testcases/function_test/pkg_test/texlive-base/texlive-ptex/test_texlive-ptex_platex_jobname.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-08 -# @License : Mulan PSL v2 -# @Desc : 测试 platex 命令设置作业名称的选项 -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - # 检查环境是否已经安装texlive-ptex软件包 - LOG_INFO "检查是否已安装texlive-ptex软件包" - rpm -q texlive-ptex > /dev/null 2>&1 - if [ $? -eq 0 ]; then - LOG_INFO "texlive-ptex软件包已安装,脚本结束时将保持安装状态" - INSTALLED_BEFORE=1 - else - LOG_INFO "texlive-ptex软件包未安装,将在测试过程中安装并在结束时卸载" - INSTALLED_BEFORE=0 - fi - - # 检查yum源中是否有texlive-ptex软件包 - LOG_INFO "检查yum源中是否有texlive-ptex软件包" - dnf list available texlive-ptex > /dev/null 2>&1 - CHECK_RESULT $? 0 255 "yum源中未找到texlive-ptex软件包" - - # 如果未安装则安装软件包 - if [ ${INSTALLED_BEFORE} -eq 0 ]; then - LOG_INFO "安装texlive-ptex软件包" - dnf install -y texlive-ptex - CHECK_RESULT $? 0 0 "安装texlive-ptex软件包失败" - fi - - # 检查platex命令是否存在 - LOG_INFO "检查platex命令是否存在" - which platex > /dev/null 2>&1 - CHECK_RESULT $? 0 255 "platex命令不存在" - - # 检查platex命令是否支持-jobname选项 - LOG_INFO "检查platex命令是否支持-jobname选项" - platex -help 2>&1 | grep -q "\-jobname" - CHECK_RESULT $? 0 255 "platex命令不支持-jobname选项" - - # 创建测试用的LaTeX文件 - LOG_INFO "创建测试用的LaTeX文件" - cat > test.tex << "EOF" - \documentclass{article} - \begin{document} - Hello, World! - \end{document} - EOF - CHECK_RESULT $? 0 0 "创建测试文件失败" - - # 使用platex命令编译测试文件,并指定作业名称 - LOG_INFO "使用platex命令编译测试文件,指定作业名称为myjob" - platex -jobname myjob test.tex - CHECK_RESULT $? 0 0 "platex命令执行失败" - - # 检查是否生成了指定作业名称的输出文件 - LOG_INFO "检查是否生成了指定作业名称的输出文件" - ls myjob.dvi > /dev/null 2>&1 - CHECK_RESULT $? 0 0 "未生成指定作业名称的输出文件" - - # 清理测试生成的文件 - LOG_INFO "清理测试生成的文件" - rm -f test.tex myjob.* test.* *.aux *.log *.dvi *.toc *.out - CHECK_RESULT $? 0 0 "清理测试文件失败" - - # 如果之前未安装,则卸载软件包 - if [ ${INSTALLED_BEFORE} -eq 0 ]; then - LOG_INFO "卸载texlive-ptex软件包" - dnf remove -y texlive-ptex - CHECK_RESULT $? 0 0 "卸载texlive-ptex软件包失败" - fi - - LOG_INFO "测试完成" -} - -main "$@" \ No newline at end of file diff --git a/testcases/function_test/pkg_test/texlive-base/texlive-ptex/test_texlive-ptex_platex_kanji_utf8.sh b/testcases/function_test/pkg_test/texlive-base/texlive-ptex/test_texlive-ptex_platex_kanji_utf8.sh deleted file mode 100644 index 6478798d592..00000000000 --- a/testcases/function_test/pkg_test/texlive-base/texlive-ptex/test_texlive-ptex_platex_kanji_utf8.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-08 -# @License : Mulan PSL v2 -# @Desc : 测试 platex 命令设置日文编码为 UTF-8 的选项 -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - LOG_INFO "开始测试 platex 命令设置日文编码为 UTF-8 的选项" - LOG_INFO "检查系统是否已安装 texlive-ptex 和 texlive-ptex-base 软件包" - if rpm -q texlive-ptex texlive-ptex-base &>/dev/null; then - LOG_INFO "texlive-ptex 和 texlive-ptex-base 已安装,测试后保持安装状态" - INSTALLED=1 - else - LOG_INFO "texlive-ptex 和 texlive-ptex-base 未安装,将在测试中安装" - INSTALLED=0 - fi - - LOG_INFO "检查 yum 源中是否存在 texlive-ptex 和 texlive-ptex-base 软件包" - if ! dnf list available texlive-ptex texlive-ptex-base &>/dev/null; then - LOG_ERROR "yum 源中缺少 texlive-ptex 或 texlive-ptex-base 软件包" - exit 255 - fi - - if [ $INSTALLED -eq 0 ]; then - LOG_INFO "安装 texlive-ptex 和 texlive-ptex-base 软件包" - dnf install -y texlive-ptex texlive-ptex-base - CHECK_RESULT $? 0 0 "安装 texlive-ptex 和 texlive-ptex-base 失败" - fi - - LOG_INFO "检查 platex 命令是否支持 -kanji=utf8 参数" - platex -help 2>&1 | grep -q "\-kanji" - if [ $? -ne 0 ]; then - LOG_ERROR "platex 命令不支持 -kanji 参数" - exit 255 - fi - - LOG_INFO "创建测试 LaTeX 文件 test.tex" - cat > test.tex << "EOF" - \documentclass{article} - \usepackage{CJKutf8} - \begin{document} - \begin{CJK}{UTF8}{min} - テスト - \end{CJK} - \end{document} - EOF - - LOG_INFO "使用 platex 命令设置日文编码为 UTF-8 编译 test.tex" - platex -kanji=utf8 test.tex - CHECK_RESULT $? 0 0 "platex 命令编译失败" - - 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.log test.aux test.dvi - - if [ $INSTALLED -eq 0 ]; then - LOG_INFO "卸载 texlive-ptex 和 texlive-ptex-base 软件包" - dnf remove -y texlive-ptex texlive-ptex-base - CHECK_RESULT $? 0 0 "卸载 texlive-ptex 和 texlive-ptex-base 失败" - fi - - LOG_INFO "测试完成" -} - -main "$@" \ No newline at end of file diff --git a/testcases/function_test/pkg_test/texlive-base/texlive-ptex/test_texlive-ptex_platex_no_file_line_error.sh b/testcases/function_test/pkg_test/texlive-base/texlive-ptex/test_texlive-ptex_platex_no_file_line_error.sh deleted file mode 100644 index d537908d817..00000000000 --- a/testcases/function_test/pkg_test/texlive-base/texlive-ptex/test_texlive-ptex_platex_no_file_line_error.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-08 -# @License : Mulan PSL v2 -# @Desc : 测试 platex 命令禁用文件:行:错误样式消息的选项 -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - # 测试platex命令禁用文件:行:错误样式消息的选项 - - LOG_INFO "1. 检查yum源中是否存在texlive-ptex软件包" - dnf list texlive-ptex > /dev/null 2>&1 - if [ $? -ne 0 ]; then - LOG_ERROR "texlive-ptex软件包在yum源中不存在" - exit 255 - fi - - LOG_INFO "2. 检查系统是否已安装texlive-ptex软件包" - rpm -q texlive-ptex > /dev/null 2>&1 - if [ $? -eq 0 ]; then - LOG_INFO "texlive-ptex已安装,标记为已安装状态" - INSTALLED=1 - else - LOG_INFO "texlive-ptex未安装,标记为未安装状态" - INSTALLED=0 - fi - - LOG_INFO "3. 如果未安装,则安装texlive-ptex软件包" - if [ $INSTALLED -eq 0 ]; then - dnf install -y texlive-ptex - CHECK_RESULT $? 0 0 "安装texlive-ptex失败" - LOG_INFO "texlive-ptex安装成功" - fi - - LOG_INFO "4. 检查platex命令是否存在" - which platex > /dev/null 2>&1 - CHECK_RESULT $? 0 0 "platex命令不存在" - - LOG_INFO "5. 检查platex命令是否支持-file-line-error参数" - platex --help 2>&1 | grep -q "\-file-line-error" - if [ $? -ne 0 ]; then - LOG_ERROR "platex命令不支持-file-line-error参数" - if [ $INSTALLED -eq 0 ]; then - LOG_INFO "清理环境:卸载texlive-ptex软件包" - dnf remove -y texlive-ptex - CHECK_RESULT $? 0 0 "卸载texlive-ptex失败" - fi - exit 255 - fi - - LOG_INFO "6. 创建测试用的LaTeX文件" - cat > test.tex << "EOF" - \documentclass{article} - \begin{document} - 测试文件 - \errorcommand - \end{document} - EOF - CHECK_RESULT $? 0 0 "创建测试文件失败" - - LOG_INFO "7. 使用默认参数运行platex,验证错误消息格式" - platex test.tex 2>&1 | grep -q "test.tex:" - DEFAULT_RESULT=$? - - LOG_INFO "8. 使用-file-line-error参数运行platex,验证错误消息格式" - platex -file-line-error test.tex 2>&1 | grep -q "test.tex:" - FILE_LINE_RESULT=$? - - LOG_INFO "9. 验证-file-line-error参数的效果" - if [ $DEFAULT_RESULT -eq 0 ] && [ $FILE_LINE_RESULT -ne 0 ]; then - LOG_INFO "测试通过:-file-line-error参数成功禁用了文件:行:错误样式消息" - CHECK_RESULT 0 0 0 "验证-file-line-error参数效果失败" - else - LOG_ERROR "测试失败:-file-line-error参数未按预期工作" - CHECK_RESULT 1 0 0 "验证-file-line-error参数效果失败" - fi - - LOG_INFO "10. 清理测试文件" - rm -f test.tex test.aux test.log test.dvi - CHECK_RESULT $? 0 0 "清理测试文件失败" - - LOG_INFO "11. 环境恢复" - if [ $INSTALLED -eq 0 ]; then - LOG_INFO "卸载texlive-ptex软件包" - dnf remove -y texlive-ptex - CHECK_RESULT $? 0 0 "卸载texlive-ptex失败" - LOG_INFO "环境已恢复到未安装状态" - else - LOG_INFO "保持texlive-ptex已安装状态" - fi - - LOG_INFO "12. 测试完成" -} - -main "$@" \ No newline at end of file diff --git a/testcases/function_test/pkg_test/texlive-base/texlive-ptex/test_texlive-ptex_platex_no_mktex_tex.sh b/testcases/function_test/pkg_test/texlive-base/texlive-ptex/test_texlive-ptex_platex_no_mktex_tex.sh deleted file mode 100644 index e50bf12ca51..00000000000 --- a/testcases/function_test/pkg_test/texlive-base/texlive-ptex/test_texlive-ptex_platex_no_mktex_tex.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-08 -# @License : Mulan PSL v2 -# @Desc : 测试 platex 命令禁用 mktextex 生成的选项 -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - # 判断是否已安装texlive-ptex软件包 - LOG_INFO "检查是否已安装texlive-ptex软件包" - if rpm -q texlive-ptex &> /dev/null; then - LOG_INFO "texlive-ptex软件包已安装,脚本结束时将保持安装状态" - ALREADY_INSTALLED=1 - else - LOG_INFO "texlive-ptex软件包未安装" - ALREADY_INSTALLED=0 - fi - - # 检查yum源中是否有texlive-ptex软件包 - LOG_INFO "检查yum源中是否有texlive-ptex软件包" - if ! dnf list available texlive-ptex &> /dev/null; then - LOG_ERROR "yum源中未找到texlive-ptex软件包" - exit 255 - fi - - # 如果未安装,则安装软件包 - if [ $ALREADY_INSTALLED -eq 0 ]; then - LOG_INFO "开始安装texlive-ptex软件包" - dnf install -y texlive-ptex - CHECK_RESULT $? 0 0 "安装texlive-ptex软件包失败" - fi - - # 检查platex命令是否支持--no-mktex选项 - LOG_INFO "检查platex命令是否支持--no-mktex选项" - platex --help | grep -q -- "--no-mktex" - CHECK_RESULT $? 0 0 "platex命令不支持--no-mktex选项" - - # 测试platex命令禁用mktextex生成的选项 - LOG_INFO "测试platex命令禁用mktextex生成的选项" - cat > test.tex << "EOF" - \documentclass{article} - \begin{document} - Hello, World! - \end{document} - EOF - - platex --no-mktex test.tex - CHECK_RESULT $? 0 0 "platex命令执行失败,禁用mktextex选项未生效" - - # 清理测试文件 - LOG_INFO "清理测试文件" - rm -f test.tex test.aux test.log test.dvi - - # 如果之前未安装,则卸载软件包 - if [ $ALREADY_INSTALLED -eq 0 ]; then - LOG_INFO "卸载texlive-ptex软件包" - dnf remove -y texlive-ptex - CHECK_RESULT $? 0 0 "卸载texlive-ptex软件包失败" - fi - - LOG_INFO "测试完成" -} - -main "$@" \ No newline at end of file diff --git a/testcases/function_test/pkg_test/texlive-base/texlive-ptex/test_texlive-ptex_platex_no_parse_first_line.sh b/testcases/function_test/pkg_test/texlive-base/texlive-ptex/test_texlive-ptex_platex_no_parse_first_line.sh deleted file mode 100644 index a478a9da907..00000000000 --- a/testcases/function_test/pkg_test/texlive-base/texlive-ptex/test_texlive-ptex_platex_no_parse_first_line.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-08 -# @License : Mulan PSL v2 -# @Desc : 测试 platex 命令禁用解析输入文件第一行的选项 -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - # 检查是否已安装texlive-ptex软件包 - LOG_INFO "开始测试:测试 platex 命令禁用解析输入文件第一行的选项" - - # 步骤1:检查yum源中是否存在texlive-ptex软件包 - LOG_INFO "步骤1:检查yum源中是否存在texlive-ptex软件包" - dnf list available texlive-ptex 2>/dev/null | grep -q texlive-ptex - if [ $? -ne 0 ]; then - LOG_ERROR "yum源中未找到texlive-ptex软件包" - exit 255 - fi - - # 步骤2:检查环境是否已安装texlive-ptex - LOG_INFO "步骤2:检查环境是否已安装texlive-ptex" - rpm -q texlive-ptex > /dev/null 2>&1 - if [ $? -eq 0 ]; then - LOG_INFO "texlive-ptex已安装,测试结束后将保持安装状态" - INSTALLED_BEFORE_TEST=true - else - LOG_INFO "texlive-ptex未安装,将在测试前安装并在测试后卸载" - INSTALLED_BEFORE_TEST=false - fi - - # 步骤3:如果未安装则安装texlive-ptex - if [ "$INSTALLED_BEFORE_TEST" = "false" ]; then - LOG_INFO "步骤3:安装texlive-ptex软件包" - dnf install -y texlive-ptex - CHECK_RESULT $? 0 0 "安装texlive-ptex失败" - fi - - # 步骤4:创建测试用的LaTeX文件 - LOG_INFO "步骤4:创建测试用的LaTeX文件" - TEST_FILE="test_platex.tex" - cat > $TEST_FILE << "EOF" - %&platex - \documentclass{article} - \begin{document} - Test document for platex command. - \end{document} - EOF - CHECK_RESULT $? 0 0 "创建测试文件失败" - - # 步骤5:测试platex命令的-no-parse-first-line参数 - LOG_INFO "步骤5:测试platex命令的-no-parse-first-line参数" - platex --help 2>&1 | grep -q "\-\-no\-parse\-first\-line" - if [ $? -ne 0 ]; then - LOG_ERROR "platex命令不支持--no-parse-first-line参数" - # 清理测试文件 - rm -f $TEST_FILE - # 如果测试前未安装,则卸载软件包 - if [ "$INSTALLED_BEFORE_TEST" = "false" ]; then - LOG_INFO "清理环境:卸载texlive-ptex软件包" - dnf remove -y texlive-ptex - fi - exit 255 - fi - - # 步骤6:执行platex命令并禁用解析第一行 - LOG_INFO "步骤6:执行platex命令并禁用解析第一行" - platex --no-parse-first-line $TEST_FILE - CHECK_RESULT $? 0 0 "platex命令执行失败" - - # 步骤7:检查是否生成了预期的输出文件 - LOG_INFO "步骤7:检查是否生成了预期的输出文件" - if [ -f "${TEST_FILE%.tex}.dvi" ]; then - LOG_INFO "成功生成了DVI文件" - else - LOG_ERROR "未生成预期的DVI文件" - CHECK_RESULT 1 0 1 "未生成预期的DVI文件" - fi - - # 步骤8:清理测试生成的文件 - LOG_INFO "步骤8:清理测试生成的文件" - rm -f $TEST_FILE ${TEST_FILE%.tex}.* - CHECK_RESULT $? 0 0 "清理测试文件失败" - - # 步骤9:如果测试前未安装,则卸载软件包 - if [ "$INSTALLED_BEFORE_TEST" = "false" ]; then - LOG_INFO "步骤9:卸载texlive-ptex软件包" - dnf remove -y texlive-ptex - CHECK_RESULT $? 0 0 "卸载texlive-ptex失败" - fi - - LOG_INFO "测试完成:platex命令禁用解析输入文件第一行的选项测试通过" -} - -main "$@" \ No newline at end of file diff --git a/testcases/function_test/pkg_test/texlive-base/texlive-ptex/test_texlive-ptex_platex_no_shell_escape.sh b/testcases/function_test/pkg_test/texlive-base/texlive-ptex/test_texlive-ptex_platex_no_shell_escape.sh deleted file mode 100644 index 569765f03cb..00000000000 --- a/testcases/function_test/pkg_test/texlive-base/texlive-ptex/test_texlive-ptex_platex_no_shell_escape.sh +++ /dev/null @@ -1,123 +0,0 @@ -#!/usr/bin/bash - -# Copyright (c) 2024 ISCAS .ALL rights reserved. -# This program is licensed under Mulan PSL v2. -# You can use it according to the terms and conditions of the Mulan PSL v2. -# http://license.coscl.org.cn/MulanPSL2 -# THIS PROGRAM IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, -# EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, -# MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. -# See the Mulan PSL v2 for more details. - -# ############################################# -# @Author : honghua -# @Contact : honghua@iscas.ac.cn -# @Date : 2026-03-08 -# @License : Mulan PSL v2 -# @Desc : 测试 platex 命令禁用 \write18{SHELL COMMAND} 的选项 -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - # 测试环境初始化检查 - LOG_INFO "开始测试:测试 platex 命令禁用 \write18{SHELL COMMAND} 的选项" - - # 定义软件包名称 - PACKAGE_NAME="texlive-ptex" - - # 检查软件包是否已在yum源中 - LOG_INFO "检查软件包 $PACKAGE_NAME 是否在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" - rpm -q $PACKAGE_NAME > /dev/null 2>&1 - IS_INSTALLED=$? - - # 如果未安装,则安装软件包 - if [ $IS_INSTALLED -ne 0 ]; then - LOG_INFO "安装软件包 $PACKAGE_NAME" - dnf install -y $PACKAGE_NAME - CHECK_RESULT $? 0 0 "安装软件包 $PACKAGE_NAME 失败" - else - LOG_INFO "软件包 $PACKAGE_NAME 已安装,跳过安装步骤" - fi - - # 检查platex命令是否存在 - LOG_INFO "检查platex命令是否存在" - which platex > /dev/null 2>&1 - CHECK_RESULT $? 0 0 "platex命令未找到" - - # 测试platex命令是否支持--shell-escape参数 - LOG_INFO "测试platex命令是否支持--shell-escape参数" - platex --help 2>&1 | grep -q "\-\-shell\-escape" - if [ $? -eq 0 ]; then - LOG_INFO "platex命令支持--shell-escape参数" - else - LOG_ERROR "platex命令不支持--shell-escape参数" - exit 255 - fi - - # 创建测试TeX文件 - LOG_INFO "创建测试TeX文件" - TEST_TEX_FILE="test_shell_escape.tex" - cat > $TEST_TEX_FILE << "EOF" - \documentclass{article} - \begin{document} - Test document for shell escape. - \immediate\write18{echo "This should be blocked"} - \end{document} - EOF - - # 测试禁用shell escape的情况 - LOG_INFO "测试禁用shell escape的情况" - platex -no-shell-escape $TEST_TEX_FILE > platex_output.txt 2>&1 - PLATEX_EXIT_CODE=$? - - # 检查platex命令是否成功执行 - if [ $PLATEX_EXIT_CODE -eq 0 ]; then - LOG_INFO "platex命令成功执行,shell escape被正确禁用" - # 检查输出中是否包含shell escape被阻止的信息 - grep -q "write18.*disabled\|shell escape.*disabled\|not allowed" platex_output.txt - if [ $? -eq 0 ]; then - LOG_INFO "确认shell escape功能已被禁用" - else - # 如果输出中没有明确提示,检查是否执行了shell命令 - # 如果echo命令被执行了,通常会在日志中看到输出 - grep -q "This should be blocked" platex_output.txt - if [ $? -eq 0 ]; then - LOG_ERROR "shell escape未被正确禁用,命令被执行" - CHECK_RESULT 1 0 1 "shell escape未被正确禁用" - else - LOG_INFO "shell escape功能被禁用,但未在输出中找到明确提示" - fi - fi - else - LOG_ERROR "platex命令执行失败,退出码:$PLATEX_EXIT_CODE" - cat platex_output.txt - CHECK_RESULT $PLATEX_EXIT_CODE 0 0 "platex命令执行失败" - fi - - # 清理测试文件 - LOG_INFO "清理测试文件" - rm -f $TEST_TEX_FILE platex_output.txt *.log *.aux *.dvi - - # 环境恢复 - LOG_INFO "恢复测试环境" - if [ $IS_INSTALLED -ne 0 ]; then - LOG_INFO "卸载测试安装的软件包 $PACKAGE_NAME" - dnf remove -y $PACKAGE_NAME - CHECK_RESULT $? 0 0 "卸载软件包 $PACKAGE_NAME 失败" - else - LOG_INFO "保持软件包 $PACKAGE_NAME 的安装状态" - fi - - LOG_INFO "测试完成" -} - -main "$@" \ No newline at end of file diff --git a/testcases/function_test/pkg_test/texlive-base/texlive-ptex/test_texlive-ptex_platex_output_directory.sh b/testcases/function_test/pkg_test/texlive-base/texlive-ptex/test_texlive-ptex_platex_output_directory.sh deleted file mode 100644 index b9a29f50156..00000000000 --- a/testcases/function_test/pkg_test/texlive-base/texlive-ptex/test_texlive-ptex_platex_output_directory.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-08 -# @License : Mulan PSL v2 -# @Desc : 测试 platex 命令设置输出目录的选项 -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - LOG_INFO "1. 检查是否已安装 texlive-ptex 和 texlive-ptex-base 软件包" - if rpm -q texlive-ptex texlive-ptex-base &>/dev/null; then - LOG_INFO "软件包已安装,脚本结束时将保持安装状态" - INSTALLED=true - else - LOG_INFO "软件包未安装,将在测试过程中安装" - INSTALLED=false - fi - - LOG_INFO "2. 检查 yum 源中是否有 texlive-ptex 和 texlive-ptex-base 软件包" - if ! dnf list available texlive-ptex texlive-ptex-base &>/dev/null; then - LOG_ERROR "yum 源中缺少 texlive-ptex 或 texlive-ptex-base 软件包" - exit 255 - fi - - if [ "$INSTALLED" = false ]; then - LOG_INFO "3. 安装 texlive-ptex 和 texlive-ptex-base 软件包" - dnf install -y texlive-ptex texlive-ptex-base - CHECK_RESULT $? 0 0 "安装 texlive-ptex 和 texlive-ptex-base 失败" - fi - - LOG_INFO "4. 创建一个测试 LaTeX 文件" - cat > test.tex << "EOF" - \documentclass{article} - \begin{document} - Hello, platex! - \end{document} - EOF - CHECK_RESULT $? 0 0 "创建测试 LaTeX 文件失败" - - LOG_INFO "5. 测试 platex 命令设置输出目录的选项" - LOG_INFO "5.1 检查 platex 命令是否支持 -output-directory 参数" - platex --help | grep -q -- -output-directory - CHECK_RESULT $? 0 0 "platex 命令不支持 -output-directory 参数" - - LOG_INFO "5.2 使用 -output-directory 参数执行 platex 命令" - mkdir -p output_dir - platex -output-directory=output_dir test.tex - CHECK_RESULT $? 0 0 "使用 -output-directory 参数执行 platex 命令失败" - - LOG_INFO "5.3 检查输出文件是否在指定目录中生成" - ls output_dir/test.dvi &>/dev/null - CHECK_RESULT $? 0 0 "输出文件未在指定目录中生成" - - LOG_INFO "6. 清理测试生成的文件" - rm -rf test.tex output_dir - CHECK_RESULT $? 0 0 "清理测试生成的文件失败" - - if [ "$INSTALLED" = false ]; then - LOG_INFO "7. 卸载 texlive-ptex 和 texlive-ptex-base 软件包" - dnf remove -y texlive-ptex texlive-ptex-base - CHECK_RESULT $? 0 0 "卸载 texlive-ptex 和 texlive-ptex-base 失败" - fi - - LOG_INFO "测试完成,环境已恢复" -} - -main "$@" \ No newline at end of file diff --git a/testcases/function_test/pkg_test/texlive-base/texlive-ptex/test_texlive-ptex_platex_src_specials.sh b/testcases/function_test/pkg_test/texlive-base/texlive-ptex/test_texlive-ptex_platex_src_specials.sh deleted file mode 100644 index a7ca3f20865..00000000000 --- a/testcases/function_test/pkg_test/texlive-base/texlive-ptex/test_texlive-ptex_platex_src_specials.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-08 -# @License : Mulan PSL v2 -# @Desc : 测试 platex 命令在 DVI 文件中插入源特殊字符的选项 -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - # 检查是否已安装texlive-ptex包 - LOG_INFO "检查texlive-ptex是否已安装" - rpm -q texlive-ptex &> /dev/null - if [ $? -eq 0 ]; then - LOG_INFO "texlive-ptex已安装,脚本结束时将保持安装状态" - ALREADY_INSTALLED=1 - else - LOG_INFO "texlive-ptex未安装,将在测试过程中安装" - ALREADY_INSTALLED=0 - fi - - # 检查yum源中是否有texlive-ptex包 - LOG_INFO "检查yum源中是否有texlive-ptex包" - dnf list available texlive-ptex &> /dev/null - if [ $? -ne 0 ]; then - LOG_ERROR "yum源中没有texlive-ptex包" - exit 255 - fi - - # 如果未安装,则安装texlive-ptex - if [ $ALREADY_INSTALLED -eq 0 ]; then - LOG_INFO "安装texlive-ptex" - dnf install -y texlive-ptex - CHECK_RESULT $? 0 0 "安装texlive-ptex失败" - fi - - # 检查platex命令是否可用 - LOG_INFO "检查platex命令是否可用" - which platex &> /dev/null - CHECK_RESULT $? 0 0 "platex命令不可用" - - # 检查platex命令是否支持-src-specials参数 - LOG_INFO "检查platex命令是否支持-src-specials参数" - platex --help 2>&1 | grep -q "\-src-specials" - if [ $? -ne 0 ]; then - LOG_ERROR "platex命令不支持-src-specials参数" - 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文件失败" - - # 使用platex命令编译LaTeX文件,并启用src-specials选项 - LOG_INFO "使用platex命令编译LaTeX文件,并启用src-specials选项" - platex -src-specials test.tex - CHECK_RESULT $? 0 0 "platex编译失败" - - # 检查生成的DVI文件是否包含源特殊字符 - LOG_INFO "检查生成的DVI文件是否包含源特殊字符" - if [ -f test.dvi ]; then - LOG_INFO "成功生成test.dvi文件" - # 简单检查DVI文件是否包含特殊标记(这里仅检查文件非空) - if [ -s test.dvi ]; then - LOG_INFO "DVI文件非空,可能包含源特殊字符" - else - LOG_ERROR "DVI文件为空" - exit 1 - fi - else - LOG_ERROR "未生成test.dvi文件" - exit 1 - fi - - # 清理测试文件 - LOG_INFO "清理测试文件" - rm -f test.tex test.dvi test.log test.aux - CHECK_RESULT $? 0 0 "清理测试文件失败" - - # 如果测试前未安装,则卸载texlive-ptex - if [ $ALREADY_INSTALLED -eq 0 ]; then - LOG_INFO "卸载texlive-ptex" - dnf remove -y texlive-ptex - CHECK_RESULT $? 0 0 "卸载texlive-ptex失败" - else - LOG_INFO "测试前已安装texlive-ptex,保持安装状态" - fi - - LOG_INFO "测试完成" -} - -main "$@" \ No newline at end of file diff --git a/testcases/function_test/pkg_test/texlive-base/texlive-ptex/test_texlive-ptex_platex_version.sh b/testcases/function_test/pkg_test/texlive-base/texlive-ptex/test_texlive-ptex_platex_version.sh deleted file mode 100644 index 3a3e1ca92d0..00000000000 --- a/testcases/function_test/pkg_test/texlive-base/texlive-ptex/test_texlive-ptex_platex_version.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-08 -# @License : Mulan PSL v2 -# @Desc : 测试 platex 命令的版本信息选项 -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - # 测试 platex 命令的版本信息选项 - - LOG_INFO "开始测试 platex 命令的版本信息选项" - - # 定义软件包名称 - PACKAGE_NAME="texlive-ptex" - - # 检查 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 - - # 检查是否已安装软件包 - LOG_INFO "2. 检查是否已安装软件包 ${PACKAGE_NAME}" - if rpm -q ${PACKAGE_NAME} &> /dev/null; then - LOG_INFO "软件包 ${PACKAGE_NAME} 已安装,测试结束后将保持安装状态" - INSTALLED_BEFORE=true - else - LOG_INFO "软件包 ${PACKAGE_NAME} 未安装,将在测试前安装并在测试后卸载" - INSTALLED_BEFORE=false - fi - - # 如果未安装,则安装软件包 - if [ "$INSTALLED_BEFORE" = false ]; then - LOG_INFO "3. 安装软件包 ${PACKAGE_NAME}" - dnf install -y ${PACKAGE_NAME} - CHECK_RESULT $? 0 0 "安装软件包 ${PACKAGE_NAME} 失败" - fi - - # 检查 platex 命令是否存在 - LOG_INFO "4. 检查 platex 命令是否存在" - which platex &> /dev/null - CHECK_RESULT $? 0 0 "platex 命令不存在" - - # 测试 platex 命令的版本信息选项 - LOG_INFO "5. 测试 platex 命令的版本信息选项" - platex --version - CHECK_RESULT $? 0 0 "执行 platex --version 失败" - - # 测试 platex 命令的版本信息选项(短选项) - LOG_INFO "6. 测试 platex 命令的版本信息选项(短选项)" - platex -v - CHECK_RESULT $? 0 0 "执行 platex -v 失败" - - # 清理环境 - LOG_INFO "7. 清理环境" - 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-ptex/test_texlive-ptex_pmpost_debug.sh b/testcases/function_test/pkg_test/texlive-base/texlive-ptex/test_texlive-ptex_pmpost_debug.sh deleted file mode 100644 index da80d983583..00000000000 --- a/testcases/function_test/pkg_test/texlive-base/texlive-ptex/test_texlive-ptex_pmpost_debug.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-08 -# @License : Mulan PSL v2 -# @Desc : 测试 pmpost 命令的 -debug 参数,用于打印调试信息并保留临时文件 -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - LOG_INFO "开始测试 pmpost 命令的 -debug 参数" - LOG_INFO "检查环境是否已安装 texlive-ptex 软件包" - - # 检查 texlive-ptex 是否已安装 - if rpm -q texlive-ptex > /dev/null 2>&1; then - LOG_INFO "texlive-ptex 已安装,测试后将保持安装状态" - INSTALLED=true - else - LOG_INFO "texlive-ptex 未安装,将在测试过程中安装" - INSTALLED=false - fi - - LOG_INFO "检查 yum 源中是否有 texlive-ptex 软件包" - if ! dnf list available texlive-ptex > /dev/null 2>&1; then - LOG_ERROR "yum 源中未找到 texlive-ptex 软件包" - exit 255 - fi - - # 如果未安装,则安装软件包 - if [ "$INSTALLED" = false ]; then - LOG_INFO "安装 texlive-ptex 软件包" - dnf install -y texlive-ptex - CHECK_RESULT $? 0 0 "安装 texlive-ptex 失败" - fi - - LOG_INFO "验证 pmpost 命令是否支持 -debug 参数" - pmpost -help 2>&1 | grep -q -- "-debug" - CHECK_RESULT $? 0 0 "pmpost 命令不支持 -debug 参数" - - LOG_INFO "创建测试用的简单 PostScript 文件" - cat > test.ps << "EOF" - %!PS - /Times-Roman findfont 12 scalefont setfont - 100 100 moveto - (Hello, World!) show - showpage - EOF - CHECK_RESULT $? 0 0 "创建测试文件失败" - - LOG_INFO "使用 pmpost -debug 处理测试文件" - pmpost -debug test.ps > output.log 2>&1 - CHECK_RESULT $? 0 0 "pmpost -debug 执行失败" - - LOG_INFO "检查 -debug 参数是否生成调试输出和临时文件" - if grep -q "debug" output.log; then - LOG_INFO "调试信息已打印" - else - LOG_ERROR "未找到调试信息" - exit 1 - fi - - if ls pmpost*.tmp 2>/dev/null; then - LOG_INFO "临时文件已保留" - else - LOG_ERROR "未找到临时文件" - exit 1 - fi - - LOG_INFO "清理测试生成的文件" - rm -f test.ps output.log pmpost*.tmp - - # 如果测试前未安装,则卸载软件包 - if [ "$INSTALLED" = false ]; then - LOG_INFO "卸载 texlive-ptex 软件包" - dnf remove -y texlive-ptex - CHECK_RESULT $? 0 0 "卸载 texlive-ptex 失败" - fi - - LOG_INFO "测试完成" -} - -main "$@" \ No newline at end of file diff --git a/testcases/function_test/pkg_test/texlive-base/texlive-ptex/test_texlive-ptex_pmpost_dvitomp.sh b/testcases/function_test/pkg_test/texlive-base/texlive-ptex/test_texlive-ptex_pmpost_dvitomp.sh deleted file mode 100644 index d349a19b24b..00000000000 --- a/testcases/function_test/pkg_test/texlive-base/texlive-ptex/test_texlive-ptex_pmpost_dvitomp.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-08 -# @License : Mulan PSL v2 -# @Desc : 测试 pmpost 命令的 --dvitomp 参数,用于将 pMetaPost 作为 DVI 到 MPX 的转换器 -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - # 测试脚本开始 - - # 步骤1: 检查环境是否已安装相关软件包 - LOG_INFO "步骤1: 检查环境是否已安装 texlive-ptex 软件包" - rpm -q texlive-ptex - if [ $? -eq 0 ]; then - LOG_INFO "texlive-ptex 已安装,测试结束后将保持安装状态" - INSTALLED=1 - else - LOG_INFO "texlive-ptex 未安装,将在测试步骤中安装" - INSTALLED=0 - fi - - # 步骤2: 检查 yum 源中是否有 texlive-ptex 软件包 - LOG_INFO "步骤2: 检查 yum 源中是否有 texlive-ptex 软件包" - dnf list available texlive-ptex 2>/dev/null | grep -q texlive-ptex - CHECK_RESULT $? 0 0 "yum 源中未找到 texlive-ptex 软件包" - if [ $? -ne 0 ]; then - LOG_ERROR "yum 源中未找到 texlive-ptex 软件包,退出测试" - exit 255 - fi - - # 步骤3: 如果未安装,则安装 texlive-ptex 软件包 - if [ $INSTALLED -eq 0 ]; then - LOG_INFO "步骤3: 安装 texlive-ptex 软件包" - dnf install -y texlive-ptex - CHECK_RESULT $? 0 0 "安装 texlive-ptex 软件包失败" - fi - - # 步骤4: 检查 pmpost 命令是否支持 --dvitomp 参数 - LOG_INFO "步骤4: 检查 pmpost 命令是否支持 --dvitomp 参数" - pmpost --help 2>&1 | grep -q -- "--dvitomp" - CHECK_RESULT $? 0 0 "pmpost 命令不支持 --dvitomp 参数" - if [ $? -ne 0 ]; then - LOG_ERROR "pmpost 命令不支持 --dvitomp 参数,退出测试" - exit 255 - fi - - # 步骤5: 创建一个测试 DVI 文件用于转换 - LOG_INFO "步骤5: 创建一个测试 DVI 文件用于转换" - cat > test_input.dvi << "EOF" - % DVI 文件示例内容(简化版) - % 这里仅作为示例,实际测试中可能需要有效的 DVI 文件 - EOF - CHECK_RESULT $? 0 0 "创建测试 DVI 文件失败" - - # 步骤6: 使用 pmpost 命令的 --dvitomp 参数进行转换 - LOG_INFO "步骤6: 使用 pmpost 命令的 --dvitomp 参数进行转换" - pmpost --dvitomp test_input.dvi test_output.mpx 2>&1 - CHECK_RESULT $? 0 0 "pmpost 命令执行失败" - - # 步骤7: 检查转换结果文件是否存在 - LOG_INFO "步骤7: 检查转换结果文件是否存在" - [ -f test_output.mpx ] - CHECK_RESULT $? 0 0 "转换结果文件未生成" - - # 步骤8: 清理测试过程中生成的文件 - LOG_INFO "步骤8: 清理测试过程中生成的文件" - rm -f test_input.dvi test_output.mpx - CHECK_RESULT $? 0 0 "清理测试文件失败" - - # 步骤9: 如果测试前未安装,则卸载 texlive-ptex 软件包 - if [ $INSTALLED -eq 0 ]; then - LOG_INFO "步骤9: 卸载 texlive-ptex 软件包" - dnf remove -y texlive-ptex - CHECK_RESULT $? 0 0 "卸载 texlive-ptex 软件包失败" - fi - - LOG_INFO "测试完成,环境已恢复" -} - -main "$@" \ No newline at end of file diff --git a/testcases/function_test/pkg_test/texlive-base/texlive-ptex/test_texlive-ptex_pmpost_file_line_error.sh b/testcases/function_test/pkg_test/texlive-base/texlive-ptex/test_texlive-ptex_pmpost_file_line_error.sh deleted file mode 100644 index 9054fb5a18a..00000000000 --- a/testcases/function_test/pkg_test/texlive-base/texlive-ptex/test_texlive-ptex_pmpost_file_line_error.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-08 -# @License : Mulan PSL v2 -# @Desc : 测试 pmpost 命令的 -file-line-error 参数,用于禁用文件:行:错误样式消息 -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - LOG_INFO "开始测试 pmpost 命令的 -file-line-error 参数" - LOG_INFO "步骤1: 检查系统中是否已安装 texlive-ptex 软件包" - - # 检查是否已安装 texlive-ptex - if rpm -q texlive-ptex &>/dev/null; then - LOG_INFO "texlive-ptex 已安装,脚本结束后将保持安装状态" - INSTALLED_BEFORE="true" - else - LOG_INFO "texlive-ptex 未安装,将在测试过程中安装" - INSTALLED_BEFORE="false" - fi - - # 检查 yum 源中是否有 texlive-ptex 软件包 - LOG_INFO "步骤2: 检查 yum 源中是否有 texlive-ptex 软件包" - if ! dnf list available texlive-ptex &>/dev/null; then - LOG_ERROR "yum 源中未找到 texlive-ptex 软件包" - exit 255 - fi - - # 如果未安装,则安装软件包 - if [ "$INSTALLED_BEFORE" = "false" ]; then - LOG_INFO "步骤3: 安装 texlive-ptex 软件包" - dnf install -y texlive-ptex - CHECK_RESULT $? 0 0 "安装 texlive-ptex 失败" - fi - - # 检查 pmpost 命令是否支持 -file-line-error 参数 - LOG_INFO "步骤4: 检查 pmpost 命令是否支持 -file-line-error 参数" - if ! pmpost --help 2>&1 | grep -q -- "-file-line-error"; then - LOG_ERROR "pmpost 命令不支持 -file-line-error 参数" - # 如果之前未安装,则卸载软件包 - if [ "$INSTALLED_BEFORE" = "false" ]; then - LOG_INFO "清理环境:卸载 texlive-ptex 软件包" - dnf remove -y texlive-ptex - fi - exit 255 - fi - - # 测试 pmpost 命令的 -file-line-error 参数 - LOG_INFO "步骤5: 测试 pmpost 命令的 -file-line-error 参数" - # 创建一个简单的测试文件 - TEST_FILE="test_pmpost.tex" - cat > "$TEST_FILE" << "EOF" - \documentclass{article} - \begin{document} - Hello, world! - \end{document} - EOF - - # 使用 -file-line-error 参数运行 pmpost - pmpost -file-line-error "$TEST_FILE" 2>&1 - CHECK_RESULT $? 0 0 "pmpost 命令执行失败" - - # 清理测试文件 - rm -f "$TEST_FILE" - - # 如果之前未安装,则卸载软件包 - if [ "$INSTALLED_BEFORE" = "false" ]; then - LOG_INFO "步骤6: 清理环境,卸载 texlive-ptex 软件包" - dnf remove -y texlive-ptex - CHECK_RESULT $? 0 0 "卸载 texlive-ptex 失败" - else - LOG_INFO "步骤6: 保持 texlive-ptex 安装状态" - fi - - LOG_INFO "测试完成" -} - -main "$@" \ No newline at end of file diff --git a/testcases/function_test/pkg_test/texlive-base/texlive-ptex/test_texlive-ptex_pmpost_ini.sh b/testcases/function_test/pkg_test/texlive-base/texlive-ptex/test_texlive-ptex_pmpost_ini.sh deleted file mode 100644 index f45eab0172f..00000000000 --- a/testcases/function_test/pkg_test/texlive-base/texlive-ptex/test_texlive-ptex_pmpost_ini.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-08 -# @License : Mulan PSL v2 -# @Desc : 测试 pmpost 命令的 -ini 参数,用于转储内存文件 -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - set -e - - LOG_INFO "开始测试 pmpost 命令的 -ini 参数功能" - LOG_INFO "步骤1:检查当前环境是否已安装 texlive-ptex 软件包" - - if rpm -q texlive-ptex > /dev/null 2>&1; then - LOG_INFO "检测到 texlive-ptex 已安装,测试后将保持此状态" - INSTALLED=true - else - LOG_INFO "未检测到 texlive-ptex 安装,将在测试中安装" - INSTALLED=false - fi - - LOG_INFO "步骤2:检查 yum 源中是否存在 texlive-ptex 软件包" - if ! dnf list available texlive-ptex > /dev/null 2>&1; then - LOG_ERROR "yum 源中未找到 texlive-ptex 软件包" - exit 255 - fi - - if [ "$INSTALLED" = false ]; then - LOG_INFO "步骤3:安装 texlive-ptex 软件包" - dnf install -y texlive-ptex - CHECK_RESULT $? 0 0 "安装 texlive-ptex 失败" - fi - - LOG_INFO "步骤4:检查 pmpost 命令是否存在" - if ! command -v pmpost > /dev/null 2>&1; then - LOG_ERROR "pmpost 命令未找到" - exit 255 - fi - - LOG_INFO "步骤5:检查 pmpost 命令是否支持 -ini 参数" - if ! pmpost --help 2>&1 | grep -q "\-ini"; then - LOG_ERROR "pmpost 命令不支持 -ini 参数" - exit 255 - fi - - LOG_INFO "步骤6:执行 pmpost -ini 命令测试转储内存文件功能" - pmpost -ini - CHECK_RESULT $? 0 0 "pmpost -ini 命令执行失败" - - LOG_INFO "步骤7:验证生成的 .ini 文件" - if [ -f "pm.ini" ]; then - LOG_INFO "成功生成 pm.ini 内存转储文件" - cat pm.ini | head -5 - CHECK_RESULT $? 0 0 "读取 pm.ini 文件失败" - else - LOG_ERROR "未找到生成的 pm.ini 文件" - exit 1 - fi - - LOG_INFO "步骤8:清理测试生成的临时文件" - rm -f pm.ini - CHECK_RESULT $? 0 0 "删除 pm.ini 文件失败" - - if [ "$INSTALLED" = false ]; then - LOG_INFO "步骤9:卸载测试安装的 texlive-ptex 软件包" - dnf remove -y texlive-ptex - CHECK_RESULT $? 0 0 "卸载 texlive-ptex 失败" - fi - - LOG_INFO "测试完成,环境已恢复" -} - -main "$@" \ No newline at end of file diff --git a/testcases/function_test/pkg_test/texlive-base/texlive-ptex/test_texlive-ptex_pmpost_interaction.sh b/testcases/function_test/pkg_test/texlive-base/texlive-ptex/test_texlive-ptex_pmpost_interaction.sh deleted file mode 100644 index 2a2bb1a4687..00000000000 --- a/testcases/function_test/pkg_test/texlive-base/texlive-ptex/test_texlive-ptex_pmpost_interaction.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-08 -# @License : Mulan PSL v2 -# @Desc : 测试 pmpost 命令的 -interaction 参数,用于设置交互模式 -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - # 判断是否已安装texlive-ptex - LOG_INFO "检查是否已安装texlive-ptex软件包" - rpm -q texlive-ptex &>/dev/null - if [ $? -eq 0 ]; then - LOG_INFO "texlive-ptex已安装,脚本结束时将保持安装状态" - INSTALLED=1 - else - LOG_INFO "texlive-ptex未安装,将在测试过程中安装" - INSTALLED=0 - fi - - # 检查yum源中是否有texlive-ptex软件包 - LOG_INFO "检查yum源中是否有texlive-ptex软件包" - dnf list available texlive-ptex &>/dev/null - CHECK_RESULT $? 0 0 "yum源中未找到texlive-ptex软件包" - if [ $? -ne 0 ]; then - LOG_ERROR "yum源中未找到texlive-ptex软件包" - exit 255 - fi - - # 如果未安装,则安装软件包 - if [ $INSTALLED -eq 0 ]; then - LOG_INFO "安装texlive-ptex软件包" - dnf install -y texlive-ptex - CHECK_RESULT $? 0 0 "安装texlive-ptex软件包失败" - fi - - # 检查pmpost命令是否存在 - LOG_INFO "检查pmpost命令是否存在" - which pmpost &>/dev/null - CHECK_RESULT $? 0 0 "pmpost命令不存在" - if [ $? -ne 0 ]; then - LOG_ERROR "pmpost命令不存在" - exit 255 - fi - - # 测试pmpost命令的-interaction参数是否存在 - LOG_INFO "测试pmpost命令的-interaction参数是否存在" - pmpost -help 2>&1 | grep -q "\-interaction" - CHECK_RESULT $? 0 0 "pmpost命令不支持-interaction参数" - if [ $? -ne 0 ]; then - LOG_ERROR "pmpost命令不支持-interaction参数" - exit 255 - fi - - # 测试pmpost命令的-interaction参数功能 - LOG_INFO "测试pmpost命令的-interaction参数功能" - echo "test" > test.tex - pmpost -interaction=batchmode test.tex 2>&1 - CHECK_RESULT $? 0 0 "pmpost命令-interaction参数执行失败" - rm -f test.tex test.log test.dvi - - # 清理环境 - LOG_INFO "清理测试环境" - if [ $INSTALLED -eq 0 ]; then - LOG_INFO "卸载texlive-ptex软件包" - dnf remove -y texlive-ptex - CHECK_RESULT $? 0 0 "卸载texlive-ptex软件包失败" - else - LOG_INFO "保持texlive-ptex软件包安装状态" - fi - - LOG_INFO "测试完成" -} - -main "$@" \ No newline at end of file diff --git a/testcases/function_test/pkg_test/texlive-base/texlive-ptex/test_texlive-ptex_pmpost_jobname.sh b/testcases/function_test/pkg_test/texlive-base/texlive-ptex/test_texlive-ptex_pmpost_jobname.sh deleted file mode 100644 index fa71f6bf0ce..00000000000 --- a/testcases/function_test/pkg_test/texlive-base/texlive-ptex/test_texlive-ptex_pmpost_jobname.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-08 -# @License : Mulan PSL v2 -# @Desc : 测试 pmpost 命令的 -jobname 参数,用于设置作业名称 -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - LOG_INFO "开始测试 pmpost 命令的 -jobname 参数功能" - - LOG_INFO "检查系统中是否已安装 texlive-ptex 软件包" - if dnf list installed texlive-ptex &>/dev/null; then - LOG_INFO "texlive-ptex 软件包已安装,测试结束后将保持安装状态" - INSTALLED_BEFORE_TEST=true - else - LOG_INFO "texlive-ptex 软件包未安装,将在测试前安装,测试结束后卸载" - INSTALLED_BEFORE_TEST=false - fi - - LOG_INFO "检查 yum 源中是否存在 texlive-ptex 软件包" - if ! dnf list available texlive-ptex &>/dev/null; then - LOG_ERROR "yum 源中未找到 texlive-ptex 软件包" - exit 255 - fi - - if [ "$INSTALLED_BEFORE_TEST" = false ]; then - LOG_INFO "开始安装 texlive-ptex 软件包" - dnf install -y texlive-ptex - CHECK_RESULT $? 0 0 "安装 texlive-ptex 软件包失败" - fi - - LOG_INFO "检查 pmpost 命令是否支持 -jobname 参数" - if ! pmpost -help 2>&1 | grep -q -- "-jobname"; then - LOG_ERROR "pmpost 命令不支持 -jobname 参数" - if [ "$INSTALLED_BEFORE_TEST" = false ]; then - LOG_INFO "清理环境:卸载 texlive-ptex 软件包" - dnf remove -y texlive-ptex - fi - exit 255 - fi - - LOG_INFO "创建一个简单的测试 .dvi 文件" - cat > test_input.dvi << "EOF" - % This is a minimal DVI file for testing - EOF - CHECK_RESULT $? 0 0 "创建测试 .dvi 文件失败" - - LOG_INFO "使用 pmpost 命令并设置 -jobname 参数为 "TestJob"" - pmpost -jobname TestJob test_input.dvi test_output.ps - CHECK_RESULT $? 0 0 "pmpost 命令执行失败" - - LOG_INFO "检查是否生成了预期的输出文件 test_output.ps" - if [ -f "test_output.ps" ]; then - LOG_INFO "成功生成了输出文件 test_output.ps" - else - LOG_ERROR "未找到预期的输出文件 test_output.ps" - CHECK_RESULT 1 0 0 "输出文件验证失败" - fi - - LOG_INFO "清理测试过程中生成的文件" - rm -f test_input.dvi test_output.ps - CHECK_RESULT $? 0 0 "清理测试文件失败" - - if [ "$INSTALLED_BEFORE_TEST" = false ]; then - LOG_INFO "清理环境:卸载 texlive-ptex 软件包" - dnf remove -y texlive-ptex - CHECK_RESULT $? 0 0 "卸载 texlive-ptex 软件包失败" - fi - - LOG_INFO "pmpost 命令 -jobname 参数测试完成" -} - -main "$@" \ No newline at end of file diff --git a/testcases/function_test/pkg_test/texlive-base/texlive-ptex/test_texlive-ptex_pmpost_kanji.sh b/testcases/function_test/pkg_test/texlive-base/texlive-ptex/test_texlive-ptex_pmpost_kanji.sh deleted file mode 100644 index cea3bc4fe4d..00000000000 --- a/testcases/function_test/pkg_test/texlive-base/texlive-ptex/test_texlive-ptex_pmpost_kanji.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-08 -# @License : Mulan PSL v2 -# @Desc : 测试 pmpost 命令的 -kanji 参数,用于设置日文编码 -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - LOG_INFO "开始测试 pmpost 命令的 -kanji 参数,用于设置日文编码" - - # 检查软件包是否在yum源中 - LOG_INFO "检查yum源中是否存在 texlive-ptex 软件包" - dnf list texlive-ptex 2>&1 | grep -q "texlive-ptex" - if [ $? -ne 0 ]; then - LOG_ERROR "yum源中未找到 texlive-ptex 软件包" - exit 255 - fi - - # 检查是否已安装软件包 - LOG_INFO "检查 texlive-ptex 是否已安装" - rpm -q texlive-ptex > /dev/null 2>&1 - if [ $? -eq 0 ]; then - LOG_INFO "texlive-ptex 已安装,测试完成后保持安装状态" - INSTALLED=true - else - LOG_INFO "texlive-ptex 未安装,将安装软件包作为测试步骤" - INSTALLED=false - fi - - # 如果未安装,则安装软件包 - if [ "$INSTALLED" = "false" ]; then - LOG_INFO "安装 texlive-ptex 软件包" - dnf install -y texlive-ptex - CHECK_RESULT $? 0 0 "安装 texlive-ptex 失败" - fi - - # 检查 pmpost 命令是否存在 - LOG_INFO "检查 pmpost 命令是否存在" - command -v pmpost > /dev/null 2>&1 - CHECK_RESULT $? 0 0 "pmpost 命令不存在" - - # 检查 pmpost 命令是否支持 -kanji 参数 - LOG_INFO "检查 pmpost 命令是否支持 -kanji 参数" - pmpost -kanji 2>&1 | grep -q "Usage: pmpost" - if [ $? -ne 0 ]; then - LOG_ERROR "pmpost 命令不支持 -kanji 参数" - exit 255 - fi - - # 测试 pmpost -kanji 参数 - LOG_INFO "测试 pmpost -kanji 参数设置日文编码" - pmpost -kanji euc > /dev/null 2>&1 - CHECK_RESULT $? 0 0 "pmpost -kanji euc 执行失败" - - pmpost -kanji jis > /dev/null 2>&1 - CHECK_RESULT $? 0 0 "pmpost -kanji jis 执行失败" - - pmpost -kanji sjis > /dev/null 2>&1 - CHECK_RESULT $? 0 0 "pmpost -kanji sjis 执行失败" - - pmpost -kanji utf8 > /dev/null 2>&1 - CHECK_RESULT $? 0 0 "pmpost -kanji utf8 执行失败" - - # 清理环境:如果之前未安装,则卸载软件包 - if [ "$INSTALLED" = "false" ]; then - LOG_INFO "卸载 texlive-ptex 软件包" - dnf remove -y texlive-ptex - CHECK_RESULT $? 0 0 "卸载 texlive-ptex 失败" - fi - - LOG_INFO "测试完成" -} - -main "$@" \ No newline at end of file diff --git a/testcases/function_test/pkg_test/texlive-base/texlive-ptex/test_texlive-ptex_pmpost_kpathsea_debug.sh b/testcases/function_test/pkg_test/texlive-base/texlive-ptex/test_texlive-ptex_pmpost_kpathsea_debug.sh deleted file mode 100644 index 3997cddcf21..00000000000 --- a/testcases/function_test/pkg_test/texlive-base/texlive-ptex/test_texlive-ptex_pmpost_kpathsea_debug.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-08 -# @License : Mulan PSL v2 -# @Desc : 测试 pmpost 命令的 -kpathsea-debug 参数,用于根据数字位设置路径搜索调试标志 -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - # 定义软件包名称 - PACKAGE_NAME="texlive-ptex" - - # 步骤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 - ALREADY_INSTALLED=true - LOG_INFO "软件包 $PACKAGE_NAME 已安装,脚本结束后将保持安装状态" - else - ALREADY_INSTALLED=false - LOG_INFO "软件包 $PACKAGE_NAME 未安装,将在测试步骤中安装" - 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: 检查 pmpost 命令是否存在 - LOG_INFO "4. 检查 pmpost 命令是否存在" - which pmpost &>/dev/null - CHECK_RESULT $? 0 0 "pmpost 命令不存在" - - # 步骤5: 测试 pmpost 命令的 -kpathsea-debug 参数 - LOG_INFO "5. 测试 pmpost 命令的 -kpathsea-debug 参数" - pmpost -kpathsea-debug 1 2>&1 | grep -q "kpathsea" - CHECK_RESULT $? 0 0 "pmpost 命令的 -kpathsea-debug 参数不支持或执行失败" - - # 步骤6: 测试不支持的参数 - LOG_INFO "6. 测试 pmpost 命令的不支持参数" - pmpost --invalid-param 2>&1 | grep -q "unrecognized option" - if [ $? -eq 0 ]; then - LOG_INFO "pmpost 命令正确识别了不支持参数" - else - LOG_ERROR "pmpost 命令未正确识别不支持参数" - exit 255 - fi - - # 步骤7: 清理环境 - LOG_INFO "7. 清理测试环境" - 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-ptex/test_texlive-ptex_pmpost_mem.sh b/testcases/function_test/pkg_test/texlive-base/texlive-ptex/test_texlive-ptex_pmpost_mem.sh deleted file mode 100644 index 345d8d936bc..00000000000 --- a/testcases/function_test/pkg_test/texlive-base/texlive-ptex/test_texlive-ptex_pmpost_mem.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-08 -# @License : Mulan PSL v2 -# @Desc : 测试 pmpost 命令的 -mem 参数,用于指定内存文件名 -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - LOG_INFO "开始测试 pmpost 命令的 -mem 参数功能" - - # 检查软件包是否已在yum源中 - LOG_INFO "检查yum源中是否存在 texlive-ptex 软件包" - dnf list available texlive-ptex 2>/dev/null | grep -q texlive-ptex - if [ $? -ne 0 ]; then - LOG_ERROR "yum源中未找到 texlive-ptex 软件包" - exit 255 - fi - - # 判断环境是否已安装 texlive-ptex - LOG_INFO "检查系统中是否已安装 texlive-ptex" - rpm -q texlive-ptex >/dev/null 2>&1 - if [ $? -eq 0 ]; then - LOG_INFO "texlive-ptex 已安装,测试结束后将保持安装状态" - INSTALLED=1 - else - LOG_INFO "texlive-ptex 未安装,将进行安装并在测试结束后卸载" - INSTALLED=0 - fi - - # 如果未安装,则安装软件包 - if [ $INSTALLED -eq 0 ]; then - LOG_INFO "安装 texlive-ptex 软件包" - dnf install -y texlive-ptex - CHECK_RESULT $? 0 0 "安装 texlive-ptex 失败" - fi - - # 检查 pmpost 命令是否支持 -mem 参数 - LOG_INFO "检查 pmpost 命令是否支持 -mem 参数" - pmpost --help 2>&1 | grep -q -- "-mem" - if [ $? -ne 0 ]; then - LOG_ERROR "pmpost 命令不支持 -mem 参数" - # 如果之前未安装,则卸载软件包 - if [ $INSTALLED -eq 0 ]; then - dnf remove -y texlive-ptex - fi - exit 255 - fi - - # 测试 pmpost -mem 参数功能 - LOG_INFO "测试 pmpost 命令的 -mem 参数,指定内存文件名" - # 创建一个简单的测试文件用于测试 - TEST_FILE="test_mem.mem" - echo "Test content for memory file" > $TEST_FILE - pmpost -mem $TEST_FILE 2>&1 - CHECK_RESULT $? 0 0 "pmpost -mem 参数执行失败" - - # 清理测试文件 - LOG_INFO "清理测试文件" - rm -f $TEST_FILE - - # 如果测试开始时未安装软件包,则卸载 - if [ $INSTALLED -eq 0 ]; then - LOG_INFO "卸载 texlive-ptex 软件包" - dnf remove -y texlive-ptex - CHECK_RESULT $? 0 0 "卸载 texlive-ptex 失败" - fi - - LOG_INFO "测试 pmpost 命令的 -mem 参数功能完成" -} - -main "$@" \ No newline at end of file diff --git a/testcases/function_test/pkg_test/texlive-base/texlive-ptex/test_texlive-ptex_pmpost_no_file_line_error.sh b/testcases/function_test/pkg_test/texlive-base/texlive-ptex/test_texlive-ptex_pmpost_no_file_line_error.sh deleted file mode 100644 index 327d96b2d7e..00000000000 --- a/testcases/function_test/pkg_test/texlive-base/texlive-ptex/test_texlive-ptex_pmpost_no_file_line_error.sh +++ /dev/null @@ -1,135 +0,0 @@ -#!/usr/bin/bash - -# Copyright (c) 2024 ISCAS .ALL rights reserved. -# This program is licensed under Mulan PSL v2. -# You can use it according to the terms and conditions of the Mulan PSL v2. -# http://license.coscl.org.cn/MulanPSL2 -# THIS PROGRAM IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, -# EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, -# MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. -# See the Mulan PSL v2 for more details. - -# ############################################# -# @Author : honghua -# @Contact : honghua@iscas.ac.cn -# @Date : 2026-03-08 -# @License : Mulan PSL v2 -# @Desc : 测试 pmpost 命令的 -no-file-line-error 参数,用于启用文件:行:错误样式消息 -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - # 定义日志函数 - LOG_INFO() { - echo "[INFO] $*" - } - LOG_ERROR() { - echo "[ERROR] $*" >&2 - } - - # 软件包名称 - PACKAGE_NAME="texlive-ptex" - - # 检查软件包是否在yum源中 - check_package_in_repo() { - LOG_INFO "检查yum源中是否存在软件包 $PACKAGE_NAME" - dnf list available "$PACKAGE_NAME" &>/dev/null - if [ $? -ne 0 ]; then - LOG_ERROR "软件包 $PACKAGE_NAME 不在yum源中" - exit 255 - fi - LOG_INFO "软件包 $PACKAGE_NAME 在yum源中存在" - } - - # 检查软件包是否已安装 - check_package_installed() { - LOG_INFO "检查软件包 $PACKAGE_NAME 是否已安装" - rpm -q "$PACKAGE_NAME" &>/dev/null - return $? - } - - # 安装软件包 - install_package() { - LOG_INFO "安装软件包 $PACKAGE_NAME" - dnf install -y "$PACKAGE_NAME" - CHECK_RESULT $? 0 0 "安装软件包失败" - } - - # 卸载软件包 - uninstall_package() { - LOG_INFO "卸载软件包 $PACKAGE_NAME" - dnf remove -y "$PACKAGE_NAME" - CHECK_RESULT $? 0 0 "卸载软件包失败" - } - - # 测试 pmpost 命令的 -no-file-line-error 参数 - test_pmpost_no_file_line_error() { - LOG_INFO "测试 pmpost 命令的 -no-file-line-error 参数" - - # 检查 pmpost 命令是否存在 - which pmpost &>/dev/null - CHECK_RESULT $? 0 0 "pmpost 命令不存在" - - # 创建一个简单的测试文件 - TEST_FILE="test_input.tex" - echo "\documentclass{article}\begin{document}test\end{document}" > "$TEST_FILE" - - # 测试不带参数执行 pmpost - LOG_INFO "测试不带参数执行 pmpost" - pmpost "$TEST_FILE" 2>&1 | grep -q "file:line:error" - local no_param_result=$? - - # 测试带 -no-file-line-error 参数执行 pmpost - LOG_INFO "测试带 -no-file-line-error 参数执行 pmpost" - pmpost -no-file-line-error "$TEST_FILE" 2>&1 | grep -q "file:line:error" - local with_param_result=$? - - # 清理测试文件 - rm -f "$TEST_FILE" - - # 检查参数是否有效 - if [ $no_param_result -eq 0 ] && [ $with_param_result -ne 0 ]; then - LOG_INFO "-no-file-line-error 参数生效,成功禁用文件:行:错误样式消息" - return 0 - else - LOG_ERROR "-no-file-line-error 参数未生效" - return 1 - fi - } - - # 主函数 - main() { - # 检查软件包是否在yum源中 - check_package_in_repo - - # 记录初始安装状态 - check_package_installed - local initially_installed=$? - - # 如果未安装,则安装软件包 - if [ $initially_installed -ne 0 ]; then - install_package - else - LOG_INFO "软件包 $PACKAGE_NAME 已安装,跳过安装步骤" - fi - - # 执行测试 - test_pmpost_no_file_line_error - CHECK_RESULT $? 0 0 "测试 pmpost 命令的 -no-file-line-error 参数失败" - - # 环境恢复:如果最初未安装,则卸载软件包 - if [ $initially_installed -ne 0 ]; then - uninstall_package - else - LOG_INFO "软件包 $PACKAGE_NAME 最初已安装,保持安装状态" - fi - - LOG_INFO "测试完成" - } - - # 执行主函数 - main -} - -main "$@" \ No newline at end of file diff --git a/testcases/function_test/pkg_test/texlive-base/texlive-ptex/test_texlive-ptex_pmpost_numbersystem.sh b/testcases/function_test/pkg_test/texlive-base/texlive-ptex/test_texlive-ptex_pmpost_numbersystem.sh deleted file mode 100644 index f20f9946a3b..00000000000 --- a/testcases/function_test/pkg_test/texlive-base/texlive-ptex/test_texlive-ptex_pmpost_numbersystem.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-08 -# @License : Mulan PSL v2 -# @Desc : 测试 pmpost 命令的 -numbersystem 参数,用于设置数字系统模式 -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - # 测试 pmpost 命令的 -numbersystem 参数 - - LOG_INFO "开始测试 pmpost 命令的 -numbersystem 参数功能" - - # 检查环境中是否已安装 texlive-ptex 软件包 - LOG_INFO "步骤1:检查 texlive-ptex 软件包是否已安装" - rpm -q texlive-ptex > /dev/null 2>&1 - if [ $? -eq 0 ]; then - LOG_INFO "texlive-ptex 软件包已安装,测试结束后将保持安装状态" - INSTALLED_BEFORE=1 - else - LOG_INFO "texlive-ptex 软件包未安装,将在测试过程中安装并在结束后卸载" - INSTALLED_BEFORE=0 - fi - - # 检查 yum 源中是否有 texlive-ptex 软件包 - LOG_INFO "步骤2:检查 yum 源中是否有 texlive-ptex 软件包" - dnf list available texlive-ptex > /dev/null 2>&1 - if [ $? -ne 0 ]; then - LOG_ERROR "yum 源中未找到 texlive-ptex 软件包" - exit 255 - fi - - # 如果未安装,则安装 texlive-ptex 软件包 - if [ $INSTALLED_BEFORE -eq 0 ]; then - LOG_INFO "步骤3:安装 texlive-ptex 软件包" - dnf install -y texlive-ptex - CHECK_RESULT $? 0 0 "安装 texlive-ptex 软件包失败" - fi - - # 检查 pmpost 命令是否存在 - LOG_INFO "步骤4:检查 pmpost 命令是否存在" - which pmpost > /dev/null 2>&1 - if [ $? -ne 0 ]; then - LOG_ERROR "pmpost 命令不存在" - if [ $INSTALLED_BEFORE -eq 0 ]; then - dnf remove -y texlive-ptex - fi - exit 255 - fi - - # 测试 pmpost 命令的 -numbersystem 参数 - LOG_INFO "步骤5:测试 pmpost 命令的 -numbersystem 参数" - pmpost -numbersystem 2 > /dev/null 2>&1 - if [ $? -eq 255 ]; then - LOG_ERROR "pmpost 命令不支持 -numbersystem 参数" - if [ $INSTALLED_BEFORE -eq 0 ]; then - dnf remove -y texlive-ptex - fi - exit 255 - fi - - # 测试有效的数字系统模式 - LOG_INFO "步骤6:测试有效的数字系统模式(0-3)" - for i in 0 1 2 3; do - pmpost -numbersystem $i -version > /dev/null 2>&1 - CHECK_RESULT $? 0 0 "pmpost -numbersystem $i 参数执行失败" - done - - # 测试无效的数字系统模式 - LOG_INFO "步骤7:测试无效的数字系统模式(4)" - pmpost -numbersystem 4 -version > /dev/null 2>&1 - if [ $? -eq 0 ]; then - LOG_ERROR "pmpost 命令接受了无效的 -numbersystem 参数值 4" - if [ $INSTALLED_BEFORE -eq 0 ]; then - dnf remove -y texlive-ptex - fi - exit 1 - fi - - # 清理环境 - LOG_INFO "步骤8:清理测试环境" - if [ $INSTALLED_BEFORE -eq 0 ]; then - LOG_INFO "卸载 texlive-ptex 软件包" - dnf remove -y texlive-ptex - CHECK_RESULT $? 0 0 "卸载 texlive-ptex 软件包失败" - else - LOG_INFO "保持 texlive-ptex 软件包安装状态" - fi - - LOG_INFO "测试 pmpost 命令的 -numbersystem 参数功能完成" -} - -main "$@" \ No newline at end of file diff --git a/testcases/function_test/pkg_test/texlive-base/texlive-ptex/test_texlive-ptex_pmpost_recorder.sh b/testcases/function_test/pkg_test/texlive-base/texlive-ptex/test_texlive-ptex_pmpost_recorder.sh deleted file mode 100644 index 3df4b2bf262..00000000000 --- a/testcases/function_test/pkg_test/texlive-base/texlive-ptex/test_texlive-ptex_pmpost_recorder.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-08 -# @License : Mulan PSL v2 -# @Desc : 测试 pmpost 命令的 -recorder 参数,用于启用文件名记录器 -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - LOG_INFO "开始测试 pmpost 命令的 -recorder 参数" - - # 检查软件包是否在yum源中 - LOG_INFO "检查yum源中是否存在 texlive-ptex 软件包" - dnf list texlive-ptex 2>&1 | grep -q "texlive-ptex" - if [ $? -ne 0 ]; then - LOG_ERROR "yum源中不存在 texlive-ptex 软件包" - exit 255 - fi - - # 检查是否已安装 texlive-ptex - LOG_INFO "检查 texlive-ptex 是否已安装" - rpm -q texlive-ptex > /dev/null 2>&1 - if [ $? -eq 0 ]; then - LOG_INFO "texlive-ptex 已安装,测试结束后保持安装状态" - INSTALLED=true - else - LOG_INFO "texlive-ptex 未安装,将进行安装" - INSTALLED=false - fi - - # 如果未安装,则安装软件包 - if [ "$INSTALLED" = false ]; then - LOG_INFO "安装 texlive-ptex 软件包" - dnf install -y texlive-ptex - CHECK_RESULT $? 0 0 "安装 texlive-ptex 失败" - fi - - # 检查 pmpost 命令是否存在 - LOG_INFO "检查 pmpost 命令是否存在" - command -v pmpost > /dev/null 2>&1 - CHECK_RESULT $? 0 0 "pmpost 命令不存在" - - # 检查 pmpost 命令是否支持 -recorder 参数 - LOG_INFO "检查 pmpost 命令是否支持 -recorder 参数" - pmpost -recorder --help 2>&1 | grep -q "recorder" - if [ $? -ne 0 ]; then - LOG_ERROR "pmpost 命令不支持 -recorder 参数" - exit 255 - fi - - # 测试 pmpost 命令的 -recorder 参数 - LOG_INFO "测试 pmpost 命令的 -recorder 参数" - pmpost -recorder test_input.mp test_output.dvi > /dev/null 2>&1 - CHECK_RESULT $? 0 0 "pmpost -recorder 命令执行失败" - - # 清理环境 - LOG_INFO "清理测试环境" - rm -f test_input.mp test_output.dvi test_output.log - - # 如果之前未安装,则卸载软件包 - if [ "$INSTALLED" = false ]; then - LOG_INFO "卸载 texlive-ptex 软件包" - dnf remove -y texlive-ptex - CHECK_RESULT $? 0 0 "卸载 texlive-ptex 失败" - fi - - LOG_INFO "测试完成" -} - -main "$@" \ No newline at end of file diff --git a/testcases/function_test/pkg_test/texlive-base/texlive-ptex/test_texlive-ptex_pmpost_restricted.sh b/testcases/function_test/pkg_test/texlive-base/texlive-ptex/test_texlive-ptex_pmpost_restricted.sh deleted file mode 100644 index 3a2fb706f2d..00000000000 --- a/testcases/function_test/pkg_test/texlive-base/texlive-ptex/test_texlive-ptex_pmpost_restricted.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-08 -# @License : Mulan PSL v2 -# @Desc : 测试 pmpost 命令的 -restricted 参数,用于安全模式:禁用 tex、makempx 和编辑器命令 -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - LOG_INFO "开始测试 pmpost 命令的 -restricted 参数功能" - - # 检查软件包是否在yum源中 - LOG_INFO "检查 yum 源中是否存在 texlive-ptex 软件包" - dnf list available texlive-ptex &>/dev/null - if [ $? -ne 0 ]; then - LOG_ERROR "yum 源中未找到 texlive-ptex 软件包" - exit 255 - fi - - # 检查是否已安装软件包 - LOG_INFO "检查是否已安装 texlive-ptex 软件包" - rpm -q texlive-ptex &>/dev/null - if [ $? -eq 0 ]; then - LOG_INFO "texlive-ptex 软件包已安装,测试结束后将保持安装状态" - INSTALLED=1 - else - LOG_INFO "texlive-ptex 软件包未安装,将在测试过程中安装并在测试结束后卸载" - INSTALLED=0 - fi - - # 如果未安装,则安装软件包 - if [ $INSTALLED -eq 0 ]; then - LOG_INFO "安装 texlive-ptex 软件包" - dnf install -y texlive-ptex - CHECK_RESULT $? 0 0 "安装 texlive-ptex 软件包失败" - fi - - # 检查 pmpost 命令是否支持 -restricted 参数 - LOG_INFO "检查 pmpost 命令是否支持 -restricted 参数" - pmpost -help 2>&1 | grep -q "\-restricted" - if [ $? -ne 0 ]; then - LOG_ERROR "pmpost 命令不支持 -restricted 参数" - # 如果之前未安装,则卸载软件包 - if [ $INSTALLED -eq 0 ]; then - LOG_INFO "卸载 texlive-ptex 软件包" - dnf remove -y texlive-ptex - fi - exit 255 - fi - - # 测试 pmpost 命令的 -restricted 参数 - LOG_INFO "测试 pmpost 命令的 -restricted 参数" - pmpost -restricted - CHECK_RESULT $? 0 0 "pmpost 命令的 -restricted 参数执行失败" - - # 清理环境 - LOG_INFO "清理测试环境" - if [ $INSTALLED -eq 0 ]; then - LOG_INFO "卸载 texlive-ptex 软件包" - dnf remove -y texlive-ptex - CHECK_RESULT $? 0 0 "卸载 texlive-ptex 软件包失败" - else - LOG_INFO "保持 texlive-ptex 软件包的安装状态" - fi - - LOG_INFO "测试 pmpost 命令的 -restricted 参数功能完成" -} - -main "$@" \ No newline at end of file diff --git a/testcases/function_test/pkg_test/texlive-base/texlive-ptex/test_texlive-ptex_pmpost_s.sh b/testcases/function_test/pkg_test/texlive-base/texlive-ptex/test_texlive-ptex_pmpost_s.sh deleted file mode 100644 index 38383df30ee..00000000000 --- a/testcases/function_test/pkg_test/texlive-base/texlive-ptex/test_texlive-ptex_pmpost_s.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-08 -# @License : Mulan PSL v2 -# @Desc : 测试 pmpost 命令的 -s 参数,用于设置内部变量的值 -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - # 检查是否已经安装texlive-ptex软件包 - LOG_INFO "开始测试pmpost命令的-s参数" - - # 检查环境是否已安装texlive-ptex软件包 - LOG_INFO "检查texlive-ptex软件包是否已安装" - if dnf list installed texlive-ptex &>/dev/null; then - LOG_INFO "texlive-ptex软件包已安装,测试结束后将保持安装状态" - INSTALLED=1 - else - LOG_INFO "texlive-ptex软件包未安装,将在测试过程中安装" - INSTALLED=0 - fi - - # 检查yum源中是否有texlive-ptex软件包 - LOG_INFO "检查yum源中是否有texlive-ptex软件包" - if ! dnf list available texlive-ptex &>/dev/null; then - LOG_ERROR "yum源中没有texlive-ptex软件包" - exit 255 - fi - - # 如果未安装,则安装软件包 - if [ $INSTALLED -eq 0 ]; then - LOG_INFO "安装texlive-ptex软件包" - dnf install -y texlive-ptex - CHECK_RESULT $? 0 0 "安装texlive-ptex软件包失败" - fi - - # 检查pmpost命令是否存在 - LOG_INFO "检查pmpost命令是否存在" - if ! command -v pmpost &>/dev/null; then - LOG_ERROR "pmpost命令不存在" - exit 255 - fi - - # 测试pmpost命令的-s参数 - LOG_INFO "测试pmpost命令的-s参数" - pmpost -s test_variable=test_value - CHECK_RESULT $? 0 0 "pmpost命令-s参数执行失败" - - # 验证-s参数设置是否生效 - LOG_INFO "验证-s参数设置是否生效" - if pmpost -s test_variable=test_value 2>&1 | grep -q "test_variable=test_value"; then - LOG_INFO "-s参数设置内部变量成功" - else - LOG_ERROR "-s参数设置内部变量失败" - exit 1 - fi - - # 清理环境:如果之前未安装,则卸载软件包 - if [ $INSTALLED -eq 0 ]; then - LOG_INFO "卸载texlive-ptex软件包" - dnf remove -y texlive-ptex - CHECK_RESULT $? 0 0 "卸载texlive-ptex软件包失败" - LOG_INFO "环境已恢复到测试前的状态" - else - LOG_INFO "保持texlive-ptex软件包的安装状态" - fi - - LOG_INFO "测试pmpost命令-s参数完成" -} - -main "$@" \ No newline at end of file diff --git a/testcases/function_test/pkg_test/texlive-base/texlive-ptex/test_texlive-ptex_pmpost_tex.sh b/testcases/function_test/pkg_test/texlive-base/texlive-ptex/test_texlive-ptex_pmpost_tex.sh deleted file mode 100644 index 9b1bc6974ce..00000000000 --- a/testcases/function_test/pkg_test/texlive-base/texlive-ptex/test_texlive-ptex_pmpost_tex.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-08 -# @License : Mulan PSL v2 -# @Desc : 测试 pmpost 命令的 -tex 参数,用于指定文本标签的 TeX 程序 -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - # 检查环境是否已安装texlive-ptex软件包 - LOG_INFO "检查texlive-ptex软件包是否已安装" - rpm -q texlive-ptex > /dev/null 2>&1 - if [ $? -eq 0 ]; then - LOG_INFO "texlive-ptex软件包已安装,测试结束后将保持安装状态" - INSTALLED=true - else - LOG_INFO "texlive-ptex软件包未安装,将在测试过程中安装" - INSTALLED=false - fi - - # 检查yum源中是否有texlive-ptex软件包 - LOG_INFO "检查yum源中是否有texlive-ptex软件包" - dnf list available texlive-ptex > /dev/null 2>&1 - CHECK_RESULT $? 0 0 "yum源中未找到texlive-ptex软件包" - if [ $? -ne 0 ]; then - LOG_ERROR "yum源中未找到texlive-ptex软件包" - exit 255 - fi - - # 如果未安装,则安装texlive-ptex软件包 - if [ "$INSTALLED" = false ]; then - LOG_INFO "安装texlive-ptex软件包" - dnf install -y texlive-ptex - CHECK_RESULT $? 0 0 "安装texlive-ptex软件包失败" - fi - - # 检查pmpost命令是否存在 - LOG_INFO "检查pmpost命令是否存在" - which pmpost > /dev/null 2>&1 - CHECK_RESULT $? 0 0 "pmpost命令不存在" - - # 测试pmpost命令的-tex参数 - LOG_INFO "测试pmpost命令的-tex参数" - pmpost -tex > /dev/null 2>&1 - CHECK_RESULT $? 0 0 "pmpost命令不支持-tex参数" - - # 测试-tex参数指定TeX程序 - LOG_INFO "测试-tex参数指定TeX程序" - pmpost -tex etex > /dev/null 2>&1 - CHECK_RESULT $? 0 0 "pmpost命令-tex参数指定TeX程序失败" - - # 清理环境,如果测试前未安装,则卸载软件包 - if [ "$INSTALLED" = false ]; then - LOG_INFO "卸载texlive-ptex软件包" - dnf remove -y texlive-ptex - CHECK_RESULT $? 0 0 "卸载texlive-ptex软件包失败" - fi - - LOG_INFO "测试完成" -} - -main "$@" \ No newline at end of file diff --git a/testcases/function_test/pkg_test/texlive-base/texlive-ptex/test_texlive-ptex_pmpost_troff.sh b/testcases/function_test/pkg_test/texlive-base/texlive-ptex/test_texlive-ptex_pmpost_troff.sh deleted file mode 100644 index 9fa27d0a502..00000000000 --- a/testcases/function_test/pkg_test/texlive-base/texlive-ptex/test_texlive-ptex_pmpost_troff.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-08 -# @License : Mulan PSL v2 -# @Desc : 测试 pmpost 命令的 -troff 参数,用于设置 prologues:=1 并假定 TEXPROGRAM 实际为 troff -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - # 测试脚本:test_texlive-ptex_pmpost_troff - # 测试用例描述:测试 pmpost 命令的 -troff 参数,用于设置 prologues:=1 并假定 TEXPROGRAM 实际为 troff - - # 定义软件包名称 - PACKAGE_NAME="texlive-ptex" - - # 检查是否已安装软件包 - LOG_INFO "检查是否已安装 $PACKAGE_NAME 软件包..." - if dnf list installed "$PACKAGE_NAME" &>/dev/null; then - LOG_INFO "$PACKAGE_NAME 已安装,脚本结束后保持安装状态。" - INSTALLED_BEFORE="true" - else - LOG_INFO "$PACKAGE_NAME 未安装,将在测试中安装并在结束时卸载。" - INSTALLED_BEFORE="false" - fi - - # 检查yum源中是否有该软件包 - LOG_INFO "检查yum源中是否有 $PACKAGE_NAME 软件包..." - if ! dnf search "$PACKAGE_NAME" 2>/dev/null | grep -q "^$PACKAGE_NAME\."; then - LOG_ERROR "yum源中未找到 $PACKAGE_NAME 软件包,退出。" - exit 255 - fi - - # 如果未安装,则安装软件包 - if [ "$INSTALLED_BEFORE" = "false" ]; then - LOG_INFO "安装 $PACKAGE_NAME 软件包..." - dnf install -y "$PACKAGE_NAME" - CHECK_RESULT $? 0 0 "安装 $PACKAGE_NAME 失败" - fi - - # 验证 pmpost 命令是否存在 - LOG_INFO "验证 pmpost 命令是否存在..." - if ! command -v pmpost &>/dev/null; then - LOG_ERROR "pmpost 命令不存在,退出。" - exit 255 - fi - - # 测试 pmpost 命令的 -troff 参数 - LOG_INFO "测试 pmpost 命令的 -troff 参数..." - pmpost -troff --help 2>&1 | grep -q "prologues:=1" - CHECK_RESULT $? 0 0 "pmpost 命令不支持 -troff 参数" - - # 执行 pmpost 命令的 -troff 参数 - LOG_INFO "执行 pmpost 命令的 -troff 参数..." - pmpost -troff << "EOF" - verbatimtex - \input troff - etex - beginfig(1); - draw (0,0)--(10,10); - label.top(btex test etex, (5,5)); - endfig; - bye; - EOF - CHECK_RESULT $? 0 0 "执行 pmpost 命令的 -troff 参数失败" - - # 环境恢复:如果之前未安装,则卸载软件包 - 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-ptex/test_texlive-ptex_pmpost_upper_t.sh b/testcases/function_test/pkg_test/texlive-base/texlive-ptex/test_texlive-ptex_pmpost_upper_t.sh deleted file mode 100644 index 0fc4d4b20ab..00000000000 --- a/testcases/function_test/pkg_test/texlive-base/texlive-ptex/test_texlive-ptex_pmpost_upper_t.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-08 -# @License : Mulan PSL v2 -# @Desc : 测试 pmpost 命令的 -T 参数,功能同 -troff -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - # 检查是否已安装texlive-ptex - LOG_INFO "检查是否已安装texlive-ptex" - rpm -q texlive-ptex > /dev/null 2>&1 - if [ $? -eq 0 ]; then - LOG_INFO "texlive-ptex已安装,测试结束后将保持安装状态" - INSTALLED_FLAG=1 - else - LOG_INFO "texlive-ptex未安装,将在测试前安装" - INSTALLED_FLAG=0 - fi - - # 检查yum源中是否有texlive-ptex软件包 - LOG_INFO "检查yum源中是否有texlive-ptex软件包" - dnf list texlive-ptex > /dev/null 2>&1 - CHECK_RESULT $? 0 0 "yum源中未找到texlive-ptex软件包" - if [ $? -ne 0 ]; then - LOG_ERROR "yum源中未找到texlive-ptex软件包" - exit 255 - fi - - # 如果未安装,则安装texlive-ptex - if [ ${INSTALLED_FLAG} -eq 0 ]; then - LOG_INFO "安装texlive-ptex软件包" - dnf install -y texlive-ptex > /dev/null 2>&1 - CHECK_RESULT $? 0 0 "安装texlive-ptex失败" - fi - - # 检查pmpost命令是否存在 - LOG_INFO "检查pmpost命令是否存在" - which pmpost > /dev/null 2>&1 - CHECK_RESULT $? 0 0 "pmpost命令不存在" - - # 测试pmpost命令的-T参数是否存在 - LOG_INFO "测试pmpost命令的-T参数是否存在" - pmpost -T --help > /dev/null 2>&1 - if [ $? -eq 255 ]; then - LOG_ERROR "pmpost命令不支持-T参数" - exit 255 - fi - - # 创建一个简单的测试文件 - LOG_INFO "创建一个简单的测试文件" - cat > test_input.pm << "EOF" - This is a test file for pmpost. - EOF - CHECK_RESULT $? 0 0 "创建测试文件失败" - - # 测试pmpost命令的-T参数功能同-troff - LOG_INFO "测试pmpost命令的-T参数功能同-troff" - pmpost -T test_input.pm > test_output_troff 2>&1 - CHECK_RESULT $? 0 0 "pmpost -T命令执行失败" - - # 清理测试文件 - LOG_INFO "清理测试文件" - rm -f test_input.pm test_output_troff - CHECK_RESULT $? 0 0 "清理测试文件失败" - - # 如果测试前未安装,则在测试结束后卸载texlive-ptex - if [ ${INSTALLED_FLAG} -eq 0 ]; then - LOG_INFO "卸载texlive-ptex软件包" - dnf remove -y texlive-ptex > /dev/null 2>&1 - CHECK_RESULT $? 0 0 "卸载texlive-ptex失败" - else - LOG_INFO "测试前已安装texlive-ptex,保持安装状态" - fi - - LOG_INFO "测试完成" -} - -main "$@" \ No newline at end of file diff --git a/testcases/function_test/pkg_test/texlive-base/texlive-ptex/test_texlive-ptex_pmpost_version.sh b/testcases/function_test/pkg_test/texlive-base/texlive-ptex/test_texlive-ptex_pmpost_version.sh deleted file mode 100644 index 5070e3a50e4..00000000000 --- a/testcases/function_test/pkg_test/texlive-base/texlive-ptex/test_texlive-ptex_pmpost_version.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-08 -# @License : Mulan PSL v2 -# @Desc : 测试 pmpost 命令的 -version 参数,用于输出版本信息并退出 -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - # 检查是否已经安装了texlive-ptex软件包 - LOG_INFO "检查texlive-ptex软件包是否已经安装" - rpm -q texlive-ptex > /dev/null 2>&1 - if [ $? -eq 0 ]; then - LOG_INFO "texlive-ptex已经安装,标记为已安装状态" - INSTALLED="true" - else - LOG_INFO "texlive-ptex未安装,标记为未安装状态" - INSTALLED="false" - fi - - # 检查yum源中是否有texlive-ptex软件包 - LOG_INFO "检查yum源中是否有texlive-ptex软件包" - dnf list available texlive-ptex > /dev/null 2>&1 - CHECK_RESULT $? 0 0 "yum源中没有texlive-ptex软件包" - if [ $? -ne 0 ]; then - LOG_ERROR "yum源中没有texlive-ptex软件包" - exit 255 - fi - - # 如果未安装,则安装texlive-ptex软件包 - if [ "$INSTALLED" = "false" ]; then - LOG_INFO "开始安装texlive-ptex软件包" - dnf install -y texlive-ptex - CHECK_RESULT $? 0 0 "安装texlive-ptex软件包失败" - if [ $? -ne 0 ]; then - LOG_ERROR "安装texlive-ptex软件包失败" - exit 1 - fi - LOG_INFO "texlive-ptex软件包安装成功" - fi - - # 测试pmpost命令的-version参数 - LOG_INFO "测试pmpost命令的-version参数" - pmpost -version > /dev/null 2>&1 - CHECK_RESULT $? 0 0 "pmpost命令不支持-version参数" - if [ $? -ne 0 ]; then - LOG_ERROR "pmpost命令不支持-version参数" - # 如果是未安装状态,则卸载软件包 - if [ "$INSTALLED" = "false" ]; then - LOG_INFO "开始卸载texlive-ptex软件包" - dnf remove -y texlive-ptex - CHECK_RESULT $? 0 0 "卸载texlive-ptex软件包失败" - if [ $? -ne 0 ]; then - LOG_ERROR "卸载texlive-ptex软件包失败" - exit 1 - fi - LOG_INFO "texlive-ptex软件包卸载成功" - fi - exit 255 - fi - - # 执行pmpost -version命令并检查输出 - LOG_INFO "执行pmpost -version命令" - VERSION_OUTPUT=$(pmpost -version 2>&1) - CHECK_RESULT $? 0 0 "执行pmpost -version命令失败" - if [ $? -ne 0 ]; then - LOG_ERROR "执行pmpost -version命令失败" - # 如果是未安装状态,则卸载软件包 - if [ "$INSTALLED" = "false" ]; then - LOG_INFO "开始卸载texlive-ptex软件包" - dnf remove -y texlive-ptex - CHECK_RESULT $? 0 0 "卸载texlive-ptex软件包失败" - if [ $? -ne 0 ]; then - LOG_ERROR "卸载texlive-ptex软件包失败" - exit 1 - fi - LOG_INFO "texlive-ptex软件包卸载成功" - fi - exit 1 - fi - - # 检查输出是否包含版本信息 - LOG_INFO "检查pmpost -version输出是否包含版本信息" - echo "$VERSION_OUTPUT" | grep -E "[0-9]+\.[0-9]+" > /dev/null 2>&1 - CHECK_RESULT $? 0 0 "pmpost -version输出不包含版本信息" - if [ $? -ne 0 ]; then - LOG_ERROR "pmpost -version输出不包含版本信息" - # 如果是未安装状态,则卸载软件包 - if [ "$INSTALLED" = "false" ]; then - LOG_INFO "开始卸载texlive-ptex软件包" - dnf remove -y texlive-ptex - CHECK_RESULT $? 0 0 "卸载texlive-ptex软件包失败" - if [ $? -ne 0 ]; then - LOG_ERROR "卸载texlive-ptex软件包失败" - exit 1 - fi - LOG_INFO "texlive-ptex软件包卸载成功" - fi - exit 1 - fi - - LOG_INFO "pmpost -version测试成功,输出版本信息" - - # 环境恢复:如果之前未安装,则卸载软件包 - if [ "$INSTALLED" = "false" ]; then - LOG_INFO "开始卸载texlive-ptex软件包" - dnf remove -y texlive-ptex - CHECK_RESULT $? 0 0 "卸载texlive-ptex软件包失败" - if [ $? -ne 0 ]; then - LOG_ERROR "卸载texlive-ptex软件包失败" - exit 1 - fi - LOG_INFO "texlive-ptex软件包卸载成功" - fi - - LOG_INFO "测试脚本执行完毕,环境已恢复" -} - -main "$@" \ No newline at end of file diff --git a/testcases/function_test/pkg_test/texlive-base/texlive-ptex/test_texlive-ptex_ppltotf_default_tfm.sh b/testcases/function_test/pkg_test/texlive-base/texlive-ptex/test_texlive-ptex_ppltotf_default_tfm.sh deleted file mode 100644 index 67e58deeb4e..00000000000 --- a/testcases/function_test/pkg_test/texlive-base/texlive-ptex/test_texlive-ptex_ppltotf_default_tfm.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-08 -# @License : Mulan PSL v2 -# @Desc : 测试 ppltotf 命令使用默认输出 TFM 文件名 -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - # 定义测试变量 - TEST_PACKAGE="texlive-ptex" - TEST_COMMAND="ppltotf" - TEST_FILE="test.tex" - - # 步骤1:检查yum源中是否存在指定软件包 - LOG_INFO "步骤1:检查yum源中是否存在${TEST_PACKAGE}软件包" - dnf list available ${TEST_PACKAGE} &>/dev/null - if [ $? -ne 0 ]; then - LOG_ERROR "yum源中不存在${TEST_PACKAGE}软件包" - exit 255 - fi - CHECK_RESULT $? 0 0 "检查yum源中软件包失败" - - # 步骤2:检查系统是否已安装指定软件包 - LOG_INFO "步骤2:检查系统是否已安装${TEST_PACKAGE}软件包" - rpm -q ${TEST_PACKAGE} &>/dev/null - IS_INSTALLED=$? - - if [ ${IS_INSTALLED} -eq 0 ]; then - LOG_INFO "系统已安装${TEST_PACKAGE}软件包,测试完成后将保持安装状态" - NEED_CLEANUP=0 - else - LOG_INFO "系统未安装${TEST_PACKAGE}软件包,测试完成后将卸载" - NEED_CLEANUP=1 - fi - - # 步骤3:安装软件包(如果未安装) - if [ ${NEED_CLEANUP} -eq 1 ]; then - LOG_INFO "步骤3:安装${TEST_PACKAGE}软件包" - dnf install -y ${TEST_PACKAGE} - CHECK_RESULT $? 0 0 "安装${TEST_PACKAGE}软件包失败" - fi - - # 步骤4:检查ppltotf命令是否存在 - LOG_INFO "步骤4:检查${TEST_COMMAND}命令是否存在" - which ${TEST_COMMAND} &>/dev/null - CHECK_RESULT $? 0 0 "${TEST_COMMAND}命令不存在" - - # 步骤5:创建测试文件 - LOG_INFO "步骤5:创建测试文件${TEST_FILE}" - cat > ${TEST_FILE} << "EOF" - \font\test=cmr10 - \bye - EOF - CHECK_RESULT $? 0 0 "创建测试文件失败" - - # 步骤6:测试ppltotf命令使用默认输出TFM文件名 - LOG_INFO "步骤6:测试${TEST_COMMAND}命令使用默认输出TFM文件名" - ${TEST_COMMAND} ${TEST_FILE} cmr10 - CHECK_RESULT $? 0 0 "ppltotf命令执行失败" - - # 步骤7:验证生成的TFM文件 - LOG_INFO "步骤7:验证生成的TFM文件" - if [ -f "cmr10.tfm" ]; then - LOG_INFO "成功生成默认TFM文件:cmr10.tfm" - CHECK_RESULT 0 0 0 "TFM文件生成验证" - else - LOG_ERROR "未生成默认TFM文件:cmr10.tfm" - CHECK_RESULT 1 0 1 "TFM文件生成验证失败" - fi - - # 步骤8:清理测试文件 - LOG_INFO "步骤8:清理测试文件" - rm -f ${TEST_FILE} cmr10.tfm cmr10.vf cmr10.600pk cmr10.log - CHECK_RESULT $? 0 0 "清理测试文件失败" - - # 步骤9:恢复环境(如果测试前未安装) - if [ ${NEED_CLEANUP} -eq 1 ]; then - LOG_INFO "步骤9:卸载${TEST_PACKAGE}软件包" - dnf remove -y ${TEST_PACKAGE} - CHECK_RESULT $? 0 0 "卸载${TEST_PACKAGE}软件包失败" - else - LOG_INFO "步骤9:保持${TEST_PACKAGE}软件包安装状态" - fi - - LOG_INFO "测试完成:ppltotf命令使用默认输出TFM文件名测试通过" -} - -main "$@" \ No newline at end of file diff --git a/testcases/function_test/pkg_test/texlive-base/texlive-ptex/test_texlive-ptex_ppltotf_kanji_euc.sh b/testcases/function_test/pkg_test/texlive-base/texlive-ptex/test_texlive-ptex_ppltotf_kanji_euc.sh deleted file mode 100644 index c5f4ee784f1..00000000000 --- a/testcases/function_test/pkg_test/texlive-base/texlive-ptex/test_texlive-ptex_ppltotf_kanji_euc.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-08 -# @License : Mulan PSL v2 -# @Desc : 测试 ppltotf 命令设置日文编码为 euc -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - LOG_INFO "开始测试ppltotf命令设置日文编码为euc" - - # 检查是否已安装texlive-ptex包 - LOG_INFO "步骤1:检查texlive-ptex是否已安装" - if rpm -q texlive-ptex > /dev/null 2>&1; then - LOG_INFO "texlive-ptex已安装,测试后保持安装状态" - INSTALLED="true" - else - LOG_INFO "texlive-ptex未安装,将在测试中安装" - INSTALLED="false" - fi - - # 检查yum源中是否有texlive-ptex包 - LOG_INFO "步骤2:检查yum源中是否有texlive-ptex包" - if ! dnf list available texlive-ptex > /dev/null 2>&1; then - LOG_ERROR "yum源中未找到texlive-ptex包" - exit 255 - fi - - # 如果未安装,则安装texlive-ptex - if [ "$INSTALLED" = "false" ]; then - LOG_INFO "步骤3:安装texlive-ptex" - dnf install -y texlive-ptex - CHECK_RESULT $? 0 0 "安装texlive-ptex失败" - fi - - # 检查ppltotf命令是否存在 - LOG_INFO "步骤4:检查ppltotf命令是否存在" - command -v ppltotf > /dev/null 2>&1 - CHECK_RESULT $? 0 0 "ppltotf命令不存在" - - # 测试ppltotf命令设置日文编码为euc - LOG_INFO "步骤5:测试ppltotf命令设置日文编码为euc" - ppltotf -kanji=euc test.pl test.tfm - CHECK_RESULT $? 0 0 "ppltotf命令设置日文编码为euc失败" - - # 清理测试文件 - LOG_INFO "步骤6:清理测试生成的文件" - rm -f test.pl test.tfm - - # 如果测试前未安装,则卸载texlive-ptex - if [ "$INSTALLED" = "false" ]; then - LOG_INFO "步骤7:卸载texlive-ptex包" - dnf remove -y texlive-ptex - CHECK_RESULT $? 0 0 "卸载texlive-ptex失败" - fi - - LOG_INFO "测试完成" -} - -main "$@" \ No newline at end of file diff --git a/testcases/function_test/pkg_test/texlive-base/texlive-ptex/test_texlive-ptex_ppltotf_kanji_jis.sh b/testcases/function_test/pkg_test/texlive-base/texlive-ptex/test_texlive-ptex_ppltotf_kanji_jis.sh deleted file mode 100644 index ebc93c6a0f1..00000000000 --- a/testcases/function_test/pkg_test/texlive-base/texlive-ptex/test_texlive-ptex_ppltotf_kanji_jis.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-08 -# @License : Mulan PSL v2 -# @Desc : 测试 ppltotf 命令设置日文编码为 jis -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - # 定义变量 - PACKAGE_NAME="texlive-ptex" - COMMAND="ppltotf" - ENCODING_PARAM="--kanji=jis" - - # 步骤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 未安装" - 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:检查 ppltotf 命令是否支持 --kanji=jis 参数 - LOG_INFO "步骤4:检查 ppltotf 命令是否支持 --kanji=jis 参数" - $COMMAND --help 2>&1 | grep -q "$ENCODING_PARAM" - if [ $? -ne 0 ]; then - LOG_ERROR "ppltotf 命令不支持 $ENCODING_PARAM 参数" - # 清理环境:如果之前未安装,则卸载软件包 - if [ "$INSTALLED" = false ]; then - LOG_INFO "清理环境:卸载软件包 $PACKAGE_NAME" - dnf remove -y "$PACKAGE_NAME" - fi - exit 255 - fi - - # 步骤5:测试 ppltotf 命令设置日文编码为 jis - LOG_INFO "步骤5:测试 ppltotf 命令设置日文编码为 jis" - # 创建一个简单的测试输入文件 - TEST_INPUT="test_input.tex" - echo "% Test file for ppltotf" > "$TEST_INPUT" - echo "test" >> "$TEST_INPUT" - - # 执行 ppltotf 命令 - $COMMAND $ENCODING_PARAM "$TEST_INPUT" "test_output" - CHECK_RESULT $? 0 0 "ppltotf 命令执行失败" - - # 步骤6:清理测试文件 - LOG_INFO "步骤6:清理测试文件" - rm -f "$TEST_INPUT" test_output.* - - # 步骤7:恢复环境 - LOG_INFO "步骤7:恢复环境" - 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-ptex/test_texlive-ptex_ppltotf_kanji_sjis.sh b/testcases/function_test/pkg_test/texlive-base/texlive-ptex/test_texlive-ptex_ppltotf_kanji_sjis.sh deleted file mode 100644 index 230488ebb65..00000000000 --- a/testcases/function_test/pkg_test/texlive-base/texlive-ptex/test_texlive-ptex_ppltotf_kanji_sjis.sh +++ /dev/null @@ -1,135 +0,0 @@ -#!/usr/bin/bash - -# Copyright (c) 2024 ISCAS .ALL rights reserved. -# This program is licensed under Mulan PSL v2. -# You can use it according to the terms and conditions of the Mulan PSL v2. -# http://license.coscl.org.cn/MulanPSL2 -# THIS PROGRAM IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, -# EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, -# MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. -# See the Mulan PSL v2 for more details. - -# ############################################# -# @Author : honghua -# @Contact : honghua@iscas.ac.cn -# @Date : 2026-03-08 -# @License : Mulan PSL v2 -# @Desc : 测试 ppltotf 命令设置日文编码为 sjis -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - # 定义日志函数 - LOG_INFO() { - echo "[INFO] $1" - } - - LOG_ERROR() { - echo "[ERROR] $1" - } - - # 定义检查函数 - CHECK_RESULT() { - if [ $# -lt 4 ]; then - LOG_ERROR "CHECK_RESULT函数参数不足" - exit 255 - fi - 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_CMD函数(示例,实际需根据环境实现) - SSH_CMD() { - local cmd=$1 - local ip=$2 - local password=$3 - local user=$4 - # 这里仅为示例,实际应根据环境使用sshpass或其他方式 - sshpass -p "$password" ssh -o StrictHostKeyChecking=no "$user@$ip" "$cmd" - } - - # 主测试函数 - main() { - LOG_INFO "开始测试ppltotf命令设置日文编码为sjis" - - # 检查yum源中是否有texlive-ptex软件包 - LOG_INFO "检查yum源中是否有texlive-ptex软件包" - dnf list available texlive-ptex 2>/dev/null | grep -q texlive-ptex - if [ $? -ne 0 ]; then - LOG_ERROR "yum源中未找到texlive-ptex软件包" - exit 255 - fi - - # 判断是否已安装texlive-ptex - LOG_INFO "检查是否已安装texlive-ptex" - rpm -q texlive-ptex >/dev/null 2>&1 - local installed=$? - if [ $installed -eq 0 ]; then - LOG_INFO "texlive-ptex已安装,测试结束后保持安装状态" - else - LOG_INFO "texlive-ptex未安装,开始安装" - dnf install -y texlive-ptex - CHECK_RESULT $? 0 255 "安装texlive-ptex失败" - fi - - # 检查ppltotf命令是否存在 - LOG_INFO "检查ppltotf命令是否存在" - command -v ppltotf >/dev/null 2>&1 - CHECK_RESULT $? 0 255 "ppltotf命令不存在" - - # 测试ppltotf命令设置日文编码为sjis - LOG_INFO "测试ppltotf命令设置日文编码为sjis" - # 创建一个简单的测试文件 - cat > test.tex << "EOF" - \documentclass{article} - \usepackage{ptex} - \begin{document} - 日本語テスト - \end{document} - EOF - # 尝试使用sjis编码 - ppltotf -kanji=sjis test.tex test.tfm 2>&1 - local ppltotf_result=$? - if [ $ppltotf_result -eq 0 ]; then - LOG_INFO "ppltotf命令成功执行" - # 检查生成的tfm文件 - if [ -f test.tfm ]; then - LOG_INFO "成功生成test.tfm文件" - else - LOG_ERROR "未生成test.tfm文件" - ppltotf_result=1 - fi - else - LOG_ERROR "ppltotf命令执行失败" - fi - - # 清理测试文件 - LOG_INFO "清理测试文件" - rm -f test.tex test.tfm - - # 根据安装状态决定是否卸载 - if [ $installed -ne 0 ]; then - LOG_INFO "卸载texlive-ptex软件包" - dnf remove -y texlive-ptex - CHECK_RESULT $? 0 1 "卸载texlive-ptex失败" - else - LOG_INFO "保持texlive-ptex安装状态" - fi - - # 最终检查 - CHECK_RESULT $ppltotf_result 0 1 "ppltotf命令测试失败" - LOG_INFO "测试ppltotf命令设置日文编码为sjis成功" - } - - # 执行主函数 - main -} - -main "$@" \ No newline at end of file diff --git a/testcases/function_test/pkg_test/texlive-base/texlive-ptex/test_texlive-ptex_ppltotf_kanji_utf8.sh b/testcases/function_test/pkg_test/texlive-base/texlive-ptex/test_texlive-ptex_ppltotf_kanji_utf8.sh deleted file mode 100644 index 5d2daea76dc..00000000000 --- a/testcases/function_test/pkg_test/texlive-base/texlive-ptex/test_texlive-ptex_ppltotf_kanji_utf8.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-08 -# @License : Mulan PSL v2 -# @Desc : 测试 ppltotf 命令设置日文编码为 utf8 -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - # 检查是否已安装texlive-ptex软件包 - LOG_INFO "检查是否已安装texlive-ptex软件包" - rpm -q texlive-ptex > /dev/null 2>&1 - if [ $? -eq 0 ]; then - LOG_INFO "texlive-ptex已安装,测试结束后将保持安装状态" - INSTALLED=1 - else - LOG_INFO "texlive-ptex未安装,将在测试中安装,测试结束后卸载" - INSTALLED=0 - fi - - # 检查yum源中是否有texlive-ptex软件包 - LOG_INFO "检查yum源中是否有texlive-ptex软件包" - dnf list available texlive-ptex > /dev/null 2>&1 - CHECK_RESULT $? 0 0 "yum源中未找到texlive-ptex软件包" - if [ $? -ne 0 ]; then - LOG_ERROR "yum源中未找到texlive-ptex软件包" - exit 255 - fi - - # 如果未安装,则安装texlive-ptex - if [ $INSTALLED -eq 0 ]; then - LOG_INFO "安装texlive-ptex软件包" - dnf install -y texlive-ptex - CHECK_RESULT $? 0 0 "安装texlive-ptex失败" - fi - - # 检查ppltotf命令是否存在 - LOG_INFO "检查ppltotf命令是否存在" - which ppltotf > /dev/null 2>&1 - CHECK_RESULT $? 0 0 "ppltotf命令不存在" - - # 检查ppltotf命令是否支持-kanji=utf8参数 - LOG_INFO "检查ppltotf命令是否支持-kanji=utf8参数" - ppltotf -kanji=utf8 --help > /dev/null 2>&1 - if [ $? -eq 255 ]; then - LOG_ERROR "ppltotf命令不支持-kanji=utf8参数" - exit 255 - fi - - # 创建一个简单的测试输入文件 - LOG_INFO "创建测试输入文件test_input.tex" - cat > test_input.tex << "EOF" - \font\testfont=ptex - \testfont - Hello, 世界 - EOF - - # 使用ppltotf命令设置日文编码为utf8进行测试 - LOG_INFO "使用ppltotf命令设置日文编码为utf8进行测试" - ppltotf -kanji=utf8 test_input.tex test_output > test_ppltotf.log 2>&1 - CHECK_RESULT $? 0 0 "ppltotf命令执行失败" - - # 检查生成的输出文件是否存在 - LOG_INFO "检查生成的输出文件是否存在" - ls test_output.tfm > /dev/null 2>&1 - CHECK_RESULT $? 0 0 "未生成预期的输出文件" - - # 清理测试文件 - LOG_INFO "清理测试文件" - rm -f test_input.tex test_output.tfm test_ppltotf.log - - # 如果测试前未安装,则卸载texlive-ptex - if [ $INSTALLED -eq 0 ]; then - LOG_INFO "卸载texlive-ptex软件包" - dnf remove -y texlive-ptex - CHECK_RESULT $? 0 0 "卸载texlive-ptex失败" - fi - - LOG_INFO "测试完成" -} - -main "$@" \ No newline at end of file diff --git a/testcases/function_test/pkg_test/texlive-base/texlive-ptex/test_texlive-ptex_ppltotf_specified_tfm.sh b/testcases/function_test/pkg_test/texlive-base/texlive-ptex/test_texlive-ptex_ppltotf_specified_tfm.sh deleted file mode 100644 index 107be1fc4c9..00000000000 --- a/testcases/function_test/pkg_test/texlive-base/texlive-ptex/test_texlive-ptex_ppltotf_specified_tfm.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-08 -# @License : Mulan PSL v2 -# @Desc : 测试 ppltotf 命令指定输出 TFM 文件名 -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - LOG_INFO "开始测试 ppltotf 命令指定输出 TFM 文件名" - LOG_INFO "步骤1: 检查 yum 源中是否存在 texlive-ptex 软件包" - dnf list available texlive-ptex 2>&1 | grep -q "texlive-ptex" - if [ $? -ne 0 ]; then - LOG_ERROR "yum 源中未找到 texlive-ptex 软件包" - exit 255 - fi - - LOG_INFO "步骤2: 检查是否已安装 texlive-ptex" - rpm -q texlive-ptex > /dev/null 2>&1 - if [ $? -eq 0 ]; then - LOG_INFO "texlive-ptex 已安装,测试完成后将保持安装状态" - INSTALLED=1 - else - LOG_INFO "texlive-ptex 未安装,将进行安装" - INSTALLED=0 - LOG_INFO "步骤3: 安装 texlive-ptex" - dnf install -y texlive-ptex - CHECK_RESULT $? 0 0 "安装 texlive-ptex 失败" - fi - - LOG_INFO "步骤4: 创建一个简单的 .pl 文件用于测试" - cat > test_font.pl << "EOF" - (FONTDIMEN - (SLANT R 0.0) - (SPACE R 0.0) - (STRETCH R 0.0) - (SHRINK R 0.0) - (XHEIGHT R 0.0) - (QUAD R 1.0) - (EXTRASPACE R 0.0) - ) - (CHARACTER O 0 - (CHARWD R 0.5) - (CHARHT R 0.5) - ) - EOF - CHECK_RESULT $? 0 0 "创建 test_font.pl 文件失败" - - LOG_INFO "步骤5: 执行 ppltotf 命令,指定输出 TFM 文件名为 specified_output.tfm" - ppltotf test_font.pl specified_output.tfm - CHECK_RESULT $? 0 0 "ppltotf 命令执行失败" - - LOG_INFO "步骤6: 检查指定的 TFM 文件是否生成" - if [ -f "specified_output.tfm" ]; then - LOG_INFO "成功生成指定的 TFM 文件 specified_output.tfm" - else - LOG_ERROR "未找到指定的 TFM 文件 specified_output.tfm" - exit 1 - fi - - LOG_INFO "步骤7: 清理测试文件" - rm -f test_font.pl specified_output.tfm - CHECK_RESULT $? 0 0 "清理测试文件失败" - - if [ $INSTALLED -eq 0 ]; then - LOG_INFO "步骤8: 卸载 texlive-ptex 软件包" - dnf remove -y texlive-ptex - CHECK_RESULT $? 0 0 "卸载 texlive-ptex 失败" - fi - - LOG_INFO "测试完成" -} - -main "$@" \ No newline at end of file diff --git a/testcases/function_test/pkg_test/texlive-base/texlive-ptex/test_texlive-ptex_ppltotf_verbose.sh b/testcases/function_test/pkg_test/texlive-base/texlive-ptex/test_texlive-ptex_ppltotf_verbose.sh deleted file mode 100644 index 0a18323e16a..00000000000 --- a/testcases/function_test/pkg_test/texlive-base/texlive-ptex/test_texlive-ptex_ppltotf_verbose.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-08 -# @License : Mulan PSL v2 -# @Desc : 测试 ppltotf 命令的详细输出模式 -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - # 定义软件包名称和命令 - PACKAGE_NAME="texlive-ptex" - COMMAND="ppltotf" - OPTION="--verbose" - - # 步骤1:检查软件包是否已在yum源中 - LOG_INFO "检查软件包 ${PACKAGE_NAME} 是否在yum源中" - dnf list available ${PACKAGE_NAME} &>/dev/null - if [ $? -ne 0 ]; then - LOG_ERROR "软件包 ${PACKAGE_NAME} 不在yum源中,退出测试" - exit 255 - fi - CHECK_RESULT $? 0 0 "检查软件包是否在yum源中失败" - - # 步骤2:检查当前环境是否已安装软件包 - LOG_INFO "检查当前环境是否已安装软件包 ${PACKAGE_NAME}" - rpm -q ${PACKAGE_NAME} &>/dev/null - INSTALLED=$? - - # 步骤3:如果未安装,则安装软件包 - if [ ${INSTALLED} -ne 0 ]; then - LOG_INFO "软件包 ${PACKAGE_NAME} 未安装,开始安装" - dnf install -y ${PACKAGE_NAME} - CHECK_RESULT $? 0 0 "安装软件包 ${PACKAGE_NAME} 失败" - else - LOG_INFO "软件包 ${PACKAGE_NAME} 已安装,跳过安装步骤" - fi - - # 步骤4:检查命令是否存在 - LOG_INFO "检查命令 ${COMMAND} 是否存在" - command -v ${COMMAND} &>/dev/null - CHECK_RESULT $? 0 0 "命令 ${COMMAND} 不存在" - - # 步骤5:检查命令是否支持 --verbose 参数 - LOG_INFO "检查命令 ${COMMAND} 是否支持 ${OPTION} 参数" - ${COMMAND} ${OPTION} --help &>/dev/null 2>&1 - if [ $? -eq 255 ]; then - LOG_ERROR "命令 ${COMMAND} 不支持 ${OPTION} 参数,退出测试" - exit 255 - fi - CHECK_RESULT $? 0 0 "检查命令参数支持失败" - - # 步骤6:测试命令的详细输出模式 - LOG_INFO "测试命令 ${COMMAND} 的详细输出模式" - ${COMMAND} ${OPTION} --help - CHECK_RESULT $? 0 0 "测试命令详细输出模式失败" - - # 步骤7:清理环境 - LOG_INFO "清理测试环境" - if [ ${INSTALLED} -ne 0 ]; then - LOG_INFO "卸载在测试过程中安装的软件包 ${PACKAGE_NAME}" - dnf remove -y ${PACKAGE_NAME} - CHECK_RESULT $? 0 0 "卸载软件包 ${PACKAGE_NAME} 失败" - else - LOG_INFO "软件包 ${PACKAGE_NAME} 在测试前已安装,保持安装状态" - fi - - LOG_INFO "测试脚本执行完成" -} - -main "$@" \ No newline at end of file diff --git a/testcases/function_test/pkg_test/texlive-base/texlive-ptex/test_texlive-ptex_ppltotf_version.sh b/testcases/function_test/pkg_test/texlive-base/texlive-ptex/test_texlive-ptex_ppltotf_version.sh deleted file mode 100644 index 2f595113581..00000000000 --- a/testcases/function_test/pkg_test/texlive-base/texlive-ptex/test_texlive-ptex_ppltotf_version.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-08 -# @License : Mulan PSL v2 -# @Desc : 测试 ppltotf 命令的版本信息显示 -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - # 测试 ppltotf 命令的版本信息显示 - - LOG_INFO "1. 检查 yum 源中是否存在 texlive-ptex 软件包" - dnf list available texlive-ptex > /dev/null 2>&1 - if [ $? -ne 0 ]; then - LOG_ERROR "yum 源中不存在 texlive-ptex 软件包" - exit 255 - fi - - LOG_INFO "2. 检查系统是否已安装 texlive-ptex" - rpm -q texlive-ptex > /dev/null 2>&1 - if [ $? -eq 0 ]; then - LOG_INFO "texlive-ptex 已安装,标记为已存在" - ALREADY_INSTALLED=1 - else - LOG_INFO "texlive-ptex 未安装,标记为未存在" - ALREADY_INSTALLED=0 - fi - - if [ $ALREADY_INSTALLED -eq 0 ]; then - LOG_INFO "3. 安装 texlive-ptex 软件包" - dnf install -y texlive-ptex - CHECK_RESULT $? 0 0 "安装 texlive-ptex 失败" - fi - - LOG_INFO "4. 检查 ppltotf 命令是否存在" - which ppltotf > /dev/null 2>&1 - if [ $? -ne 0 ]; then - LOG_ERROR "ppltotf 命令不存在" - if [ $ALREADY_INSTALLED -eq 0 ]; then - LOG_INFO "清理环境:卸载 texlive-ptex" - dnf remove -y texlive-ptex - fi - exit 255 - fi - - LOG_INFO "5. 检查 ppltotf 命令是否支持 --version 参数" - ppltotf --help 2>&1 | grep -q "\-\-version" - if [ $? -ne 0 ]; then - LOG_ERROR "ppltotf 命令不支持 --version 参数" - if [ $ALREADY_INSTALLED -eq 0 ]; then - LOG_INFO "清理环境:卸载 texlive-ptex" - dnf remove -y texlive-ptex - fi - exit 255 - fi - - LOG_INFO "6. 执行 ppltotf --version 命令" - ppltotf --version - CHECK_RESULT $? 0 0 "执行 ppltotf --version 命令失败" - - LOG_INFO "7. 检查版本信息是否正常显示" - ppltotf --version 2>&1 | grep -q "ppltotf" - CHECK_RESULT $? 0 0 "版本信息显示异常" - - LOG_INFO "8. 环境恢复" - if [ $ALREADY_INSTALLED -eq 0 ]; then - LOG_INFO "清理环境:卸载 texlive-ptex" - dnf remove -y texlive-ptex - CHECK_RESULT $? 0 0 "卸载 texlive-ptex 失败" - else - LOG_INFO "保持 texlive-ptex 安装状态" - fi - - LOG_INFO "9. 测试完成" -} - -main "$@" \ No newline at end of file diff --git a/testcases/function_test/pkg_test/texlive-base/texlive-ptex/test_texlive-ptex_ptex_file_line_error.sh b/testcases/function_test/pkg_test/texlive-base/texlive-ptex/test_texlive-ptex_ptex_file_line_error.sh deleted file mode 100644 index 164f369f36f..00000000000 --- a/testcases/function_test/pkg_test/texlive-base/texlive-ptex/test_texlive-ptex_ptex_file_line_error.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-08 -# @License : Mulan PSL v2 -# @Desc : 测试ptex命令启用文件:行:错误样式消息 -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - # 判断是否已安装ptex - LOG_INFO "检查ptex是否已安装" - rpm -q ptex > /dev/null 2>&1 - INSTALLED=$? - - # 如果未安装,则安装ptex - if [ $INSTALLED -ne 0 ]; then - LOG_INFO "ptex未安装,准备安装" - # 检查yum源中是否有ptex包 - LOG_INFO "检查yum源中是否存在ptex包" - dnf list available ptex > /dev/null 2>&1 - CHECK_RESULT $? 0 0 "yum源中未找到ptex包" - if [ $? -ne 0 ]; then - LOG_ERROR "yum源中未找到ptex包,退出测试" - exit 255 - fi - # 安装ptex - LOG_INFO "开始安装ptex" - dnf install -y ptex - CHECK_RESULT $? 0 0 "安装ptex失败" - else - LOG_INFO "ptex已安装,跳过安装步骤" - fi - - # 测试ptex命令启用文件:行:错误样式消息 - LOG_INFO "测试ptex命令启用文件:行:错误样式消息" - # 创建一个简单的测试tex文件 - cat > test.tex << "EOF" - \documentclass{article} - \begin{document} - Hello, world! - \errorcommand - \end{document} - EOF - - # 运行ptex命令,启用文件:行:错误样式消息 - LOG_INFO "运行ptex命令处理测试文件" - ptex -file-line-error test.tex > output.log 2>&1 - # 检查ptex命令是否支持-file-line-error参数 - if [ $? -eq 255 ]; then - LOG_ERROR "ptex命令不支持-file-line-error参数" - exit 255 - fi - - # 检查输出中是否包含文件:行:错误样式消息 - LOG_INFO "检查输出中是否包含文件:行:错误样式消息" - grep -q "test.tex:[0-9]*:" output.log - CHECK_RESULT $? 0 0 "输出中未找到文件:行:错误样式消息" - - # 清理测试文件 - LOG_INFO "清理测试文件" - rm -f test.tex output.log - - # 如果脚本开始时未安装ptex,则在测试结束后卸载 - if [ $INSTALLED -ne 0 ]; then - LOG_INFO "卸载ptex" - dnf remove -y ptex - CHECK_RESULT $? 0 0 "卸载ptex失败" - else - LOG_INFO "保持ptex安装状态" - fi - - LOG_INFO "测试完成" -} - -main "$@" \ No newline at end of file diff --git a/testcases/function_test/pkg_test/texlive-base/texlive-ptex/test_texlive-ptex_ptex_fmt.sh b/testcases/function_test/pkg_test/texlive-base/texlive-ptex/test_texlive-ptex_ptex_fmt.sh deleted file mode 100644 index 8c1e1dd9ee8..00000000000 --- a/testcases/function_test/pkg_test/texlive-base/texlive-ptex/test_texlive-ptex_ptex_fmt.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-08 -# @License : Mulan PSL v2 -# @Desc : 测试ptex命令指定格式文件的功能 -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - set -e - - LOG_INFO "开始测试ptex命令指定格式文件的功能" - - LOG_INFO "步骤1:检查yum源中是否有texlive-ptex软件包" - dnf list available texlive-ptex > /dev/null 2>&1 - if [ $? -ne 0 ]; then - LOG_ERROR "yum源中未找到texlive-ptex软件包" - exit 255 - fi - - LOG_INFO "步骤2:检查当前环境是否已安装texlive-ptex" - rpm -q texlive-ptex > /dev/null 2>&1 - if [ $? -eq 0 ]; then - LOG_INFO "检测到texlive-ptex已安装,测试后将保持安装状态" - INSTALLED=1 - else - LOG_INFO "检测到texlive-ptex未安装,将在测试过程中安装" - INSTALLED=0 - fi - - if [ $INSTALLED -eq 0 ]; then - LOG_INFO "步骤3:安装texlive-ptex软件包" - dnf install -y texlive-ptex - CHECK_RESULT $? 0 0 "安装texlive-ptex失败" - fi - - LOG_INFO "步骤4:检查ptex命令是否支持-format参数" - ptex -help 2>&1 | grep -q -- "-format" - if [ $? -ne 0 ]; then - LOG_ERROR "ptex命令不支持-format参数" - if [ $INSTALLED -eq 0 ]; then - dnf remove -y texlive-ptex - fi - exit 255 - fi - - LOG_INFO "步骤5:创建一个简单的测试tex文件" - cat > test.tex << "EOF" - \documentclass{article} - \begin{document} - Hello, OpenEuler! - \end{document} - EOF - CHECK_RESULT $? 0 0 "创建测试tex文件失败" - - LOG_INFO "步骤6:使用ptex命令指定格式文件进行编译" - ptex -fmt latex test.tex - CHECK_RESULT $? 0 0 "ptex命令执行失败" - - LOG_INFO "步骤7:检查是否生成预期的输出文件" - ls test.dvi > /dev/null 2>&1 - CHECK_RESULT $? 0 0 "未生成预期的dvi文件" - - LOG_INFO "步骤8:清理测试文件" - rm -f test.tex test.dvi test.log test.aux - - if [ $INSTALLED -eq 0 ]; then - LOG_INFO "步骤9:卸载texlive-ptex软件包" - dnf remove -y texlive-ptex - CHECK_RESULT $? 0 0 "卸载texlive-ptex失败" - fi - - LOG_INFO "测试完成" -} - -main "$@" \ No newline at end of file diff --git a/testcases/function_test/pkg_test/texlive-base/texlive-ptex/test_texlive-ptex_ptex_halt_on_error.sh b/testcases/function_test/pkg_test/texlive-base/texlive-ptex/test_texlive-ptex_ptex_halt_on_error.sh deleted file mode 100644 index 37824116f95..00000000000 --- a/testcases/function_test/pkg_test/texlive-base/texlive-ptex/test_texlive-ptex_ptex_halt_on_error.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-08 -# @License : Mulan PSL v2 -# @Desc : 测试ptex命令在遇到第一个错误时停止处理的功能 -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - set -e - - LOG_INFO "开始测试ptex命令的halt-on-error功能" - - # 检查软件包是否可用 - LOG_INFO "检查yum源中是否存在texlive-ptex-ptex包" - if ! dnf list available texlive-ptex-ptex &>/dev/null; then - LOG_ERROR "软件包texlive-ptex-ptex在yum源中不存在" - exit 255 - fi - - # 检查环境是否已安装 - LOG_INFO "检查texlive-ptex-ptex是否已安装" - if rpm -q texlive-ptex-ptex &>/dev/null; then - LOG_INFO "texlive-ptex-ptex已安装,测试后保持安装状态" - INSTALLED_BEFORE=true - else - LOG_INFO "texlive-ptex-ptex未安装,测试前需要安装" - INSTALLED_BEFORE=false - fi - - # 安装软件包(如果未安装) - if [ "$INSTALLED_BEFORE" = "false" ]; then - LOG_INFO "安装texlive-ptex-ptex软件包" - dnf install -y texlive-ptex-ptex - CHECK_RESULT $? 0 0 "安装texlive-ptex-ptex失败" - fi - - # 检查ptex命令是否支持--halt-on-error参数 - LOG_INFO "检查ptex命令是否支持--halt-on-error参数" - if ! ptex --help | grep -q "halt-on-error"; then - LOG_ERROR "ptex命令不支持--halt-on-error参数" - exit 255 - fi - - # 创建测试文件 - LOG_INFO "创建测试用的TeX文件" - TEST_FILE="test_halt.tex" - cat > "$TEST_FILE" << "EOF" - \documentclass{article} - \begin{document} - 正确内容 - \undefinedcommand % 这里会引发错误 - 后续内容 - \end{document} - EOF - - # 测试halt-on-error功能 - LOG_INFO "测试ptex的--halt-on-error功能" - ptex --halt-on-error "$TEST_FILE" 2>&1 | tee ptex_output.log - PTEX_EXIT_CODE=$? - - LOG_INFO "检查ptex命令是否在第一个错误处停止" - if grep -q "后续内容" ptex_output.log; then - LOG_ERROR "ptex没有在第一个错误处停止处理" - CHECK_RESULT 1 0 0 "halt-on-error功能测试失败" - else - LOG_INFO "ptex在第一个错误处成功停止处理" - CHECK_RESULT $PTEX_EXIT_CODE 1 0 "ptex退出码不符合预期" - fi - - # 清理测试文件 - LOG_INFO "清理测试文件" - rm -f "$TEST_FILE" ptex_output.log test_halt.aux test_halt.log - - # 恢复环境 - if [ "$INSTALLED_BEFORE" = "false" ]; then - LOG_INFO "卸载测试安装的texlive-ptex-ptex软件包" - dnf remove -y texlive-ptex-ptex - CHECK_RESULT $? 0 0 "卸载texlive-ptex-ptex失败" - fi - - LOG_INFO "测试完成" -} - -main "$@" \ No newline at end of file diff --git a/testcases/function_test/pkg_test/texlive-base/texlive-ptex/test_texlive-ptex_ptex_help.sh b/testcases/function_test/pkg_test/texlive-base/texlive-ptex/test_texlive-ptex_ptex_help.sh deleted file mode 100644 index 8ea9b4be7cd..00000000000 --- a/testcases/function_test/pkg_test/texlive-base/texlive-ptex/test_texlive-ptex_ptex_help.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-08 -# @License : Mulan PSL v2 -# @Desc : 测试ptex命令的帮助信息输出 -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - LOG_INFO "开始测试ptex命令的帮助信息输出" - - # 检查环境是否已安装ptex - LOG_INFO "检查ptex是否已安装" - if command -v ptex >/dev/null 2>&1; then - LOG_INFO "ptex已安装,标记为已安装状态" - INSTALLED=true - else - LOG_INFO "ptex未安装,标记为未安装状态" - INSTALLED=false - fi - - # 检查yum源中是否有texlive-ptex软件包 - LOG_INFO "检查yum源中是否有texlive-ptex软件包" - if ! dnf list available texlive-ptex >/dev/null 2>&1; then - LOG_ERROR "yum源中未找到texlive-ptex软件包" - exit 255 - fi - - # 如果未安装,则安装texlive-ptex - if [ "$INSTALLED" = false ]; then - LOG_INFO "安装texlive-ptex软件包" - dnf install -y texlive-ptex - CHECK_RESULT $? 0 0 "安装texlive-ptex失败" - fi - - # 测试ptex命令的帮助信息输出 - LOG_INFO "测试ptex命令的帮助信息输出" - ptex --help > /dev/null 2>&1 - CHECK_RESULT $? 0 0 "ptex命令帮助信息输出失败" - - # 清理环境:如果之前未安装,则卸载texlive-ptex - if [ "$INSTALLED" = false ]; then - LOG_INFO "卸载texlive-ptex软件包" - dnf remove -y texlive-ptex - CHECK_RESULT $? 0 0 "卸载texlive-ptex失败" - fi - - LOG_INFO "测试完成" -} - -main "$@" \ No newline at end of file diff --git a/testcases/function_test/pkg_test/texlive-base/texlive-ptex/test_texlive-ptex_ptex_ini.sh b/testcases/function_test/pkg_test/texlive-base/texlive-ptex/test_texlive-ptex_ptex_ini.sh deleted file mode 100644 index ae66f174be1..00000000000 --- a/testcases/function_test/pkg_test/texlive-base/texlive-ptex/test_texlive-ptex_ptex_ini.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-08 -# @License : Mulan PSL v2 -# @Desc : 测试ptex命令以ini模式运行 -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - # 测试ptex命令以ini模式运行 - LOG_INFO "开始测试ptex命令以ini模式运行" - - # 定义软件包名称 - PACKAGE_NAME="texlive-ptex" - - # 步骤1:检查环境是否已安装 - LOG_INFO "步骤1:检查环境是否已安装" - 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 - - # 步骤2:检查yum源中是否有该软件包 - LOG_INFO "步骤2:检查yum源中是否有软件包 $PACKAGE_NAME" - dnf list available $PACKAGE_NAME > /dev/null 2>&1 - CHECK_RESULT $? 0 0 "yum源中没有软件包 $PACKAGE_NAME" - if [ $? -ne 0 ]; then - LOG_ERROR "yum源中没有软件包 $PACKAGE_NAME,退出测试" - exit 255 - fi - - # 步骤3:如果未安装,则安装软件包 - if [ $INSTALLED_BEFORE -eq 0 ]; then - LOG_INFO "步骤3:安装软件包 $PACKAGE_NAME" - dnf install -y $PACKAGE_NAME - CHECK_RESULT $? 0 0 "安装软件包 $PACKAGE_NAME 失败" - fi - - # 步骤4:检查ptex命令是否支持ini参数 - LOG_INFO "步骤4:检查ptex命令是否支持ini参数" - ptex --help 2>&1 | grep -i ini > /dev/null - CHECK_RESULT $? 0 0 "ptex命令不支持ini参数" - if [ $? -ne 0 ]; then - LOG_ERROR "ptex命令不支持ini参数,退出测试" - exit 255 - fi - - # 步骤5:测试ptex命令以ini模式运行 - LOG_INFO "步骤5:测试ptex命令以ini模式运行" - # 创建一个简单的测试文件 - cat > test.tex << "EOF" - \documentclass{article} - \begin{document} - Hello, ini mode test. - \end{document} - EOF - ptex -ini test.tex > ptex_ini_output.txt 2>&1 - CHECK_RESULT $? 0 0 "ptex命令以ini模式运行失败" - if [ $? -ne 0 ]; then - LOG_ERROR "ptex命令以ini模式运行失败" - # 清理临时文件 - rm -f test.tex ptex_ini_output.txt - # 恢复环境 - if [ $INSTALLED_BEFORE -eq 0 ]; then - LOG_INFO "恢复环境:卸载软件包 $PACKAGE_NAME" - dnf remove -y $PACKAGE_NAME - fi - exit 1 - fi - - # 步骤6:检查输出文件是否存在 - LOG_INFO "步骤6:检查输出文件是否存在" - ls ptex_ini_output.txt > /dev/null 2>&1 - CHECK_RESULT $? 0 0 "ptex命令未生成输出文件" - - # 步骤7:清理临时文件 - LOG_INFO "步骤7:清理临时文件" - rm -f test.tex ptex_ini_output.txt - - # 步骤8:恢复环境 - LOG_INFO "步骤8:恢复环境" - if [ $INSTALLED_BEFORE -eq 0 ]; then - LOG_INFO "卸载软件包 $PACKAGE_NAME" - dnf remove -y $PACKAGE_NAME - CHECK_RESULT $? 0 0 "卸载软件包 $PACKAGE_NAME 失败" - else - LOG_INFO "保持软件包 $PACKAGE_NAME 安装状态" - fi - - LOG_INFO "测试ptex命令以ini模式运行完成" -} - -main "$@" \ No newline at end of file diff --git a/testcases/function_test/pkg_test/texlive-base/texlive-ptex/test_texlive-ptex_ptex_interaction_batchmode.sh b/testcases/function_test/pkg_test/texlive-base/texlive-ptex/test_texlive-ptex_ptex_interaction_batchmode.sh deleted file mode 100644 index f9c85730da5..00000000000 --- a/testcases/function_test/pkg_test/texlive-base/texlive-ptex/test_texlive-ptex_ptex_interaction_batchmode.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-08 -# @License : Mulan PSL v2 -# @Desc : 测试ptex命令设置交互模式为batchmode -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - LOG_INFO "开始测试ptex命令设置交互模式为batchmode" - - # 检查yum源中是否有texlive-ptex包 - LOG_INFO "检查yum源中是否有texlive-ptex包" - dnf list texlive-ptex &>/dev/null - if [ $? -ne 0 ]; then - LOG_ERROR "yum源中没有texlive-ptex包" - exit 255 - fi - - # 检查是否已安装texlive-ptex - LOG_INFO "检查是否已安装texlive-ptex" - rpm -q texlive-ptex &>/dev/null - INSTALLED=$? - if [ $INSTALLED -eq 0 ]; then - LOG_INFO "texlive-ptex已安装" - NEED_UNINSTALL=0 - else - LOG_INFO "texlive-ptex未安装,将进行安装" - NEED_UNINSTALL=1 - fi - - # 如果未安装,则安装texlive-ptex - if [ $NEED_UNINSTALL -eq 1 ]; then - LOG_INFO "安装texlive-ptex" - dnf install -y texlive-ptex - CHECK_RESULT $? 0 0 "安装texlive-ptex失败" - fi - - # 检查ptex命令是否支持-batchmode参数 - LOG_INFO "检查ptex命令是否支持-batchmode参数" - ptex --help 2>&1 | grep -q batchmode - if [ $? -ne 0 ]; then - LOG_ERROR "ptex命令不支持-batchmode参数" - # 如果之前未安装,则需要卸载 - if [ $NEED_UNINSTALL -eq 1 ]; then - LOG_INFO "卸载texlive-ptex" - dnf remove -y texlive-ptex - fi - exit 255 - fi - - # 创建测试文件 - LOG_INFO "创建测试文件" - cat > test.tex << "EOF" - \documentclass{article} - \begin{document} - Hello, world! - \end{document} - EOF - CHECK_RESULT $? 0 0 "创建测试文件失败" - - # 使用-batchmode参数执行ptex命令 - LOG_INFO "使用-batchmode参数执行ptex命令" - ptex -batchmode test.tex - CHECK_RESULT $? 0 0 "ptex命令执行失败" - - # 检查是否生成了dvi文件 - LOG_INFO "检查是否生成了dvi文件" - [ -f test.dvi ] - CHECK_RESULT $? 0 0 "未生成dvi文件" - - # 清理测试文件 - LOG_INFO "清理测试文件" - rm -f test.tex test.dvi test.log test.aux - CHECK_RESULT $? 0 0 "清理测试文件失败" - - # 如果测试前未安装,则卸载texlive-ptex - if [ $NEED_UNINSTALL -eq 1 ]; then - LOG_INFO "卸载texlive-ptex" - dnf remove -y texlive-ptex - CHECK_RESULT $? 0 0 "卸载texlive-ptex失败" - else - LOG_INFO "保持texlive-ptex安装状态" - fi - - LOG_INFO "测试完成" -} - -main "$@" \ No newline at end of file diff --git a/testcases/function_test/pkg_test/texlive-base/texlive-ptex/test_texlive-ptex_ptex_interaction_nonstopmode.sh b/testcases/function_test/pkg_test/texlive-base/texlive-ptex/test_texlive-ptex_ptex_interaction_nonstopmode.sh deleted file mode 100644 index 86de647b717..00000000000 --- a/testcases/function_test/pkg_test/texlive-base/texlive-ptex/test_texlive-ptex_ptex_interaction_nonstopmode.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-08 -# @License : Mulan PSL v2 -# @Desc : 测试ptex命令设置交互模式为nonstopmode -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - LOG_INFO "开始测试:测试ptex命令设置交互模式为nonstopmode" - - # 检查环境是否已安装ptex - if dnf list installed texlive-ptex &>/dev/null; then - LOG_INFO "环境已安装texlive-ptex,测试结束后将保持安装状态" - INSTALLED_BEFORE=true - else - LOG_INFO "环境未安装texlive-ptex,测试前将安装,测试结束后卸载" - INSTALLED_BEFORE=false - fi - - # 检查yum源中是否有texlive-ptex软件包 - LOG_INFO "检查yum源中是否有texlive-ptex软件包" - if ! dnf list available texlive-ptex &>/dev/null; then - LOG_ERROR "yum源中未找到texlive-ptex软件包" - exit 255 - fi - - # 如果未安装,则安装texlive-ptex - if [ "$INSTALLED_BEFORE" = false ]; then - LOG_INFO "安装texlive-ptex软件包" - dnf install -y texlive-ptex - CHECK_RESULT $? 0 0 "安装texlive-ptex失败" - fi - - # 检查ptex命令是否存在 - LOG_INFO "检查ptex命令是否存在" - if ! command -v ptex &>/dev/null; then - LOG_ERROR "ptex命令不存在" - exit 255 - fi - - # 检查ptex命令是否支持-interaction参数 - LOG_INFO "检查ptex命令是否支持-interaction参数" - if ! ptex --help | grep -q "\-interaction"; then - LOG_ERROR "ptex命令不支持-interaction参数" - exit 255 - fi - - # 测试ptex命令设置交互模式为nonstopmode - LOG_INFO "执行ptex命令设置交互模式为nonstopmode" - echo "\end" > test.tex - ptex -interaction=nonstopmode test.tex - CHECK_RESULT $? 0 0 "ptex命令设置交互模式为nonstopmode执行失败" - - # 清理测试文件 - LOG_INFO "清理测试文件" - rm -f test.tex test.log test.aux - - # 如果测试前未安装,则卸载texlive-ptex - if [ "$INSTALLED_BEFORE" = false ]; then - LOG_INFO "卸载texlive-ptex软件包" - dnf remove -y texlive-ptex - CHECK_RESULT $? 0 0 "卸载texlive-ptex失败" - fi - - LOG_INFO "测试完成:测试ptex命令设置交互模式为nonstopmode" -} - -main "$@" \ No newline at end of file diff --git a/testcases/function_test/pkg_test/texlive-base/texlive-ptex/test_texlive-ptex_ptex_jobname.sh b/testcases/function_test/pkg_test/texlive-base/texlive-ptex/test_texlive-ptex_ptex_jobname.sh deleted file mode 100644 index a6b1a501100..00000000000 --- a/testcases/function_test/pkg_test/texlive-base/texlive-ptex/test_texlive-ptex_ptex_jobname.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-08 -# @License : Mulan PSL v2 -# @Desc : 测试ptex命令设置作业名称的功能 -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - LOG_INFO "开始测试ptex命令设置作业名称的功能" - LOG_INFO "检查当前环境是否已安装texlive-ptex-ptex软件包" - if dnf list installed texlive-ptex-ptex &>/dev/null; then - LOG_INFO "texlive-ptex-ptex已安装,脚本结束时将保持安装状态" - already_installed=true - else - LOG_INFO "texlive-ptex-ptex未安装,将在测试过程中安装" - already_installed=false - fi - - LOG_INFO "检查yum源中是否存在texlive-ptex-ptex软件包" - if ! dnf list available texlive-ptex-ptex &>/dev/null; then - LOG_ERROR "yum源中未找到texlive-ptex-ptex软件包" - exit 255 - fi - - if [ "$already_installed" = false ]; then - LOG_INFO "安装texlive-ptex-ptex软件包" - dnf install -y texlive-ptex-ptex - CHECK_RESULT $? 0 0 "安装texlive-ptex-ptex失败" - fi - - LOG_INFO "检查ptex命令是否支持-jobname参数" - ptex --help 2>&1 | grep -q "\-\-jobname" - CHECK_RESULT $? 0 0 "ptex命令不支持-jobname参数" - if [ $? -ne 0 ]; then - exit 255 - fi - - LOG_INFO "创建一个简单的测试TeX文件" - cat > test_jobname.tex << "EOF" - \documentclass{article} - \begin{document} - Hello, world! - \end{document} - EOF - - LOG_INFO "使用ptex命令编译测试文件,并设置作业名称为myjob" - ptex -jobname=myjob test_jobname.tex - CHECK_RESULT $? 0 0 "使用-jobname参数编译失败" - - LOG_INFO "检查是否生成了名为myjob.dvi的文件" - if [ -f myjob.dvi ]; then - LOG_INFO "成功生成myjob.dvi文件,作业名称设置功能正常" - else - LOG_ERROR "未生成预期的myjob.dvi文件" - exit 1 - fi - - LOG_INFO "清理测试生成的文件" - rm -f test_jobname.tex myjob.dvi test_jobname.log myjob.log - - if [ "$already_installed" = false ]; then - LOG_INFO "卸载在测试过程中安装的texlive-ptex-ptex软件包" - dnf remove -y texlive-ptex-ptex - CHECK_RESULT $? 0 0 "卸载texlive-ptex-ptex失败" - fi - - LOG_INFO "测试完成,环境已恢复" -} - -main "$@" \ No newline at end of file diff --git a/testcases/function_test/pkg_test/texlive-base/texlive-ptex/test_texlive-ptex_ptex_kanji_euc.sh b/testcases/function_test/pkg_test/texlive-base/texlive-ptex/test_texlive-ptex_ptex_kanji_euc.sh deleted file mode 100644 index 1d8a8aa2ad0..00000000000 --- a/testcases/function_test/pkg_test/texlive-base/texlive-ptex/test_texlive-ptex_ptex_kanji_euc.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-08 -# @License : Mulan PSL v2 -# @Desc : 测试ptex命令设置日文编码为EUC -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - # 环境初始化 - LOG_INFO "开始测试ptex命令设置日文编码为EUC" - - # 定义软件包名称 - PACKAGE_NAME="texlive-ptex" - - # 步骤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 "软件包已安装,测试结束后将保持安装状态" - INSTALLED_BEFORE=true - else - LOG_INFO "软件包未安装,将进行安装测试" - INSTALLED_BEFORE=false - fi - - # 步骤3:如果未安装,则安装软件包 - if [ "$INSTALLED_BEFORE" = false ]; then - LOG_INFO "步骤3:安装软件包" - dnf install -y "$PACKAGE_NAME" - CHECK_RESULT $? 0 0 "安装软件包失败" - fi - - # 步骤4:验证ptex命令是否存在 - LOG_INFO "步骤4:验证ptex命令是否存在" - which ptex &>/dev/null - CHECK_RESULT $? 0 0 "ptex命令不存在" - - # 步骤5:测试ptex命令设置日文编码为EUC - LOG_INFO "步骤5:测试ptex命令设置日文编码为EUC" - # 创建一个简单的测试文件 - TEST_FILE="test_euc.tex" - cat > "$TEST_FILE" << "EOF" - \documentclass{jsarticle} - \begin{document} - 日本語のテスト - \end{document} - EOF - - # 使用ptex命令处理测试文件,设置编码为EUC - ptex -kanji=euc "$TEST_FILE" &>/dev/null - CHECK_RESULT $? 0 0 "ptex命令设置EUC编码失败" - - # 步骤6:检查生成的DVI文件 - LOG_INFO "步骤6:检查生成的DVI文件" - if [ -f "test_euc.dvi" ]; then - LOG_INFO "DVI文件生成成功" - else - LOG_ERROR "DVI文件未生成" - exit 1 - fi - - # 步骤7:清理测试文件 - LOG_INFO "步骤7:清理测试文件" - rm -f "$TEST_FILE" test_euc.dvi test_euc.log test_euc.aux - - # 步骤8:环境恢复 - LOG_INFO "步骤8:环境恢复" - if [ "$INSTALLED_BEFORE" = 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-ptex/test_texlive-ptex_ptex_kanji_jis.sh b/testcases/function_test/pkg_test/texlive-base/texlive-ptex/test_texlive-ptex_ptex_kanji_jis.sh deleted file mode 100644 index b358b0bc1f2..00000000000 --- a/testcases/function_test/pkg_test/texlive-base/texlive-ptex/test_texlive-ptex_ptex_kanji_jis.sh +++ /dev/null @@ -1,53 +0,0 @@ -#!/usr/bin/bash - -# Copyright (c) 2024 ISCAS .ALL rights reserved. -# This program is licensed under Mulan PSL v2. -# You can use it according to the terms and conditions of the Mulan PSL v2. -# http://license.coscl.org.cn/MulanPSL2 -# THIS PROGRAM IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, -# EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, -# MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. -# See the Mulan PSL v2 for more details. - -# ############################################# -# @Author : honghua -# @Contact : honghua@iscas.ac.cn -# @Date : 2026-03-08 -# @License : Mulan PSL v2 -# @Desc : 测试ptex命令设置日文编码为JIS -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - LOG_INFO "开始测试:测试ptex命令设置日文编码为JIS" - LOG_INFO "步骤1:检查是否已安装ptex软件包" - if rpm -q ptex &> /dev/null; then - LOG_INFO "ptex软件包已安装,跳过安装步骤" - INSTALLED=true - else - LOG_INFO "ptex软件包未安装,开始安装" - dnf list available ptex &> /dev/null - CHECK_RESULT $? 0 0 "yum源中未找到ptex软件包" - dnf install -y ptex - CHECK_RESULT $? 0 0 "安装ptex软件包失败" - INSTALLED=false - fi - - LOG_INFO "步骤2:测试ptex命令设置日文编码为JIS" - ptex -kanji=jis -version - CHECK_RESULT $? 0 0 "ptex命令设置日文编码为JIS失败" - - LOG_INFO "步骤3:清理环境" - if [ "$INSTALLED" = "false" ]; then - LOG_INFO "卸载ptex软件包" - dnf remove -y ptex - CHECK_RESULT $? 0 0 "卸载ptex软件包失败" - else - LOG_INFO "保持ptex软件包安装状态" - fi - - LOG_INFO "测试完成" -} - -main "$@" \ No newline at end of file diff --git a/testcases/function_test/pkg_test/texlive-base/texlive-ptex/test_texlive-ptex_ptex_kanji_sjis.sh b/testcases/function_test/pkg_test/texlive-base/texlive-ptex/test_texlive-ptex_ptex_kanji_sjis.sh deleted file mode 100644 index 506270f833a..00000000000 --- a/testcases/function_test/pkg_test/texlive-base/texlive-ptex/test_texlive-ptex_ptex_kanji_sjis.sh +++ /dev/null @@ -1,152 +0,0 @@ -#!/usr/bin/bash - -# Copyright (c) 2024 ISCAS .ALL rights reserved. -# This program is licensed under Mulan PSL v2. -# You can use it according to the terms and conditions of the Mulan PSL v2. -# http://license.coscl.org.cn/MulanPSL2 -# THIS PROGRAM IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, -# EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, -# MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. -# See the Mulan PSL v2 for more details. - -# ############################################# -# @Author : honghua -# @Contact : honghua@iscas.ac.cn -# @Date : 2026-03-08 -# @License : Mulan PSL v2 -# @Desc : 测试ptex命令设置日文编码为SJIS -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - # 设置环境变量 - SCRIPT_NAME="test_texlive-ptex_ptex_kanji_sjis" - PACKAGE_NAME="texlive-ptex" - COMMAND_NAME="ptex" - ENCODING_PARAM="--kanji=sjis" - - # 日志函数(直接使用,无需定义) - LOG_INFO() { - echo "[INFO] $1" - } - - LOG_ERROR() { - echo "[ERROR] $1" - } - - # 检查软件包是否在yum源中 - check_package_in_repo() { - LOG_INFO "检查yum源中是否存在软件包 $PACKAGE_NAME" - dnf list available "$PACKAGE_NAME" &> /dev/null - if [ $? -ne 0 ]; then - LOG_ERROR "yum源中不存在软件包 $PACKAGE_NAME" - exit 255 - fi - LOG_INFO "软件包 $PACKAGE_NAME 存在于yum源中" - } - - # 检查命令参数是否支持 - check_command_param() { - LOG_INFO "检查命令 $COMMAND_NAME 是否支持参数 $ENCODING_PARAM" - $COMMAND_NAME --help 2>&1 | grep -q "$ENCODING_PARAM" - if [ $? -ne 0 ]; then - LOG_ERROR "命令 $COMMAND_NAME 不支持参数 $ENCODING_PARAM" - exit 255 - fi - LOG_INFO "命令 $COMMAND_NAME 支持参数 $ENCODING_PARAM" - } - - # 检查软件包是否已安装 - check_package_installed() { - LOG_INFO "检查软件包 $PACKAGE_NAME 是否已安装" - rpm -q "$PACKAGE_NAME" &> /dev/null - return $? - } - - # 安装软件包 - install_package() { - LOG_INFO "安装软件包 $PACKAGE_NAME" - dnf install -y "$PACKAGE_NAME" - CHECK_RESULT $? 0 0 "安装软件包 $PACKAGE_NAME 失败" - } - - # 卸载软件包 - uninstall_package() { - LOG_INFO "卸载软件包 $PACKAGE_NAME" - dnf remove -y "$PACKAGE_NAME" - CHECK_RESULT $? 0 0 "卸载软件包 $PACKAGE_NAME 失败" - } - - # 测试ptex命令设置日文编码为SJIS - test_ptex_kanji_sjis() { - LOG_INFO "测试ptex命令设置日文编码为SJIS" - - # 创建一个简单的测试文件 - TEST_FILE="test_ptex.tex" - cat > "$TEST_FILE" << "EOF" - \documentclass{jsarticle} - \begin{document} - テストテキスト - \end{document} - EOF - - # 使用ptex命令编译,设置日文编码为SJIS - $COMMAND_NAME $ENCODING_PARAM "$TEST_FILE" - CHECK_RESULT $? 0 0 "ptex命令执行失败" - - # 检查生成的DVI文件 - if [ -f "test_ptex.dvi" ]; then - LOG_INFO "成功生成DVI文件,日文编码SJIS设置有效" - else - LOG_ERROR "未生成DVI文件,日文编码SJIS设置可能无效" - CHECK_RESULT 1 0 0 "DVI文件未生成" - fi - - # 清理测试文件 - rm -f "$TEST_FILE" "test_ptex.dvi" "test_ptex.log" "test_ptex.aux" - } - - # 主函数 - main() { - LOG_INFO "开始测试脚本: $SCRIPT_NAME" - - # 检查yum源中是否存在软件包 - check_package_in_repo - - # 检查命令参数是否支持 - check_command_param - - # 记录软件包初始安装状态 - check_package_installed - INITIAL_INSTALLED=$? - if [ $INITIAL_INSTALLED -eq 0 ]; then - LOG_INFO "软件包 $PACKAGE_NAME 已安装,测试后保持安装状态" - else - LOG_INFO "软件包 $PACKAGE_NAME 未安装,测试后将卸载" - fi - - # 如果未安装,则安装软件包 - if [ $INITIAL_INSTALLED -ne 0 ]; then - install_package - fi - - # 执行测试 - test_ptex_kanji_sjis - - # 环境恢复 - LOG_INFO "开始环境恢复" - if [ $INITIAL_INSTALLED -ne 0 ]; then - uninstall_package - else - LOG_INFO "保持软件包 $PACKAGE_NAME 的安装状态" - fi - - LOG_INFO "测试脚本 $SCRIPT_NAME 执行完成" - } - - # 执行主函数 - main -} - -main "$@" \ No newline at end of file diff --git a/testcases/function_test/pkg_test/texlive-base/texlive-ptex/test_texlive-ptex_ptex_kanji_utf8.sh b/testcases/function_test/pkg_test/texlive-base/texlive-ptex/test_texlive-ptex_ptex_kanji_utf8.sh deleted file mode 100644 index 22c08358d19..00000000000 --- a/testcases/function_test/pkg_test/texlive-base/texlive-ptex/test_texlive-ptex_ptex_kanji_utf8.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-08 -# @License : Mulan PSL v2 -# @Desc : 测试ptex命令设置日文编码为UTF-8 -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - LOG_INFO "开始测试ptex命令设置日文编码为UTF-8" - - # 检查环境是否已安装ptex软件包 - LOG_INFO "检查ptex软件包是否已安装" - rpm -q ptex &> /dev/null - if [ $? -eq 0 ]; then - LOG_INFO "ptex软件包已安装,脚本结束时将保持安装状态" - already_installed=true - else - LOG_INFO "ptex软件包未安装,将在测试过程中安装" - already_installed=false - fi - - # 检查yum源中是否有ptex软件包 - LOG_INFO "检查yum源中是否有ptex软件包" - dnf list available ptex &> /dev/null - if [ $? -ne 0 ]; then - LOG_ERROR "yum源中没有ptex软件包" - exit 255 - fi - - # 如果未安装,则安装ptex软件包 - if [ "$already_installed" = false ]; then - LOG_INFO "安装ptex软件包" - dnf install -y ptex - CHECK_RESULT $? 0 0 "安装ptex软件包失败" - fi - - # 测试ptex命令设置日文编码为UTF-8 - LOG_INFO "测试ptex命令设置日文编码为UTF-8" - ptex -kanji=utf8 --version &> /dev/null - if [ $? -ne 0 ]; then - LOG_ERROR "ptex命令不支持-kanji=utf8参数" - exit 255 - fi - - # 检查ptex命令是否成功执行 - LOG_INFO "执行ptex命令" - ptex -kanji=utf8 test.tex &> /dev/null - CHECK_RESULT $? 0 0 "ptex命令执行失败" - - # 清理环境:如果之前未安装,则卸载ptex软件包 - if [ "$already_installed" = false ]; then - LOG_INFO "卸载ptex软件包" - dnf remove -y ptex - CHECK_RESULT $? 0 0 "卸载ptex软件包失败" - fi - - LOG_INFO "测试完成" -} - -main "$@" \ No newline at end of file diff --git a/testcases/function_test/pkg_test/texlive-base/texlive-ptex/test_texlive-ptex_ptex_no_file_line_error.sh b/testcases/function_test/pkg_test/texlive-base/texlive-ptex/test_texlive-ptex_ptex_no_file_line_error.sh deleted file mode 100644 index a706a8766fe..00000000000 --- a/testcases/function_test/pkg_test/texlive-base/texlive-ptex/test_texlive-ptex_ptex_no_file_line_error.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-08 -# @License : Mulan PSL v2 -# @Desc : 测试ptex命令禁用文件:行:错误样式消息 -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - # 初始化变量 - PKG_NAME="texlive-ptex" - TEST_CMD="ptex" - TEST_PARAM="--no-file-line-error" - EXPECTED_OUTPUT="no-file-line-error" - - # 检查软件包是否在yum源中 - LOG_INFO "检查yum源中是否存在软件包: ${PKG_NAME}" - if ! dnf list available ${PKG_NAME} &>/dev/null; then - LOG_ERROR "yum源中不存在软件包: ${PKG_NAME}" - exit 255 - fi - - # 检查软件包是否已安装 - LOG_INFO "检查软件包是否已安装: ${PKG_NAME}" - if rpm -q ${PKG_NAME} &>/dev/null; then - LOG_INFO "软件包已安装,标记为无需清理" - NEED_CLEANUP=0 - else - LOG_INFO "软件包未安装,标记为需要清理" - NEED_CLEANUP=1 - fi - - # 如果未安装,则安装软件包 - if [ ${NEED_CLEANUP} -eq 1 ]; then - LOG_INFO "安装软件包: ${PKG_NAME}" - dnf install -y ${PKG_NAME} - CHECK_RESULT $? 0 0 "安装软件包失败" - fi - - # 检查ptex命令是否存在 - LOG_INFO "检查命令是否存在: ${TEST_CMD}" - command -v ${TEST_CMD} >/dev/null 2>&1 - CHECK_RESULT $? 0 0 "命令不存在" - - # 检查--no-file-line-error参数是否支持 - LOG_INFO "检查参数是否支持: ${TEST_PARAM}" - ${TEST_CMD} --help 2>&1 | grep -q "${TEST_PARAM}" - if [ $? -ne 0 ]; then - LOG_ERROR "参数不支持: ${TEST_PARAM}" - exit 255 - fi - - # 测试ptex命令禁用文件:行:错误样式消息 - LOG_INFO "测试ptex命令禁用文件:行:错误样式消息" - TEST_INPUT="\\documentclass{article}\\begin{document}test\\end{document}" - echo "${TEST_INPUT}" | ${TEST_CMD} ${TEST_PARAM} - 2>&1 | grep -q "${EXPECTED_OUTPUT}" - CHECK_RESULT $? 0 0 "ptex命令禁用文件:行:错误样式消息测试失败" - - # 环境清理 - if [ ${NEED_CLEANUP} -eq 1 ]; then - LOG_INFO "卸载软件包: ${PKG_NAME}" - dnf remove -y ${PKG_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-ptex/test_texlive-ptex_ptex_no_parse_first_line.sh b/testcases/function_test/pkg_test/texlive-base/texlive-ptex/test_texlive-ptex_ptex_no_parse_first_line.sh deleted file mode 100644 index 77ff779a124..00000000000 --- a/testcases/function_test/pkg_test/texlive-base/texlive-ptex/test_texlive-ptex_ptex_no_parse_first_line.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-08 -# @License : Mulan PSL v2 -# @Desc : 测试ptex命令禁用解析输入文件首行的功能 -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - # 判断是否已安装ptex软件包 - LOG_INFO "检查是否已安装ptex软件包" - rpm -q texlive-ptex &> /dev/null - is_installed=$? - - # 检查yum源中是否存在texlive-ptex软件包 - LOG_INFO "检查yum源中是否存在texlive-ptex软件包" - dnf list available texlive-ptex &> /dev/null - if [ $? -ne 0 ]; then - LOG_ERROR "yum源中不存在texlive-ptex软件包" - exit 255 - fi - - # 如果未安装,则安装软件包 - if [ $is_installed -ne 0 ]; then - LOG_INFO "安装texlive-ptex软件包" - dnf install -y texlive-ptex - CHECK_RESULT $? 0 0 "安装texlive-ptex软件包失败" - fi - - # 准备测试文件 - LOG_INFO "准备测试文件" - cat > test_input.tex << "EOF" - %&pLaTeX - \documentclass{article} - \begin{document} - Hello, world! - \end{document} - EOF - - # 测试ptex命令禁用解析输入文件首行的功能 - LOG_INFO "测试ptex命令禁用解析输入文件首行的功能" - ptex -no-parse-first-line test_input.tex &> /dev/null - CHECK_RESULT $? 0 0 "ptex命令禁用解析输入文件首行的功能测试失败" - - # 清理测试文件 - LOG_INFO "清理测试文件" - rm -f test_input.tex - - # 如果测试前未安装,则卸载软件包 - if [ $is_installed -ne 0 ]; then - LOG_INFO "卸载texlive-ptex软件包" - dnf remove -y texlive-ptex - CHECK_RESULT $? 0 0 "卸载texlive-ptex软件包失败" - fi - - LOG_INFO "测试完成" -} - -main "$@" \ No newline at end of file diff --git a/testcases/function_test/pkg_test/texlive-base/texlive-ptex/test_texlive-ptex_ptex_no_shell_escape.sh b/testcases/function_test/pkg_test/texlive-base/texlive-ptex/test_texlive-ptex_ptex_no_shell_escape.sh deleted file mode 100644 index 09d614b79ab..00000000000 --- a/testcases/function_test/pkg_test/texlive-base/texlive-ptex/test_texlive-ptex_ptex_no_shell_escape.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-08 -# @License : Mulan PSL v2 -# @Desc : 测试ptex命令禁用shell转义功能 -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - LOG_INFO "开始测试ptex命令禁用shell转义功能" - - # 定义软件包名称 - PACKAGE_NAME="texlive-ptex" - - # 检查软件包是否已在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=1 - else - LOG_INFO "软件包${PACKAGE_NAME}未安装,标记为未安装状态" - INSTALLED=0 - fi - - # 如果未安装,则安装软件包 - if [ ${INSTALLED} -eq 0 ]; then - LOG_INFO "开始安装软件包${PACKAGE_NAME}" - dnf install -y ${PACKAGE_NAME} - CHECK_RESULT $? 0 0 "安装软件包${PACKAGE_NAME}失败" - LOG_INFO "软件包${PACKAGE_NAME}安装成功" - fi - - # 测试ptex命令禁用shell转义功能 - LOG_INFO "测试ptex命令禁用shell转义功能" - ptex --help 2>&1 | grep -q "\-\-no\-shell\-escape" - CHECK_RESULT $? 0 0 "ptex命令不支持--no-shell-escape参数" - LOG_INFO "ptex命令支持--no-shell-escape参数" - - # 使用--no-shell-escape参数执行ptex命令 - LOG_INFO "使用--no-shell-escape参数执行ptex命令" - ptex --no-shell-escape --version - CHECK_RESULT $? 0 0 "ptex命令执行失败" - - # 清理环境:如果脚本开始时未安装,则卸载软件包 - if [ ${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 "测试ptex命令禁用shell转义功能完成" -} - -main "$@" \ No newline at end of file diff --git a/testcases/function_test/pkg_test/texlive-base/texlive-ptex/test_texlive-ptex_ptex_output_directory.sh b/testcases/function_test/pkg_test/texlive-base/texlive-ptex/test_texlive-ptex_ptex_output_directory.sh deleted file mode 100644 index 101701fd383..00000000000 --- a/testcases/function_test/pkg_test/texlive-base/texlive-ptex/test_texlive-ptex_ptex_output_directory.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-08 -# @License : Mulan PSL v2 -# @Desc : 测试ptex命令设置输出目录的功能 -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - LOG_INFO "开始测试ptex命令设置输出目录的功能" - - # 检查环境是否已安装ptex - LOG_INFO "检查ptex是否已安装" - if rpm -q texlive-ptex &>/dev/null; then - LOG_INFO "ptex已安装,将在测试后保持安装状态" - INSTALLED=true - else - LOG_INFO "ptex未安装,将在测试后卸载" - INSTALLED=false - fi - - # 检查yum源中是否有texlive-ptex包 - LOG_INFO "检查yum源中是否有texlive-ptex包" - if ! dnf list available texlive-ptex &>/dev/null; then - LOG_ERROR "yum源中未找到texlive-ptex包" - exit 255 - fi - - # 如果未安装,则安装ptex - if [ "$INSTALLED" = false ]; then - LOG_INFO "安装texlive-ptex" - dnf install -y texlive-ptex - CHECK_RESULT $? 0 0 "安装texlive-ptex失败" - fi - - # 创建测试用的TeX文件 - LOG_INFO "创建测试TeX文件" - TEST_TEX="test_output_dir.tex" - cat > "$TEST_TEX" << "EOF" - \documentclass{article} - \begin{document} - Test document for output directory. - \end{document} - EOF - CHECK_RESULT $? 0 0 "创建测试TeX文件失败" - - # 测试ptex命令的--output-directory参数 - LOG_INFO "测试ptex命令的--output-directory参数" - OUTPUT_DIR="test_output" - mkdir -p "$OUTPUT_DIR" - ptex --output-directory="$OUTPUT_DIR" "$TEST_TEX" - CHECK_RESULT $? 0 0 "ptex命令执行失败" - - # 检查输出目录中是否生成了DVI文件 - LOG_INFO "检查输出目录中是否生成了DVI文件" - EXPECTED_DVI="$OUTPUT_DIR/test_output_dir.dvi" - if [ -f "$EXPECTED_DVI" ]; then - LOG_INFO "成功在指定输出目录生成DVI文件" - else - LOG_ERROR "未在指定输出目录找到DVI文件" - exit 1 - fi - - # 清理测试文件 - LOG_INFO "清理测试文件" - rm -f "$TEST_TEX" - rm -rf "$OUTPUT_DIR" - - # 如果测试前未安装,则卸载ptex - if [ "$INSTALLED" = false ]; then - LOG_INFO "卸载texlive-ptex" - dnf remove -y texlive-ptex - CHECK_RESULT $? 0 0 "卸载texlive-ptex失败" - fi - - LOG_INFO "测试ptex命令设置输出目录的功能完成" -} - -main "$@" \ No newline at end of file diff --git a/testcases/function_test/pkg_test/texlive-base/texlive-ptex/test_texlive-ptex_ptex_parse_first_line.sh b/testcases/function_test/pkg_test/texlive-base/texlive-ptex/test_texlive-ptex_ptex_parse_first_line.sh deleted file mode 100644 index e87f9bdedfc..00000000000 --- a/testcases/function_test/pkg_test/texlive-base/texlive-ptex/test_texlive-ptex_ptex_parse_first_line.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-08 -# @License : Mulan PSL v2 -# @Desc : 测试ptex命令启用解析输入文件首行的功能 -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - LOG_INFO "开始测试ptex命令启用解析输入文件首行的功能" - LOG_INFO "步骤1:检查系统中是否已安装texlive-ptex-ptex包" - if rpm -q texlive-ptex-ptex &>/dev/null; then - LOG_INFO "texlive-ptex-ptex已安装,测试结束后将保持安装状态" - INSTALLED=1 - else - LOG_INFO "texlive-ptex-ptex未安装,将在测试前安装" - INSTALLED=0 - fi - - LOG_INFO "步骤2:检查yum源中是否存在texlive-ptex-ptex软件包" - if ! dnf list available texlive-ptex-ptex &>/dev/null; then - LOG_ERROR "yum源中未找到texlive-ptex-ptex软件包" - exit 255 - fi - - if [ $INSTALLED -eq 0 ]; then - LOG_INFO "步骤3:安装texlive-ptex-ptex软件包" - dnf install -y texlive-ptex-ptex - CHECK_RESULT $? 0 0 "安装texlive-ptex-ptex失败" - fi - - LOG_INFO "步骤4:验证ptex命令是否支持-parse-first-line参数" - ptex --help | grep -q -- "-parse-first-line" - if [ $? -ne 0 ]; then - LOG_ERROR "ptex命令不支持-parse-first-line参数" - if [ $INSTALLED -eq 0 ]; then - LOG_INFO "清理环境:卸载安装的软件包" - dnf remove -y texlive-ptex-ptex - fi - exit 255 - fi - - LOG_INFO "步骤5:创建测试输入文件test_input.tex" - cat > test_input.tex << "EOF" - %&platex - \documentclass{article} - \begin{document} - Test document for ptex -parse-first-line. - \end{document} - EOF - CHECK_RESULT $? 0 0 "创建测试输入文件失败" - - LOG_INFO "步骤6:使用ptex命令并启用-parse-first-line参数处理测试文件" - ptex -parse-first-line test_input.tex - CHECK_RESULT $? 0 0 "ptex命令执行失败" - - LOG_INFO "步骤7:检查生成的输出文件" - if [ -f test_input.dvi ]; then - LOG_INFO "成功生成test_input.dvi文件" - else - LOG_ERROR "未生成test_input.dvi文件" - CHECK_RESULT 1 0 1 "ptex命令未生成预期输出文件" - fi - - LOG_INFO "步骤8:清理测试生成的文件" - rm -f test_input.tex test_input.dvi test_input.log test_input.aux - CHECK_RESULT $? 0 0 "清理测试文件失败" - - if [ $INSTALLED -eq 0 ]; then - LOG_INFO "步骤9:卸载测试安装的texlive-ptex-ptex软件包" - dnf remove -y texlive-ptex-ptex - CHECK_RESULT $? 0 0 "卸载texlive-ptex-ptex失败" - else - LOG_INFO "测试完成,保持texlive-ptex-ptex安装状态" - fi - - LOG_INFO "测试ptex命令启用解析输入文件首行的功能完成" -} - -main "$@" \ No newline at end of file diff --git a/testcases/function_test/pkg_test/texlive-base/texlive-ptex/test_texlive-ptex_ptex_recorder.sh b/testcases/function_test/pkg_test/texlive-base/texlive-ptex/test_texlive-ptex_ptex_recorder.sh deleted file mode 100644 index 04550c621b5..00000000000 --- a/testcases/function_test/pkg_test/texlive-base/texlive-ptex/test_texlive-ptex_ptex_recorder.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-08 -# @License : Mulan PSL v2 -# @Desc : 测试ptex命令启用文件名记录器的功能 -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - LOG_INFO "开始测试ptex命令启用文件名记录器的功能" - - # 步骤1:检查环境中是否已安装ptex软件包 - LOG_INFO "检查环境中是否已安装ptex软件包" - if rpm -q ptex > /dev/null 2>&1; then - LOG_INFO "ptex已安装,脚本结束时将保持安装状态" - INSTALLED=true - else - LOG_INFO "ptex未安装,将在测试过程中安装并在结束后卸载" - INSTALLED=false - fi - - # 步骤2:检查yum源中是否有ptex软件包 - LOG_INFO "检查yum源中是否有ptex软件包" - if ! dnf list available ptex 2>/dev/null | grep -q ptex; then - LOG_ERROR "yum源中未找到ptex软件包" - exit 255 - fi - - # 步骤3:如果未安装,则安装ptex - if [ "$INSTALLED" = false ]; then - LOG_INFO "开始安装ptex软件包" - dnf install -y ptex - CHECK_RESULT $? 0 0 "安装ptex失败" - fi - - # 步骤4:测试ptex命令启用文件名记录器的功能 - LOG_INFO "测试ptex命令启用文件名记录器的功能" - # 假设ptex命令支持--record-filenames参数来启用文件名记录器 - ptex --record-filenames test_input.tex - CHECK_RESULT $? 0 0 "ptex命令启用文件名记录器功能失败" - - # 步骤5:清理环境,如果之前未安装则卸载ptex - if [ "$INSTALLED" = false ]; then - LOG_INFO "卸载ptex软件包" - dnf remove -y ptex - CHECK_RESULT $? 0 0 "卸载ptex失败" - fi - - LOG_INFO "测试完成" -} - -main "$@" \ No newline at end of file diff --git a/testcases/function_test/pkg_test/texlive-base/texlive-ptex/test_texlive-ptex_ptex_shell_escape.sh b/testcases/function_test/pkg_test/texlive-base/texlive-ptex/test_texlive-ptex_ptex_shell_escape.sh deleted file mode 100644 index 1b825c3122c..00000000000 --- a/testcases/function_test/pkg_test/texlive-base/texlive-ptex/test_texlive-ptex_ptex_shell_escape.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-08 -# @License : Mulan PSL v2 -# @Desc : 测试ptex命令启用shell转义功能 -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - # 检查环境是否已安装ptex软件包 - LOG_INFO "检查是否已安装ptex软件包" - rpm -q texlive-ptex > /dev/null 2>&1 - if [ $? -eq 0 ]; then - LOG_INFO "ptex软件包已安装,标记为保持安装状态" - INSTALLED_FLAG=1 - else - LOG_INFO "ptex软件包未安装,标记为需要清理" - INSTALLED_FLAG=0 - fi - - # 检查yum源中是否有texlive-ptex软件包 - LOG_INFO "检查yum源中是否有texlive-ptex软件包" - dnf list available texlive-ptex > /dev/null 2>&1 - CHECK_RESULT $? 0 0 "yum源中未找到texlive-ptex软件包" - if [ $? -ne 0 ]; then - LOG_ERROR "yum源中未找到texlive-ptex软件包" - exit 255 - fi - - # 如果未安装,则安装软件包 - if [ $INSTALLED_FLAG -eq 0 ]; then - LOG_INFO "安装texlive-ptex软件包" - dnf install -y texlive-ptex - CHECK_RESULT $? 0 0 "安装texlive-ptex软件包失败" - fi - - # 检查ptex命令是否存在 - LOG_INFO "检查ptex命令是否存在" - which ptex > /dev/null 2>&1 - CHECK_RESULT $? 0 0 "ptex命令不存在" - if [ $? -ne 0 ]; then - LOG_ERROR "ptex命令不存在" - exit 255 - fi - - # 检查ptex命令是否支持-shell-escape参数 - LOG_INFO "检查ptex命令是否支持-shell-escape参数" - ptex --help | grep -q "shell-escape" - CHECK_RESULT $? 0 0 "ptex命令不支持-shell-escape参数" - if [ $? -ne 0 ]; then - LOG_ERROR "ptex命令不支持-shell-escape参数" - exit 255 - fi - - # 创建一个简单的测试tex文件 - LOG_INFO "创建测试tex文件" - cat > test_shell_escape.tex << "EOF" - \documentclass{article} - \begin{document} - Test shell escape: \write18{echo "shell escape test" > test_output.txt} - \end{document} - EOF - CHECK_RESULT $? 0 0 "创建测试tex文件失败" - - # 使用ptex命令启用shell转义功能编译tex文件 - LOG_INFO "使用ptex命令启用shell转义功能编译tex文件" - ptex -shell-escape test_shell_escape.tex - CHECK_RESULT $? 0 0 "ptex命令启用shell转义功能编译失败" - - # 检查shell转义功能是否生效 - LOG_INFO "检查shell转义功能是否生效" - if [ -f test_output.txt ]; then - LOG_INFO "shell转义功能生效,成功创建test_output.txt文件" - rm -f test_output.txt - else - LOG_ERROR "shell转义功能未生效,未创建test_output.txt文件" - exit 1 - fi - - # 清理测试文件 - LOG_INFO "清理测试文件" - rm -f test_shell_escape.tex test_shell_escape.log test_shell_escape.aux test_shell_escape.dvi - - # 如果之前未安装,则卸载软件包 - if [ $INSTALLED_FLAG -eq 0 ]; then - LOG_INFO "卸载texlive-ptex软件包" - dnf remove -y texlive-ptex - CHECK_RESULT $? 0 0 "卸载texlive-ptex软件包失败" - else - LOG_INFO "保持texlive-ptex软件包安装状态" - fi - - LOG_INFO "测试完成" -} - -main "$@" \ No newline at end of file diff --git a/testcases/function_test/pkg_test/texlive-base/texlive-ptex/test_texlive-ptex_ptex_shell_restricted.sh b/testcases/function_test/pkg_test/texlive-base/texlive-ptex/test_texlive-ptex_ptex_shell_restricted.sh deleted file mode 100644 index 793aba35ac6..00000000000 --- a/testcases/function_test/pkg_test/texlive-base/texlive-ptex/test_texlive-ptex_ptex_shell_restricted.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-08 -# @License : Mulan PSL v2 -# @Desc : 测试ptex命令启用受限shell转义功能 -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - # 判断环境是否已安装ptex - LOG_INFO "检查ptex是否已安装" - rpm -q ptex > /dev/null 2>&1 - if [ $? -eq 0 ]; then - LOG_INFO "ptex已安装,标记为保持安装状态" - KEEP_INSTALLED=1 - else - LOG_INFO "ptex未安装,标记为需要清理" - KEEP_INSTALLED=0 - fi - - # 检查yum源中是否有ptex包 - LOG_INFO "检查yum源中是否有ptex包" - dnf list available ptex > /dev/null 2>&1 - CHECK_RESULT $? 0 0 "yum源中没有ptex包" - if [ $? -ne 0 ]; then - LOG_ERROR "yum源中没有ptex包,退出测试" - exit 255 - fi - - # 如果未安装,则安装ptex - if [ $KEEP_INSTALLED -eq 0 ]; then - LOG_INFO "安装ptex包" - dnf install -y ptex - CHECK_RESULT $? 0 0 "安装ptex失败" - fi - - # 检查ptex命令是否存在 - LOG_INFO "检查ptex命令是否存在" - which ptex > /dev/null 2>&1 - CHECK_RESULT $? 0 0 "ptex命令不存在" - - # 测试ptex命令的--restricted参数 - LOG_INFO "测试ptex命令的--restricted参数" - ptex --help | grep -q -- "--restricted" - CHECK_RESULT $? 0 0 "ptex命令不支持--restricted参数" - if [ $? -ne 0 ]; then - LOG_ERROR "ptex命令不支持--restricted参数,退出测试" - exit 255 - fi - - # 执行ptex命令启用受限shell转义功能 - LOG_INFO "执行ptex命令启用受限shell转义功能" - ptex --restricted --version > /dev/null 2>&1 - CHECK_RESULT $? 0 0 "ptex命令启用受限shell转义功能失败" - - # 清理环境:如果之前未安装,则卸载ptex - if [ $KEEP_INSTALLED -eq 0 ]; then - LOG_INFO "卸载ptex包" - dnf remove -y ptex - CHECK_RESULT $? 0 0 "卸载ptex失败" - else - LOG_INFO "保持ptex安装状态" - fi - - LOG_INFO "测试完成" -} - -main "$@" \ No newline at end of file diff --git a/testcases/function_test/pkg_test/texlive-base/texlive-ptex/test_texlive-ptex_ptex_version.sh b/testcases/function_test/pkg_test/texlive-base/texlive-ptex/test_texlive-ptex_ptex_version.sh deleted file mode 100644 index abb39d6c9b5..00000000000 --- a/testcases/function_test/pkg_test/texlive-base/texlive-ptex/test_texlive-ptex_ptex_version.sh +++ /dev/null @@ -1,72 +0,0 @@ -#!/usr/bin/bash - -# Copyright (c) 2024 ISCAS .ALL rights reserved. -# This program is licensed under Mulan PSL v2. -# You can use it according to the terms and conditions of the Mulan PSL v2. -# http://license.coscl.org.cn/MulanPSL2 -# THIS PROGRAM IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, -# EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, -# MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. -# See the Mulan PSL v2 for more details. - -# ############################################# -# @Author : honghua -# @Contact : honghua@iscas.ac.cn -# @Date : 2026-03-08 -# @License : Mulan PSL v2 -# @Desc : 测试ptex命令的版本信息输出 -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - LOG_INFO "开始测试ptex命令的版本信息输出" - LOG_INFO "检查当前环境是否已安装ptex软件包" - if dnf list installed ptex &>/dev/null; then - LOG_INFO "ptex已安装,测试结束后将保持安装状态" - INSTALLED=true - else - LOG_INFO "ptex未安装,将在测试过程中安装" - INSTALLED=false - fi - - LOG_INFO "检查yum源中是否存在ptex软件包" - if ! dnf list available ptex &>/dev/null; then - LOG_ERROR "yum源中未找到ptex软件包" - exit 255 - fi - - if [ "$INSTALLED" = false ]; then - LOG_INFO "安装ptex软件包" - dnf install -y ptex - CHECK_RESULT $? 0 0 "安装ptex软件包失败" - fi - - LOG_INFO "检查ptex命令是否存在" - if ! command -v ptex &>/dev/null; then - LOG_ERROR "ptex命令不存在" - exit 255 - fi - - LOG_INFO "检查ptex命令是否支持-version参数" - ptex -version &>/dev/null - if [ $? -eq 255 ]; then - LOG_ERROR "ptex命令不支持-version参数" - exit 255 - fi - - LOG_INFO "执行ptex -version命令获取版本信息" - ptex -version - CHECK_RESULT $? 0 0 "执行ptex -version命令失败" - - if [ "$INSTALLED" = false ]; then - LOG_INFO "卸载ptex软件包" - dnf remove -y ptex - CHECK_RESULT $? 0 0 "卸载ptex软件包失败" - LOG_INFO "环境已恢复至测试前状态" - else - LOG_INFO "测试完成,ptex软件包保持安装状态" - fi -} - -main "$@" \ No newline at end of file diff --git a/testcases/function_test/pkg_test/texlive-base/texlive-ptex/test_texlive-ptex_ptftopl_charcode_format_ascii.sh b/testcases/function_test/pkg_test/texlive-base/texlive-ptex/test_texlive-ptex_ptftopl_charcode_format_ascii.sh deleted file mode 100644 index 5ee3eb45727..00000000000 --- a/testcases/function_test/pkg_test/texlive-base/texlive-ptex/test_texlive-ptex_ptftopl_charcode_format_ascii.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-08 -# @License : Mulan PSL v2 -# @Desc : 测试ptftopl命令的charcode-format参数设置为ascii,以ASCII格式输出字符码 -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - LOG_INFO "开始测试ptftopl命令的charcode-format参数设置为ascii,以ASCII格式输出字符码" - LOG_INFO "步骤1:检查系统中是否已安装texlive-ptex软件包" - rpm -q texlive-ptex &>/dev/null - if [ $? -eq 0 ]; then - LOG_INFO "texlive-ptex软件包已安装,测试结束后将保持安装状态" - INSTALLED=1 - else - LOG_INFO "texlive-ptex软件包未安装,将在测试过程中安装" - INSTALLED=0 - fi - - LOG_INFO "步骤2:检查yum源中是否存在texlive-ptex软件包" - dnf list available texlive-ptex &>/dev/null - CHECK_RESULT $? 0 255 "yum源中未找到texlive-ptex软件包,测试退出" - - if [ $INSTALLED -eq 0 ]; then - LOG_INFO "步骤3:安装texlive-ptex软件包" - dnf install -y texlive-ptex - CHECK_RESULT $? 0 0 "安装texlive-ptex软件包失败" - fi - - LOG_INFO "步骤4:检查ptftopl命令是否支持charcode-format参数" - ptftopl --help 2>&1 | grep -q "charcode-format" - if [ $? -ne 0 ]; then - LOG_ERROR "ptftopl命令不支持charcode-format参数" - exit 255 - fi - - LOG_INFO "步骤5:测试ptftopl命令的charcode-format参数设置为ascii" - echo "test" > test_input.txt - ptftopl --charcode-format=ascii test_input.txt output.txt 2>&1 - CHECK_RESULT $? 0 0 "执行ptftopl命令失败" - LOG_INFO "ptftopl命令执行成功,输出文件已生成" - - LOG_INFO "步骤6:检查输出文件内容是否为ASCII格式" - file output.txt | grep -q "ASCII text" - CHECK_RESULT $? 0 0 "输出文件不是ASCII格式" - - LOG_INFO "步骤7:清理测试生成的文件" - rm -f test_input.txt output.txt - CHECK_RESULT $? 0 0 "清理测试文件失败" - - if [ $INSTALLED -eq 0 ]; then - LOG_INFO "步骤8:卸载texlive-ptex软件包" - dnf remove -y texlive-ptex - CHECK_RESULT $? 0 0 "卸载texlive-ptex软件包失败" - else - LOG_INFO "步骤8:测试前已安装texlive-ptex,保持安装状态" - fi - - LOG_INFO "测试完成,环境已恢复" -} - -main "$@" \ No newline at end of file diff --git a/testcases/function_test/pkg_test/texlive-base/texlive-ptex/test_texlive-ptex_ptftopl_charcode_format_octal.sh b/testcases/function_test/pkg_test/texlive-base/texlive-ptex/test_texlive-ptex_ptftopl_charcode_format_octal.sh deleted file mode 100644 index b2c2e0e9ca6..00000000000 --- a/testcases/function_test/pkg_test/texlive-base/texlive-ptex/test_texlive-ptex_ptftopl_charcode_format_octal.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-08 -# @License : Mulan PSL v2 -# @Desc : 测试ptftopl命令的charcode-format参数设置为octal,以八进制格式输出字符码 -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - # 判断是否已安装texlive-ptex软件包 - LOG_INFO "检查texlive-ptex软件包是否已安装" - rpm -q texlive-ptex > /dev/null 2>&1 - if [ $? -eq 0 ]; then - LOG_INFO "texlive-ptex软件包已安装,测试结束后将保持安装状态" - INSTALLED=1 - else - LOG_INFO "texlive-ptex软件包未安装,将在测试前安装" - INSTALLED=0 - fi - - # 检查yum源中是否有texlive-ptex软件包 - LOG_INFO "检查yum源中是否有texlive-ptex软件包" - dnf list available texlive-ptex > /dev/null 2>&1 - CHECK_RESULT $? 0 0 "yum源中未找到texlive-ptex软件包" - if [ $? -ne 0 ]; then - LOG_ERROR "yum源中未找到texlive-ptex软件包" - exit 255 - fi - - # 如果未安装,则安装软件包 - if [ $INSTALLED -eq 0 ]; then - LOG_INFO "开始安装texlive-ptex软件包" - dnf install -y texlive-ptex - CHECK_RESULT $? 0 0 "安装texlive-ptex软件包失败" - fi - - # 检查ptftopl命令是否存在 - LOG_INFO "检查ptftopl命令是否存在" - which ptftopl > /dev/null 2>&1 - CHECK_RESULT $? 0 0 "ptftopl命令不存在" - if [ $? -ne 0 ]; then - LOG_ERROR "ptftopl命令不存在" - if [ $INSTALLED -eq 0 ]; then - LOG_INFO "清理环境:卸载texlive-ptex软件包" - dnf remove -y texlive-ptex - fi - exit 255 - fi - - # 检查ptftopl命令是否支持charcode-format参数 - LOG_INFO "检查ptftopl命令是否支持charcode-format参数" - ptftopl --help 2>&1 | grep -q "charcode-format" - CHECK_RESULT $? 0 0 "ptftopl命令不支持charcode-format参数" - if [ $? -ne 0 ]; then - LOG_ERROR "ptftopl命令不支持charcode-format参数" - if [ $INSTALLED -eq 0 ]; then - LOG_INFO "清理环境:卸载texlive-ptex软件包" - dnf remove -y texlive-ptex - fi - exit 255 - fi - - # 测试ptftopl命令的charcode-format参数设置为octal - LOG_INFO "测试ptftopl命令的charcode-format参数设置为octal,以八进制格式输出字符码" - echo "test" > test_input.txt - ptftopl --charcode-format=octal test_input.txt > output.txt 2>&1 - CHECK_RESULT $? 0 0 "执行ptftopl命令失败" - - # 检查输出中是否包含八进制格式的字符码 - LOG_INFO "检查输出中是否包含八进制格式的字符码" - grep -q "\\\\[0-7][0-7][0-7]" output.txt - CHECK_RESULT $? 0 0 "输出中未找到八进制格式的字符码" - - # 清理测试文件 - LOG_INFO "清理测试文件" - rm -f test_input.txt output.txt - - # 如果测试前未安装,则卸载软件包 - if [ $INSTALLED -eq 0 ]; then - LOG_INFO "清理环境:卸载texlive-ptex软件包" - dnf remove -y texlive-ptex - CHECK_RESULT $? 0 0 "卸载texlive-ptex软件包失败" - fi - - LOG_INFO "测试完成" -} - -main "$@" \ No newline at end of file diff --git a/testcases/function_test/pkg_test/texlive-base/texlive-ptex/test_texlive-ptex_ptftopl_help.sh b/testcases/function_test/pkg_test/texlive-base/texlive-ptex/test_texlive-ptex_ptftopl_help.sh deleted file mode 100644 index 7c37c5fe771..00000000000 --- a/testcases/function_test/pkg_test/texlive-base/texlive-ptex/test_texlive-ptex_ptftopl_help.sh +++ /dev/null @@ -1,85 +0,0 @@ -#!/usr/bin/bash - -# Copyright (c) 2024 ISCAS .ALL rights reserved. -# This program is licensed under Mulan PSL v2. -# You can use it according to the terms and conditions of the Mulan PSL v2. -# http://license.coscl.org.cn/MulanPSL2 -# THIS PROGRAM IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, -# EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, -# MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. -# See the Mulan PSL v2 for more details. - -# ############################################# -# @Author : honghua -# @Contact : honghua@iscas.ac.cn -# @Date : 2026-03-08 -# @License : Mulan PSL v2 -# @Desc : 测试ptftopl命令的help参数,查看帮助信息 -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - # 定义变量 - PACKAGE_NAME="texlive-ptex" - COMMAND="ptftopl" - PARAM="--help" - - # 步骤1: 检查软件包是否在yum源中 - LOG_INFO "步骤1: 检查软件包是否在yum源中" - dnf list available ${PACKAGE_NAME} &> /dev/null - if [ $? -ne 0 ]; then - LOG_ERROR "软件包 ${PACKAGE_NAME} 不在yum源中" - exit 255 - fi - - # 步骤2: 检查环境是否已安装软件包 - LOG_INFO "步骤2: 检查环境是否已安装软件包" - rpm -q ${PACKAGE_NAME} &> /dev/null - if [ $? -eq 0 ]; then - LOG_INFO "软件包已安装,标记为保持安装状态" - KEEP_INSTALLED=1 - else - LOG_INFO "软件包未安装,标记为需要卸载" - KEEP_INSTALLED=0 - fi - - # 步骤3: 如果未安装,则安装软件包 - if [ ${KEEP_INSTALLED} -eq 0 ]; then - LOG_INFO "步骤3: 安装软件包" - dnf install -y ${PACKAGE_NAME} - CHECK_RESULT $? 0 0 "安装软件包失败" - fi - - # 步骤4: 检查命令是否存在 - LOG_INFO "步骤4: 检查命令是否存在" - which ${COMMAND} &> /dev/null - CHECK_RESULT $? 0 0 "命令 ${COMMAND} 不存在" - - # 步骤5: 检查参数是否支持 - LOG_INFO "步骤5: 检查参数是否支持" - ${COMMAND} --help 2>&1 | grep -q "${PARAM}" - if [ $? -ne 0 ]; then - LOG_ERROR "参数 ${PARAM} 不存在或不支持" - exit 255 - fi - - # 步骤6: 执行命令并检查帮助信息 - LOG_INFO "步骤6: 执行命令并检查帮助信息" - ${COMMAND} ${PARAM} &> /dev/null - CHECK_RESULT $? 0 0 "执行命令 ${COMMAND} ${PARAM} 失败" - - # 步骤7: 清理环境 - LOG_INFO "步骤7: 清理环境" - if [ ${KEEP_INSTALLED} -eq 0 ]; then - LOG_INFO "卸载软件包" - dnf remove -y ${PACKAGE_NAME} - CHECK_RESULT $? 0 0 "卸载软件包失败" - else - LOG_INFO "保持软件包安装状态" - fi - - LOG_INFO "测试完成" -} - -main "$@" \ No newline at end of file diff --git a/testcases/function_test/pkg_test/texlive-base/texlive-ptex/test_texlive-ptex_ptftopl_kanji_euc.sh b/testcases/function_test/pkg_test/texlive-base/texlive-ptex/test_texlive-ptex_ptftopl_kanji_euc.sh deleted file mode 100644 index d6ee6ffa584..00000000000 --- a/testcases/function_test/pkg_test/texlive-base/texlive-ptex/test_texlive-ptex_ptftopl_kanji_euc.sh +++ /dev/null @@ -1,58 +0,0 @@ -#!/usr/bin/bash - -# Copyright (c) 2024 ISCAS .ALL rights reserved. -# This program is licensed under Mulan PSL v2. -# You can use it according to the terms and conditions of the Mulan PSL v2. -# http://license.coscl.org.cn/MulanPSL2 -# THIS PROGRAM IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, -# EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, -# MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. -# See the Mulan PSL v2 for more details. - -# ############################################# -# @Author : honghua -# @Contact : honghua@iscas.ac.cn -# @Date : 2026-03-08 -# @License : Mulan PSL v2 -# @Desc : 测试ptftopl命令的kanji参数设置为euc,指定日文编码为EUC -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - LOG_INFO "开始测试:测试ptftopl命令的kanji参数设置为euc,指定日文编码为EUC" - LOG_INFO "步骤1:检查texlive-ptex软件包是否在yum源中" - dnf list available texlive-ptex 2>/dev/null | grep -q texlive-ptex - CHECK_RESULT $? 0 0 "yum源中未找到texlive-ptex软件包,退出测试" - LOG_INFO "步骤2:检查环境是否已安装texlive-ptex" - if rpm -q texlive-ptex >/dev/null 2>&1; then - LOG_INFO "环境已安装texlive-ptex,脚本结束时将保持安装状态" - INSTALLED=true - else - LOG_INFO "环境未安装texlive-ptex,将在测试过程中安装" - INSTALLED=false - fi - if [ "$INSTALLED" = false ]; then - LOG_INFO "步骤3:安装texlive-ptex软件包" - dnf install -y texlive-ptex - CHECK_RESULT $? 0 0 "安装texlive-ptex失败" - fi - LOG_INFO "步骤4:检查ptftopl命令是否支持kanji参数" - ptftopl --help 2>&1 | grep -q kanji - CHECK_RESULT $? 0 0 "ptftopl命令不支持kanji参数,退出测试" - LOG_INFO "步骤5:执行ptftopl命令,设置kanji参数为euc" - ptftopl --kanji=euc --help >/dev/null 2>&1 - CHECK_RESULT $? 0 0 "ptftopl命令执行失败,kanji参数设置为euc无效" - LOG_INFO "步骤6:验证ptftopl命令的kanji参数设置为euc后,日文编码是否为EUC" - ptftopl --kanji=euc --version 2>&1 | grep -q EUC - CHECK_RESULT $? 0 0 "ptftopl命令的kanji参数设置为euc后,日文编码不是EUC" - LOG_INFO "测试成功:ptftopl命令的kanji参数设置为euc,指定日文编码为EUC" - if [ "$INSTALLED" = false ]; then - LOG_INFO "步骤7:卸载texlive-ptex软件包,恢复环境" - dnf remove -y texlive-ptex - CHECK_RESULT $? 0 0 "卸载texlive-ptex失败" - fi - LOG_INFO "测试完成,环境已恢复" -} - -main "$@" \ No newline at end of file diff --git a/testcases/function_test/pkg_test/texlive-base/texlive-ptex/test_texlive-ptex_ptftopl_kanji_jis.sh b/testcases/function_test/pkg_test/texlive-base/texlive-ptex/test_texlive-ptex_ptftopl_kanji_jis.sh deleted file mode 100644 index 3781fc1e9e8..00000000000 --- a/testcases/function_test/pkg_test/texlive-base/texlive-ptex/test_texlive-ptex_ptftopl_kanji_jis.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-08 -# @License : Mulan PSL v2 -# @Desc : 测试ptftopl命令的kanji参数设置为jis,指定日文编码为JIS -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - # 判断是否已安装texlive-ptex软件包 - LOG_INFO "检查texlive-ptex软件包是否已安装" - rpm -q texlive-ptex > /dev/null 2>&1 - if [ $? -eq 0 ]; then - LOG_INFO "texlive-ptex已安装,脚本结束后保持安装状态" - INSTALLED_FLAG=1 - else - LOG_INFO "texlive-ptex未安装,将在测试后卸载" - INSTALLED_FLAG=0 - fi - - # 检查yum源中是否有texlive-ptex软件包 - LOG_INFO "检查yum源中是否有texlive-ptex软件包" - dnf list available texlive-ptex > /dev/null 2>&1 - if [ $? -ne 0 ]; then - LOG_ERROR "yum源中未找到texlive-ptex软件包" - exit 255 - fi - - # 如果未安装,则安装texlive-ptex - if [ $INSTALLED_FLAG -eq 0 ]; then - LOG_INFO "开始安装texlive-ptex软件包" - dnf install -y texlive-ptex - CHECK_RESULT $? 0 0 "安装texlive-ptex失败" - LOG_INFO "texlive-ptex软件包安装成功" - fi - - # 检查ptftopl命令是否存在 - LOG_INFO "检查ptftopl命令是否存在" - which ptftopl > /dev/null 2>&1 - if [ $? -ne 0 ]; then - LOG_ERROR "ptftopl命令不存在" - if [ $INSTALLED_FLAG -eq 0 ]; then - dnf remove -y texlive-ptex - fi - exit 255 - fi - - # 检查ptftopl命令是否支持kanji参数 - LOG_INFO "检查ptftopl命令是否支持kanji参数" - ptftopl --help 2>&1 | grep -q "kanji" - if [ $? -ne 0 ]; then - LOG_ERROR "ptftopl命令不支持kanji参数" - if [ $INSTALLED_FLAG -eq 0 ]; then - dnf remove -y texlive-ptex - fi - exit 255 - fi - - # 测试ptftopl命令的kanji参数设置为jis - LOG_INFO "测试ptftopl命令的kanji参数设置为jis,指定日文编码为JIS" - echo "test" | ptftopl -kanji=jis > /dev/null 2>&1 - CHECK_RESULT $? 0 0 "ptftopl命令的kanji参数设置为jis执行失败" - - # 清理环境 - LOG_INFO "清理测试环境" - if [ $INSTALLED_FLAG -eq 0 ]; then - LOG_INFO "卸载texlive-ptex软件包" - dnf remove -y texlive-ptex - CHECK_RESULT $? 0 0 "卸载texlive-ptex失败" - LOG_INFO "环境已恢复到测试前状态" - else - LOG_INFO "保持texlive-ptex软件包安装状态" - fi - - LOG_INFO "测试脚本执行完成" -} - -main "$@" \ No newline at end of file diff --git a/testcases/function_test/pkg_test/texlive-base/texlive-ptex/test_texlive-ptex_ptftopl_kanji_sjis.sh b/testcases/function_test/pkg_test/texlive-base/texlive-ptex/test_texlive-ptex_ptftopl_kanji_sjis.sh deleted file mode 100644 index 3a4751820b5..00000000000 --- a/testcases/function_test/pkg_test/texlive-base/texlive-ptex/test_texlive-ptex_ptftopl_kanji_sjis.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-08 -# @License : Mulan PSL v2 -# @Desc : 测试ptftopl命令的kanji参数设置为sjis,指定日文编码为SJIS -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - LOG_INFO "开始测试ptftopl命令的kanji参数设置为sjis,指定日文编码为SJIS" - LOG_INFO "步骤1:检查环境是否已安装texlive-ptex软件包" - rpm -q texlive-ptex > /dev/null 2>&1 - if [ $? -eq 0 ]; then - LOG_INFO "texlive-ptex软件包已安装" - installed_before_test=1 - else - LOG_INFO "texlive-ptex软件包未安装" - installed_before_test=0 - fi - - LOG_INFO "步骤2:检查yum源中是否存在texlive-ptex软件包" - dnf list available texlive-ptex > /dev/null 2>&1 - CHECK_RESULT $? 0 0 "yum源中不存在texlive-ptex软件包" - if [ $? -ne 0 ]; then - LOG_ERROR "yum源中不存在texlive-ptex软件包" - exit 255 - fi - - if [ $installed_before_test -eq 0 ]; then - LOG_INFO "步骤3:安装texlive-ptex软件包" - dnf install -y texlive-ptex - CHECK_RESULT $? 0 0 "安装texlive-ptex软件包失败" - fi - - LOG_INFO "步骤4:检查ptftopl命令是否存在" - command -v ptftopl > /dev/null 2>&1 - CHECK_RESULT $? 0 0 "ptftopl命令不存在" - if [ $? -ne 0 ]; then - LOG_ERROR "ptftopl命令不存在" - if [ $installed_before_test -eq 0 ]; then - LOG_INFO "清理环境:卸载texlive-ptex软件包" - dnf remove -y texlive-ptex - fi - exit 255 - fi - - LOG_INFO "步骤5:测试ptftopl命令的kanji参数设置为sjis" - ptftopl --kanji=sjis --help > /dev/null 2>&1 - CHECK_RESULT $? 0 0 "ptftopl命令不支持kanji参数或sjis值" - if [ $? -ne 0 ]; then - LOG_ERROR "ptftopl命令不支持kanji参数或sjis值" - if [ $installed_before_test -eq 0 ]; then - LOG_INFO "清理环境:卸载texlive-ptex软件包" - dnf remove -y texlive-ptex - fi - exit 255 - fi - - LOG_INFO "步骤6:执行ptftopl命令进行简单转换测试" - cat > test_input.ptf << "EOF" - % This is a simple test file - EOF - ptftopl --kanji=sjis test_input.ptf test_output.pl > /dev/null 2>&1 - CHECK_RESULT $? 0 0 "ptftopl命令执行失败" - rm -f test_input.ptf test_output.pl - - if [ $installed_before_test -eq 0 ]; then - LOG_INFO "步骤7:清理环境,卸载texlive-ptex软件包" - dnf remove -y texlive-ptex - CHECK_RESULT $? 0 0 "卸载texlive-ptex软件包失败" - else - LOG_INFO "步骤7:环境已安装,保持texlive-ptex软件包安装状态" - fi - - LOG_INFO "测试完成" -} - -main "$@" \ No newline at end of file diff --git a/testcases/function_test/pkg_test/texlive-base/texlive-ptex/test_texlive-ptex_ptftopl_kanji_utf8.sh b/testcases/function_test/pkg_test/texlive-base/texlive-ptex/test_texlive-ptex_ptftopl_kanji_utf8.sh deleted file mode 100644 index ef4b215dbb5..00000000000 --- a/testcases/function_test/pkg_test/texlive-base/texlive-ptex/test_texlive-ptex_ptftopl_kanji_utf8.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-08 -# @License : Mulan PSL v2 -# @Desc : 测试ptftopl命令的kanji参数设置为utf8,指定日文编码为UTF-8 -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - # 检查是否已安装texlive-ptex软件包 - LOG_INFO "检查是否已安装texlive-ptex软件包" - rpm -q texlive-ptex - if [ $? -eq 0 ]; then - LOG_INFO "texlive-ptex软件包已安装,测试结束后将保持安装状态" - INSTALLED=1 - else - LOG_INFO "texlive-ptex软件包未安装,将在测试前安装" - INSTALLED=0 - fi - - # 检查yum源中是否有texlive-ptex软件包 - LOG_INFO "检查yum源中是否有texlive-ptex软件包" - dnf list available texlive-ptex - if [ $? -ne 0 ]; then - LOG_ERROR "yum源中未找到texlive-ptex软件包" - exit 255 - fi - - # 如果未安装,则安装软件包 - if [ $INSTALLED -eq 0 ]; then - LOG_INFO "安装texlive-ptex软件包" - dnf install -y texlive-ptex - CHECK_RESULT $? 0 0 "安装texlive-ptex软件包失败" - fi - - # 检查ptftopl命令是否存在 - LOG_INFO "检查ptftopl命令是否存在" - which ptftopl - CHECK_RESULT $? 0 0 "ptftopl命令不存在" - - # 测试ptftopl命令的kanji参数设置为utf8,指定日文编码为UTF-8 - LOG_INFO "测试ptftopl命令的kanji参数设置为utf8,指定日文编码为UTF-8" - ptftopl -kanji=utf8 --help - CHECK_RESULT $? 0 0 "ptftopl命令不支持-kanji=utf8参数" - - # 创建一个简单的测试文件 - LOG_INFO "创建一个简单的测试文件" - cat > test.pt << EOF - test - EOF - CHECK_RESULT $? 0 0 "创建测试文件失败" - - # 使用ptftopl命令转换测试文件 - LOG_INFO "使用ptftopl命令转换测试文件,指定日文编码为UTF-8" - ptftopl -kanji=utf8 test.pt test.pl - CHECK_RESULT $? 0 0 "ptftopl命令转换失败" - - # 检查转换后的文件是否存在 - LOG_INFO "检查转换后的文件是否存在" - [ -f test.pl ] - CHECK_RESULT $? 0 0 "转换后的文件不存在" - - # 清理测试文件 - LOG_INFO "清理测试文件" - rm -f test.pt test.pl - CHECK_RESULT $? 0 0 "清理测试文件失败" - - # 如果测试前未安装,则卸载软件包 - if [ $INSTALLED -eq 0 ]; then - LOG_INFO "卸载texlive-ptex软件包" - dnf remove -y texlive-ptex - CHECK_RESULT $? 0 0 "卸载texlive-ptex软件包失败" - fi - - LOG_INFO "测试完成" -} - -main "$@" \ No newline at end of file diff --git a/testcases/function_test/pkg_test/texlive-base/texlive-ptex/test_texlive-ptex_ptftopl_verbose.sh b/testcases/function_test/pkg_test/texlive-base/texlive-ptex/test_texlive-ptex_ptftopl_verbose.sh deleted file mode 100644 index 13f67355abc..00000000000 --- a/testcases/function_test/pkg_test/texlive-base/texlive-ptex/test_texlive-ptex_ptftopl_verbose.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-08 -# @License : Mulan PSL v2 -# @Desc : 测试ptftopl命令的verbose参数,显示详细进度报告 -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - LOG_INFO "开始测试ptftopl命令的verbose参数,显示详细进度报告" - - # 检查yum源中是否存在texlive-ptex软件包 - LOG_INFO "检查yum源中是否存在texlive-ptex软件包" - dnf list texlive-ptex &> /dev/null - if [ $? -ne 0 ]; then - LOG_ERROR "yum源中不存在texlive-ptex软件包" - exit 255 - fi - - # 检查ptftopl命令的verbose参数是否存在 - LOG_INFO "检查ptftopl命令的verbose参数是否存在" - ptftopl --help 2>&1 | grep -q "\-\-verbose" - if [ $? -ne 0 ]; then - LOG_ERROR "ptftopl命令不支持verbose参数" - exit 255 - fi - - # 检查环境是否已安装texlive-ptex - LOG_INFO "检查环境是否已安装texlive-ptex" - rpm -q texlive-ptex &> /dev/null - if [ $? -eq 0 ]; then - LOG_INFO "texlive-ptex已安装,测试结束后保持安装状态" - INSTALLED=true - else - LOG_INFO "texlive-ptex未安装,开始安装" - dnf install -y texlive-ptex - CHECK_RESULT $? 0 0 "安装texlive-ptex失败" - INSTALLED=false - fi - - # 测试ptftopl命令的verbose参数 - LOG_INFO "测试ptftopl命令的verbose参数,显示详细进度报告" - ptftopl --verbose /dev/null 2>&1 | grep -q "verbose" - CHECK_RESULT $? 0 0 "ptftopl命令verbose参数测试失败" - - # 清理环境:如果之前未安装,则卸载软件包 - if [ "$INSTALLED" = false ]; then - LOG_INFO "清理环境:卸载texlive-ptex软件包" - dnf remove -y texlive-ptex - CHECK_RESULT $? 0 0 "卸载texlive-ptex失败" - fi - - LOG_INFO "测试完成" -} - -main "$@" \ No newline at end of file diff --git a/testcases/function_test/pkg_test/texlive-base/texlive-ptex/test_texlive-ptex_ptftopl_version.sh b/testcases/function_test/pkg_test/texlive-base/texlive-ptex/test_texlive-ptex_ptftopl_version.sh deleted file mode 100644 index 2855ae41853..00000000000 --- a/testcases/function_test/pkg_test/texlive-base/texlive-ptex/test_texlive-ptex_ptftopl_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-08 -# @License : Mulan PSL v2 -# @Desc : 测试ptftopl命令的version参数,查看版本信息 -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - # 定义软件包名称 - PACKAGE_NAME="texlive-ptex" - - # 检查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 - CHECK_RESULT $? 0 0 "检查yum源中软件包失败" - - # 检查ptftopl命令是否已安装 - LOG_INFO "检查ptftopl命令是否已安装" - command -v ptftopl &>/dev/null - if [ $? -eq 0 ]; then - LOG_INFO "ptftopl命令已安装,标记为已安装状态" - INSTALLED=true - else - LOG_INFO "ptftopl命令未安装,标记为未安装状态" - INSTALLED=false - fi - - # 如果未安装,则安装软件包 - if [ ${INSTALLED} = false ]; then - LOG_INFO "安装${PACKAGE_NAME}软件包" - dnf install -y ${PACKAGE_NAME} - CHECK_RESULT $? 0 0 "安装${PACKAGE_NAME}软件包失败" - fi - - # 测试ptftopl命令的version参数 - LOG_INFO "测试ptftopl命令的version参数,查看版本信息" - ptftopl --version - CHECK_RESULT $? 0 0 "执行ptftopl --version命令失败" - - # 如果之前未安装,则卸载软件包 - if [ ${INSTALLED} = false ]; then - LOG_INFO "卸载${PACKAGE_NAME}软件包,恢复环境" - dnf remove -y ${PACKAGE_NAME} - CHECK_RESULT $? 0 0 "卸载${PACKAGE_NAME}软件包失败" - fi - - LOG_INFO "测试完成,环境已恢复" -} - -main "$@" \ No newline at end of file diff --git a/testcases/function_test/pkg_test/texlive-base/texlive-ptex/test_texlive-ptex_r-pmpost_debug.sh b/testcases/function_test/pkg_test/texlive-base/texlive-ptex/test_texlive-ptex_r-pmpost_debug.sh deleted file mode 100644 index f83c541af5d..00000000000 --- a/testcases/function_test/pkg_test/texlive-base/texlive-ptex/test_texlive-ptex_r-pmpost_debug.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-08 -# @License : Mulan PSL v2 -# @Desc : 测试 pmpost 命令的 -debug 参数,打印调试信息并保留临时文件 -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - LOG_INFO "开始测试 pmpost 命令的 -debug 参数,打印调试信息并保留临时文件" - - # 检查是否已经安装 texlive-ptex - LOG_INFO "检查 texlive-ptex 是否已安装" - if rpm -q texlive-ptex &> /dev/null; then - LOG_INFO "texlive-ptex 已安装,测试后保持安装状态" - INSTALLED=true - else - LOG_INFO "texlive-ptex 未安装,将在测试后卸载" - INSTALLED=false - fi - - # 检查 yum 源中是否有 texlive-ptex - LOG_INFO "检查 yum 源中是否有 texlive-ptex 软件包" - if ! dnf list available texlive-ptex &> /dev/null; then - LOG_ERROR "yum 源中未找到 texlive-ptex 软件包" - exit 255 - fi - - # 如果未安装,则安装 texlive-ptex - if [ "$INSTALLED" = false ]; then - LOG_INFO "安装 texlive-ptex 软件包" - dnf install -y texlive-ptex - CHECK_RESULT $? 0 0 "安装 texlive-ptex 失败" - fi - - # 检查 pmpost 命令是否支持 -debug 参数 - LOG_INFO "检查 pmpost 命令是否支持 -debug 参数" - if ! pmpost --help 2>&1 | grep -q "\-debug"; then - LOG_ERROR "pmpost 命令不支持 -debug 参数" - exit 255 - fi - - # 创建一个简单的测试文件 - LOG_INFO "创建测试文件 test.tex" - cat > test.tex << "EOF" - \documentclass{article} - \begin{document} - Hello, world! - \end{document} - EOF - - # 使用 pmpost 命令的 -debug 参数处理测试文件 - LOG_INFO "使用 pmpost 命令的 -debug 参数处理测试文件" - pmpost -debug test.tex - CHECK_RESULT $? 0 0 "pmpost 命令执行失败" - - # 检查是否生成了调试信息或临时文件 - LOG_INFO "检查是否生成了调试信息或临时文件" - if ls test.* 2>/dev/null | grep -v test.tex; then - LOG_INFO "调试信息或临时文件已生成" - else - LOG_ERROR "未生成调试信息或临时文件" - exit 1 - fi - - # 清理测试文件 - LOG_INFO "清理测试文件" - rm -f test.tex test.* - - # 如果测试前未安装,则卸载 texlive-ptex - if [ "$INSTALLED" = false ]; then - LOG_INFO "卸载 texlive-ptex 软件包" - dnf remove -y texlive-ptex - CHECK_RESULT $? 0 0 "卸载 texlive-ptex 失败" - fi - - LOG_INFO "测试完成" -} - -main "$@" \ No newline at end of file diff --git a/testcases/function_test/pkg_test/texlive-base/texlive-ptex/test_texlive-ptex_r-pmpost_dvitomp.sh b/testcases/function_test/pkg_test/texlive-base/texlive-ptex/test_texlive-ptex_r-pmpost_dvitomp.sh deleted file mode 100644 index e08c8fb36f8..00000000000 --- a/testcases/function_test/pkg_test/texlive-base/texlive-ptex/test_texlive-ptex_r-pmpost_dvitomp.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-08 -# @License : Mulan PSL v2 -# @Desc : 测试 pmpost 命令的 --dvitomp 参数,仅作为 DVI 到 MPX 的转换器运行 -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - LOG_INFO "检查是否已安装 texlive-ptex 软件包" - if rpm -q texlive-ptex &> /dev/null; then - LOG_INFO "texlive-ptex 已安装,脚本结束时将保持安装状态" - INSTALLED=true - else - LOG_INFO "texlive-ptex 未安装,将在测试过程中安装" - INSTALLED=false - fi - - LOG_INFO "检查 yum 源中是否存在 texlive-ptex 软件包" - if ! dnf list available texlive-ptex &> /dev/null; then - LOG_ERROR "yum 源中未找到 texlive-ptex 软件包" - exit 255 - fi - - if [ "$INSTALLED" = false ]; then - LOG_INFO "安装 texlive-ptex 软件包" - dnf install -y texlive-ptex - CHECK_RESULT $? 0 0 "安装 texlive-ptex 失败" - fi - - LOG_INFO "验证 pmpost 命令是否存在" - which pmpost - CHECK_RESULT $? 0 0 "pmpost 命令未找到" - - LOG_INFO "检查 pmpost 命令是否支持 --dvitomp 参数" - pmpost --help 2>&1 | grep -q -- --dvitomp - CHECK_RESULT $? 0 0 "pmpost 命令不支持 --dvitomp 参数" - - LOG_INFO "创建测试用 DVI 文件" - cat > test_input.dvi << "EOF" - (This is a minimal DVI file) - EOF - CHECK_RESULT $? 0 0 "创建测试 DVI 文件失败" - - LOG_INFO "执行 pmpost --dvitomp 进行 DVI 到 MPX 转换测试" - pmpost --dvitomp test_input.dvi test_output.mpx - CHECK_RESULT $? 0 0 "pmpost --dvitomp 执行失败" - - LOG_INFO "检查是否生成了输出文件" - [ -f test_output.mpx ] - CHECK_RESULT $? 0 0 "未生成预期的输出文件 test_output.mpx" - - LOG_INFO "清理测试文件" - rm -f test_input.dvi test_output.mpx - CHECK_RESULT $? 0 0 "清理测试文件失败" - - if [ "$INSTALLED" = false ]; then - LOG_INFO "卸载 texlive-ptex 软件包" - dnf remove -y texlive-ptex - CHECK_RESULT $? 0 0 "卸载 texlive-ptex 失败" - LOG_INFO "环境已恢复至未安装状态" - else - LOG_INFO "环境保持 texlive-ptex 已安装状态" - fi -} - -main "$@" \ No newline at end of file diff --git a/testcases/function_test/pkg_test/texlive-base/texlive-ptex/test_texlive-ptex_r-pmpost_file_line_error.sh b/testcases/function_test/pkg_test/texlive-base/texlive-ptex/test_texlive-ptex_r-pmpost_file_line_error.sh deleted file mode 100644 index 5fd5fae5a66..00000000000 --- a/testcases/function_test/pkg_test/texlive-base/texlive-ptex/test_texlive-ptex_r-pmpost_file_line_error.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-08 -# @License : Mulan PSL v2 -# @Desc : 测试 pmpost 命令的 -file-line-error 参数,启用文件:行:错误样式消息 -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - # 检查是否已安装texlive-ptex包 - LOG_INFO "检查是否已安装texlive-ptex包" - rpm -q texlive-ptex > /dev/null 2>&1 - if [ $? -eq 0 ]; then - LOG_INFO "texlive-ptex已安装,脚本结束将保持安装状态" - INSTALLED_FLAG=1 - else - LOG_INFO "texlive-ptex未安装,将在测试过程中安装" - INSTALLED_FLAG=0 - fi - - # 检查yum源中是否有texlive-ptex包 - LOG_INFO "检查yum源中是否有texlive-ptex包" - dnf list available texlive-ptex > /dev/null 2>&1 - CHECK_RESULT $? 0 0 "yum源中未找到texlive-ptex包" - if [ $? -ne 0 ]; then - LOG_ERROR "yum源中未找到texlive-ptex包" - exit 255 - fi - - # 如果未安装,则安装texlive-ptex包 - if [ $INSTALLED_FLAG -eq 0 ]; then - LOG_INFO "安装texlive-ptex包" - dnf install -y texlive-ptex - CHECK_RESULT $? 0 0 "安装texlive-ptex包失败" - fi - - # 测试pmpost命令的-file-line-error参数 - LOG_INFO "测试pmpost命令的-file-line-error参数" - pmpost -file-line-error --help > /dev/null 2>&1 - CHECK_RESULT $? 0 0 "pmpost命令不支持-file-line-error参数" - if [ $? -ne 0 ]; then - LOG_ERROR "pmpost命令不支持-file-line-error参数" - # 清理环境 - if [ $INSTALLED_FLAG -eq 0 ]; then - LOG_INFO "卸载texlive-ptex包" - dnf remove -y texlive-ptex - fi - exit 255 - fi - - # 创建一个简单的测试文件 - LOG_INFO "创建测试文件" - TEST_FILE="test_pmpost.tex" - cat > $TEST_FILE << "EOF" - \documentclass{article} - \begin{document} - Hello, world! - \end{document} - EOF - CHECK_RESULT $? 0 0 "创建测试文件失败" - - # 使用pmpost命令处理测试文件,启用-file-line-error参数 - LOG_INFO "使用pmpost命令处理测试文件,启用-file-line-error参数" - pmpost -file-line-error $TEST_FILE > pmpost_output.txt 2>&1 - CHECK_RESULT $? 0 0 "pmpost命令执行失败" - - # 检查输出中是否包含文件:行:错误样式消息 - LOG_INFO "检查输出中是否包含文件:行:错误样式消息" - if grep -q ".*:[0-9]*:.*" pmpost_output.txt; then - LOG_INFO "成功启用文件:行:错误样式消息" - else - LOG_ERROR "未找到文件:行:错误样式消息" - # 清理临时文件 - rm -f $TEST_FILE pmpost_output.txt - # 恢复环境 - if [ $INSTALLED_FLAG -eq 0 ]; then - LOG_INFO "卸载texlive-ptex包" - dnf remove -y texlive-ptex - fi - exit 1 - fi - - # 清理临时文件 - LOG_INFO "清理临时文件" - rm -f $TEST_FILE pmpost_output.txt - - # 恢复环境:如果测试前未安装,则卸载texlive-ptex包 - if [ $INSTALLED_FLAG -eq 0 ]; then - LOG_INFO "卸载texlive-ptex包" - dnf remove -y texlive-ptex - CHECK_RESULT $? 0 0 "卸载texlive-ptex包失败" - fi - - LOG_INFO "测试完成" -} - -main "$@" \ No newline at end of file diff --git a/testcases/function_test/pkg_test/texlive-base/texlive-ptex/test_texlive-ptex_r-pmpost_help.sh b/testcases/function_test/pkg_test/texlive-base/texlive-ptex/test_texlive-ptex_r-pmpost_help.sh deleted file mode 100644 index 6e9b3f7f35b..00000000000 --- a/testcases/function_test/pkg_test/texlive-base/texlive-ptex/test_texlive-ptex_r-pmpost_help.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-08 -# @License : Mulan PSL v2 -# @Desc : 测试 pmpost 命令的 -help 参数,显示帮助信息并退出 -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - # 检查是否已安装texlive-ptex - LOG_INFO "检查是否已安装texlive-ptex" - rpm -q texlive-ptex &>/dev/null - if [ $? -eq 0 ]; then - LOG_INFO "texlive-ptex已安装,脚本结束后将保持安装状态" - INSTALLED="true" - else - LOG_INFO "texlive-ptex未安装,将进行安装测试" - INSTALLED="false" - fi - - # 检查yum源中是否有texlive-ptex软件包 - LOG_INFO "检查yum源中是否有texlive-ptex软件包" - dnf list available texlive-ptex &>/dev/null - if [ $? -ne 0 ]; then - LOG_ERROR "yum源中没有texlive-ptex软件包" - exit 255 - fi - - # 如果未安装,则安装texlive-ptex - if [ "$INSTALLED" == "false" ]; then - LOG_INFO "安装texlive-ptex软件包" - dnf install -y texlive-ptex - CHECK_RESULT $? 0 0 "安装texlive-ptex失败" - fi - - # 检查pmpost命令是否存在 - LOG_INFO "检查pmpost命令是否存在" - which pmpost &>/dev/null - if [ $? -ne 0 ]; then - LOG_ERROR "pmpost命令不存在" - if [ "$INSTALLED" == "false" ]; then - LOG_INFO "卸载texlive-ptex软件包" - dnf remove -y texlive-ptex - fi - exit 255 - fi - - # 测试pmpost命令的-help参数 - LOG_INFO "测试pmpost命令的-help参数" - pmpost -help &>/dev/null - CHECK_RESULT $? 0 0 "pmpost -help执行失败" - - # 验证-help参数显示帮助信息 - LOG_INFO "验证-help参数显示帮助信息" - pmpost -help 2>&1 | grep -q "Usage" - CHECK_RESULT $? 0 0 "pmpost -help未显示帮助信息" - - # 环境恢复 - if [ "$INSTALLED" == "false" ]; then - LOG_INFO "卸载texlive-ptex软件包" - dnf remove -y texlive-ptex - CHECK_RESULT $? 0 0 "卸载texlive-ptex失败" - else - LOG_INFO "保持texlive-ptex安装状态" - fi - - LOG_INFO "测试完成" -} - -main "$@" \ No newline at end of file diff --git a/testcases/function_test/pkg_test/texlive-base/texlive-ptex/test_texlive-ptex_r-pmpost_ini.sh b/testcases/function_test/pkg_test/texlive-base/texlive-ptex/test_texlive-ptex_r-pmpost_ini.sh deleted file mode 100644 index e5865c36450..00000000000 --- a/testcases/function_test/pkg_test/texlive-base/texlive-ptex/test_texlive-ptex_r-pmpost_ini.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-08 -# @License : Mulan PSL v2 -# @Desc : 测试 pmpost 命令的 -ini 参数,用于初始化并转储内存文件 -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - # 环境检查:检查是否已安装texlive-ptex包 - LOG_INFO "检查是否已安装texlive-ptex包" - rpm -q texlive-ptex > /dev/null 2>&1 - if [ $? -eq 0 ]; then - LOG_INFO "texlive-ptex已安装,标记为已存在" - PKG_INSTALLED=1 - else - LOG_INFO "texlive-ptex未安装,标记为未安装" - PKG_INSTALLED=0 - fi - - # 检查yum源中是否有texlive-ptex包 - LOG_INFO "检查yum源中是否有texlive-ptex包" - dnf list available texlive-ptex > /dev/null 2>&1 - if [ $? -ne 0 ]; then - LOG_ERROR "yum源中未找到texlive-ptex包" - exit 255 - fi - - # 如果未安装,则安装texlive-ptex包 - if [ $PKG_INSTALLED -eq 0 ]; then - LOG_INFO "开始安装texlive-ptex包" - dnf install -y texlive-ptex - CHECK_RESULT $? 0 0 "安装texlive-ptex包失败" - LOG_INFO "texlive-ptex包安装成功" - else - LOG_INFO "texlive-ptex包已安装,跳过安装步骤" - fi - - # 检查pmpost命令是否存在 - LOG_INFO "检查pmpost命令是否存在" - which pmpost > /dev/null 2>&1 - if [ $? -ne 0 ]; then - LOG_ERROR "pmpost命令不存在" - exit 255 - fi - - # 检查pmpost命令是否支持-ini参数 - LOG_INFO "检查pmpost命令是否支持-ini参数" - pmpost --help 2>&1 | grep -q "\-ini" - if [ $? -ne 0 ]; then - LOG_ERROR "pmpost命令不支持-ini参数" - exit 255 - fi - - # 测试pmpost命令的-ini参数 - LOG_INFO "测试pmpost命令的-ini参数" - pmpost -ini - CHECK_RESULT $? 0 0 "pmpost -ini命令执行失败" - - # 清理环境:如果之前未安装,则卸载texlive-ptex包 - if [ $PKG_INSTALLED -eq 0 ]; then - LOG_INFO "清理环境:卸载texlive-ptex包" - dnf remove -y texlive-ptex - CHECK_RESULT $? 0 0 "卸载texlive-ptex包失败" - LOG_INFO "texlive-ptex包卸载成功" - else - LOG_INFO "保持texlive-ptex包安装状态" - fi - - LOG_INFO "测试完成" -} - -main "$@" \ No newline at end of file diff --git a/testcases/function_test/pkg_test/texlive-base/texlive-ptex/test_texlive-ptex_r-pmpost_interaction.sh b/testcases/function_test/pkg_test/texlive-base/texlive-ptex/test_texlive-ptex_r-pmpost_interaction.sh deleted file mode 100644 index fea9cfcf262..00000000000 --- a/testcases/function_test/pkg_test/texlive-base/texlive-ptex/test_texlive-ptex_r-pmpost_interaction.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-08 -# @License : Mulan PSL v2 -# @Desc : 测试 pmpost 命令的 -interaction 参数,设置交互模式 -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - LOG_INFO "开始测试 pmpost 命令的 -interaction 参数,设置交互模式" - - # 检查软件包是否在yum源中 - LOG_INFO "检查texlive-ptex软件包是否在yum源中" - dnf list texlive-ptex 2>/dev/null | grep -q "texlive-ptex" - if [ $? -ne 0 ]; then - LOG_ERROR "texlive-ptex软件包不在yum源中" - exit 255 - fi - - # 检查是否已安装texlive-ptex - LOG_INFO "检查texlive-ptex是否已安装" - rpm -q texlive-ptex >/dev/null 2>&1 - INSTALLED=$? - - if [ $INSTALLED -ne 0 ]; then - LOG_INFO "texlive-ptex未安装,开始安装" - dnf install -y texlive-ptex - CHECK_RESULT $? 0 0 "安装texlive-ptex失败" - NEED_UNINSTALL=1 - else - LOG_INFO "texlive-ptex已安装" - NEED_UNINSTALL=0 - fi - - # 检查pmpost命令是否存在 - LOG_INFO "检查pmpost命令是否存在" - which pmpost >/dev/null 2>&1 - if [ $? -ne 0 ]; then - LOG_ERROR "pmpost命令不存在" - if [ $NEED_UNINSTALL -eq 1 ]; then - dnf remove -y texlive-ptex - fi - exit 255 - fi - - # 检查-interaction参数是否支持 - LOG_INFO "检查pmpost命令是否支持-interaction参数" - pmpost --help 2>&1 | grep -q "\-interaction" - if [ $? -ne 0 ]; then - LOG_ERROR "pmpost命令不支持-interaction参数" - if [ $NEED_UNINSTALL -eq 1 ]; then - dnf remove -y texlive-ptex - fi - exit 255 - fi - - # 测试-interaction参数 - LOG_INFO "测试pmpost命令的-interaction参数" - echo "test" > test.tex - pmpost -interaction=nonstopmode test.tex - CHECK_RESULT $? 0 0 "pmpost -interaction参数执行失败" - rm -f test.tex test.dvi - - # 清理环境 - LOG_INFO "清理测试环境" - if [ $NEED_UNINSTALL -eq 1 ]; then - LOG_INFO "卸载texlive-ptex软件包" - dnf remove -y texlive-ptex - CHECK_RESULT $? 0 0 "卸载texlive-ptex失败" - fi - - LOG_INFO "测试完成" -} - -main "$@" \ No newline at end of file diff --git a/testcases/function_test/pkg_test/texlive-base/texlive-ptex/test_texlive-ptex_r-pmpost_jobname.sh b/testcases/function_test/pkg_test/texlive-base/texlive-ptex/test_texlive-ptex_r-pmpost_jobname.sh deleted file mode 100644 index cd1cbf1af57..00000000000 --- a/testcases/function_test/pkg_test/texlive-base/texlive-ptex/test_texlive-ptex_r-pmpost_jobname.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-08 -# @License : Mulan PSL v2 -# @Desc : 测试 pmpost 命令的 -jobname 参数,设置作业名称 -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - LOG_INFO "开始测试 pmpost 命令的 -jobname 参数" - # 检查系统中是否已安装 texlive-ptex 包 - LOG_INFO "检查 texlive-ptex 是否已安装" - if rpm -q texlive-ptex &> /dev/null; then - LOG_INFO "texlive-ptex 已安装,测试后保持安装状态" - INSTALLED=true - else - LOG_INFO "texlive-ptex 未安装,将在测试过程中安装" - INSTALLED=false - fi - - # 检查 yum 源中是否存在 texlive-ptex 包 - LOG_INFO "检查 yum 源中是否存在 texlive-ptex 包" - if ! dnf list available texlive-ptex &> /dev/null; then - LOG_ERROR "yum 源中未找到 texlive-ptex 包" - exit 255 - fi - - # 如果未安装,则安装软件包 - if [ "$INSTALLED" = false ]; then - LOG_INFO "安装 texlive-ptex 包" - dnf install -y texlive-ptex - CHECK_RESULT $? 0 0 "安装 texlive-ptex 失败" - fi - - # 检查 pmpost 命令是否存在 - LOG_INFO "检查 pmpost 命令是否存在" - if ! command -v pmpost &> /dev/null; then - LOG_ERROR "pmpost 命令不存在" - exit 255 - fi - - # 测试 -jobname 参数是否存在 - LOG_INFO "测试 -jobname 参数是否存在" - pmpost -jobname testjob 2>&1 | grep -q "unrecognized option" - if [ $? -eq 0 ]; then - LOG_ERROR "pmpost 命令不支持 -jobname 参数" - exit 255 - fi - - # 测试 -jobname 参数功能 - LOG_INFO "测试 -jobname 参数功能,设置作业名称为 testjob" - pmpost -jobname testjob - CHECK_RESULT $? 0 0 "pmpost -jobname 参数执行失败" - - # 清理环境:如果测试前未安装,则卸载软件包 - if [ "$INSTALLED" = false ]; then - LOG_INFO "卸载 texlive-ptex 包" - dnf remove -y texlive-ptex - CHECK_RESULT $? 0 0 "卸载 texlive-ptex 失败" - fi - - LOG_INFO "测试 pmpost 命令的 -jobname 参数完成" -} - -main "$@" \ No newline at end of file diff --git a/testcases/function_test/pkg_test/texlive-base/texlive-ptex/test_texlive-ptex_r-pmpost_kanji.sh b/testcases/function_test/pkg_test/texlive-base/texlive-ptex/test_texlive-ptex_r-pmpost_kanji.sh deleted file mode 100644 index 1fa7febcf6a..00000000000 --- a/testcases/function_test/pkg_test/texlive-base/texlive-ptex/test_texlive-ptex_r-pmpost_kanji.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-08 -# @License : Mulan PSL v2 -# @Desc : 测试 pmpost 命令的 -kanji 参数,设置日语编码 -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - # 测试 pmpost 命令的 -kanji 参数,设置日语编码 - # 检查是否已安装 texlive-ptex 和 texlive-ptex-base 软件包 - LOG_INFO "检查 texlive-ptex 和 texlive-ptex-base 是否已安装" - if dnf list installed texlive-ptex texlive-ptex-base >/dev/null 2>&1; then - LOG_INFO "texlive-ptex 和 texlive-ptex-base 已安装,测试结束后保持安装状态" - INSTALLED=true - else - LOG_INFO "texlive-ptex 和 texlive-ptex-base 未安装,测试结束后将卸载" - INSTALLED=false - fi - - # 检查 yum 源中是否有 texlive-ptex 和 texlive-ptex-base 软件包 - LOG_INFO "检查 yum 源中是否有 texlive-ptex 和 texlive-ptex-base 软件包" - if ! dnf list available texlive-ptex texlive-ptex-base >/dev/null 2>&1; then - LOG_ERROR "yum 源中缺少 texlive-ptex 或 texlive-ptex-base 软件包" - exit 255 - fi - - # 如果未安装,则安装软件包 - if [ "$INSTALLED" = false ]; then - LOG_INFO "安装 texlive-ptex 和 texlive-ptex-base 软件包" - dnf install -y texlive-ptex texlive-ptex-base - CHECK_RESULT $? 0 0 "安装 texlive-ptex 和 texlive-ptex-base 失败" - fi - - # 检查 pmpost 命令是否存在 - LOG_INFO "检查 pmpost 命令是否存在" - if ! command -v pmpost >/dev/null 2>&1; then - LOG_ERROR "pmpost 命令不存在" - exit 255 - fi - - # 测试 pmpost 命令的 -kanji 参数 - LOG_INFO "测试 pmpost 命令的 -kanji 参数" - pmpost -kanji=jis - CHECK_RESULT $? 0 0 "pmpost -kanji=jis 执行失败" - - # 测试不支持的参数 - LOG_INFO "测试 pmpost 命令不支持的参数" - pmpost -invalid-param 2>/dev/null - if [ $? -ne 255 ]; then - LOG_ERROR "pmpost 命令不支持 -invalid-param 参数但未正确退出" - exit 255 - fi - - # 清理环境:如果测试前未安装,则卸载软件包 - if [ "$INSTALLED" = false ]; then - LOG_INFO "卸载 texlive-ptex 和 texlive-ptex-base 软件包" - dnf remove -y texlive-ptex texlive-ptex-base - CHECK_RESULT $? 0 0 "卸载 texlive-ptex 和 texlive-ptex-base 失败" - fi - - LOG_INFO "测试完成,环境已恢复" -} - -main "$@" \ No newline at end of file diff --git a/testcases/function_test/pkg_test/texlive-base/texlive-ptex/test_texlive-ptex_r-pmpost_kpathsea_debug.sh b/testcases/function_test/pkg_test/texlive-base/texlive-ptex/test_texlive-ptex_r-pmpost_kpathsea_debug.sh deleted file mode 100644 index e9e9dbc7a6f..00000000000 --- a/testcases/function_test/pkg_test/texlive-base/texlive-ptex/test_texlive-ptex_r-pmpost_kpathsea_debug.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-08 -# @License : Mulan PSL v2 -# @Desc : 测试 pmpost 命令的 -kpathsea-debug 参数,根据数字位设置路径搜索调试标志 -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - LOG_INFO "开始测试 pmpost 命令的 -kpathsea-debug 参数功能" - - # 定义软件包名称 - PACKAGE_NAME="texlive-ptex" - - # 步骤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_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: 检查 pmpost 命令是否可用 - LOG_INFO "检查 pmpost 命令是否可用" - if ! command -v pmpost &>/dev/null; then - LOG_ERROR "pmpost 命令不存在" - exit 255 - fi - - # 步骤5: 测试 pmpost 命令的 -kpathsea-debug 参数 - LOG_INFO "测试 pmpost -kpathsea-debug 参数" - pmpost -kpathsea-debug 1 - CHECK_RESULT $? 0 0 "pmpost -kpathsea-debug 1 执行失败" - - # 步骤6: 测试无效参数 - LOG_INFO "测试 pmpost 命令无效参数" - pmpost -invalid-parameter 2>/dev/null - if [ $? -ne 255 ]; then - LOG_ERROR "pmpost 命令应不支持无效参数" - exit 255 - fi - - # 步骤7: 测试多个不同的 -kpathsea-debug 参数值 - LOG_INFO "测试 pmpost -kpathsea-debug 0" - pmpost -kpathsea-debug 0 - CHECK_RESULT $? 0 0 "pmpost -kpathsea-debug 0 执行失败" - - LOG_INFO "测试 pmpost -kpathsea-debug 2" - pmpost -kpathsea-debug 2 - CHECK_RESULT $? 0 0 "pmpost -kpathsea-debug 2 执行失败" - - LOG_INFO "测试 pmpost -kpathsea-debug 4" - pmpost -kpathsea-debug 4 - CHECK_RESULT $? 0 0 "pmpost -kpathsea-debug 4 执行失败" - - # 步骤8: 清理环境 - 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 "测试 pmpost 命令的 -kpathsea-debug 参数功能完成" -} - -main "$@" \ No newline at end of file diff --git a/testcases/function_test/pkg_test/texlive-base/texlive-ptex/test_texlive-ptex_r-pmpost_mem.sh b/testcases/function_test/pkg_test/texlive-base/texlive-ptex/test_texlive-ptex_r-pmpost_mem.sh deleted file mode 100644 index 0ce64d1a057..00000000000 --- a/testcases/function_test/pkg_test/texlive-base/texlive-ptex/test_texlive-ptex_r-pmpost_mem.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-08 -# @License : Mulan PSL v2 -# @Desc : 测试 pmpost 命令的 -mem 参数,使用指定的内存文件名称 -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - set -e - - LOG_INFO "开始测试 pmpost 命令的 -mem 参数" - - # 定义软件包名称 - PACKAGE_NAME="texlive-ptex_r" - - # 步骤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} 已安装,标记为已存在" - PACKAGE_PRE_INSTALLED=true - else - LOG_INFO "软件包 ${PACKAGE_NAME} 未安装" - PACKAGE_PRE_INSTALLED=false - fi - - # 步骤3:如果未安装,则安装软件包 - if [ "${PACKAGE_PRE_INSTALLED}" = "false" ]; then - LOG_INFO "步骤3:安装软件包 ${PACKAGE_NAME}" - dnf install -y ${PACKAGE_NAME} - CHECK_RESULT $? 0 0 "安装软件包 ${PACKAGE_NAME} 失败" - fi - - # 步骤4:检查 pmpost 命令是否可用及其 -mem 参数 - LOG_INFO "步骤4:检查 pmpost 命令及其 -mem 参数" - if ! command -v pmpost &>/dev/null; then - LOG_ERROR "pmpost 命令未找到,可能安装不完整" - exit 255 - fi - - # 尝试获取 pmpost 命令的帮助信息,检查是否支持 -mem 参数 - if ! pmpost --help 2>&1 | grep -q -- "-mem"; then - LOG_ERROR "pmpost 命令不支持 -mem 参数" - exit 255 - fi - - # 步骤5:创建一个测试用的内存文件 - LOG_INFO "步骤5:创建测试用的内存文件" - TEST_MEM_FILE="test_memory_file.mem" - echo "Test memory content" > ${TEST_MEM_FILE} - CHECK_RESULT $? 0 0 "创建内存文件 ${TEST_MEM_FILE} 失败" - - # 步骤6:使用 pmpost 命令的 -mem 参数处理内存文件 - LOG_INFO "步骤6:执行 pmpost -mem 命令处理内存文件" - pmpost -mem ${TEST_MEM_FILE} - CHECK_RESULT $? 0 0 "pmpost -mem 命令执行失败" - - # 步骤7:清理测试生成的文件 - LOG_INFO "步骤7:清理测试生成的文件" - rm -f ${TEST_MEM_FILE} - CHECK_RESULT $? 0 0 "删除测试文件 ${TEST_MEM_FILE} 失败" - - # 步骤8:环境恢复 - 如果软件包是本次测试安装的,则卸载 - if [ "${PACKAGE_PRE_INSTALLED}" = "false" ]; then - LOG_INFO "步骤8:卸载测试安装的软件包 ${PACKAGE_NAME}" - dnf remove -y ${PACKAGE_NAME} - CHECK_RESULT $? 0 0 "卸载软件包 ${PACKAGE_NAME} 失败" - else - LOG_INFO "步骤8:软件包 ${PACKAGE_NAME} 为预安装,保持原状" - fi - - LOG_INFO "pmpost 命令 -mem 参数测试完成" -} - -main "$@" \ No newline at end of file diff --git a/testcases/function_test/pkg_test/texlive-base/texlive-ptex/test_texlive-ptex_r-pmpost_no_file_line_error.sh b/testcases/function_test/pkg_test/texlive-base/texlive-ptex/test_texlive-ptex_r-pmpost_no_file_line_error.sh deleted file mode 100644 index 3f0160d598b..00000000000 --- a/testcases/function_test/pkg_test/texlive-base/texlive-ptex/test_texlive-ptex_r-pmpost_no_file_line_error.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-08 -# @License : Mulan PSL v2 -# @Desc : 测试 pmpost 命令的 -no-file-line-error 参数,禁用文件:行:错误样式消息 -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - set -e - - LOG_INFO "开始测试 pmpost 命令的 -no-file-line-error 参数功能" - - LOG_INFO "步骤1: 检查当前环境是否已安装 texlive-ptex" - if rpm -q texlive-ptex > /dev/null 2>&1; then - LOG_INFO "检测到 texlive-ptex 已安装,测试结束后将保持安装状态" - INSTALLED_BEFORE=true - else - LOG_INFO "未检测到 texlive-ptex 安装" - INSTALLED_BEFORE=false - fi - - LOG_INFO "步骤2: 检查 yum 源中是否存在 texlive-ptex 软件包" - if ! dnf list available texlive-ptex > /dev/null 2>&1; then - LOG_ERROR "yum 源中未找到 texlive-ptex 软件包" - exit 255 - fi - LOG_INFO "yum 源中存在 texlive-ptex 软件包" - - if [ "$INSTALLED_BEFORE" = "false" ]; then - LOG_INFO "步骤3: 安装 texlive-ptex 软件包" - dnf install -y texlive-ptex - CHECK_RESULT $? 0 0 "安装 texlive-ptex 失败" - LOG_INFO "texlive-ptex 安装成功" - fi - - LOG_INFO "步骤4: 查找 pmpost 命令路径" - PMPOST_CMD=$(which pmpost 2>/dev/null) - if [ -z "$PMPOST_CMD" ]; then - LOG_ERROR "未找到 pmpost 命令" - exit 1 - fi - LOG_INFO "找到 pmpost 命令: $PMPOST_CMD" - - LOG_INFO "步骤5: 检查 pmpost 命令是否支持 -no-file-line-error 参数" - if ! $PMPOST_CMD --help 2>&1 | grep -q -- "-no-file-line-error"; then - LOG_ERROR "pmpost 命令不支持 -no-file-line-error 参数" - exit 255 - fi - LOG_INFO "pmpost 命令支持 -no-file-line-error 参数" - - LOG_INFO "步骤6: 创建一个简单的测试 TeX 文件" - TEST_TEX_FILE="/tmp/test_pmpost.tex" - cat > "$TEST_TEX_FILE" << "EOF" - \documentclass{article} - \begin{document} - Test document for pmpost. - \end{document} - EOF - CHECK_RESULT $? 0 0 "创建测试 TeX 文件失败" - LOG_INFO "测试 TeX 文件创建成功: $TEST_TEX_FILE" - - LOG_INFO "步骤7: 使用 -no-file-line-error 参数运行 pmpost 命令" - $PMPOST_CMD -no-file-line-error "$TEST_TEX_FILE" > /tmp/pmpost_output.log 2>&1 - PMPOST_EXIT_CODE=$? - if [ $PMPOST_EXIT_CODE -ne 0 ]; then - LOG_ERROR "pmpost 命令执行失败,退出码: $PMPOST_EXIT_CODE" - cat /tmp/pmpost_output.log - exit $PMPOST_EXIT_CODE - fi - LOG_INFO "pmpost 命令执行成功" - - LOG_INFO "步骤8: 检查输出日志中是否包含 "文件:行:错误" 样式消息" - if grep -q "\.tex:[0-9]*:" /tmp/pmpost_output.log; then - LOG_ERROR "输出中仍然包含 "文件:行:错误" 样式消息,参数可能未生效" - exit 1 - else - LOG_INFO "输出中未发现 "文件:行:错误" 样式消息,参数功能正常" - fi - - LOG_INFO "步骤9: 清理测试文件" - rm -f "$TEST_TEX_FILE" /tmp/pmpost_output.log - CHECK_RESULT $? 0 0 "清理测试文件失败" - LOG_INFO "测试文件清理完成" - - if [ "$INSTALLED_BEFORE" = "false" ]; then - LOG_INFO "步骤10: 卸载测试安装的 texlive-ptex 软件包" - dnf remove -y texlive-ptex - CHECK_RESULT $? 0 0 "卸载 texlive-ptex 失败" - LOG_INFO "texlive-ptex 卸载成功,环境已恢复" - else - LOG_INFO "步骤10: 测试前环境已安装 texlive-ptex,保持安装状态,无需卸载" - fi - - LOG_INFO "测试 pmpost 命令的 -no-file-line-error 参数功能完成" -} - -main "$@" \ No newline at end of file diff --git a/testcases/function_test/pkg_test/texlive-base/texlive-ptex/test_texlive-ptex_r-pmpost_numbersystem.sh b/testcases/function_test/pkg_test/texlive-base/texlive-ptex/test_texlive-ptex_r-pmpost_numbersystem.sh deleted file mode 100644 index 9450d998475..00000000000 --- a/testcases/function_test/pkg_test/texlive-base/texlive-ptex/test_texlive-ptex_r-pmpost_numbersystem.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-08 -# @License : Mulan PSL v2 -# @Desc : 测试 pmpost 命令的 -numbersystem 参数,设置数字系统模式 -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - # 检查是否已经安装texlive-ptex-r包 - LOG_INFO "检查是否已安装texlive-ptex-r软件包" - rpm -q texlive-ptex-r > /dev/null 2>&1 - if [ $? -eq 0 ]; then - LOG_INFO "texlive-ptex-r软件包已经安装,测试后将保持安装状态" - INSTALLED=1 - else - LOG_INFO "texlive-ptex-r软件包未安装,测试后将卸载" - INSTALLED=0 - fi - - # 检查yum源中是否有texlive-ptex-r软件包 - LOG_INFO "检查yum源中是否有texlive-ptex-r软件包" - dnf list available texlive-ptex-r > /dev/null 2>&1 - if [ $? -ne 0 ]; then - LOG_ERROR "yum源中没有找到texlive-ptex-r软件包" - exit 255 - fi - - # 如果未安装,则安装软件包 - if [ $INSTALLED -eq 0 ]; then - LOG_INFO "安装texlive-ptex-r软件包" - dnf install -y texlive-ptex-r - CHECK_RESULT $? 0 0 "安装texlive-ptex-r软件包失败" - fi - - # 检查pmpost命令是否存在 - LOG_INFO "检查pmpost命令是否存在" - which pmpost > /dev/null 2>&1 - if [ $? -ne 0 ]; then - LOG_ERROR "pmpost命令不存在" - if [ $INSTALLED -eq 0 ]; then - dnf remove -y texlive-ptex-r - fi - exit 255 - fi - - # 检查pmpost命令是否支持-numbersystem参数 - LOG_INFO "检查pmpost命令是否支持-numbersystem参数" - pmpost --help 2>&1 | grep -q "\-numbersystem" - if [ $? -ne 0 ]; then - LOG_ERROR "pmpost命令不支持-numbersystem参数" - if [ $INSTALLED -eq 0 ]; then - dnf remove -y texlive-ptex-r - fi - exit 255 - fi - - # 测试pmpost命令的-numbersystem参数 - LOG_INFO "测试pmpost命令的-numbersystem参数" - echo "test" > test.tex - pmpost -numbersystem=2 test.tex - CHECK_RESULT $? 0 0 "pmpost命令-numbersystem参数执行失败" - - # 清理测试文件 - LOG_INFO "清理测试文件" - rm -f test.tex test.dvi test.log test.aux - - # 如果测试前未安装,则卸载软件包 - if [ $INSTALLED -eq 0 ]; then - LOG_INFO "卸载texlive-ptex-r软件包" - dnf remove -y texlive-ptex-r - CHECK_RESULT $? 0 0 "卸载texlive-ptex-r软件包失败" - fi - - LOG_INFO "测试完成" -} - -main "$@" \ No newline at end of file diff --git a/testcases/function_test/pkg_test/texlive-base/texlive-ptex/test_texlive-ptex_r-pmpost_progname.sh b/testcases/function_test/pkg_test/texlive-base/texlive-ptex/test_texlive-ptex_r-pmpost_progname.sh deleted file mode 100644 index 37cc0a8d8a4..00000000000 --- a/testcases/function_test/pkg_test/texlive-base/texlive-ptex/test_texlive-ptex_r-pmpost_progname.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-08 -# @License : Mulan PSL v2 -# @Desc : 测试 pmpost 命令的 -progname 参数,设置程序(和内存)名称 -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - # 环境检查:检查是否已安装texlive-ptex-rpmpost软件包 - LOG_INFO "检查是否已安装texlive-ptex-rpmpost软件包" - rpm -q texlive-ptex-rpmpost > /dev/null 2>&1 - if [ $? -eq 0 ]; then - LOG_INFO "软件包已安装,测试结束后将保持安装状态" - INSTALLED=1 - else - LOG_INFO "软件包未安装,将在测试前安装并在测试后卸载" - INSTALLED=0 - fi - - # 检查yum源中是否存在该软件包 - LOG_INFO "检查yum源中是否存在texlive-ptex-rpmpost软件包" - dnf list available texlive-ptex-rpmpost > /dev/null 2>&1 - CHECK_RESULT $? 0 255 "yum源中未找到texlive-ptex-rpmpost软件包" - - # 如果未安装,则安装软件包 - if [ ${INSTALLED} -eq 0 ]; then - LOG_INFO "安装texlive-ptex-rpmpost软件包" - dnf install -y texlive-ptex-rpmpost > /dev/null 2>&1 - CHECK_RESULT $? 0 0 "安装texlive-ptex-rpmpost软件包失败" - fi - - # 验证pmpost命令是否存在 - LOG_INFO "验证pmpost命令是否存在" - which pmpost > /dev/null 2>&1 - CHECK_RESULT $? 0 0 "pmpost命令未找到" - - # 测试pmpost命令的-progname参数 - LOG_INFO "测试pmpost命令的-progname参数" - pmpost -progname testprog -h > /dev/null 2>&1 - CHECK_RESULT $? 0 255 "pmpost命令不支持-progname参数" - - # 清理环境:如果测试前未安装,则卸载软件包 - if [ ${INSTALLED} -eq 0 ]; then - LOG_INFO "卸载texlive-ptex-rpmpost软件包" - dnf remove -y texlive-ptex-rpmpost > /dev/null 2>&1 - CHECK_RESULT $? 0 0 "卸载texlive-ptex-rpmpost软件包失败" - fi - - LOG_INFO "测试完成" -} - -main "$@" \ No newline at end of file diff --git a/testcases/function_test/pkg_test/texlive-base/texlive-ptex/test_texlive-ptex_r-pmpost_recorder.sh b/testcases/function_test/pkg_test/texlive-base/texlive-ptex/test_texlive-ptex_r-pmpost_recorder.sh deleted file mode 100644 index 1d9de75f31e..00000000000 --- a/testcases/function_test/pkg_test/texlive-base/texlive-ptex/test_texlive-ptex_r-pmpost_recorder.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-08 -# @License : Mulan PSL v2 -# @Desc : 测试 pmpost 命令的 -recorder 参数,启用文件名记录器 -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - # 检查是否已安装texlive-ptex包 - LOG_INFO "检查是否已安装texlive-ptex包" - rpm -q texlive-ptex > /dev/null 2>&1 - is_installed=$? - - # 如果未安装,则安装 - if [ $is_installed -ne 0 ]; then - LOG_INFO "texlive-ptex未安装,开始安装" - dnf list available texlive-ptex > /dev/null 2>&1 - if [ $? -ne 0 ]; then - LOG_ERROR "yum源中未找到texlive-ptex包" - exit 255 - fi - dnf install -y texlive-ptex > /dev/null 2>&1 - CHECK_RESULT $? 0 0 "安装texlive-ptex失败" - LOG_INFO "安装texlive-ptex成功" - else - LOG_INFO "texlive-ptex已安装" - fi - - # 测试pmpost命令的-recorder参数 - LOG_INFO "测试pmpost命令的-recorder参数" - pmpost -help 2>&1 | grep -q "\-recorder" - if [ $? -ne 0 ]; then - LOG_ERROR "pmpost命令不支持-recorder参数" - # 如果之前未安装,则卸载 - if [ $is_installed -ne 0 ]; then - LOG_INFO "恢复环境,卸载texlive-ptex" - dnf remove -y texlive-ptex > /dev/null 2>&1 - CHECK_RESULT $? 0 0 "卸载texlive-ptex失败" - fi - exit 255 - fi - - # 执行pmpost命令并启用文件名记录器 - LOG_INFO "执行pmpost命令启用文件名记录器" - pmpost -recorder test_output > /dev/null 2>&1 - CHECK_RESULT $? 0 0 "pmpost命令执行失败" - - # 检查是否生成了记录文件 - LOG_INFO "检查是否生成了记录文件" - if [ -f "test_output.rec" ]; then - LOG_INFO "成功生成记录文件test_output.rec" - else - LOG_ERROR "未生成记录文件test_output.rec" - # 如果之前未安装,则卸载 - if [ $is_installed -ne 0 ]; then - LOG_INFO "恢复环境,卸载texlive-ptex" - dnf remove -y texlive-ptex > /dev/null 2>&1 - CHECK_RESULT $? 0 0 "卸载texlive-ptex失败" - fi - exit 1 - fi - - # 清理生成的测试文件 - LOG_INFO "清理测试文件" - rm -f test_output.rec > /dev/null 2>&1 - CHECK_RESULT $? 0 0 "清理测试文件失败" - - # 如果测试前未安装,则卸载软件包 - if [ $is_installed -ne 0 ]; then - LOG_INFO "恢复环境,卸载texlive-ptex" - dnf remove -y texlive-ptex > /dev/null 2>&1 - CHECK_RESULT $? 0 0 "卸载texlive-ptex失败" - fi - - LOG_INFO "测试完成" -} - -main "$@" \ No newline at end of file diff --git a/testcases/function_test/pkg_test/texlive-base/texlive-ptex/test_texlive-ptex_r-pmpost_restricted.sh b/testcases/function_test/pkg_test/texlive-base/texlive-ptex/test_texlive-ptex_r-pmpost_restricted.sh deleted file mode 100644 index 4ef5d30d227..00000000000 --- a/testcases/function_test/pkg_test/texlive-base/texlive-ptex/test_texlive-ptex_r-pmpost_restricted.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-08 -# @License : Mulan PSL v2 -# @Desc : 测试 pmpost 命令的 -restricted 参数,以安全模式运行,禁用 tex、makempx 和编辑器命令 -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - LOG_INFO "开始测试 pmpost 命令的 -restricted 参数,以安全模式运行,禁用 tex、makempx 和编辑器命令" - - # 检查 yum 源中是否存在 texlive-ptex 软件包 - LOG_INFO "检查 yum 源中是否存在 texlive-ptex 软件包" - dnf list texlive-ptex &> /dev/null - if [ $? -ne 0 ]; then - LOG_ERROR "yum 源中不存在 texlive-ptex 软件包" - exit 255 - fi - - # 检查是否已经安装了 texlive-ptex - LOG_INFO "检查是否已经安装了 texlive-ptex" - rpm -q texlive-ptex &> /dev/null - if [ $? -eq 0 ]; then - LOG_INFO "texlive-ptex 已经安装,脚本结束后保持安装状态" - installed=true - else - LOG_INFO "texlive-ptex 未安装,将进行安装和卸载操作" - installed=false - fi - - # 如果未安装,则安装 texlive-ptex - if [ "$installed" = false ]; then - LOG_INFO "安装 texlive-ptex 软件包" - dnf install -y texlive-ptex - CHECK_RESULT $? 0 0 "安装 texlive-ptex 失败" - fi - - # 检查 pmpost 命令是否存在 - LOG_INFO "检查 pmpost 命令是否存在" - which pmpost &> /dev/null - if [ $? -ne 0 ]; then - LOG_ERROR "pmpost 命令不存在" - if [ "$installed" = false ]; then - LOG_INFO "卸载 texlive-ptex 软件包" - dnf remove -y texlive-ptex - fi - exit 255 - fi - - # 检查 pmpost 命令是否支持 -restricted 参数 - LOG_INFO "检查 pmpost 命令是否支持 -restricted 参数" - pmpost -help 2>&1 | grep -q "restricted" - if [ $? -ne 0 ]; then - LOG_ERROR "pmpost 命令不支持 -restricted 参数" - if [ "$installed" = false ]; then - LOG_INFO "卸载 texlive-ptex 软件包" - dnf remove -y texlive-ptex - fi - exit 255 - fi - - # 使用 -restricted 参数运行 pmpost 命令 - LOG_INFO "使用 -restricted 参数运行 pmpost 命令" - pmpost -restricted - CHECK_RESULT $? 0 0 "pmpost 命令以 -restricted 参数运行失败" - - # 清理环境,如果之前未安装,则卸载 texlive-ptex - if [ "$installed" = false ]; then - LOG_INFO "卸载 texlive-ptex 软件包" - dnf remove -y texlive-ptex - CHECK_RESULT $? 0 0 "卸载 texlive-ptex 失败" - fi - - LOG_INFO "测试完成,环境已恢复" -} - -main "$@" \ No newline at end of file diff --git a/testcases/function_test/pkg_test/texlive-base/texlive-ptex/test_texlive-ptex_r-pmpost_s.sh b/testcases/function_test/pkg_test/texlive-base/texlive-ptex/test_texlive-ptex_r-pmpost_s.sh deleted file mode 100644 index da2199bacd8..00000000000 --- a/testcases/function_test/pkg_test/texlive-base/texlive-ptex/test_texlive-ptex_r-pmpost_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-08 -# @License : Mulan PSL v2 -# @Desc : 测试 pmpost 命令的 -s 参数,设置内部变量的值 -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - # 检查是否已安装texlive-ptex和texlive-ptex-doc - LOG_INFO "检查是否已安装texlive-ptex和texlive-ptex-doc软件包" - rpm -q texlive-ptex texlive-ptex-doc > /dev/null 2>&1 - if [ $? -eq 0 ]; then - LOG_INFO "软件包已安装,标记为保持安装状态" - INSTALLED=1 - else - LOG_INFO "软件包未安装,标记为需要清理" - INSTALLED=0 - fi - - # 检查yum源中是否存在软件包 - LOG_INFO "检查yum源中是否存在texlive-ptex和texlive-ptex-doc软件包" - dnf list available texlive-ptex texlive-ptex-doc > /dev/null 2>&1 - if [ $? -ne 0 ]; then - LOG_ERROR "yum源中不存在texlive-ptex或texlive-ptex-doc软件包" - exit 255 - fi - - # 如果未安装,则安装软件包 - if [ $INSTALLED -eq 0 ]; then - LOG_INFO "开始安装texlive-ptex和texlive-ptex-doc软件包" - dnf install -y texlive-ptex texlive-ptex-doc - CHECK_RESULT $? 0 0 "安装texlive-ptex和texlive-ptex-doc软件包失败" - fi - - # 检查pmpost命令是否存在 - LOG_INFO "检查pmpost命令是否存在" - command -v pmpost > /dev/null 2>&1 - CHECK_RESULT $? 0 0 "pmpost命令不存在" - - # 测试pmpost命令的-s参数 - LOG_INFO "测试pmpost命令的-s参数,设置内部变量的值" - pmpost -s test_variable=test_value 2>&1 | grep -q "test_variable=test_value" - CHECK_RESULT $? 0 0 "pmpost命令-s参数设置内部变量失败" - - # 测试无效参数 - LOG_INFO "测试pmpost命令的无效参数" - pmpost --invalid-param 2>&1 | grep -q "unrecognized option" - if [ $? -eq 0 ]; then - LOG_INFO "无效参数检查通过" - else - LOG_ERROR "pmpost命令不支持--invalid-param参数" - exit 255 - fi - - # 环境清理 - if [ $INSTALLED -eq 0 ]; then - LOG_INFO "清理环境,卸载安装的软件包" - dnf remove -y texlive-ptex texlive-ptex-doc - CHECK_RESULT $? 0 0 "卸载texlive-ptex和texlive-ptex-doc软件包失败" - else - LOG_INFO "保持软件包安装状态,无需清理" - fi - - LOG_INFO "测试脚本执行完成" -} - -main "$@" \ No newline at end of file diff --git a/testcases/function_test/pkg_test/texlive-base/texlive-ptex/test_texlive-ptex_r-pmpost_tex.sh b/testcases/function_test/pkg_test/texlive-base/texlive-ptex/test_texlive-ptex_r-pmpost_tex.sh deleted file mode 100644 index ac0d23ba052..00000000000 --- a/testcases/function_test/pkg_test/texlive-base/texlive-ptex/test_texlive-ptex_r-pmpost_tex.sh +++ /dev/null @@ -1,133 +0,0 @@ -#!/usr/bin/bash - -# Copyright (c) 2024 ISCAS .ALL rights reserved. -# This program is licensed under Mulan PSL v2. -# You can use it according to the terms and conditions of the Mulan PSL v2. -# http://license.coscl.org.cn/MulanPSL2 -# THIS PROGRAM IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, -# EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, -# MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. -# See the Mulan PSL v2 for more details. - -# ############################################# -# @Author : honghua -# @Contact : honghua@iscas.ac.cn -# @Date : 2026-03-08 -# @License : Mulan PSL v2 -# @Desc : 测试 pmpost 命令的 -tex 参数,指定用于文本标签的 TEXPROGRAM -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - # 定义日志函数(虽然题目说直接使用,但实际需要定义) - LOG_INFO() { - echo "[INFO] $*" - } - - LOG_ERROR() { - echo "[ERROR] $*" >&2 - } - - # 定义CHECK_RESULT函数(虽然题目说直接使用,但实际需要定义) - CHECK_RESULT() { - local actual=$1 - local expected=$2 - local exit_code=$3 - local message=$4 - - if [ "$actual" -eq "$expected" ]; then - LOG_INFO "$message 检查通过" - return 0 - else - LOG_ERROR "$message 检查失败" - exit $exit_code - fi - } - - # 定义SSH_CMD函数(虽然题目说直接使用,但实际需要定义) - SSH_CMD() { - local cmd=$1 - local ip=$2 - local password=$3 - local user=${4:-root} - - # 这里只是一个模拟实现,实际环境需要根据具体情况调整 - sshpass -p "$password" ssh -o StrictHostKeyChecking=no "$user@$ip" "$cmd" - } - - # 主测试函数 - main() { - LOG_INFO "开始测试 pmpost 命令的 -tex 参数" - - # 检查是否已经安装 texlive-ptex 和 pmpost - LOG_INFO "步骤1: 检查 texlive-ptex 和 pmpost 是否已安装" - if dnf list installed texlive-ptex &>/dev/null && command -v pmpost &>/dev/null; then - LOG_INFO "texlive-ptex 和 pmpost 已安装,测试后将保持安装状态" - already_installed=true - else - LOG_INFO "texlive-ptex 和 pmpost 未安装,将进行安装测试" - already_installed=false - - # 检查yum源中是否有该软件包 - LOG_INFO "步骤2: 检查yum源中是否有 texlive-ptex 软件包" - if ! dnf list available texlive-ptex &>/dev/null; then - LOG_ERROR "yum源中没有找到 texlive-ptex 软件包" - exit 255 - fi - - LOG_INFO "步骤3: 安装 texlive-ptex 软件包" - dnf install -y texlive-ptex - CHECK_RESULT $? 0 0 "安装 texlive-ptex" - fi - - # 验证 pmpost 命令是否存在 - LOG_INFO "步骤4: 验证 pmpost 命令是否存在" - if ! command -v pmpost &>/dev/null; then - LOG_ERROR "pmpost 命令不存在" - exit 255 - fi - - # 测试 pmpost 的 -tex 参数 - LOG_INFO "步骤5: 测试 pmpost 命令的 -tex 参数" - - # 先获取 pmpost 的帮助信息,检查是否支持 -tex 参数 - LOG_INFO "步骤6: 检查 pmpost 是否支持 -tex 参数" - if ! pmpost --help 2>/dev/null | grep -q -- "-tex"; then - LOG_ERROR "pmpost 命令不支持 -tex 参数" - exit 255 - fi - - # 创建一个简单的测试文件 - LOG_INFO "步骤7: 创建测试文件" - cat > test_input.tex << "EOF" - \documentclass{article} - \begin{document} - Test document for pmpost - \end{document} - EOF - - # 使用 -tex 参数指定 TEXPROGRAM - LOG_INFO "步骤8: 使用 -tex 参数执行 pmpost" - pmpost -tex pdflatex test_input.tex - CHECK_RESULT $? 0 0 "执行 pmpost -tex 命令" - - # 清理测试文件 - LOG_INFO "步骤9: 清理测试文件" - rm -f test_input.tex test_input.pdf test_input.log test_input.aux - - # 如果测试前未安装,则卸载软件包 - if [ "$already_installed" = false ]; then - LOG_INFO "步骤10: 卸载 texlive-ptex 软件包" - dnf remove -y texlive-ptex - CHECK_RESULT $? 0 0 "卸载 texlive-ptex" - fi - - LOG_INFO "测试完成" - } - - # 执行主函数 - main -} - -main "$@" \ No newline at end of file diff --git a/testcases/function_test/pkg_test/texlive-base/texlive-ptex/test_texlive-ptex_r-pmpost_troff.sh b/testcases/function_test/pkg_test/texlive-base/texlive-ptex/test_texlive-ptex_r-pmpost_troff.sh deleted file mode 100644 index 3d509469d3e..00000000000 --- a/testcases/function_test/pkg_test/texlive-base/texlive-ptex/test_texlive-ptex_r-pmpost_troff.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-08 -# @License : Mulan PSL v2 -# @Desc : 测试 pmpost 命令的 -troff 参数,设置 prologues:=1 并假设 TEXPROGRAM 是真正的 troff -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - LOG_INFO "开始测试 pmpost 命令的 -troff 参数,设置 prologues:=1 并假设 TEXPROGRAM 是真正的 troff" - - LOG_INFO "步骤1:检查环境是否已安装 texlive-ptex 和 texlive-ptex-fonts 软件包" - dnf list installed texlive-ptex texlive-ptex-fonts > /dev/null 2>&1 - if [ $? -eq 0 ]; then - LOG_INFO "环境已安装,测试结束后将保持安装状态" - INSTALLED=1 - else - LOG_INFO "环境未安装,将在测试前安装并在测试后卸载" - INSTALLED=0 - fi - - LOG_INFO "步骤2:检查 yum 源中是否有 texlive-ptex 和 texlive-ptex-fonts 软件包" - dnf list available texlive-ptex texlive-ptex-fonts > /dev/null 2>&1 - CHECK_RESULT $? 0 0 "yum 源中缺少 texlive-ptex 或 texlive-ptex-fonts 软件包" - if [ $? -ne 0 ]; then - LOG_ERROR "yum 源中缺少必要的软件包" - exit 255 - fi - - if [ $INSTALLED -eq 0 ]; then - LOG_INFO "步骤3:安装 texlive-ptex 和 texlive-ptex-fonts 软件包" - dnf install -y texlive-ptex texlive-ptex-fonts - CHECK_RESULT $? 0 0 "安装 texlive-ptex 或 texlive-ptex-fonts 失败" - fi - - LOG_INFO "步骤4:检查 pmpost 命令是否支持 -troff 参数" - pmpost --help | grep -q "\-troff" - CHECK_RESULT $? 0 0 "pmpost 命令不支持 -troff 参数" - if [ $? -ne 0 ]; then - LOG_ERROR "pmpost 命令不支持 -troff 参数" - exit 255 - fi - - LOG_INFO "步骤5:创建测试用的 .mp 文件" - cat > test_troff.mp << EOF - prologues:=1; - beginfig(1); - draw (0,0)--(100,100); - endfig; - end - EOF - CHECK_RESULT $? 0 0 "创建测试文件失败" - - LOG_INFO "步骤6:使用 pmpost 命令的 -troff 参数处理测试文件" - pmpost -troff test_troff.mp > test_output.txt 2>&1 - CHECK_RESULT $? 0 0 "pmpost 命令执行失败" - - LOG_INFO "步骤7:检查输出文件是否生成" - ls test_output.txt > /dev/null 2>&1 - CHECK_RESULT $? 0 0 "输出文件未生成" - - LOG_INFO "步骤8:检查输出文件内容是否包含预期的 troff 命令" - grep -q "TEXPROGRAM" test_output.txt - CHECK_RESULT $? 0 0 "输出文件内容不符合预期" - - LOG_INFO "步骤9:清理测试生成的文件" - rm -f test_troff.mp test_output.txt - CHECK_RESULT $? 0 0 "清理测试文件失败" - - if [ $INSTALLED -eq 0 ]; then - LOG_INFO "步骤10:卸载 texlive-ptex 和 texlive-ptex-fonts 软件包" - dnf remove -y texlive-ptex texlive-ptex-fonts - CHECK_RESULT $? 0 0 "卸载 texlive-ptex 或 texlive-ptex-fonts 失败" - fi - - LOG_INFO "测试完成,环境已恢复到初始状态" -} - -main "$@" \ No newline at end of file diff --git a/testcases/function_test/pkg_test/texlive-base/texlive-ptex/test_texlive-ptex_r-pmpost_upper_t.sh b/testcases/function_test/pkg_test/texlive-base/texlive-ptex/test_texlive-ptex_r-pmpost_upper_t.sh deleted file mode 100644 index 2fdb7fcf543..00000000000 --- a/testcases/function_test/pkg_test/texlive-base/texlive-ptex/test_texlive-ptex_r-pmpost_upper_t.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-08 -# @License : Mulan PSL v2 -# @Desc : 测试 pmpost 命令的 -T 参数,其作用等同于 -troff -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - # 检查是否已经安装texlive-ptex - if rpm -q texlive-ptex &> /dev/null; then - LOG_INFO "检测到texlive-ptex已安装,测试结束后将保持安装状态" - INSTALLED_FLAG=1 - else - LOG_INFO "未检测到texlive-ptex安装,将在测试中安装" - INSTALLED_FLAG=0 - fi - - # 检查yum源中是否有texlive-ptex软件包 - LOG_INFO "检查yum源中是否存在texlive-ptex软件包" - dnf list available texlive-ptex &> /dev/null - if [ $? -ne 0 ]; then - LOG_ERROR "yum源中未找到texlive-ptex软件包" - exit 255 - fi - - # 如果未安装,则安装软件包 - if [ $INSTALLED_FLAG -eq 0 ]; then - LOG_INFO "开始安装texlive-ptex软件包" - dnf install -y texlive-ptex - CHECK_RESULT $? 0 0 "安装texlive-ptex失败" - fi - - # 检查pmpost命令是否存在 - LOG_INFO "检查pmpost命令是否存在" - which pmpost &> /dev/null - CHECK_RESULT $? 0 0 "pmpost命令未找到" - - # 检查pmpost命令是否支持-T参数 - LOG_INFO "检查pmpost命令是否支持-T参数" - pmpost -h 2>&1 | grep -q "\-T" - if [ $? -ne 0 ]; then - LOG_ERROR "pmpost命令不支持-T参数" - # 如果之前未安装,需要卸载 - if [ $INSTALLED_FLAG -eq 0 ]; then - LOG_INFO "清理环境,卸载texlive-ptex" - dnf remove -y texlive-ptex - fi - exit 255 - fi - - # 测试-T参数的基本功能 - LOG_INFO "测试pmpost命令的-T参数功能" - # 创建一个简单的测试输入文件 - TEST_INPUT="test_input.pm" - cat > $TEST_INPUT << "EOF" - % This is a test PM file - test line 1 - test line 2 - EOF - - # 使用-T参数执行pmpost - pmpost -T $TEST_INPUT - CHECK_RESULT $? 0 0 "pmpost -T命令执行失败" - - # 清理测试文件 - LOG_INFO "清理测试文件" - rm -f $TEST_INPUT - - # 测试-T参数与-troff参数的等价性 - LOG_INFO "测试-T参数与-troff参数的等价性" - # 创建另一个测试文件 - TEST_INPUT2="test_input2.pm" - cat > $TEST_INPUT2 << "EOF" - % Another test PM file - another test line - EOF - - # 分别使用-T和-troff参数执行,比较输出 - pmpost -T $TEST_INPUT2 > output_T.txt - pmpost -troff $TEST_INPUT2 > output_troff.txt - - # 比较两个输出文件 - diff output_T.txt output_troff.txt - CHECK_RESULT $? 0 0 "-T参数与-troff参数输出不一致" - - # 清理测试文件 - LOG_INFO "清理测试输出文件" - rm -f $TEST_INPUT2 output_T.txt output_troff.txt - - # 如果测试开始时未安装,则卸载软件包 - if [ $INSTALLED_FLAG -eq 0 ]; then - LOG_INFO "测试完成,清理环境" - dnf remove -y texlive-ptex - CHECK_RESULT $? 0 0 "卸载texlive-ptex失败" - else - LOG_INFO "测试完成,保持texlive-ptex安装状态" - fi - - LOG_INFO "pmpost命令-T参数测试完成" -} - -main "$@" \ No newline at end of file diff --git a/testcases/function_test/pkg_test/texlive-base/texlive-ptex/test_texlive-ptex_r-pmpost_version.sh b/testcases/function_test/pkg_test/texlive-base/texlive-ptex/test_texlive-ptex_r-pmpost_version.sh deleted file mode 100644 index 17b65c4881e..00000000000 --- a/testcases/function_test/pkg_test/texlive-base/texlive-ptex/test_texlive-ptex_r-pmpost_version.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-08 -# @License : Mulan PSL v2 -# @Desc : 测试 pmpost 命令的 -version 参数,输出版本信息并退出 -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - # 定义变量 - PACKAGE_NAME="texlive-ptex" - COMMAND="pmpost" - PARAM="-version" - EXPECTED_OUTPUT="This is pmpost, Version" - - # 步骤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: 检查命令是否存在 - LOG_INFO "检查命令 ${COMMAND} 是否存在" - if ! command -v ${COMMAND} &>/dev/null; then - LOG_ERROR "命令 ${COMMAND} 不存在" - # 如果之前未安装,则卸载软件包 - if [ "${INSTALLED_BEFORE}" = "false" ]; then - dnf remove -y ${PACKAGE_NAME} - fi - exit 255 - fi - - # 步骤5: 检查参数是否支持 - LOG_INFO "检查命令 ${COMMAND} 是否支持参数 ${PARAM}" - ${COMMAND} ${PARAM} &>/dev/null - if [ $? -eq 255 ]; then - LOG_ERROR "命令 ${COMMAND} 不支持参数 ${PARAM}" - # 如果之前未安装,则卸载软件包 - if [ "${INSTALLED_BEFORE}" = "false" ]; then - dnf remove -y ${PACKAGE_NAME} - fi - exit 255 - fi - - # 步骤6: 执行命令并检查输出 - LOG_INFO "执行命令 ${COMMAND} ${PARAM} 并检查版本信息" - OUTPUT=$(${COMMAND} ${PARAM} 2>&1) - if echo "${OUTPUT}" | grep -q "${EXPECTED_OUTPUT}"; then - LOG_INFO "命令执行成功,输出符合预期" - CHECK_RESULT $? 0 0 "命令输出不符合预期" - else - LOG_ERROR "命令执行失败或输出不符合预期" - CHECK_RESULT $? 0 1 "命令输出不符合预期" - fi - - # 步骤7: 清理环境 - LOG_INFO "清理测试环境" - 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-split-b/texlive-aspectratio/test_texlive-aspectratio_function_basic.sh b/testcases/function_test/pkg_test/texlive-split-b/texlive-aspectratio/test_texlive-aspectratio_function_basic.sh deleted file mode 100644 index b7eac0a04a6..00000000000 --- a/testcases/function_test/pkg_test/texlive-split-b/texlive-aspectratio/test_texlive-aspectratio_function_basic.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-25 -# @License : Mulan PSL v2 -# @Desc : Test basic functionality of aspectratio package -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - - LOG_INFO "开始测试:Test basic functionality of aspectratio package" - - # 检查是否已安装texlive-aspectratio - LOG_INFO "检查是否已安装texlive-aspectratio" - dnf list installed texlive-aspectratio > /dev/null 2>&1 - if [ $? -eq 0 ]; then - LOG_INFO "texlive-aspectratio已安装,测试结束后将保持安装状态" - INSTALLED=1 - else - LOG_INFO "texlive-aspectratio未安装,将在测试结束后卸载" - INSTALLED=0 - fi - - # 检查yum源中是否有texlive-aspectratio - LOG_INFO "检查yum源中是否有texlive-aspectratio" - dnf list available texlive-aspectratio > /dev/null 2>&1 - if [ $? -ne 0 ]; then - LOG_ERROR "yum源中未找到texlive-aspectratio软件包" - exit 255 - fi - - # 安装texlive-aspectratio(如果未安装) - if [ $INSTALLED -eq 0 ]; then - LOG_INFO "正在安装texlive-aspectratio" - dnf install -y texlive-aspectratio > /dev/null 2>&1 - CHECK_RESULT $? 0 0 "安装texlive-aspectratio失败" - fi - - # 测试aspectratio基本功能 - LOG_INFO "测试aspectratio基本功能" - command_to_test="some_aspectratio_command --test-param" # 替换为实际命令和参数 - $command_to_test > /dev/null 2>&1 - CHECK_RESULT $? 0 0 "$command_to_test 执行失败" - - # 清理环境(如果测试前未安装) - if [ $INSTALLED -eq 0 ]; then - LOG_INFO "正在卸载texlive-aspectratio" - dnf remove -y texlive-aspectratio > /dev/null 2>&1 - CHECK_RESULT $? 0 0 "卸载texlive-aspectratio失败" - fi - - LOG_INFO "测试完成:Test basic functionality of aspectratio package" - -} - -main "$@" \ No newline at end of file diff --git a/testcases/function_test/pkg_test/texlive-split-b/texlive-aspectratio/test_texlive-aspectratio_function_compile.sh b/testcases/function_test/pkg_test/texlive-split-b/texlive-aspectratio/test_texlive-aspectratio_function_compile.sh deleted file mode 100644 index ee681f5122c..00000000000 --- a/testcases/function_test/pkg_test/texlive-split-b/texlive-aspectratio/test_texlive-aspectratio_function_compile.sh +++ /dev/null @@ -1,83 +0,0 @@ -#!/usr/bin/bash - -# Copyright (c) 2024 ISCAS .ALL rights reserved. -# This program is licensed under Mulan PSL v2. -# You can use it according to the terms and conditions of the Mulan PSL v2. -# http://license.coscl.org.cn/MulanPSL2 -# THIS PROGRAM IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, -# EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, -# MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. -# See the Mulan PSL v2 for more details. - -# ############################################# -# @Author : honghua -# @Contact : honghua@iscas.ac.cn -# @Date : 2026-03-28 -# @License : Mulan PSL v2 -# @Desc : Test document compilation with aspectratio -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - LOG_INFO "开始测试:Test document compilation with aspectratio" - - LOG_INFO "步骤1: 检查texlive-aspectratio软件包是否在yum源中" - if ! dnf list available texlive-aspectratio &>/dev/null; then - LOG_ERROR "texlive-aspectratio软件包不在yum源中" - exit 255 - fi - - LOG_INFO "步骤2: 检查是否已安装texlive-aspectratio" - if rpm -q texlive-aspectratio &>/dev/null; then - LOG_INFO "texlive-aspectratio已安装,测试结束后保持安装状态" - already_installed=true - else - LOG_INFO "texlive-aspectratio未安装,将进行安装测试" - already_installed=false - fi - - if [ "$already_installed" = false ]; then - LOG_INFO "步骤3: 安装texlive-aspectratio软件包" - dnf install -y texlive-aspectratio - CHECK_RESULT $? 0 0 "安装texlive-aspectratio失败" - fi - - LOG_INFO "步骤4: 创建测试LaTeX文档" - cat > test_aspectratio.tex << "EOF" - \documentclass{article} - \usepackage{geometry} - \geometry{paperwidth=8.5in, paperheight=11in, margin=1in} - \usepackage{aspectratio} - \begin{document} - Test document with aspectratio package. - \end{document} - EOF - CHECK_RESULT $? 0 0 "创建测试文档失败" - - LOG_INFO "步骤5: 编译测试文档" - pdflatex -interaction=nonstopmode test_aspectratio.tex - CHECK_RESULT $? 0 0 "编译文档失败" - - LOG_INFO "步骤6: 检查生成的PDF文件" - if [ -f test_aspectratio.pdf ]; then - LOG_INFO "PDF文件生成成功" - else - LOG_ERROR "PDF文件生成失败" - exit 1 - fi - - LOG_INFO "步骤7: 清理测试文件" - rm -f test_aspectratio.tex test_aspectratio.pdf test_aspectratio.log test_aspectratio.aux test_aspectratio.out - CHECK_RESULT $? 0 0 "清理测试文件失败" - - if [ "$already_installed" = false ]; then - LOG_INFO "步骤8: 卸载texlive-aspectratio软件包" - dnf remove -y texlive-aspectratio - CHECK_RESULT $? 0 0 "卸载texlive-aspectratio失败" - fi - - LOG_INFO "测试完成:Test document compilation with aspectratio" -} - -main "$@" \ No newline at end of file diff --git a/testcases/function_test/pkg_test/texlive-split-b/texlive-aspectratio/test_texlive-aspectratio_function_install.sh b/testcases/function_test/pkg_test/texlive-split-b/texlive-aspectratio/test_texlive-aspectratio_function_install.sh deleted file mode 100644 index d582e2811db..00000000000 --- a/testcases/function_test/pkg_test/texlive-split-b/texlive-aspectratio/test_texlive-aspectratio_function_install.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-28 -# @License : Mulan PSL v2 -# @Desc : Test installation of the aspectratio package -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - set -e - - LOG_INFO "开始测试:Test installation of the aspectratio package" - - LOG_INFO "步骤1: 检查测试环境是否已安装texlive-aspectratio软件包" - if dnf list installed texlive-aspectratio &>/dev/null; then - LOG_INFO "环境已安装texlive-aspectratio,标记为保持安装状态" - INSTALLED_BEFORE_TEST=true - else - LOG_INFO "环境未安装texlive-aspectratio,标记为需要测试后清理" - INSTALLED_BEFORE_TEST=false - fi - - LOG_INFO "步骤2: 检查yum源中是否存在texlive-aspectratio软件包" - if ! dnf list available texlive-aspectratio &>/dev/null; then - LOG_ERROR "yum源中未找到texlive-aspectratio软件包" - exit 255 - fi - - LOG_INFO "步骤3: 检查dnf install命令是否支持--nogpgcheck参数" - if ! dnf install --help | grep -q "nogpgcheck"; then - LOG_ERROR "dnf install命令不支持--nogpgcheck参数" - exit 255 - fi - - if [ "$INSTALLED_BEFORE_TEST" = "false" ]; then - LOG_INFO "步骤4: 执行软件包安装测试" - dnf install -y texlive-aspectratio --nogpgcheck - CHECK_RESULT $? 0 0 "安装texlive-aspectratio软件包失败" - - LOG_INFO "步骤5: 验证软件包安装成功" - dnf list installed texlive-aspectratio - CHECK_RESULT $? 0 0 "验证texlive-aspectratio安装状态失败" - - LOG_INFO "步骤6: 验证软件包基本功能" - kpsewhich aspectratio.sty - CHECK_RESULT $? 0 0 "查找aspectratio.sty文件失败" - fi - - LOG_INFO "步骤7: 检查是否需要在第二个节点执行命令" - if [ -n "$NODE2_IPV4" ] && [ -n "$NODE2_PASSWORD" ] && [ -n "$NODE2_USER" ]; then - LOG_INFO "在第二个节点上检查texlive-aspectratio安装状态" - SSH_CMD "dnf list installed texlive-aspectratio" "$NODE2_IPV4" "$NODE2_PASSWORD" "$NODE2_USER" - CHECK_RESULT $? 0 0 "在第二个节点上检查texlive-aspectratio失败" - fi - - LOG_INFO "步骤8: 环境清理与恢复" - if [ "$INSTALLED_BEFORE_TEST" = "false" ]; then - LOG_INFO "卸载测试安装的texlive-aspectratio软件包" - dnf remove -y texlive-aspectratio - CHECK_RESULT $? 0 0 "卸载texlive-aspectratio软件包失败" - - LOG_INFO "验证软件包已成功卸载" - if dnf list installed texlive-aspectratio &>/dev/null; then - LOG_ERROR "texlive-aspectratio软件包卸载不彻底" - exit 1 - fi - else - LOG_INFO "测试前已安装texlive-aspectratio,保持安装状态不变" - fi - - LOG_INFO "测试完成:Test installation of the aspectratio package" -} - -main "$@" \ No newline at end of file diff --git a/testcases/function_test/pkg_test/texlive-split-b/texlive-aspectratio/test_texlive-aspectratio_function_setratio.sh b/testcases/function_test/pkg_test/texlive-split-b/texlive-aspectratio/test_texlive-aspectratio_function_setratio.sh deleted file mode 100644 index 63d4a98dc2a..00000000000 --- a/testcases/function_test/pkg_test/texlive-split-b/texlive-aspectratio/test_texlive-aspectratio_function_setratio.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-28 -# @License : Mulan PSL v2 -# @Desc : Test setting the aspect ratio in document -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - # 检查是否已安装texlive-aspectratio软件包 - LOG_INFO "检查是否已安装texlive-aspectratio软件包" - if dnf list installed texlive-aspectratio &>/dev/null; then - LOG_INFO "texlive-aspectratio已安装,测试结束后保持安装状态" - INSTALLED_BEFORE=true - else - LOG_INFO "texlive-aspectratio未安装,将在测试结束后卸载" - INSTALLED_BEFORE=false - fi - - # 检查yum源中是否有texlive-aspectratio软件包 - LOG_INFO "检查yum源中是否有texlive-aspectratio软件包" - if ! dnf list available texlive-aspectratio &>/dev/null; then - LOG_ERROR "yum源中未找到texlive-aspectratio软件包" - exit 255 - fi - - # 如果未安装,则安装软件包 - if [ "$INSTALLED_BEFORE" = false ]; then - LOG_INFO "安装texlive-aspectratio软件包" - dnf install -y texlive-aspectratio - CHECK_RESULT $? 0 0 "安装texlive-aspectratio失败" - fi - - # 测试设置文档宽高比功能 - LOG_INFO "测试设置文档宽高比功能" - # 创建一个简单的LaTeX文档测试宽高比设置 - TEST_FILE="test_aspectratio.tex" - cat > $TEST_FILE << "EOF" - \documentclass{article} - \usepackage{aspectratio} - \begin{document} - \setaspectratio{16}{9} - This is a test document with aspect ratio 16:9. - \end{document} - EOF - - # 检查aspectratio包是否支持\setaspectratio命令 - LOG_INFO "检查aspectratio包是否支持\setaspectratio命令" - if grep -q "\\setaspectratio" $TEST_FILE; then - LOG_INFO "检测到\setaspectratio命令,尝试编译文档" - pdflatex -interaction=nonstopmode $TEST_FILE - CHECK_RESULT $? 0 0 "编译LaTeX文档失败" - else - LOG_ERROR "aspectratio包不支持\setaspectratio命令" - exit 255 - fi - - # 清理测试文件 - LOG_INFO "清理测试生成的文件" - rm -f test_aspectratio.* - CHECK_RESULT $? 0 0 "清理测试文件失败" - - # 如果测试前未安装,则卸载软件包 - if [ "$INSTALLED_BEFORE" = false ]; then - LOG_INFO "卸载texlive-aspectratio软件包" - dnf remove -y texlive-aspectratio - CHECK_RESULT $? 0 0 "卸载texlive-aspectratio失败" - fi - - LOG_INFO "测试设置文档宽高比功能完成" -} - -main "$@" \ No newline at end of file diff --git a/testcases/function_test/pkg_test/texlive-split-b/texlive-aspectratio/test_texlive-aspectratio_function_uninstall.sh b/testcases/function_test/pkg_test/texlive-split-b/texlive-aspectratio/test_texlive-aspectratio_function_uninstall.sh deleted file mode 100644 index 4550ad3b5ae..00000000000 --- a/testcases/function_test/pkg_test/texlive-split-b/texlive-aspectratio/test_texlive-aspectratio_function_uninstall.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-28 -# @License : Mulan PSL v2 -# @Desc : Test uninstallation of the aspectratio package -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - PACKAGE_NAME="texlive-aspectratio" - LOG_INFO "测试开始:测试卸载aspectratio包的功能" - LOG_INFO "步骤1:检查yum源中是否存在${PACKAGE_NAME}软件包" - if ! dnf list available ${PACKAGE_NAME} &>/dev/null; then - LOG_ERROR "yum源中未找到${PACKAGE_NAME}软件包" - exit 255 - fi - LOG_INFO "yum源中存在${PACKAGE_NAME}软件包" - LOG_INFO "步骤2:检查当前环境是否已安装${PACKAGE_NAME}" - if dnf list installed ${PACKAGE_NAME} &>/dev/null; then - LOG_INFO "${PACKAGE_NAME}已安装,测试结束后将保持安装状态" - INSTALLED_BEFORE_TEST=true - else - LOG_INFO "${PACKAGE_NAME}未安装,将在测试步骤中安装" - INSTALLED_BEFORE_TEST=false - fi - LOG_INFO "步骤3:如果未安装,则安装${PACKAGE_NAME}包" - if [ "${INSTALLED_BEFORE_TEST}" = "false" ]; then - dnf install -y ${PACKAGE_NAME} - CHECK_RESULT $? 0 0 "安装${PACKAGE_NAME}失败" - LOG_INFO "安装${PACKAGE_NAME}成功" - fi - LOG_INFO "步骤4:卸载${PACKAGE_NAME}包" - dnf remove -y ${PACKAGE_NAME} - CHECK_RESULT $? 0 0 "卸载${PACKAGE_NAME}失败" - LOG_INFO "卸载${PACKAGE_NAME}成功" - LOG_INFO "步骤5:验证${PACKAGE_NAME}包已成功卸载" - if dnf list installed ${PACKAGE_NAME} &>/dev/null; then - LOG_ERROR "${PACKAGE_NAME}包卸载后仍显示为已安装状态" - CHECK_RESULT 1 0 0 "${PACKAGE_NAME}卸载验证失败" - else - LOG_INFO "${PACKAGE_NAME}包已成功卸载" - CHECK_RESULT 0 0 0 "${PACKAGE_NAME}卸载验证成功" - fi - LOG_INFO "步骤6:环境恢复" - if [ "${INSTALLED_BEFORE_TEST}" = "true" ]; then - LOG_INFO "测试前${PACKAGE_NAME}已安装,重新安装以恢复环境" - dnf install -y ${PACKAGE_NAME} - CHECK_RESULT $? 0 0 "重新安装${PACKAGE_NAME}失败" - LOG_INFO "环境恢复成功,${PACKAGE_NAME}已安装" - else - LOG_INFO "测试前${PACKAGE_NAME}未安装,环境无需额外恢复" - fi - LOG_INFO "测试结束:卸载aspectratio包功能测试完成" -} - -main "$@" \ No newline at end of file diff --git a/testcases/function_test/pkg_test/texlive-split-g/texlive-docbytex-doc/test_texlive-docbytex-doc_function_render.sh b/testcases/function_test/pkg_test/texlive-split-g/texlive-docbytex-doc/test_texlive-docbytex-doc_function_render.sh deleted file mode 100644 index fdf0dd41113..00000000000 --- a/testcases/function_test/pkg_test/texlive-split-g/texlive-docbytex-doc/test_texlive-docbytex-doc_function_render.sh +++ /dev/null @@ -1,71 +0,0 @@ -#!/usr/bin/bash - -# Copyright (c) 2024 ISCAS .ALL rights reserved. -# This program is licensed under Mulan PSL v2. -# You can use it according to the terms and conditions of the Mulan PSL v2. -# http://license.coscl.org.cn/MulanPSL2 -# THIS PROGRAM IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, -# EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, -# MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. -# See the Mulan PSL v2 for more details. - -# ############################################# -# @Author : honghua -# @Contact : honghua@iscas.ac.cn -# @Date : 2025-12-10 -# @License : Mulan PSL v2 -# @Desc : 测试 texlive-docbytex-doc 的文档渲染功能,验证是否能正确生成文档。 -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - LOG_INFO "开始测试 texlive-docbytex-doc 的文档渲染功能" - - # 检查是否已安装 texlive-docbytex-doc - LOG_INFO "检查 texlive-docbytex-doc 是否已安装" - dnf list installed texlive-docbytex-doc > /dev/null 2>&1 - if [ $? -eq 0 ]; then - LOG_INFO "texlive-docbytex-doc 已安装,测试结束后将保持安装状态" - INSTALLED=1 - else - LOG_INFO "texlive-docbytex-doc 未安装,将在测试结束后卸载" - INSTALLED=0 - fi - - # 检查 yum 源中是否有 texlive-docbytex-doc - LOG_INFO "检查 yum 源中是否有 texlive-docbytex-doc" - dnf list available texlive-docbytex-doc > /dev/null 2>&1 - if [ $? -ne 0 ]; then - LOG_ERROR "yum 源中未找到 texlive-docbytex-doc,退出测试" - exit 255 - fi - - # 如果未安装,则安装 texlive-docbytex-doc - if [ $INSTALLED -eq 0 ]; then - LOG_INFO "安装 texlive-docbytex-doc" - dnf install -y texlive-docbytex-doc - CHECK_RESULT $? 0 0 "安装 texlive-docbytex-doc 失败" - fi - - # 测试文档渲染功能 - LOG_INFO "测试 texlive-docbytex-dox的文档渲染功能" - TEMP_FILE=$(mktemp) - echo "\documentclass{article}\begin{document}Test Document\end{document}" > $TEMP_FILE.tex - pdflatex $TEMP_FILE.tex > /dev/null 2>&1 - CHECK_RESULT $? 0 0 "文档渲染失败" - - #清理临时文件 - rm -f $TEMP_FILE.* - - # 如果测试开始时未安装,则卸载软件包 - if [ $INSTALLED -eq 0 ]; then - LOG_INFO “卸载 texLive—docbyTex—doc” - dnf remove -y texLive—docbyTex—doc - CHECK_RESULT $? 0 0 “卸载失败” - fi - - LOG_INFO “测试完成” -} - -main "$@" \ No newline at end of file diff --git a/testcases/function_test/pkg_test/texlive-split-h/texlive-eco-doc/test_texlive-eco-doc_function_usage.sh b/testcases/function_test/pkg_test/texlive-split-h/texlive-eco-doc/test_texlive-eco-doc_function_usage.sh deleted file mode 100644 index a695457b8d3..00000000000 --- a/testcases/function_test/pkg_test/texlive-split-h/texlive-eco-doc/test_texlive-eco-doc_function_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-04-05 -# @License : Mulan PSL v2 -# @Desc : Test basic LaTeX usage -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - set -e - - LOG_INFO "开始测试:Test basic LaTeX usage" - LOG_INFO "步骤1:检查texlive-eco-doc软件包是否在yum源中" - dnf list available texlive-eco-doc > /dev/null 2>&1 - if [ $? -ne 0 ]; then - LOG_ERROR "yum源中未找到texlive-eco-doc软件包" - exit 255 - fi - - LOG_INFO "步骤2:检查是否已安装texlive-eco-doc" - rpm -q texlive-eco-doc > /dev/null 2>&1 - if [ $? -eq 0 ]; then - LOG_INFO "texlive-eco-doc已安装,测试后保持安装状态" - INSTALLED_BEFORE=true - else - LOG_INFO "texlive-eco-doc未安装,将在测试后卸载" - INSTALLED_BEFORE=false - fi - - if [ "$INSTALLED_BEFORE" = "false" ]; then - LOG_INFO "步骤3:安装texlive-eco-doc软件包" - dnf install -y texlive-eco-doc - CHECK_RESULT $? 0 0 "安装texlive-eco-doc失败" - fi - - LOG_INFO "步骤4:测试基本LaTeX功能 - 创建一个简单的LaTeX文档" - cat > test_latex.tex << "EOF" - \documentclass{article} - \begin{document} - Hello, LaTeX! - \end{document} - EOF - CHECK_RESULT $? 0 0 "创建测试LaTeX文件失败" - - LOG_INFO "步骤5:使用pdflatex编译LaTeX文档" - if command -v pdflatex > /dev/null 2>&1; then - pdflatex -interaction=nonstopmode test_latex.tex > /dev/null 2>&1 - CHECK_RESULT $? 0 0 "pdflatex编译失败" - LOG_INFO "pdflatex编译成功" - else - LOG_INFO "未找到pdflatex命令,尝试使用latex命令" - if command -v latex > /dev/null 2>&1; then - latex -interaction=nonstopmode test_latex.tex > /dev/null 2>&1 - CHECK_RESULT $? 0 0 "latex编译失败" - LOG_INFO "latex编译成功" - else - LOG_ERROR "未找到pdflatex或latex命令" - exit 255 - fi - fi - - LOG_INFO "步骤6:检查生成的PDF或DVI文件" - if [ -f test_latex.pdf ]; then - LOG_INFO "成功生成PDF文件:test_latex.pdf" - elif [ -f test_latex.dvi ]; then - LOG_INFO "成功生成DVI文件:test_latex.dvi" - else - LOG_ERROR "未找到生成的PDF或DVI文件" - exit 1 - fi - - LOG_INFO "步骤7:清理测试文件" - rm -f test_latex.tex test_latex.pdf test_latex.dvi test_latex.aux test_latex.log test_latex.out - - if [ "$INSTALLED_BEFORE" = "false" ]; then - LOG_INFO "步骤8:卸载texlive-eco-doc软件包" - dnf remove -y texlive-eco-doc - CHECK_RESULT $? 0 0 "卸载texlive-eco-doc失败" - LOG_INFO "已卸载texlive-eco-doc" - else - LOG_INFO "步骤8:保持texlive-eco-doc安装状态" - fi - - LOG_INFO "测试完成:Test basic LaTeX usage" -} - -main "$@" \ No newline at end of file diff --git a/testcases/function_test/pkg_test/texlive-split-j/texlive-gmverb/test_texlive-gmverb_function_basic.sh b/testcases/function_test/pkg_test/texlive-split-j/texlive-gmverb/test_texlive-gmverb_function_basic.sh deleted file mode 100644 index 17ed7041cc3..00000000000 --- a/testcases/function_test/pkg_test/texlive-split-j/texlive-gmverb/test_texlive-gmverb_function_basic.sh +++ /dev/null @@ -1,66 +0,0 @@ -#!/usr/bin/bash - -# Copyright (c) 2024 ISCAS .ALL rights reserved. -# This program is licensed under Mulan PSL v2. -# You can use it according to the terms and conditions of the Mulan PSL v2. -# http://license.coscl.org.cn/MulanPSL2 -# THIS PROGRAM IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, -# EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, -# MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. -# See the Mulan PSL v2 for more details. - -# ############################################# -# @Author : honghua -# @Contact : honghua@iscas.ac.cn -# @Date : 2025-11-26 -# @License : Mulan PSL v2 -# @Desc : Test basic functionality of texlive-gmverb -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - - # 检查texlive-gmverb软件包是否已安装 - LOG_INFO "检查texlive-gmverb软件包是否已安装" - rpm -q texlive-gmverb &> /dev/null - if [ $? -eq 0 ]; then - LOG_INFO "texlive-gmverb软件包已安装,测试完成后将保持安装状态" - INSTALLED=true - else - LOG_INFO "texlive-gmverb软件包未安装,测试完成后将卸载" - INSTALLED=false - fi - - # 检查yum源中是否存在texlive-gmverb软件包 - LOG_INFO "检查yum源中是否存在texlive-gmverb软件包" - dnf list available texlive-gmverb &> /dev/null - if [ $? -ne 0 ]; then - LOG_ERROR "yum源中不存在texlive-gmverb软件包" - exit 255 - fi - - # 若未安装则安装texlive-gmverb软件包 - if ! $INSTALLED; then - LOG_INFO "安装texlive-gmverb软件包" - dnf install -y texlive-gmverb - CHECK_RESULT $? 0 0 "安装texlive-gmverb软件包失败" - fi - - # 测试texlive-gmverb基本功能 - LOG_INFO "测试texlive-gmverb基本功能" - gmverb --help &> /dev/null - CHECK_RESULT $? 0 0 "gmverb命令不支持或参数错误" - - # 清理环境 - if ! $INSTALLED; then - LOG_INFO "卸载texlive-gmverb软件包" - dnf remove -y texlive-gmverb - CHECK_RESULT $? 0 0 "卸载texlive-gmverb软件包失败" - fi - - LOG_INFO "测试完成,环境已恢复" - -} - -main "$@" \ No newline at end of file diff --git a/testcases/function_test/pkg_test/texlive-split-l/texlive-hyphen-spanish/test_texlive-hyphen-spanish_function_usage.sh b/testcases/function_test/pkg_test/texlive-split-l/texlive-hyphen-spanish/test_texlive-hyphen-spanish_function_usage.sh deleted file mode 100644 index b41d6712b37..00000000000 --- a/testcases/function_test/pkg_test/texlive-split-l/texlive-hyphen-spanish/test_texlive-hyphen-spanish_function_usage.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-25 -# @License : Mulan PSL v2 -# @Desc : Test basic LaTeX hyphenation usage -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - LOG_INFO "测试开始:测试基本LaTeX连字符使用功能" - LOG_INFO "步骤1:检查环境是否已安装texlive-hyphen-spanish软件包" - rpm -q texlive-hyphen-spanish - if [ $? -eq 0 ]; then - LOG_INFO "检测到texlive-hyphen-spanish已安装,将保持安装状态" - INSTALLED=true - else - LOG_INFO "未检测到texlive-hyphen-spanish安装,将在测试中安装" - INSTALLED=false - fi - - LOG_INFO "步骤2:检查yum源中是否存在texlive-hyphen-spanish软件包" - dnf list available texlive-hyphen-spanish - if [ $? -ne 0 ]; then - LOG_ERROR "yum源中未找到texlive-hyphen-spanish软件包" - exit 255 - fi - - if [ "$INSTALLED" = false ]; then - LOG_INFO "步骤3:安装texlive-hyphen-spanish软件包" - dnf install -y texlive-hyphen-spanish - CHECK_RESULT $? 0 0 "安装texlive-hyphen-spanish失败" - fi - - LOG_INFO "步骤4:验证基本LaTeX连字符使用命令" - command -v tex - if [ $? -ne 0 ]; then - LOG_ERROR "未找到tex命令,可能未安装LaTeX基本包" - exit 255 - fi - - LOG_INFO "步骤5:创建一个简单的测试LaTeX文档测试连字符功能" - cat > test_hyphen.tex << "EOF" - \documentclass{article} - \usepackage[spanish]{babel} - \begin{document} - Probando la funcionalidad de guiones en español. - \end{document} - EOF - CHECK_RESULT $? 0 0 "创建测试LaTeX文件失败" - - LOG_INFO "步骤6:使用pdflatex编译测试文档" - pdflatex test_hyphen.tex - CHECK_RESULT $? 0 0 "编译LaTeX文档失败" - - LOG_INFO "步骤7:检查生成的PDF文件" - if [ -f test_hyphen.pdf ]; then - LOG_INFO "成功生成PDF文件" - else - LOG_ERROR "未生成PDF文件" - exit 1 - fi - - LOG_INFO "步骤8:清理测试生成的文件" - rm -f test_hyphen.tex test_hyphen.aux test_hyphen.log test_hyphen.pdf - - if [ "$INSTALLED" = false ]; then - LOG_INFO "步骤9:卸载测试安装的texlive-hyphen-spanish软件包" - dnf remove -y texlive-hyphen-spanish - CHECK_RESULT $? 0 0 "卸载texlive-hyphen-spanish失败" - else - LOG_INFO "步骤9:保持texlive-hyphen-spanish安装状态" - fi - - LOG_INFO "测试完成:基本LaTeX连字符使用功能测试通过" -} - -main "$@" \ No newline at end of file diff --git a/testcases/function_test/pkg_test/texlive-split-y/texlive-unfonts-extra/test_texlive-unfonts-extra_function_font_rendering.sh b/testcases/function_test/pkg_test/texlive-split-y/texlive-unfonts-extra/test_texlive-unfonts-extra_function_font_rendering.sh deleted file mode 100644 index 5e58e2e63f4..00000000000 --- a/testcases/function_test/pkg_test/texlive-split-y/texlive-unfonts-extra/test_texlive-unfonts-extra_function_font_rendering.sh +++ /dev/null @@ -1,91 +0,0 @@ -#!/usr/bin/bash - -# Copyright (c) 2024 ISCAS .ALL rights reserved. -# This program is licensed under Mulan PSL v2. -# You can use it according to the terms and conditions of the Mulan PSL v2. -# http://license.coscl.org.cn/MulanPSL2 -# THIS PROGRAM IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, -# EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, -# MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. -# See the Mulan PSL v2 for more details. - -# ############################################# -# @Author : honghua -# @Contact : honghua@iscas.ac.cn -# @Date : 2025-11-26 -# @License : Mulan PSL v2 -# @Desc : Test the rendering of fonts provided by texlive-unfonts-extra -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - - # 检查是否已安装texlive-unfonts-extra软件包 - LOG_INFO "检查是否已安装texlive-unfonts-extra软件包" - if dnf list installed texlive-unfonts-extra &>/dev/null; then - LOG_INFO "texlive-unfonts-extra已安装,脚本结束后将保持安装状态" - INSTALLED=true - else - LOG_INFO "texlive-unfonts-extra未安装,将在测试完成后卸载" - INSTALLED=false - fi - - # 检查yum源中是否存在texlive-unfonts-extra软件包 - LOG_INFO "检查yum源中是否存在texlive-unfonts-extra软件包" - if ! dnf list available texlive-unfonts-extra &>/dev/null; then - LOG_ERROR "yum源中未找到texlive-unfonts-extra软件包" - exit 255 - fi - - # 安装texlive-unfonts-extra软件包 - LOG_INFO "开始安装texlive-unfonts-extra软件包" - dnf install -y texlive-unfonts-extra - CHECK_RESULT $? 0 0 "安装texlive-unfonts-extra失败" - - # 测试字体渲染功能 - LOG_INFO "测试字体渲染功能" - if ! command -v pdflatex &>/dev/null; then - LOG_ERROR "pdflatex命令不存在或不支持" - exit 255 - fi - - # 创建一个简单的TeX文件测试字体渲染 - LOG_INFO "创建测试TeX文件" - cat > test_font.tex </dev/null; then - LOG_INFO "texlive-soulpos已安装,测试结束后将保持安装状态" - INSTALLED=true - else - LOG_INFO "texlive-soulpos未安装,将在测试结束后卸载" - INSTALLED=false - fi - - # 检查yum源中是否有texlive-soulpos软件包 - LOG_INFO "检查yum源中是否有texlive-soulpos软件包" - if ! dnf list available texlive-soulpos &>/dev/null; then - LOG_ERROR "yum源中未找到texlive-soulpos软件包" - exit 255 - fi - - # 如果未安装,则安装texlive-soulpos - if [ "$INSTALLED" = false ]; then - LOG_INFO "安装texlive-soulpos软件包" - dnf install -y texlive-soulpos - CHECK_RESULT $? 0 0 "安装texlive-soulpos失败" - fi - - # 测试spacing adjustment功能 - LOG_INFO "测试spacing adjustment功能" - command_to_test="some_spacing_command --adjust" # 替换为实际的测试命令 - $command_to_test - CHECK_RESULT $? 0 0 "spacing adjustment功能测试失败" - - # 如果之前未安装,则卸载texlive-soulpos - if [ "$INSTALLED" = false ]; then - LOG_INFO "卸载texlive-soulpos软件包" - dnf remove -y texlive-soulpos - CHECK_RESULT $? 0 0 "卸载texlive-soulpos失败" - fi - - LOG_INFO "测试完成:Test spacing adjustment functionality" -} - -main "$@" \ No newline at end of file diff --git a/testcases/function_test/pkg_test/texlive-split-z/texlive-yafoot/test_texlive-yafoot_function_install.sh b/testcases/function_test/pkg_test/texlive-split-z/texlive-yafoot/test_texlive-yafoot_function_install.sh deleted file mode 100644 index 71b702587c5..00000000000 --- a/testcases/function_test/pkg_test/texlive-split-z/texlive-yafoot/test_texlive-yafoot_function_install.sh +++ /dev/null @@ -1,67 +0,0 @@ -#!/usr/bin/bash - -# Copyright (c) 2024 ISCAS .ALL rights reserved. -# This program is licensed under Mulan PSL v2. -# You can use it according to the terms and conditions of the Mulan PSL v2. -# http://license.coscl.org.cn/MulanPSL2 -# THIS PROGRAM IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, -# EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, -# MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. -# See the Mulan PSL v2 for more details. - -# ############################################# -# @Author : honghua -# @Contact : honghua@iscas.ac.cn -# @Date : 2025-11-26 -# @License : Mulan PSL v2 -# @Desc : Verify package installation -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - LOG_INFO "开始测试:验证软件包安装功能" - - # 检查yum源中是否存在texlive-yafoot软件包 - LOG_INFO "检查yum源中是否存在texlive-yafoot软件包" - dnf list available texlive-yafoot >/dev/null 2>&1 - if [ $? -ne 0 ]; then - LOG_ERROR "yum源中不存在texlive-yafoot软件包" - exit 255 - fi - - # 检查是否已安装texlive-yafoot - LOG_INFO "检查是否已安装texlive-yafoot" - rpm -q texlive-yafoot >/dev/null 2>&1 - if [ $? -eq 0 ]; then - LOG_INFO "texlive-yafoot已安装,测试结束后保持安装状态" - installed=true - else - LOG_INFO "texlive-yafoot未安装,测试结束后将卸载" - installed=false - fi - - # 安装texlive-yafoot - if [ "$installed" = false ]; then - LOG_INFO "安装texlive-yafoot" - dnf install -y texlive-yafoot - CHECK_RESULT $? 0 0 "安装texlive-yafoot失败" - fi - - # 验证软件包功能 - LOG_INFO "验证texlive-yafoot功能" - command_to_test="texlive-yafoot --version" - eval "$command_to_test" >/dev/null 2>&1 - CHECK_RESULT $? 0 0 "验证texlive-yafoot功能失败" - - # 清理环境(如果之前未安装) - if [ "$installed" = false ]; then - LOG_INFO "卸载texlive-yafoot" - dnf remove -y texlive-yafoot - CHECK_RESULT $? 0 0 "卸载texlive-yafoot失败" - fi - - LOG_INFO "测试完成:验证软件包安装功能" -} - -main "$@" \ No newline at end of file