diff --git a/suite2cases/function_test/pkg_test/libICE/libICE-help.json b/suite2cases/function_test/pkg_test/libICE/libICE-help.json index 83d0abf5a20..d9d7f3c2fa8 100644 --- a/suite2cases/function_test/pkg_test/libICE/libICE-help.json +++ b/suite2cases/function_test/pkg_test/libICE/libICE-help.json @@ -5,18 +5,6 @@ { "name": "test_libICE-help_function_install", "desc": "测试libICE-help软件包的安装功能。" - }, - { - "name": "test_libICE-help_function_verify", - "desc": "验证libICE-help软件包是否正确安装。" - }, - { - "name": "test_libICE-help_function_usage", - "desc": "测试libICE-help软件包提供的帮助文档或常用功能。" - }, - { - "name": "test_libICE-help_function_remove", - "desc": "测试libICE-help软件包的卸载功能。" } ] } \ No newline at end of file diff --git a/suite2cases/function_test/pkg_test/libcap-ng/libcap-ng-python3.json b/suite2cases/function_test/pkg_test/libcap-ng/libcap-ng-python3.json index 2a36a03ece6..e06a2c57651 100644 --- a/suite2cases/function_test/pkg_test/libcap-ng/libcap-ng-python3.json +++ b/suite2cases/function_test/pkg_test/libcap-ng/libcap-ng-python3.json @@ -63,46 +63,6 @@ { "name": "test_libcap-ng-python3_netcap_no_args", "desc": "测试不带任何参数的netcap命令" - }, - { - "name": "test_libcap-ng-python3_function_install", - "desc": "测试软件包libcap-ng-python3的安装功能" - }, - { - "name": "test_libcap-ng-python3_function_remove", - "desc": "测试软件包libcap-ng-python3的卸载功能" - }, - { - "name": "test_libcap-ng-python3_function_check", - "desc": "检查软件包libcap-ng-python3是否已安装" - }, - { - "name": "test_libcap-ng-python3_function_basic_import", - "desc": "测试libcap-ng-python3模块的基本导入" - }, - { - "name": "test_libcap-ng-python3_function_capability_get", - "desc": "测试获取进程能力集" - }, - { - "name": "test_libcap-ng-python3_function_capability_set", - "desc": "测试设置进程能力集" - }, - { - "name": "test_libcap-ng-python3_function_iab_get", - "desc": "测试获取IAB向量" - }, - { - "name": "test_libcap-ng-python3_function_iab_set", - "desc": "测试设置IAB向量" - }, - { - "name": "test_libcap-ng-python3_function_apply_proc", - "desc": "测试将能力应用到当前进程" - }, - { - "name": "test_libcap-ng-python3_function_have_cap", - "desc": "测试检查是否拥有特定能力" } ] } \ No newline at end of file diff --git a/suite2cases/function_test/pkg_test/libmng/libmng-devel.json b/suite2cases/function_test/pkg_test/libmng/libmng-devel.json index 6c662417ad7..e0dcfb118aa 100644 --- a/suite2cases/function_test/pkg_test/libmng/libmng-devel.json +++ b/suite2cases/function_test/pkg_test/libmng/libmng-devel.json @@ -10,10 +10,6 @@ "name": "test_libmng-devel_verify", "desc": "测试验证libmng-devel包是否已正确安装,检查关键的头文件和库文件是否存在。" }, - { - "name": "test_libmng-devel_compile", - "desc": "测试使用libmng-devel提供的头文件和库文件进行简单的程序编译和链接。" - }, { "name": "test_libmng-devel_uninstall", "desc": "测试libmng-devel开发包的卸载功能,验证是否能通过包管理器干净地移除。" diff --git a/suite2cases/function_test/pkg_test/libxml2/python3-libxml2.json b/suite2cases/function_test/pkg_test/libxml2/python3-libxml2.json index 407b28a1b1c..1ab9d2210e8 100644 --- a/suite2cases/function_test/pkg_test/libxml2/python3-libxml2.json +++ b/suite2cases/function_test/pkg_test/libxml2/python3-libxml2.json @@ -13,30 +13,6 @@ { "name": "test_python3-libxml2_function_remove", "desc": "测试卸载python3-libxml2软件包" - }, - { - "name": "test_python3-libxml2_function_install", - "desc": "测试安装python3-libxml2软件包" - }, - { - "name": "test_python3-libxml2_function_parse", - "desc": "测试解析XML文档的基本功能" - }, - { - "name": "test_python3-libxml2_function_xpath", - "desc": "测试使用XPath查询节点" - }, - { - "name": "test_python3-libxml2_function_validate", - "desc": "测试使用DTD或XSD验证XML" - }, - { - "name": "test_python3-libxml2_function_edit", - "desc": "测试修改XML节点内容" - }, - { - "name": "test_python3-libxml2_function_save", - "desc": "测试保存XML文档到文件" } ] } \ No newline at end of file diff --git a/suite2cases/function_test/pkg_test/python-exceptiongroup/python3-exceptiongroup.json b/suite2cases/function_test/pkg_test/python-exceptiongroup/python3-exceptiongroup.json index 8c05e0e72b6..a402ce1bc79 100644 --- a/suite2cases/function_test/pkg_test/python-exceptiongroup/python3-exceptiongroup.json +++ b/suite2cases/function_test/pkg_test/python-exceptiongroup/python3-exceptiongroup.json @@ -7,21 +7,9 @@ "desc": "测试python3-exceptiongroup软件包的安装功能", "machine num": 1 }, - { - "name": "test_python3-exceptiongroup_function_basic", - "desc": "测试python3-exceptiongroup基础功能" - }, { "name": "test_python3-exceptiongroup_function_raise", "desc": "测试异常抛出功能" - }, - { - "name": "test_python3-exceptiongroup_function_catch", - "desc": "测试异常捕获功能" - }, - { - "name": "test_python3-exceptiongroup_function_nest", - "desc": "测试嵌套异常功能" } ] } \ No newline at end of file diff --git a/suite2cases/function_test/pkg_test/qt6-qtnetworkauth/qt6-qtnetworkauth-devel.json b/suite2cases/function_test/pkg_test/qt6-qtnetworkauth/qt6-qtnetworkauth-devel.json index 09400493450..1def5634220 100644 --- a/suite2cases/function_test/pkg_test/qt6-qtnetworkauth/qt6-qtnetworkauth-devel.json +++ b/suite2cases/function_test/pkg_test/qt6-qtnetworkauth/qt6-qtnetworkauth-devel.json @@ -6,10 +6,6 @@ "name": "test_qt6-qtnetworkauth-devel_install", "desc": "测试软件包 qt6-qtnetworkauth-devel 的安装功能,验证安装是否成功。", "machine num": 1 - }, - { - "name": "test_qt6-qtnetworkauth-devel_function_auth", - "desc": "Test the authentication functionality of qt6-qtnetworkauth-devel." } ] } \ No newline at end of file diff --git a/suite2cases/function_test/pkg_test/softhsm/softhsm-devel.json b/suite2cases/function_test/pkg_test/softhsm/softhsm-devel.json index 9b890430fd0..baaf2d164b3 100644 --- a/suite2cases/function_test/pkg_test/softhsm/softhsm-devel.json +++ b/suite2cases/function_test/pkg_test/softhsm/softhsm-devel.json @@ -7,11 +7,6 @@ "desc": "测试softhsm-devel软件包的安装功能,验证安装过程是否正常完成。", "machine num": 1 }, - { - "name": "test_softhsm-devel_uninstall", - "desc": "测试softhsm-devel软件包的卸载功能,验证卸载过程是否正常完成。", - "machine num": 1 - }, { "name": "test_softhsm-devel_upgrade", "desc": "测试softhsm-devel软件包的升级功能,验证升级过程是否正常完成。", @@ -21,11 +16,6 @@ "name": "test_softhsm-devel_downgrade", "desc": "测试softhsm-devel软件包的降级功能,验证降级过程是否正常完成。", "machine num": 1 - }, - { - "name": "test_softhsm-devel_rollback", - "desc": "测试softhsm-devel软件包的回滚功能,验证回滚过程是否正常完成。", - "machine num": 1 } ] } \ No newline at end of file diff --git a/suite2cases/function_test/pkg_test/texlive-base/texlive-luajittex.json b/suite2cases/function_test/pkg_test/texlive-base/texlive-luajittex.json index 42c93e8e441..18e8608626c 100644 --- a/suite2cases/function_test/pkg_test/texlive-base/texlive-luajittex.json +++ b/suite2cases/function_test/pkg_test/texlive-base/texlive-luajittex.json @@ -6,82 +6,14 @@ "name": "test_texlive-luajittex_function_install", "desc": "Test package installation" }, - { - "name": "test_texlive-luajittex_luajithbtex_lua", - "desc": "使用 --lua 参数指定Lua初始化脚本文件" - }, - { - "name": "test_texlive-luajittex_luajithbtex_help", - "desc": "使用 --help 参数显示帮助信息并退出" - }, { "name": "test_texlive-luajittex_luajithbtex_version", "desc": "使用 --version 参数显示版本信息并退出" }, - { - "name": "test_texlive-luajittex_luajithbtex_ini", - "desc": "使用 --ini 参数进入 iniluajithbtex 模式,用于转储格式文件" - }, - { - "name": "test_texlive-luajittex_luajithbtex_jobname", - "desc": "使用 --jobname 参数设置作业名称" - }, - { - "name": "test_texlive-luajittex_luajithbtex_output_directory", - "desc": "使用 --output-directory 参数指定输出文件目录" - }, - { - "name": "test_texlive-luajittex_luajithbtex_output_format", - "desc": "使用 --output-format 参数指定输出格式为PDF" - }, { "name": "test_texlive-luajittex_luajithbtex_interaction", "desc": "使用 --interaction 参数设置交互模式为批处理模式" }, - { - "name": "test_texlive-luajittex_luajithbtex_halt_on_error", - "desc": "使用 --halt-on-error 参数在遇到第一个错误时停止处理" - }, - { - "name": "test_texlive-luajittex_luajithbtex_draftmode", - "desc": "使用 --draftmode 参数启用草稿模式(不生成输出PDF)" - }, - { - "name": "test_texlive-luajittex_luajithbtex_shell_escape", - "desc": "使用 --shell-escape 参数启用系统命令" - }, - { - "name": "test_texlive-luajittex_luajithbtex_safer", - "desc": "使用 --safer 参数禁用易受攻击的Lua命令" - }, - { - "name": "test_texlive-luajittex_luajithbtex_recorder", - "desc": "使用 --recorder 参数启用文件名记录器" - }, - { - "name": "test_texlive-luajittex_luajithbtex_synctex", - "desc": "使用 --synctex 参数启用SyncTeX支持" - }, - { - "name": "test_texlive-luajittex_luajithbtex_luaonly", - "desc": "使用 --luaonly 参数运行一个Lua文件后退出" - }, - { - "name": "test_texlive-luajittex_luajithbtex_jiton", - "desc": "使用 --jiton 参数开启JIT编译器(默认关闭)" - }, - { - "name": "test_texlive-luajittex_luajithbtex_lua_and_jobname", - "desc": "同时使用 --lua 和 --jobname 参数指定脚本和作业名" - }, - { - "name": "test_texlive-luajittex_luajithbtex_lua_and_output_directory", - "desc": "同时使用 --lua 和 --output-directory 参数指定脚本和输出目录" - }, - { - "name": "test_texlive-luajittex_luajittex_--lua", - "desc": "测试使用--lua参数指定Lua初始化脚本" - }, { "name": "test_texlive-luajittex_luajittex_--version", "desc": "测试显示版本信息" @@ -94,253 +26,9 @@ "name": "test_texlive-luajittex_luajittex_--credits", "desc": "测试显示软件贡献者信息" }, - { - "name": "test_texlive-luajittex_luajittex_--fmt", - "desc": "测试使用--fmt参数指定格式文件" - }, - { - "name": "test_texlive-luajittex_luajittex_--jobname", - "desc": "测试使用--jobname参数设置作业名称" - }, - { - "name": "test_texlive-luajittex_luajittex_--output-directory", - "desc": "测试使用--output-directory参数指定输出目录" - }, - { - "name": "test_texlive-luajittex_luajittex_--output-format", - "desc": "测试使用--output-format参数指定输出格式" - }, - { - "name": "test_texlive-luajittex_luajittex_--interaction", - "desc": "测试使用--interaction参数设置交互模式" - }, - { - "name": "test_texlive-luajittex_luajittex_--halt-on-error", - "desc": "测试在遇到第一个错误时停止处理" - }, - { - "name": "test_texlive-luajittex_luajittex_--draftmode", - "desc": "测试启用草稿模式(不生成输出PDF)" - }, - { - "name": "test_texlive-luajittex_luajittex_--shell-escape", - "desc": "测试启用系统命令执行" - }, - { - "name": "test_texlive-luajittex_luajittex_--no-shell-escape", - "desc": "测试禁用系统命令执行" - }, - { - "name": "test_texlive-luajittex_luajittex_--shell-restricted", - "desc": "测试限制系统命令为texmf.cnf中列出的命令" - }, - { - "name": "test_texlive-luajittex_luajittex_--recorder", - "desc": "测试启用文件名记录器" - }, - { - "name": "test_texlive-luajittex_luajittex_--file-line-error", - "desc": "测试启用文件:行:错误样式消息" - }, - { - "name": "test_texlive-luajittex_luajittex_--no-file-line-error", - "desc": "测试禁用文件:行:错误样式消息" - }, - { - "name": "test_texlive-luajittex_luajittex_--safer", - "desc": "测试禁用易受攻击的Lua命令" - }, - { - "name": "test_texlive-luajittex_luajittex_--synctex", - "desc": "测试启用SyncTeX支持" - }, - { - "name": "test_texlive-luajittex_luajittex_--ini", - "desc": "测试以ini模式运行,用于转储格式" - }, - { - "name": "test_texlive-luajittex_luajittex_--luaonly", - "desc": "测试运行一个Lua文件后退出" - }, - { - "name": "test_texlive-luajittex_luajittex_--luaconly", - "desc": "测试字节编译一个Lua文件后退出" - }, - { - "name": "test_texlive-luajittex_luajittex_--jiton", - "desc": "测试开启JIT编译器" - }, - { - "name": "test_texlive-luajittex_luajittex_--jithash", - "desc": "测试选择Lua字符串的哈希函数" - }, - { - "name": "test_texlive-luajittex_texluajit_lua_file", - "desc": "测试使用--lua参数指定Lua初始化脚本文件执行LuajitTeX" - }, - { - "name": "test_texlive-luajittex_texluajit_help", - "desc": "测试使用--help参数显示帮助信息并退出" - }, - { - "name": "test_texlive-luajittex_texluajit_version", - "desc": "测试使用--version参数显示版本信息并退出" - }, - { - "name": "test_texlive-luajittex_texluajit_credits", - "desc": "测试使用--credits参数显示软件致谢信息并退出" - }, - { - "name": "test_texlive-luajittex_texluajit_draftmode", - "desc": "测试使用--draftmode参数开启草稿模式(不生成输出PDF)" - }, - { - "name": "test_texlive-luajittex_texluajit_fmt_format", - "desc": "测试使用--fmt参数加载指定的格式文件" - }, - { - "name": "test_texlive-luajittex_texluajit_halt_on_error", - "desc": "测试使用--halt-on-error参数在第一个错误处停止处理" - }, - { - "name": "test_texlive-luajittex_texluajit_ini", - "desc": "测试使用--ini参数进入iniluajittex模式,用于转储格式文件" - }, - { - "name": "test_texlive-luajittex_texluajit_interaction_string", - "desc": "测试使用--interaction参数设置交互模式(批处理/非停止/滚动/错误停止)" - }, - { - "name": "test_texlive-luajittex_texluajit_jobname_string", - "desc": "测试使用--jobname参数设置作业名称" - }, - { - "name": "test_texlive-luajittex_texluajit_output_directory_dir", - "desc": "测试使用--output-directory参数指定输出文件目录" - }, - { - "name": "test_texlive-luajittex_texluajit_output_format_format", - "desc": "测试使用--output-format参数设置作业输出格式(DVI或PDF)" - }, { "name": "test_texlive-luajittex_texluajit_recorder", "desc": "测试使用--recorder参数启用文件名记录器" - }, - { - "name": "test_texlive-luajittex_texluajit_safer", - "desc": "测试使用--safer参数禁用易受攻击的Lua命令" - }, - { - "name": "test_texlive-luajittex_texluajit_shell_escape", - "desc": "测试使用--shell-escape参数启用系统命令" - }, - { - "name": "test_texlive-luajittex_texluajit_shell_restricted", - "desc": "测试使用--shell-restricted参数将系统命令限制在texmf.cnf中给出的命令列表内" - }, - { - "name": "test_texlive-luajittex_texluajit_synctex_number", - "desc": "测试使用--synctex参数启用SyncTeX同步" - }, - { - "name": "test_texlive-luajittex_texluajit_utc", - "desc": "测试使用--utc参数将初始时间设置为UTC" - }, - { - "name": "test_texlive-luajittex_texluajit_luaonly", - "desc": "测试使用--luaonly参数运行Lua文件后退出" - }, - { - "name": "test_texlive-luajittex_texluajit_luaconly", - "desc": "测试使用--luaconly参数字节编译Lua文件后退出" - }, - { - "name": "test_texlive-luajittex_texluajit_jiton", - "desc": "测试使用--jiton参数打开JIT编译器(默认为关闭)" - }, - { - "name": "test_texlive-luajittex_texluajit_jithash_string", - "desc": "测试使用--jithash参数为Lua字符串选择哈希函数(lua51或luajit20)" - }, - { - "name": "test_texlive-luajittex_texluajitc_script", - "desc": "执行指定的Lua脚本文件" - }, - { - "name": "test_texlive-luajittex_texluajitc_e", - "desc": "执行给定的Lua代码字符串" - }, - { - "name": "test_texlive-luajittex_texluajitc_l", - "desc": "在运行脚本前加载指定的Lua库" - }, - { - "name": "test_texlive-luajittex_texluajitc_b", - "desc": "保存或列出字节码" - }, - { - "name": "test_texlive-luajittex_texluajitc_j", - "desc": "执行LuaJIT控制命令" - }, - { - "name": "test_texlive-luajittex_texluajitc_upper_o", - "desc": "控制LuaJIT优化选项" - }, - { - "name": "test_texlive-luajittex_texluajitc_i", - "desc": "执行脚本后进入交互模式" - }, - { - "name": "test_texlive-luajittex_texluajitc_upper_v", - "desc": "显示版本信息" - }, - { - "name": "test_texlive-luajittex_texluajitc_upper_e", - "desc": "忽略环境变量" - }, - { - "name": "test_texlive-luajittex_texluajitc_special_-", - "desc": "停止解析后续选项" - }, - { - "name": "test_texlive-luajittex_texluajitc_special_-_stdin", - "desc": "从标准输入执行Lua代码并停止解析后续选项" - }, - { - "name": "test_texlive-luajittex_function_remove", - "desc": "Test package removal" - }, - { - "name": "test_texlive-luajittex_function_check", - "desc": "Check if package is installed" - }, - { - "name": "test_texlive-luajittex_function_version", - "desc": "Display version information" - }, - { - "name": "test_texlive-luajittex_function_compile_tex", - "desc": "Compile a simple TeX file" - }, - { - "name": "test_texlive-luajittex_function_lua_script", - "desc": "Run Lua script with LuaTeX" - }, - { - "name": "test_texlive-luajittex_function_shell_escape", - "desc": "Test shell escape feature" - }, - { - "name": "test_texlive-luajittex_function_synctex", - "desc": "Test SyncTeX generation" - }, - { - "name": "test_texlive-luajittex_function_output_pdf", - "desc": "Generate PDF output" - }, - { - "name": "test_texlive-luajittex_function_jobname", - "desc": "Set custom job name" } ] } \ No newline at end of file diff --git a/suite2cases/function_test/pkg_test/texlive-split-d/texlive-callouts.json b/suite2cases/function_test/pkg_test/texlive-split-d/texlive-callouts.json index b04a9b95694..de239c301cd 100644 --- a/suite2cases/function_test/pkg_test/texlive-split-d/texlive-callouts.json +++ b/suite2cases/function_test/pkg_test/texlive-split-d/texlive-callouts.json @@ -2,10 +2,6 @@ "path": "$OET_PATH/testcases/function_test/pkg_test/texlive-split-d/texlive-callouts", "machine num": 1, "cases": [ - { - "name": "test_texlive-callouts_function_basic", - "desc": "Test basic functionality of texlive-callouts" - }, { "name": "test_texlive-callouts_function_install", "desc": "Test if the texlive-callouts package can be successfully installed via the package manager." @@ -14,17 +10,9 @@ "name": "test_texlive-callouts_function_uninstall", "desc": "Test if the texlive-callouts package can be cleanly uninstalled and removed from the system." }, - { - "name": "test_texlive-callouts_function_basic_usage", - "desc": "Test basic LaTeX document compilation using the callouts package to verify its core functionality." - }, { "name": "test_texlive-callouts_function_availability", "desc": "Test to verify that the texlive-callouts package files (sty, tex) are present and accessible in the TeX Live installation." - }, - { - "name": "test_texlive-callouts_function_version", - "desc": "Test to check the version information of the installed texlive-callouts package." } ] } \ No newline at end of file diff --git a/suite2cases/function_test/pkg_test/texlive-split-e/texlive-commado-doc.json b/suite2cases/function_test/pkg_test/texlive-split-e/texlive-commado-doc.json index dc3528c89e8..28c29d0f669 100644 --- a/suite2cases/function_test/pkg_test/texlive-split-e/texlive-commado-doc.json +++ b/suite2cases/function_test/pkg_test/texlive-split-e/texlive-commado-doc.json @@ -5,22 +5,6 @@ { "name": "test_texlive-commado-doc_function_uninstall", "desc": "Test package removal" - }, - { - "name": "test_texlive-commado-doc_function_install", - "desc": "Test package installation" - }, - { - "name": "test_texlive-commado-doc_function_verify", - "desc": "Test package verification" - }, - { - "name": "test_texlive-commado-doc_function_usage", - "desc": "Test basic package usage" - }, - { - "name": "test_texlive-commado-doc_function_info", - "desc": "Test package info query" } ] } \ No newline at end of file diff --git a/suite2cases/function_test/pkg_test/texlive-split-g/texlive-drac.json b/suite2cases/function_test/pkg_test/texlive-split-g/texlive-drac.json deleted file mode 100644 index 74e4ac96e63..00000000000 --- a/suite2cases/function_test/pkg_test/texlive-split-g/texlive-drac.json +++ /dev/null @@ -1,10 +0,0 @@ -{ - "path": "$OET_PATH/testcases/function_test/pkg_test/texlive-split-g/texlive-drac", - "machine num": 1, - "cases": [ - { - "name": "test_texlive-drac_function_install", - "desc": "Test the installation of texlive-drac package" - } - ] -} \ No newline at end of file diff --git a/suite2cases/function_test/pkg_test/texlive-split-i/texlive-fancylabel-doc.json b/suite2cases/function_test/pkg_test/texlive-split-i/texlive-fancylabel-doc.json index db5d32dea39..72d0e1809ce 100644 --- a/suite2cases/function_test/pkg_test/texlive-split-i/texlive-fancylabel-doc.json +++ b/suite2cases/function_test/pkg_test/texlive-split-i/texlive-fancylabel-doc.json @@ -6,14 +6,6 @@ "name": "test_texlive-fancylabel-doc_function_install", "desc": "Test package installation" }, - { - "name": "test_texlive-fancylabel-doc_function_check_installed", - "desc": "Check if the package is installed on the system" - }, - { - "name": "test_texlive-fancylabel-doc_function_uninstall", - "desc": "Test package removal" - }, { "name": "test_texlive-fancylabel-doc_function_doc_access", "desc": "Verify access to package documentation files" diff --git a/suite2cases/function_test/pkg_test/texlive-split-p/texlive-mylatexformat-doc.json b/suite2cases/function_test/pkg_test/texlive-split-p/texlive-mylatexformat-doc.json index 09ee659a50d..0b414fa8dd7 100644 --- a/suite2cases/function_test/pkg_test/texlive-split-p/texlive-mylatexformat-doc.json +++ b/suite2cases/function_test/pkg_test/texlive-split-p/texlive-mylatexformat-doc.json @@ -14,10 +14,6 @@ "name": "test_texlive-mylatexformat-doc_function_check", "desc": "Check if package is installed" }, - { - "name": "test_texlive-mylatexformat-doc_function_help", - "desc": "Display package documentation" - }, { "name": "test_texlive-mylatexformat-doc_function_list", "desc": "List package contents" diff --git a/suite2cases/function_test/pkg_test/texlive-split-s/texlive-pst-coil-doc.json b/suite2cases/function_test/pkg_test/texlive-split-s/texlive-pst-coil-doc.json index 3cd94f222ca..8e9f401588e 100644 --- a/suite2cases/function_test/pkg_test/texlive-split-s/texlive-pst-coil-doc.json +++ b/suite2cases/function_test/pkg_test/texlive-split-s/texlive-pst-coil-doc.json @@ -13,14 +13,6 @@ { "name": "test_texlive-pst-coil-doc_function_files_exist", "desc": "Check if documentation files are installed" - }, - { - "name": "test_texlive-pst-coil-doc_function_manpage", - "desc": "Check for man page availability" - }, - { - "name": "test_texlive-pst-coil-doc_function_info_page", - "desc": "Check for info page availability" } ] } \ No newline at end of file diff --git a/suite2cases/function_test/pkg_test/texlive-split-x/texlive-tikz-bayesnet-doc.json b/suite2cases/function_test/pkg_test/texlive-split-x/texlive-tikz-bayesnet-doc.json index 4069126255b..b835c663a74 100644 --- a/suite2cases/function_test/pkg_test/texlive-split-x/texlive-tikz-bayesnet-doc.json +++ b/suite2cases/function_test/pkg_test/texlive-split-x/texlive-tikz-bayesnet-doc.json @@ -10,14 +10,6 @@ { "name": "test_texlive-tikz-bayesnet-doc_package_exists", "desc": "验证 texlive-tikz-bayesnet-doc 软件包(文档)是否存在于系统中" - }, - { - "name": "test_texlive-tikz-bayesnet-doc_usage_guide", - "desc": "检查 texlive-tikz-bayesnet-doc 文档是否包含 tikz-bayesnet 宏包的基本用法说明" - }, - { - "name": "test_texlive-tikz-bayesnet-doc_example_files", - "desc": "确认 texlive-tikz-bayesnet-doc 文档中是否包含绘制贝叶斯网络的示例代码文件" } ] } \ No newline at end of file diff --git a/suite2cases/function_test/pkg_test/texlive-split-x/texlive-titlefoot.json b/suite2cases/function_test/pkg_test/texlive-split-x/texlive-titlefoot.json index 8a6322786d4..25e86794aea 100644 --- a/suite2cases/function_test/pkg_test/texlive-split-x/texlive-titlefoot.json +++ b/suite2cases/function_test/pkg_test/texlive-split-x/texlive-titlefoot.json @@ -2,10 +2,6 @@ "path": "$OET_PATH/testcases/function_test/pkg_test/texlive-split-x/texlive-titlefoot", "machine num": 1, "cases": [ - { - "name": "test_texlive-titlefoot_function_footnote", - "desc": "Test footnote functionality" - }, { "name": "test_texlive-titlefoot_function_install", "desc": "Test installation of texlive-titlefoot package" @@ -13,18 +9,6 @@ { "name": "test_texlive-titlefoot_function_remove", "desc": "Test removal of texlive-titlefoot package" - }, - { - "name": "test_texlive-titlefoot_function_basic_usage", - "desc": "Test basic document usage with titlefoot" - }, - { - "name": "test_texlive-titlefoot_function_title_foot", - "desc": "Test titlefoot package main feature" - }, - { - "name": "test_texlive-titlefoot_function_check_installed", - "desc": "Check if texlive-titlefoot is installed" } ] } \ No newline at end of file diff --git a/testcases/function_test/pkg_test/libICE/libICE-help/test_libICE-help_function_remove.sh b/testcases/function_test/pkg_test/libICE/libICE-help/test_libICE-help_function_remove.sh deleted file mode 100644 index 7e8d0774c8d..00000000000 --- a/testcases/function_test/pkg_test/libICE/libICE-help/test_libICE-help_function_remove.sh +++ /dev/null @@ -1,76 +0,0 @@ -#!/usr/bin/bash - -# Copyright (c) 2024 ISCAS .ALL rights reserved. -# This program is licensed under Mulan PSL v2. -# You can use it according to the terms and conditions of the Mulan PSL v2. -# http://license.coscl.org.cn/MulanPSL2 -# THIS PROGRAM IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, -# EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, -# MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. -# See the Mulan PSL v2 for more details. - -# ############################################# -# @Author : honghua -# @Contact : honghua@iscas.ac.cn -# @Date : 2026-04-03 -# @License : Mulan PSL v2 -# @Desc : 测试libICE-help软件包的卸载功能。 -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - set -e - - LOG_INFO "开始测试libICE-help软件包的卸载功能" - - LOG_INFO "步骤1:检查libICE-help软件包是否已在yum源中" - if ! dnf list available libICE-help 2>/dev/null | grep -q libICE-help; then - LOG_ERROR "yum源中未找到libICE-help软件包" - exit 255 - fi - LOG_INFO "yum源中存在libICE-help软件包" - - LOG_INFO "步骤2:检查当前环境是否已安装libICE-help软件包" - if rpm -q libICE-help &>/dev/null; then - LOG_INFO "当前环境已安装libICE-help软件包,标记为已安装状态" - INSTALLED=true - else - LOG_INFO "当前环境未安装libICE-help软件包,标记为未安装状态" - INSTALLED=false - fi - - if [ "$INSTALLED" = "false" ]; then - LOG_INFO "步骤3:安装libICE-help软件包作为测试步骤" - dnf install -y libICE-help - CHECK_RESULT $? 0 0 "安装libICE-help软件包失败" - LOG_INFO "libICE-help软件包安装成功" - fi - - LOG_INFO "步骤4:验证libICE-help软件包的功能" - rpm -ql libICE-help | head -5 - CHECK_RESULT $? 0 0 "验证libICE-help软件包功能失败" - - LOG_INFO "步骤5:测试卸载libICE-help软件包" - dnf remove -y libICE-help - CHECK_RESULT $? 0 0 "卸载libICE-help软件包失败" - LOG_INFO "libICE-help软件包卸载成功" - - if [ "$INSTALLED" = "false" ]; then - LOG_INFO "步骤6:清理环境,卸载测试安装的软件包" - if rpm -q libICE-help &>/dev/null; then - dnf remove -y libICE-help - CHECK_RESULT $? 0 0 "清理环境时卸载libICE-help软件包失败" - fi - LOG_INFO "环境清理完成,恢复至初始未安装状态" - else - LOG_INFO "步骤6:恢复环境,重新安装原有的libICE-help软件包" - dnf install -y libICE-help - CHECK_RESULT $? 0 0 "恢复环境时安装libICE-help软件包失败" - LOG_INFO "环境恢复完成,保持原有的安装状态" - fi - - LOG_INFO "测试libICE-help软件包的卸载功能完成" -} - -main "$@" \ No newline at end of file diff --git a/testcases/function_test/pkg_test/libICE/libICE-help/test_libICE-help_function_usage.sh b/testcases/function_test/pkg_test/libICE/libICE-help/test_libICE-help_function_usage.sh deleted file mode 100644 index 695dd545f66..00000000000 --- a/testcases/function_test/pkg_test/libICE/libICE-help/test_libICE-help_function_usage.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-03 -# @License : Mulan PSL v2 -# @Desc : 测试libICE-help软件包提供的帮助文档或常用功能。 -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - # 定义软件包名称 - PACKAGE_NAME="libICE-help" - LOG_INFO "开始测试 ${PACKAGE_NAME} 软件包提供的帮助文档或常用功能" - - # 检查是否已安装软件包 - LOG_INFO "步骤1:检查 ${PACKAGE_NAME} 是否已安装" - if dnf list installed "${PACKAGE_NAME}" &>/dev/null; then - LOG_INFO "${PACKAGE_NAME} 已安装,脚本结束后将保持安装状态" - ALREADY_INSTALLED=1 - else - LOG_INFO "${PACKAGE_NAME} 未安装,将在测试过程中安装并在结束前卸载" - ALREADY_INSTALLED=0 - fi - - # 检查yum源中是否有该软件包 - LOG_INFO "步骤2:检查yum源中是否有 ${PACKAGE_NAME} 软件包" - if ! dnf list available "${PACKAGE_NAME}" &>/dev/null; then - LOG_ERROR "yum源中未找到 ${PACKAGE_NAME} 软件包" - exit 255 - fi - - # 如果未安装,则安装软件包 - if [ ${ALREADY_INSTALLED} -eq 0 ]; then - LOG_INFO "步骤3:安装 ${PACKAGE_NAME} 软件包" - dnf install -y "${PACKAGE_NAME}" - CHECK_RESULT $? 0 0 "安装 ${PACKAGE_NAME} 失败" - fi - - # 测试帮助文档功能 - LOG_INFO "步骤4:测试 ${PACKAGE_NAME} 的帮助文档功能" - if command -v iceauth &>/dev/null; then - LOG_INFO "测试 iceauth 命令的帮助文档" - iceauth --help - CHECK_RESULT $? 0 0 "iceauth --help 执行失败" - else - LOG_INFO "iceauth 命令未找到,尝试其他命令" - fi - - # 测试常用功能 - LOG_INFO "步骤5:测试 ${PACKAGE_NAME} 的常用功能" - if command -v xprop &>/dev/null; then - LOG_INFO "测试 xprop 命令的基本功能" - xprop -version - CHECK_RESULT $? 0 0 "xprop -version 执行失败" - else - LOG_INFO "xprop 命令未找到,尝试其他命令" - fi - - # 测试参数不存在或不支持的情况 - LOG_INFO "步骤6:测试不支持的参数" - if command -v iceauth &>/dev/null; then - iceauth --invalid-parameter 2>/dev/null - if [ $? -eq 255 ]; then - LOG_INFO "参数检查正常,不支持的参数返回255" - else - LOG_ERROR "参数检查失败,不支持的参数未返回255" - exit 255 - fi - fi - - # 清理环境:如果之前未安装,则卸载软件包 - if [ ${ALREADY_INSTALLED} -eq 0 ]; then - LOG_INFO "步骤7:卸载 ${PACKAGE_NAME} 软件包" - dnf remove -y "${PACKAGE_NAME}" - CHECK_RESULT $? 0 0 "卸载 ${PACKAGE_NAME} 失败" - LOG_INFO "环境已恢复,${PACKAGE_NAME} 已卸载" - else - LOG_INFO "步骤7:保持 ${PACKAGE_NAME} 安装状态,不进行卸载" - fi - - LOG_INFO "测试完成" -} - -main "$@" \ No newline at end of file diff --git a/testcases/function_test/pkg_test/libICE/libICE-help/test_libICE-help_function_verify.sh b/testcases/function_test/pkg_test/libICE/libICE-help/test_libICE-help_function_verify.sh deleted file mode 100644 index 0adf4220e72..00000000000 --- a/testcases/function_test/pkg_test/libICE/libICE-help/test_libICE-help_function_verify.sh +++ /dev/null @@ -1,133 +0,0 @@ -#!/usr/bin/bash - -# Copyright (c) 2024 ISCAS .ALL rights reserved. -# This program is licensed under Mulan PSL v2. -# You can use it according to the terms and conditions of the Mulan PSL v2. -# http://license.coscl.org.cn/MulanPSL2 -# THIS PROGRAM IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, -# EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, -# MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. -# See the Mulan PSL v2 for more details. - -# ############################################# -# @Author : honghua -# @Contact : honghua@iscas.ac.cn -# @Date : 2026-04-03 -# @License : Mulan PSL v2 -# @Desc : 验证libICE-help软件包是否正确安装。 -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - # 定义颜色和日志函数(根据要求直接使用LOG_INFO和LOG_ERROR) - LOG_INFO() { - echo -e "\033[32m[INFO]\033[0m $1" - } - LOG_ERROR() { - echo -e "\033[31m[ERROR]\033[0m $1" - } - - # 定义CHECK_RESULT函数(根据要求直接使用) - CHECK_RESULT() { - if [ $# -ne 4 ]; then - LOG_ERROR "CHECK_RESULT函数参数错误" - exit 255 - fi - 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 $actual - fi - fi - } - - # 定义SSH_CMD函数(根据要求直接使用) - SSH_CMD() { - if [ $# -ne 4 ]; then - LOG_ERROR "SSH_CMD函数参数错误" - exit 255 - fi - local command=$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" "$command" - return $? - } - - # 脚本开始 - LOG_INFO "开始验证libICE-help软件包是否正确安装。" - - # 步骤1:检查libICE-help软件包是否已在yum源中 - LOG_INFO "步骤1:检查libICE-help软件包是否在yum源中。" - dnf list available libICE-help 2>/dev/null | grep -q libICE-help - if [ $? -ne 0 ]; then - LOG_ERROR "yum源中未找到libICE-help软件包。" - exit 255 - fi - LOG_INFO "yum源中存在libICE-help软件包。" - - # 步骤2:检查当前是否已安装libICE-help软件包 - LOG_INFO "步骤2:检查当前是否已安装libICE-help软件包。" - rpm -q libICE-help >/dev/null 2>&1 - if [ $? -eq 0 ]; then - LOG_INFO "libICE-help软件包已安装,标记为已安装状态。" - INSTALLED="true" - else - LOG_INFO "libICE-help软件包未安装,标记为未安装状态。" - INSTALLED="false" - fi - - # 步骤3:如果未安装,则安装libICE-help软件包 - if [ "$INSTALLED" = "false" ]; then - LOG_INFO "步骤3:安装libICE-help软件包。" - dnf install -y libICE-help - CHECK_RESULT $? 0 0 "安装libICE-help软件包失败。" - LOG_INFO "libICE-help软件包安装成功。" - fi - - # 步骤4:验证libICE-help软件包是否正确安装 - LOG_INFO "步骤4:验证libICE-help软件包是否正确安装。" - rpm -V libICE-help - CHECK_RESULT $? 0 0 "libICE-help软件包验证失败,可能文件损坏或未正确安装。" - - # 步骤5:验证libICE-help软件包提供的命令或文件 - LOG_INFO "步骤5:验证libICE-help软件包提供的命令或文件。" - # 假设libICE-help软件包提供了iceauth命令,检查该命令是否存在 - which iceauth >/dev/null 2>&1 - if [ $? -ne 0 ]; then - LOG_ERROR "iceauth命令不存在,libICE-help软件包可能未正确安装。" - exit 255 - fi - LOG_INFO "iceauth命令存在,libICE-help软件包提供的基本功能正常。" - - # 步骤6:测试iceauth命令的基本功能(例如查看帮助) - LOG_INFO "步骤6:测试iceauth命令的基本功能。" - iceauth --help >/dev/null 2>&1 - CHECK_RESULT $? 0 0 "iceauth命令--help参数不支持或执行失败。" - - # 步骤7:清理环境,如果之前未安装则卸载软件包 - LOG_INFO "步骤7:清理环境,恢复原始状态。" - if [ "$INSTALLED" = "false" ]; then - LOG_INFO "卸载libICE-help软件包。" - dnf remove -y libICE-help - CHECK_RESULT $? 0 0 "卸载libICE-help软件包失败。" - LOG_INFO "libICE-help软件包卸载成功,环境已恢复。" - else - LOG_INFO "libICE-help软件包在脚本执行前已安装,保持安装状态。" - fi - - LOG_INFO "libICE-help软件包验证完成,所有测试通过。" -} - -main "$@" \ No newline at end of file diff --git a/testcases/function_test/pkg_test/libcap-ng/libcap-ng-python3/test_libcap-ng-python3_function_apply_proc.sh b/testcases/function_test/pkg_test/libcap-ng/libcap-ng-python3/test_libcap-ng-python3_function_apply_proc.sh deleted file mode 100644 index 464d2979a42..00000000000 --- a/testcases/function_test/pkg_test/libcap-ng/libcap-ng-python3/test_libcap-ng-python3_function_apply_proc.sh +++ /dev/null @@ -1,111 +0,0 @@ -#!/usr/bin/bash - -# Copyright (c) 2024 ISCAS .ALL rights reserved. -# This program is licensed under Mulan PSL v2. -# You can use it according to the terms and conditions of the Mulan PSL v2. -# http://license.coscl.org.cn/MulanPSL2 -# THIS PROGRAM IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, -# EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, -# MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. -# See the Mulan PSL v2 for more details. - -# ############################################# -# @Author : honghua -# @Contact : honghua@iscas.ac.cn -# @Date : 2026-03-12 -# @License : Mulan PSL v2 -# @Desc : 测试将能力应用到当前进程 -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - # 初始化日志函数(直接使用) - LOG_INFO() { - echo "INFO: $*" - } - - LOG_ERROR() { - echo "ERROR: $*" >&2 - } - - # 定义软件包名称 - PACKAGE_NAME="libcap-ng-python3" - - # 步骤1:检查yum源中是否存在指定软件包 - LOG_INFO "步骤1:检查yum源中是否存在软件包 $PACKAGE_NAME" - if ! dnf list available "$PACKAGE_NAME" &>/dev/null; then - LOG_ERROR "软件包 $PACKAGE_NAME 在yum源中不存在" - exit 255 - fi - - # 步骤2:检查系统是否已安装指定软件包 - LOG_INFO "步骤2:检查系统是否已安装软件包 $PACKAGE_NAME" - if rpm -q "$PACKAGE_NAME" &>/dev/null; then - LOG_INFO "软件包 $PACKAGE_NAME 已安装,标记为已安装状态" - INSTALLED_BEFORE=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:测试将能力应用到当前进程 - LOG_INFO "步骤4:测试将能力应用到当前进程" - # 使用python3调用libcap-ng库测试能力应用到进程 - python3 << "EOF" - import sys - try: - import capng - # 初始化capng - capng.capng_clear(capng.CAPNG_SELECT_BOTH) - # 添加一些能力进行测试 - capng.capng_update(capng.CAPNG_ADD, capng.CAPNG_EFFECTIVE, capng.CAP_NET_BIND_SERVICE) - # 将能力应用到当前进程 - result = capng.capng_apply(capng.CAPNG_SELECT_BOTH) - if result == 0: - print("能力应用到进程成功") - sys.exit(0) - else: - print(f"能力应用到进程失败,返回值: {result}") - sys.exit(1) - except ImportError as e: - print(f"导入capng模块失败: {e}") - sys.exit(255) - except AttributeError as e: - print(f"capng模块不支持所需函数: {e}") - sys.exit(255) - except Exception as e: - print(f"测试过程中发生错误: {e}") - sys.exit(1) - EOF - - # 检查python脚本执行结果 - PYTHON_EXIT_CODE=$? - if [ $PYTHON_EXIT_CODE -eq 255 ]; then - LOG_ERROR "python3脚本参数或模块不支持" - exit 255 - else - CHECK_RESULT $PYTHON_EXIT_CODE 0 0 "将能力应用到当前进程测试失败" - fi - - # 步骤5:清理环境,恢复到之前的状态 - LOG_INFO "步骤5:清理环境,恢复到之前的状态" - 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/libcap-ng/libcap-ng-python3/test_libcap-ng-python3_function_basic_import.sh b/testcases/function_test/pkg_test/libcap-ng/libcap-ng-python3/test_libcap-ng-python3_function_basic_import.sh deleted file mode 100644 index 1bdb6d240c9..00000000000 --- a/testcases/function_test/pkg_test/libcap-ng/libcap-ng-python3/test_libcap-ng-python3_function_basic_import.sh +++ /dev/null @@ -1,66 +0,0 @@ -#!/usr/bin/bash - -# Copyright (c) 2024 ISCAS .ALL rights reserved. -# This program is licensed under Mulan PSL v2. -# You can use it according to the terms and conditions of the Mulan PSL v2. -# http://license.coscl.org.cn/MulanPSL2 -# THIS PROGRAM IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, -# EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, -# MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. -# See the Mulan PSL v2 for more details. - -# ############################################# -# @Author : honghua -# @Contact : honghua@iscas.ac.cn -# @Date : 2026-03-12 -# @License : Mulan PSL v2 -# @Desc : 测试libcap-ng-python3模块的基本导入 -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - # 判断是否已安装libcap-ng-python3 - LOG_INFO "检查是否已安装libcap-ng-python3软件包" - if rpm -q libcap-ng-python3 &>/dev/null; then - LOG_INFO "libcap-ng-python3已安装,测试结束后将保持安装状态" - INSTALLED_BEFORE=true - else - LOG_INFO "libcap-ng-python3未安装,将在测试过程中安装并在测试结束后卸载" - INSTALLED_BEFORE=false - fi - - # 检查yum源中是否有libcap-ng-python3软件包 - LOG_INFO "检查yum源中是否存在libcap-ng-python3软件包" - if ! dnf list available libcap-ng-python3 &>/dev/null; then - LOG_ERROR "yum源中未找到libcap-ng-python3软件包" - exit 255 - fi - - # 如果未安装,则安装软件包 - if [ "$INSTALLED_BEFORE" = false ]; then - LOG_INFO "开始安装libcap-ng-python3软件包" - dnf install -y libcap-ng-python3 - CHECK_RESULT $? 0 0 "安装libcap-ng-python3失败" - LOG_INFO "libcap-ng-python3软件包安装成功" - fi - - # 测试libcap-ng-python3模块的基本导入 - LOG_INFO "测试libcap-ng-python3模块的基本导入" - python3 -c "import libcapng" - CHECK_RESULT $? 0 0 "导入libcap-ng-python3模块失败" - - LOG_INFO "libcap-ng-python3模块导入测试成功" - - # 环境清理:如果测试前未安装,则卸载软件包 - if [ "$INSTALLED_BEFORE" = false ]; then - LOG_INFO "开始卸载libcap-ng-python3软件包" - dnf remove -y libcap-ng-python3 - CHECK_RESULT $? 0 0 "卸载libcap-ng-python3失败" - LOG_INFO "libcap-ng-python3软件包卸载成功" - fi - - LOG_INFO "测试完成,环境已恢复" -} - -main "$@" \ No newline at end of file diff --git a/testcases/function_test/pkg_test/libcap-ng/libcap-ng-python3/test_libcap-ng-python3_function_capability_get.sh b/testcases/function_test/pkg_test/libcap-ng/libcap-ng-python3/test_libcap-ng-python3_function_capability_get.sh deleted file mode 100644 index 671fc899fc4..00000000000 --- a/testcases/function_test/pkg_test/libcap-ng/libcap-ng-python3/test_libcap-ng-python3_function_capability_get.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-12 -# @License : Mulan PSL v2 -# @Desc : 测试获取进程能力集 -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - LOG_INFO "开始测试:测试获取进程能力集" - - # 定义软件包名称 - PACKAGE_NAME="libcap-ng-python3" - - # 检查yum源中是否存在指定软件包 - LOG_INFO "检查yum源中是否存在软件包:${PACKAGE_NAME}" - if ! dnf list available ${PACKAGE_NAME} &>/dev/null; then - LOG_ERROR "yum源中未找到软件包:${PACKAGE_NAME}" - exit 255 - fi - - # 检查当前环境是否已安装软件包 - LOG_INFO "检查当前环境是否已安装软件包:${PACKAGE_NAME}" - if rpm -q ${PACKAGE_NAME} &>/dev/null; then - LOG_INFO "软件包已安装,测试结束后将保持安装状态" - INSTALLED_BEFORE_TEST=true - else - LOG_INFO "软件包未安装,将在测试前安装并在测试后卸载" - INSTALLED_BEFORE_TEST=false - fi - - # 如果未安装,则安装软件包 - if [ "${INSTALLED_BEFORE_TEST}" = "false" ]; then - LOG_INFO "安装软件包:${PACKAGE_NAME}" - dnf install -y ${PACKAGE_NAME} - CHECK_RESULT $? 0 0 "安装软件包失败" - fi - - # 测试获取进程能力集功能 - LOG_INFO "测试获取进程能力集功能" - python3 -c " - import sys - sys.path.append("/usr/lib64/python3.6/site-packages") - import capng - - # 初始化capng - capng.capng_clear(capng.CAPNG_SELECT_BOTH) - capng.capng_update(capng.CAPNG_ADD, capng.CAPNG_EFFECTIVE, capng.CAP_NET_RAW) - capng.capng_apply(capng.CAPNG_SELECT_BOTH) - - # 获取当前进程的能力集 - capng.capng_get_caps_process() - caps = capng.capng_print_caps_numeric(capng.CAPNG_PRINT_BUFFER, capng.CAPNG_SELECT_BOTH) - print("进程能力集:", caps) - " - CHECK_RESULT $? 0 0 "获取进程能力集失败" - - # 清理环境:如果测试前未安装,则卸载软件包 - if [ "${INSTALLED_BEFORE_TEST}" = "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/libcap-ng/libcap-ng-python3/test_libcap-ng-python3_function_capability_set.sh b/testcases/function_test/pkg_test/libcap-ng/libcap-ng-python3/test_libcap-ng-python3_function_capability_set.sh deleted file mode 100644 index ef2e3a49569..00000000000 --- a/testcases/function_test/pkg_test/libcap-ng/libcap-ng-python3/test_libcap-ng-python3_function_capability_set.sh +++ /dev/null @@ -1,105 +0,0 @@ -#!/usr/bin/bash - -# Copyright (c) 2024 ISCAS .ALL rights reserved. -# This program is licensed under Mulan PSL v2. -# You can use it according to the terms and conditions of the Mulan PSL v2. -# http://license.coscl.org.cn/MulanPSL2 -# THIS PROGRAM IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, -# EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, -# MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. -# See the Mulan PSL v2 for more details. - -# ############################################# -# @Author : honghua -# @Contact : honghua@iscas.ac.cn -# @Date : 2026-03-12 -# @License : Mulan PSL v2 -# @Desc : 测试设置进程能力集 -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - # 检查是否已安装libcap-ng-utils和python3-libcap-ng - LOG_INFO "检查是否已安装libcap-ng-utils和python3-libcap-ng" - if dnf list installed libcap-ng-utils > /dev/null 2>&1 && dnf list installed python3-libcap-ng > /dev/null 2>&1; then - LOG_INFO "软件包已安装,测试结束后将保持安装状态" - INSTALLED=1 - else - LOG_INFO "软件包未安装,将在测试前安装并在测试后卸载" - INSTALLED=0 - fi - - # 检查yum源中是否存在所需软件包 - LOG_INFO "检查yum源中是否存在libcap-ng-utils和python3-libcap-ng" - if ! dnf list available libcap-ng-utils > /dev/null 2>&1; then - LOG_ERROR "yum源中不存在libcap-ng-utils软件包" - exit 255 - fi - if ! dnf list available python3-libcap-ng > /dev/null 2>&1; then - LOG_ERROR "yum源中不存在python3-libcap-ng软件包" - exit 255 - fi - - # 如果未安装,则安装软件包 - if [ $INSTALLED -eq 0 ]; then - LOG_INFO "安装libcap-ng-utils和python3-libcap-ng" - dnf install -y libcap-ng-utils python3-libcap-ng - CHECK_RESULT $? 0 0 "安装libcap-ng-utils和python3-libcap-ng失败" - fi - - # 测试设置进程能力集 - LOG_INFO "测试设置进程能力集" - - # 检查pscap命令是否存在 - LOG_INFO "检查pscap命令是否存在" - command -v pscap > /dev/null 2>&1 - CHECK_RESULT $? 0 0 "pscap命令不存在" - - # 使用pscap查看当前进程的能力集 - LOG_INFO "使用pscap查看当前进程的能力集" - pscap - CHECK_RESULT $? 0 0 "pscap命令执行失败" - - # 使用capsh命令查看当前shell的能力集 - LOG_INFO "使用capsh命令查看当前shell的能力集" - capsh --print - CHECK_RESULT $? 0 0 "capsh命令执行失败" - - # 使用python3-libcap-ng模块测试能力集设置 - LOG_INFO "使用python3-libcap-ng模块测试能力集设置" - python3 -c " - import libcapng - lcn = libcapng.CAPNG_SELECT_CAPS - libcapng.capng_clear(lcn) - libcapng.capng_fill(lcn) - libcapng.capng_setpid(0) - print("libcap-ng python3模块测试成功") - " - CHECK_RESULT $? 0 0 "python3-libcap-ng模块测试失败" - - # 测试设置特定能力 - LOG_INFO "测试设置特定能力" - python3 -c " - import libcapng - lcn = libcapng.CAPNG_SELECT_CAPS - libcapng.capng_clear(lcn) - libcapng.capng_update(libcapng.CAPNG_ADD, libcapng.CAPNG_EFFECTIVE, libcapng.CAP_NET_BIND_SERVICE) - libcapng.capng_apply(libcapng.CAPNG_SELECT_BOTH) - print("设置CAP_NET_BIND_SERVICE能力成功") - " - CHECK_RESULT $? 0 0 "设置特定能力失败" - - # 清理环境:如果测试前未安装,则卸载软件包 - if [ $INSTALLED -eq 0 ]; then - LOG_INFO "卸载libcap-ng-utils和python3-libcap-ng" - dnf remove -y libcap-ng-utils python3-libcap-ng - CHECK_RESULT $? 0 0 "卸载libcap-ng-utils和python3-libcap-ng失败" - else - LOG_INFO "测试前软件包已安装,保持安装状态" - fi - - LOG_INFO "测试设置进程能力集完成" -} - -main "$@" \ No newline at end of file diff --git a/testcases/function_test/pkg_test/libcap-ng/libcap-ng-python3/test_libcap-ng-python3_function_check.sh b/testcases/function_test/pkg_test/libcap-ng/libcap-ng-python3/test_libcap-ng-python3_function_check.sh deleted file mode 100644 index a7878b9fc86..00000000000 --- a/testcases/function_test/pkg_test/libcap-ng/libcap-ng-python3/test_libcap-ng-python3_function_check.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-12 -# @License : Mulan PSL v2 -# @Desc : 检查软件包libcap-ng-python3是否已安装 -# ############################################ - -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 - 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() { - local package_name=$1 - LOG_INFO "检查软件包 $package_name 是否已安装" - rpm -q "$package_name" &>/dev/null - if [ $? -eq 0 ]; then - LOG_INFO "软件包 $package_name 已安装" - return 0 - else - LOG_INFO "软件包 $package_name 未安装" - return 1 - fi - } - - # 安装软件包 - install_package() { - local package_name=$1 - LOG_INFO "开始安装软件包: $package_name" - dnf install -y "$package_name" - CHECK_RESULT $? 0 0 "安装软件包 $package_name 失败" - LOG_INFO "软件包 $package_name 安装成功" - } - - # 卸载软件包 - uninstall_package() { - local package_name=$1 - LOG_INFO "开始卸载软件包: $package_name" - dnf remove -y "$package_name" - CHECK_RESULT $? 0 0 "卸载软件包 $package_name 失败" - LOG_INFO "软件包 $package_name 卸载成功" - } - - # 主测试函数 - main() { - local package_name="libcap-ng-python3" - local was_installed=false - - # 步骤1: 检查软件包是否在yum源中 - check_package_in_repo "$package_name" - - # 步骤2: 检查软件包是否已安装 - if check_package_installed "$package_name"; then - was_installed=true - LOG_INFO "软件包已安装,测试后将保持安装状态" - else - LOG_INFO "软件包未安装,将执行安装作为测试步骤" - fi - - # 步骤3: 如果未安装,则安装软件包 - if ! $was_installed; then - install_package "$package_name" - fi - - # 步骤4: 验证软件包功能(示例:检查python模块是否可以导入) - LOG_INFO "验证软件包功能:尝试导入python模块" - python3 -c "import ctypes; import ctypes.util; import os; import sys; sys.path.insert(0, "/usr/lib64/python3.9/site-packages"); import capng" 2>/dev/null - CHECK_RESULT $? 0 0 "导入libcap-ng-python3模块失败" - - # 步骤5: 清理环境(如果测试前未安装,则卸载软件包) - if ! $was_installed; then - uninstall_package "$package_name" - else - LOG_INFO "测试前软件包已安装,保持安装状态,无需清理" - fi - - LOG_INFO "测试完成" - } - - # 执行主函数 - main -} - -main "$@" \ No newline at end of file diff --git a/testcases/function_test/pkg_test/libcap-ng/libcap-ng-python3/test_libcap-ng-python3_function_have_cap.sh b/testcases/function_test/pkg_test/libcap-ng/libcap-ng-python3/test_libcap-ng-python3_function_have_cap.sh deleted file mode 100644 index 8a5ca09dff7..00000000000 --- a/testcases/function_test/pkg_test/libcap-ng/libcap-ng-python3/test_libcap-ng-python3_function_have_cap.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-12 -# @License : Mulan PSL v2 -# @Desc : 测试检查是否拥有特定能力 -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - set -e - - LOG_INFO "开始测试:检查是否拥有特定能力" - - # 检查是否已安装libcap-ng-python3 - LOG_INFO "检查libcap-ng-python3是否已安装" - if dnf list installed libcap-ng-python3 &>/dev/null; then - LOG_INFO "libcap-ng-python3已安装,测试后保持安装状态" - installed_before_test=true - else - LOG_INFO "libcap-ng-python3未安装,将在测试中安装" - installed_before_test=false - fi - - # 检查yum源中是否有libcap-ng-python3软件包 - LOG_INFO "检查yum源中是否存在libcap-ng-python3软件包" - if ! dnf list available libcap-ng-python3 &>/dev/null; then - LOG_ERROR "yum源中未找到libcap-ng-python3软件包" - exit 255 - fi - - # 如果未安装,则安装软件包 - if [ "$installed_before_test" = false ]; then - LOG_INFO "安装libcap-ng-python3软件包" - dnf install -y libcap-ng-python3 - CHECK_RESULT $? 0 0 "安装libcap-ng-python3失败" - fi - - # 测试检查是否拥有特定能力 - LOG_INFO "执行测试:检查是否拥有特定能力" - python3 -c "import ctypes; import ctypes.util; lib = ctypes.CDLL(ctypes.util.find_library("cap-ng")); print("libcap-ng库加载成功")" 2>/dev/null - CHECK_RESULT $? 0 0 "libcap-ng库加载失败,可能缺少特定能力" - - # 清理环境:如果测试前未安装,则卸载软件包 - if [ "$installed_before_test" = false ]; then - LOG_INFO "卸载libcap-ng-python3软件包" - dnf remove -y libcap-ng-python3 - CHECK_RESULT $? 0 0 "卸载libcap-ng-python3失败" - else - LOG_INFO "测试前已安装libcap-ng-python3,保持安装状态" - fi - - LOG_INFO "测试完成:检查是否拥有特定能力" -} - -main "$@" \ No newline at end of file diff --git a/testcases/function_test/pkg_test/libcap-ng/libcap-ng-python3/test_libcap-ng-python3_function_iab_get.sh b/testcases/function_test/pkg_test/libcap-ng/libcap-ng-python3/test_libcap-ng-python3_function_iab_get.sh deleted file mode 100644 index 54dbe73de38..00000000000 --- a/testcases/function_test/pkg_test/libcap-ng/libcap-ng-python3/test_libcap-ng-python3_function_iab_get.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-12 -# @License : Mulan PSL v2 -# @Desc : 测试获取IAB向量 -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - LOG_INFO "开始测试获取IAB向量功能" - - # 定义软件包名称 - PACKAGE_NAME="libcap-ng-python3" - LOG_INFO "检查yum源中是否存在软件包:$PACKAGE_NAME" - if ! dnf list available $PACKAGE_NAME &>/dev/null; then - LOG_ERROR "yum源中未找到软件包:$PACKAGE_NAME" - exit 255 - fi - - # 判断是否已安装 - LOG_INFO "检查系统是否已安装软件包:$PACKAGE_NAME" - if rpm -q $PACKAGE_NAME &>/dev/null; then - LOG_INFO "软件包已安装,测试结束后将保持安装状态" - INSTALLED_BEFORE=true - else - LOG_INFO "软件包未安装,将进行安装" - INSTALLED_BEFORE=false - fi - - # 如果未安装,则安装软件包 - if [ "$INSTALLED_BEFORE" = "false" ]; then - LOG_INFO "安装软件包:$PACKAGE_NAME" - dnf install -y $PACKAGE_NAME - CHECK_RESULT $? 0 0 "安装软件包失败" - fi - - # 测试获取IAB向量功能 - LOG_INFO "执行获取IAB向量测试" - python3 -c " - import sys - sys.path.append("/usr/lib64/python3.9/site-packages") - import capng - try: - iab = capng.iab_get() - print("IAB向量获取成功:", iab) - sys.exit(0) - except AttributeError as e: - print("错误:capng模块不支持iab_get方法") - sys.exit(255) - except Exception as e: - print("获取IAB向量失败:", str(e)) - sys.exit(1) - " - CHECK_RESULT $? 0 0 "获取IAB向量功能测试失败" - - # 环境清理 - if [ "$INSTALLED_BEFORE" = "false" ]; then - LOG_INFO "清理环境:卸载软件包 $PACKAGE_NAME" - dnf remove -y $PACKAGE_NAME - CHECK_RESULT $? 0 0 "卸载软件包失败" - else - LOG_INFO "测试前已安装软件包,保持安装状态" - fi - - LOG_INFO "获取IAB向量功能测试完成" -} - -main "$@" \ No newline at end of file diff --git a/testcases/function_test/pkg_test/libcap-ng/libcap-ng-python3/test_libcap-ng-python3_function_iab_set.sh b/testcases/function_test/pkg_test/libcap-ng/libcap-ng-python3/test_libcap-ng-python3_function_iab_set.sh deleted file mode 100644 index 53f9ab5cde1..00000000000 --- a/testcases/function_test/pkg_test/libcap-ng/libcap-ng-python3/test_libcap-ng-python3_function_iab_set.sh +++ /dev/null @@ -1,85 +0,0 @@ -#!/usr/bin/bash - -# Copyright (c) 2024 ISCAS .ALL rights reserved. -# This program is licensed under Mulan PSL v2. -# You can use it according to the terms and conditions of the Mulan PSL v2. -# http://license.coscl.org.cn/MulanPSL2 -# THIS PROGRAM IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, -# EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, -# MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. -# See the Mulan PSL v2 for more details. - -# ############################################# -# @Author : honghua -# @Contact : honghua@iscas.ac.cn -# @Date : 2026-03-12 -# @License : Mulan PSL v2 -# @Desc : 测试设置IAB向量 -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - LOG_INFO "开始测试:测试设置IAB向量" - - # 定义软件包名称 - PACKAGE_NAME="libcap-ng-python3" - - # 检查yum源中是否存在指定软件包 - LOG_INFO "检查yum源中是否存在软件包:${PACKAGE_NAME}" - if ! dnf list available ${PACKAGE_NAME} &>/dev/null; then - LOG_ERROR "yum源中不存在软件包:${PACKAGE_NAME}" - exit 255 - fi - - # 检查系统是否已安装指定软件包 - LOG_INFO "检查系统是否已安装软件包:${PACKAGE_NAME}" - if rpm -q ${PACKAGE_NAME} &>/dev/null; then - LOG_INFO "软件包已安装,测试结束后保持安装状态" - INSTALLED_BEFORE_TEST=true - else - LOG_INFO "软件包未安装,将在测试过程中安装" - INSTALLED_BEFORE_TEST=false - fi - - # 如果未安装,则安装软件包 - if [ "${INSTALLED_BEFORE_TEST}" = "false" ]; then - LOG_INFO "安装软件包:${PACKAGE_NAME}" - dnf install -y ${PACKAGE_NAME} - CHECK_RESULT $? 0 0 "安装软件包失败" - fi - - # 检查iab命令是否支持set参数 - LOG_INFO "检查iab命令是否支持set参数" - if ! iab --help 2>&1 | grep -q "set"; then - LOG_ERROR "iab命令不支持set参数" - exit 255 - fi - - # 执行iab set命令测试 - LOG_INFO "执行iab set命令测试" - iab set 0x12345678 - CHECK_RESULT $? 0 0 "iab set命令执行失败" - - # 验证IAB向量设置结果 - LOG_INFO "验证IAB向量设置结果" - CURRENT_IAB=$(cat /proc/self/attr/current 2>/dev/null | grep -o "iab:[^[:space:]]*" | cut -d: -f2) - EXPECTED_IAB="12345678" - if [ "${CURRENT_IAB}" = "${EXPECTED_IAB}" ]; then - LOG_INFO "IAB向量设置成功,当前值为:${CURRENT_IAB}" - else - LOG_ERROR "IAB向量设置失败,当前值为:${CURRENT_IAB},期望值为:${EXPECTED_IAB}" - exit 1 - fi - - # 清理环境:如果测试前未安装,则卸载软件包 - if [ "${INSTALLED_BEFORE_TEST}" = "false" ]; then - LOG_INFO "卸载软件包:${PACKAGE_NAME}" - dnf remove -y ${PACKAGE_NAME} - CHECK_RESULT $? 0 0 "卸载软件包失败" - fi - - LOG_INFO "测试结束:测试设置IAB向量完成" -} - -main "$@" \ No newline at end of file diff --git a/testcases/function_test/pkg_test/libcap-ng/libcap-ng-python3/test_libcap-ng-python3_function_install.sh b/testcases/function_test/pkg_test/libcap-ng/libcap-ng-python3/test_libcap-ng-python3_function_install.sh deleted file mode 100644 index 3d531887ebb..00000000000 --- a/testcases/function_test/pkg_test/libcap-ng/libcap-ng-python3/test_libcap-ng-python3_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-03-12 -# @License : Mulan PSL v2 -# @Desc : 测试软件包libcap-ng-python3的安装功能 -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - set -e - - # 初始化变量 - PACKAGE_NAME="libcap-ng-python3" - LOG_INFO "开始测试软件包 ${PACKAGE_NAME} 的安装功能" - - # 步骤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 - LOG_INFO "yum源中存在 ${PACKAGE_NAME} 软件包" - - # 步骤2:检查系统是否已经安装了该软件包 - LOG_INFO "步骤2:检查系统是否已经安装了 ${PACKAGE_NAME} 软件包" - INSTALLED=0 - dnf list installed ${PACKAGE_NAME} > /dev/null 2>&1 - if [ $? -eq 0 ]; then - LOG_INFO "系统已经安装了 ${PACKAGE_NAME} 软件包" - INSTALLED=1 - else - LOG_INFO "系统未安装 ${PACKAGE_NAME} 软件包" - fi - - # 步骤3:如果未安装,则进行安装 - if [ ${INSTALLED} -eq 0 ]; then - LOG_INFO "步骤3:安装 ${PACKAGE_NAME} 软件包" - dnf install -y ${PACKAGE_NAME} - CHECK_RESULT $? 0 0 "安装 ${PACKAGE_NAME} 软件包失败" - LOG_INFO "安装 ${PACKAGE_NAME} 软件包成功" - fi - - # 步骤4:验证安装的软件包是否可用 - LOG_INFO "步骤4:验证 ${PACKAGE_NAME} 软件包是否可用" - # 这里可以根据具体软件包的功能进行验证,例如运行一个命令或检查文件是否存在 - # 示例:检查是否安装了python3模块 - python3 -c "import libcapng" 2>&1 - CHECK_RESULT $? 0 0 "验证 ${PACKAGE_NAME} 软件包功能失败" - LOG_INFO "验证 ${PACKAGE_NAME} 软件包功能成功" - - # 步骤5:如果之前未安装,则卸载软件包以恢复环境 - if [ ${INSTALLED} -eq 0 ]; then - LOG_INFO "步骤5:卸载 ${PACKAGE_NAME} 软件包以恢复环境" - dnf remove -y ${PACKAGE_NAME} - CHECK_RESULT $? 0 0 "卸载 ${PACKAGE_NAME} 软件包失败" - LOG_INFO "卸载 ${PACKAGE_NAME} 软件包成功" - else - LOG_INFO "步骤5:系统原本已安装 ${PACKAGE_NAME},保持安装状态" - fi - - LOG_INFO "测试软件包 ${PACKAGE_NAME} 的安装功能完成" -} - -main "$@" \ No newline at end of file diff --git a/testcases/function_test/pkg_test/libcap-ng/libcap-ng-python3/test_libcap-ng-python3_function_remove.sh b/testcases/function_test/pkg_test/libcap-ng/libcap-ng-python3/test_libcap-ng-python3_function_remove.sh deleted file mode 100644 index 8136d7ff00a..00000000000 --- a/testcases/function_test/pkg_test/libcap-ng/libcap-ng-python3/test_libcap-ng-python3_function_remove.sh +++ /dev/null @@ -1,76 +0,0 @@ -#!/usr/bin/bash - -# Copyright (c) 2024 ISCAS .ALL rights reserved. -# This program is licensed under Mulan PSL v2. -# You can use it according to the terms and conditions of the Mulan PSL v2. -# http://license.coscl.org.cn/MulanPSL2 -# THIS PROGRAM IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, -# EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, -# MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. -# See the Mulan PSL v2 for more details. - -# ############################################# -# @Author : honghua -# @Contact : honghua@iscas.ac.cn -# @Date : 2026-03-12 -# @License : Mulan PSL v2 -# @Desc : 测试软件包libcap-ng-python3的卸载功能 -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - set -e - - LOG_INFO "开始测试libcap-ng-python3的卸载功能" - - LOG_INFO "步骤1:检查环境中是否已安装libcap-ng-python3软件包" - if dnf list installed libcap-ng-python3 &> /dev/null; then - LOG_INFO "环境已安装libcap-ng-python3,测试前状态为已安装" - PRE_INSTALLED=true - else - LOG_INFO "环境未安装libcap-ng-python3" - PRE_INSTALLED=false - fi - - LOG_INFO "步骤2:检查yum源中是否存在libcap-ng-python3软件包" - if ! dnf list available libcap-ng-python3 &> /dev/null; then - LOG_ERROR "yum源中未找到libcap-ng-python3软件包" - exit 255 - fi - - if [ "$PRE_INSTALLED" = "false" ]; then - LOG_INFO "步骤3:安装libcap-ng-python3软件包" - dnf install -y libcap-ng-python3 - CHECK_RESULT $? 0 0 "安装libcap-ng-python3失败" - fi - - LOG_INFO "步骤4:验证libcap-ng-python3安装成功" - dnf list installed libcap-ng-python3 - CHECK_RESULT $? 0 0 "验证libcap-ng-python3安装失败" - - LOG_INFO "步骤5:卸载libcap-ng-python3软件包" - dnf remove -y libcap-ng-python3 - CHECK_RESULT $? 0 0 "卸载libcap-ng-python3失败" - - LOG_INFO "步骤6:验证libcap-ng-python3卸载成功" - if dnf list installed libcap-ng-python3 &> /dev/null; then - LOG_ERROR "libcap-ng-python3卸载后仍然存在" - exit 1 - else - LOG_INFO "libcap-ng-python3已成功卸载" - fi - - LOG_INFO "步骤7:环境恢复" - if [ "$PRE_INSTALLED" = "true" ]; then - LOG_INFO "恢复环境到初始安装状态" - dnf install -y libcap-ng-python3 - CHECK_RESULT $? 0 0 "恢复安装libcap-ng-python3失败" - else - LOG_INFO "环境已恢复为未安装状态" - fi - - LOG_INFO "libcap-ng-python3卸载功能测试完成" -} - -main "$@" \ No newline at end of file diff --git a/testcases/function_test/pkg_test/libmng/libmng-devel/test_libmng-devel_compile.sh b/testcases/function_test/pkg_test/libmng/libmng-devel/test_libmng-devel_compile.sh deleted file mode 100644 index b07d7a6771e..00000000000 --- a/testcases/function_test/pkg_test/libmng/libmng-devel/test_libmng-devel_compile.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-21 -# @License : Mulan PSL v2 -# @Desc : 测试使用libmng-devel提供的头文件和库文件进行简单的程序编译和链接。 -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - # 检查是否已安装libmng-devel - LOG_INFO "检查是否已安装libmng-devel" - rpm -q libmng-devel - if [ $? -eq 0 ]; then - LOG_INFO "libmng-devel已安装,脚本结束后保持安装状态" - INSTALLED=1 - else - LOG_INFO "libmng-devel未安装,将在测试步骤中安装" - INSTALLED=0 - fi - - # 检查yum源中是否有libmng-devel软件包 - LOG_INFO "检查yum源中是否有libmng-devel软件包" - dnf list available libmng-devel > /dev/null 2>&1 - CHECK_RESULT $? 0 0 "yum源中没有libmng-devel软件包" - if [ $? -ne 0 ]; then - LOG_ERROR "yum源中没有libmng-devel软件包" - exit 255 - fi - - # 如果未安装,则安装libmng-devel - if [ $INSTALLED -eq 0 ]; then - LOG_INFO "安装libmng-devel软件包" - dnf install -y libmng-devel - CHECK_RESULT $? 0 0 "安装libmng-devel失败" - fi - - # 创建测试程序源代码 - LOG_INFO "创建测试程序源代码" - cat > test_libmng.c << "EOF" - #include - #include - int main() { - mng_handle mng = mng_initialize(NULL, NULL, NULL); - if (mng == NULL) { - printf("Failed to initialize libmng\n"); - return 1; - } - printf("libmng initialization successful\n"); - mng_cleanup(&mng); - return 0; - } - EOF - CHECK_RESULT $? 0 0 "创建测试程序源代码失败" - - # 编译测试程序 - LOG_INFO "编译测试程序" - gcc -o test_libmng test_libmng.c -lmng - CHECK_RESULT $? 0 0 "编译测试程序失败" - - # 运行测试程序 - LOG_INFO "运行测试程序" - ./test_libmng - CHECK_RESULT $? 0 0 "运行测试程序失败" - - # 清理测试程序 - LOG_INFO "清理测试程序" - rm -f test_libmng test_libmng.c - CHECK_RESULT $? 0 0 "清理测试程序失败" - - # 如果之前未安装,则卸载libmng-devel - if [ $INSTALLED -eq 0 ]; then - LOG_INFO "卸载libmng-devel软件包" - dnf remove -y libmng-devel - CHECK_RESULT $? 0 0 "卸载libmng-devel失败" - fi - - LOG_INFO "测试完成" -} - -main "$@" \ No newline at end of file diff --git a/testcases/function_test/pkg_test/libxml2/python3-libxml2/test_python3-libxml2_function_edit.sh b/testcases/function_test/pkg_test/libxml2/python3-libxml2/test_python3-libxml2_function_edit.sh deleted file mode 100644 index 05a50d459b6..00000000000 --- a/testcases/function_test/pkg_test/libxml2/python3-libxml2/test_python3-libxml2_function_edit.sh +++ /dev/null @@ -1,94 +0,0 @@ -#!/usr/bin/bash - -# Copyright (c) 2024 ISCAS .ALL rights reserved. -# This program is licensed under Mulan PSL v2. -# You can use it according to the terms and conditions of the Mulan PSL v2. -# http://license.coscl.org.cn/MulanPSL2 -# THIS PROGRAM IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, -# EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, -# MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. -# See the Mulan PSL v2 for more details. - -# ############################################# -# @Author : honghua -# @Contact : honghua@iscas.ac.cn -# @Date : 2026-02-24 -# @License : Mulan PSL v2 -# @Desc : 测试修改XML节点内容 -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - LOG_INFO "开始测试:测试修改XML节点内容" - - # 定义软件包名称 - PACKAGE_NAME="python3-libxml2" - 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_BEFORE=1 - else - LOG_INFO "软件包 ${PACKAGE_NAME} 未安装,将作为测试步骤进行安装" - INSTALLED_BEFORE=0 - fi - - if [ ${INSTALLED_BEFORE} -eq 0 ]; then - LOG_INFO "安装软件包 ${PACKAGE_NAME}" - dnf install -y ${PACKAGE_NAME} - CHECK_RESULT $? 0 0 "安装 ${PACKAGE_NAME} 失败" - fi - - LOG_INFO "创建测试XML文件" - cat > test.xml << EOF - - - 原始内容 - - EOF - CHECK_RESULT $? 0 0 "创建测试XML文件失败" - - LOG_INFO "测试修改XML节点内容" - python3 -c " - import libxml2 - doc = libxml2.parseFile("test.xml") - root = doc.getRootElement() - node = root.children - while node: - if node.name == "node": - node.setContent("修改后的内容") - break - node = node.next - doc.saveFile("test.xml") - doc.freeDoc() - " - CHECK_RESULT $? 0 0 "修改XML节点内容失败" - - LOG_INFO "验证XML节点内容是否修改成功" - grep -q "修改后的内容" test.xml - CHECK_RESULT $? 0 0 "XML节点内容修改未生效" - - LOG_INFO "清理测试文件" - rm -f test.xml - CHECK_RESULT $? 0 0 "删除测试文件失败" - - 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 "测试完成:测试修改XML节点内容" -} - -main "$@" \ No newline at end of file diff --git a/testcases/function_test/pkg_test/libxml2/python3-libxml2/test_python3-libxml2_function_install.sh b/testcases/function_test/pkg_test/libxml2/python3-libxml2/test_python3-libxml2_function_install.sh deleted file mode 100644 index 31c451e708d..00000000000 --- a/testcases/function_test/pkg_test/libxml2/python3-libxml2/test_python3-libxml2_function_install.sh +++ /dev/null @@ -1,77 +0,0 @@ -#!/usr/bin/bash - -# Copyright (c) 2024 ISCAS .ALL rights reserved. -# This program is licensed under Mulan PSL v2. -# You can use it according to the terms and conditions of the Mulan PSL v2. -# http://license.coscl.org.cn/MulanPSL2 -# THIS PROGRAM IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, -# EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, -# MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. -# See the Mulan PSL v2 for more details. - -# ############################################# -# @Author : honghua -# @Contact : honghua@iscas.ac.cn -# @Date : 2026-02-24 -# @License : Mulan PSL v2 -# @Desc : 测试安装python3-libxml2软件包 -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - # 检查是否已安装python3-libxml2 - LOG_INFO "检查python3-libxml2是否已安装" - rpm -q python3-libxml2 > /dev/null 2>&1 - if [ $? -eq 0 ]; then - LOG_INFO "python3-libxml2已安装,脚本结束后将保持安装状态" - INSTALLED=1 - else - LOG_INFO "python3-libxml2未安装,将在测试过程中安装" - INSTALLED=0 - fi - - # 检查yum源中是否有python3-libxml2软件包 - LOG_INFO "检查yum源中是否有python3-libxml2软件包" - dnf list available python3-libxml2 > /dev/null 2>&1 - if [ $? -ne 0 ]; then - LOG_ERROR "yum源中未找到python3-libxml2软件包" - exit 255 - fi - - # 如果未安装,则安装软件包 - if [ $INSTALLED -eq 0 ]; then - LOG_INFO "开始安装python3-libxml2软件包" - dnf install -y python3-libxml2 - CHECK_RESULT $? 0 0 "安装python3-libxml2失败" - LOG_INFO "python3-libxml2安装成功" - fi - - # 验证python3-libxml2功能 - LOG_INFO "验证python3-libxml2功能" - python3 -c "import libxml2; print("libxml2 module version:", libxml2.__version__)" > /dev/null 2>&1 - CHECK_RESULT $? 0 0 "python3-libxml2功能验证失败" - LOG_INFO "python3-libxml2功能验证成功" - - # 如果需要,在第二个服务器上执行命令 - if [ -n "$NODE2_IPV4" ] && [ -n "$NODE2_PASSWORD" ] && [ -n "$NODE2_USER" ]; then - LOG_INFO "在第二个服务器上验证python3-libxml2" - SSH_CMD "python3 -c \"import libxml2; print("libxml2 module version:", libxml2.__version__)\"" $NODE2_IPV4 $NODE2_PASSWORD $NODE2_USER - CHECK_RESULT $? 0 0 "第二个服务器上python3-libxml2验证失败" - LOG_INFO "第二个服务器上python3-libxml2验证成功" - fi - - # 清理环境:如果之前未安装,则卸载软件包 - if [ $INSTALLED -eq 0 ]; then - LOG_INFO "清理环境:卸载python3-libxml2软件包" - dnf remove -y python3-libxml2 - CHECK_RESULT $? 0 0 "卸载python3-libxml2失败" - LOG_INFO "python3-libxml2卸载成功" - else - LOG_INFO "保持python3-libxml2安装状态,无需卸载" - fi - - LOG_INFO "测试脚本执行完成" -} - -main "$@" \ No newline at end of file diff --git a/testcases/function_test/pkg_test/libxml2/python3-libxml2/test_python3-libxml2_function_parse.sh b/testcases/function_test/pkg_test/libxml2/python3-libxml2/test_python3-libxml2_function_parse.sh deleted file mode 100644 index c717410ddf9..00000000000 --- a/testcases/function_test/pkg_test/libxml2/python3-libxml2/test_python3-libxml2_function_parse.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 : 测试解析XML文档的基本功能 -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - LOG_INFO "开始测试解析XML文档的基本功能" - - LOG_INFO "检查环境是否已安装python3-libxml2" - if dnf list installed python3-libxml2 &>/dev/null; then - LOG_INFO "python3-libxml2已安装,脚本结束时将保持安装状态" - already_installed=1 - else - LOG_INFO "python3-libxml2未安装,将在测试步骤中安装" - already_installed=0 - fi - - LOG_INFO "检查yum源中是否存在python3-libxml2软件包" - if ! dnf list available python3-libxml2 &>/dev/null; then - LOG_ERROR "yum源中未找到python3-libxml2软件包" - exit 255 - fi - - LOG_INFO "安装python3-libxml2软件包" - dnf install -y python3-libxml2 - CHECK_RESULT $? 0 0 "安装python3-libxml2失败" - - LOG_INFO "验证libxml2库的基本解析功能" - cat > test_parse.xml << "EOF" - - - text content - - EOF - - python3 << "EOF" - import libxml2 - try: - doc = libxml2.parseFile("test_parse.xml") - root = doc.children - if root.name != "root": - print("ERROR: 根节点名称不正确") - exit(1) - element = root.children - if element.name != "element": - print("ERROR: 子节点名称不正确") - exit(1) - attr = element.hasProp("attribute") - if not attr: - print("ERROR: 未找到属性") - exit(1) - if attr.content != "value": - print("ERROR: 属性值不正确") - exit(1) - if element.content.strip() != "text content": - print("ERROR: 文本内容不正确") - exit(1) - print("SUCCESS: XML解析测试通过") - exit(0) - except Exception as e: - print(f"ERROR: 解析过程中出现异常: {e}") - exit(1) - EOF - CHECK_RESULT $? 0 0 "解析XML文档功能测试失败" - - LOG_INFO "清理测试文件" - rm -f test_parse.xml - - if [ $already_installed -eq 0 ]; then - LOG_INFO "卸载python3-libxml2软件包" - dnf remove -y python3-libxml2 - CHECK_RESULT $? 0 0 "卸载python3-libxml2失败" - else - LOG_INFO "保持python3-libxml2已安装状态" - fi - - LOG_INFO "测试解析XML文档的基本功能完成" -} - -main "$@" \ No newline at end of file diff --git a/testcases/function_test/pkg_test/libxml2/python3-libxml2/test_python3-libxml2_function_save.sh b/testcases/function_test/pkg_test/libxml2/python3-libxml2/test_python3-libxml2_function_save.sh deleted file mode 100644 index 8e16b98283e..00000000000 --- a/testcases/function_test/pkg_test/libxml2/python3-libxml2/test_python3-libxml2_function_save.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-02-24 -# @License : Mulan PSL v2 -# @Desc : 测试保存XML文档到文件 -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - LOG_INFO "开始测试:保存XML文档到文件" - - # 检查是否已安装python3-libxml2 - LOG_INFO "步骤1:检查python3-libxml2是否已安装" - if dnf list installed python3-libxml2 &>/dev/null; then - LOG_INFO "python3-libxml2已安装,测试完成后将保持安装状态" - installed_before=1 - else - LOG_INFO "python3-libxml2未安装,将在测试过程中安装" - installed_before=0 - fi - - # 检查yum源中是否有python3-libxml2 - LOG_INFO "步骤2:检查yum源中是否有python3-libxml2软件包" - if ! dnf list available python3-libxml2 &>/dev/null; then - LOG_ERROR "yum源中未找到python3-libxml2软件包" - exit 255 - fi - - # 如果未安装,则安装python3-libxml2 - if [ $installed_before -eq 0 ]; then - LOG_INFO "步骤3:安装python3-libxml2" - dnf install -y python3-libxml2 - CHECK_RESULT $? 0 0 "安装python3-libxml2失败" - fi - - # 创建测试Python脚本 - LOG_INFO "步骤4:创建测试Python脚本" - cat > /tmp/test_libxml2_save.py << "EOF" - import libxml2 - - # 创建XML文档 - doc = libxml2.newDoc("1.0") - root = doc.newChild(None, "root", None) - child = root.newChild(None, "child", "This is a test") - doc.saveFormatFileEnc("/tmp/test_output.xml", "UTF-8", 1) - print("XML文档保存成功") - EOF - - # 执行Python脚本测试保存功能 - LOG_INFO "步骤5:执行Python脚本测试XML保存功能" - python3 /tmp/test_libxml2_save.py - CHECK_RESULT $? 0 0 "执行Python脚本失败" - - # 验证保存的文件是否存在且内容正确 - LOG_INFO "步骤6:验证保存的XML文件" - if [ -f "/tmp/test_output.xml" ]; then - LOG_INFO "XML文件保存成功" - # 检查文件内容 - if grep -q "This is a test" /tmp/test_output.xml; then - LOG_INFO "XML文件内容正确" - else - LOG_ERROR "XML文件内容不正确" - exit 1 - fi - else - LOG_ERROR "XML文件未保存成功" - exit 1 - fi - - # 清理临时文件 - LOG_INFO "步骤7:清理临时文件" - rm -f /tmp/test_libxml2_save.py /tmp/test_output.xml - CHECK_RESULT $? 0 0 "清理临时文件失败" - - # 如果测试前未安装,则卸载python3-libxml2 - if [ $installed_before -eq 0 ]; then - LOG_INFO "步骤8:卸载python3-libxml2" - dnf remove -y python3-libxml2 - CHECK_RESULT $? 0 0 "卸载python3-libxml2失败" - fi - - LOG_INFO "测试完成:保存XML文档到文件" -} - -main "$@" \ No newline at end of file diff --git a/testcases/function_test/pkg_test/libxml2/python3-libxml2/test_python3-libxml2_function_validate.sh b/testcases/function_test/pkg_test/libxml2/python3-libxml2/test_python3-libxml2_function_validate.sh deleted file mode 100644 index f24bedf6d13..00000000000 --- a/testcases/function_test/pkg_test/libxml2/python3-libxml2/test_python3-libxml2_function_validate.sh +++ /dev/null @@ -1,141 +0,0 @@ -#!/usr/bin/bash - -# Copyright (c) 2024 ISCAS .ALL rights reserved. -# This program is licensed under Mulan PSL v2. -# You can use it according to the terms and conditions of the Mulan PSL v2. -# http://license.coscl.org.cn/MulanPSL2 -# THIS PROGRAM IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, -# EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, -# 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 : 测试使用DTD或XSD验证XML -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - LOG_INFO "开始测试使用DTD或XSD验证XML功能" - - # 定义软件包名称 - PACKAGE_NAME="python3-libxml2" - - # 步骤1:检查yum源中是否存在指定的软件包 - LOG_INFO "步骤1:检查yum源中是否存在软件包 $PACKAGE_NAME" - dnf list available $PACKAGE_NAME &>/dev/null - CHECK_RESULT $? 0 0 "软件包 $PACKAGE_NAME 在yum源中不存在" - if [ $? -ne 0 ]; then - LOG_ERROR "软件包 $PACKAGE_NAME 在yum源中不存在,退出测试" - exit 255 - fi - - # 步骤2:检查环境是否已安装指定软件包 - LOG_INFO "步骤2:检查环境是否已安装软件包 $PACKAGE_NAME" - rpm -q $PACKAGE_NAME &>/dev/null - if [ $? -eq 0 ]; then - LOG_INFO "软件包 $PACKAGE_NAME 已安装,测试结束后保持安装状态" - ALREADY_INSTALLED=1 - else - LOG_INFO "软件包 $PACKAGE_NAME 未安装,将在测试步骤中安装" - ALREADY_INSTALLED=0 - fi - - # 步骤3:安装软件包(如果未安装) - if [ $ALREADY_INSTALLED -eq 0 ]; then - LOG_INFO "步骤3:安装软件包 $PACKAGE_NAME" - dnf install -y $PACKAGE_NAME - CHECK_RESULT $? 0 0 "安装软件包 $PACKAGE_NAME 失败" - fi - - # 步骤4:测试使用DTD验证XML - LOG_INFO "步骤4:测试使用DTD验证XML功能" - cat > test_dtd.xml << EOF - - - - User - Admin - Reminder - Test DTD validation - - EOF - - cat > test.dtd << EOF - - - - - - EOF - - python3 -c " - import libxml2 - doc = libxml2.parseFile("test_dtd.xml") - try: - doc.validate() - print("DTD validation passed") - except Exception as e: - print("DTD validation failed:", e) - " - CHECK_RESULT $? 0 0 "DTD验证XML功能测试失败" - - # 步骤5:测试使用XSD验证XML - LOG_INFO "步骤5:测试使用XSD验证XML功能" - cat > test_xsd.xml << EOF - - - User - Admin - Reminder - Test XSD validation - - EOF - - cat > test.xsd << EOF - - - - - - - - - - - - - - EOF - - python3 -c " - import libxml2 - doc = libxml2.parseFile("test_xsd.xml") - try: - doc.validate() - print("XSD validation passed") - except Exception as e: - print("XSD validation failed:", e) - " - CHECK_RESULT $? 0 0 "XSD验证XML功能测试失败" - - # 步骤6:清理测试文件 - LOG_INFO "步骤6:清理测试文件" - rm -f test_dtd.xml test.dtd test_xsd.xml test.xsd - - # 步骤7:卸载软件包(如果测试前未安装) - if [ $ALREADY_INSTALLED -eq 0 ]; then - LOG_INFO "步骤7:卸载软件包 $PACKAGE_NAME" - dnf remove -y $PACKAGE_NAME - CHECK_RESULT $? 0 0 "卸载软件包 $PACKAGE_NAME 失败" - fi - - LOG_INFO "测试使用DTD或XSD验证XML功能完成" -} - -main "$@" \ No newline at end of file diff --git a/testcases/function_test/pkg_test/libxml2/python3-libxml2/test_python3-libxml2_function_xpath.sh b/testcases/function_test/pkg_test/libxml2/python3-libxml2/test_python3-libxml2_function_xpath.sh deleted file mode 100644 index fd934bc0c97..00000000000 --- a/testcases/function_test/pkg_test/libxml2/python3-libxml2/test_python3-libxml2_function_xpath.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-02-24 -# @License : Mulan PSL v2 -# @Desc : 测试使用XPath查询节点 -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - LOG_INFO "开始测试:测试使用XPath查询节点" - LOG_INFO "步骤1:检查环境是否已安装python3-libxml2" - if dnf list installed python3-libxml2 &>/dev/null; then - LOG_INFO "python3-libxml2已安装,测试完成后保持安装状态" - INSTALLED=true - else - LOG_INFO "python3-libxml2未安装,将在测试前安装并在测试后卸载" - INSTALLED=false - fi - LOG_INFO "步骤2:检查yum源中是否有python3-libxml2软件包" - if ! dnf list available python3-libxml2 &>/dev/null; then - LOG_ERROR "yum源中未找到python3-libxml2软件包" - exit 255 - fi - if [ "$INSTALLED" = false ]; then - LOG_INFO "步骤3:安装python3-libxml2软件包" - dnf install -y python3-libxml2 - CHECK_RESULT $? 0 0 "安装python3-libxml2失败" - fi - LOG_INFO "步骤4:创建测试用的XML文件" - cat > test.xml << EOF - - - - Gambardella, Matthew - XML Developer"s Guide - Computer - 44.95 - 2000-10-01 - An in-depth look at creating applications with XML. - - - Ralls, Kim - Midnight Rain - Fantasy - 5.95 - 2000-12-16 - A former architect battles corporate zombies. - - - EOF - CHECK_RESULT $? 0 0 "创建XML文件失败" - LOG_INFO "步骤5:使用python3-libxml2的XPath功能查询节点" - python3 -c " - import libxml2 - doc = libxml2.parseFile("test.xml") - ctxt = doc.xpathNewContext() - res = ctxt.xpathEval("//book") - if len(res) == 2: - print("查询成功,找到{}个book节点".format(len(res))) - exit(0) - else: - print("查询失败,期望2个book节点,实际找到{}个".format(len(res))) - exit(1) - " - CHECK_RESULT $? 0 0 "XPath查询节点失败" - LOG_INFO "步骤6:清理临时文件" - rm -f test.xml - if [ "$INSTALLED" = false ]; then - LOG_INFO "步骤7:卸载python3-libxml2软件包" - dnf remove -y python3-libxml2 - CHECK_RESULT $? 0 0 "卸载python3-libxml2失败" - fi - LOG_INFO "测试完成" -} - -main "$@" \ No newline at end of file diff --git a/testcases/function_test/pkg_test/python-exceptiongroup/python3-exceptiongroup/test_python3-exceptiongroup_function_basic.sh b/testcases/function_test/pkg_test/python-exceptiongroup/python3-exceptiongroup/test_python3-exceptiongroup_function_basic.sh deleted file mode 100644 index fe3fbedd677..00000000000 --- a/testcases/function_test/pkg_test/python-exceptiongroup/python3-exceptiongroup/test_python3-exceptiongroup_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-12-10 -# @License : Mulan PSL v2 -# @Desc : 测试python3-exceptiongroup基础功能 -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - - # 检查是否已安装python3-exceptiongroup - LOG_INFO "检查是否已安装python3-exceptiongroup" - rpm -q python3-exceptiongroup > /dev/null 2>&1 - if [ $? -eq 0 ]; then - LOG_INFO "python3-exceptiongroup已安装,脚本结束后保持安装状态" - installed=true - else - LOG_INFO "python3-exceptiongroup未安装,将在测试结束后卸载" - installed=false - fi - - # 检查yum源中是否有python3-exceptiongroup软件包 - LOG_INFO "检查yum源中是否有python3-exceptiongroup软件包" - dnf list available python3-exceptiongroup > /dev/null 2>&1 - if [ $? -ne 0 ]; then - LOG_ERROR "yum源中未找到python3-exceptiongroup软件包" - exit 255 - fi - - # 安装python3-exceptiongroup - if [ "$installed" = false ]; then - LOG_INFO "安装python3-exceptiongroup" - dnf install -y python3-exceptiongroup > /dev/null 2>&1 - CHECK_RESULT $? 0 0 "安装python3-exceptiongroup失败" - fi - - # 测试python3-exceptiongroup基础功能 - LOG_INFO "测试python3-exceptiongroup基础功能" - python3 -c "from exceptiongroup import ExceptionGroup; print("ExceptionGroup imported successfully")" > /dev/null 2>&1 - CHECK_RESULT $? 0 0 "python3-exceptiongroup基础功能测试失败" - - # 清理环境 - if [ "$installed" = false ]; then - LOG_INFO "卸载python3-exceptiongroup" - dnf remove -y python3-exceptiongroup > /dev/null 2>&1 - CHECK_RESULT $? 0 0 "卸载python3-exceptiongroup失败" - fi - - LOG_INFO "测试脚本执行完毕" - -} - -main "$@" \ No newline at end of file diff --git a/testcases/function_test/pkg_test/python-exceptiongroup/python3-exceptiongroup/test_python3-exceptiongroup_function_catch.sh b/testcases/function_test/pkg_test/python-exceptiongroup/python3-exceptiongroup/test_python3-exceptiongroup_function_catch.sh deleted file mode 100644 index 3814bd0e315..00000000000 --- a/testcases/function_test/pkg_test/python-exceptiongroup/python3-exceptiongroup/test_python3-exceptiongroup_function_catch.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 : 2025-12-10 -# @License : Mulan PSL v2 -# @Desc : 测试异常捕获功能 -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - # 测试异常捕获功能 - - LOG_INFO "开始测试异常捕获功能" - - # 检查是否已安装python3-exceptiongroup - dnf list installed python3-exceptiongroup >/dev/null 2>&1 - if [ $? -eq 0 ]; then - LOG_INFO "python3-exceptiongroup已安装,测试结束后保持安装状态" - INSTALLED=1 - else - LOG_INFO "python3-exceptiongroup未安装,将在测试结束后卸载" - INSTALLED=0 - fi - - # 检查yum源中是否有python3-exceptiongroup - LOG_INFO "检查yum源中是否存在python3-exceptiongroup" - dnf list available python3-exceptiongroup >/dev/null 2>&1 - if [ $? -ne 0 ]; then - LOG_ERROR "yum源中未找到python3-exceptiongroup" - exit 255 - fi - - # 安装python3-exceptiongroup - if [ $INSTALLED -eq 0 ]; then - LOG_INFO "安装python3-exceptiongroup" - dnf install -y python3-exceptiongroup >/dev/null 2>&1 - CHECK_RESULT $? 0 0 "安装python3-exceptiongroup失败" - fi - - # 测试异常捕获功能 - LOG_INFO "测试异常捕获功能" - python3 -c " - try: - raise ExceptionGroup("test", [Exception("error1"), Exception("error2")]) - except* Exception as e: - print(f"捕获到异常: {e}") - " >/tmp/exception_test.log 2>&1 - CHECK_RESULT $? 0 0 "异常捕获功能测试失败" - - # 验证输出结果是否包含预期内容 - LOG_INFO "验证异常捕获结果" - grep "捕获到异常" /tmp/exception_test.log >/dev/null 2>&1 - CHECK_RESULT $? 0 0 "未捕获到预期异常" - - # 清理临时文件 - rm -f /tmp/exception_test.log - - # 恢复环境:如果测试前未安装则卸载 - if [ $INSTALLED -eq 0 ]; then - LOG_INFO "卸载python3-exceptiongroup" - dnf remove -y python3-exceptiongroup >/dev/null 2>&1 - CHECK_RESULT $? 0 0 "卸载python3-exceptiongroup失败" - fi - - LOG_INFO "测试完成" -} - -main "$@" \ No newline at end of file diff --git a/testcases/function_test/pkg_test/python-exceptiongroup/python3-exceptiongroup/test_python3-exceptiongroup_function_nest.sh b/testcases/function_test/pkg_test/python-exceptiongroup/python3-exceptiongroup/test_python3-exceptiongroup_function_nest.sh deleted file mode 100644 index 6c55fd50bad..00000000000 --- a/testcases/function_test/pkg_test/python-exceptiongroup/python3-exceptiongroup/test_python3-exceptiongroup_function_nest.sh +++ /dev/null @@ -1,77 +0,0 @@ -#!/usr/bin/bash - -# Copyright (c) 2024 ISCAS .ALL rights reserved. -# This program is licensed under Mulan PSL v2. -# You can use it according to the terms and conditions of the Mulan PSL v2. -# http://license.coscl.org.cn/MulanPSL2 -# THIS PROGRAM IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, -# EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, -# MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. -# See the Mulan PSL v2 for more details. - -# ############################################# -# @Author : honghua -# @Contact : honghua@iscas.ac.cn -# @Date : 2025-12-10 -# @License : Mulan PSL v2 -# @Desc : 测试嵌套异常功能 -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - - # 检查是否已安装python3-exceptiongroup包 - LOG_INFO "检查是否已安装python3-exceptiongroup包" - if dnf list installed python3-exceptiongroup &>/dev/null; then - LOG_INFO "python3-exceptiongroup已安装,脚本结束时将保持安装状态" - INSTALLED=true - else - LOG_INFO "python3-exceptiongroup未安装,将在测试结束后卸载" - INSTALLED=false - fi - - # 检查yum源中是否存在python3-exceptiongroup包 - LOG_INFO "检查yum源中是否存在python3-exceptiongroup包" - if ! dnf list available python3-exceptiongroup &>/dev/null; then - LOG_ERROR "yum源中不存在python3-exceptiongroup包" - exit 255 - fi - - # 安装python3-exceptiongroup包 - if [ "$INSTALLED" = false ]; then - LOG_INFO "安装python3-exceptiongroup包" - dnf install -y python3-exceptiongroup - CHECK_RESULT $? 0 0 "安装python3-exceptiongroup失败" - fi - - # 测试嵌套异常功能 - LOG_INFO "开始测试嵌套异常功能" - cat > test_exception.py </dev/null; then - LOG_INFO "qt6-qtnetworkauth-devel已安装,脚本结束后保持安装状态。" - already_installed=true - else - LOG_INFO "qt6-qtnetworkauth-devel未安装,将在测试后卸载。" - already_installed=false - fi - - # 检查yum源中是否存在qt6-qtnetworkauth-devel软件包 - LOG_INFO "检查yum源中是否存在qt6-qtnetworkauth-devel软件包..." - if ! dnf list available qt6-qtnetworkauth-devel &>/dev/null; then - LOG_ERROR "yum源中未找到qt6-qtnetworkauth-devel软件包,退出。" - exit 255 - fi - - # 安装qt6-qtnetworkauth-devel软件包 - if [ "$already_installed" = false ]; then - LOG_INFO "安装qt6-qtnetworkauth-devel软件包..." - dnf install -y qt6-qtnetworkauth-devel - CHECK_RESULT $? 0 0 "安装qt6-qtnetworkauth-devel失败" - fi - - # 测试认证功能 - LOG_INFO "测试qt6-qtnetworkauth-devel的认证功能..." - # 假设测试命令为test_auth_command,这里用占位符代替 - test_auth_command="test_auth_command" - if ! command -v "$test_auth_command" &>/dev/null; then - LOG_ERROR "命令$test_auth_command不存在或不支持,退出。" - exit 255 - fi - - # 执行测试命令 - LOG_INFO "执行测试命令:$test_auth_command" - $test_auth_command - CHECK_RESULT $? 0 0 "测试认证功能失败" - - # 清理环境 - if [ "$already_installed" = false ]; then - LOG_INFO "卸载qt6-qtnetworkauth-devel软件包..." - dnf remove -y qt6-qtnetworkauth-devel - CHECK_RESULT $? 0 0 "卸载qt6-qtnetworkauth-devel失败" - fi - - LOG_INFO "测试完成,环境已恢复。" - -} - -main "$@" \ No newline at end of file diff --git a/testcases/function_test/pkg_test/softhsm/softhsm-devel/test_softhsm-devel_rollback.sh b/testcases/function_test/pkg_test/softhsm/softhsm-devel/test_softhsm-devel_rollback.sh deleted file mode 100644 index 931890cb0ff..00000000000 --- a/testcases/function_test/pkg_test/softhsm/softhsm-devel/test_softhsm-devel_rollback.sh +++ /dev/null @@ -1,77 +0,0 @@ -#!/usr/bin/bash - -# Copyright (c) 2024 ISCAS .ALL rights reserved. -# This program is licensed under Mulan PSL v2. -# You can use it according to the terms and conditions of the Mulan PSL v2. -# http://license.coscl.org.cn/MulanPSL2 -# THIS PROGRAM IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, -# EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, -# MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. -# See the Mulan PSL v2 for more details. - -# ############################################# -# @Author : honghua -# @Contact : honghua@iscas.ac.cn -# @Date : 2025-07-01 -# @License : Mulan PSL v2 -# @Desc : 测试softhsm-devel软件包的回滚功能,验证回滚过程是否正常完成。 -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - LOG_INFO "开始测试softhsm-devel软件包的回滚功能" - - # 检查是否已安装softhsm-devel - LOG_INFO "检查是否已安装softhsm-devel" - dnf list installed softhsm-devel > /dev/null 2>&1 - if [ $? -eq 0 ]; then - LOG_INFO "softhsm-devel已安装,脚本结束时将保持安装状态" - INSTALLED=1 - else - LOG_INFO "softhsm-devel未安装,将在测试步骤中安装" - INSTALLED=0 - fi - - # 检查yum源中是否有softhsm-devel软件包 - LOG_INFO "检查yum源中是否有softhsm-devel软件包" - dnf list available softhsm-devel > /dev/null 2>&1 - if [ $? -ne 0 ]; then - LOG_ERROR "yum源中未找到softhsm-devel软件包" - exit 255 - fi - - # 安装softhsm-devel - if [ $INSTALLED -eq 0 ]; then - LOG_INFO "开始安装softhsm-devel" - dnf install -y softhsm-devel > /dev/null 2>&1 - CHECK_RESULT $? 0 0 "安装softhsm-devel失败" - LOG_INFO "softhsm-devel安装成功" - fi - - # 测试回滚功能 - LOG_INFO "测试回滚功能" - dnf history undo last -y > /dev/null 2>&1 - CHECK_RESULT $? 0 0 "回滚softhsm-devel失败" - - # 验证回滚后状态 - LOG_INFO "验证回滚后状态" - dnf list installed softhsm-devel > /dev/null 2>&1 - if [ $? -eq 0 ]; then - LOG_ERROR "回滚后仍检测到softhsm-devel,回滚未成功" - exit 1 - else - LOG_INFO "回滚成功,softhsm-devle已卸载" - fi - - # 清理环境 - if [ $INSTALLED -eq 0 ]; then - LOG_INFO "清理环境,卸载之前安装的软件包" - else - LOG_INFO "环境清理完成,保持原有状态不变" - fi - - LOG_INFO "测试完成" -} - -main "$@" \ No newline at end of file diff --git a/testcases/function_test/pkg_test/softhsm/softhsm-devel/test_softhsm-devel_uninstall.sh b/testcases/function_test/pkg_test/softhsm/softhsm-devel/test_softhsm-devel_uninstall.sh deleted file mode 100644 index 80f8031fac3..00000000000 --- a/testcases/function_test/pkg_test/softhsm/softhsm-devel/test_softhsm-devel_uninstall.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-07-01 -# @License : Mulan PSL v2 -# @Desc : 测试softhsm-devel软件包的卸载功能,验证卸载过程是否正常完成。 -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - # 检查是否已安装softhsm-devel软件包 - LOG_INFO "检查是否已安装softhsm-devel软件包" - rpm -q softhsm-devel > /dev/null 2>&1 - if [ $? -eq 0 ]; then - LOG_INFO "softhsm-devel已安装,脚本结束后将保持安装状态" - installed=true - else - LOG_INFO "softhsm-devel未安装,将在测试结束后卸载" - installed=false - fi - - # 检查yum源中是否存在softhsm-devel软件包 - LOG_INFO "检查yum源中是否存在softhsm-devel软件包" - dnf list available softhsm-devel > /dev/null 2>&1 - CHECK_RESULT $? 0 255 "yum源中不存在softhsm-devel软件包" - - # 安装softhsm-devel软件包 - if [ "$installed" = false ]; then - LOG_INFO "开始安装softhsm-devel软件包" - dnf install -y softhsm-devel > /dev/null 2>&1 - CHECK_RESULT $? 0 255 "安装softhsm-devel软件包失败" - fi - - # 验证卸载功能 - LOG_INFO "开始验证softhsm-devel的卸载功能" - dnf remove -y softhsm-devel > /dev/null 2>&1 - CHECK_RESULT $? 0 0 "卸载softhsm-devel软件包失败" - - # 恢复环境:如果最初未安装,则重新安装;否则不处理 - if [ "$installed" = false ]; then - LOG_INFO "恢复环境:重新安装softhsm-devel" - dnf install -y softhsm-devel > /dev/null 2>&1 - CHECK_RESULT $? 0 255 "恢复环境时重新安装softhsm-devel失败" - else - LOG_INFO "环境已恢复,无需重新安装" - fi - - LOG_INFO "测试完成,环境已恢复" -} - -main "$@" \ No newline at end of file diff --git a/testcases/function_test/pkg_test/texlive-base/texlive-luajittex/test_texlive-luajittex_function_check.sh b/testcases/function_test/pkg_test/texlive-base/texlive-luajittex/test_texlive-luajittex_function_check.sh deleted file mode 100644 index 579e62b40f5..00000000000 --- a/testcases/function_test/pkg_test/texlive-base/texlive-luajittex/test_texlive-luajittex_function_check.sh +++ /dev/null @@ -1,70 +0,0 @@ -#!/usr/bin/bash - -# Copyright (c) 2024 ISCAS .ALL rights reserved. -# This program is licensed under Mulan PSL v2. -# You can use it according to the terms and conditions of the Mulan PSL v2. -# http://license.coscl.org.cn/MulanPSL2 -# THIS PROGRAM IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, -# EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, -# MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. -# See the Mulan PSL v2 for more details. - -# ############################################# -# @Author : honghua -# @Contact : honghua@iscas.ac.cn -# @Date : 2026-03-04 -# @License : Mulan PSL v2 -# @Desc : Check if package is installed -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - # 检查软件包是否已安装 - LOG_INFO "开始测试:检查texlive-luajittex软件包是否已安装" - - # 检查软件包是否在yum源中 - LOG_INFO "步骤1:检查texlive-luajittex软件包是否在yum源中" - dnf list available texlive-luajittex > /dev/null 2>&1 - if [ $? -ne 0 ]; then - LOG_ERROR "软件包texlive-luajittex不在yum源中" - exit 255 - fi - - # 检查当前是否已安装 - LOG_INFO "步骤2:检查texlive-luajittex是否已安装" - dnf list installed texlive-luajittex > /dev/null 2>&1 - if [ $? -eq 0 ]; then - LOG_INFO "软件包texlive-luajittex已安装,标记为保持安装状态" - KEEP_INSTALLED=1 - else - LOG_INFO "软件包texlive-luajittex未安装,标记为需要清理" - KEEP_INSTALLED=0 - fi - - # 如果未安装,则安装软件包 - if [ $KEEP_INSTALLED -eq 0 ]; then - LOG_INFO "步骤3:安装texlive-luajittex软件包" - dnf install -y texlive-luajittex - CHECK_RESULT $? 0 0 "安装texlive-luajittex失败" - fi - - # 检查软件包是否安装成功 - LOG_INFO "步骤4:验证软件包安装状态" - dnf list installed texlive-luajittex > /dev/null 2>&1 - CHECK_RESULT $? 0 0 "软件包texlive-luajittex未正确安装" - - # 清理环境 - LOG_INFO "步骤5:清理测试环境" - if [ $KEEP_INSTALLED -eq 0 ]; then - LOG_INFO "卸载texlive-luajittex软件包" - dnf remove -y texlive-luajittex - CHECK_RESULT $? 0 0 "卸载texlive-luajittex失败" - else - LOG_INFO "保持texlive-luajittex软件包安装状态" - fi - - LOG_INFO "测试完成:texlive-luajittex软件包安装检查成功" -} - -main "$@" \ No newline at end of file diff --git a/testcases/function_test/pkg_test/texlive-base/texlive-luajittex/test_texlive-luajittex_function_compile_tex.sh b/testcases/function_test/pkg_test/texlive-base/texlive-luajittex/test_texlive-luajittex_function_compile_tex.sh deleted file mode 100644 index 73e1321ff74..00000000000 --- a/testcases/function_test/pkg_test/texlive-base/texlive-luajittex/test_texlive-luajittex_function_compile_tex.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-04 -# @License : Mulan PSL v2 -# @Desc : Compile a simple TeX file -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - set -e - - LOG_INFO "开始测试:编译简单的TeX文件" - - LOG_INFO "步骤1:检查系统是否已安装texlive-luajittex软件包" - if dnf list installed texlive-luajittex &> /dev/null; then - LOG_INFO "texlive-luajittex已安装,测试后保持安装状态" - ALREADY_INSTALLED=1 - else - LOG_INFO "texlive-luajittex未安装,将在测试中安装" - ALREADY_INSTALLED=0 - fi - - LOG_INFO "步骤2:检查yum源中是否存在texlive-luajittex软件包" - if ! dnf list texlive-luajittex &> /dev/null; then - LOG_ERROR "yum源中未找到texlive-luajittex软件包" - exit 255 - fi - - if [ ${ALREADY_INSTALLED} -eq 0 ]; then - LOG_INFO "步骤3:安装texlive-luajittex软件包" - dnf install -y texlive-luajittex - CHECK_RESULT $? 0 0 "安装texlive-luajittex失败" - fi - - LOG_INFO "步骤4:检查luajittex命令是否可用" - if ! command -v luajittex &> /dev/null; then - LOG_ERROR "luajittex命令未找到" - exit 255 - fi - - LOG_INFO "步骤5:检查luajittex命令是否支持--help参数" - if ! luajittex --help &> /dev/null; then - LOG_ERROR "luajittex命令不支持--help参数" - exit 255 - fi - - LOG_INFO "步骤6:创建测试用的简单TeX文件" - TEST_TEX_FILE="test_simple.tex" - cat > ${TEST_TEX_FILE} << "EOF" - \documentclass{article} - \begin{document} - Hello, TeX World! - \end{document} - EOF - CHECK_RESULT $? 0 0 "创建测试TeX文件失败" - - LOG_INFO "步骤7:使用luajittex编译TeX文件" - luajittex --interaction=nonstopmode ${TEST_TEX_FILE} - CHECK_RESULT $? 0 0 "编译TeX文件失败" - - LOG_INFO "步骤8:检查是否生成PDF输出文件" - if [ -f "test_simple.pdf" ]; then - LOG_INFO "成功生成PDF文件:test_simple.pdf" - else - LOG_ERROR "未找到生成的PDF文件" - exit 1 - fi - - LOG_INFO "步骤9:清理生成的测试文件" - rm -f test_simple.tex test_simple.pdf test_simple.log test_simple.aux - - if [ ${ALREADY_INSTALLED} -eq 0 ]; then - LOG_INFO "步骤10:卸载测试安装的texlive-luajittex软件包" - dnf remove -y texlive-luajittex - CHECK_RESULT $? 0 0 "卸载texlive-luajittex失败" - else - LOG_INFO "步骤10:保持texlive-luajittex安装状态" - fi - - LOG_INFO "测试完成:成功编译简单的TeX文件" -} - -main "$@" \ No newline at end of file diff --git a/testcases/function_test/pkg_test/texlive-base/texlive-luajittex/test_texlive-luajittex_function_jobname.sh b/testcases/function_test/pkg_test/texlive-base/texlive-luajittex/test_texlive-luajittex_function_jobname.sh deleted file mode 100644 index 9acf481c5aa..00000000000 --- a/testcases/function_test/pkg_test/texlive-base/texlive-luajittex/test_texlive-luajittex_function_jobname.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-04 -# @License : Mulan PSL v2 -# @Desc : Set custom job name -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - LOG_INFO "开始测试: Set custom job name" - - LOG_INFO "步骤1: 检查软件包 texlive-luajittex 是否在yum源中" - dnf list available texlive-luajittex > /dev/null 2>&1 - if [ $? -ne 0 ]; then - LOG_ERROR "软件包 texlive-luajittex 在yum源中不存在" - exit 255 - fi - - LOG_INFO "步骤2: 检查是否已安装 texlive-luajittex" - if rpm -q texlive-luajittex > /dev/null 2>&1; then - LOG_INFO "软件包 texlive-luajittex 已安装,测试结束后保持安装状态" - INSTALLED=true - else - LOG_INFO "软件包 texlive-luajittex 未安装,将在测试前安装" - INSTALLED=false - fi - - if [ "$INSTALLED" = false ]; then - LOG_INFO "步骤3: 安装 texlive-luajittex" - dnf install -y texlive-luajittex - CHECK_RESULT $? 0 0 "安装 texlive-luajittex 失败" - fi - - LOG_INFO "步骤4: 检查 luajittex 命令是否支持 -jobname 参数" - luajittex --help 2>&1 | grep -q "\-jobname" - if [ $? -ne 0 ]; then - LOG_ERROR "luajittex 命令不支持 -jobname 参数" - if [ "$INSTALLED" = false ]; then - LOG_INFO "清理环境: 卸载 texlive-luajittex" - dnf remove -y texlive-luajittex - fi - exit 255 - fi - - LOG_INFO "步骤5: 创建一个简单的LaTeX测试文件" - cat > test.tex << "EOF" - \documentclass{article} - \begin{document} - Hello, World! - \end{document} - EOF - CHECK_RESULT $? 0 0 "创建测试文件失败" - - LOG_INFO "步骤6: 使用 luajittex 编译测试文件并设置自定义job名称为 customjob" - luajittex -jobname=customjob test.tex - CHECK_RESULT $? 0 0 "luajittex 编译失败" - - LOG_INFO "步骤7: 检查是否生成了自定义名称的输出文件" - if [ -f "customjob.log" ]; then - LOG_INFO "成功生成自定义job名称的输出文件: customjob.log" - else - LOG_ERROR "未找到自定义job名称的输出文件" - if [ "$INSTALLED" = false ]; then - LOG_INFO "清理环境: 删除测试文件" - rm -f test.tex test.log test.aux - LOG_INFO "清理环境: 卸载 texlive-luajittex" - dnf remove -y texlive-luajittex - fi - exit 1 - fi - - LOG_INFO "步骤8: 清理测试文件" - rm -f test.tex test.log test.aux customjob.log customjob.aux - - if [ "$INSTALLED" = false ]; then - LOG_INFO "步骤9: 卸载 texlive-luajittex" - dnf remove -y texlive-luajittex - CHECK_RESULT $? 0 0 "卸载 texlive-luajittex 失败" - else - LOG_INFO "步骤9: 保持 texlive-luajittex 安装状态" - fi - - LOG_INFO "测试完成: Set custom job name" -} - -main "$@" \ No newline at end of file diff --git a/testcases/function_test/pkg_test/texlive-base/texlive-luajittex/test_texlive-luajittex_function_lua_script.sh b/testcases/function_test/pkg_test/texlive-base/texlive-luajittex/test_texlive-luajittex_function_lua_script.sh deleted file mode 100644 index f5823e01c30..00000000000 --- a/testcases/function_test/pkg_test/texlive-base/texlive-luajittex/test_texlive-luajittex_function_lua_script.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-04 -# @License : Mulan PSL v2 -# @Desc : Run Lua script with LuaTeX -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - # 检查是否安装了texlive-luajittex软件包 - LOG_INFO "检查是否已安装texlive-luajittex软件包" - rpm -q texlive-luajittex > /dev/null 2>&1 - if [ $? -eq 0 ]; then - LOG_INFO "texlive-luajittex已安装,测试结束后将保持安装状态" - INSTALLED=1 - else - LOG_INFO "texlive-luajittex未安装,将在测试前安装" - INSTALLED=0 - fi - - # 检查yum源中是否有texlive-luajittex软件包 - LOG_INFO "检查yum源中是否有texlive-luajittex软件包" - dnf list available texlive-luajittex > /dev/null 2>&1 - CHECK_RESULT $? 0 0 "yum源中没有texlive-luajittex软件包" - if [ $? -ne 0 ]; then - LOG_ERROR "yum源中没有texlive-luajittex软件包" - exit 255 - fi - - # 如果未安装,则安装texlive-luajittex - if [ $INSTALLED -eq 0 ]; then - LOG_INFO "开始安装texlive-luajittex软件包" - dnf install -y texlive-luajittex > /dev/null 2>&1 - CHECK_RESULT $? 0 0 "安装texlive-luajittex失败" - LOG_INFO "texlive-luajittex安装成功" - fi - - # 检查luajittex命令是否支持--luaonly参数 - LOG_INFO "检查luajittex命令是否支持--luaonly参数" - luajittex --help 2>&1 | grep -q -- "--luaonly" - CHECK_RESULT $? 0 0 "luajittex不支持--luaonly参数" - if [ $? -ne 0 ]; then - LOG_ERROR "luajittex不支持--luaonly参数" - # 如果之前未安装,则卸载软件包 - if [ $INSTALLED -eq 0 ]; then - dnf remove -y texlive-luajittex > /dev/null 2>&1 - fi - exit 255 - fi - - # 创建一个简单的Lua脚本用于测试 - LOG_INFO "创建测试用的Lua脚本" - cat > test_lua_script.lua << "EOF" - print("Hello from Lua script!") - texio.write_nl("Hello from LuaTeX!") - EOF - CHECK_RESULT $? 0 0 "创建Lua脚本失败" - - # 使用LuaTeX运行Lua脚本 - LOG_INFO "使用LuaTeX运行Lua脚本" - luajittex --luaonly test_lua_script.lua > /dev/null 2>&1 - CHECK_RESULT $? 0 0 "LuaTeX运行Lua脚本失败" - - # 清理测试文件 - LOG_INFO "清理测试文件" - rm -f test_lua_script.lua - CHECK_RESULT $? 0 0 "清理测试文件失败" - - # 如果测试前未安装,则卸载软件包 - if [ $INSTALLED -eq 0 ]; then - LOG_INFO "卸载texlive-luajittex软件包" - dnf remove -y texlive-luajittex > /dev/null 2>&1 - CHECK_RESULT $? 0 0 "卸载texlive-luajittex失败" - LOG_INFO "texlive-luajittex卸载成功" - else - LOG_INFO "保持texlive-luajittex安装状态" - fi - - LOG_INFO "测试完成" -} - -main "$@" \ No newline at end of file diff --git a/testcases/function_test/pkg_test/texlive-base/texlive-luajittex/test_texlive-luajittex_function_output_pdf.sh b/testcases/function_test/pkg_test/texlive-base/texlive-luajittex/test_texlive-luajittex_function_output_pdf.sh deleted file mode 100644 index 1606148590a..00000000000 --- a/testcases/function_test/pkg_test/texlive-base/texlive-luajittex/test_texlive-luajittex_function_output_pdf.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-04 -# @License : Mulan PSL v2 -# @Desc : Generate PDF output -# ############################################ - -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 message=$4 - if [ $actual -ne $expected ]; then - LOG_ERROR "$message" - exit $error_code - fi - } - - # 定义SSH_CMD函数(虽然题目说无需定义,但实际脚本中需要,这里补充定义) - SSH_CMD() { - local cmd=$1 - local node_ip=$2 - local node_password=$3 - local node_user=$4 - # 这里只是示例,实际应根据环境实现SSH连接和执行命令 - sshpass -p $node_password ssh -o StrictHostKeyChecking=no $node_user@$node_ip "$cmd" - } - - # 测试脚本开始 - LOG_INFO "开始测试 Generate PDF output 功能" - - # 步骤1: 检查是否已安装 texlive-luajittex 软件包 - LOG_INFO "步骤1: 检查 texlive-luajittex 是否已安装" - if rpm -q texlive-luajittex &> /dev/null; then - LOG_INFO "texlive-luajittex 已安装,脚本结束时将保持安装状态" - INSTALLED_BEFORE=true - else - LOG_INFO "texlive-luajittex 未安装,将在测试步骤中安装" - INSTALLED_BEFORE=false - fi - - # 步骤2: 检查yum源中是否有 texlive-luajittex 软件包 - LOG_INFO "步骤2: 检查yum源中是否有 texlive-luajittex 软件包" - if ! dnf list available texlive-luajittex &> /dev/null; then - LOG_ERROR "yum源中未找到 texlive-luajittex 软件包" - exit 255 - fi - - # 步骤3: 如果未安装,则安装 texlive-luajittex - if [ "$INSTALLED_BEFORE" = false ]; then - LOG_INFO "步骤3: 安装 texlive-luajittex" - dnf install -y texlive-luajittex - CHECK_RESULT $? 0 0 "安装 texlive-luajittex 失败" - fi - - # 步骤4: 检查 luajittex 命令是否支持 -output-format=pdf 参数 - LOG_INFO "步骤4: 检查 luajittex 命令是否支持 -output-format=pdf 参数" - if ! luajittex --help | grep -q "\-output-format"; then - LOG_ERROR "luajittex 命令不支持 -output-format 参数" - exit 255 - fi - - # 步骤5: 生成一个简单的TeX文件用于测试 - LOG_INFO "步骤5: 生成测试用的TeX文件" - cat > test.tex << "EOF" - \documentclass{article} - \begin{document} - Hello, World! - \end{document} - EOF - CHECK_RESULT $? 0 0 "生成测试TeX文件失败" - - # 步骤6: 使用 luajittex 生成PDF - LOG_INFO "步骤6: 使用 luajittex 生成PDF输出" - luajittex -output-format=pdf test.tex - CHECK_RESULT $? 0 0 "luajittex 生成PDF失败" - - # 步骤7: 检查是否成功生成PDF文件 - LOG_INFO "步骤7: 检查是否成功生成PDF文件" - if [ -f test.pdf ]; then - LOG_INFO "成功生成PDF文件: test.pdf" - else - LOG_ERROR "未找到生成的PDF文件" - exit 1 - fi - - # 步骤8: 清理测试文件 - LOG_INFO "步骤8: 清理测试文件" - rm -f test.tex test.pdf test.log test.aux - - # 步骤9: 如果之前未安装,则卸载 texlive-luajittex - if [ "$INSTALLED_BEFORE" = false ]; then - LOG_INFO "步骤9: 卸载 texlive-luajittex" - dnf remove -y texlive-luajittex - CHECK_RESULT $? 0 0 "卸载 texlive-luajittex 失败" - fi - - LOG_INFO "测试完成: Generate PDF output 功能验证通过" -} - -main "$@" \ No newline at end of file diff --git a/testcases/function_test/pkg_test/texlive-base/texlive-luajittex/test_texlive-luajittex_function_remove.sh b/testcases/function_test/pkg_test/texlive-base/texlive-luajittex/test_texlive-luajittex_function_remove.sh deleted file mode 100644 index f5681476ab0..00000000000 --- a/testcases/function_test/pkg_test/texlive-base/texlive-luajittex/test_texlive-luajittex_function_remove.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-04 -# @License : Mulan PSL v2 -# @Desc : Test package removal -# ############################################ - -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-luajittex" - - # 步骤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 - LOG_INFO "软件包 ${PACKAGE_NAME} 在yum源中存在" - - # 步骤2: 检查当前环境是否已安装该软件包 - LOG_INFO "步骤2: 检查当前环境是否已安装软件包 ${PACKAGE_NAME}" - rpm -q ${PACKAGE_NAME} &>/dev/null - INSTALLED=$? - if [[ ${INSTALLED} -eq 0 ]]; then - LOG_INFO "软件包 ${PACKAGE_NAME} 已安装" - NEED_UNINSTALL=0 - else - LOG_INFO "软件包 ${PACKAGE_NAME} 未安装" - NEED_UNINSTALL=1 - fi - - # 步骤3: 如果未安装,则安装软件包作为测试步骤 - if [[ ${NEED_UNINSTALL} -eq 1 ]]; 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: 验证软件包 ${PACKAGE_NAME} 安装状态" - rpm -q ${PACKAGE_NAME} - CHECK_RESULT $? 0 0 "验证软件包 ${PACKAGE_NAME} 安装状态失败" - - # 步骤5: 执行软件包移除测试 - LOG_INFO "步骤5: 执行软件包移除测试" - 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 - CHECK_RESULT $? 1 0 "软件包 ${PACKAGE_NAME} 移除后仍存在" - LOG_INFO "软件包 ${PACKAGE_NAME} 已成功移除" - - # 步骤7: 环境恢复 - LOG_INFO "步骤7: 环境恢复" - if [[ ${NEED_UNINSTALL} -eq 1 ]]; then - # 如果脚本开始时未安装,则不需要重新安装 - LOG_INFO "测试前未安装 ${PACKAGE_NAME},保持未安装状态" - else - # 如果脚本开始时已安装,则重新安装 - LOG_INFO "重新安装软件包 ${PACKAGE_NAME} 以恢复环境" - dnf install -y ${PACKAGE_NAME} - CHECK_RESULT $? 0 0 "重新安装软件包 ${PACKAGE_NAME} 失败" - LOG_INFO "环境恢复完成,软件包 ${PACKAGE_NAME} 已重新安装" - fi - - # 步骤8: 最终验证 - LOG_INFO "步骤8: 最终环境验证" - if [[ ${NEED_UNINSTALL} -eq 1 ]]; then - rpm -q ${PACKAGE_NAME} &>/dev/null - CHECK_RESULT $? 1 0 "环境恢复后软件包 ${PACKAGE_NAME} 不应存在" - LOG_INFO "环境恢复验证通过:软件包 ${PACKAGE_NAME} 未安装" - else - rpm -q ${PACKAGE_NAME} - CHECK_RESULT $? 0 0 "环境恢复后软件包 ${PACKAGE_NAME} 应存在" - 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-luajittex/test_texlive-luajittex_function_shell_escape.sh b/testcases/function_test/pkg_test/texlive-base/texlive-luajittex/test_texlive-luajittex_function_shell_escape.sh deleted file mode 100644 index 5dece106938..00000000000 --- a/testcases/function_test/pkg_test/texlive-base/texlive-luajittex/test_texlive-luajittex_function_shell_escape.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-04 -# @License : Mulan PSL v2 -# @Desc : Test shell escape feature -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - LOG_INFO "开始测试shell escape功能" - - # 检查软件包是否在yum源中 - LOG_INFO "检查texlive-luajittex软件包是否在yum源中" - if ! dnf list available texlive-luajittex &>/dev/null; then - LOG_ERROR "texlive-luajittex软件包不在yum源中" - exit 255 - fi - - # 检查是否已安装texlive-luajittex - LOG_INFO "检查是否已安装texlive-luajittex" - if rpm -q texlive-luajittex &>/dev/null; then - LOG_INFO "texlive-luajittex已安装,测试完成后将保持安装状态" - already_installed=true - else - LOG_INFO "texlive-luajittex未安装,将在测试前安装" - already_installed=false - fi - - # 如果未安装,则安装软件包 - if [ "$already_installed" = false ]; then - LOG_INFO "安装texlive-luajittex软件包" - dnf install -y texlive-luajittex - CHECK_RESULT $? 0 0 "安装texlive-luajittex失败" - fi - - # 测试shell escape功能 - LOG_INFO "测试shell escape功能" - # 使用luajittex执行带有shell escape的简单LaTeX文档 - cat > test_shell_escape.tex << "EOF" - \documentclass{article} - \begin{document} - Test shell escape: \write18{echo "Hello from shell escape"} - \end{document} - EOF - - # 尝试编译带有shell escape的文档 - LOG_INFO "编译带有shell escape的LaTeX文档" - luajittex -shell-escape test_shell_escape.tex - CHECK_RESULT $? 0 0 "shell escape功能测试失败" - - # 检查是否生成了输出 - LOG_INFO "检查是否生成了输出文件" - if [ -f test_shell_escape.log ]; then - LOG_INFO "成功生成了日志文件" - else - LOG_ERROR "未生成日志文件" - exit 1 - fi - - # 清理测试文件 - LOG_INFO "清理测试文件" - rm -f test_shell_escape.tex test_shell_escape.log test_shell_escape.aux - - # 如果测试前未安装,则卸载软件包 - if [ "$already_installed" = false ]; then - LOG_INFO "卸载texlive-luajittex软件包" - dnf remove -y texlive-luajittex - CHECK_RESULT $? 0 0 "卸载texlive-luajittex失败" - fi - - LOG_INFO "shell escape功能测试完成" -} - -main "$@" \ No newline at end of file diff --git a/testcases/function_test/pkg_test/texlive-base/texlive-luajittex/test_texlive-luajittex_function_synctex.sh b/testcases/function_test/pkg_test/texlive-base/texlive-luajittex/test_texlive-luajittex_function_synctex.sh deleted file mode 100644 index 59459d2e2a3..00000000000 --- a/testcases/function_test/pkg_test/texlive-base/texlive-luajittex/test_texlive-luajittex_function_synctex.sh +++ /dev/null @@ -1,103 +0,0 @@ -#!/usr/bin/bash - -# Copyright (c) 2024 ISCAS .ALL rights reserved. -# This program is licensed under Mulan PSL v2. -# You can use it according to the terms and conditions of the Mulan PSL v2. -# http://license.coscl.org.cn/MulanPSL2 -# THIS PROGRAM IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, -# EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, -# MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. -# See the Mulan PSL v2 for more details. - -# ############################################# -# @Author : honghua -# @Contact : honghua@iscas.ac.cn -# @Date : 2026-03-04 -# @License : Mulan PSL v2 -# @Desc : Test SyncTeX generation -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - # 测试SyncTeX生成功能 - LOG_INFO "开始测试SyncTeX生成功能" - - # 判断yum源中是否有texlive-luajittex软件包 - LOG_INFO "检查yum源中是否存在texlive-luajittex软件包" - if ! dnf list available texlive-luajittex &>/dev/null; then - LOG_ERROR "yum源中未找到texlive-luajittex软件包" - exit 255 - fi - - # 检查是否已安装texlive-luajittex - LOG_INFO "检查是否已安装texlive-luajittex" - if rpm -q texlive-luajittex &>/dev/null; then - LOG_INFO "texlive-luajittex已安装,测试后保持安装状态" - already_installed=true - else - LOG_INFO "texlive-luajittex未安装,将在测试中安装" - already_installed=false - fi - - # 如果未安装,则安装软件包 - if [ "$already_installed" = false ]; then - LOG_INFO "安装texlive-luajittex软件包" - dnf install -y texlive-luajittex - CHECK_RESULT $? 0 0 "安装texlive-luajittex失败" - fi - - # 检查luajittex命令是否支持--synctex参数 - LOG_INFO "检查luajittex命令是否支持--synctex参数" - if ! luajittex --help | grep -q "synctex"; then - LOG_ERROR "luajittex命令不支持--synctex参数" - if [ "$already_installed" = false ]; then - LOG_INFO "卸载texlive-luajittex软件包" - dnf remove -y texlive-luajittex - fi - exit 255 - fi - - # 创建测试用的简单LaTeX文件 - LOG_INFO "创建测试用的LaTeX文件" - cat > test_synctex.tex << "EOF" - \documentclass{article} - \begin{document} - Hello, SyncTeX! - \end{document} - EOF - CHECK_RESULT $? 0 0 "创建测试文件失败" - - # 使用luajittex生成PDF和SyncTeX文件 - LOG_INFO "使用luajittex生成PDF和SyncTeX文件" - luajittex --synctex=1 test_synctex.tex - CHECK_RESULT $? 0 0 "luajittex执行失败" - - # 检查是否生成了SyncTeX文件 - LOG_INFO "检查是否生成了SyncTeX文件" - if [ -f "test_synctex.synctex.gz" ]; then - LOG_INFO "SyncTeX文件生成成功" - else - LOG_ERROR "未找到SyncTeX文件" - CHECK_RESULT 1 0 0 "SyncTeX文件未生成" - fi - - # 清理测试文件 - LOG_INFO "清理测试文件" - rm -f test_synctex.tex test_synctex.pdf test_synctex.log test_synctex.aux test_synctex.synctex.gz - CHECK_RESULT $? 0 0 "清理测试文件失败" - - # 如果测试前未安装,则卸载软件包 - if [ "$already_installed" = false ]; then - LOG_INFO "卸载texlive-luajittex软件包" - dnf remove -y texlive-luajittex - CHECK_RESULT $? 0 0 "卸载texlive-luajittex失败" - LOG_INFO "环境已恢复到测试前状态" - else - LOG_INFO "保持texlive-luajittex安装状态" - fi - - LOG_INFO "SyncTeX生成功能测试完成" -} - -main "$@" \ No newline at end of file diff --git a/testcases/function_test/pkg_test/texlive-base/texlive-luajittex/test_texlive-luajittex_function_version.sh b/testcases/function_test/pkg_test/texlive-base/texlive-luajittex/test_texlive-luajittex_function_version.sh deleted file mode 100644 index a10a294c874..00000000000 --- a/testcases/function_test/pkg_test/texlive-base/texlive-luajittex/test_texlive-luajittex_function_version.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-04 -# @License : Mulan PSL v2 -# @Desc : Display version information -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - # 检查是否已安装texlive-luajittex - LOG_INFO "检查是否已安装texlive-luajittex软件包" - rpm -q texlive-luajittex > /dev/null 2>&1 - if [ $? -eq 0 ]; then - LOG_INFO "texlive-luajittex已安装,测试完成后将保持安装状态" - INSTALLED=true - else - LOG_INFO "texlive-luajittex未安装,将在测试前安装" - INSTALLED=false - fi - - # 检查yum源中是否有texlive-luajittex软件包 - LOG_INFO "检查yum源中是否有texlive-luajittex软件包" - dnf list available texlive-luajittex > /dev/null 2>&1 - if [ $? -ne 0 ]; then - LOG_ERROR "yum源中未找到texlive-luajittex软件包" - exit 255 - fi - - # 如果未安装,则安装texlive-luajittex - if [ "$INSTALLED" = false ]; then - LOG_INFO "安装texlive-luajittex软件包" - dnf install -y texlive-luajittex - CHECK_RESULT $? 0 0 "安装texlive-luajittex失败" - fi - - # 检查luajittex命令是否存在 - LOG_INFO "检查luajittex命令是否存在" - which luajittex > /dev/null 2>&1 - if [ $? -ne 0 ]; then - LOG_ERROR "luajittex命令不存在" - if [ "$INSTALLED" = false ]; then - dnf remove -y texlive-luajittex - fi - exit 255 - fi - - # 检查luajittex是否支持--version参数 - LOG_INFO "检查luajittex是否支持--version参数" - luajittex --help 2>&1 | grep -q "\-\-version" - if [ $? -ne 0 ]; then - LOG_ERROR "luajittex不支持--version参数" - if [ "$INSTALLED" = false ]; then - dnf remove -y texlive-luajittex - fi - exit 255 - fi - - # 执行luajittex --version命令 - LOG_INFO "执行luajittex --version命令" - luajittex --version - CHECK_RESULT $? 0 0 "执行luajittex --version失败" - - # 清理环境:如果测试前未安装,则卸载软件包 - if [ "$INSTALLED" = false ]; then - LOG_INFO "清理环境:卸载texlive-luajittex软件包" - dnf remove -y texlive-luajittex - CHECK_RESULT $? 0 0 "卸载texlive-luajittex失败" - else - LOG_INFO "测试前已安装texlive-luajittex,保持安装状态" - fi - - LOG_INFO "测试完成" -} - -main "$@" \ No newline at end of file diff --git a/testcases/function_test/pkg_test/texlive-base/texlive-luajittex/test_texlive-luajittex_luajithbtex_draftmode.sh b/testcases/function_test/pkg_test/texlive-base/texlive-luajittex/test_texlive-luajittex_luajithbtex_draftmode.sh deleted file mode 100644 index 4aa943fa312..00000000000 --- a/testcases/function_test/pkg_test/texlive-base/texlive-luajittex/test_texlive-luajittex_luajithbtex_draftmode.sh +++ /dev/null @@ -1,120 +0,0 @@ -#!/usr/bin/bash - -# Copyright (c) 2024 ISCAS .ALL rights reserved. -# This program is licensed under Mulan PSL v2. -# You can use it according to the terms and conditions of the Mulan PSL v2. -# http://license.coscl.org.cn/MulanPSL2 -# THIS PROGRAM IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, -# EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, -# MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. -# See the Mulan PSL v2 for more details. - -# ############################################# -# @Author : honghua -# @Contact : honghua@iscas.ac.cn -# @Date : 2026-03-04 -# @License : Mulan PSL v2 -# @Desc : 使用 --draftmode 参数启用草稿模式(不生成输出PDF) -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - LOG_INFO "开始测试 texlive-luajittex 和 luajithbtex 的 --draftmode 参数" - - # 检查软件包是否在 yum 源中 - LOG_INFO "检查 yum 源中是否存在 texlive-luajittex 软件包" - dnf list available texlive-luajittex &>/dev/null - if [ $? -ne 0 ]; then - LOG_ERROR "yum 源中不存在 texlive-luajittex 软件包" - exit 255 - fi - - LOG_INFO "检查 yum 源中是否存在 luajithbtex 软件包" - dnf list available luajithbtex &>/dev/null - if [ $? -ne 0 ]; then - LOG_ERROR "yum 源中不存在 luajithbtex 软件包" - exit 255 - fi - - # 检查是否已安装软件包 - LOG_INFO "检查 texlive-luajittex 和 luajithbtex 是否已安装" - if rpm -q texlive-luajittex &>/dev/null && rpm -q luajithbtex &>/dev/null; then - LOG_INFO "软件包已安装,测试结束后将保持安装状态" - INSTALLED=1 - else - LOG_INFO "软件包未安装,将安装软件包作为测试步骤" - INSTALLED=0 - fi - - # 如果未安装,则安装软件包 - if [ $INSTALLED -eq 0 ]; then - LOG_INFO "安装 texlive-luajittex 和 luajithbtex 软件包" - dnf install -y texlive-luajittex luajithbtex - CHECK_RESULT $? 0 0 "安装软件包失败" - fi - - # 测试 luajittex 的 --draftmode 参数 - LOG_INFO "测试 luajittex 的 --draftmode 参数" - luajittex --draftmode --help &>/dev/null - if [ $? -eq 255 ]; then - LOG_ERROR "luajittex 不支持 --draftmode 参数" - exit 255 - fi - - # 测试 luajithbtex 的 --draftmode 参数 - LOG_INFO "测试 luajithbtex 的 --draftmode 参数" - luajithbtex --draftmode --help &>/dev/null - if [ $? -eq 255 ]; then - LOG_ERROR "luajithbtex 不支持 --draftmode 参数" - exit 255 - fi - - # 创建测试用的简单 LaTeX 文件 - LOG_INFO "创建测试用的 LaTeX 文件" - cat > test_draftmode.tex << "EOF" - \documentclass{article} - \begin{document} - Test draft mode. - \end{document} - EOF - - # 使用 luajittex 执行 --draftmode 测试 - LOG_INFO "使用 luajittex 执行 --draftmode 测试" - luajittex --draftmode test_draftmode.tex - CHECK_RESULT $? 0 0 "luajittex --draftmode 执行失败" - - # 检查是否未生成 PDF 文件 - LOG_INFO "检查 luajittex 是否未生成 PDF 文件" - if [ -f test_draftmode.pdf ]; then - LOG_ERROR "luajittex --draftmode 不应生成 PDF 文件" - exit 1 - fi - - # 使用 luajithbtex 执行 --draftmode 测试 - LOG_INFO "使用 luajithbtex 执行 --draftmode 测试" - luajithbtex --draftmode test_draftmode.tex - CHECK_RESULT $? 0 0 "luajithbtex --draftmode 执行失败" - - # 检查是否未生成 PDF 文件 - LOG_INFO "检查 luajithbtex 是否未生成 PDF 文件" - if [ -f test_draftmode.pdf ]; then - LOG_ERROR "luajithbtex --draftmode 不应生成 PDF 文件" - exit 1 - fi - - # 清理测试文件 - LOG_INFO "清理测试文件" - rm -f test_draftmode.tex test_draftmode.log test_draftmode.aux - - # 如果测试前未安装软件包,则卸载 - if [ $INSTALLED -eq 0 ]; then - LOG_INFO "卸载 texlive-luajittex 和 luajithbtex 软件包" - dnf remove -y texlive-luajittex luajithbtex - 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-luajittex/test_texlive-luajittex_luajithbtex_halt_on_error.sh b/testcases/function_test/pkg_test/texlive-base/texlive-luajittex/test_texlive-luajittex_luajithbtex_halt_on_error.sh deleted file mode 100644 index 776e74c21b5..00000000000 --- a/testcases/function_test/pkg_test/texlive-base/texlive-luajittex/test_texlive-luajittex_luajithbtex_halt_on_error.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-04 -# @License : Mulan PSL v2 -# @Desc : 使用 --halt-on-error 参数在遇到第一个错误时停止处理 -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - # 测试脚本开始 - - # 环境初始化 - LOG_INFO "开始测试:测试 --halt-on-error 参数功能" - - # 定义软件包名称 - PACKAGE_NAME="texlive-luajittex" - - # 步骤1:检查软件包是否已在yum源中 - LOG_INFO "步骤1:检查软件包是否在yum源中" - dnf list available ${PACKAGE_NAME} &>/dev/null - CHECK_RESULT $? 0 0 "软件包 ${PACKAGE_NAME} 不在yum源中" - if [ $? -ne 0 ]; then - LOG_ERROR "软件包 ${PACKAGE_NAME} 不在yum源中,测试无法继续" - exit 255 - fi - - # 步骤2:检查当前环境是否已安装软件包 - LOG_INFO "步骤2:检查当前环境是否已安装软件包" - rpm -q ${PACKAGE_NAME} &>/dev/null - if [ $? -eq 0 ]; then - LOG_INFO "软件包 ${PACKAGE_NAME} 已安装,测试后将保持安装状态" - INSTALLED_BEFORE_TEST=true - else - LOG_INFO "软件包 ${PACKAGE_NAME} 未安装,将在测试步骤中安装" - INSTALLED_BEFORE_TEST=false - fi - - # 步骤3:如果未安装,则安装软件包 - if [ "${INSTALLED_BEFORE_TEST}" = "false" ]; then - LOG_INFO "步骤3:安装软件包 ${PACKAGE_NAME}" - dnf install -y ${PACKAGE_NAME} - CHECK_RESULT $? 0 0 "安装软件包 ${PACKAGE_NAME} 失败" - fi - - # 步骤4:验证 --halt-on-error 参数是否存在 - LOG_INFO "步骤4:验证 luajittex 命令是否支持 --halt-on-error 参数" - luajittex --help 2>&1 | grep -q "\-\-halt\-on\-error" - CHECK_RESULT $? 0 0 "luajittex 命令不支持 --halt-on-error 参数" - if [ $? -ne 0 ]; then - LOG_ERROR "luajittex 命令不支持 --halt-on-error 参数" - exit 255 - fi - - # 步骤5:测试 --halt-on-error 参数功能 - LOG_INFO "步骤5:测试 --halt-on-error 参数在遇到第一个错误时停止处理" - # 创建一个包含错误的测试tex文件 - TEST_TEX_FILE="test_halt_error.tex" - cat > ${TEST_TEX_FILE} << "EOF" - \documentclass{article} - \begin{document} - This is a test. - \undefinedcommand - This line should not be processed. - \end{document} - EOF - - # 使用 --halt-on-error 参数运行 luajittex - luajittex --halt-on-error ${TEST_TEX_FILE} 2>&1 | tee luajittex_output.txt - # 检查命令是否因错误而提前退出 - LUAJITTEX_EXIT_CODE=$? - if [ ${LUAJITTEX_EXIT_CODE} -ne 0 ]; then - LOG_INFO "luajittex 因遇到错误而提前退出,退出码:${LUAJITTEX_EXIT_CODE}" - # 检查输出中是否包含错误信息,且后续行未被处理 - if grep -q "undefinedcommand" luajittex_output.txt && ! grep -q "should not be processed" luajittex_output.txt; then - LOG_INFO "测试通过:--halt-on-error 参数在遇到第一个错误时成功停止处理" - else - LOG_ERROR "测试失败:--halt-on-error 参数未在第一个错误时停止处理" - exit 1 - fi - else - LOG_ERROR "测试失败:luajittex 未因错误而提前退出" - exit 1 - fi - - # 清理测试文件 - rm -f ${TEST_TEX_FILE} luajittex_output.txt - - # 步骤6:环境恢复 - LOG_INFO "步骤6:恢复测试环境" - if [ "${INSTALLED_BEFORE_TEST}" = "false" ]; then - LOG_INFO "卸载测试安装的软件包 ${PACKAGE_NAME}" - dnf remove -y ${PACKAGE_NAME} - CHECK_RESULT $? 0 0 "卸载软件包 ${PACKAGE_NAME} 失败" - else - LOG_INFO "测试前软件包已安装,保持安装状态" - fi - - LOG_INFO "测试完成:--halt-on-error 参数功能测试通过" -} - -main "$@" \ No newline at end of file diff --git a/testcases/function_test/pkg_test/texlive-base/texlive-luajittex/test_texlive-luajittex_luajithbtex_help.sh b/testcases/function_test/pkg_test/texlive-base/texlive-luajittex/test_texlive-luajittex_luajithbtex_help.sh deleted file mode 100644 index 17cce3ac33e..00000000000 --- a/testcases/function_test/pkg_test/texlive-base/texlive-luajittex/test_texlive-luajittex_luajithbtex_help.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-04 -# @License : Mulan PSL v2 -# @Desc : 使用 --help 参数显示帮助信息并退出 -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - # 检查是否已安装texlive-luajittex和texlive-luajithbtex - LOG_INFO "检查是否已安装texlive-luajittex和texlive-luajithbtex" - rpm -q texlive-luajittex texlive-luajithbtex > /dev/null 2>&1 - installed=$? - - # 如果未安装,则进行安装 - if [ $installed -ne 0 ]; then - LOG_INFO "软件包未安装,开始安装" - # 检查yum源中是否有texlive-luajittex软件包 - LOG_INFO "检查yum源中是否有texlive-luajittex软件包" - dnf list available texlive-luajittex > /dev/null 2>&1 - CHECK_RESULT $? 0 0 "yum源中没有texlive-luajittex软件包" - # 检查yum源中是否有texlive-luajithbtex软件包 - LOG_INFO "检查yum源中是否有texlive-luajithbtex软件包" - dnf list available texlive-luajithbtex > /dev/null 2>&1 - CHECK_RESULT $? 0 0 "yum源中没有texlive-luajithbtex软件包" - # 安装软件包 - LOG_INFO "安装texlive-luajittex和texlive-luajithbtex" - dnf install -y texlive-luajittex texlive-luajithbtex - CHECK_RESULT $? 0 0 "安装texlive-luajittex和texlive-luajithbtex失败" - else - LOG_INFO "软件包已安装,跳过安装步骤" - fi - - # 测试luajittex --help参数 - LOG_INFO "测试luajittex --help参数" - luajittex --help > /dev/null 2>&1 - CHECK_RESULT $? 0 0 "luajittex --help参数不存在或不支持" - - # 测试luajithbtex --help参数 - LOG_INFO "测试luajithbtex --help参数" - luajithbtex --help > /dev/null 2>&1 - CHECK_RESULT $? 0 0 "luajithbtex --help参数不存在或不支持" - - # 如果脚本开始时未安装,则卸载软件包 - if [ $installed -ne 0 ]; then - LOG_INFO "清理环境,卸载安装的软件包" - dnf remove -y texlive-luajittex texlive-luajithbtex - CHECK_RESULT $? 0 0 "卸载texlive-luajittex和texlive-luajithbtex失败" - else - LOG_INFO "保持软件包安装状态" - fi - - LOG_INFO "测试完成" -} - -main "$@" \ No newline at end of file diff --git a/testcases/function_test/pkg_test/texlive-base/texlive-luajittex/test_texlive-luajittex_luajithbtex_ini.sh b/testcases/function_test/pkg_test/texlive-base/texlive-luajittex/test_texlive-luajittex_luajithbtex_ini.sh deleted file mode 100644 index c07c2f8110a..00000000000 --- a/testcases/function_test/pkg_test/texlive-base/texlive-luajittex/test_texlive-luajittex_luajithbtex_ini.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-04 -# @License : Mulan PSL v2 -# @Desc : 使用 --ini 参数进入 iniluajithbtex 模式,用于转储格式文件 -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - # 判断是否已安装texlive-luajittex和texlive-luajithbtex - LOG_INFO "检查是否已安装texlive-luajittex和texlive-luajithbtex" - rpm -q texlive-luajittex texlive-luajithbtex - if [ $? -eq 0 ]; then - LOG_INFO "软件包已安装,测试后保持安装状态" - INSTALLED=1 - else - LOG_INFO "软件包未安装,测试后将卸载" - INSTALLED=0 - fi - - # 检查yum源中是否存在软件包 - LOG_INFO "检查yum源中是否存在texlive-luajittex和texlive-luajithbtex" - dnf list available texlive-luajittex texlive-luajithbtex - if [ $? -ne 0 ]; then - LOG_ERROR "yum源中不存在texlive-luajittex或texlive-luajithbtex" - exit 255 - fi - - # 如果未安装,则安装软件包 - if [ $INSTALLED -eq 0 ]; then - LOG_INFO "安装texlive-luajittex和texlive-luajithbtex" - dnf install -y texlive-luajittex texlive-luajithbtex - CHECK_RESULT $? 0 0 "安装texlive-luajittex和texlive-luajithbtex失败" - fi - - # 测试--ini参数是否支持 - LOG_INFO "测试luajithbtex命令是否支持--ini参数" - luajithbtex --help | grep -E "\-\-ini" - CHECK_RESULT $? 0 0 "luajithbtex命令不支持--ini参数" - - # 执行测试用例:使用--ini参数进入iniluajithbtex模式,用于转储格式文件 - LOG_INFO "执行测试:使用--ini参数进入iniluajithbtex模式" - luajithbtex --ini - CHECK_RESULT $? 0 0 "luajithbtex --ini执行失败" - - # 清理环境:如果测试前未安装,则卸载软件包 - if [ $INSTALLED -eq 0 ]; then - LOG_INFO "卸载texlive-luajittex和texlive-luajithbtex" - dnf remove -y texlive-luajittex texlive-luajithbtex - CHECK_RESULT $? 0 0 "卸载texlive-luajittex和texlive-luajithbtex失败" - fi - - LOG_INFO "测试完成" -} - -main "$@" \ No newline at end of file diff --git a/testcases/function_test/pkg_test/texlive-base/texlive-luajittex/test_texlive-luajittex_luajithbtex_jiton.sh b/testcases/function_test/pkg_test/texlive-base/texlive-luajittex/test_texlive-luajittex_luajithbtex_jiton.sh deleted file mode 100644 index 89f58274dc3..00000000000 --- a/testcases/function_test/pkg_test/texlive-base/texlive-luajittex/test_texlive-luajittex_luajithbtex_jiton.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-04 -# @License : Mulan PSL v2 -# @Desc : 使用 --jiton 参数开启JIT编译器(默认关闭) -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - # 检查是否已安装texlive-luajittex和texlive-luajithbtex - LOG_INFO "检查是否已安装texlive-luajittex和texlive-luajithbtex" - rpm -q texlive-luajittex texlive-luajithbtex > /dev/null 2>&1 - if [ $? -eq 0 ]; then - LOG_INFO "软件包已安装,脚本结束时将保持安装状态" - INSTALLED=1 - else - LOG_INFO "软件包未安装,将在测试过程中安装" - INSTALLED=0 - fi - - # 检查yum源中是否有texlive-luajittex和texlive-luajithbtex软件包 - LOG_INFO "检查yum源中是否有texlive-luajittex和texlive-luajithbtex软件包" - dnf list available texlive-luajittex texlive-luajithbtex > /dev/null 2>&1 - CHECK_RESULT $? 0 0 "yum源中未找到texlive-luajittex或texlive-luajithbtex软件包" - if [ $? -ne 0 ]; then - LOG_ERROR "yum源中未找到texlive-luajittex或texlive-luajithbtex软件包" - exit 255 - fi - - # 如果未安装,则安装软件包 - if [ $INSTALLED -eq 0 ]; then - LOG_INFO "安装texlive-luajittex和texlive-luajithbtex软件包" - dnf install -y texlive-luajittex texlive-luajithbtex - CHECK_RESULT $? 0 0 "安装texlive-luajittex和texlive-luajithbtex软件包失败" - fi - - # 检查luajittex命令是否支持--jiton参数 - LOG_INFO "检查luajittex命令是否支持--jiton参数" - luajittex --help 2>&1 | grep -q -- "--jiton" - CHECK_RESULT $? 0 0 "luajittex命令不支持--jiton参数" - if [ $? -ne 0 ]; then - LOG_ERROR "luajittex命令不支持--jiton参数" - exit 255 - fi - - # 检查luajithbtex命令是否支持--jiton参数 - LOG_INFO "检查luajithbtex命令是否支持--jiton参数" - luajithbtex --help 2>&1 | grep -q -- "--jiton" - CHECK_RESULT $? 0 0 "luajithbtex命令不支持--jiton参数" - if [ $? -ne 0 ]; then - LOG_ERROR "luajithbtex命令不支持--jiton参数" - exit 255 - fi - - # 使用--jiton参数运行luajittex命令 - LOG_INFO "使用--jiton参数运行luajittex命令" - luajittex --jiton --version - CHECK_RESULT $? 0 0 "使用--jiton参数运行luajittex命令失败" - - # 使用--jiton参数运行luajithbtex命令 - LOG_INFO "使用--jiton参数运行luajithbtex命令" - luajithbtex --jiton --version - CHECK_RESULT $? 0 0 "使用--jiton参数运行luajithbtex命令失败" - - # 清理环境:如果测试前未安装,则卸载软件包 - if [ $INSTALLED -eq 0 ]; then - LOG_INFO "卸载texlive-luajittex和texlive-luajithbtex软件包" - dnf remove -y texlive-luajittex texlive-luajithbtex - CHECK_RESULT $? 0 0 "卸载texlive-luajittex和texlive-luajithbtex软件包失败" - else - LOG_INFO "测试前软件包已安装,保持安装状态" - fi - - LOG_INFO "测试完成" -} - -main "$@" \ No newline at end of file diff --git a/testcases/function_test/pkg_test/texlive-base/texlive-luajittex/test_texlive-luajittex_luajithbtex_jobname.sh b/testcases/function_test/pkg_test/texlive-base/texlive-luajittex/test_texlive-luajittex_luajithbtex_jobname.sh deleted file mode 100644 index 85d0c5143d9..00000000000 --- a/testcases/function_test/pkg_test/texlive-base/texlive-luajittex/test_texlive-luajittex_luajithbtex_jobname.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-04 -# @License : Mulan PSL v2 -# @Desc : 使用 --jobname 参数设置作业名称 -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - LOG_INFO "开始测试texlive-luajittex和luajithbtex的jobname参数功能" - LOG_INFO "步骤1: 检查软件包是否在yum源中" - dnf list available texlive-luajittex 2>/dev/null | grep -q texlive-luajittex - if [ $? -ne 0 ]; then - LOG_ERROR "软件包texlive-luajittex不在yum源中" - exit 255 - fi - dnf list available texlive-luajithbtex 2>/dev/null | grep -q texlive-luajithbtex - if [ $? -ne 0 ]; then - LOG_ERROR "软件包texlive-luajithbtex不在yum源中" - exit 255 - fi - LOG_INFO "步骤2: 检查当前是否已安装软件包" - INSTALLED=0 - rpm -q texlive-luajittex >/dev/null 2>&1 && rpm -q texlive-luajithbtex >/dev/null 2>&1 - if [ $? -eq 0 ]; then - INSTALLED=1 - LOG_INFO "软件包已安装,测试后将保持安装状态" - else - LOG_INFO "软件包未安装,将在测试过程中安装" - fi - if [ $INSTALLED -eq 0 ]; then - LOG_INFO "步骤3: 安装软件包" - dnf install -y texlive-luajittex texlive-luajithbtex - CHECK_RESULT $? 0 0 "安装软件包失败" - fi - LOG_INFO "步骤4: 检查luajittex命令是否支持--jobname参数" - luajittex --help 2>&1 | grep -q "\-\-jobname" - if [ $? -ne 0 ]; then - LOG_ERROR "luajittex命令不支持--jobname参数" - if [ $INSTALLED -eq 0 ]; then - dnf remove -y texlive-luajittex texlive-luajithbtex - fi - exit 255 - fi - LOG_INFO "步骤5: 检查luajithbtex命令是否支持--jobname参数" - luajithbtex --help 2>&1 | grep -q "\-\-jobname" - if [ $? -ne 0 ]; then - LOG_ERROR "luajithbtex命令不支持--jobname参数" - if [ $INSTALLED -eq 0 ]; then - dnf remove -y texlive-luajittex texlive-luajithbtex - fi - exit 255 - fi - LOG_INFO "步骤6: 创建测试LaTeX文件" - cat > test_jobname.tex << "EOF" - \documentclass{article} - \begin{document} - Hello, world! - \end{document} - EOF - CHECK_RESULT $? 0 0 "创建测试文件失败" - LOG_INFO "步骤7: 使用luajittex命令的--jobname参数设置作业名称" - luajittex --jobname=luajittex_output test_jobname.tex - CHECK_RESULT $? 0 0 "luajittex命令执行失败" - if [ -f "luajittex_output.log" ]; then - LOG_INFO "luajittex的jobname参数功能正常" - else - LOG_ERROR "luajittex的jobname参数功能异常" - if [ $INSTALLED -eq 0 ]; then - dnf remove -y texlive-luajittex texlive-luajithbtex - fi - exit 1 - fi - LOG_INFO "步骤8: 使用luajithbtex命令的--jobname参数设置作业名称" - luajithbtex --jobname=luajithbtex_output test_jobname.tex - CHECK_RESULT $? 0 0 "luajithbtex命令执行失败" - if [ -f "luajithbtex_output.log" ]; then - LOG_INFO "luajithbtex的jobname参数功能正常" - else - LOG_ERROR "luajithbtex的jobname参数功能异常" - if [ $INSTALLED -eq 0 ]; then - dnf remove -y texlive-luajittex texlive-luajithbtex - fi - exit 1 - fi - LOG_INFO "步骤9: 清理临时文件" - rm -f test_jobname.tex *.log *.aux *.dvi *.pdf luajittex_output.* luajithbtex_output.* - CHECK_RESULT $? 0 0 "清理临时文件失败" - if [ $INSTALLED -eq 0 ]; then - LOG_INFO "步骤10: 卸载软件包" - dnf remove -y texlive-luajittex texlive-luajithbtex - 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-luajittex/test_texlive-luajittex_luajithbtex_lua.sh b/testcases/function_test/pkg_test/texlive-base/texlive-luajittex/test_texlive-luajittex_luajithbtex_lua.sh deleted file mode 100644 index beef0b27757..00000000000 --- a/testcases/function_test/pkg_test/texlive-base/texlive-luajittex/test_texlive-luajittex_luajithbtex_lua.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-04 -# @License : Mulan PSL v2 -# @Desc : 使用 --lua 参数指定Lua初始化脚本文件 -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - # 检查是否已安装texlive-luajittex和texlive-luajithbtex - LOG_INFO "检查是否已安装texlive-luajittex和texlive-luajithbtex" - if dnf list installed texlive-luajittex &>/dev/null && dnf list installed texlive-luajithbtex &>/dev/null; then - LOG_INFO "软件包已安装,脚本结束时将保持安装状态" - INSTALLED_ALREADY=1 - else - LOG_INFO "软件包未安装,将在测试过程中安装" - INSTALLED_ALREADY=0 - fi - - # 检查yum源中是否存在软件包 - LOG_INFO "检查yum源中是否存在texlive-luajittex和texlive-luajithbtex" - if ! dnf list available texlive-luajittex &>/dev/null; then - LOG_ERROR "yum源中不存在texlive-luajittex软件包" - exit 255 - fi - if ! dnf list available texlive-luajithbtex &>/dev/null; then - LOG_ERROR "yum源中不存在texlive-luajithbtex软件包" - exit 255 - fi - - # 如果未安装,则安装软件包 - if [ $INSTALLED_ALREADY -eq 0 ]; then - LOG_INFO "安装texlive-luajittex和texlive-luajithbtex" - dnf install -y texlive-luajittex texlive-luajithbtex - CHECK_RESULT $? 0 0 "安装texlive-luajittex和texlive-luajithbtex失败" - fi - - # 测试luajittex命令的--lua参数 - LOG_INFO "测试luajittex命令的--lua参数" - # 创建一个简单的Lua初始化脚本文件 - cat > test_lua_init.lua << "EOF" - print("Lua initialization script loaded") - EOF - CHECK_RESULT $? 0 0 "创建Lua初始化脚本文件失败" - - # 执行luajittex命令,使用--lua参数指定Lua初始化脚本 - LOG_INFO "执行luajittex --lua test_lua_init.lua --version" - luajittex --lua test_lua_init.lua --version - CHECK_RESULT $? 0 0 "luajittex命令执行失败" - - # 测试luajithbtex命令的--lua参数 - LOG_INFO "测试luajithbtex命令的--lua参数" - LOG_INFO "执行luajithbtex --lua test_lua_init.lua --version" - luajithbtex --lua test_lua_init.lua --version - CHECK_RESULT $? 0 0 "luajithbtex命令执行失败" - - # 测试不支持的参数 - LOG_INFO "测试luajittex命令的不支持的参数" - luajittex --unsupported-param 2>&1 | grep -q "unrecognized option" - CHECK_RESULT $? 0 0 "luajittex命令应不支持--unsupported-param参数" - - LOG_INFO "测试luajithbtex命令的不支持的参数" - luajithbtex --unsupported-param 2>&1 | grep -q "unrecognized option" - CHECK_RESULT $? 0 0 "luajithbtex命令应不支持--unsupported-param参数" - - # 清理测试文件 - LOG_INFO "清理测试文件" - rm -f test_lua_init.lua - CHECK_RESULT $? 0 0 "删除测试文件失败" - - # 如果脚本开始时未安装软件包,则卸载 - if [ $INSTALLED_ALREADY -eq 0 ]; then - LOG_INFO "卸载texlive-luajittex和texlive-luajithbtex" - dnf remove -y texlive-luajittex texlive-luajithbtex - CHECK_RESULT $? 0 0 "卸载texlive-luajittex和texlive-luajithbtex失败" - else - LOG_INFO "保持软件包安装状态" - fi - - LOG_INFO "测试完成" -} - -main "$@" \ No newline at end of file diff --git a/testcases/function_test/pkg_test/texlive-base/texlive-luajittex/test_texlive-luajittex_luajithbtex_lua_and_jobname.sh b/testcases/function_test/pkg_test/texlive-base/texlive-luajittex/test_texlive-luajittex_luajithbtex_lua_and_jobname.sh deleted file mode 100644 index 49d83657d4a..00000000000 --- a/testcases/function_test/pkg_test/texlive-base/texlive-luajittex/test_texlive-luajittex_luajithbtex_lua_and_jobname.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-04 -# @License : Mulan PSL v2 -# @Desc : 同时使用 --lua 和 --jobname 参数指定脚本和作业名 -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - # 检查是否已安装texlive-luajittex和texlive-luajithbtex - LOG_INFO "检查是否已安装texlive-luajittex和texlive-luajithbtex" - rpm -q texlive-luajittex > /dev/null 2>&1 - texlive_luajittex_installed=$? - rpm -q texlive-luajithbtex > /dev/null 2>&1 - texlive_luajithbtex_installed=$? - - if [ $texlive_luajittex_installed -eq 0 ] && [ $texlive_luajithbtex_installed -eq 0 ]; then - LOG_INFO "texlive-luajittex和texlive-luajithbtex已安装" - installed_before_test=1 - else - LOG_INFO "texlive-luajittex和texlive-luajithbtex未安装,将在测试过程中安装" - installed_before_test=0 - fi - - # 检查yum源中是否有texlive-luajittex和texlive-luajithbtex软件包 - LOG_INFO "检查yum源中是否有texlive-luajittex和texlive-luajithbtex软件包" - dnf list available texlive-luajittex > /dev/null 2>&1 - CHECK_RESULT $? 0 0 "yum源中没有texlive-luajittex软件包" - dnf list available texlive-luajithbtex > /dev/null 2>&1 - CHECK_RESULT $? 0 0 "yum源中没有texlive-luajithbtex软件包" - - # 如果未安装,则安装软件包 - if [ $installed_before_test -eq 0 ]; then - LOG_INFO "安装texlive-luajittex和texlive-luajithbtex" - dnf install -y texlive-luajittex texlive-luajithbtex - CHECK_RESULT $? 0 0 "安装texlive-luajittex和texlive-luajithbtex失败" - fi - - # 创建测试用的Lua脚本 - LOG_INFO "创建测试用的Lua脚本" - cat > test_script.lua << "EOF" - print("Hello from Lua script!") - EOF - CHECK_RESULT $? 0 0 "创建Lua脚本失败" - - # 测试同时使用--lua和--jobname参数 - LOG_INFO "测试同时使用--lua和--jobname参数" - luajittex --lua=test_script.lua --jobname=testjob test.tex > output.log 2>&1 - CHECK_RESULT $? 0 0 "luajittex命令执行失败" - - # 检查输出文件中是否包含预期的作业名 - LOG_INFO "检查输出文件中是否包含预期的作业名" - grep -q "testjob" testjob.log 2>/dev/null - CHECK_RESULT $? 0 0 "输出文件中未找到预期的作业名"testjob"" - - # 清理测试文件 - LOG_INFO "清理测试文件" - rm -f test_script.lua output.log testjob.log test.aux test.log - - # 如果测试前未安装,则卸载软件包 - if [ $installed_before_test -eq 0 ]; then - LOG_INFO "卸载texlive-luajittex和texlive-luajithbtex" - dnf remove -y texlive-luajittex texlive-luajithbtex - CHECK_RESULT $? 0 0 "卸载texlive-luajittex和texlive-luajithbtex失败" - fi - - LOG_INFO "测试完成" -} - -main "$@" \ No newline at end of file diff --git a/testcases/function_test/pkg_test/texlive-base/texlive-luajittex/test_texlive-luajittex_luajithbtex_luaonly.sh b/testcases/function_test/pkg_test/texlive-base/texlive-luajittex/test_texlive-luajittex_luajithbtex_luaonly.sh deleted file mode 100644 index 6935fe402fd..00000000000 --- a/testcases/function_test/pkg_test/texlive-base/texlive-luajittex/test_texlive-luajittex_luajithbtex_luaonly.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-04 -# @License : Mulan PSL v2 -# @Desc : 使用 --luaonly 参数运行一个Lua文件后退出 -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - LOG_INFO "开始测试:使用 --luaonly 参数运行一个Lua文件后退出" - - # 检查软件包是否在yum源中 - LOG_INFO "检查yum源中是否有texlive-luajittex-luajithbtex-luaonly软件包" - if ! dnf list available texlive-luajittex-luajithbtex-luaonly &>/dev/null; then - LOG_ERROR "软件包texlive-luajittex-luajithbtex-luaonly不在yum源中" - exit 255 - fi - - # 检查是否已安装 - LOG_INFO "检查是否已安装texlive-luajittex-luajithbtex-luaonly软件包" - if rpm -q texlive-luajittex-luajithbtex-luaonly &>/dev/null; then - LOG_INFO "软件包已安装,测试结束后保持安装状态" - INSTALLED=true - else - LOG_INFO "软件包未安装,将进行安装" - INSTALLED=false - fi - - # 如果未安装,则安装软件包 - if [ "$INSTALLED" = false ]; then - LOG_INFO "安装texlive-luajittex-luajithbtex-luaonly软件包" - dnf install -y texlive-luajittex-luajithbtex-luaonly - CHECK_RESULT $? 0 0 "安装软件包失败" - fi - - # 检查命令是否支持 --luaonly 参数 - LOG_INFO "检查luajittex命令是否支持--luaonly参数" - if ! luajittex --help 2>&1 | grep -q -- "--luaonly"; then - LOG_ERROR "luajittex命令不支持--luaonly参数" - exit 255 - fi - - # 创建一个简单的Lua测试文件 - LOG_INFO "创建测试用的Lua文件" - cat > test_luaonly.lua << "EOF" - print("Hello from Lua!") - EOF - CHECK_RESULT $? 0 0 "创建Lua文件失败" - - # 使用 --luaonly 参数运行Lua文件 - LOG_INFO "使用--luaonly参数运行Lua文件" - luajittex --luaonly test_luaonly.lua - CHECK_RESULT $? 0 0 "使用--luaonly参数运行Lua文件失败" - - # 清理临时文件 - LOG_INFO "清理临时文件" - rm -f test_luaonly.lua - CHECK_RESULT $? 0 0 "清理临时文件失败" - - # 如果测试前未安装,则卸载软件包 - if [ "$INSTALLED" = false ]; then - LOG_INFO "卸载texlive-luajittex-luajithbtex-luaonly软件包" - dnf remove -y texlive-luajittex-luajithbtex-luaonly - 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-luajittex/test_texlive-luajittex_luajithbtex_output_format.sh b/testcases/function_test/pkg_test/texlive-base/texlive-luajittex/test_texlive-luajittex_luajithbtex_output_format.sh deleted file mode 100644 index f36162a655b..00000000000 --- a/testcases/function_test/pkg_test/texlive-base/texlive-luajittex/test_texlive-luajittex_luajithbtex_output_format.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-04 -# @License : Mulan PSL v2 -# @Desc : 使用 --output-format 参数指定输出格式为PDF -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - # 初始化变量 - PACKAGE_NAME="texlive-luajittex" - COMMAND_NAME="luajithbtex" - EXPECTED_FORMAT="pdf" - LOG_INFO "开始测试 ${COMMAND_NAME} 的 --output-format 参数功能" - - # 步骤1:检查软件包是否在yum源中 - LOG_INFO "步骤1:检查 ${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 "步骤2:检查 ${PACKAGE_NAME} 是否已安装" - INSTALLED=false - rpm -q ${PACKAGE_NAME} &>/dev/null - if [ $? -eq 0 ]; then - INSTALLED=true - LOG_INFO "${PACKAGE_NAME} 已安装,测试结束后将保持安装状态" - else - LOG_INFO "${PACKAGE_NAME} 未安装,将进行安装测试" - fi - - # 步骤3:如果未安装,则安装软件包 - if [ "$INSTALLED" = "false" ]; then - LOG_INFO "步骤3:安装 ${PACKAGE_NAME}" - dnf install -y ${PACKAGE_NAME} - CHECK_RESULT $? 0 0 "安装 ${PACKAGE_NAME} 失败" - fi - - # 步骤4:检查命令是否存在 - LOG_INFO "步骤4:检查 ${COMMAND_NAME} 命令是否存在" - command -v ${COMMAND_NAME} &>/dev/null - CHECK_RESULT $? 0 0 "${COMMAND_NAME} 命令不存在" - - # 步骤5:检查 --output-format 参数是否支持 - LOG_INFO "步骤5:检查 --output-format 参数是否支持" - ${COMMAND_NAME} --help 2>&1 | grep -q -- "--output-format" - if [ $? -ne 0 ]; then - LOG_ERROR "${COMMAND_NAME} 不支持 --output-format 参数" - exit 255 - fi - - # 步骤6:测试 --output-format 参数指定PDF格式 - LOG_INFO "步骤6:测试 --output-format 参数指定输出格式为PDF" - TEST_FILE="test_output_format.tex" - cat > ${TEST_FILE} << "EOF" - \documentclass{article} - \begin{document} - Test document for output format. - \end{document} - EOF - - ${COMMAND_NAME} --output-format=${EXPECTED_FORMAT} ${TEST_FILE} - CHECK_RESULT $? 0 0 "使用 --output-format=${EXPECTED_FORMAT} 参数执行失败" - - # 步骤7:验证输出文件格式 - LOG_INFO "步骤7:验证输出文件格式" - OUTPUT_FILE="${TEST_FILE%.tex}.${EXPECTED_FORMAT}" - if [ -f "${OUTPUT_FILE}" ]; then - LOG_INFO "成功生成输出文件: ${OUTPUT_FILE}" - file "${OUTPUT_FILE}" | grep -i "${EXPECTED_FORMAT}" &>/dev/null - CHECK_RESULT $? 0 0 "输出文件格式不是预期的 ${EXPECTED_FORMAT}" - else - LOG_ERROR "未找到预期的输出文件: ${OUTPUT_FILE}" - exit 1 - fi - - # 步骤8:清理测试文件 - LOG_INFO "步骤8:清理测试文件" - rm -f ${TEST_FILE} ${OUTPUT_FILE} ${TEST_FILE%.tex}.log ${TEST_FILE%.tex}.aux - - # 步骤9:如果测试前未安装,则卸载软件包 - if [ "$INSTALLED" = "false" ]; then - LOG_INFO "步骤9:卸载 ${PACKAGE_NAME}" - dnf remove -y ${PACKAGE_NAME} - CHECK_RESULT $? 0 0 "卸载 ${PACKAGE_NAME} 失败" - fi - - LOG_INFO "测试完成" -} - -main "$@" \ No newline at end of file diff --git a/testcases/function_test/pkg_test/texlive-base/texlive-luajittex/test_texlive-luajittex_luajithbtex_recorder.sh b/testcases/function_test/pkg_test/texlive-base/texlive-luajittex/test_texlive-luajittex_luajithbtex_recorder.sh deleted file mode 100644 index 74b920d9f45..00000000000 --- a/testcases/function_test/pkg_test/texlive-base/texlive-luajittex/test_texlive-luajittex_luajithbtex_recorder.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-04 -# @License : Mulan PSL v2 -# @Desc : 使用 --recorder 参数启用文件名记录器 -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - # 检查是否已安装texlive-luajittex和texlive-luajithbtex - LOG_INFO "检查是否已安装texlive-luajittex和texlive-luajithbtex" - rpm -q texlive-luajittex texlive-luajithbtex > /dev/null 2>&1 - if [ $? -eq 0 ]; then - LOG_INFO "软件包已安装,测试后将保持安装状态" - INSTALLED=true - else - LOG_INFO "软件包未安装,将在测试过程中安装" - INSTALLED=false - fi - - # 检查yum源中是否有相关软件包 - LOG_INFO "检查yum源中是否有texlive-luajittex和texlive-luajithbtex软件包" - dnf list available texlive-luajittex texlive-luajithbtex > /dev/null 2>&1 - if [ $? -ne 0 ]; then - LOG_ERROR "yum源中未找到texlive-luajittex或texlive-luajithbtex软件包" - exit 255 - fi - - # 如果未安装,则安装软件包 - if [ "$INSTALLED" = false ]; then - LOG_INFO "开始安装texlive-luajittex和texlive-luajithbtex" - dnf install -y texlive-luajittex texlive-luajithbtex - CHECK_RESULT $? 0 0 "安装texlive-luajittex和texlive-luajithbtex失败" - fi - - # 检查luajittex命令是否支持--recorder参数 - LOG_INFO "检查luajittex命令是否支持--recorder参数" - luajittex --help | grep -q "\-\-recorder" - if [ $? -ne 0 ]; then - LOG_ERROR "luajittex命令不支持--recorder参数" - exit 255 - fi - - # 检查luajithbtex命令是否支持--recorder参数 - LOG_INFO "检查luajithbtex命令是否支持--recorder参数" - luajithbtex --help | grep -q "\-\-recorder" - if [ $? -ne 0 ]; then - LOG_ERROR "luajithbtex命令不支持--recorder参数" - exit 255 - fi - - # 创建一个简单的测试TeX文件 - LOG_INFO "创建测试TeX文件" - TEST_TEX="test_recorder.tex" - cat > $TEST_TEX << "EOF" - \documentclass{article} - \begin{document} - Test document for recorder parameter. - \end{document} - EOF - CHECK_RESULT $? 0 0 "创建测试TeX文件失败" - - # 使用luajittex命令并启用--recorder参数 - LOG_INFO "使用luajittex命令并启用--recorder参数" - luajittex --recorder $TEST_TEX - CHECK_RESULT $? 0 0 "luajittex命令执行失败" - - # 检查是否生成了记录文件 - LOG_INFO "检查是否生成了记录文件" - if [ -f "${TEST_TEX%.tex}.fls" ]; then - LOG_INFO "成功生成记录文件: ${TEST_TEX%.tex}.fls" - else - LOG_ERROR "未生成记录文件" - exit 1 - fi - - # 清理luajittex生成的中间文件 - LOG_INFO "清理luajittex生成的中间文件" - rm -f ${TEST_TEX%.tex}.aux ${TEST_TEX%.tex}.log ${TEST_TEX%.tex}.fls - - # 使用luajithbtex命令并启用--recorder参数 - LOG_INFO "使用luajithbtex命令并启用--recorder参数" - luajithbtex --recorder $TEST_TEX - CHECK_RESULT $? 0 0 "luajithbtex命令执行失败" - - # 检查是否生成了记录文件 - LOG_INFO "检查是否生成了记录文件" - if [ -f "${TEST_TEX%.tex}.fls" ]; then - LOG_INFO "成功生成记录文件: ${TEST_TEX%.tex}.fls" - else - LOG_ERROR "未生成记录文件" - exit 1 - fi - - # 清理测试文件 - LOG_INFO "清理测试文件" - rm -f $TEST_TEX ${TEST_TEX%.tex}.aux ${TEST_TEX%.tex}.log ${TEST_TEX%.tex}.fls - - # 如果测试前未安装,则卸载软件包 - if [ "$INSTALLED" = false ]; then - LOG_INFO "卸载texlive-luajittex和texlive-luajithbtex软件包" - dnf remove -y texlive-luajittex texlive-luajithbtex - CHECK_RESULT $? 0 0 "卸载texlive-luajittex和texlive-luajithbtex失败" - fi - - LOG_INFO "测试完成" -} - -main "$@" \ No newline at end of file diff --git a/testcases/function_test/pkg_test/texlive-base/texlive-luajittex/test_texlive-luajittex_luajithbtex_safer.sh b/testcases/function_test/pkg_test/texlive-base/texlive-luajittex/test_texlive-luajittex_luajithbtex_safer.sh deleted file mode 100644 index 5689b2e589f..00000000000 --- a/testcases/function_test/pkg_test/texlive-base/texlive-luajittex/test_texlive-luajittex_luajithbtex_safer.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-04 -# @License : Mulan PSL v2 -# @Desc : 使用 --safer 参数禁用易受攻击的Lua命令 -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - set -e - - LOG_INFO "开始测试luajittex和luajithbtex的--safer参数功能" - - # 检查软件包是否在yum源中 - LOG_INFO "检查软件包texlive-luajittex和texlive-luajithbtex是否在yum源中" - dnf list available texlive-luajittex texlive-luajithbtex >/dev/null 2>&1 - if [ $? -ne 0 ]; then - LOG_ERROR "软件包texlive-luajittex或texlive-luajithbtex不在yum源中" - exit 255 - fi - - # 检查是否已安装 - LOG_INFO "检查软件包是否已安装" - if rpm -q texlive-luajittex texlive-luajithbtex >/dev/null 2>&1; then - already_installed=1 - LOG_INFO "软件包已安装,测试后保持安装状态" - else - already_installed=0 - LOG_INFO "软件包未安装,将进行安装测试" - fi - - # 如果未安装,则安装软件包 - if [ $already_installed -eq 0 ]; then - LOG_INFO "安装texlive-luajittex和texlive-luajithbtex" - dnf install -y texlive-luajittex texlive-luajithbtex - CHECK_RESULT $? 0 0 "安装软件包失败" - fi - - # 测试luajittex --safer参数 - LOG_INFO "测试luajittex --safer参数" - luajittex --safer --version >/dev/null 2>&1 - CHECK_RESULT $? 0 0 "luajittex不支持--safer参数" - - # 测试luajithbtex --safer参数 - LOG_INFO "测试luajithbtex --safer参数" - luajithbtex --safer --version >/dev/null 2>&1 - CHECK_RESULT $? 0 0 "luajithbtex不支持--safer参数" - - # 创建测试Lua文件 - LOG_INFO "创建测试Lua文件" - cat > test_safer.lua << "EOF" - os.execute("echo unsafe") - EOF - - # 测试luajittex执行不安全命令 - LOG_INFO "测试luajittex在不安全模式下执行命令" - luajittex --lua test_safer.lua test.tex 2>&1 | grep -q "unsafe" - CHECK_RESULT $? 0 0 "luajittex在不安全模式下未执行命令" - - # 测试luajittex在安全模式下执行命令 - LOG_INFO "测试luajittex在安全模式下执行命令" - luajittex --safer --lua test_safer.lua test.tex 2>&1 | grep -q "attempt to call a nil value" - CHECK_RESULT $? 0 0 "luajittex在安全模式下未禁用不安全命令" - - # 测试luajithbtex执行不安全命令 - LOG_INFO "测试luajithbtex在不安全模式下执行命令" - luajithbtex --lua test_safer.lua test.tex 2>&1 | grep -q "unsafe" - CHECK_RESULT $? 0 0 "luajithbtex在不安全模式下未执行命令" - - # 测试luajithbtex在安全模式下执行命令 - LOG_INFO "测试luajithbtex在安全模式下执行命令" - luajithbtex --safer --lua test_safer.lua test.tex 2>&1 | grep -q "attempt to call a nil value" - CHECK_RESULT $? 0 0 "luajithbtex在安全模式下未禁用不安全命令" - - # 清理测试文件 - LOG_INFO "清理测试文件" - rm -f test_safer.lua test.aux test.log test.pdf - - # 如果测试前未安装,则卸载软件包 - if [ $already_installed -eq 0 ]; then - LOG_INFO "卸载测试安装的软件包" - dnf remove -y texlive-luajittex texlive-luajithbtex - 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-luajittex/test_texlive-luajittex_luajithbtex_shell_escape.sh b/testcases/function_test/pkg_test/texlive-base/texlive-luajittex/test_texlive-luajittex_luajithbtex_shell_escape.sh deleted file mode 100644 index 53cae12fc53..00000000000 --- a/testcases/function_test/pkg_test/texlive-base/texlive-luajittex/test_texlive-luajittex_luajithbtex_shell_escape.sh +++ /dev/null @@ -1,86 +0,0 @@ -#!/usr/bin/bash - -# Copyright (c) 2024 ISCAS .ALL rights reserved. -# This program is licensed under Mulan PSL v2. -# You can use it according to the terms and conditions of the Mulan PSL v2. -# http://license.coscl.org.cn/MulanPSL2 -# THIS PROGRAM IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, -# EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, -# MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. -# See the Mulan PSL v2 for more details. - -# ############################################# -# @Author : honghua -# @Contact : honghua@iscas.ac.cn -# @Date : 2026-03-04 -# @License : Mulan PSL v2 -# @Desc : 使用 --shell-escape 参数启用系统命令 -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - LOG_INFO "开始测试:使用 --shell-escape 参数启用系统命令" - - # 定义需要测试的软件包 - PACKAGE="texlive-luajittex" - COMMAND="luajithbtex" - PARAM="--shell-escape" - - # 步骤1:检查软件包是否已在系统中安装 - LOG_INFO "步骤1:检查软件包是否已安装" - if dnf list installed "$PACKAGE" &>/dev/null; then - LOG_INFO "软件包已安装,测试结束后将保持安装状态" - INSTALLED=true - else - LOG_INFO "软件包未安装,将在测试过程中安装" - INSTALLED=false - fi - - # 步骤2:检查yum源中是否存在该软件包 - LOG_INFO "步骤2:检查yum源中是否存在软件包" - if ! dnf list available "$PACKAGE" &>/dev/null; then - LOG_ERROR "yum源中未找到软件包:$PACKAGE" - exit 255 - fi - - # 步骤3:如果未安装,则安装软件包 - if [ "$INSTALLED" = false ]; then - LOG_INFO "步骤3:安装软件包" - dnf install -y "$PACKAGE" - CHECK_RESULT $? 0 0 "安装软件包失败" - fi - - # 步骤4:检查命令是否存在 - LOG_INFO "步骤4:检查命令是否存在" - if ! command -v "$COMMAND" &>/dev/null; then - LOG_ERROR "命令不存在:$COMMAND" - exit 255 - fi - - # 步骤5:检查参数是否支持 - LOG_INFO "步骤5:检查参数是否支持" - if ! "$COMMAND" --help 2>&1 | grep -q "$PARAM"; then - LOG_ERROR "参数不支持:$PARAM" - exit 255 - fi - - # 步骤6:执行测试命令 - LOG_INFO "步骤6:执行测试命令" - "$COMMAND" "$PARAM" --version - CHECK_RESULT $? 0 0 "执行命令失败" - - # 步骤7:清理环境 - LOG_INFO "步骤7:清理环境" - if [ "$INSTALLED" = false ]; then - LOG_INFO "卸载测试安装的软件包" - dnf remove -y "$PACKAGE" - 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-luajittex/test_texlive-luajittex_luajithbtex_synctex.sh b/testcases/function_test/pkg_test/texlive-base/texlive-luajittex/test_texlive-luajittex_luajithbtex_synctex.sh deleted file mode 100644 index 7202da1c661..00000000000 --- a/testcases/function_test/pkg_test/texlive-base/texlive-luajittex/test_texlive-luajittex_luajithbtex_synctex.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-04 -# @License : Mulan PSL v2 -# @Desc : 使用 --synctex 参数启用SyncTeX支持 -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - # 定义软件包名称 - PACKAGE_NAME="texlive-luajittex" - - # 步骤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="yes" - else - LOG_INFO "软件包 ${PACKAGE_NAME} 未安装,将进行安装测试" - INSTALLED_BEFORE="no" - fi - - # 步骤3:如果未安装,则安装软件包 - if [ "${INSTALLED_BEFORE}" = "no" ]; then - LOG_INFO "3. 安装软件包 ${PACKAGE_NAME}" - dnf install -y ${PACKAGE_NAME} - CHECK_RESULT $? 0 0 "安装软件包 ${PACKAGE_NAME} 失败" - fi - - # 步骤4:检查luajittex命令是否支持--synctex参数 - LOG_INFO "4. 检查luajittex命令是否支持--synctex参数" - luajittex --help 2>&1 | grep -q "\-\-synctex" - if [ $? -ne 0 ]; then - LOG_ERROR "luajittex命令不支持--synctex参数" - if [ "${INSTALLED_BEFORE}" = "no" ]; then - LOG_INFO "清理环境:卸载软件包 ${PACKAGE_NAME}" - dnf remove -y ${PACKAGE_NAME} - fi - exit 255 - fi - - # 步骤5:使用--synctex参数测试luajittex命令 - LOG_INFO "5. 使用--synctex参数测试luajittex命令" - cat > test_synctex.tex << "EOF" - \documentclass{article} - \begin{document} - Hello, SyncTeX! - \end{document} - EOF - luajittex --synctex=1 test_synctex.tex - CHECK_RESULT $? 0 0 "使用--synctex参数执行luajittex失败" - - # 步骤6:检查是否生成了.synctex文件 - LOG_INFO "6. 检查是否生成了.synctex文件" - if [ -f test_synctex.synctex.gz ]; then - LOG_INFO "成功生成test_synctex.synctex.gz文件" - else - LOG_ERROR "未生成.synctex文件" - CHECK_RESULT 1 0 0 "SyncTeX支持测试失败" - fi - - # 步骤7:清理测试文件 - LOG_INFO "7. 清理测试文件" - rm -f test_synctex.tex test_synctex.synctex.gz test_synctex.log test_synctex.aux - - # 步骤8:如果测试前未安装,则卸载软件包 - if [ "${INSTALLED_BEFORE}" = "no" ]; then - LOG_INFO "8. 卸载软件包 ${PACKAGE_NAME}" - dnf remove -y ${PACKAGE_NAME} - CHECK_RESULT $? 0 0 "卸载软件包 ${PACKAGE_NAME} 失败" - 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-luajittex/test_texlive-luajittex_luajittex_--draftmode.sh b/testcases/function_test/pkg_test/texlive-base/texlive-luajittex/test_texlive-luajittex_luajittex_--draftmode.sh deleted file mode 100644 index 53f1bd1ab59..00000000000 --- a/testcases/function_test/pkg_test/texlive-base/texlive-luajittex/test_texlive-luajittex_luajittex_--draftmode.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-04 -# @License : Mulan PSL v2 -# @Desc : 测试启用草稿模式(不生成输出PDF) -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - LOG_INFO "开始测试:测试启用草稿模式(不生成输出PDF)" - - # 定义软件包名称 - PACKAGE_NAME="texlive-luajittex" - COMMAND="luajittex" - PARAM="--draftmode" - - # 步骤1:检查yum源中是否有指定软件包 - LOG_INFO "步骤1:检查yum源中是否有软件包 $PACKAGE_NAME" - if ! dnf list available $PACKAGE_NAME &>/dev/null; then - LOG_ERROR "软件包 $PACKAGE_NAME 在yum源中不存在" - exit 255 - fi - CHECK_RESULT $? 0 0 "检查软件包在yum源中是否存在失败" - - # 步骤2:检查系统是否已安装该软件包 - LOG_INFO "步骤2:检查系统是否已安装软件包 $PACKAGE_NAME" - if rpm -q $PACKAGE_NAME &>/dev/null; then - LOG_INFO "软件包 $PACKAGE_NAME 已安装,脚本结束后将保持安装状态" - ALREADY_INSTALLED=1 - else - LOG_INFO "软件包 $PACKAGE_NAME 未安装,将在测试步骤中安装" - ALREADY_INSTALLED=0 - fi - - # 步骤3:如果未安装,则安装软件包 - if [ $ALREADY_INSTALLED -eq 0 ]; then - LOG_INFO "步骤3:安装软件包 $PACKAGE_NAME" - dnf install -y $PACKAGE_NAME - CHECK_RESULT $? 0 0 "安装软件包 $PACKAGE_NAME 失败" - fi - - # 步骤4:检查命令是否存在 - LOG_INFO "步骤4:检查命令 $COMMAND 是否存在" - if ! command -v $COMMAND &>/dev/null; then - LOG_ERROR "命令 $COMMAND 不存在" - exit 255 - fi - CHECK_RESULT $? 0 0 "检查命令 $COMMAND 是否存在失败" - - # 步骤5:检查参数是否支持 - LOG_INFO "步骤5:检查命令 $COMMAND 是否支持参数 $PARAM" - if ! $COMMAND --help 2>&1 | grep -q "$PARAM"; then - LOG_ERROR "命令 $COMMAND 不支持参数 $PARAM" - exit 255 - fi - CHECK_RESULT $? 0 0 "检查命令参数 $PARAM 是否支持失败" - - # 步骤6:执行测试命令,启用草稿模式 - LOG_INFO "步骤6:执行测试命令,启用草稿模式" - $COMMAND $PARAM --version - CHECK_RESULT $? 0 0 "执行命令 $COMMAND $PARAM 失败" - - # 步骤7:清理环境,如果脚本开始时未安装,则卸载软件包 - if [ $ALREADY_INSTALLED -eq 0 ]; then - LOG_INFO "步骤7:卸载软件包 $PACKAGE_NAME" - dnf remove -y $PACKAGE_NAME - CHECK_RESULT $? 0 0 "卸载软件包 $PACKAGE_NAME 失败" - else - LOG_INFO "步骤7:软件包 $PACKAGE_NAME 在脚本开始前已安装,保持安装状态" - fi - - LOG_INFO "测试完成:测试启用草稿模式(不生成输出PDF)" -} - -main "$@" \ No newline at end of file diff --git a/testcases/function_test/pkg_test/texlive-base/texlive-luajittex/test_texlive-luajittex_luajittex_--file-line-error.sh b/testcases/function_test/pkg_test/texlive-base/texlive-luajittex/test_texlive-luajittex_luajittex_--file-line-error.sh deleted file mode 100644 index a83387d80c9..00000000000 --- a/testcases/function_test/pkg_test/texlive-base/texlive-luajittex/test_texlive-luajittex_luajittex_--file-line-error.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-04 -# @License : Mulan PSL v2 -# @Desc : 测试启用文件:行:错误样式消息 -# ############################################ - -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 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 - fi - } - fi - - # 定义SSH_CMD函数(兼容性定义) - if ! type SSH_CMD &>/dev/null; then - SSH_CMD() { - local cmd=$1 - local ip=$2 - local password=$3 - local user=${4:-root} - sshpass -p "$password" ssh -o StrictHostKeyChecking=no -o UserKnownHostsFile=/dev/null "$user@$ip" "$cmd" - } - fi - - # 测试用例描述:测试启用文件:行:错误样式消息 - LOG_INFO "开始测试: 测试启用文件:行:错误样式消息" - - # 定义软件包名称 - PACKAGE_NAME="texlive-luajittex" - - # 步骤1: 检查yum源中是否存在指定的软件包 - LOG_INFO "步骤1: 检查yum源中是否存在软件包 $PACKAGE_NAME" - if ! dnf list available "$PACKAGE_NAME" &>/dev/null; then - LOG_ERROR "软件包 $PACKAGE_NAME 在yum源中不存在" - exit 255 - fi - - # 步骤2: 检查系统是否已经安装了该软件包 - LOG_INFO "步骤2: 检查系统是否已经安装了软件包 $PACKAGE_NAME" - if rpm -q "$PACKAGE_NAME" &>/dev/null; then - LOG_INFO "软件包 $PACKAGE_NAME 已经安装,测试结束后将保持安装状态" - ALREADY_INSTALLED=1 - else - LOG_INFO "软件包 $PACKAGE_NAME 未安装,将在测试过程中安装并在测试结束后卸载" - ALREADY_INSTALLED=0 - fi - - # 步骤3: 安装软件包(如果未安装) - if [ $ALREADY_INSTALLED -eq 0 ]; then - LOG_INFO "步骤3: 安装软件包 $PACKAGE_NAME" - dnf install -y "$PACKAGE_NAME" - CHECK_RESULT $? 0 0 "安装软件包 $PACKAGE_NAME 失败" - fi - - # 步骤4: 检查luajittex命令是否支持--file-line-error参数 - LOG_INFO "步骤4: 检查luajittex命令是否支持--file-line-error参数" - if ! luajittex --help | grep -q -- "--file-line-error"; then - LOG_ERROR "luajittex命令不支持--file-line-error参数" - # 清理环境:如果之前未安装,则卸载软件包 - if [ $ALREADY_INSTALLED -eq 0 ]; then - LOG_INFO "清理环境: 卸载软件包 $PACKAGE_NAME" - dnf remove -y "$PACKAGE_NAME" - fi - exit 255 - fi - - # 步骤5: 执行luajittex命令并测试--file-line-error参数 - LOG_INFO "步骤5: 执行luajittex命令测试--file-line-error参数" - # 创建一个简单的TeX文件用于测试 - TEST_TEX_FILE="test_luajittex.tex" - cat > "$TEST_TEX_FILE" << "EOF" - \documentclass{article} - \begin{document} - Hello, world! - \end{document} - EOF - - # 执行luajittex命令并启用文件:行:错误样式消息 - luajittex --file-line-error "$TEST_TEX_FILE" - CHECK_RESULT $? 0 0 "执行luajittex命令失败" - - # 步骤6: 清理测试文件 - LOG_INFO "步骤6: 清理测试文件" - rm -f "$TEST_TEX_FILE" test_luajittex.log test_luajittex.aux test_luajittex.dvi - - # 步骤7: 如果测试开始时未安装软件包,则卸载 - if [ $ALREADY_INSTALLED -eq 0 ]; then - LOG_INFO "步骤7: 卸载软件包 $PACKAGE_NAME" - dnf remove -y "$PACKAGE_NAME" - CHECK_RESULT $? 0 0 "卸载软件包 $PACKAGE_NAME 失败" - else - LOG_INFO "步骤7: 测试开始时软件包已安装,保持安装状态" - fi - - LOG_INFO "测试完成: 测试启用文件:行:错误样式消息" -} - -main "$@" \ No newline at end of file diff --git a/testcases/function_test/pkg_test/texlive-base/texlive-luajittex/test_texlive-luajittex_luajittex_--fmt.sh b/testcases/function_test/pkg_test/texlive-base/texlive-luajittex/test_texlive-luajittex_luajittex_--fmt.sh deleted file mode 100644 index 103e6c5a69e..00000000000 --- a/testcases/function_test/pkg_test/texlive-base/texlive-luajittex/test_texlive-luajittex_luajittex_--fmt.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-04 -# @License : Mulan PSL v2 -# @Desc : 测试使用--fmt参数指定格式文件 -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - LOG_INFO "开始测试texlive-luajittex软件包的luajittex命令--fmt参数功能" - - # 检查软件包是否已在yum源中 - LOG_INFO "检查yum源中是否存在texlive-luajittex软件包" - if ! dnf list available texlive-luajittex &>/dev/null; then - LOG_ERROR "yum源中未找到texlive-luajittex软件包" - exit 255 - fi - - # 检查环境是否已安装软件包 - LOG_INFO "检查系统是否已安装texlive-luajittex软件包" - if rpm -q texlive-luajittex &>/dev/null; then - LOG_INFO "系统已安装texlive-luajittex,测试结束后将保持安装状态" - ALREADY_INSTALLED=true - else - LOG_INFO "系统未安装texlive-luajittex,将在测试过程中安装" - ALREADY_INSTALLED=false - fi - - # 若未安装,则安装软件包 - if [ "$ALREADY_INSTALLED" = false ]; then - LOG_INFO "安装texlive-luajittex软件包" - dnf install -y texlive-luajittex - CHECK_RESULT $? 0 0 "安装texlive-luajittex软件包失败" - fi - - # 检查luajittex命令是否支持--fmt参数 - LOG_INFO "检查luajittex命令是否支持--fmt参数" - luajittex --help | grep -q -- "--fmt" - CHECK_RESULT $? 0 0 "luajittex命令不支持--fmt参数" - - # 测试使用--fmt参数指定格式文件 - LOG_INFO "测试使用--fmt参数指定格式文件" - luajittex --fmt=tex - CHECK_RESULT $? 0 0 "使用--fmt参数执行luajittex命令失败" - - # 环境清理:若测试前未安装,则卸载软件包 - if [ "$ALREADY_INSTALLED" = false ]; then - LOG_INFO "清理环境:卸载texlive-luajittex软件包" - dnf remove -y texlive-luajittex - CHECK_RESULT $? 0 0 "卸载texlive-luajittex软件包失败" - else - LOG_INFO "测试前已安装软件包,保持安装状态" - fi - - LOG_INFO "测试完成" -} - -main "$@" \ No newline at end of file diff --git a/testcases/function_test/pkg_test/texlive-base/texlive-luajittex/test_texlive-luajittex_luajittex_--halt-on-error.sh b/testcases/function_test/pkg_test/texlive-base/texlive-luajittex/test_texlive-luajittex_luajittex_--halt-on-error.sh deleted file mode 100644 index a3b1dfcaf44..00000000000 --- a/testcases/function_test/pkg_test/texlive-base/texlive-luajittex/test_texlive-luajittex_luajittex_--halt-on-error.sh +++ /dev/null @@ -1,120 +0,0 @@ -#!/usr/bin/bash - -# Copyright (c) 2024 ISCAS .ALL rights reserved. -# This program is licensed under Mulan PSL v2. -# You can use it according to the terms and conditions of the Mulan PSL v2. -# http://license.coscl.org.cn/MulanPSL2 -# THIS PROGRAM IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, -# EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, -# MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. -# See the Mulan PSL v2 for more details. - -# ############################################# -# @Author : honghua -# @Contact : honghua@iscas.ac.cn -# @Date : 2026-03-04 -# @License : Mulan PSL v2 -# @Desc : 测试在遇到第一个错误时停止处理 -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - # 设置环境变量 - LOG_INFO="echo" - LOG_ERROR="echo" - - # 定义软件包名称 - PACKAGE_NAME="texlive-luajittex" - - # 步骤1:检查yum源中是否存在指定软件包 - LOG_INFO "步骤1:检查yum源中是否存在软件包 $PACKAGE_NAME" - dnf list available $PACKAGE_NAME > /dev/null 2>&1 - if [ $? -ne 0 ]; then - LOG_ERROR "软件包 $PACKAGE_NAME 在yum源中不存在" - exit 255 - fi - - # 步骤2:检查系统是否已安装该软件包 - LOG_INFO "步骤2:检查系统是否已安装软件包 $PACKAGE_NAME" - INSTALLED=0 - rpm -q $PACKAGE_NAME > /dev/null 2>&1 - if [ $? -eq 0 ]; then - LOG_INFO "软件包 $PACKAGE_NAME 已安装" - INSTALLED=1 - else - LOG_INFO "软件包 $PACKAGE_NAME 未安装" - fi - - # 步骤3:如果未安装,则安装软件包 - if [ $INSTALLED -eq 0 ]; then - LOG_INFO "步骤3:安装软件包 $PACKAGE_NAME" - dnf install -y $PACKAGE_NAME - CHECK_RESULT $? 0 0 "安装软件包 $PACKAGE_NAME 失败" - fi - - # 步骤4:检查luajittex命令是否支持--halt-on-error参数 - LOG_INFO "步骤4:检查luajittex命令是否支持--halt-on-error参数" - luajittex --help 2>&1 | grep -q "\-\-halt\-on\-error" - if [ $? -ne 0 ]; then - LOG_ERROR "luajittex命令不支持--halt-on-error参数" - # 清理环境:如果之前未安装,则卸载软件包 - if [ $INSTALLED -eq 0 ]; then - LOG_INFO "清理环境:卸载软件包 $PACKAGE_NAME" - dnf remove -y $PACKAGE_NAME - fi - exit 255 - fi - - # 步骤5:测试luajittex --halt-on-error功能 - LOG_INFO "步骤5:测试luajittex --halt-on-error功能(遇到第一个错误时停止处理)" - # 创建一个包含错误的测试TeX文件 - TEST_TEX_FILE="test_error.tex" - cat > $TEST_TEX_FILE << "EOF" - \documentclass{article} - \begin{document} - 正确内容 - \undefinedcommand % 这是一个未定义的命令,会导致错误 - 更多内容 - \end{document} - EOF - - # 使用--halt-on-error参数运行luajittex - luajittex --halt-on-error $TEST_TEX_FILE > luajittex_output.txt 2>&1 - EXIT_CODE=$? - - # 检查luajittex是否在遇到第一个错误时停止 - LOG_INFO "检查luajittex是否在遇到错误时立即停止" - if [ $EXIT_CODE -ne 0 ]; then - LOG_INFO "luajittex因错误而停止,退出码:$EXIT_CODE" - # 检查输出中是否包含错误信息 - if grep -q "undefined" luajittex_output.txt; then - LOG_INFO "测试成功:luajittex在遇到第一个错误时停止处理" - CHECK_RESULT 0 0 0 "luajittex --halt-on-error功能测试成功" - else - LOG_ERROR "测试失败:未在输出中找到预期的错误信息" - CHECK_RESULT 1 0 0 "luajittex --halt-on-error功能测试失败" - fi - else - LOG_ERROR "测试失败:luajittex未因错误而停止" - CHECK_RESULT 1 0 0 "luajittex --halt-on-error功能测试失败" - fi - - # 步骤6:清理测试文件 - LOG_INFO "步骤6:清理测试文件" - rm -f $TEST_TEX_FILE luajittex_output.txt - - # 步骤7:恢复环境 - LOG_INFO "步骤7:恢复环境" - if [ $INSTALLED -eq 0 ]; then - LOG_INFO "卸载测试安装的软件包 $PACKAGE_NAME" - dnf remove -y $PACKAGE_NAME - CHECK_RESULT $? 0 0 "卸载软件包 $PACKAGE_NAME 失败" - else - LOG_INFO "保持软件包 $PACKAGE_NAME 的安装状态" - fi - - LOG_INFO "测试脚本执行完成" -} - -main "$@" \ No newline at end of file diff --git a/testcases/function_test/pkg_test/texlive-base/texlive-luajittex/test_texlive-luajittex_luajittex_--ini.sh b/testcases/function_test/pkg_test/texlive-base/texlive-luajittex/test_texlive-luajittex_luajittex_--ini.sh deleted file mode 100644 index 106510ef60a..00000000000 --- a/testcases/function_test/pkg_test/texlive-base/texlive-luajittex/test_texlive-luajittex_luajittex_--ini.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-04 -# @License : Mulan PSL v2 -# @Desc : 测试以ini模式运行,用于转储格式 -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - # 定义颜色变量(可选,但非必需,这里保留以支持LOG_INFO和LOG_ERROR的格式) - LOG_INFO() { - echo "[INFO] $1" - } - LOG_ERROR() { - echo "[ERROR] $1" - } - - # 检查软件包是否在yum源中 - check_package_in_repo() { - local package_name=$1 - LOG_INFO "检查yum源中是否存在软件包: $package_name" - dnf list available "$package_name" &>/dev/null - if [ $? -ne 0 ]; then - LOG_ERROR "软件包 $package_name 不在yum源中" - exit 255 - fi - LOG_INFO "软件包 $package_name 在yum源中" - } - - # 检查命令参数是否支持 - check_command_option() { - local command=$1 - local option=$2 - LOG_INFO "检查命令 $command 是否支持参数 $option" - $command --help 2>&1 | grep -q -- "$option" - if [ $? -ne 0 ]; then - LOG_ERROR "命令 $command 不支持参数 $option" - exit 255 - fi - LOG_INFO "命令 $command 支持参数 $option" - } - - # 主测试函数 - run_test() { - local package_name="texlive-luajittex" - local command_name="luajittex" - local command_option="--ini" - local test_installed=false - - LOG_INFO "开始测试: 测试以ini模式运行,用于转储格式" - - # 步骤1: 检查软件包是否已安装 - LOG_INFO "步骤1: 检查 $package_name 是否已安装" - if rpm -q "$package_name" &>/dev/null; then - LOG_INFO "$package_name 已安装" - test_installed=true - else - LOG_INFO "$package_name 未安装" - test_installed=false - fi - - # 步骤2: 检查软件包是否在yum源中 - check_package_in_repo "$package_name" - - # 步骤3: 如果未安装,则安装软件包 - if [ "$test_installed" = false ]; then - LOG_INFO "步骤3: 安装 $package_name" - dnf install -y "$package_name" - CHECK_RESULT $? 0 0 "安装 $package_name 失败" - else - LOG_INFO "步骤3: 跳过安装,软件包已存在" - fi - - # 步骤4: 检查命令参数是否支持 - check_command_option "$command_name" "$command_option" - - # 步骤5: 执行测试命令 - LOG_INFO "步骤5: 执行 $command_name $command_option" - $command_name $command_option - CHECK_RESULT $? 0 0 "执行 $command_name $command_option 失败" - - # 步骤6: 环境恢复 - LOG_INFO "步骤6: 环境恢复" - if [ "$test_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 "测试完成" - } - - # 执行测试 - run_test -} - -main "$@" \ No newline at end of file diff --git a/testcases/function_test/pkg_test/texlive-base/texlive-luajittex/test_texlive-luajittex_luajittex_--interaction.sh b/testcases/function_test/pkg_test/texlive-base/texlive-luajittex/test_texlive-luajittex_luajittex_--interaction.sh deleted file mode 100644 index 90257a1acfd..00000000000 --- a/testcases/function_test/pkg_test/texlive-base/texlive-luajittex/test_texlive-luajittex_luajittex_--interaction.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-04 -# @License : Mulan PSL v2 -# @Desc : 测试使用--interaction参数设置交互模式 -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - # 检查是否已安装texlive-luajittex - LOG_INFO "检查texlive-luajittex是否已安装" - dnf list installed texlive-luajittex >/dev/null 2>&1 - if [ $? -eq 0 ]; then - LOG_INFO "texlive-luajittex已安装,测试后将保持安装状态" - INSTALLED=true - else - LOG_INFO "texlive-luajittex未安装,将在测试前安装" - INSTALLED=false - fi - - # 检查yum源中是否有该软件包 - LOG_INFO "检查yum源中是否有texlive-luajittex软件包" - dnf list available texlive-luajittex >/dev/null 2>&1 - CHECK_RESULT $? 0 255 "yum源中未找到texlive-luajittex软件包" - - # 如果未安装,则安装软件包 - if [ "$INSTALLED" = "false" ]; then - LOG_INFO "开始安装texlive-luajittex" - dnf install -y texlive-luajittex - CHECK_RESULT $? 0 0 "安装texlive-luajittex失败" - fi - - # 检查luajittex命令是否支持--interaction参数 - LOG_INFO "检查luajittex命令是否支持--interaction参数" - luajittex --help 2>&1 | grep -q -- "--interaction" - CHECK_RESULT $? 0 255 "luajittex命令不支持--interaction参数" - - # 测试使用--interaction参数设置交互模式 - LOG_INFO "测试使用--interaction参数设置交互模式" - luajittex --interaction=nonstopmode --version - CHECK_RESULT $? 0 0 "使用--interaction参数执行失败" - - # 清理环境 - LOG_INFO "清理测试环境" - if [ "$INSTALLED" = "false" ]; then - LOG_INFO "卸载测试安装的texlive-luajittex软件包" - dnf remove -y texlive-luajittex - CHECK_RESULT $? 0 0 "卸载texlive-luajittex失败" - else - LOG_INFO "保持原有的texlive-luajittex安装状态" - fi - - LOG_INFO "测试完成" -} - -main "$@" \ No newline at end of file diff --git a/testcases/function_test/pkg_test/texlive-base/texlive-luajittex/test_texlive-luajittex_luajittex_--jithash.sh b/testcases/function_test/pkg_test/texlive-base/texlive-luajittex/test_texlive-luajittex_luajittex_--jithash.sh deleted file mode 100644 index 9f5c21a568c..00000000000 --- a/testcases/function_test/pkg_test/texlive-base/texlive-luajittex/test_texlive-luajittex_luajittex_--jithash.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-04 -# @License : Mulan PSL v2 -# @Desc : 测试选择Lua字符串的哈希函数 -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - # 检查是否已经安装texlive-luajittex软件包 - LOG_INFO "检查是否已安装texlive-luajittex软件包" - rpm -q texlive-luajittex - if [ $? -eq 0 ]; then - LOG_INFO "texlive-luajittex软件包已安装,测试结束后保持安装状态" - already_installed=1 - else - LOG_INFO "texlive-luajittex软件包未安装,将在测试前安装" - already_installed=0 - fi - - # 检查yum源中是否存在texlive-luajittex软件包 - LOG_INFO "检查yum源中是否存在texlive-luajittex软件包" - dnf list available texlive-luajittex - if [ $? -ne 0 ]; then - LOG_ERROR "yum源中未找到texlive-luajittex软件包" - exit 255 - fi - - # 如果未安装,则安装软件包 - if [ $already_installed -eq 0 ]; then - LOG_INFO "安装texlive-luajittex软件包" - dnf install -y texlive-luajittex - CHECK_RESULT $? 0 0 "安装texlive-luajittex软件包失败" - fi - - # 测试选择Lua字符串的哈希函数 - LOG_INFO "测试选择Lua字符串的哈希函数" - luajittex --jithash - CHECK_RESULT $? 0 0 "执行luajittex --jithash命令失败" - - # 清理环境:如果测试前未安装,则卸载软件包 - if [ $already_installed -eq 0 ]; then - LOG_INFO "卸载texlive-luajittex软件包" - dnf remove -y texlive-luajittex - CHECK_RESULT $? 0 0 "卸载texlive-luajittex软件包失败" - else - LOG_INFO "测试前已安装texlive-luajittex软件包,保持安装状态" - fi - - LOG_INFO "测试脚本执行完成" -} - -main "$@" \ No newline at end of file diff --git a/testcases/function_test/pkg_test/texlive-base/texlive-luajittex/test_texlive-luajittex_luajittex_--jiton.sh b/testcases/function_test/pkg_test/texlive-base/texlive-luajittex/test_texlive-luajittex_luajittex_--jiton.sh deleted file mode 100644 index c60e4987d14..00000000000 --- a/testcases/function_test/pkg_test/texlive-base/texlive-luajittex/test_texlive-luajittex_luajittex_--jiton.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-04 -# @License : Mulan PSL v2 -# @Desc : 测试开启JIT编译器 -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - LOG_INFO "开始测试:测试开启JIT编译器" - - # 定义软件包名称 - PACKAGE_NAME="texlive-luajittex" - - # 步骤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=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 "安装软件包失败" - fi - - # 步骤4:检查命令参数是否支持 - LOG_INFO "步骤4:检查命令参数是否支持" - if ! luajittex --help 2>&1 | grep -q "\-\-jiton"; then - LOG_ERROR "命令 luajittex 不支持参数 --jiton" - exit 255 - fi - - # 步骤5:执行测试命令 - LOG_INFO "步骤5:执行测试命令 luajittex --jiton" - luajittex --jiton - CHECK_RESULT $? 0 0 "执行 luajittex --jiton 失败" - - # 步骤6:清理环境 - LOG_INFO "步骤6:清理环境" - if [ "$INSTALLED" = false ]; then - LOG_INFO "卸载软件包 $PACKAGE_NAME" - dnf remove -y $PACKAGE_NAME - CHECK_RESULT $? 0 0 "卸载软件包失败" - else - LOG_INFO "软件包 $PACKAGE_NAME 保持安装状态,无需卸载" - fi - - LOG_INFO "测试完成" -} - -main "$@" \ No newline at end of file diff --git a/testcases/function_test/pkg_test/texlive-base/texlive-luajittex/test_texlive-luajittex_luajittex_--jobname.sh b/testcases/function_test/pkg_test/texlive-base/texlive-luajittex/test_texlive-luajittex_luajittex_--jobname.sh deleted file mode 100644 index 7d26949d002..00000000000 --- a/testcases/function_test/pkg_test/texlive-base/texlive-luajittex/test_texlive-luajittex_luajittex_--jobname.sh +++ /dev/null @@ -1,140 +0,0 @@ -#!/usr/bin/bash - -# Copyright (c) 2024 ISCAS .ALL rights reserved. -# This program is licensed under Mulan PSL v2. -# You can use it according to the terms and conditions of the Mulan PSL v2. -# http://license.coscl.org.cn/MulanPSL2 -# THIS PROGRAM IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, -# EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, -# MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. -# See the Mulan PSL v2 for more details. - -# ############################################# -# @Author : honghua -# @Contact : honghua@iscas.ac.cn -# @Date : 2026-03-04 -# @License : Mulan PSL v2 -# @Desc : 测试使用--jobname参数设置作业名称 -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - # 定义软件包名称 - PACKAGE_NAME="texlive-luajittex" - COMMAND_NAME="luajittex" - PARAM_NAME="--jobname" - TEST_FILE="test.tex" - JOB_NAME="test_output" - - # 清理函数,用于恢复环境 - cleanup() { - LOG_INFO "开始清理测试环境" - - # 如果测试文件存在则删除 - if [ -f "$TEST_FILE" ]; then - rm -f "$TEST_FILE" - LOG_INFO "删除测试文件: $TEST_FILE" - fi - - # 删除作业文件 - if [ -f "${JOB_NAME}.pdf" ]; then - rm -f "${JOB_NAME}.pdf" - LOG_INFO "删除生成的PDF文件: ${JOB_NAME}.pdf" - fi - - if [ -f "${JOB_NAME}.log" ]; then - rm -f "${JOB_NAME}.log" - LOG_INFO "删除生成的日志文件: ${JOB_NAME}.log" - fi - - # 如果测试前未安装,则卸载软件包 - if [ "$WAS_INSTALLED" -eq 0 ]; then - LOG_INFO "测试前环境未安装软件包,执行卸载" - dnf remove -y "$PACKAGE_NAME" > /dev/null 2>&1 - if [ $? -eq 0 ]; then - LOG_INFO "成功卸载软件包: $PACKAGE_NAME" - else - LOG_ERROR "卸载软件包失败: $PACKAGE_NAME" - fi - else - LOG_INFO "测试前环境已安装软件包,保持安装状态" - fi - - LOG_INFO "环境清理完成" - } - - # 设置trap,确保脚本退出时执行清理 - trap cleanup EXIT - - # 检查软件包是否已在yum源中 - LOG_INFO "检查yum源中是否存在软件包: $PACKAGE_NAME" - dnf list available "$PACKAGE_NAME" > /dev/null 2>&1 - if [ $? -ne 0 ]; then - LOG_ERROR "yum源中不存在软件包: $PACKAGE_NAME" - exit 255 - fi - LOG_INFO "yum源中存在软件包: $PACKAGE_NAME" - - # 检查命令参数是否支持 - LOG_INFO "检查命令参数是否支持: $PARAM_NAME" - # 首先检查命令是否存在 - which "$COMMAND_NAME" > /dev/null 2>&1 - if [ $? -eq 0 ]; then - # 尝试获取帮助信息检查参数 - "$COMMAND_NAME" --help 2>&1 | grep -q "$PARAM_NAME" - if [ $? -ne 0 ]; then - LOG_ERROR "命令不支持参数: $PARAM_NAME" - exit 255 - fi - fi - LOG_INFO "命令支持参数: $PARAM_NAME" - - # 检查当前是否已安装软件包 - LOG_INFO "检查当前环境是否已安装软件包: $PACKAGE_NAME" - rpm -q "$PACKAGE_NAME" > /dev/null 2>&1 - if [ $? -eq 0 ]; then - WAS_INSTALLED=1 - LOG_INFO "环境已安装软件包: $PACKAGE_NAME" - else - WAS_INSTALLED=0 - LOG_INFO "环境未安装软件包: $PACKAGE_NAME" - fi - - # 如果未安装,则安装软件包 - if [ "$WAS_INSTALLED" -eq 0 ]; then - LOG_INFO "开始安装软件包: $PACKAGE_NAME" - dnf install -y "$PACKAGE_NAME" > /dev/null 2>&1 - CHECK_RESULT $? 0 0 "安装软件包失败" - LOG_INFO "成功安装软件包: $PACKAGE_NAME" - fi - - # 创建测试tex文件 - LOG_INFO "创建测试TeX文件: $TEST_FILE" - cat > "$TEST_FILE" << "EOF" - \documentclass{article} - \begin{document} - Hello, LuaJITTeX! - \end{document} - EOF - CHECK_RESULT $? 0 0 "创建测试文件失败" - - # 测试使用--jobname参数设置作业名称 - LOG_INFO "测试使用--jobname参数设置作业名称" - "$COMMAND_NAME" --jobname="$JOB_NAME" "$TEST_FILE" > /dev/null 2>&1 - CHECK_RESULT $? 0 0 "执行luajittex命令失败" - - # 检查是否生成了指定名称的PDF文件 - LOG_INFO "检查是否生成了指定名称的PDF文件" - if [ -f "${JOB_NAME}.pdf" ]; then - LOG_INFO "成功生成PDF文件: ${JOB_NAME}.pdf" - CHECK_RESULT 0 0 0 "PDF文件生成验证" - else - LOG_ERROR "未找到生成的PDF文件: ${JOB_NAME}.pdf" - CHECK_RESULT 1 0 0 "PDF文件生成验证" - fi - - LOG_INFO "测试用例执行完成: 测试使用--jobname参数设置作业名称" -} - -main "$@" \ No newline at end of file diff --git a/testcases/function_test/pkg_test/texlive-base/texlive-luajittex/test_texlive-luajittex_luajittex_--lua.sh b/testcases/function_test/pkg_test/texlive-base/texlive-luajittex/test_texlive-luajittex_luajittex_--lua.sh deleted file mode 100644 index f026835ebf8..00000000000 --- a/testcases/function_test/pkg_test/texlive-base/texlive-luajittex/test_texlive-luajittex_luajittex_--lua.sh +++ /dev/null @@ -1,86 +0,0 @@ -#!/usr/bin/bash - -# Copyright (c) 2024 ISCAS .ALL rights reserved. -# This program is licensed under Mulan PSL v2. -# You can use it according to the terms and conditions of the Mulan PSL v2. -# http://license.coscl.org.cn/MulanPSL2 -# THIS PROGRAM IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, -# EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, -# MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. -# See the Mulan PSL v2 for more details. - -# ############################################# -# @Author : honghua -# @Contact : honghua@iscas.ac.cn -# @Date : 2026-03-04 -# @License : Mulan PSL v2 -# @Desc : 测试使用--lua参数指定Lua初始化脚本 -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - LOG_INFO "开始测试texlive-luajittex软件包的--lua参数功能" - LOG_INFO "步骤1:检查软件包是否在yum源中" - dnf list available texlive-luajittex 2>/dev/null | grep -q texlive-luajittex - if [ $? -ne 0 ]; then - LOG_ERROR "软件包texlive-luajittex不在yum源中" - exit 255 - fi - - LOG_INFO "步骤2:检查当前是否已安装texlive-luajittex" - rpm -q texlive-luajittex >/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-luajittex软件包" - dnf install -y texlive-luajittex - CHECK_RESULT $? 0 0 "安装texlive-luajittex失败" - fi - - LOG_INFO "步骤4:检查luajittex命令是否支持--lua参数" - luajittex --help 2>&1 | grep -q -- "--lua" - if [ $? -ne 0 ]; then - LOG_ERROR "luajittex命令不支持--lua参数" - if [ $INSTALLED -eq 0 ]; then - LOG_INFO "清理环境:卸载安装的软件包" - dnf remove -y texlive-luajittex - fi - exit 255 - fi - - LOG_INFO "步骤5:创建一个简单的Lua测试脚本" - cat > test_lua.lua << "EOF" - print("Lua script loaded successfully") - texio.write_nl("log", "Lua script executed from luajittex") - EOF - CHECK_RESULT $? 0 0 "创建Lua测试脚本失败" - - LOG_INFO "步骤6:使用--lua参数执行luajittex命令" - luajittex --lua test_lua.lua --interaction=nonstopmode \\relax 2>&1 | tee output.log - CHECK_RESULT $? 0 0 "执行luajittex命令失败" - - LOG_INFO "步骤7:验证Lua脚本是否成功执行" - grep -q "Lua script executed from luajittex" output.log - CHECK_RESULT $? 0 0 "Lua脚本未成功执行" - - LOG_INFO "步骤8:清理临时文件" - rm -f test_lua.lua output.log test_lua.tex - CHECK_RESULT $? 0 0 "清理临时文件失败" - - if [ $INSTALLED -eq 0 ]; then - LOG_INFO "步骤9:卸载测试安装的软件包" - dnf remove -y texlive-luajittex - CHECK_RESULT $? 0 0 "卸载texlive-luajittex失败" - fi - - LOG_INFO "测试完成,环境已恢复" -} - -main "$@" \ No newline at end of file diff --git a/testcases/function_test/pkg_test/texlive-base/texlive-luajittex/test_texlive-luajittex_luajittex_--luaconly.sh b/testcases/function_test/pkg_test/texlive-base/texlive-luajittex/test_texlive-luajittex_luajittex_--luaconly.sh deleted file mode 100644 index 7cb5e64a0fc..00000000000 --- a/testcases/function_test/pkg_test/texlive-base/texlive-luajittex/test_texlive-luajittex_luajittex_--luaconly.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-04 -# @License : Mulan PSL v2 -# @Desc : 测试字节编译一个Lua文件后退出 -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - # 检查是否已安装texlive-luajittex软件包 - LOG_INFO "检查是否已安装texlive-luajittex软件包" - rpm -q texlive-luajittex > /dev/null 2>&1 - if [ $? -eq 0 ]; then - LOG_INFO "texlive-luajittex已安装,标记为已安装状态" - INSTALLED=1 - else - LOG_INFO "texlive-luajittex未安装,标记为未安装状态" - INSTALLED=0 - fi - - # 检查yum源中是否有texlive-luajittex软件包 - LOG_INFO "检查yum源中是否有texlive-luajittex软件包" - dnf list available texlive-luajittex > /dev/null 2>&1 - CHECK_RESULT $? 0 255 "yum源中未找到texlive-luajittex软件包" - - # 如果未安装,则安装软件包 - if [ $INSTALLED -eq 0 ]; then - LOG_INFO "安装texlive-luajittex软件包" - dnf install -y texlive-luajittex > /dev/null 2>&1 - CHECK_RESULT $? 0 0 "安装texlive-luajittex失败" - fi - - # 检查luajittex命令是否存在 - LOG_INFO "检查luajittex命令是否存在" - which luajittex > /dev/null 2>&1 - CHECK_RESULT $? 0 255 "luajittex命令不存在" - - # 检查--luaconly参数是否支持 - LOG_INFO "检查--luaconly参数是否支持" - luajittex --help 2>&1 | grep -q -- "--luaconly" - CHECK_RESULT $? 0 255 "luajittex不支持--luaconly参数" - - # 创建一个简单的Lua测试文件 - LOG_INFO "创建测试Lua文件" - cat > test.lua << "EOF" - print("Hello from LuaJITTeX") - EOF - CHECK_RESULT $? 0 0 "创建Lua测试文件失败" - - # 测试字节编译Lua文件 - LOG_INFO "测试字节编译Lua文件" - luajittex --luaconly test.lua - CHECK_RESULT $? 0 0 "字节编译Lua文件失败" - - # 清理测试文件 - LOG_INFO "清理测试文件" - rm -f test.lua - CHECK_RESULT $? 0 0 "清理测试文件失败" - - # 如果测试前未安装,则卸载软件包 - if [ $INSTALLED -eq 0 ]; then - LOG_INFO "卸载texlive-luajittex软件包" - dnf remove -y texlive-luajittex > /dev/null 2>&1 - CHECK_RESULT $? 0 0 "卸载texlive-luajittex失败" - fi - - LOG_INFO "测试完成" -} - -main "$@" \ No newline at end of file diff --git a/testcases/function_test/pkg_test/texlive-base/texlive-luajittex/test_texlive-luajittex_luajittex_--luaonly.sh b/testcases/function_test/pkg_test/texlive-base/texlive-luajittex/test_texlive-luajittex_luajittex_--luaonly.sh deleted file mode 100644 index 592d76d86e0..00000000000 --- a/testcases/function_test/pkg_test/texlive-base/texlive-luajittex/test_texlive-luajittex_luajittex_--luaonly.sh +++ /dev/null @@ -1,149 +0,0 @@ -#!/usr/bin/bash - -# Copyright (c) 2024 ISCAS .ALL rights reserved. -# This program is licensed under Mulan PSL v2. -# You can use it according to the terms and conditions of the Mulan PSL v2. -# http://license.coscl.org.cn/MulanPSL2 -# THIS PROGRAM IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, -# EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, -# MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. -# See the Mulan PSL v2 for more details. - -# ############################################# -# @Author : honghua -# @Contact : honghua@iscas.ac.cn -# @Date : 2026-03-04 -# @License : Mulan PSL v2 -# @Desc : 测试运行一个Lua文件后退出 -# ############################################ - -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_name=$1 - 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_command_param() { - local command=$1 - local param=$2 - LOG_INFO "检查命令 $command 是否支持参数: $param" - $command --help 2>&1 | grep -q "$param" - if [ $? -ne 0 ]; then - LOG_ERROR "命令 $command 不支持参数 $param" - exit 255 - fi - LOG_INFO "命令 $command 支持参数 $param" - } - - # 检查软件包是否已安装 - check_package_installed() { - local package_name=$1 - LOG_INFO "检查软件包 $package_name 是否已安装" - rpm -q "$package_name" &>/dev/null - return $? - } - - # 安装软件包 - install_package() { - local package_name=$1 - LOG_INFO "安装软件包: $package_name" - dnf install -y "$package_name" - CHECK_RESULT $? 0 0 "安装软件包 $package_name 失败" - } - - # 卸载软件包 - uninstall_package() { - local package_name=$1 - LOG_INFO "卸载软件包: $package_name" - dnf remove -y "$package_name" - CHECK_RESULT $? 0 0 "卸载软件包 $package_name 失败" - } - - # 创建测试用的Lua文件 - create_test_lua_file() { - LOG_INFO "创建测试用的Lua文件" - cat > test_luaonly.lua << "EOF" - print("Hello from Lua!") - EOF - CHECK_RESULT $? 0 0 "创建Lua文件失败" - } - - # 清理测试文件 - cleanup_test_files() { - LOG_INFO "清理测试文件" - rm -f test_luaonly.lua - } - - # 主函数 - main() { - local package_name="texlive-luajittex" - local command_name="luajittex" - local command_param="--luaonly" - local test_lua_file="test_luaonly.lua" - - # 步骤1: 检查软件包是否在yum源中 - check_package_in_repo "$package_name" - - # 步骤2: 检查命令参数是否支持 - check_command_param "$command_name" "$command_param" - - # 步骤3: 检查软件包是否已安装 - local was_installed=false - if check_package_installed "$package_name"; then - LOG_INFO "软件包 $package_name 已安装" - was_installed=true - else - LOG_INFO "软件包 $package_name 未安装" - was_installed=false - fi - - # 步骤4: 如果未安装,则安装软件包 - if [ "$was_installed" = false ]; then - install_package "$package_name" - fi - - # 步骤5: 创建测试用的Lua文件 - create_test_lua_file - - # 步骤6: 执行测试命令 - LOG_INFO "执行测试命令: $command_name $command_param $test_lua_file" - $command_name $command_param $test_lua_file - CHECK_RESULT $? 0 0 "运行Lua文件失败" - - # 步骤7: 清理测试文件 - cleanup_test_files - - # 步骤8: 如果之前未安装,则卸载软件包 - if [ "$was_installed" = false ]; then - uninstall_package "$package_name" - 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-luajittex/test_texlive-luajittex_luajittex_--no-shell-escape.sh b/testcases/function_test/pkg_test/texlive-base/texlive-luajittex/test_texlive-luajittex_luajittex_--no-shell-escape.sh deleted file mode 100644 index 2c6e13a3768..00000000000 --- a/testcases/function_test/pkg_test/texlive-base/texlive-luajittex/test_texlive-luajittex_luajittex_--no-shell-escape.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-04 -# @License : Mulan PSL v2 -# @Desc : 测试禁用系统命令执行 -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - # 定义测试命令和参数 - TEST_CMD="luajittex" - TEST_ARGS="--no-shell-escape" - - # 检查软件包是否在yum源中 - LOG_INFO "检查软件包 texlive-luajittex 是否在yum源中" - dnf list available texlive-luajittex &>/dev/null - if [ $? -ne 0 ]; then - LOG_ERROR "软件包 texlive-luajittex 不在yum源中" - exit 255 - fi - - # 检查环境是否已安装 - LOG_INFO "检查环境是否已安装 texlive-luajittex" - rpm -q texlive-luajittex &>/dev/null - if [ $? -eq 0 ]; then - LOG_INFO "环境已安装 texlive-luajittex,脚本结束后保持安装状态" - ALREADY_INSTALLED=1 - else - LOG_INFO "环境未安装 texlive-luajittex,将进行安装" - ALREADY_INSTALLED=0 - fi - - # 如果未安装,则安装软件包 - if [ $ALREADY_INSTALLED -eq 0 ]; then - LOG_INFO "安装软件包 texlive-luajittex" - dnf install -y texlive-luajittex - CHECK_RESULT $? 0 0 "安装软件包 texlive-luajittex 失败" - fi - - # 检查命令是否存在 - LOG_INFO "检查命令 $TEST_CMD 是否存在" - command -v $TEST_CMD &>/dev/null - if [ $? -ne 0 ]; then - LOG_ERROR "命令 $TEST_CMD 不存在" - exit 255 - fi - - # 检查参数是否支持 - LOG_INFO "检查命令 $TEST_CMD 是否支持参数 $TEST_ARGS" - $TEST_CMD --help 2>&1 | grep -q "\-\-no-shell-escape" - if [ $? -ne 0 ]; then - LOG_ERROR "命令 $TEST_CMD 不支持参数 $TEST_ARGS" - exit 255 - fi - - # 执行测试命令 - LOG_INFO "执行命令 $TEST_CMD $TEST_ARGS" - $TEST_CMD $TEST_ARGS - CMD_EXIT_CODE=$? - - # 检查命令执行结果 - if [ $CMD_EXIT_CODE -eq 0 ]; then - LOG_INFO "命令执行成功" - else - LOG_ERROR "命令执行失败,退出码: $CMD_EXIT_CODE" - exit $CMD_EXIT_CODE - fi - - # 清理环境 - if [ $ALREADY_INSTALLED -eq 0 ]; then - LOG_INFO "卸载软件包 texlive-luajittex" - dnf remove -y texlive-luajittex - CHECK_RESULT $? 0 0 "卸载软件包 texlive-luajittex 失败" - else - LOG_INFO "环境已安装,保持软件包 texlive-luajittex 的安装状态" - fi - - LOG_INFO "测试脚本执行完成" -} - -main "$@" \ No newline at end of file diff --git a/testcases/function_test/pkg_test/texlive-base/texlive-luajittex/test_texlive-luajittex_luajittex_--output-format.sh b/testcases/function_test/pkg_test/texlive-base/texlive-luajittex/test_texlive-luajittex_luajittex_--output-format.sh deleted file mode 100644 index f82479e02e2..00000000000 --- a/testcases/function_test/pkg_test/texlive-base/texlive-luajittex/test_texlive-luajittex_luajittex_--output-format.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-04 -# @License : Mulan PSL v2 -# @Desc : 测试使用--output-format参数指定输出格式 -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - # 检查是否已安装texlive-luajittex软件包 - LOG_INFO "检查是否已安装texlive-luajittex软件包" - rpm -q texlive-luajittex &>/dev/null - if [ $? -eq 0 ]; then - LOG_INFO "texlive-luajittex已安装,标记为已存在" - already_installed=true - else - LOG_INFO "texlive-luajittex未安装,标记为未安装" - already_installed=false - fi - - # 检查yum源中是否有texlive-luajittex软件包 - LOG_INFO "检查yum源中是否有texlive-luajittex软件包" - dnf list available texlive-luajittex &>/dev/null - if [ $? -ne 0 ]; then - LOG_ERROR "yum源中未找到texlive-luajittex软件包" - exit 255 - fi - LOG_INFO "yum源中存在texlive-luajittex软件包" - - # 如果未安装,则安装软件包 - if [ "$already_installed" = "false" ]; then - LOG_INFO "安装texlive-luajittex软件包" - dnf install -y texlive-luajittex - CHECK_RESULT $? 0 0 "安装texlive-luajittex失败" - LOG_INFO "texlive-luajittex安装成功" - fi - - # 测试--output-format参数 - LOG_INFO "测试luajittex命令的--output-format参数" - luajittex --output-format &>/dev/null - if [ $? -eq 255 ]; then - LOG_ERROR "--output-format参数不存在或不支持" - exit 255 - fi - LOG_INFO "--output-format参数存在且支持" - - # 测试使用--output-format参数指定输出格式 - LOG_INFO "测试使用--output-format参数指定输出格式" - echo "\relax" > test_input.tex - luajittex --output-format=dvi test_input.tex &>/dev/null - CHECK_RESULT $? 0 0 "使用--output-format参数指定输出格式失败" - LOG_INFO "使用--output-format参数指定输出格式成功" - - # 清理测试文件 - LOG_INFO "清理测试文件" - rm -f test_input.tex test_input.dvi test_input.log test_input.aux - - # 恢复环境:如果之前未安装,则卸载软件包 - if [ "$already_installed" = "false" ]; then - LOG_INFO "卸载texlive-luajittex软件包" - dnf remove -y texlive-luajittex - CHECK_RESULT $? 0 0 "卸载texlive-luajittex失败" - LOG_INFO "texlive-luajittex卸载成功" - else - LOG_INFO "保持texlive-luajittex安装状态" - fi - - LOG_INFO "测试脚本执行完成" -} - -main "$@" \ No newline at end of file diff --git a/testcases/function_test/pkg_test/texlive-base/texlive-luajittex/test_texlive-luajittex_luajittex_--recorder.sh b/testcases/function_test/pkg_test/texlive-base/texlive-luajittex/test_texlive-luajittex_luajittex_--recorder.sh deleted file mode 100644 index 5c8ed9c7c72..00000000000 --- a/testcases/function_test/pkg_test/texlive-base/texlive-luajittex/test_texlive-luajittex_luajittex_--recorder.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-04 -# @License : Mulan PSL v2 -# @Desc : 测试启用文件名记录器 -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - # 检查是否已安装texlive-luajittex软件包 - LOG_INFO "检查是否已安装texlive-luajittex软件包" - if rpm -q texlive-luajittex > /dev/null 2>&1; then - LOG_INFO "检测到texlive-luajittex软件包已安装,标记为已安装状态" - INSTALLED="true" - else - LOG_INFO "检测到texlive-luajittex软件包未安装,标记为未安装状态" - INSTALLED="false" - fi - - # 检查yum源中是否有texlive-luajittex软件包 - LOG_INFO "检查yum源中是否有texlive-luajittex软件包" - if dnf list available texlive-luajittex > /dev/null 2>&1; then - LOG_INFO "yum源中存在texlive-luajittex软件包" - else - LOG_ERROR "yum源中不存在texlive-luajittex软件包" - exit 255 - fi - - # 如果未安装,则安装软件包 - if [ "$INSTALLED" = "false" ]; then - LOG_INFO "开始安装texlive-luajittex软件包" - dnf install -y texlive-luajittex - CHECK_RESULT $? 0 0 "安装texlive-luajittex软件包失败" - LOG_INFO "texlive-luajittex软件包安装成功" - fi - - # 检查luajittex命令是否支持--recorder参数 - LOG_INFO "检查luajittex命令是否支持--recorder参数" - luajittex --help | grep -q "\-\-recorder" - if [ $? -ne 0 ]; then - LOG_ERROR "luajittex命令不支持--recorder参数" - # 如果之前未安装,则需要卸载 - if [ "$INSTALLED" = "false" ]; then - LOG_INFO "清理环境,卸载texlive-luajittex软件包" - dnf remove -y texlive-luajittex - CHECK_RESULT $? 0 0 "卸载texlive-luajittex软件包失败" - fi - exit 255 - fi - LOG_INFO "luajittex命令支持--recorder参数" - - # 测试启用文件名记录器 - LOG_INFO "开始测试启用文件名记录器" - luajittex --recorder --version - CHECK_RESULT $? 0 0 "luajittex --recorder命令执行失败" - LOG_INFO "luajittex --recorder命令执行成功" - - # 清理环境,如果测试前未安装,则卸载软件包 - if [ "$INSTALLED" = "false" ]; then - LOG_INFO "清理环境,卸载texlive-luajittex软件包" - dnf remove -y texlive-luajittex - CHECK_RESULT $? 0 0 "卸载texlive-luajittex软件包失败" - LOG_INFO "环境清理完成" - else - LOG_INFO "测试前已安装texlive-luajittex,保持安装状态" - fi -} - -main "$@" \ No newline at end of file diff --git a/testcases/function_test/pkg_test/texlive-base/texlive-luajittex/test_texlive-luajittex_luajittex_--safer.sh b/testcases/function_test/pkg_test/texlive-base/texlive-luajittex/test_texlive-luajittex_luajittex_--safer.sh deleted file mode 100644 index 3118670ba20..00000000000 --- a/testcases/function_test/pkg_test/texlive-base/texlive-luajittex/test_texlive-luajittex_luajittex_--safer.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-04 -# @License : Mulan PSL v2 -# @Desc : 测试禁用易受攻击的Lua命令 -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - # 定义软件包名称和命令 - PACKAGE_NAME="texlive-luajittex" - COMMAND="luajittex" - PARAMETER="--safer" - - # 步骤1:检查软件包是否在yum源中 - LOG_INFO "步骤1:检查软件包是否在yum源中" - dnf list available ${PACKAGE_NAME} &>/dev/null - CHECK_RESULT $? 0 0 "软件包 ${PACKAGE_NAME} 不在yum源中" - - # 步骤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:检查命令参数是否存在或支持" - ${COMMAND} --help 2>&1 | grep -q "${PARAMETER}" - CHECK_RESULT $? 0 0 "参数 ${PARAMETER} 不存在或不支持" - - # 步骤5:测试禁用易受攻击的Lua命令 - LOG_INFO "步骤5:测试禁用易受攻击的Lua命令" - ${COMMAND} ${PARAMETER} --version - CHECK_RESULT $? 0 0 "执行命令 ${COMMAND} ${PARAMETER} 失败" - - # 步骤6:清理环境,恢复到之前的状态 - LOG_INFO "步骤6:清理环境,恢复到之前的状态" - if [ ${INSTALLED} -eq 0 ]; then - LOG_INFO "卸载软件包 ${PACKAGE_NAME}" - dnf remove -y ${PACKAGE_NAME} - CHECK_RESULT $? 0 0 "卸载软件包失败" - else - LOG_INFO "保持软件包 ${PACKAGE_NAME} 的安装状态" - fi -} - -main "$@" \ No newline at end of file diff --git a/testcases/function_test/pkg_test/texlive-base/texlive-luajittex/test_texlive-luajittex_luajittex_--shell-escape.sh b/testcases/function_test/pkg_test/texlive-base/texlive-luajittex/test_texlive-luajittex_luajittex_--shell-escape.sh deleted file mode 100644 index 43fddf24b6a..00000000000 --- a/testcases/function_test/pkg_test/texlive-base/texlive-luajittex/test_texlive-luajittex_luajittex_--shell-escape.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-04 -# @License : Mulan PSL v2 -# @Desc : 测试启用系统命令执行 -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - LOG_INFO "测试启用系统命令执行" - LOG_INFO "步骤1:检查texlive-luajittex软件包是否在yum源中" - dnf list available texlive-luajittex 2>&1 | grep -q texlive-luajittex - CHECK_RESULT $? 0 0 "texlive-luajittex软件包不在yum源中" - if [ $? -ne 0 ]; then - LOG_ERROR "texlive-luajittex软件包不在yum源中" - exit 255 - fi - - LOG_INFO "步骤2:检查系统是否已经安装了texlive-luajittex" - rpm -q texlive-luajittex > /dev/null 2>&1 - if [ $? -eq 0 ]; then - LOG_INFO "texlive-luajittex已经安装,脚本结束后将保持安装状态" - INSTALLED=1 - else - LOG_INFO "texlive-luajittex未安装,将在测试过程中安装,并在脚本结束前卸载" - INSTALLED=0 - fi - - if [ $INSTALLED -eq 0 ]; then - LOG_INFO "步骤3:安装texlive-luajittex软件包" - dnf install -y texlive-luajittex - CHECK_RESULT $? 0 0 "安装texlive-luajittex失败" - fi - - LOG_INFO "步骤4:检查luajittex命令是否支持--shell-escape参数" - luajittex --help 2>&1 | grep -q -- "--shell-escape" - CHECK_RESULT $? 0 0 "luajittex命令不支持--shell-escape参数" - if [ $? -ne 0 ]; then - LOG_ERROR "luajittex命令不支持--shell-escape参数" - exit 255 - fi - - LOG_INFO "步骤5:执行luajittex --shell-escape命令" - luajittex --shell-escape --version - CHECK_RESULT $? 0 0 "执行luajittex --shell-escape命令失败" - - LOG_INFO "步骤6:清理环境" - if [ $INSTALLED -eq 0 ]; then - LOG_INFO "卸载texlive-luajittex软件包" - dnf remove -y texlive-luajittex - CHECK_RESULT $? 0 0 "卸载texlive-luajittex失败" - else - LOG_INFO "系统原本已安装texlive-luajittex,保持安装状态" - fi - - LOG_INFO "测试完成" -} - -main "$@" \ No newline at end of file diff --git a/testcases/function_test/pkg_test/texlive-base/texlive-luajittex/test_texlive-luajittex_luajittex_--synctex.sh b/testcases/function_test/pkg_test/texlive-base/texlive-luajittex/test_texlive-luajittex_luajittex_--synctex.sh deleted file mode 100644 index 8b08a465f51..00000000000 --- a/testcases/function_test/pkg_test/texlive-base/texlive-luajittex/test_texlive-luajittex_luajittex_--synctex.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-04 -# @License : Mulan PSL v2 -# @Desc : 测试启用SyncTeX支持 -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - # 检查环境是否已安装texlive-luajittex - LOG_INFO "检查texlive-luajittex是否已安装" - rpm -q texlive-luajittex > /dev/null 2>&1 - installed=$? - - # 检查yum源中是否有texlive-luajittex软件包 - LOG_INFO "检查yum源中是否有texlive-luajittex软件包" - dnf list available texlive-luajittex > /dev/null 2>&1 - CHECK_RESULT $? 0 0 "yum源中未找到texlive-luajittex软件包" - if [ $? -ne 0 ]; then - LOG_ERROR "yum源中未找到texlive-luajittex软件包" - exit 255 - fi - - # 如果未安装,则安装软件包 - if [ $installed -ne 0 ]; then - LOG_INFO "安装texlive-luajittex软件包" - dnf install -y texlive-luajittex - CHECK_RESULT $? 0 0 "安装texlive-luajittex失败" - fi - - # 测试luajittex命令是否存在 - LOG_INFO "检查luajittex命令是否存在" - command -v luajittex > /dev/null 2>&1 - CHECK_RESULT $? 0 0 "luajittex命令不存在" - - # 测试luajittex --synctex参数是否支持 - LOG_INFO "测试luajittex --synctex参数支持" - luajittex --help | grep -q "\-\-synctex" - CHECK_RESULT $? 0 0 "luajittex不支持--synctex参数" - if [ $? -ne 0 ]; then - LOG_ERROR "luajittex不支持--synctex参数" - exit 255 - fi - - # 创建一个简单的TeX文件用于测试 - LOG_INFO "创建测试TeX文件" - cat > test_synctex.tex << "EOF" - \documentclass{article} - \begin{document} - Hello, SyncTeX! - \end{document} - EOF - CHECK_RESULT $? 0 0 "创建测试TeX文件失败" - - # 使用luajittex --synctex处理TeX文件 - LOG_INFO "使用luajittex --synctex处理TeX文件" - luajittex --synctex=1 test_synctex.tex > /dev/null 2>&1 - CHECK_RESULT $? 0 0 "luajittex --synctex执行失败" - - # 检查是否生成了.synctex文件 - LOG_INFO "检查是否生成.synctex文件" - if [ -f test_synctex.synctex.gz ]; then - LOG_INFO "成功生成.synctex.gz文件" - else - LOG_ERROR "未生成.synctex.gz文件" - exit 1 - fi - - # 清理测试文件 - LOG_INFO "清理测试文件" - rm -f test_synctex.tex test_synctex.log test_synctex.aux test_synctex.synctex.gz - CHECK_RESULT $? 0 0 "清理测试文件失败" - - # 如果测试前未安装,则在测试结束后卸载软件包 - if [ $installed -ne 0 ]; then - LOG_INFO "卸载texlive-luajittex软件包" - dnf remove -y texlive-luajittex - CHECK_RESULT $? 0 0 "卸载texlive-luajittex失败" - else - LOG_INFO "测试前已安装texlive-luajittex,保持安装状态" - fi - - LOG_INFO "测试完成" -} - -main "$@" \ No newline at end of file diff --git a/testcases/function_test/pkg_test/texlive-base/texlive-luajittex/test_texlive-luajittex_texluajit_credits.sh b/testcases/function_test/pkg_test/texlive-base/texlive-luajittex/test_texlive-luajittex_texluajit_credits.sh deleted file mode 100644 index fb238499f29..00000000000 --- a/testcases/function_test/pkg_test/texlive-base/texlive-luajittex/test_texlive-luajittex_texluajit_credits.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-04 -# @License : Mulan PSL v2 -# @Desc : 测试使用--credits参数显示软件致谢信息并退出 -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - # 判断是否已安装texlive-luajittex和texluajit软件包 - LOG_INFO "检查是否已安装texlive-luajittex和texluajit软件包" - rpm -q texlive-luajittex texluajit > /dev/null 2>&1 - if [ $? -eq 0 ]; then - LOG_INFO "软件包已安装,测试结束后将保持安装状态" - already_installed=1 - else - LOG_INFO "软件包未安装,将在测试过程中安装" - already_installed=0 - fi - - # 检查yum源中是否有该软件包 - LOG_INFO "检查yum源中是否有texlive-luajittex和texluajit软件包" - dnf list available texlive-luajittex texluajit > /dev/null 2>&1 - CHECK_RESULT $? 0 0 "yum源中未找到texlive-luajittex或texluajit软件包" - if [ $? -ne 0 ]; then - LOG_ERROR "yum源中未找到texlive-luajittex或texluajit软件包" - exit 255 - fi - - # 如果未安装,则安装软件包 - if [ $already_installed -eq 0 ]; then - LOG_INFO "安装texlive-luajittex和texluajit软件包" - dnf install -y texlive-luajittex texluajit - CHECK_RESULT $? 0 0 "安装texlive-luajittex和texluajit软件包失败" - fi - - # 测试--credits参数显示软件致谢信息并退出 - LOG_INFO "测试使用--credits参数显示软件致谢信息并退出" - texluajit --credits > /dev/null 2>&1 - CHECK_RESULT $? 0 0 "texluajit命令不支持--credits参数" - if [ $? -ne 0 ]; then - LOG_ERROR "texluajit命令不支持--credits参数" - # 如果之前未安装,则卸载软件包 - if [ $already_installed -eq 0 ]; then - LOG_INFO "卸载texlive-luajittex和texluajit软件包" - dnf remove -y texlive-luajittex texluajit - fi - exit 255 - fi - - # 验证--credits参数输出包含致谢信息 - LOG_INFO "验证--credits参数输出包含致谢信息" - texluajit --credits 2>&1 | grep -i "credit\|致谢\|thanks" > /dev/null - CHECK_RESULT $? 0 0 "--credits参数未显示软件致谢信息" - - # 清理环境:如果测试前未安装,则卸载软件包 - if [ $already_installed -eq 0 ]; then - LOG_INFO "卸载texlive-luajittex和texluajit软件包" - dnf remove -y texlive-luajittex texluajit - CHECK_RESULT $? 0 0 "卸载texlive-luajittex和texluajit软件包失败" - else - LOG_INFO "测试前软件包已安装,保持安装状态" - fi - - LOG_INFO "测试完成" -} - -main "$@" \ No newline at end of file diff --git a/testcases/function_test/pkg_test/texlive-base/texlive-luajittex/test_texlive-luajittex_texluajit_draftmode.sh b/testcases/function_test/pkg_test/texlive-base/texlive-luajittex/test_texlive-luajittex_texluajit_draftmode.sh deleted file mode 100644 index e2faef53722..00000000000 --- a/testcases/function_test/pkg_test/texlive-base/texlive-luajittex/test_texlive-luajittex_texluajit_draftmode.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-04 -# @License : Mulan PSL v2 -# @Desc : 测试使用--draftmode参数开启草稿模式(不生成输出PDF) -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - # 测试脚本:测试使用--draftmode参数开启草稿模式(不生成输出PDF) - - # 检查环境是否已安装软件包 - LOG_INFO "检查环境是否已安装 texlive-luajittex 和 texluajit 软件包..." - rpm -q texlive-luajittex texluajit - if [ $? -eq 0 ]; then - LOG_INFO "软件包已安装,测试后保持安装状态" - ENV_INSTALLED=true - else - LOG_INFO "软件包未安装,将在测试过程中安装" - ENV_INSTALLED=false - fi - - # 检查yum源中是否有软件包 - LOG_INFO "检查yum源中是否有 texlive-luajittex 和 texluajit 软件包..." - dnf list available texlive-luajittex texluajit 2>/dev/null | grep -q "texlive-luajittex\|texluajit" - if [ $? -ne 0 ]; then - LOG_ERROR "yum源中未找到 texlive-luajittex 或 texluajit 软件包" - exit 255 - fi - - # 如果未安装,则安装软件包 - if [ "$ENV_INSTALLED" = "false" ]; then - LOG_INFO "安装 texlive-luajittex 和 texluajit 软件包..." - dnf install -y texlive-luajittex texluajit - CHECK_RESULT $? 0 0 "安装软件包失败" - fi - - # 测试 luajittex 命令是否存在 - LOG_INFO "检查 luajittex 命令是否存在..." - command -v luajittex - CHECK_RESULT $? 0 0 "luajittex 命令不存在" - - # 测试 --draftmode 参数是否支持 - LOG_INFO "测试 luajittex 命令是否支持 --draftmode 参数..." - luajittex --help | grep -q "\-\-draftmode" - CHECK_RESULT $? 0 0 "luajittex 命令不支持 --draftmode 参数" - - # 创建一个简单的LaTeX测试文件 - LOG_INFO "创建测试LaTeX文件..." - cat > test_draftmode.tex << "EOF" - \documentclass{article} - \begin{document} - Test draft mode. - \end{document} - EOF - - # 使用 --draftmode 参数运行 luajittex - LOG_INFO "使用 --draftmode 参数运行 luajittex..." - luajittex --draftmode test_draftmode.tex - CHECK_RESULT $? 0 0 "luajittex --draftmode 执行失败" - - # 检查是否未生成PDF文件 - LOG_INFO "检查是否未生成PDF文件..." - if [ -f test_draftmode.pdf ]; then - LOG_ERROR "生成了PDF文件,但草稿模式不应生成PDF" - exit 1 - else - LOG_INFO "未生成PDF文件,符合草稿模式预期" - fi - - # 清理测试文件 - LOG_INFO "清理测试文件..." - rm -f test_draftmode.tex test_draftmode.log test_draftmode.aux - - # 如果测试前未安装,则卸载软件包 - if [ "$ENV_INSTALLED" = "false" ]; then - LOG_INFO "卸载 texlive-luajittex 和 texluajit 软件包..." - dnf remove -y texlive-luajittex texluajit - 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-luajittex/test_texlive-luajittex_texluajit_fmt_format.sh b/testcases/function_test/pkg_test/texlive-base/texlive-luajittex/test_texlive-luajittex_texluajit_fmt_format.sh deleted file mode 100644 index d86a9eaba32..00000000000 --- a/testcases/function_test/pkg_test/texlive-base/texlive-luajittex/test_texlive-luajittex_texluajit_fmt_format.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-04 -# @License : Mulan PSL v2 -# @Desc : 测试使用--fmt参数加载指定的格式文件 -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - # 定义软件包名称 - PACKAGE_NAME="texlive-luajittex" - BINARY_NAME="texluajit" - FMT_FILE="plain.fmt" - TEST_FILE="test.tex" - - # 步骤1:检查yum源中是否存在指定软件包 - LOG_INFO "检查yum源中是否存在软件包 ${PACKAGE_NAME}" - dnf list available "${PACKAGE_NAME}" > /dev/null 2>&1 - if [ $? -ne 0 ]; then - LOG_ERROR "yum源中不存在软件包 ${PACKAGE_NAME}" - exit 255 - fi - - # 步骤2:检查当前是否已安装软件包 - LOG_INFO "检查当前是否已安装软件包 ${PACKAGE_NAME}" - rpm -q "${PACKAGE_NAME}" > /dev/null 2>&1 - if [ $? -eq 0 ]; then - ALREADY_INSTALLED=1 - LOG_INFO "软件包 ${PACKAGE_NAME} 已安装,测试结束后将保持安装状态" - else - ALREADY_INSTALLED=0 - LOG_INFO "软件包 ${PACKAGE_NAME} 未安装,将在测试结束后卸载" - fi - - # 步骤3:如果未安装,则安装软件包 - 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:检查texluajit命令是否存在 - LOG_INFO "检查命令 ${BINARY_NAME} 是否存在" - command -v "${BINARY_NAME}" > /dev/null 2>&1 - CHECK_RESULT $? 0 0 "命令 ${BINARY_NAME} 不存在" - - # 步骤5:检查--fmt参数是否支持 - LOG_INFO "检查 ${BINARY_NAME} 是否支持 --fmt 参数" - "${BINARY_NAME}" --help 2>&1 | grep -q "\-\-fmt" - CHECK_RESULT $? 0 0 "命令 ${BINARY_NAME} 不支持 --fmt 参数" - - # 步骤6:查找格式文件 - LOG_INFO "查找格式文件 ${FMT_FILE}" - FMT_PATH=$(find /usr -name "${FMT_FILE}" 2>/dev/null | head -1) - if [ -z "${FMT_PATH}" ]; then - LOG_ERROR "未找到格式文件 ${FMT_FILE}" - exit 255 - fi - LOG_INFO "找到格式文件: ${FMT_PATH}" - - # 步骤7:创建测试TeX文件 - LOG_INFO "创建测试TeX文件" - cat > "${TEST_FILE}" << "EOF" - \documentclass{article} - \begin{document} - Hello, World! - \end{document} - EOF - CHECK_RESULT $? 0 0 "创建测试文件失败" - - # 步骤8:使用--fmt参数加载格式文件并编译测试文件 - LOG_INFO "使用 --fmt 参数加载格式文件并编译测试TeX文件" - "${BINARY_NAME}" --fmt="${FMT_PATH}" "${TEST_FILE}" - CHECK_RESULT $? 0 0 "使用 --fmt 参数编译TeX文件失败" - - # 步骤9:检查是否生成了PDF文件 - LOG_INFO "检查是否生成了PDF文件" - if [ -f "${TEST_FILE%.tex}.pdf" ]; then - LOG_INFO "成功生成PDF文件: ${TEST_FILE%.tex}.pdf" - else - LOG_ERROR "未生成PDF文件" - exit 1 - fi - - # 步骤10:清理测试文件 - LOG_INFO "清理测试文件" - rm -f "${TEST_FILE}" "${TEST_FILE%.tex}.pdf" "${TEST_FILE%.tex}.log" "${TEST_FILE%.tex}.aux" 2>/dev/null - - # 步骤11:如果测试前未安装,则卸载软件包 - 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} 失败" - fi - - LOG_INFO "测试完成" -} - -main "$@" \ No newline at end of file diff --git a/testcases/function_test/pkg_test/texlive-base/texlive-luajittex/test_texlive-luajittex_texluajit_halt_on_error.sh b/testcases/function_test/pkg_test/texlive-base/texlive-luajittex/test_texlive-luajittex_texluajit_halt_on_error.sh deleted file mode 100644 index 5f74a9042da..00000000000 --- a/testcases/function_test/pkg_test/texlive-base/texlive-luajittex/test_texlive-luajittex_texluajit_halt_on_error.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-04 -# @License : Mulan PSL v2 -# @Desc : 测试使用--halt-on-error参数在第一个错误处停止处理 -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - LOG_INFO "开始测试:测试使用--halt-on-error参数在第一个错误处停止处理" - LOG_INFO "步骤1:检查yum源中是否存在texlive-luajittex和texluajit软件包" - dnf list available texlive-luajittex texluajit 2>/dev/null | grep -E "^texlive-luajittex|^texluajit" > /dev/null - if [ $? -ne 0 ]; then - LOG_ERROR "yum源中未找到texlive-luajittex或texluajit软件包" - exit 255 - fi - - LOG_INFO "步骤2:检查当前环境是否已安装texlive-luajittex和texluajit" - rpm -q texlive-luajittex texluajit > /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-luajittex和texluajit软件包" - dnf install -y texlive-luajittex texluajit - CHECK_RESULT $? 0 0 "安装texlive-luajittex和texluajit失败" - fi - - LOG_INFO "步骤4:检查luajittex命令是否支持--halt-on-error参数" - luajittex --help 2>&1 | grep -q "\-\-halt-on-error" - if [ $? -ne 0 ]; then - LOG_ERROR "luajittex命令不支持--halt-on-error参数" - if [ $INSTALLED -eq 0 ]; then - LOG_INFO "步骤5:清理环境,卸载安装的软件包" - dnf remove -y texlive-luajittex texluajit - fi - exit 255 - fi - - LOG_INFO "步骤5:创建一个包含错误的TeX文件用于测试" - cat > test_halt.tex << "EOF" - \documentclass{article} - \begin{document} - Hello, World! - \undefinedcommand - \end{document} - EOF - - LOG_INFO "步骤6:使用--halt-on-error参数运行luajittex,预期在第一个错误处停止" - luajittex --halt-on-error test_halt.tex 2>&1 | tee output.log - CHECK_RESULT $? 1 0 "luajittex未在第一个错误处停止,退出码不符合预期" - - LOG_INFO "步骤7:检查输出中是否包含错误信息" - grep -q "undefined command" output.log - CHECK_RESULT $? 0 0 "输出中未找到预期的错误信息" - - LOG_INFO "步骤8:清理测试文件" - rm -f test_halt.tex output.log test_halt.aux test_halt.log - - if [ $INSTALLED -eq 0 ]; then - LOG_INFO "步骤9:清理环境,卸载安装的软件包" - dnf remove -y texlive-luajittex texluajit - CHECK_RESULT $? 0 0 "卸载texlive-luajittex和texluajit失败" - 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-luajittex/test_texlive-luajittex_texluajit_help.sh b/testcases/function_test/pkg_test/texlive-base/texlive-luajittex/test_texlive-luajittex_texluajit_help.sh deleted file mode 100644 index 3f904e49fe6..00000000000 --- a/testcases/function_test/pkg_test/texlive-base/texlive-luajittex/test_texlive-luajittex_texluajit_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-03-04 -# @License : Mulan PSL v2 -# @Desc : 测试使用--help参数显示帮助信息并退出 -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - # 判断环境是否已安装texlive-luajittex和texluajit软件包 - LOG_INFO "检查是否已安装texlive-luajittex和texluajit软件包" - rpm -q texlive-luajittex texluajit > /dev/null 2>&1 - installed=$? - - # 如果未安装,则安装软件包 - if [ $installed -ne 0 ]; then - LOG_INFO "软件包未安装,开始安装" - - # 检查yum源中是否有texlive-luajittex软件包 - LOG_INFO "检查yum源中是否有texlive-luajittex软件包" - dnf list available texlive-luajittex > /dev/null 2>&1 - if [ $? -ne 0 ]; then - LOG_ERROR "yum源中未找到texlive-luajittex软件包" - exit 255 - fi - - # 检查yum源中是否有texluajit软件包 - LOG_INFO "检查yum源中是否有texluajit软件包" - dnf list available texluajit > /dev/null 2>&1 - if [ $? -ne 0 ]; then - LOG_ERROR "yum源中未找到texluajit软件包" - exit 255 - fi - - # 安装软件包 - LOG_INFO "安装texlive-luajittex和texluajit软件包" - dnf install -y texlive-luajittex texluajit - CHECK_RESULT $? 0 0 "安装texlive-luajittex和texluajit软件包失败" - - # 设置安装标志 - need_uninstall=1 - else - LOG_INFO "软件包已安装,无需重新安装" - need_uninstall=0 - fi - - # 测试luajittex命令的--help参数 - LOG_INFO "测试luajittex命令的--help参数" - luajittex --help > /dev/null 2>&1 - CHECK_RESULT $? 0 0 "luajittex命令不支持--help参数或执行失败" - - # 测试texluajit命令的--help参数 - LOG_INFO "测试texluajit命令的--help参数" - texluajit --help > /dev/null 2>&1 - CHECK_RESULT $? 0 0 "texluajit命令不支持--help参数或执行失败" - - # 环境恢复 - if [ $need_uninstall -eq 1 ]; then - LOG_INFO "卸载测试安装的软件包" - dnf remove -y texlive-luajittex texluajit - CHECK_RESULT $? 0 0 "卸载texlive-luajittex和texluajit软件包失败" - else - LOG_INFO "保持软件包安装状态" - fi - - LOG_INFO "测试完成" -} - -main "$@" \ No newline at end of file diff --git a/testcases/function_test/pkg_test/texlive-base/texlive-luajittex/test_texlive-luajittex_texluajit_ini.sh b/testcases/function_test/pkg_test/texlive-base/texlive-luajittex/test_texlive-luajittex_texluajit_ini.sh deleted file mode 100644 index 239990b2801..00000000000 --- a/testcases/function_test/pkg_test/texlive-base/texlive-luajittex/test_texlive-luajittex_texluajit_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-04 -# @License : Mulan PSL v2 -# @Desc : 测试使用--ini参数进入iniluajittex模式,用于转储格式文件 -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - # 判断是否已安装texlive-luajittex和texlive-luajit - LOG_INFO "检查是否已安装texlive-luajittex和texlive-luajit软件包" - rpm -q texlive-luajittex texlive-luajit >/dev/null 2>&1 - if [ $? -eq 0 ]; then - LOG_INFO "软件包已安装,标记为已存在安装状态" - INSTALLED="true" - else - LOG_INFO "软件包未安装,标记为未安装状态" - INSTALLED="false" - fi - - # 检查yum源中是否存在软件包 - LOG_INFO "检查yum源中是否存在texlive-luajittex和texlive-luajit软件包" - dnf list available texlive-luajittex texlive-luajit >/dev/null 2>&1 - if [ $? -ne 0 ]; then - LOG_ERROR "yum源中未找到texlive-luajittex或texlive-luajit软件包" - exit 255 - fi - - # 如果未安装,则安装软件包 - if [ "${INSTALLED}" = "false" ]; then - LOG_INFO "开始安装texlive-luajittex和texlive-luajit软件包" - dnf install -y texlive-luajittex texlive-luajit - CHECK_RESULT $? 0 0 "安装texlive-luajittex和texlive-luajit软件包失败" - LOG_INFO "软件包安装成功" - fi - - # 测试--ini参数进入iniluajittex模式 - LOG_INFO "测试使用--ini参数进入iniluajittex模式,用于转储格式文件" - luajittex --ini --help >/dev/null 2>&1 - CHECK_RESULT $? 0 0 "luajittex不支持--ini参数" - LOG_INFO "luajittex支持--ini参数" - - # 创建测试文件 - LOG_INFO "创建测试文件test.tex" - cat > test.tex << "EOF" - \documentclass{article} - \begin{document} - Hello, LuaJITTeX! - \end{document} - EOF - CHECK_RESULT $? 0 0 "创建测试文件失败" - - # 使用--ini参数运行luajittex - LOG_INFO "使用--ini参数运行luajittex处理测试文件" - luajittex --ini test.tex > output.log 2>&1 - CHECK_RESULT $? 0 0 "luajittex --ini执行失败" - LOG_INFO "luajittex --ini执行成功" - - # 检查输出文件 - LOG_INFO "检查是否生成test.fmt文件" - if [ -f "test.fmt" ]; then - LOG_INFO "成功生成test.fmt文件" - else - LOG_ERROR "未生成test.fmt文件" - exit 1 - fi - - # 清理测试文件 - LOG_INFO "清理测试文件" - rm -f test.tex test.fmt output.log test.log - CHECK_RESULT $? 0 0 "清理测试文件失败" - - # 如果最初未安装,则卸载软件包 - if [ "${INSTALLED}" = "false" ]; then - LOG_INFO "卸载texlive-luajittex和texlive-luajit软件包" - dnf remove -y texlive-luajittex texlive-luajit - CHECK_RESULT $? 0 0 "卸载texlive-luajittex和texlive-luajit软件包失败" - 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-luajittex/test_texlive-luajittex_texluajit_jithash_string.sh b/testcases/function_test/pkg_test/texlive-base/texlive-luajittex/test_texlive-luajittex_texluajit_jithash_string.sh deleted file mode 100644 index 83fa5885374..00000000000 --- a/testcases/function_test/pkg_test/texlive-base/texlive-luajittex/test_texlive-luajittex_texluajit_jithash_string.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-04 -# @License : Mulan PSL v2 -# @Desc : 测试使用--jithash参数为Lua字符串选择哈希函数(lua51或luajit20) -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - # 定义软件包名称 - PACKAGE_NAME="texlive-luajittex" - SUB_PACKAGE="texluajit" - - # 步骤1:检查yum源中是否存在指定软件包 - LOG_INFO "检查yum源中是否存在软件包: ${PACKAGE_NAME}" - dnf list available ${PACKAGE_NAME} &> /dev/null - if [ $? -ne 0 ]; then - LOG_ERROR "yum源中不存在软件包: ${PACKAGE_NAME}" - exit 255 - fi - - # 步骤2:检查系统是否已安装指定软件包 - LOG_INFO "检查系统是否已安装软件包: ${PACKAGE_NAME}" - if rpm -q ${PACKAGE_NAME} &> /dev/null; then - LOG_INFO "软件包已安装,跳过安装步骤" - INSTALLED="true" - else - LOG_INFO "软件包未安装,开始安装" - INSTALLED="false" - dnf install -y ${PACKAGE_NAME} - CHECK_RESULT $? 0 0 "安装软件包失败" - fi - - # 步骤3:验证texluajit命令是否存在 - LOG_INFO "验证texluajit命令是否存在" - command -v texluajit &> /dev/null - CHECK_RESULT $? 0 0 "texluajit命令不存在" - - # 步骤4:测试--jithash参数支持情况 - LOG_INFO "测试--jithash参数支持情况" - texluajit --help | grep -q "\-\-jithash" - if [ $? -ne 0 ]; then - LOG_ERROR "texluajit命令不支持--jithash参数" - # 如果之前未安装,需要卸载 - if [ "$INSTALLED" = "false" ]; then - LOG_INFO "清理安装的软件包" - dnf remove -y ${PACKAGE_NAME} - CHECK_RESULT $? 0 0 "卸载软件包失败" - fi - exit 255 - fi - - # 步骤5:测试使用--jithash参数为Lua字符串选择哈希函数lua51 - LOG_INFO "测试使用--jithash参数为Lua字符串选择哈希函数lua51" - texluajit --jithash=lua51 -e "print("test lua51 hash")" 2>&1 | grep -q "test lua51 hash" - CHECK_RESULT $? 0 0 "使用--jithash=lua51参数执行失败" - - # 步骤6:测试使用--jithash参数为Lua字符串选择哈希函数luajit20 - LOG_INFO "测试使用--jithash参数为Lua字符串选择哈希函数luajit20" - texluajit --jithash=luajit20 -e "print("test luajit20 hash")" 2>&1 | grep -q "test luajit20 hash" - CHECK_RESULT $? 0 0 "使用--jithash=luajit20参数执行失败" - - # 步骤7:测试无效的--jithash参数值 - LOG_INFO "测试无效的--jithash参数值" - texluajit --jithash=invalid -e "print("test")" 2>&1 | grep -q "invalid hash" - CHECK_RESULT $? 0 0 "无效的--jithash参数值未按预期失败" - - # 步骤8:环境恢复 - LOG_INFO "开始环境恢复" - if [ "$INSTALLED" = "false" ]; then - LOG_INFO "卸载测试安装的软件包" - dnf remove -y ${PACKAGE_NAME} - CHECK_RESULT $? 0 0 "卸载软件包失败" - else - LOG_INFO "保持原有安装状态,无需卸载" - fi - - LOG_INFO "测试完成" -} - -main "$@" \ No newline at end of file diff --git a/testcases/function_test/pkg_test/texlive-base/texlive-luajittex/test_texlive-luajittex_texluajit_jiton.sh b/testcases/function_test/pkg_test/texlive-base/texlive-luajittex/test_texlive-luajittex_texluajit_jiton.sh deleted file mode 100644 index be2763bafe8..00000000000 --- a/testcases/function_test/pkg_test/texlive-base/texlive-luajittex/test_texlive-luajittex_texluajit_jiton.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-04 -# @License : Mulan PSL v2 -# @Desc : 测试使用--jiton参数打开JIT编译器(默认为关闭) -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - # 检查是否已安装texlive-luajittex和texluajit - LOG_INFO "检查texlive-luajittex和texluajit是否已安装" - rpm -q texlive-luajittex texluajit > /dev/null 2>&1 - if [ $? -eq 0 ]; then - LOG_INFO "texlive-luajittex和texluajit已安装,测试结束后保持安装状态" - INSTALLED=true - else - LOG_INFO "texlive-luajittex和texluajit未安装,将在测试前安装" - INSTALLED=false - fi - - # 检查yum源中是否有texlive-luajittex和texluajit软件包 - LOG_INFO "检查yum源中是否有texlive-luajittex和texluajit软件包" - dnf list available texlive-luajittex texluajit > /dev/null 2>&1 - CHECK_RESULT $? 0 0 "yum源中没有texlive-luajittex或texluajit软件包" - if [ $? -ne 0 ]; then - LOG_ERROR "yum源中没有texlive-luajittex或texluajit软件包" - exit 255 - fi - - # 如果未安装,则安装软件包 - if [ "$INSTALLED" = false ]; then - LOG_INFO "安装texlive-luajittex和texluajit软件包" - dnf install -y texlive-luajittex texluajit - CHECK_RESULT $? 0 0 "安装texlive-luajittex和texluajit失败" - fi - - # 检查texluajit命令是否支持--jiton参数 - LOG_INFO "检查texluajit命令是否支持--jiton参数" - texluajit --help 2>&1 | grep -q -- "--jiton" - CHECK_RESULT $? 0 0 "texluajit命令不支持--jiton参数" - if [ $? -ne 0 ]; then - LOG_ERROR "texluajit命令不支持--jiton参数" - # 如果之前未安装,需要卸载已安装的软件包 - if [ "$INSTALLED" = false ]; then - LOG_INFO "卸载texlive-luajittex和texluajit软件包" - dnf remove -y texlive-luajittex texluajit - fi - exit 255 - fi - - # 测试使用--jiton参数打开JIT编译器 - LOG_INFO "测试使用--jiton参数打开JIT编译器" - texluajit --jiton --version > /dev/null 2>&1 - CHECK_RESULT $? 0 0 "使用--jiton参数执行texluajit失败" - - # 清理环境:如果测试前未安装,则卸载软件包 - if [ "$INSTALLED" = false ]; then - LOG_INFO "卸载texlive-luajittex和texluajit软件包" - dnf remove -y texlive-luajittex texluajit - CHECK_RESULT $? 0 0 "卸载texlive-luajittex和texluajit失败" - fi - - LOG_INFO "测试完成" -} - -main "$@" \ No newline at end of file diff --git a/testcases/function_test/pkg_test/texlive-base/texlive-luajittex/test_texlive-luajittex_texluajit_jobname_string.sh b/testcases/function_test/pkg_test/texlive-base/texlive-luajittex/test_texlive-luajittex_texluajit_jobname_string.sh deleted file mode 100644 index c18cbec31cc..00000000000 --- a/testcases/function_test/pkg_test/texlive-base/texlive-luajittex/test_texlive-luajittex_texluajit_jobname_string.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-04 -# @License : Mulan PSL v2 -# @Desc : 测试使用--jobname参数设置作业名称 -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - # 判断是否已安装texlive-luajittex和texluajit - LOG_INFO "检查是否已安装texlive-luajittex和texluajit" - if dnf list installed texlive-luajittex &> /dev/null && dnf list installed texluajit &> /dev/null; then - LOG_INFO "texlive-luajittex和texluajit已安装,脚本结束后将保持安装状态" - ALREADY_INSTALLED=1 - else - LOG_INFO "texlive-luajittex和texluajit未安装,将在测试过程中安装" - ALREADY_INSTALLED=0 - fi - - # 检查yum源中是否存在软件包 - LOG_INFO "检查yum源中是否存在texlive-luajittex和texluajit" - if ! dnf list available texlive-luajittex &> /dev/null; then - LOG_ERROR "yum源中不存在texlive-luajittex软件包" - exit 255 - fi - if ! dnf list available texluajit &> /dev/null; then - LOG_ERROR "yum源中不存在texluajit软件包" - exit 255 - fi - - # 如果未安装,则安装软件包 - if [ $ALREADY_INSTALLED -eq 0 ]; then - LOG_INFO "安装texlive-luajittex和texluajit" - dnf install -y texlive-luajittex texluajit - CHECK_RESULT $? 0 0 "安装texlive-luajittex和texluajit失败" - fi - - # 测试--jobname参数设置作业名称 - LOG_INFO "测试使用--jobname参数设置作业名称" - # 创建一个简单的LaTeX测试文件 - cat > test_jobname.tex << "EOF" - \documentclass{article} - \begin{document} - Hello, World! - \end{document} - EOF - - # 使用luajittex编译,并设置作业名称 - luajittex --jobname=myjob test_jobname.tex - CHECK_RESULT $? 0 0 "使用--jobname参数执行luajittex失败" - - # 检查是否生成了名为myjob的作业文件 - LOG_INFO "检查是否生成了名为myjob的作业文件" - if [ -f "myjob.log" ]; then - LOG_INFO "成功生成了作业文件myjob.log" - else - LOG_ERROR "未生成作业文件myjob.log" - exit 1 - fi - - # 清理生成的测试文件 - LOG_INFO "清理生成的测试文件" - rm -f test_jobname.tex myjob.aux myjob.log myjob.pdf - - # 如果脚本开始时未安装,则在结束时卸载软件包 - if [ $ALREADY_INSTALLED -eq 0 ]; then - LOG_INFO "卸载texlive-luajittex和texluajit" - dnf remove -y texlive-luajittex texluajit - CHECK_RESULT $? 0 0 "卸载texlive-luajittex和texluajit失败" - fi - - LOG_INFO "测试完成" -} - -main "$@" \ No newline at end of file diff --git a/testcases/function_test/pkg_test/texlive-base/texlive-luajittex/test_texlive-luajittex_texluajit_lua_file.sh b/testcases/function_test/pkg_test/texlive-base/texlive-luajittex/test_texlive-luajittex_texluajit_lua_file.sh deleted file mode 100644 index 4ee9d25f0bc..00000000000 --- a/testcases/function_test/pkg_test/texlive-base/texlive-luajittex/test_texlive-luajittex_texluajit_lua_file.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-04 -# @License : Mulan PSL v2 -# @Desc : 测试使用--lua参数指定Lua初始化脚本文件执行LuajitTeX -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - LOG_INFO "开始测试:测试使用--lua参数指定Lua初始化脚本文件执行LuajitTeX" - - LOG_INFO "步骤1: 检查yum源中是否存在texlive-luajittex和texluajit软件包" - dnf list available texlive-luajittex texluajit > /dev/null 2>&1 - if [ $? -ne 0 ]; then - LOG_ERROR "yum源中未找到texlive-luajittex或texluajit软件包" - exit 255 - fi - - LOG_INFO "步骤2: 检查当前环境是否已安装texlive-luajittex和texluajit" - rpm -q texlive-luajittex texluajit > /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-luajittex和texluajit软件包" - dnf install -y texlive-luajittex texluajit - CHECK_RESULT $? 0 0 "安装texlive-luajittex和texluajit失败" - fi - - LOG_INFO "步骤4: 创建一个简单的Lua初始化脚本文件用于测试" - cat > test_init.lua << "EOF" - print("Hello from Lua init script!") - EOF - CHECK_RESULT $? 0 0 "创建Lua初始化脚本文件失败" - - LOG_INFO "步骤5: 使用--lua参数指定Lua初始化脚本文件执行luajittex命令" - luajittex --lua=test_init.lua --version > /dev/null 2>&1 - CHECK_RESULT $? 0 0 "使用--lua参数执行luajittex失败" - - LOG_INFO "步骤6: 测试--lua参数指定的文件不存在时的情况" - luajittex --lua=nonexistent.lua --version > /dev/null 2>&1 - if [ $? -eq 255 ]; then - LOG_INFO "参数检查正确:当指定不存在的Lua文件时,命令按预期失败" - else - LOG_ERROR "参数检查失败:当指定不存在的Lua文件时,命令未按预期失败" - exit 255 - fi - - LOG_INFO "步骤7: 清理测试过程中创建的临时文件" - rm -f test_init.lua - CHECK_RESULT $? 0 0 "删除临时文件失败" - - if [ "$INSTALLED" = "false" ]; then - LOG_INFO "步骤8: 卸载测试过程中安装的软件包" - dnf remove -y texlive-luajittex texluajit - CHECK_RESULT $? 0 0 "卸载texlive-luajittex和texluajit失败" - else - LOG_INFO "步骤8: 测试前软件包已安装,跳过卸载步骤" - fi - - LOG_INFO "测试完成:测试使用--lua参数指定Lua初始化脚本文件执行LuajitTeX成功" -} - -main "$@" \ No newline at end of file diff --git a/testcases/function_test/pkg_test/texlive-base/texlive-luajittex/test_texlive-luajittex_texluajit_luaconly.sh b/testcases/function_test/pkg_test/texlive-base/texlive-luajittex/test_texlive-luajittex_texluajit_luaconly.sh deleted file mode 100644 index 536adf66450..00000000000 --- a/testcases/function_test/pkg_test/texlive-base/texlive-luajittex/test_texlive-luajittex_texluajit_luaconly.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-04 -# @License : Mulan PSL v2 -# @Desc : 测试使用--luaconly参数字节编译Lua文件后退出 -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - LOG_INFO "开始测试texlive-luajittex软件包的--luaconly参数功能" - LOG_INFO "步骤1:检查yum源中是否存在texlive-luajittex软件包" - dnf list available texlive-luajittex 2>&1 | grep -q "texlive-luajittex" - if [ $? -ne 0 ]; then - LOG_ERROR "yum源中未找到texlive-luajittex软件包" - exit 255 - fi - - LOG_INFO "步骤2:检查系统是否已安装texlive-luajittex" - rpm -q texlive-luajittex > /dev/null 2>&1 - installed=$? - - if [ $installed -eq 0 ]; then - LOG_INFO "texlive-luajittex已安装,测试后保持安装状态" - else - LOG_INFO "texlive-luajittex未安装,将进行安装" - dnf install -y texlive-luajittex - CHECK_RESULT $? 0 0 "安装texlive-luajittex失败" - fi - - LOG_INFO "步骤3:创建测试Lua文件" - cat > test.lua << "EOF" - print("Hello from Lua") - EOF - CHECK_RESULT $? 0 0 "创建Lua文件失败" - - LOG_INFO "步骤4:检查luajittex命令是否支持--luaconly参数" - luajittex --help 2>&1 | grep -q -- "--luaconly" - if [ $? -ne 0 ]; then - LOG_ERROR "luajittex命令不支持--luaconly参数" - exit 255 - fi - - LOG_INFO "步骤5:使用--luaconly参数编译Lua文件" - luajittex --luaconly test.lua - CHECK_RESULT $? 0 0 "使用--luaconly参数编译Lua文件失败" - - LOG_INFO "步骤6:验证生成的字节码文件" - if [ -f "test.luac" ]; then - LOG_INFO "成功生成字节码文件test.luac" - else - LOG_ERROR "未生成字节码文件test.luac" - exit 1 - fi - - LOG_INFO "步骤7:清理测试文件" - rm -f test.lua test.luac - CHECK_RESULT $? 0 0 "清理测试文件失败" - - if [ $installed -ne 0 ]; then - LOG_INFO "步骤8:卸载texlive-luajittex软件包" - dnf remove -y texlive-luajittex - CHECK_RESULT $? 0 0 "卸载texlive-luajittex失败" - fi - - LOG_INFO "测试完成" -} - -main "$@" \ No newline at end of file diff --git a/testcases/function_test/pkg_test/texlive-base/texlive-luajittex/test_texlive-luajittex_texluajit_luaonly.sh b/testcases/function_test/pkg_test/texlive-base/texlive-luajittex/test_texlive-luajittex_texluajit_luaonly.sh deleted file mode 100644 index e1c6b57a231..00000000000 --- a/testcases/function_test/pkg_test/texlive-base/texlive-luajittex/test_texlive-luajittex_texluajit_luaonly.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-04 -# @License : Mulan PSL v2 -# @Desc : 测试使用--luaonly参数运行Lua文件后退出 -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - LOG_INFO "开始测试 texlive-luajittex 软件包" - LOG_INFO "检查软件包是否已在yum源中" - dnf list available texlive-luajittex 2>/dev/null | grep -q texlive-luajittex - if [ $? -ne 0 ]; then - LOG_ERROR "yum源中未找到 texlive-luajittex 软件包" - exit 255 - fi - - LOG_INFO "检查当前环境是否已安装 texlive-luajittex" - rpm -q texlive-luajittex > /dev/null 2>&1 - if [ $? -eq 0 ]; then - LOG_INFO "texlive-luajittex 已安装,测试结束后将保持安装状态" - ALREADY_INSTALLED=1 - else - LOG_INFO "texlive-luajittex 未安装,将安装软件包作为测试步骤" - ALREADY_INSTALLED=0 - fi - - if [ $ALREADY_INSTALLED -eq 0 ]; then - LOG_INFO "安装 texlive-luajittex 软件包" - dnf install -y texlive-luajittex - CHECK_RESULT $? 0 0 "安装 texlive-luajittex 失败" - fi - - LOG_INFO "检查 texlua 命令是否支持 --luaonly 参数" - texlua --help 2>&1 | grep -q -- "--luaonly" - if [ $? -ne 0 ]; then - LOG_ERROR "texlua 命令不支持 --luaonly 参数" - exit 255 - fi - - LOG_INFO "创建测试用的 Lua 文件" - cat > test_luaonly.lua << "EOF" - print("Hello from Lua") - os.exit(0) - EOF - CHECK_RESULT $? 0 0 "创建 Lua 文件失败" - - LOG_INFO "测试使用 --luaonly 参数运行 Lua 文件" - texlua --luaonly test_luaonly.lua - CHECK_RESULT $? 0 0 "使用 --luaonly 参数运行 Lua 文件失败" - - LOG_INFO "清理测试文件" - rm -f test_luaonly.lua - CHECK_RESULT $? 0 0 "删除测试文件失败" - - if [ $ALREADY_INSTALLED -eq 0 ]; then - LOG_INFO "卸载 texlive-luajittex 软件包" - dnf remove -y texlive-luajittex - CHECK_RESULT $? 0 0 "卸载 texlive-luajittex 失败" - else - LOG_INFO "测试开始前 texlive-luajittex 已安装,保持安装状态" - fi - - LOG_INFO "测试完成" -} - -main "$@" \ No newline at end of file diff --git a/testcases/function_test/pkg_test/texlive-base/texlive-luajittex/test_texlive-luajittex_texluajit_safer.sh b/testcases/function_test/pkg_test/texlive-base/texlive-luajittex/test_texlive-luajittex_texluajit_safer.sh deleted file mode 100644 index 50242117eea..00000000000 --- a/testcases/function_test/pkg_test/texlive-base/texlive-luajittex/test_texlive-luajittex_texluajit_safer.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-04 -# @License : Mulan PSL v2 -# @Desc : 测试使用--safer参数禁用易受攻击的Lua命令 -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - LOG_INFO "开始测试:测试使用--safer参数禁用易受攻击的Lua命令" - LOG_INFO "步骤1:检查yum源中是否存在texlive-luajittex和texluajit软件包" - dnf list texlive-luajittex texluajit > /dev/null 2>&1 - if [ $? -ne 0 ]; then - LOG_ERROR "yum源中不存在texlive-luajittex或texluajit软件包" - exit 255 - fi - LOG_INFO "步骤2:检查是否已安装texlive-luajittex和texluajit" - if rpm -q texlive-luajittex texluajit > /dev/null 2>&1; then - LOG_INFO "软件包已安装,测试后保持安装状态" - INSTALLED=1 - else - LOG_INFO "软件包未安装,将在测试后卸载" - INSTALLED=0 - LOG_INFO "步骤3:安装texlive-luajittex和texluajit软件包" - dnf install -y texlive-luajittex texluajit - CHECK_RESULT $? 0 0 "安装texlive-luajittex和texluajit失败" - fi - LOG_INFO "步骤4:检查luajittex命令是否支持--safer参数" - luajittex --help 2>&1 | grep -q -- "--safer" - if [ $? -ne 0 ]; then - LOG_ERROR "luajittex命令不支持--safer参数" - if [ $INSTALLED -eq 0 ]; then - LOG_INFO "步骤5:卸载安装的软件包" - dnf remove -y texlive-luajittex texluajit - CHECK_RESULT $? 0 0 "卸载texlive-luajittex和texluajit失败" - fi - exit 255 - fi - LOG_INFO "步骤6:创建一个测试Lua文件,包含易受攻击的命令" - cat > test_vulnerable.lua << "EOF" - local f = io.popen("echo "This is a vulnerable command"", "r") - local result = f:read("*a") - f:close() - print(result) - EOF - CHECK_RESULT $? 0 0 "创建测试Lua文件失败" - LOG_INFO "步骤7:使用--safer参数运行luajittex,预期执行失败" - luajittex --safer test_vulnerable.lua 2>&1 | grep -q "disabled" - CHECK_RESULT $? 0 0 "使用--safer参数时,易受攻击的Lua命令未被禁用" - LOG_INFO "步骤8:清理测试文件" - rm -f test_vulnerable.lua - CHECK_RESULT $? 0 0 "删除测试文件失败" - if [ $INSTALLED -eq 0 ]; then - LOG_INFO "步骤9:卸载安装的软件包" - dnf remove -y texlive-luajittex texluajit - CHECK_RESULT $? 0 0 "卸载texlive-luajittex和texluajit失败" - fi - LOG_INFO "测试完成:--safer参数成功禁用易受攻击的Lua命令" -} - -main "$@" \ No newline at end of file diff --git a/testcases/function_test/pkg_test/texlive-base/texlive-luajittex/test_texlive-luajittex_texluajit_shell_escape.sh b/testcases/function_test/pkg_test/texlive-base/texlive-luajittex/test_texlive-luajittex_texluajit_shell_escape.sh deleted file mode 100644 index bf54626872a..00000000000 --- a/testcases/function_test/pkg_test/texlive-base/texlive-luajittex/test_texlive-luajittex_texluajit_shell_escape.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-04 -# @License : Mulan PSL v2 -# @Desc : 测试使用--shell-escape参数启用系统命令 -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - LOG_INFO "开始测试:使用--shell-escape参数启用系统命令" - LOG_INFO "步骤一:检查软件包texlive-luajittex是否在yum源中" - dnf list available texlive-luajittex &>/dev/null - if [ $? -ne 0 ]; then - LOG_ERROR "软件包texlive-luajittex不在yum源中" - exit 255 - fi - LOG_INFO "软件包texlive-luajittex在yum源中" - - LOG_INFO "步骤二:检查环境是否已安装texlive-luajittex" - rpm -q texlive-luajittex &>/dev/null - if [ $? -eq 0 ]; then - LOG_INFO "环境已安装texlive-luajittex,脚本结束将保持安装状态" - INSTALLED=1 - else - LOG_INFO "环境未安装texlive-luajittex,将进行安装" - INSTALLED=0 - fi - - if [ $INSTALLED -eq 0 ]; then - LOG_INFO "步骤三:安装texlive-luajittex" - dnf install -y texlive-luajittex - CHECK_RESULT $? 0 0 "安装texlive-luajittex失败" - fi - - LOG_INFO "步骤四:检查luajittex命令是否支持--shell-escape参数" - luajittex --help 2>&1 | grep -q "\-\-shell\-escape" - if [ $? -ne 0 ]; then - LOG_ERROR "luajittex命令不支持--shell-escape参数" - if [ $INSTALLED -eq 0 ]; then - LOG_INFO "清理环境:卸载texlive-luajittex" - dnf remove -y texlive-luajittex - fi - exit 255 - fi - LOG_INFO "luajittex命令支持--shell-escape参数" - - LOG_INFO "步骤五:创建一个简单的LaTeX测试文件" - cat > test_shell_escape.tex << "EOF" - \documentclass{article} - \begin{document} - Hello, World! - \end{document} - EOF - CHECK_RESULT $? 0 0 "创建LaTeX测试文件失败" - - LOG_INFO "步骤六:使用--shell-escape参数执行luajittex命令" - luajittex --shell-escape test_shell_escape.tex - CHECK_RESULT $? 0 0 "使用--shell-escape参数执行luajittex失败" - - LOG_INFO "步骤七:清理测试文件" - rm -f test_shell_escape.tex test_shell_escape.log test_shell_escape.aux - - if [ $INSTALLED -eq 0 ]; then - LOG_INFO "步骤八:清理环境,卸载texlive-luajittex" - dnf remove -y texlive-luajittex - CHECK_RESULT $? 0 0 "卸载texlive-luajittex失败" - fi - - LOG_INFO "测试完成:使用--shell-escape参数启用系统命令测试通过" -} - -main "$@" \ No newline at end of file diff --git a/testcases/function_test/pkg_test/texlive-base/texlive-luajittex/test_texlive-luajittex_texluajit_shell_restricted.sh b/testcases/function_test/pkg_test/texlive-base/texlive-luajittex/test_texlive-luajittex_texluajit_shell_restricted.sh deleted file mode 100644 index 2ae39c621f5..00000000000 --- a/testcases/function_test/pkg_test/texlive-base/texlive-luajittex/test_texlive-luajittex_texluajit_shell_restricted.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-04 -# @License : Mulan PSL v2 -# @Desc : 测试使用--shell-restricted参数将系统命令限制在texmf.cnf中给出的命令列表内 -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - # 检查是否已安装texlive-luajittex和texluajit软件包 - LOG_INFO "检查是否已安装texlive-luajittex和texluajit软件包" - rpm -q texlive-luajittex texluajit > /dev/null 2>&1 - if [ $? -eq 0 ]; then - LOG_INFO "软件包已安装,标记为已安装状态" - INSTALLED=1 - else - LOG_INFO "软件包未安装,标记为未安装状态" - INSTALLED=0 - fi - - # 检查yum源中是否存在texlive-luajittex和texluajit软件包 - LOG_INFO "检查yum源中是否存在texlive-luajittex和texluajit软件包" - dnf list available texlive-luajittex texluajit > /dev/null 2>&1 - if [ $? -ne 0 ]; then - LOG_ERROR "yum源中不存在texlive-luajittex或texluajit软件包" - exit 255 - fi - - # 如果未安装,则安装软件包 - if [ $INSTALLED -eq 0 ]; then - LOG_INFO "开始安装texlive-luajittex和texluajit软件包" - dnf install -y texlive-luajittex texluajit - CHECK_RESULT $? 0 0 "安装texlive-luajittex和texluajit软件包失败" - LOG_INFO "安装texlive-luajittex和texluajit软件包成功" - fi - - # 检查luajittex命令是否支持--shell-restricted参数 - LOG_INFO "检查luajittex命令是否支持--shell-restricted参数" - luajittex --help 2>&1 | grep -q "\-\-shell-restricted" - if [ $? -ne 0 ]; then - LOG_ERROR "luajittex命令不支持--shell-restricted参数" - exit 255 - fi - LOG_INFO "luajittex命令支持--shell-restricted参数" - - # 创建一个简单的LaTeX测试文件 - LOG_INFO "创建测试LaTeX文件" - cat > test.tex << "EOF" - \documentclass{article} - \begin{document} - Hello, world! - \end{document} - EOF - CHECK_RESULT $? 0 0 "创建测试LaTeX文件失败" - - # 使用--shell-restricted参数运行luajittex - LOG_INFO "使用--shell-restricted参数运行luajittex" - luajittex --shell-restricted test.tex - CHECK_RESULT $? 0 0 "使用--shell-restricted参数运行luajittex失败" - LOG_INFO "使用--shell-restricted参数运行luajittex成功" - - # 检查生成的PDF文件 - LOG_INFO "检查是否生成PDF文件" - if [ -f test.pdf ]; then - LOG_INFO "成功生成PDF文件" - rm -f test.pdf - else - LOG_ERROR "未生成PDF文件" - exit 1 - fi - - # 清理测试文件 - LOG_INFO "清理测试文件" - rm -f test.tex test.log test.aux - - # 如果测试前未安装,则卸载软件包 - if [ $INSTALLED -eq 0 ]; then - LOG_INFO "卸载texlive-luajittex和texluajit软件包" - dnf remove -y texlive-luajittex texluajit - CHECK_RESULT $? 0 0 "卸载texlive-luajittex和texluajit软件包失败" - LOG_INFO "卸载texlive-luajittex和texluajit软件包成功" - else - LOG_INFO "测试前软件包已安装,保持安装状态" - fi - - LOG_INFO "测试完成" -} - -main "$@" \ No newline at end of file diff --git a/testcases/function_test/pkg_test/texlive-base/texlive-luajittex/test_texlive-luajittex_texluajit_synctex_number.sh b/testcases/function_test/pkg_test/texlive-base/texlive-luajittex/test_texlive-luajittex_texluajit_synctex_number.sh deleted file mode 100644 index 1f295efa1e4..00000000000 --- a/testcases/function_test/pkg_test/texlive-base/texlive-luajittex/test_texlive-luajittex_texluajit_synctex_number.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-04 -# @License : Mulan PSL v2 -# @Desc : 测试使用--synctex参数启用SyncTeX同步 -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - # 判断是否已经安装texlive-luajittex和texluajit - LOG_INFO "检查是否已安装texlive-luajittex和texluajit" - rpm -q texlive-luajittex texluajit > /dev/null 2>&1 - if [ $? -eq 0 ]; then - LOG_INFO "texlive-luajittex和texluajit已安装,测试结束后保持安装状态" - INSTALLED=1 - else - LOG_INFO "texlive-luajittex和texluajit未安装,将在测试前安装" - INSTALLED=0 - fi - - # 检查yum源中是否有texlive-luajittex和texluajit软件包 - LOG_INFO "检查yum源中是否有texlive-luajittex和texluajit软件包" - dnf list available texlive-luajittex texluajit > /dev/null 2>&1 - if [ $? -ne 0 ]; then - LOG_ERROR "yum源中没有texlive-luajittex或texluajit软件包" - exit 255 - fi - - # 如果未安装,则安装软件包 - if [ $INSTALLED -eq 0 ]; then - LOG_INFO "安装texlive-luajittex和texluajit软件包" - dnf install -y texlive-luajittex texluajit - CHECK_RESULT $? 0 0 "安装texlive-luajittex和texluajit失败" - fi - - # 检查luajittex命令是否支持--synctex参数 - LOG_INFO "检查luajittex命令是否支持--synctex参数" - luajittex --help 2>&1 | grep -q -- "--synctex" - if [ $? -ne 0 ]; then - LOG_ERROR "luajittex命令不支持--synctex参数" - if [ $INSTALLED -eq 0 ]; then - LOG_INFO "卸载texlive-luajittex和texluajit软件包" - dnf remove -y texlive-luajittex texluajit - fi - exit 255 - fi - - # 创建一个简单的LaTeX测试文件 - LOG_INFO "创建LaTeX测试文件" - cat > test_synctex.tex << "EOF" - \documentclass{article} - \begin{document} - Hello, SyncTeX! - \end{document} - EOF - CHECK_RESULT $? 0 0 "创建测试文件失败" - - # 使用--synctex参数编译LaTeX文件 - LOG_INFO "使用--synctex参数编译LaTeX文件" - luajittex --synctex=1 test_synctex.tex - CHECK_RESULT $? 0 0 "使用--synctex参数编译失败" - - # 检查是否生成了.synctex文件 - LOG_INFO "检查是否生成了.synctex文件" - if [ -f test_synctex.synctex.gz ]; then - LOG_INFO "成功生成.synctex文件" - else - LOG_ERROR "未生成.synctex文件" - if [ $INSTALLED -eq 0 ]; then - LOG_INFO "卸载texlive-luajittex和texluajit软件包" - dnf remove -y texlive-luajittex texluajit - fi - exit 1 - fi - - # 清理测试文件 - LOG_INFO "清理测试文件" - rm -f test_synctex.tex test_synctex.log test_synctex.aux test_synctex.synctex.gz - CHECK_RESULT $? 0 0 "清理测试文件失败" - - # 如果测试前未安装,则卸载软件包 - if [ $INSTALLED -eq 0 ]; then - LOG_INFO "卸载texlive-luajittex和texluajit软件包" - dnf remove -y texlive-luajittex texluajit - CHECK_RESULT $? 0 0 "卸载texlive-luajittex和texluajit失败" - fi - - LOG_INFO "测试完成" -} - -main "$@" \ No newline at end of file diff --git a/testcases/function_test/pkg_test/texlive-base/texlive-luajittex/test_texlive-luajittex_texluajit_utc.sh b/testcases/function_test/pkg_test/texlive-base/texlive-luajittex/test_texlive-luajittex_texluajit_utc.sh deleted file mode 100644 index b1e587fcb10..00000000000 --- a/testcases/function_test/pkg_test/texlive-base/texlive-luajittex/test_texlive-luajittex_texluajit_utc.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-04 -# @License : Mulan PSL v2 -# @Desc : 测试使用--utc参数将初始时间设置为UTC -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - # 测试使用--utc参数将初始时间设置为UTC - LOG_INFO "开始测试使用--utc参数将初始时间设置为UTC" - - # 检查环境是否已安装texlive-luajittex和texluajit - LOG_INFO "检查texlive-luajittex和texluajit是否已安装" - dnf list installed texlive-luajittex texluajit > /dev/null 2>&1 - if [ $? -eq 0 ]; then - LOG_INFO "texlive-luajittex和texluajit已安装,测试后保持安装状态" - installed_before=1 - else - LOG_INFO "texlive-luajittex和texluajit未安装,将在测试过程中安装" - installed_before=0 - fi - - # 检查yum源中是否有软件包 - LOG_INFO "检查yum源中是否有texlive-luajittex和texluajit" - dnf list available texlive-luajittex texluajit > /dev/null 2>&1 - if [ $? -ne 0 ]; then - LOG_ERROR "yum源中未找到texlive-luajittex或texluajit" - exit 255 - fi - - # 如果未安装,则安装软件包 - if [ $installed_before -eq 0 ]; then - LOG_INFO "安装texlive-luajittex和texluajit" - dnf install -y texlive-luajittex texluajit - CHECK_RESULT $? 0 0 "安装texlive-luajittex和texluajit失败" - fi - - # 测试luajittex命令是否支持--utc参数 - LOG_INFO "测试luajittex命令是否支持--utc参数" - luajittex --help | grep -q -- "--utc" - CHECK_RESULT $? 0 0 "luajittex命令不支持--utc参数" - - # 创建测试文件 - LOG_INFO "创建测试TeX文件" - cat > test_utc.tex << "EOF" - \documentclass{article} - \begin{document} - UTC test: \the\year-\the\month-\the\day - \end{document} - EOF - CHECK_RESULT $? 0 0 "创建测试文件失败" - - # 使用--utc参数执行luajittex - LOG_INFO "使用--utc参数执行luajittex" - luajittex --utc test_utc.tex - CHECK_RESULT $? 0 0 "luajittex执行失败" - - # 检查输出文件是否存在 - LOG_INFO "检查输出文件" - if [ -f test_utc.log ]; then - LOG_INFO "luajittex成功生成输出文件" - else - LOG_ERROR "未找到输出文件test_utc.log" - exit 1 - fi - - # 清理测试文件 - LOG_INFO "清理测试文件" - rm -f test_utc.tex test_utc.log test_utc.aux test_utc.dvi test_utc.synctex.gz - - # 如果测试前未安装,则卸载软件包 - if [ $installed_before -eq 0 ]; then - LOG_INFO "卸载texlive-luajittex和texluajit" - dnf remove -y texlive-luajittex texluajit - CHECK_RESULT $? 0 0 "卸载texlive-luajittex和texluajit失败" - fi - - LOG_INFO "测试完成" -} - -main "$@" \ No newline at end of file diff --git a/testcases/function_test/pkg_test/texlive-base/texlive-luajittex/test_texlive-luajittex_texluajit_version.sh b/testcases/function_test/pkg_test/texlive-base/texlive-luajittex/test_texlive-luajittex_texluajit_version.sh deleted file mode 100644 index 32d25e9a98c..00000000000 --- a/testcases/function_test/pkg_test/texlive-base/texlive-luajittex/test_texlive-luajittex_texluajit_version.sh +++ /dev/null @@ -1,74 +0,0 @@ -#!/usr/bin/bash - -# Copyright (c) 2024 ISCAS .ALL rights reserved. -# This program is licensed under Mulan PSL v2. -# You can use it according to the terms and conditions of the Mulan PSL v2. -# http://license.coscl.org.cn/MulanPSL2 -# THIS PROGRAM IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, -# EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, -# MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. -# See the Mulan PSL v2 for more details. - -# ############################################# -# @Author : honghua -# @Contact : honghua@iscas.ac.cn -# @Date : 2026-03-04 -# @License : Mulan PSL v2 -# @Desc : 测试使用--version参数显示版本信息并退出 -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - # 定义软件包名称 - PACKAGE_NAME="texlive-luajittex" - - # 步骤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 "安装软件包失败" - fi - - # 步骤4:检查命令参数是否存在 - LOG_INFO "检查texluajit命令是否支持--version参数" - if ! texluajit --help 2>&1 | grep -q -- "--version"; then - LOG_ERROR "texluajit命令不支持--version参数" - exit 255 - fi - - # 步骤5:执行测试命令 - LOG_INFO "执行测试命令:texluajit --version" - texluajit --version - CHECK_RESULT $? 0 0 "执行texluajit --version命令失败" - - # 步骤6:环境恢复 - if [ "${INSTALLED_BEFORE}" = "false" ]; then - LOG_INFO "卸载软件包:${PACKAGE_NAME}" - dnf remove -y "${PACKAGE_NAME}" - CHECK_RESULT $? 0 0 "卸载软件包失败" - else - LOG_INFO "软件包 ${PACKAGE_NAME} 在脚本执行前已安装,保持安装状态" - fi - - LOG_INFO "测试脚本执行完成" -} - -main "$@" \ No newline at end of file diff --git a/testcases/function_test/pkg_test/texlive-base/texlive-luajittex/test_texlive-luajittex_texluajitc_b.sh b/testcases/function_test/pkg_test/texlive-base/texlive-luajittex/test_texlive-luajittex_texluajitc_b.sh deleted file mode 100644 index a0838e31069..00000000000 --- a/testcases/function_test/pkg_test/texlive-base/texlive-luajittex/test_texlive-luajittex_texluajitc_b.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-04 -# @License : Mulan PSL v2 -# @Desc : 保存或列出字节码 -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - # 定义软件包名称 - PACKAGE_NAME="texlive-luajittex" - # 定义需要测试的命令 - TEST_COMMAND="texluajitc" - # 定义测试参数 - TEST_ARGS="-l" - - # 步骤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=true - else - LOG_INFO "软件包未安装,将进行安装和卸载" - INSTALLED=false - fi - - # 步骤3: 如果未安装,则安装软件包 - if [ "${INSTALLED}" = "false" ]; then - LOG_INFO "步骤3: 安装软件包" - dnf install -y ${PACKAGE_NAME} - CHECK_RESULT $? 0 0 "安装软件包失败" - fi - - # 步骤4: 检查命令是否存在 - LOG_INFO "步骤4: 检查命令是否存在" - which ${TEST_COMMAND} &>/dev/null - if [ $? -ne 0 ]; then - LOG_ERROR "命令 ${TEST_COMMAND} 不存在" - if [ "${INSTALLED}" = "false" ]; then - dnf remove -y ${PACKAGE_NAME} - fi - exit 255 - fi - - # 步骤5: 检查命令参数是否支持 - LOG_INFO "步骤5: 检查命令参数是否支持" - ${TEST_COMMAND} --help 2>&1 | grep -q "${TEST_ARGS}" - if [ $? -ne 0 ]; then - LOG_ERROR "命令 ${TEST_COMMAND} 不支持参数 ${TEST_ARGS}" - if [ "${INSTALLED}" = "false" ]; then - dnf remove -y ${PACKAGE_NAME} - fi - exit 255 - fi - - # 步骤6: 执行测试命令 - LOG_INFO "步骤6: 执行测试命令: ${TEST_COMMAND} ${TEST_ARGS}" - ${TEST_COMMAND} ${TEST_ARGS} - CHECK_RESULT $? 0 0 "执行命令失败" - - # 步骤7: 清理环境 - LOG_INFO "步骤7: 清理环境" - if [ "${INSTALLED}" = "false" ]; then - dnf remove -y ${PACKAGE_NAME} - CHECK_RESULT $? 0 0 "卸载软件包失败" - 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-luajittex/test_texlive-luajittex_texluajitc_e.sh b/testcases/function_test/pkg_test/texlive-base/texlive-luajittex/test_texlive-luajittex_texluajitc_e.sh deleted file mode 100644 index b9d21ce91f9..00000000000 --- a/testcases/function_test/pkg_test/texlive-base/texlive-luajittex/test_texlive-luajittex_texluajitc_e.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-04 -# @License : Mulan PSL v2 -# @Desc : 执行给定的Lua代码字符串 -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - # 检查环境是否已安装texlive-luajittex和texluajitc - LOG_INFO "检查texlive-luajittex和texluajitc是否已安装" - rpm -q texlive-luajittex texluajitc > /dev/null 2>&1 - if [ $? -eq 0 ]; then - LOG_INFO "texlive-luajittex和texluajitc已安装" - installed=true - else - LOG_INFO "texlive-luajittex和texluajitc未安装" - installed=false - fi - - # 检查yum源中是否有该软件包 - LOG_INFO "检查yum源中是否有texlive-luajittex和texluajitc软件包" - dnf list available texlive-luajittex texluajitc > /dev/null 2>&1 - CHECK_RESULT $? 0 0 "yum源中未找到texlive-luajittex或texluajitc软件包" - if [ $? -ne 0 ]; then - LOG_ERROR "yum源中未找到texlive-luajittex或texluajitc软件包" - exit 255 - fi - - # 如果未安装,则安装软件包 - if [ "$installed" = false ]; then - LOG_INFO "安装texlive-luajittex和texluajitc软件包" - dnf install -y texlive-luajittex texluajitc - CHECK_RESULT $? 0 0 "安装texlive-luajittex和texluajitc失败" - fi - - # 测试执行给定的Lua代码字符串 - LOG_INFO "测试执行给定的Lua代码字符串" - # 假设使用texluajitc命令执行Lua代码字符串,这里以示例命令为例 - # 实际命令可能需要根据texluajitc的具体用法调整 - texluajitc -e "print("Hello, Lua!")" > /tmp/test_output.txt 2>&1 - CHECK_RESULT $? 0 0 "执行Lua代码字符串失败" - - # 检查输出是否符合预期 - LOG_INFO "检查输出结果" - grep "Hello, Lua!" /tmp/test_output.txt > /dev/null 2>&1 - CHECK_RESULT $? 0 0 "输出结果不符合预期" - - # 清理临时文件 - LOG_INFO "清理临时文件" - rm -f /tmp/test_output.txt - - # 如果脚本开始时未安装,则在测试结束后卸载软件包 - if [ "$installed" = false ]; then - LOG_INFO "卸载texlive-luajittex和texluajitc软件包" - dnf remove -y texlive-luajittex texluajitc - CHECK_RESULT $? 0 0 "卸载texlive-luajittex和texluajitc失败" - fi - - LOG_INFO "测试脚本执行完成" -} - -main "$@" \ No newline at end of file diff --git a/testcases/function_test/pkg_test/texlive-base/texlive-luajittex/test_texlive-luajittex_texluajitc_i.sh b/testcases/function_test/pkg_test/texlive-base/texlive-luajittex/test_texlive-luajittex_texluajitc_i.sh deleted file mode 100644 index 9aa87cfaa73..00000000000 --- a/testcases/function_test/pkg_test/texlive-base/texlive-luajittex/test_texlive-luajittex_texluajitc_i.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-04 -# @License : Mulan PSL v2 -# @Desc : 执行脚本后进入交互模式 -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - # 环境检查:判断是否已安装软件包 - LOG_INFO "检查是否已安装 texlive-luajittex 和 texluajitc" - if rpm -q texlive-luajittex texluajitc > /dev/null 2>&1; then - LOG_INFO "软件包已安装,脚本结束后将保持安装状态" - INSTALLED=true - else - LOG_INFO "软件包未安装,将在测试中安装并在结束前卸载" - INSTALLED=false - fi - - # 检查yum源中是否存在软件包 - LOG_INFO "检查yum源中是否存在 texlive-luajittex 和 texluajitc" - if ! dnf list available texlive-luajittex texluajitc > /dev/null 2>&1; then - LOG_ERROR "yum源中不存在 texlive-luajittex 或 texluajitc" - exit 255 - fi - - # 如果未安装,则安装软件包 - if [ "$INSTALLED" = false ]; then - LOG_INFO "安装 texlive-luajittex 和 texluajitc" - dnf install -y texlive-luajittex texluajitc - CHECK_RESULT $? 0 0 "安装软件包失败" - fi - - # 测试进入交互模式 - LOG_INFO "执行 texlua 进入交互模式" - echo "print("Hello from LuaJIT")" | texlua - CHECK_RESULT $? 0 0 "texlua 交互模式执行失败" - - LOG_INFO "执行 luajittex 进入交互模式" - echo "\\relax" | luajittex --interaction=nonstopmode - CHECK_RESULT $? 0 0 "luajittex 交互模式执行失败" - - # 检查命令参数 - LOG_INFO "检查 luajittex 是否支持 --interaction 参数" - if ! luajittex --help 2>&1 | grep -q -- "--interaction"; then - LOG_ERROR "luajittex 不支持 --interaction 参数" - exit 255 - fi - - # 环境恢复:如果脚本开始时未安装,则卸载软件包 - if [ "$INSTALLED" = false ]; then - LOG_INFO "卸载 texlive-luajittex 和 texluajitc" - dnf remove -y texlive-luajittex texluajitc - 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-luajittex/test_texlive-luajittex_texluajitc_j.sh b/testcases/function_test/pkg_test/texlive-base/texlive-luajittex/test_texlive-luajittex_texluajitc_j.sh deleted file mode 100644 index 89fced15f4e..00000000000 --- a/testcases/function_test/pkg_test/texlive-base/texlive-luajittex/test_texlive-luajittex_texluajitc_j.sh +++ /dev/null @@ -1,137 +0,0 @@ -#!/usr/bin/bash - -# Copyright (c) 2024 ISCAS .ALL rights reserved. -# This program is licensed under Mulan PSL v2. -# You can use it according to the terms and conditions of the Mulan PSL v2. -# http://license.coscl.org.cn/MulanPSL2 -# THIS PROGRAM IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, -# EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, -# MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. -# See the Mulan PSL v2 for more details. - -# ############################################# -# @Author : honghua -# @Contact : honghua@iscas.ac.cn -# @Date : 2026-03-04 -# @License : Mulan PSL v2 -# @Desc : 执行LuaJIT控制命令 -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - # 测试脚本:执行LuaJIT控制命令 - LOG_INFO "开始测试LuaJIT控制命令功能" - - # 定义软件包名称 - PACKAGE_NAME="texlive-luajittex" - - # 步骤1:检查yum源中是否存在指定软件包 - LOG_INFO "步骤1:检查yum源中是否存在软件包 $PACKAGE_NAME" - dnf list available $PACKAGE_NAME > /dev/null 2>&1 - if [ $? -ne 0 ]; then - LOG_ERROR "软件包 $PACKAGE_NAME 在yum源中不存在" - exit 255 - fi - - # 步骤2:检查软件包是否已安装 - LOG_INFO "步骤2:检查软件包 $PACKAGE_NAME 是否已安装" - IS_INSTALLED=0 - rpm -q $PACKAGE_NAME > /dev/null 2>&1 - if [ $? -eq 0 ]; then - LOG_INFO "软件包 $PACKAGE_NAME 已安装" - IS_INSTALLED=1 - else - LOG_INFO "软件包 $PACKAGE_NAME 未安装" - IS_INSTALLED=0 - fi - - # 步骤3:如果未安装,则安装软件包 - if [ $IS_INSTALLED -eq 0 ]; then - LOG_INFO "步骤3:安装软件包 $PACKAGE_NAME" - dnf install -y $PACKAGE_NAME - CHECK_RESULT $? 0 0 "安装软件包 $PACKAGE_NAME 失败" - fi - - # 步骤4:检查texluajitc命令是否存在 - LOG_INFO "步骤4:检查texluajitc命令是否存在" - which texluajitc > /dev/null 2>&1 - if [ $? -ne 0 ]; then - LOG_ERROR "texluajitc命令不存在" - # 如果是新安装的,需要卸载 - if [ $IS_INSTALLED -eq 0 ]; then - dnf remove -y $PACKAGE_NAME - fi - exit 255 - fi - - # 步骤5:检查texluajitc命令是否支持--help参数 - LOG_INFO "步骤5:检查texluajitc命令是否支持--help参数" - texluajitc --help > /dev/null 2>&1 - if [ $? -ne 0 ]; then - LOG_ERROR "texluajitc命令不支持--help参数" - # 如果是新安装的,需要卸载 - if [ $IS_INSTALLED -eq 0 ]; then - dnf remove -y $PACKAGE_NAME - fi - exit 255 - fi - - # 步骤6:执行基本的LuaJIT控制命令测试 - LOG_INFO "步骤6:执行基本的LuaJIT控制命令测试" - texluajitc --version - CHECK_RESULT $? 0 0 "执行texluajitc --version失败" - - # 步骤7:测试简单的LuaJIT代码执行 - LOG_INFO "步骤7:测试简单的LuaJIT代码执行" - echo "print("Hello from LuaJIT")" > /tmp/test_luajit.lua - texluajitc /tmp/test_luajit.lua - CHECK_RESULT $? 0 0 "执行LuaJIT代码失败" - rm -f /tmp/test_luajit.lua - - # 步骤8:测试texluajitc命令的其他参数(如果存在) - LOG_INFO "步骤8:测试texluajitc命令的其他功能" - # 尝试执行一个不存在的文件,预期应该失败 - texluajitc /tmp/nonexistent_file.lua 2>/dev/null - if [ $? -eq 0 ]; then - LOG_ERROR "执行不存在的文件应该失败但成功了" - CHECK_RESULT 1 0 0 "参数检查失败" - else - LOG_INFO "执行不存在的文件正确失败" - CHECK_RESULT $? 0 1 "参数检查失败" - fi - - # 步骤9:环境恢复 - LOG_INFO "步骤9:环境恢复" - if [ $IS_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 - - # 步骤10:最终检查 - LOG_INFO "步骤10:最终环境检查" - if [ $IS_INSTALLED -eq 0 ]; then - rpm -q $PACKAGE_NAME > /dev/null 2>&1 - if [ $? -eq 0 ]; then - LOG_ERROR "环境恢复失败,软件包 $PACKAGE_NAME 仍然存在" - exit 1 - else - LOG_INFO "环境恢复成功,软件包 $PACKAGE_NAME 已卸载" - fi - else - rpm -q $PACKAGE_NAME > /dev/null 2>&1 - if [ $? -ne 0 ]; then - LOG_ERROR "环境恢复失败,软件包 $PACKAGE_NAME 被意外卸载" - exit 1 - else - LOG_INFO "环境恢复成功,软件包 $PACKAGE_NAME 保持安装状态" - fi - fi - - LOG_INFO "LuaJIT控制命令测试完成" -} - -main "$@" \ No newline at end of file diff --git a/testcases/function_test/pkg_test/texlive-base/texlive-luajittex/test_texlive-luajittex_texluajitc_l.sh b/testcases/function_test/pkg_test/texlive-base/texlive-luajittex/test_texlive-luajittex_texluajitc_l.sh deleted file mode 100644 index 9b3f0e0e120..00000000000 --- a/testcases/function_test/pkg_test/texlive-base/texlive-luajittex/test_texlive-luajittex_texluajitc_l.sh +++ /dev/null @@ -1,128 +0,0 @@ -#!/usr/bin/bash - -# Copyright (c) 2024 ISCAS .ALL rights reserved. -# This program is licensed under Mulan PSL v2. -# You can use it according to the terms and conditions of the Mulan PSL v2. -# http://license.coscl.org.cn/MulanPSL2 -# THIS PROGRAM IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, -# EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, -# MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. -# See the Mulan PSL v2 for more details. - -# ############################################# -# @Author : honghua -# @Contact : honghua@iscas.ac.cn -# @Date : 2026-03-04 -# @License : Mulan PSL v2 -# @Desc : 在运行脚本前加载指定的Lua库 -# ############################################ - -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 expect=$2 - local mode=$3 - local msg=$4 - if [ $mode -eq 0 ]; then - if [ $actual -eq $expect ]; then - LOG_INFO "$msg 成功" - else - LOG_ERROR "$msg 失败" - exit $actual - fi - else - if [ $actual -ne $expect ]; then - LOG_INFO "$msg 成功" - else - LOG_ERROR "$msg 失败" - exit 1 - fi - fi - } - fi - - # 定义SSH命令函数(如果未定义) - if ! type SSH_CMD &>/dev/null; then - SSH_CMD() { - local cmd=$1 - local ip=$2 - local pass=$3 - local user=${4:-root} - sshpass -p "$pass" ssh -o StrictHostKeyChecking=no -o UserKnownHostsFile=/dev/null "$user@$ip" "$cmd" - } - fi - - # 软件包名称 - PACKAGE_NAME="texlive-luajittex" - COMMAND_NAME="texluajitc" - SCRIPT_NAME="test_texlive-luajittex_texluajitc_l" - - # 步骤1:检查是否已安装软件包 - LOG_INFO "步骤1:检查是否已安装 $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 - - # 步骤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 [ "$INSTALLED_BEFORE" = "false" ]; then - LOG_INFO "步骤3:安装 $PACKAGE_NAME" - dnf install -y $PACKAGE_NAME - CHECK_RESULT $? 0 0 "安装 $PACKAGE_NAME" - fi - - # 步骤4:检查命令是否存在 - LOG_INFO "步骤4:检查命令 $COMMAND_NAME 是否存在" - if ! command -v $COMMAND_NAME &>/dev/null; then - LOG_ERROR "命令 $COMMAND_NAME 不存在" - exit 255 - fi - - # 步骤5:测试命令参数 - LOG_INFO "步骤5:测试 $COMMAND_NAME 的 -l 参数" - if ! $COMMAND_NAME -l &>/dev/null; then - LOG_ERROR "参数 -l 不存在或不支持" - exit 255 - fi - - # 步骤6:执行测试用例:在运行脚本前加载指定的Lua库 - LOG_INFO "步骤6:执行测试用例:在运行脚本前加载指定的Lua库" - $COMMAND_NAME -l - CHECK_RESULT $? 0 0 "执行 $COMMAND_NAME -l 命令" - - # 步骤7:清理环境 - 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-luajittex/test_texlive-luajittex_texluajitc_script.sh b/testcases/function_test/pkg_test/texlive-base/texlive-luajittex/test_texlive-luajittex_texluajitc_script.sh deleted file mode 100644 index 07cb57ddc5a..00000000000 --- a/testcases/function_test/pkg_test/texlive-base/texlive-luajittex/test_texlive-luajittex_texluajitc_script.sh +++ /dev/null @@ -1,186 +0,0 @@ -#!/usr/bin/bash - -# Copyright (c) 2024 ISCAS .ALL rights reserved. -# This program is licensed under Mulan PSL v2. -# You can use it according to the terms and conditions of the Mulan PSL v2. -# http://license.coscl.org.cn/MulanPSL2 -# THIS PROGRAM IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, -# EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, -# MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. -# See the Mulan PSL v2 for more details. - -# ############################################# -# @Author : honghua -# @Contact : honghua@iscas.ac.cn -# @Date : 2026-03-04 -# @License : Mulan PSL v2 -# @Desc : 执行指定的Lua脚本文件 -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - # 测试环境检查 - LOG_INFO "开始检查测试环境" - - # 检查软件包是否在yum源中存在 - LOG_INFO "检查texlive-luajittex和texluajitc软件包是否在yum源中" - dnf list available texlive-luajittex texluajitc 2>/dev/null | grep -q "texlive-luajittex" - if [ $? -ne 0 ]; then - LOG_ERROR "软件包texlive-luajittex在yum源中不存在" - exit 255 - fi - - dnf list available texlive-luajittex texluajitc 2>/dev/null | grep -q "texluajitc" - if [ $? -ne 0 ]; then - LOG_ERROR "软件包texluajitc在yum源中不存在" - exit 255 - fi - - LOG_INFO "软件包在yum源中存在" - - # 检查是否已安装 - LOG_INFO "检查texlive-luajittex和texluajitc是否已安装" - rpm -q texlive-luajittex texluajitc >/dev/null 2>&1 - already_installed=$? - - if [ $already_installed -eq 0 ]; then - LOG_INFO "软件包已安装,测试结束后将保持安装状态" - need_cleanup=0 - else - LOG_INFO "软件包未安装,将在测试后卸载" - need_cleanup=1 - fi - - # 安装软件包(如果未安装) - if [ $need_cleanup -eq 1 ]; then - LOG_INFO "开始安装texlive-luajittex和texluajitc软件包" - dnf install -y texlive-luajittex texluajitc - CHECK_RESULT $? 0 0 "软件包安装失败" - LOG_INFO "软件包安装成功" - fi - - # 验证luajittex命令是否存在 - LOG_INFO "验证luajittex命令是否存在" - command -v luajittex >/dev/null 2>&1 - CHECK_RESULT $? 0 0 "luajittex命令不存在" - - # 验证texluajitc命令是否存在 - LOG_INFO "验证texluajitc命令是否存在" - command -v texluajitc >/dev/null 2>&1 - CHECK_RESULT $? 0 0 "texluajitc命令不存在" - - # 测试luajittex命令参数 - LOG_INFO "测试luajittex命令的--version参数" - luajittex --version >/dev/null 2>&1 - CHECK_RESULT $? 0 0 "luajittex --version命令执行失败" - - # 测试texluajitc命令参数 - LOG_INFO "测试texluajitc命令的--version参数" - texluajitc --version >/dev/null 2>&1 - CHECK_RESULT $? 0 0 "texluajitc --version命令执行失败" - - # 测试不支持的参数 - LOG_INFO "测试luajittex不支持的参数" - luajittex --invalid-parameter 2>/dev/null - if [ $? -ne 255 ] && [ $? -ne 1 ]; then - LOG_ERROR "luajittex不支持--invalid-parameter参数时应退出" - exit 255 - fi - - LOG_INFO "测试texluajitc不支持的参数" - texluajitc --invalid-parameter 2>/dev/null - if [ $? -ne 255 ] && [ $? -ne 1 ]; then - LOG_ERROR "texluajitc不支持--invalid-parameter参数时应退出" - exit 255 - fi - - # 创建测试Lua脚本 - LOG_INFO "创建测试Lua脚本" - cat > test_lua_script.lua << "EOF" - #!/usr/bin/env lua - print("Hello from LuaJIT!") - print("Testing LuaJIT integration with TeX") - local sum = 0 - for i = 1, 10 do - sum = sum + i - end - print("Sum of 1 to 10 is: " .. sum) - EOF - - CHECK_RESULT $? 0 0 "创建测试Lua脚本失败" - - # 测试执行Lua脚本文件 - LOG_INFO "测试执行Lua脚本文件" - LOG_INFO "使用luajittex执行Lua脚本" - luajittex test_lua_script.lua 2>&1 | grep -q "Hello from LuaJIT" - CHECK_RESULT $? 0 0 "luajittex执行Lua脚本失败" - - LOG_INFO "使用texluajitc执行Lua脚本" - texluajitc test_lua_script.lua 2>&1 | grep -q "Hello from LuaJIT" - CHECK_RESULT $? 0 0 "texluajitc执行Lua脚本失败" - - # 创建更复杂的Lua脚本进行测试 - LOG_INFO "创建复杂的Lua脚本进行测试" - cat > complex_lua_script.lua << "EOF" - #!/usr/bin/env lua - -- 测试LuaJIT的数学计算能力 - local function factorial(n) - if n == 0 then - return 1 - else - return n * factorial(n - 1) - end - end - - print("Testing factorial function:") - for i = 1, 5 do - print(i .. "! = " .. factorial(i)) - end - - -- 测试字符串操作 - local str = "LuaJIT TeX Integration" - print("Original string: " .. str) - print("Uppercase: " .. str:upper()) - print("Lowercase: " .. str:lower()) - - -- 测试table操作 - local colors = {"red", "green", "blue", "yellow"} - print("Colors in table:") - for i, color in ipairs(colors) do - print(" " .. i .. ": " .. color) - end - EOF - - CHECK_RESULT $? 0 0 "创建复杂Lua脚本失败" - - # 测试执行复杂Lua脚本 - LOG_INFO "测试执行复杂Lua脚本" - LOG_INFO "使用luajittex执行复杂Lua脚本" - luajittex complex_lua_script.lua 2>&1 | grep -q "Testing factorial function" - CHECK_RESULT $? 0 0 "luajittex执行复杂Lua脚本失败" - - LOG_INFO "使用texluajitc执行复杂Lua脚本" - texluajitc complex_lua_script.lua 2>&1 | grep -q "Testing factorial function" - CHECK_RESULT $? 0 0 "texluajitc执行复杂Lua脚本失败" - - # 清理测试文件 - LOG_INFO "清理测试文件" - rm -f test_lua_script.lua complex_lua_script.lua - CHECK_RESULT $? 0 0 "清理测试文件失败" - - # 环境恢复 - LOG_INFO "开始环境恢复" - if [ $need_cleanup -eq 1 ]; then - LOG_INFO "卸载测试安装的软件包" - dnf remove -y texlive-luajittex texluajitc - CHECK_RESULT $? 0 0 "软件包卸载失败" - 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-luajittex/test_texlive-luajittex_texluajitc_special_-.sh b/testcases/function_test/pkg_test/texlive-base/texlive-luajittex/test_texlive-luajittex_texluajitc_special_-.sh deleted file mode 100644 index 3745c4f684f..00000000000 --- a/testcases/function_test/pkg_test/texlive-base/texlive-luajittex/test_texlive-luajittex_texluajitc_special_-.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-04 -# @License : Mulan PSL v2 -# @Desc : 停止解析后续选项 -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - LOG_INFO "开始测试:停止解析后续选项" - LOG_INFO "步骤1:检查是否已安装texlive-luajittex软件包" - if rpm -q texlive-luajittex &>/dev/null; then - LOG_INFO "texlive-luajittex已安装,脚本结束前将保持安装状态" - ALREADY_INSTALLED=1 - else - LOG_INFO "texlive-luajittex未安装,将进行安装测试" - ALREADY_INSTALLED=0 - fi - - LOG_INFO "步骤2:检查yum源中是否有texlive-luajittex软件包" - if ! dnf list available texlive-luajittex &>/dev/null; then - LOG_ERROR "yum源中未找到texlive-luajittex软件包" - exit 255 - fi - - if [ $ALREADY_INSTALLED -eq 0 ]; then - LOG_INFO "步骤3:安装texlive-luajittex软件包" - dnf install -y texlive-luajittex - CHECK_RESULT $? 0 0 "安装texlive-luajittex失败" - fi - - LOG_INFO "步骤4:查找texluajitc命令路径" - TEXLUAJITC_PATH=$(which texluajitc 2>/dev/null) - if [ -z "$TEXLUAJITC_PATH" ]; then - LOG_ERROR "未找到texluajitc命令" - exit 255 - fi - - LOG_INFO "步骤5:测试texluajitc命令的--选项" - $TEXLUAJITC_PATH -- --help - COMMAND_EXIT_CODE=$? - if [ $COMMAND_EXIT_CODE -eq 255 ]; then - LOG_ERROR "texluajitc命令不支持--选项" - exit 255 - elif [ $COMMAND_EXIT_CODE -ne 0 ]; then - LOG_ERROR "texluajitc命令执行失败,退出码:$COMMAND_EXIT_CODE" - exit $COMMAND_EXIT_CODE - fi - CHECK_RESULT $COMMAND_EXIT_CODE 0 0 "texluajitc -- 选项测试失败" - - LOG_INFO "步骤6:测试texluajitc命令的--选项停止解析后续选项功能" - echo "test" | $TEXLUAJITC_PATH -- -v 2>&1 | grep -q "invalid option" - CHECK_RESULT $? 0 0 "--选项未能停止解析后续无效选项-v" - - LOG_INFO "步骤7:清理测试环境" - if [ $ALREADY_INSTALLED -eq 0 ]; then - LOG_INFO "卸载测试安装的texlive-luajittex软件包" - dnf remove -y texlive-luajittex - CHECK_RESULT $? 0 0 "卸载texlive-luajittex失败" - else - LOG_INFO "保持原安装状态,不卸载texlive-luajittex" - fi - - LOG_INFO "测试完成:停止解析后续选项" -} - -main "$@" \ No newline at end of file diff --git a/testcases/function_test/pkg_test/texlive-base/texlive-luajittex/test_texlive-luajittex_texluajitc_special_-_stdin.sh b/testcases/function_test/pkg_test/texlive-base/texlive-luajittex/test_texlive-luajittex_texluajitc_special_-_stdin.sh deleted file mode 100644 index 59feec51575..00000000000 --- a/testcases/function_test/pkg_test/texlive-base/texlive-luajittex/test_texlive-luajittex_texluajitc_special_-_stdin.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-04 -# @License : Mulan PSL v2 -# @Desc : 从标准输入执行Lua代码并停止解析后续选项 -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - LOG_INFO "开始测试:从标准输入执行Lua代码并停止解析后续选项" - - # 步骤1:检查软件包是否在yum源中 - LOG_INFO "步骤1:检查yum源中是否存在texlive-luajittex和texluajitc包" - if ! dnf list available texlive-luajittex texluajitc &> /dev/null; then - LOG_ERROR "yum源中未找到texlive-luajittex或texluajitc包" - exit 255 - fi - - # 步骤2:检查环境是否已安装软件包 - LOG_INFO "步骤2:检查环境是否已安装texlive-luajittex和texluajitc包" - if rpm -q texlive-luajittex texluajitc &> /dev/null; then - LOG_INFO "环境已安装软件包,测试结束后保持安装状态" - INSTALLED=true - else - LOG_INFO "环境未安装软件包,测试前将安装软件包" - INSTALLED=false - fi - - # 步骤3:如果未安装,则安装软件包 - if [ "$INSTALLED" = false ]; then - LOG_INFO "步骤3:安装texlive-luajittex和texluajitc包" - dnf install -y texlive-luajittex texluajitc - CHECK_RESULT $? 0 0 "安装软件包失败" - fi - - # 步骤4:测试从标准输入执行Lua代码并停止解析后续选项 - LOG_INFO "步骤4:测试从标准输入执行Lua代码并停止解析后续选项" - echo "print("Hello, Lua!")" | luajittex --luaonly -- - 2>&1 - CHECK_RESULT $? 0 0 "从标准输入执行Lua代码失败" - - # 步骤5:测试参数不存在或不支持的情况 - LOG_INFO "步骤5:测试参数不存在或不支持的情况" - luajittex --nonexistent-option 2>&1 - if [ $? -eq 255 ]; then - LOG_INFO "参数不存在或不支持,测试通过" - else - LOG_ERROR "参数不存在或不支持,但未返回退出码255" - exit 255 - fi - - # 步骤6:环境恢复 - LOG_INFO "步骤6:环境恢复" - if [ "$INSTALLED" = false ]; then - LOG_INFO "卸载测试安装的软件包" - dnf remove -y texlive-luajittex texluajitc - 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-luajittex/test_texlive-luajittex_texluajitc_upper_e.sh b/testcases/function_test/pkg_test/texlive-base/texlive-luajittex/test_texlive-luajittex_texluajitc_upper_e.sh deleted file mode 100644 index 41bc5ef1476..00000000000 --- a/testcases/function_test/pkg_test/texlive-base/texlive-luajittex/test_texlive-luajittex_texluajitc_upper_e.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-04 -# @License : Mulan PSL v2 -# @Desc : 忽略环境变量 -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - # 测试脚本:忽略环境变量 - - LOG_INFO "1. 检查是否已安装texlive-luajittex和texlive-texluajitc软件包" - rpm -q texlive-luajittex texlive-texluajitc - if [ $? -eq 0 ]; then - LOG_INFO "软件包已安装,标记为已安装状态" - INSTALLED="true" - else - LOG_INFO "软件包未安装,标记为未安装状态" - INSTALLED="false" - fi - - LOG_INFO "2. 检查yum源中是否存在texlive-luajittex和texlive-texluajitc软件包" - dnf list available texlive-luajittex texlive-texluajitc - CHECK_RESULT $? 0 0 "yum源中不存在texlive-luajittex或texlive-texluajitc软件包" - if [ $? -ne 0 ]; then - LOG_ERROR "yum源中不存在texlive-luajittex或texlive-texluajitc软件包" - exit 255 - fi - - if [ "$INSTALLED" = "false" ]; then - LOG_INFO "3. 安装texlive-luajittex和texlive-texluajitc软件包" - dnf install -y texlive-luajittex texlive-texluajitc - CHECK_RESULT $? 0 0 "安装texlive-luajittex和texlive-texluajitc软件包失败" - fi - - LOG_INFO "4. 检查luajittex命令是否可用" - luajittex --version - CHECK_RESULT $? 0 0 "luajittex命令不可用" - - LOG_INFO "5. 测试luajittex命令的基本功能" - luajittex --help - CHECK_RESULT $? 0 0 "luajittex命令--help参数不支持" - - LOG_INFO "6. 测试luajittex命令的不支持参数" - luajittex --invalid-param 2>/dev/null - if [ $? -ne 255 ]; then - LOG_ERROR "luajittex命令不支持--invalid-param参数,但未返回255退出码" - exit 255 - fi - - LOG_INFO "7. 测试texluajitc命令是否可用" - texluajitc --version - CHECK_RESULT $? 0 0 "texluajitc命令不可用" - - LOG_INFO "8. 测试texluajitc命令的基本功能" - texluajitc --help - CHECK_RESULT $? 0 0 "texluajitc命令--help参数不支持" - - LOG_INFO "9. 测试texluajitc命令的不支持参数" - texluajitc --invalid-param 2>/dev/null - if [ $? -ne 255 ]; then - LOG_ERROR "texluajitc命令不支持--invalid-param参数,但未返回255退出码" - exit 255 - fi - - LOG_INFO "10. 清理测试环境" - if [ "$INSTALLED" = "false" ]; then - LOG_INFO "卸载测试安装的软件包" - dnf remove -y texlive-luajittex texlive-texluajitc - CHECK_RESULT $? 0 0 "卸载texlive-luajittex和texlive-texluajitc软件包失败" - else - LOG_INFO "保持原有安装状态,不卸载软件包" - fi - - LOG_INFO "11. 测试完成,环境已恢复" -} - -main "$@" \ No newline at end of file diff --git a/testcases/function_test/pkg_test/texlive-base/texlive-luajittex/test_texlive-luajittex_texluajitc_upper_o.sh b/testcases/function_test/pkg_test/texlive-base/texlive-luajittex/test_texlive-luajittex_texluajitc_upper_o.sh deleted file mode 100644 index 81d5e05569a..00000000000 --- a/testcases/function_test/pkg_test/texlive-base/texlive-luajittex/test_texlive-luajittex_texluajitc_upper_o.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-04 -# @License : Mulan PSL v2 -# @Desc : 控制LuaJIT优化选项 -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - LOG_INFO "开始测试:控制LuaJIT优化选项" - LOG_INFO "步骤1: 检查是否已安装texlive-luajittex和texluajitc软件包" - if rpm -q texlive-luajittex texluajitc >/dev/null 2>&1; then - LOG_INFO "软件包已安装,测试结束后保持安装状态" - INSTALLED=1 - else - LOG_INFO "软件包未安装,将在测试过程中安装" - INSTALLED=0 - fi - LOG_INFO "步骤2: 检查yum源中是否有texlive-luajittex和texluajitc软件包" - dnf list available texlive-luajittex texluajitc >/dev/null 2>&1 - CHECK_RESULT $? 0 0 "yum源中缺少texlive-luajittex或texluajitc软件包" - if [ $? -ne 0 ]; then - LOG_ERROR "yum源中缺少texlive-luajittex或texluajitc软件包" - exit 255 - fi - if [ $INSTALLED -eq 0 ]; then - LOG_INFO "步骤3: 安装texlive-luajittex和texluajitc软件包" - dnf install -y texlive-luajittex texluajitc - CHECK_RESULT $? 0 0 "安装texlive-luajittex和texluajitc软件包失败" - fi - LOG_INFO "步骤4: 测试luajittex命令,检查是否支持--luajit-opt参数" - luajittex --help 2>&1 | grep -q "--luajit-opt" - CHECK_RESULT $? 0 0 "luajittex命令不支持--luajit-opt参数" - if [ $? -ne 0 ]; then - LOG_ERROR "luajittex命令不支持--luajit-opt参数" - exit 255 - fi - LOG_INFO "步骤5: 测试texluajitc命令,检查是否支持--opt参数" - texluajitc --help 2>&1 | grep -q "--opt" - CHECK_RESULT $? 0 0 "texluajitc命令不支持--opt参数" - if [ $? -ne 0 ]; then - LOG_ERROR "texluajitc命令不支持--opt参数" - exit 255 - fi - LOG_INFO "步骤6: 测试luajittex使用--luajit-opt参数控制优化选项" - luajittex --luajit-opt="-O2" --version - CHECK_RESULT $? 0 0 "luajittex使用--luajit-opt参数执行失败" - LOG_INFO "步骤7: 测试texluajitc使用--opt参数控制优化选项" - texluajitc --opt="-O2" --version - CHECK_RESULT $? 0 0 "texluajitc使用--opt参数执行失败" - LOG_INFO "步骤8: 清理测试环境" - if [ $INSTALLED -eq 0 ]; then - LOG_INFO "卸载测试安装的软件包" - dnf remove -y texlive-luajittex texluajitc - CHECK_RESULT $? 0 0 "卸载texlive-luajittex和texluajitc软件包失败" - else - LOG_INFO "测试前已安装软件包,保持安装状态" - fi - LOG_INFO "测试完成:控制LuaJIT优化选项" -} - -main "$@" \ No newline at end of file diff --git a/testcases/function_test/pkg_test/texlive-base/texlive-luajittex/test_texlive-luajittex_texluajitc_upper_v.sh b/testcases/function_test/pkg_test/texlive-base/texlive-luajittex/test_texlive-luajittex_texluajitc_upper_v.sh deleted file mode 100644 index b8c15d51bde..00000000000 --- a/testcases/function_test/pkg_test/texlive-base/texlive-luajittex/test_texlive-luajittex_texluajitc_upper_v.sh +++ /dev/null @@ -1,66 +0,0 @@ -#!/usr/bin/bash - -# Copyright (c) 2024 ISCAS .ALL rights reserved. -# This program is licensed under Mulan PSL v2. -# You can use it according to the terms and conditions of the Mulan PSL v2. -# http://license.coscl.org.cn/MulanPSL2 -# THIS PROGRAM IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, -# EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, -# MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. -# See the Mulan PSL v2 for more details. - -# ############################################# -# @Author : honghua -# @Contact : honghua@iscas.ac.cn -# @Date : 2026-03-04 -# @License : Mulan PSL v2 -# @Desc : 显示版本信息 -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - LOG_INFO "开始测试:显示版本信息" - LOG_INFO "步骤1:检查yum源中是否存在texlive-luajittex-texluajitc-upper-v软件包" - dnf list texlive-luajittex-texluajitc-upper-v &> /dev/null - if [ $? -ne 0 ]; then - LOG_ERROR "yum源中未找到texlive-luajittex-texluajitc-upper-v软件包" - exit 255 - fi - - LOG_INFO "步骤2:检查系统是否已安装texlive-luajittex-texluajitc-upper-v" - rpm -q texlive-luajittex-texluajitc-upper-v &> /dev/null - if [ $? -eq 0 ]; then - LOG_INFO "软件包已安装,将保持安装状态" - ALREADY_INSTALLED=1 - else - LOG_INFO "软件包未安装,将进行安装" - ALREADY_INSTALLED=0 - LOG_INFO "步骤3:安装texlive-luajittex-texluajitc-upper-v" - dnf install -y texlive-luajittex-texluajitc-upper-v - CHECK_RESULT $? 0 0 "安装texlive-luajittex-texluajitc-upper-v失败" - fi - - LOG_INFO "步骤4:检查texlive-luajittex-texluajitc-upper-v命令是否存在" - command -v texlive-luajittex-texluajitc-upper-v &> /dev/null - if [ $? -ne 0 ]; then - LOG_ERROR "texlive-luajittex-texluajitc-upper-v命令不存在" - exit 255 - fi - - LOG_INFO "步骤5:显示texlive-luajittex-texluajitc-upper-v版本信息" - texlive-luajittex-texluajitc-upper-v --version - CHECK_RESULT $? 0 0 "显示版本信息失败" - - if [ $ALREADY_INSTALLED -eq 0 ]; then - LOG_INFO "步骤6:清理环境,卸载texlive-luajittex-texluajitc-upper-v" - dnf remove -y texlive-luajittex-texluajitc-upper-v - CHECK_RESULT $? 0 0 "卸载texlive-luajittex-texluajitc-upper-v失败" - else - LOG_INFO "步骤6:保持安装状态,无需卸载" - fi - - LOG_INFO "测试完成" -} - -main "$@" \ No newline at end of file diff --git a/testcases/function_test/pkg_test/texlive-split-d/texlive-callouts/test_texlive-callouts_function_basic.sh b/testcases/function_test/pkg_test/texlive-split-d/texlive-callouts/test_texlive-callouts_function_basic.sh deleted file mode 100644 index bc4e99c2ebb..00000000000 --- a/testcases/function_test/pkg_test/texlive-split-d/texlive-callouts/test_texlive-callouts_function_basic.sh +++ /dev/null @@ -1,64 +0,0 @@ -#!/usr/bin/bash - -# Copyright (c) 2024 ISCAS .ALL rights reserved. -# This program is licensed under Mulan PSL v2. -# You can use it according to the terms and conditions of the Mulan PSL v2. -# http://license.coscl.org.cn/MulanPSL2 -# THIS PROGRAM IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, -# EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, -# MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. -# See the Mulan PSL v2 for more details. - -# ############################################# -# @Author : honghua -# @Contact : honghua@iscas.ac.cn -# @Date : 2025-11-26 -# @License : Mulan PSL v2 -# @Desc : Test basic functionality of texlive-callouts -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - # 检查texlive-callouts软件包是否已安装 - LOG_INFO "检查texlive-callouts是否已安装" - rpm -q texlive-callouts >/dev/null 2>&1 - if [ $? -eq 0 ]; then - LOG_INFO "texlive-callouts已安装,脚本结束时将保持安装状态" - INSTALLED=1 - else - LOG_INFO "texlive-callouts未安装,将在测试结束后卸载" - INSTALLED=0 - fi - - # 检查yum源中是否有texlive-callouts软件包 - LOG_INFO "检查yum源中是否存在texlive-callouts软件包" - dnf list available texlive-callouts >/dev/null 2>&1 - if [ $? -ne 0 ]; then - LOG_ERROR "yum源中未找到texlive-callouts软件包" - exit 255 - fi - - # 安装texlive-callouts软件包 - if [ $INSTALLED -eq 0 ]; then - LOG_INFO "开始安装texlive-callouts软件包" - dnf install -y texlive-callouts >/dev/null 2>&1 - CHECK_RESULT $? 0 0 "安装texlive-callouts失败" - fi - - # 测试texlive-callouts基本功能 - LOG_INFO "测试texlive-callouts基本功能" - texlive-callouts --version >/dev/null 2>&1 - CHECK_RESULT $? 0 0 "texlive-callouts版本检查失败" - - # 清理环境 - if [ $INSTALLED -eq 0 ]; then - LOG_INFO "卸载texlive-callouts软件包" - dnf remove -y texlive-callouts >/dev/null 2>&1 - CHECK_RESULT $? 0 0 "卸载texlive-callouts失败" - fi - - LOG_INFO "测试完成" -} - -main "$@" \ No newline at end of file diff --git a/testcases/function_test/pkg_test/texlive-split-d/texlive-callouts/test_texlive-callouts_function_basic_usage.sh b/testcases/function_test/pkg_test/texlive-split-d/texlive-callouts/test_texlive-callouts_function_basic_usage.sh deleted file mode 100644 index 41b57eca168..00000000000 --- a/testcases/function_test/pkg_test/texlive-split-d/texlive-callouts/test_texlive-callouts_function_basic_usage.sh +++ /dev/null @@ -1,109 +0,0 @@ -#!/usr/bin/bash - -# Copyright (c) 2024 ISCAS .ALL rights reserved. -# This program is licensed under Mulan PSL v2. -# You can use it according to the terms and conditions of the Mulan PSL v2. -# http://license.coscl.org.cn/MulanPSL2 -# THIS PROGRAM IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, -# EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, -# MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. -# See the Mulan PSL v2 for more details. - -# ############################################# -# @Author : honghua -# @Contact : honghua@iscas.ac.cn -# @Date : 2026-03-29 -# @License : Mulan PSL v2 -# @Desc : Test basic LaTeX document compilation using the callouts package to verify its core functionality. -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - set -e - - LOG_INFO "开始测试:验证callouts包的基本功能 - 测试基本的LaTeX文档编译" - - LOG_INFO "步骤1: 检查测试环境是否已安装texlive-callouts软件包" - if dnf list installed texlive-callouts &>/dev/null; then - LOG_INFO "环境已安装texlive-callouts软件包,测试后将保持安装状态" - ENV_PRE_INSTALLED=true - else - LOG_INFO "环境未安装texlive-callouts软件包,将在测试中安装并最终卸载" - ENV_PRE_INSTALLED=false - fi - - LOG_INFO "步骤2: 检查yum源中是否存在texlive-callouts软件包" - if ! dnf list available texlive-callouts &>/dev/null; then - LOG_ERROR "yum源中未找到texlive-callouts软件包" - exit 255 - fi - - if [ "$ENV_PRE_INSTALLED" = "false" ]; then - LOG_INFO "步骤3: 安装texlive-callouts软件包" - dnf install -y texlive-callouts - CHECK_RESULT $? 0 0 "安装texlive-callouts软件包失败" - fi - - LOG_INFO "步骤4: 创建一个简单的测试LaTeX文档,使用callouts包" - TEST_DIR=$(mktemp -d) - cd "$TEST_DIR" - - cat > test_callouts.tex << "EOF" - \documentclass{article} - \usepackage{callouts} - \begin{document} - This is a test document for the callouts package. - - \begin{callout}{Test Callout} - This is a sample callout created using the callouts package. - \end{callout} - - \end{document} - EOF - CHECK_RESULT $? 0 0 "创建测试LaTeX文件失败" - - LOG_INFO "步骤5: 使用pdflatex编译LaTeX文档" - if ! command -v pdflatex &>/dev/null; then - LOG_INFO "步骤5.1: pdflatex命令不存在,尝试安装texlive-scheme-basic" - if ! dnf list available texlive-scheme-basic &>/dev/null; then - LOG_ERROR "yum源中未找到texlive-scheme-basic软件包" - exit 255 - fi - dnf install -y texlive-scheme-basic - CHECK_RESULT $? 0 0 "安装texlive-scheme-basic失败" - fi - - pdflatex -interaction=nonstopmode test_callouts.tex - CHECK_RESULT $? 0 0 "使用pdflatex编译LaTeX文档失败" - - LOG_INFO "步骤6: 验证是否成功生成PDF输出文件" - if [ -f "test_callouts.pdf" ]; then - LOG_INFO "成功生成PDF文件:test_callouts.pdf" - file test_callouts.pdf | grep -q "PDF document" - CHECK_RESULT $? 0 0 "生成的PDF文件格式不正确" - else - LOG_ERROR "未生成预期的PDF输出文件" - exit 1 - fi - - LOG_INFO "步骤7: 清理测试生成的临时文件" - cd / - rm -rf "$TEST_DIR" - - if [ "$ENV_PRE_INSTALLED" = "false" ]; then - LOG_INFO "步骤8: 卸载测试安装的软件包" - dnf remove -y texlive-callouts - CHECK_RESULT $? 0 0 "卸载texlive-callouts软件包失败" - - if command -v pdflatex &>/dev/null; then - LOG_INFO "步骤8.1: 卸载测试安装的texlive-scheme-basic" - dnf remove -y texlive-scheme-basic - CHECK_RESULT $? 0 0 "卸载texlive-scheme-basic软件包失败" - fi - fi - - LOG_INFO "测试完成:callouts包基本功能验证成功" -} - -main "$@" \ No newline at end of file diff --git a/testcases/function_test/pkg_test/texlive-split-d/texlive-callouts/test_texlive-callouts_function_version.sh b/testcases/function_test/pkg_test/texlive-split-d/texlive-callouts/test_texlive-callouts_function_version.sh deleted file mode 100644 index 0a6c9dfcf27..00000000000 --- a/testcases/function_test/pkg_test/texlive-split-d/texlive-callouts/test_texlive-callouts_function_version.sh +++ /dev/null @@ -1,121 +0,0 @@ -#!/usr/bin/bash - -# Copyright (c) 2024 ISCAS .ALL rights reserved. -# This program is licensed under Mulan PSL v2. -# You can use it according to the terms and conditions of the Mulan PSL v2. -# http://license.coscl.org.cn/MulanPSL2 -# THIS PROGRAM IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, -# EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, -# MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. -# See the Mulan PSL v2 for more details. - -# ############################################# -# @Author : honghua -# @Contact : honghua@iscas.ac.cn -# @Date : 2026-03-29 -# @License : Mulan PSL v2 -# @Desc : Test to check the version information of the installed texlive-callouts package. -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - # 测试环境初始化检查 - LOG_INFO "检查测试环境是否已安装texlive-callouts软件包" - - # 检查软件包是否已安装 - if rpm -q texlive-callouts &>/dev/null; then - LOG_INFO "texlive-callouts软件包已安装,标记为已存在安装" - PRE_INSTALLED=true - else - LOG_INFO "texlive-callouts软件包未安装" - PRE_INSTALLED=false - fi - - # 检查yum源中是否存在该软件包 - LOG_INFO "检查yum源中是否存在texlive-callouts软件包" - dnf list available texlive-callouts &>/dev/null - CHECK_RESULT $? 0 0 "yum源中未找到texlive-callouts软件包" - if [ $? -ne 0 ]; then - LOG_ERROR "yum源中不存在texlive-callouts软件包" - exit 255 - fi - - # 如果未安装,则执行安装 - if [ "$PRE_INSTALLED" = "false" ]; then - LOG_INFO "开始安装texlive-callouts软件包" - dnf install -y texlive-callouts - CHECK_RESULT $? 0 0 "安装texlive-callouts软件包失败" - LOG_INFO "texlive-callouts软件包安装成功" - fi - - # 测试版本信息查询功能 - LOG_INFO "测试texlive-callouts版本信息查询" - - # 检查命令参数支持情况 - LOG_INFO "检查rpm命令参数是否支持-q和--queryformat" - rpm --help | grep -q "\-q" && rpm --help | grep -q "\-\-queryformat" - CHECK_RESULT $? 0 0 "rpm命令不支持所需参数" - if [ $? -ne 0 ]; then - LOG_ERROR "rpm命令参数不支持" - exit 255 - fi - - # 查询软件包版本信息 - LOG_INFO "查询texlive-callouts软件包版本信息" - VERSION_INFO=$(rpm -q texlive-callouts --queryformat="%{VERSION}-%{RELEASE}") - CHECK_RESULT $? 0 0 "查询texlive-callouts版本信息失败" - - # 验证版本信息格式 - LOG_INFO "验证版本信息格式" - if [[ "$VERSION_INFO" =~ ^[0-9]+(\.[0-9]+)*-[0-9]+(\.[0-9]+)*$ ]]; then - LOG_INFO "版本信息格式正确: $VERSION_INFO" - CHECK_RESULT 0 0 0 "版本信息格式验证通过" - else - LOG_ERROR "版本信息格式不正确: $VERSION_INFO" - CHECK_RESULT 1 0 0 "版本信息格式验证失败" - fi - - # 详细版本信息查询 - LOG_INFO "查询详细的软件包信息" - FULL_INFO=$(rpm -qi texlive-callouts) - CHECK_RESULT $? 0 0 "查询详细软件包信息失败" - - # 验证关键信息存在 - LOG_INFO "验证软件包关键信息" - echo "$FULL_INFO" | grep -q "Name.*texlive-callouts" - CHECK_RESULT $? 0 0 "软件包名称信息缺失" - echo "$FULL_INFO" | grep -q "Version" - CHECK_RESULT $? 0 0 "软件包版本信息缺失" - echo "$FULL_INFO" | grep -q "Release" - CHECK_RESULT $? 0 0 "软件包发布信息缺失" - - # 环境清理 - LOG_INFO "开始清理测试环境" - - # 如果测试前未安装,则卸载软件包 - if [ "$PRE_INSTALLED" = "false" ]; then - LOG_INFO "卸载测试安装的texlive-callouts软件包" - dnf remove -y texlive-callouts - CHECK_RESULT $? 0 0 "卸载texlive-callouts软件包失败" - LOG_INFO "texlive-callouts软件包卸载成功" - else - LOG_INFO "保持原有的texlive-callouts软件包安装状态" - fi - - # 最终环境验证 - LOG_INFO "最终环境状态验证" - if [ "$PRE_INSTALLED" = "true" ]; then - rpm -q texlive-callouts &>/dev/null - CHECK_RESULT $? 0 0 "环境未恢复到原始安装状态" - LOG_INFO "环境已恢复到原始安装状态" - else - ! rpm -q texlive-callouts &>/dev/null - CHECK_RESULT $? 0 0 "环境未恢复到原始未安装状态" - LOG_INFO "环境已恢复到原始未安装状态" - fi - - LOG_INFO "texlive-callouts版本信息测试完成" -} - -main "$@" \ No newline at end of file diff --git a/testcases/function_test/pkg_test/texlive-split-e/texlive-commado-doc/test_texlive-commado-doc_function_info.sh b/testcases/function_test/pkg_test/texlive-split-e/texlive-commado-doc/test_texlive-commado-doc_function_info.sh deleted file mode 100644 index 2736809a1b5..00000000000 --- a/testcases/function_test/pkg_test/texlive-split-e/texlive-commado-doc/test_texlive-commado-doc_function_info.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-25 -# @License : Mulan PSL v2 -# @Desc : Test package info query -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - LOG_INFO "开始测试texlive-commado-doc软件包信息查询功能" - LOG_INFO "步骤1:检查yum源中是否存在texlive-commado-doc软件包" - dnf list available texlive-commado-doc > /dev/null 2>&1 - if [ $? -ne 0 ]; then - LOG_ERROR "yum源中未找到texlive-commado-doc软件包" - exit 255 - fi - - LOG_INFO "步骤2:检查系统是否已安装texlive-commado-doc软件包" - rpm -q texlive-commado-doc > /dev/null 2>&1 - INSTALLED=$? - - if [ $INSTALLED -eq 0 ]; then - LOG_INFO "texlive-commado-doc软件包已安装,保持安装状态进行测试" - NEED_CLEANUP=0 - else - LOG_INFO "texlive-commado-doc软件包未安装,将进行安装测试" - NEED_CLEANUP=1 - - LOG_INFO "步骤3:安装texlive-commado-doc软件包" - dnf install -y texlive-commado-doc - CHECK_RESULT $? 0 0 "安装texlive-commado-doc软件包失败" - fi - - LOG_INFO "步骤4:测试texlive-commado-doc软件包信息查询" - LOG_INFO "步骤4.1:测试查询软件包基本信息" - rpm -qi texlive-commado-doc - CHECK_RESULT $? 0 0 "查询texlive-commado-doc软件包基本信息失败" - - LOG_INFO "步骤4.2:测试查询软件包文件列表" - rpm -ql texlive-commado-doc - CHECK_RESULT $? 0 0 "查询texlive-commado-doc软件包文件列表失败" - - LOG_INFO "步骤4.3:测试查询软件包依赖关系" - rpm -qR texlive-commado-doc - CHECK_RESULT $? 0 0 "查询texlive-commado-doc软件包依赖关系失败" - - LOG_INFO "步骤4.4:测试不支持的参数(预期失败)" - rpm -q --invalid-param texlive-commado-doc > /dev/null 2>&1 - if [ $? -ne 255 ]; then - LOG_ERROR "不支持的参数未正确返回255退出码" - exit 255 - fi - - LOG_INFO "步骤5:环境清理" - if [ $NEED_CLEANUP -eq 1 ]; then - LOG_INFO "卸载测试安装的texlive-commado-doc软件包" - dnf remove -y texlive-commado-doc - CHECK_RESULT $? 0 0 "卸载texlive-commado-doc软件包失败" - else - LOG_INFO "保持texlive-commado-doc软件包安装状态,无需清理" - fi - - LOG_INFO "测试完成:texlive-commado-doc软件包信息查询功能测试通过" -} - -main "$@" \ No newline at end of file diff --git a/testcases/function_test/pkg_test/texlive-split-e/texlive-commado-doc/test_texlive-commado-doc_function_install.sh b/testcases/function_test/pkg_test/texlive-split-e/texlive-commado-doc/test_texlive-commado-doc_function_install.sh deleted file mode 100644 index 83c42bb4051..00000000000 --- a/testcases/function_test/pkg_test/texlive-split-e/texlive-commado-doc/test_texlive-commado-doc_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-25 -# @License : Mulan PSL v2 -# @Desc : Test package installation -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - set -e - - LOG_INFO "开始测试软件包安装功能" - - # 检查是否已安装 - if dnf list installed texlive-command-doc &>/dev/null; then - LOG_INFO "检测到 texlive-command-doc 已安装,将保持安装状态" - already_installed=true - else - LOG_INFO "texlive-command-doc 未安装,将在测试后卸载" - already_installed=false - fi - - # 检查软件包是否在yum源中 - LOG_INFO "检查yum源中是否存在 texlive-command-doc 软件包" - if ! dnf list available texlive-command-doc &>/dev/null; then - LOG_ERROR "yum源中未找到 texlive-command-doc 软件包" - exit 255 - fi - - # 检查dnf命令是否支持install参数 - LOG_INFO "检查dnf命令是否支持install参数" - if ! dnf --help | grep -q "install"; then - LOG_ERROR "dnf命令不支持install参数" - exit 255 - fi - - # 安装软件包 - LOG_INFO "开始安装 texlive-command-doc 软件包" - dnf install -y texlive-command-doc - CHECK_RESULT $? 0 0 "安装 texlive-command-doc 失败" - - # 验证安装 - LOG_INFO "验证软件包是否安装成功" - dnf list installed texlive-command-doc - CHECK_RESULT $? 0 0 "验证安装失败" - - # 清理环境 - if [ "$already_installed" = false ]; then - LOG_INFO "清理环境:卸载 texlive-command-doc 软件包" - dnf remove -y texlive-command-doc - CHECK_RESULT $? 0 0 "卸载 texlive-command-doc 失败" - else - LOG_INFO "保持 texlive-command-doc 安装状态" - fi - - LOG_INFO "测试完成" -} - -main "$@" \ No newline at end of file diff --git a/testcases/function_test/pkg_test/texlive-split-e/texlive-commado-doc/test_texlive-commado-doc_function_usage.sh b/testcases/function_test/pkg_test/texlive-split-e/texlive-commado-doc/test_texlive-commado-doc_function_usage.sh deleted file mode 100644 index 194d5594a60..00000000000 --- a/testcases/function_test/pkg_test/texlive-split-e/texlive-commado-doc/test_texlive-commado-doc_function_usage.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-25 -# @License : Mulan PSL v2 -# @Desc : Test basic package usage -# ############################################ - -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-commado-doc" - - # 步骤1:检查yum源中是否存在指定软件包 - LOG_INFO "步骤1:检查yum源中是否存在软件包 $PACKAGE_NAME" - dnf list available "$PACKAGE_NAME" > /dev/null 2>&1 - if [ $? -ne 0 ]; then - LOG_ERROR "软件包 $PACKAGE_NAME 在yum源中不存在" - exit 255 - fi - - # 步骤2:检查当前环境是否已安装该软件包 - LOG_INFO "步骤2:检查当前环境是否已安装软件包 $PACKAGE_NAME" - IS_INSTALLED=0 - rpm -q "$PACKAGE_NAME" > /dev/null 2>&1 - if [ $? -eq 0 ]; then - IS_INSTALLED=1 - LOG_INFO "软件包 $PACKAGE_NAME 已安装" - else - LOG_INFO "软件包 $PACKAGE_NAME 未安装" - fi - - # 步骤3:如果未安装,则安装软件包 - if [ $IS_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:测试基本命令功能" - # 假设texlive-commado-doc包安装了一个命令 "texdoc",我们测试其基本用法 - # 如果实际命令不同,请替换为正确的命令 - COMMAND="texdoc" - # 检查命令是否存在 - command -v $COMMAND > /dev/null 2>&1 - if [ $? -ne 0 ]; then - LOG_ERROR "命令 $COMMAND 不存在" - exit 255 - fi - - # 测试命令的基本帮助信息 - LOG_INFO "测试命令 $COMMAND 的 --help 参数" - $COMMAND --help > /dev/null 2>&1 - CHECK_RESULT $? 0 0 "命令 $COMMAND 的 --help 参数测试失败" - - # 步骤5:测试无效参数 - LOG_INFO "步骤5:测试无效参数" - $COMMAND --invalid-parameter > /dev/null 2>&1 - if [ $? -ne 255 ]; then - LOG_ERROR "命令 $COMMAND 对无效参数的处理不符合预期" - exit 255 - fi - LOG_INFO "无效参数测试通过" - - # 步骤6:清理环境 - LOG_INFO "步骤6:清理环境" - if [ $IS_INSTALLED -eq 0 ]; then - LOG_INFO "卸载测试安装的软件包 $PACKAGE_NAME" - dnf remove -y "$PACKAGE_NAME" - CHECK_RESULT $? 0 0 "卸载软件包 $PACKAGE_NAME 失败" - LOG_INFO "环境已恢复到测试前状态" - else - LOG_INFO "环境保持原有安装状态" - fi - - LOG_INFO "测试完成:Test basic package usage" -} - -main "$@" \ No newline at end of file diff --git a/testcases/function_test/pkg_test/texlive-split-e/texlive-commado-doc/test_texlive-commado-doc_function_verify.sh b/testcases/function_test/pkg_test/texlive-split-e/texlive-commado-doc/test_texlive-commado-doc_function_verify.sh deleted file mode 100644 index 89ba4547d64..00000000000 --- a/testcases/function_test/pkg_test/texlive-split-e/texlive-commado-doc/test_texlive-commado-doc_function_verify.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-25 -# @License : Mulan PSL v2 -# @Desc : Test package verification -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - LOG_INFO "开始测试:Test package verification" - LOG_INFO "步骤1:检查环境中是否已安装texlive-commado-doc软件包" - if rpm -q texlive-commado-doc &>/dev/null; then - LOG_INFO "texlive-commado-doc已安装,脚本结束时将保持安装状态" - INSTALLED=true - else - LOG_INFO "texlive-commado-doc未安装,将在测试中安装" - INSTALLED=false - fi - LOG_INFO "步骤2:检查yum源中是否存在texlive-commado-doc软件包" - if ! dnf list available texlive-commado-doc &>/dev/null; then - LOG_ERROR "yum源中未找到texlive-commado-doc软件包" - exit 255 - fi - LOG_INFO "步骤3:验证指定命令的参数是否存在或不支持" - if [[ ! -n "${1}" ]]; then - LOG_ERROR "命令参数不存在或不支持" - exit 255 - fi - LOG_INFO "步骤4:执行测试命令" - if ! command -v texlive-commado-doc &>/dev/null; then - LOG_INFO "步骤4.1:安装texlive-commado-doc软件包" - dnf install -y texlive-commado-doc - CHECK_RESULT $? 0 0 "安装texlive-commado-doc失败" - fi - LOG_INFO "步骤5:执行测试命令并检查结果" - test_command_output=$(texlive-commado-doc "${1}" 2>&1) - if [[ $? -ne 0 ]]; then - LOG_ERROR "测试命令执行失败" - exit 1 - fi - CHECK_RESULT $? 0 0 "测试命令执行失败" - LOG_INFO "步骤6:清理环境" - if [[ "${INSTALLED}" == "false" ]]; then - LOG_INFO "卸载texlive-commado-doc软件包" - dnf remove -y texlive-commado-doc - CHECK_RESULT $? 0 0 "卸载texlive-commado-doc失败" - fi - LOG_INFO "测试完成" -} - -main "$@" \ No newline at end of file diff --git a/testcases/function_test/pkg_test/texlive-split-g/texlive-drac/test_texlive-drac_function_install.sh b/testcases/function_test/pkg_test/texlive-split-g/texlive-drac/test_texlive-drac_function_install.sh deleted file mode 100644 index 5bc4576bceb..00000000000 --- a/testcases/function_test/pkg_test/texlive-split-g/texlive-drac/test_texlive-drac_function_install.sh +++ /dev/null @@ -1,73 +0,0 @@ -#!/usr/bin/bash - -# Copyright (c) 2024 ISCAS .ALL rights reserved. -# This program is licensed under Mulan PSL v2. -# You can use it according to the terms and conditions of the Mulan PSL v2. -# http://license.coscl.org.cn/MulanPSL2 -# THIS PROGRAM IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, -# EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, -# MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. -# See the Mulan PSL v2 for more details. - -# ############################################# -# @Author : honghua -# @Contact : honghua@iscas.ac.cn -# @Date : 2025-12-12 -# @License : Mulan PSL v2 -# @Desc : Test the installation of texlive-drac package -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - LOG_INFO "开始测试 texlive-drac 包的安装功能" - - # 检查是否已安装 texlive-drac - if dnf list installed texlive-drac &>/dev/null; then - LOG_INFO "texlive-drac 已安装,测试将保持安装状态" - installed=true - else - LOG_INFO "texlive-drac 未安装,测试将进行安装与卸载" - installed=false - fi - - # 检查 yum 源中是否有 texlive-drac 包 - LOG_INFO "检查 yum 源中是否存在 texlive-drac 包" - if ! dnf list available texlive-drac &>/dev/null; then - LOG_ERROR "yum 源中不存在 texlive-drac 包" - exit 255 - fi - - # 安装 texlive-drac(如果未安装) - if [ "$installed" = false ]; then - LOG_INFO "开始安装 texlive-drac 包" - dnf install -y texlive-drac - CHECK_RESULT $? 0 0 "texlive-drac 包安装失败" - fi - - # 测试命令参数是否存在或不支持 - LOG_INFO "测试命令参数是否存在或不支持" - if ! tex --help | grep -q "drac"; then - LOG_ERROR "texlive-drac 不支持 "drac" 参数" - if [ "$installed" = false ]; then - dnf remove -y texlive-drac - fi - exit 255 - fi - - # 执行命令并检查是否成功 - LOG_INFO "执行命令并检查结果" - tex --drac test.tex - CHECK_RESULT $? 0 0 "执行命令失败" - - # 清理环境(如果最初未安装) - if [ "$installed" = false ]; then - LOG_INFO "卸载 texlive-drac 包以恢复环境" - dnf remove -y texlive-drac - CHECK_RESULT $? 0 0 "texlive-drac 包卸载失败" - fi - - LOG_INFO "测试完成,环境已恢复" -} - -main "$@" \ No newline at end of file diff --git a/testcases/function_test/pkg_test/texlive-split-i/texlive-fancylabel-doc/test_texlive-fancylabel-doc_function_uninstall.sh b/testcases/function_test/pkg_test/texlive-split-i/texlive-fancylabel-doc/test_texlive-fancylabel-doc_function_uninstall.sh deleted file mode 100644 index 5240188e14e..00000000000 --- a/testcases/function_test/pkg_test/texlive-split-i/texlive-fancylabel-doc/test_texlive-fancylabel-doc_function_uninstall.sh +++ /dev/null @@ -1,122 +0,0 @@ -#!/usr/bin/bash - -# Copyright (c) 2024 ISCAS .ALL rights reserved. -# This program is licensed under Mulan PSL v2. -# You can use it according to the terms and conditions of the Mulan PSL v2. -# http://license.coscl.org.cn/MulanPSL2 -# THIS PROGRAM IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, -# EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, -# MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. -# See the Mulan PSL v2 for more details. - -# ############################################# -# @Author : honghua -# @Contact : honghua@iscas.ac.cn -# @Date : 2026-02-20 -# @License : Mulan PSL v2 -# @Desc : Test package removal -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - # 定义日志函数(根据要求直接使用,无需定义) - LOG_INFO() { - echo "[INFO] $*" - } - - LOG_ERROR() { - echo "[ERROR] $*" - } - - # 定义检查结果函数(根据要求直接使用,无需定义) - CHECK_RESULT() { - local actual=$1 - local expect=$2 - local mode=$3 - local message=$4 - if [ $mode -eq 0 ]; then - if [ $actual -ne $expect ]; then - LOG_ERROR "$message" - exit $actual - fi - elif [ $mode -eq 1 ]; then - if [ $actual -eq $expect ]; then - LOG_ERROR "$message" - exit 1 - fi - fi - } - - # 定义SSH命令函数(根据要求直接使用,无需定义) - SSH_CMD() { - local cmd=$1 - local node_ip=$2 - local node_password=$3 - local node_user=$4 - sshpass -p "$node_password" ssh -o StrictHostKeyChecking=no "$node_user@$node_ip" "$cmd" - } - - # 测试脚本开始 - LOG_INFO "开始测试:Test package removal" - - # 步骤1:检查yum源中是否存在软件包 - LOG_INFO "步骤1:检查yum源中是否存在软件包 texlive-fancylabel-doc" - dnf list available texlive-fancylabel-doc &>/dev/null - if [ $? -ne 0 ]; then - LOG_ERROR "yum源中不存在软件包 texlive-fancylabel-doc" - exit 255 - fi - - # 步骤2:检查当前环境是否已安装软件包 - LOG_INFO "步骤2:检查当前环境是否已安装软件包 texlive-fancylabel-doc" - dnf list installed texlive-fancylabel-doc &>/dev/null - if [ $? -eq 0 ]; then - LOG_INFO "软件包 texlive-fancylabel-doc 已安装,测试结束后将保持安装状态" - INSTALLED=true - else - LOG_INFO "软件包 texlive-fancylabel-doc 未安装,将在测试步骤中安装并在结束前卸载" - INSTALLED=false - fi - - # 步骤3:如果未安装,则安装软件包 - if [ "$INSTALLED" = "false" ]; then - LOG_INFO "步骤3:安装软件包 texlive-fancylabel-doc" - dnf install -y texlive-fancylabel-doc - CHECK_RESULT $? 0 0 "安装软件包 texlive-fancylabel-doc 失败" - fi - - # 步骤4:执行测试操作(这里模拟测试操作,例如检查软件包文件) - LOG_INFO "步骤4:执行测试操作,检查软件包文件是否存在" - rpm -ql texlive-fancylabel-doc &>/dev/null - CHECK_RESULT $? 0 0 "软件包 texlive-fancylabel-doc 文件检查失败" - - # 步骤5:执行卸载操作(仅当测试前未安装时才执行) - if [ "$INSTALLED" = "false" ]; then - LOG_INFO "步骤5:卸载软件包 texlive-fancylabel-doc" - dnf remove -y texlive-fancylabel-doc - CHECK_RESULT $? 0 0 "卸载软件包 texlive-fancylabel-doc 失败" - - # 验证卸载是否成功 - dnf list installed texlive-fancylabel-doc &>/dev/null - CHECK_RESULT $? 1 1 "软件包 texlive-fancylabel-doc 卸载后仍显示已安装" - else - LOG_INFO "步骤5:测试前已安装软件包,跳过卸载步骤" - fi - - # 步骤6:环境恢复确认 - LOG_INFO "步骤6:环境恢复确认" - if [ "$INSTALLED" = "true" ]; then - dnf list installed texlive-fancylabel-doc &>/dev/null - CHECK_RESULT $? 0 0 "环境未恢复到初始安装状态" - LOG_INFO "环境已恢复到初始安装状态" - else - dnf list installed texlive-fancylabel-doc &>/dev/null - CHECK_RESULT $? 1 1 "环境未恢复到初始未安装状态" - LOG_INFO "环境已恢复到初始未安装状态" - fi - - LOG_INFO "测试完成:Test package removal" -} - -main "$@" \ No newline at end of file diff --git a/testcases/function_test/pkg_test/texlive-split-p/texlive-mylatexformat-doc/test_texlive-mylatexformat-doc_function_help.sh b/testcases/function_test/pkg_test/texlive-split-p/texlive-mylatexformat-doc/test_texlive-mylatexformat-doc_function_help.sh deleted file mode 100644 index 2ede2da2232..00000000000 --- a/testcases/function_test/pkg_test/texlive-split-p/texlive-mylatexformat-doc/test_texlive-mylatexformat-doc_function_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-04-01 -# @License : Mulan PSL v2 -# @Desc : Display package documentation -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - LOG_INFO "开始测试: Display package documentation" - LOG_INFO "步骤1: 检查texlive-mylatexformat-doc软件包是否在yum源中可用" - dnf list available texlive-mylatexformat-doc 2>/dev/null | grep -q texlive-mylatexformat-doc - if [ $? -ne 0 ]; then - LOG_ERROR "texlive-mylatexformat-doc软件包在yum源中不可用" - exit 255 - fi - LOG_INFO "texlive-mylatexformat-doc软件包在yum源中可用" - - LOG_INFO "步骤2: 检查texlive-mylatexformat-doc软件包是否已安装" - rpm -q texlive-mylatexformat-doc >/dev/null 2>&1 - if [ $? -eq 0 ]; then - LOG_INFO "texlive-mylatexformat-doc软件包已安装,测试后保持安装状态" - INSTALLED=true - else - LOG_INFO "texlive-mylatexformat-doc软件包未安装,将在测试过程中安装" - INSTALLED=false - fi - - LOG_INFO "步骤3: 安装texlive-mylatexformat-doc软件包(如未安装)" - if [ "$INSTALLED" = "false" ]; then - dnf install -y texlive-mylatexformat-doc - CHECK_RESULT $? 0 0 "安装texlive-mylatexformat-doc软件包失败" - LOG_INFO "texlive-mylatexformat-doc软件包安装成功" - fi - - LOG_INFO "步骤4: 检查texdoc命令是否支持--help参数" - texdoc --help >/dev/null 2>&1 - if [ $? -ne 0 ]; then - LOG_ERROR "texdoc命令不支持--help参数或命令执行失败" - if [ "$INSTALLED" = "false" ]; then - dnf remove -y texlive-mylatexformat-doc - fi - exit 255 - fi - LOG_INFO "texdoc命令支持--help参数" - - LOG_INFO "步骤5: 执行texdoc --help命令查看帮助信息" - texdoc --help - CHECK_RESULT $? 0 0 "执行texdoc --help命令失败" - LOG_INFO "texdoc --help命令执行成功,帮助信息已显示" - - LOG_INFO "步骤6: 清理环境,恢复原始状态" - if [ "$INSTALLED" = "false" ]; then - dnf remove -y texlive-mylatexformat-doc - CHECK_RESULT $? 0 0 "卸载texlive-mylatexformat-doc软件包失败" - LOG_INFO "texlive-mylatexformat-doc软件包已卸载,环境已恢复" - else - LOG_INFO "texlive-mylatexformat-doc软件包保持安装状态,无需卸载" - fi - - LOG_INFO "测试完成: Display package documentation" -} - -main "$@" \ No newline at end of file diff --git a/testcases/function_test/pkg_test/texlive-split-s/texlive-pst-coil-doc/test_texlive-pst-coil-doc_function_info_page.sh b/testcases/function_test/pkg_test/texlive-split-s/texlive-pst-coil-doc/test_texlive-pst-coil-doc_function_info_page.sh deleted file mode 100644 index b79abf02e72..00000000000 --- a/testcases/function_test/pkg_test/texlive-split-s/texlive-pst-coil-doc/test_texlive-pst-coil-doc_function_info_page.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-17 -# @License : Mulan PSL v2 -# @Desc : Check for info page availability -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - set -e - - LOG_INFO "开始测试:检查 texlive-pst-coil-doc 的 info page 可用性" - - # 步骤1:检查软件包是否在 yum 源中 - LOG_INFO "步骤1:检查 texlive-pst-coil-doc 软件包是否在 yum 源中" - if ! dnf list texlive-pst-coil-doc &>/dev/null; then - LOG_ERROR "软件包 texlive-pst-coil-doc 不在 yum 源中" - exit 255 - fi - - # 步骤2:检查软件包是否已安装 - LOG_INFO "步骤2:检查 texlive-pst-coil-doc 软件包是否已安装" - if rpm -q texlive-pst-coil-doc &>/dev/null; then - LOG_INFO "软件包 texlive-pst-coil-doc 已安装" - INSTALLED=true - else - LOG_INFO "软件包 texlive-pst-coil-doc 未安装" - INSTALLED=false - fi - - # 步骤3:如果未安装,则安装软件包 - if [ "$INSTALLED" = false ]; then - LOG_INFO "步骤3:安装 texlive-pst-coil-doc 软件包" - dnf install -y texlive-pst-coil-doc - CHECK_RESULT $? 0 0 "安装 texlive-pst-coil-doc 失败" - fi - - # 步骤4:检查 info page 是否可用 - LOG_INFO "步骤4:检查 texlive-pst-coil-doc 的 info page 是否可用" - if info texlive-pst-coil-doc &>/dev/null; then - LOG_INFO "info page 可用" - CHECK_RESULT $? 0 0 "info page 不可用" - else - LOG_ERROR "info page 不可用或命令不支持" - exit 255 - fi - - # 步骤5:清理环境 - LOG_INFO "步骤5:清理环境" - if [ "$INSTALLED" = false ]; then - LOG_INFO "卸载 texlive-pst-coil-doc 软件包" - dnf remove -y texlive-pst-coil-doc - CHECK_RESULT $? 0 0 "卸载 texlive-pst-coil-doc 失败" - else - LOG_INFO "保持软件包安装状态" - fi - - LOG_INFO "测试完成:texlive-pst-coil-doc 的 info page 可用性检查通过" -} - -main "$@" \ No newline at end of file diff --git a/testcases/function_test/pkg_test/texlive-split-s/texlive-pst-coil-doc/test_texlive-pst-coil-doc_function_manpage.sh b/testcases/function_test/pkg_test/texlive-split-s/texlive-pst-coil-doc/test_texlive-pst-coil-doc_function_manpage.sh deleted file mode 100644 index 506d2ee5592..00000000000 --- a/testcases/function_test/pkg_test/texlive-split-s/texlive-pst-coil-doc/test_texlive-pst-coil-doc_function_manpage.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-17 -# @License : Mulan PSL v2 -# @Desc : Check for man page availability -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - # 定义软件包名称 - PACKAGE_NAME="texlive-pst-coil-doc" - - # 步骤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_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 "安装软件包失败" - fi - - # 步骤4: 检查man命令是否存在 - LOG_INFO "检查man命令是否存在" - command -v man &>/dev/null - CHECK_RESULT $? 0 0 "man命令不存在" - - # 步骤5: 检查man命令是否支持-k参数 - LOG_INFO "检查man命令是否支持-k参数" - man -k "test" &>/dev/null 2>&1 - if [ $? -eq 255 ]; then - LOG_ERROR "man命令不支持-k参数" - exit 255 - fi - - # 步骤6: 使用man -k查找与软件包相关的man页面 - LOG_INFO "使用man -k查找与软件包相关的man页面" - man -k pst-coil 2>/dev/null | grep -q pst-coil - CHECK_RESULT $? 0 0 "未找到与pst-coil相关的man页面" - - # 步骤7: 尝试查看具体的man页面 - LOG_INFO "尝试查看具体的man页面" - man pst-coil 2>&1 | head -5 | grep -q "PST" - CHECK_RESULT $? 0 0 "无法查看pst-coil的man页面" - - # 步骤8: 清理环境,如果测试前未安装则卸载软件包 - LOG_INFO "清理测试环境" - if [ "$INSTALLED_BEFORE_TEST" = false ]; then - LOG_INFO "卸载软件包: $PACKAGE_NAME" - dnf remove -y $PACKAGE_NAME - CHECK_RESULT $? 0 0 "卸载软件包失败" - else - LOG_INFO "测试前软件包已安装,保持安装状态" - fi - - LOG_INFO "测试完成: man页面可用性检查通过" -} - -main "$@" \ No newline at end of file diff --git a/testcases/function_test/pkg_test/texlive-split-x/texlive-tikz-bayesnet-doc/test_texlive-tikz-bayesnet-doc_example_files.sh b/testcases/function_test/pkg_test/texlive-split-x/texlive-tikz-bayesnet-doc/test_texlive-tikz-bayesnet-doc_example_files.sh deleted file mode 100644 index a0296707dc7..00000000000 --- a/testcases/function_test/pkg_test/texlive-split-x/texlive-tikz-bayesnet-doc/test_texlive-tikz-bayesnet-doc_example_files.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-28 -# @License : Mulan PSL v2 -# @Desc : 确认 texlive-tikz-bayesnet-doc 文档中是否包含绘制贝叶斯网络的示例代码文件 -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - LOG_INFO "开始测试 texlive-tikz-bayesnet-doc 文档中是否包含绘制贝叶斯网络的示例代码文件" - - LOG_INFO "步骤1:检查 texlive-tikz-bayesnet-doc 软件包是否在 yum 源中" - dnf list available texlive-tikz-bayesnet-doc > /dev/null 2>&1 - if [ $? -ne 0 ]; then - LOG_ERROR "软件包 texlive-tikz-bayesnet-doc 不在 yum 源中" - exit 255 - fi - - LOG_INFO "步骤2:检查 texlive-tikz-bayesnet-doc 是否已经安装" - rpm -q texlive-tikz-bayesnet-doc > /dev/null 2>&1 - if [ $? -eq 0 ]; then - LOG_INFO "软件包 texlive-tikz-bayesnet-doc 已经安装,测试结束后将保持安装状态" - INSTALLED=1 - else - LOG_INFO "软件包 texlive-tikz-bayesnet-doc 未安装,将在测试步骤中安装" - INSTALLED=0 - fi - - if [ $INSTALLED -eq 0 ]; then - LOG_INFO "步骤3:安装 texlive-tikz-bayesnet-doc 软件包" - dnf install -y texlive-tikz-bayesnet-doc - CHECK_RESULT $? 0 0 "安装 texlive-tikz-bayesnet-doc 失败" - fi - - LOG_INFO "步骤4:检查 texlive-tikz-bayesnet-doc 文档中是否包含绘制贝叶斯网络的示例代码文件" - rpm -ql texlive-tikz-bayesnet-doc | grep -i "bayes" | grep -i "example" > /dev/null 2>&1 - CHECK_RESULT $? 0 0 "texlive-tikz-bayesnet-doc 文档中未找到贝叶斯网络示例代码文件" - - LOG_INFO "步骤5:清理测试环境" - if [ $INSTALLED -eq 0 ]; then - LOG_INFO "卸载 texlive-tikz-bayesnet-doc 软件包" - dnf remove -y texlive-tikz-bayesnet-doc - CHECK_RESULT $? 0 0 "卸载 texlive-tikz-bayesnet-doc 失败" - else - LOG_INFO "测试开始前软件包已安装,测试结束后保持安装状态" - fi - - LOG_INFO "测试完成" -} - -main "$@" \ No newline at end of file diff --git a/testcases/function_test/pkg_test/texlive-split-x/texlive-tikz-bayesnet-doc/test_texlive-tikz-bayesnet-doc_usage_guide.sh b/testcases/function_test/pkg_test/texlive-split-x/texlive-tikz-bayesnet-doc/test_texlive-tikz-bayesnet-doc_usage_guide.sh deleted file mode 100644 index f16ec5d8f3d..00000000000 --- a/testcases/function_test/pkg_test/texlive-split-x/texlive-tikz-bayesnet-doc/test_texlive-tikz-bayesnet-doc_usage_guide.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-28 -# @License : Mulan PSL v2 -# @Desc : 检查 texlive-tikz-bayesnet-doc 文档是否包含 tikz-bayesnet 宏包的基本用法说明 -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - # 检查 texlive-tikz-bayesnet-doc 文档是否包含 tikz-bayesnet 宏包的基本用法说明 - - LOG_INFO "1. 检查 yum 源中是否存在 texlive-tikz-bayesnet-doc 软件包" - dnf list texlive-tikz-bayesnet-doc 2>/dev/null | grep -q "texlive-tikz-bayesnet-doc" - if [ $? -ne 0 ]; then - LOG_ERROR "yum 源中未找到 texlive-tikz-bayesnet-doc 软件包" - exit 255 - fi - - LOG_INFO "2. 检查系统是否已安装 texlive-tikz-bayesnet-doc" - rpm -q texlive-tikz-bayesnet-doc >/dev/null 2>&1 - if [ $? -eq 0 ]; then - LOG_INFO "texlive-tikz-bayesnet-doc 已安装,脚本结束后将保持安装状态" - INSTALLED_BEFORE=1 - else - LOG_INFO "texlive-tikz-bayesnet-doc 未安装,将在测试过程中安装" - INSTALLED_BEFORE=0 - fi - - if [ ${INSTALLED_BEFORE} -eq 0 ]; then - LOG_INFO "3. 安装 texlive-tikz-bayesnet-doc 软件包" - dnf install -y texlive-tikz-bayesnet-doc - CHECK_RESULT $? 0 0 "安装 texlive-tikz-bayesnet-doc 失败" - fi - - LOG_INFO "4. 检查 texlive-tikz-bayesnet-doc 文档路径" - DOC_PATH=$(rpm -ql texlive-tikz-bayesnet-doc | grep -E "\.pdf$|\.html$" | head -1) - if [ -z "${DOC_PATH}" ]; then - LOG_ERROR "未找到 texlive-tikz-bayesnet-doc 文档文件" - exit 1 - fi - - LOG_INFO "5. 检查文档是否包含 tikz-bayesnet 宏包的基本用法说明" - if [[ "${DOC_PATH}" == *.pdf ]]; then - if command -v pdftotext >/dev/null 2>&1; then - pdftotext "${DOC_PATH}" - 2>/dev/null | grep -i "bayesnet" | grep -i "usage\|basic\|tutorial" >/dev/null 2>&1 - CHECK_RESULT $? 0 0 "文档中未找到 tikz-bayesnet 宏包的基本用法说明" - else - LOG_INFO "未安装 pdftotext 工具,跳过 PDF 内容检查" - exit 255 - fi - elif [[ "${DOC_PATH}" == *.html ]]; then - grep -i "bayesnet" "${DOC_PATH}" | grep -i "usage\|basic\|tutorial" >/dev/null 2>&1 - CHECK_RESULT $? 0 0 "文档中未找到 tikz-bayesnet 宏包的基本用法说明" - else - LOG_ERROR "不支持的文档格式" - exit 255 - fi - - LOG_INFO "6. 清理测试环境" - if [ ${INSTALLED_BEFORE} -eq 0 ]; then - LOG_INFO "卸载 texlive-tikz-bayesnet-doc 软件包" - dnf remove -y texlive-tikz-bayesnet-doc - CHECK_RESULT $? 0 0 "卸载 texlive-tikz-bayesnet-doc 失败" - else - LOG_INFO "系统之前已安装 texlive-tikz-bayesnet-doc,保持安装状态" - fi - - LOG_INFO "7. 测试完成" -} - -main "$@" \ No newline at end of file diff --git a/testcases/function_test/pkg_test/texlive-split-x/texlive-titlefoot/test_texlive-titlefoot_function_basic_usage.sh b/testcases/function_test/pkg_test/texlive-split-x/texlive-titlefoot/test_texlive-titlefoot_function_basic_usage.sh deleted file mode 100644 index 79a365a17a6..00000000000 --- a/testcases/function_test/pkg_test/texlive-split-x/texlive-titlefoot/test_texlive-titlefoot_function_basic_usage.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-16 -# @License : Mulan PSL v2 -# @Desc : Test basic document usage with titlefoot -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - # 定义日志函数(直接使用) - LOG_INFO() { - echo "[INFO] $*" - } - - LOG_ERROR() { - echo "[ERROR] $*" - } - - # 检查软件包是否存在 - 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 - # 这里以假设的检查方式为例,实际应根据具体命令调整 - $cmd --help 2>&1 | grep -q "$param" - if [ $? -ne 0 ]; then - LOG_ERROR "命令 $cmd 不支持参数 $param" - exit 255 - fi - } - - # 主测试函数 - test_titlefoot_basic_usage() { - LOG_INFO "开始测试:Test basic document usage with titlefoot" - - # 定义测试所需软件包 - PACKAGE_NAME="texlive-titlefoot" - INSTALLED=false - - # 步骤1:检查环境是否已安装 - LOG_INFO "步骤1:检查环境是否已安装 $PACKAGE_NAME" - rpm -q "$PACKAGE_NAME" &>/dev/null - if [ $? -eq 0 ]; then - LOG_INFO "$PACKAGE_NAME 已安装,测试结束后将保持安装状态" - INSTALLED=true - else - LOG_INFO "$PACKAGE_NAME 未安装,将在测试过程中安装" - fi - - # 步骤2:检查yum源中是否有该软件包 - LOG_INFO "步骤2:检查yum源中是否有 $PACKAGE_NAME" - check_package_exists "$PACKAGE_NAME" - - # 步骤3:如果未安装,则安装软件包 - if [ "$INSTALLED" = false ]; then - LOG_INFO "步骤3:安装 $PACKAGE_NAME" - dnf install -y "$PACKAGE_NAME" - CHECK_RESULT $? 0 0 "安装 $PACKAGE_NAME 失败" - fi - - # 步骤4:测试基本文档使用 - LOG_INFO "步骤4:测试基本文档使用" - # 假设测试命令为:texlive-titlefoot --test-basic - TEST_CMD="texlive-titlefoot" - TEST_PARAM="--test-basic" - - # 检查参数是否支持 - check_command_param "$TEST_CMD" "$TEST_PARAM" - - # 执行测试命令 - $TEST_CMD $TEST_PARAM - CHECK_RESULT $? 0 0 "执行基本文档使用测试失败" - - # 步骤5:清理环境(如果测试前未安装,则卸载) - LOG_INFO "步骤5:清理环境" - 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 "测试完成:Test basic document usage with titlefoot" - } - - # 执行测试 - test_titlefoot_basic_usage -} - -main "$@" \ No newline at end of file diff --git a/testcases/function_test/pkg_test/texlive-split-x/texlive-titlefoot/test_texlive-titlefoot_function_check_installed.sh b/testcases/function_test/pkg_test/texlive-split-x/texlive-titlefoot/test_texlive-titlefoot_function_check_installed.sh deleted file mode 100644 index 391fbb75a2b..00000000000 --- a/testcases/function_test/pkg_test/texlive-split-x/texlive-titlefoot/test_texlive-titlefoot_function_check_installed.sh +++ /dev/null @@ -1,73 +0,0 @@ -#!/usr/bin/bash - -# Copyright (c) 2024 ISCAS .ALL rights reserved. -# This program is licensed under Mulan PSL v2. -# You can use it according to the terms and conditions of the Mulan PSL v2. -# http://license.coscl.org.cn/MulanPSL2 -# THIS PROGRAM IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, -# EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, -# MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. -# See the Mulan PSL v2 for more details. - -# ############################################# -# @Author : honghua -# @Contact : honghua@iscas.ac.cn -# @Date : 2026-03-16 -# @License : Mulan PSL v2 -# @Desc : Check if texlive-titlefoot is installed -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - LOG_INFO "开始检查texlive-titlefoot是否已安装" - # 检查texlive-titlefoot是否已安装 - if dnf list installed texlive-titlefoot &> /dev/null; then - LOG_INFO "texlive-titlefoot已安装,脚本结束时将保持安装状态" - INSTALLED=true - else - LOG_INFO "texlive-titlefoot未安装,将进行安装测试" - INSTALLED=false - fi - - # 检查yum源中是否有texlive-titlefoot软件包 - LOG_INFO "检查yum源中是否有texlive-titlefoot软件包" - if ! dnf list available texlive-titlefoot &> /dev/null; then - LOG_ERROR "yum源中未找到texlive-titlefoot软件包" - exit 255 - fi - - # 如果未安装,则安装软件包 - if [ "$INSTALLED" = false ]; then - LOG_INFO "开始安装texlive-titlefoot软件包" - dnf install -y texlive-titlefoot - CHECK_RESULT $? 0 0 "安装texlive-titlefoot失败" - LOG_INFO "texlive-titlefoot安装成功" - fi - - # 检查texlive-titlefoot命令是否可用 - LOG_INFO "检查texlive-titlefoot命令是否可用" - if ! command -v texlive-titlefoot &> /dev/null; then - LOG_ERROR "texlive-titlefoot命令不存在或不支持" - exit 255 - fi - - # 执行texlive-titlefoot命令并检查结果 - LOG_INFO "执行texlive-titlefoot命令" - texlive-titlefoot --version - CHECK_RESULT $? 0 0 "执行texlive-titlefoot命令失败" - - # 环境恢复:如果之前未安装,则卸载软件包 - if [ "$INSTALLED" = false ]; then - LOG_INFO "开始卸载texlive-titlefoot软件包" - dnf remove -y texlive-titlefoot - CHECK_RESULT $? 0 0 "卸载texlive-titlefoot失败" - LOG_INFO "texlive-titlefoot卸载成功,环境已恢复" - else - LOG_INFO "脚本开始时texlive-titlefoot已安装,保持安装状态" - fi - - LOG_INFO "测试完成" -} - -main "$@" \ No newline at end of file diff --git a/testcases/function_test/pkg_test/texlive-split-x/texlive-titlefoot/test_texlive-titlefoot_function_footnote.sh b/testcases/function_test/pkg_test/texlive-split-x/texlive-titlefoot/test_texlive-titlefoot_function_footnote.sh deleted file mode 100644 index c0112c99ec1..00000000000 --- a/testcases/function_test/pkg_test/texlive-split-x/texlive-titlefoot/test_texlive-titlefoot_function_footnote.sh +++ /dev/null @@ -1,64 +0,0 @@ -#!/usr/bin/bash - -# Copyright (c) 2024 ISCAS .ALL rights reserved. -# This program is licensed under Mulan PSL v2. -# You can use it according to the terms and conditions of the Mulan PSL v2. -# http://license.coscl.org.cn/MulanPSL2 -# THIS PROGRAM IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, -# EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, -# MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. -# See the Mulan PSL v2 for more details. - -# ############################################# -# @Author : honghua -# @Contact : honghua@iscas.ac.cn -# @Date : 2025-11-26 -# @License : Mulan PSL v2 -# @Desc : Test footnote functionality -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - LOG_INFO "开始测试: Test footnote functionality" - - # 检查是否已安装texlive-titlefoot软件包 - LOG_INFO "步骤1: 检查texlive-titlefoot是否已安装" - if rpm -q texlive-titlefoot &>/dev/null; then - LOG_INFO "texlive-titlefoot已安装,测试结束后将保持安装状态" - INSTALLED=true - else - LOG_INFO "texlive-titlefoot未安装,测试结束后将卸载" - INSTALLED=false - fi - - # 检查yum源中是否有texlive-titlefoot软件包 - LOG_INFO "步骤2: 检查yum源中是否存在texlive-titlefoot软件包" - if ! dnf list available texlive-titlefoot &>/dev/null; then - LOG_ERROR "yum源中不存在texlive-titlefoot软件包" - exit 255 - fi - - # 安装texlive-titlefoot软件包(如果未安装) - if [ "$INSTALLED" = false ]; then - LOG_INFO "步骤3: 安装texlive-titlefoot软件包" - dnf install -y texlive-titlefoot - CHECK_RESULT $? 0 0 "安装texlive-titlefoot失败" - fi - - # 测试footnote功能 - LOG_INFO "步骤4: 测试footnote功能" - texlua test_footnote.lua - CHECK_RESULT $? 0 0 "footnote功能测试失败" - - # 清理环境(如果测试前未安装) - if [ "$INSTALLED" = false ]; then - LOG_INFO "步骤5: 卸载texlive-titlefoot软件包" - dnf remove -y texlive-titlefoot - CHECK_RESULT $? 0 0 "卸载texlive-titlefoot失败" - fi - - LOG_INFO "测试完成: Test footnote functionality" -} - -main "$@" \ No newline at end of file diff --git a/testcases/function_test/pkg_test/texlive-split-x/texlive-titlefoot/test_texlive-titlefoot_function_title_foot.sh b/testcases/function_test/pkg_test/texlive-split-x/texlive-titlefoot/test_texlive-titlefoot_function_title_foot.sh deleted file mode 100644 index e7c9c11df9a..00000000000 --- a/testcases/function_test/pkg_test/texlive-split-x/texlive-titlefoot/test_texlive-titlefoot_function_title_foot.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-16 -# @License : Mulan PSL v2 -# @Desc : Test titlefoot package main feature -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - LOG_INFO "开始测试: Test titlefoot package main feature" - - # 检查环境是否已安装titlefoot软件包 - LOG_INFO "步骤1: 检查titlefoot软件包是否已安装" - if rpm -q titlefoot &>/dev/null; then - LOG_INFO "titlefoot软件包已安装,测试后将保持安装状态" - ALREADY_INSTALLED=true - else - LOG_INFO "titlefoot软件包未安装,将在测试中安装" - ALREADY_INSTALLED=false - fi - - # 检查yum源中是否有titlefoot软件包 - LOG_INFO "步骤2: 检查yum源中是否有titlefoot软件包" - if ! dnf list available titlefoot &>/dev/null; then - LOG_ERROR "yum源中未找到titlefoot软件包" - exit 255 - fi - - # 如果未安装,则安装软件包 - if [ "$ALREADY_INSTALLED" = false ]; then - LOG_INFO "步骤3: 安装titlefoot软件包" - dnf install -y titlefoot - CHECK_RESULT $? 0 0 "安装titlefoot软件包失败" - fi - - # 测试titlefoot命令的基本功能 - LOG_INFO "步骤4: 测试titlefoot命令的基本功能" - titlefoot --version - CHECK_RESULT $? 0 0 "titlefoot命令版本查询失败" - - # 测试titlefoot命令的特定参数 - LOG_INFO "步骤5: 测试titlefoot命令的--help参数" - if titlefoot --help &>/dev/null; then - LOG_INFO "--help参数支持" - else - LOG_ERROR "--help参数不支持" - exit 255 - fi - - # 测试titlefoot命令的无效参数 - LOG_INFO "步骤6: 测试titlefoot命令的无效参数--invalid" - if titlefoot --invalid &>/dev/null; then - LOG_ERROR "无效参数--invalid不应被支持" - exit 255 - else - LOG_INFO "无效参数--invalid正确处理" - fi - - # 测试titlefoot命令的实际功能 - LOG_INFO "步骤7: 测试titlefoot命令的实际功能" - titlefoot test_input.txt test_output.txt - CHECK_RESULT $? 0 0 "titlefoot命令执行失败" - - # 清理测试文件 - LOG_INFO "步骤8: 清理测试文件" - rm -f test_input.txt test_output.txt - - # 如果测试前未安装,则在测试后卸载软件包 - if [ "$ALREADY_INSTALLED" = false ]; then - LOG_INFO "步骤9: 卸载titlefoot软件包" - dnf remove -y titlefoot - CHECK_RESULT $? 0 0 "卸载titlefoot软件包失败" - fi - - LOG_INFO "测试完成: Test titlefoot package main feature" -} - -main "$@" \ No newline at end of file