From b83e19dda7ccea1df43184350584dc4062e3243a Mon Sep 17 00:00:00 2001 From: honghua Date: Sat, 18 Apr 2026 13:48:49 +0800 Subject: [PATCH 1/8] update testcase for testsuite texlive-elements --- .../texlive-split-h/texlive-elements.json | 12 --- ...t_texlive-elements_function_check_files.sh | 80 ---------------- ...texlive-elements_function_check_version.sh | 80 ---------------- ...t_texlive-elements_function_compile_doc.sh | 96 ------------------- 4 files changed, 268 deletions(-) delete mode 100644 testcases/function_test/pkg_test/texlive-split-h/texlive-elements/test_texlive-elements_function_check_files.sh delete mode 100644 testcases/function_test/pkg_test/texlive-split-h/texlive-elements/test_texlive-elements_function_check_version.sh delete mode 100644 testcases/function_test/pkg_test/texlive-split-h/texlive-elements/test_texlive-elements_function_compile_doc.sh diff --git a/suite2cases/function_test/pkg_test/texlive-split-h/texlive-elements.json b/suite2cases/function_test/pkg_test/texlive-split-h/texlive-elements.json index 8d63aea0349..65d3efc693c 100644 --- a/suite2cases/function_test/pkg_test/texlive-split-h/texlive-elements.json +++ b/suite2cases/function_test/pkg_test/texlive-split-h/texlive-elements.json @@ -9,18 +9,6 @@ { "name": "test_texlive-elements_function_uninstall", "desc": "Test removal of texlive-elements package" - }, - { - "name": "test_texlive-elements_function_check_files", - "desc": "Check if core .sty or .cls files exist" - }, - { - "name": "test_texlive-elements_function_compile_doc", - "desc": "Test LaTeX compilation with elements package" - }, - { - "name": "test_texlive-elements_function_check_version", - "desc": "Check package version in documentation" } ] } \ No newline at end of file diff --git a/testcases/function_test/pkg_test/texlive-split-h/texlive-elements/test_texlive-elements_function_check_files.sh b/testcases/function_test/pkg_test/texlive-split-h/texlive-elements/test_texlive-elements_function_check_files.sh deleted file mode 100644 index 73b81e15bf5..00000000000 --- a/testcases/function_test/pkg_test/texlive-split-h/texlive-elements/test_texlive-elements_function_check_files.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-15 -# @License : Mulan PSL v2 -# @Desc : Check if core .sty or .cls files exist -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - LOG_INFO "开始测试:检查core .sty或.cls文件是否存在" - - # 定义软件包名称 - PACKAGE_NAME="texlive-elements" - - # 检查是否已安装软件包 - LOG_INFO "检查是否已安装 $PACKAGE_NAME" - if rpm -q $PACKAGE_NAME &>/dev/null; then - LOG_INFO "$PACKAGE_NAME 已安装,测试后保持安装状态" - ALREADY_INSTALLED=1 - else - LOG_INFO "$PACKAGE_NAME 未安装,将在测试中安装" - ALREADY_INSTALLED=0 - fi - - # 检查yum源中是否有该软件包 - LOG_INFO "检查yum源中是否存在 $PACKAGE_NAME" - if ! dnf list available $PACKAGE_NAME &>/dev/null; then - LOG_ERROR "yum源中未找到 $PACKAGE_NAME" - exit 255 - fi - - # 如果未安装,则安装软件包 - if [ $ALREADY_INSTALLED -eq 0 ]; then - LOG_INFO "安装 $PACKAGE_NAME" - dnf install -y $PACKAGE_NAME - CHECK_RESULT $? 0 0 "安装 $PACKAGE_NAME 失败" - fi - - # 检查core .sty或.cls文件是否存在 - LOG_INFO "检查core .sty或.cls文件是否存在" - # 假设texlive-elements安装后文件在/usr/share/texlive/texmf-dist/tex/latex/elements/目录下 - # 具体路径可能需要根据实际安装情况调整 - FILE_PATH="/usr/share/texlive/texmf-dist/tex/latex/elements" - if [ -d "$FILE_PATH" ]; then - # 检查目录下是否有.sty或.cls文件 - if ls $FILE_PATH/*.sty $FILE_PATH/*.cls 2>/dev/null | grep -q .; then - LOG_INFO "找到core .sty或.cls文件" - else - LOG_ERROR "未找到core .sty或.cls文件" - exit 1 - fi - else - LOG_ERROR "目录 $FILE_PATH 不存在" - exit 1 - fi - - # 清理环境:如果测试前未安装,则卸载软件包 - if [ $ALREADY_INSTALLED -eq 0 ]; then - LOG_INFO "卸载 $PACKAGE_NAME" - dnf remove -y $PACKAGE_NAME - CHECK_RESULT $? 0 0 "卸载 $PACKAGE_NAME 失败" - fi - - LOG_INFO "测试完成" -} - -main "$@" \ No newline at end of file diff --git a/testcases/function_test/pkg_test/texlive-split-h/texlive-elements/test_texlive-elements_function_check_version.sh b/testcases/function_test/pkg_test/texlive-split-h/texlive-elements/test_texlive-elements_function_check_version.sh deleted file mode 100644 index e308e33bf25..00000000000 --- a/testcases/function_test/pkg_test/texlive-split-h/texlive-elements/test_texlive-elements_function_check_version.sh +++ /dev/null @@ -1,80 +0,0 @@ -#!/usr/bin/bash - -# Copyright (c) 2024 ISCAS .ALL rights reserved. -# This program is licensed under Mulan PSL v2. -# You can use it according to the terms and conditions of the Mulan PSL v2. -# http://license.coscl.org.cn/MulanPSL2 -# THIS PROGRAM IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, -# EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, -# MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. -# See the Mulan PSL v2 for more details. - -# ############################################# -# @Author : honghua -# @Contact : honghua@iscas.ac.cn -# @Date : 2026-03-15 -# @License : Mulan PSL v2 -# @Desc : Check package version in documentation -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - # 定义软件包名称 - PACKAGE_NAME="texlive-elements" - LOG_INFO "开始测试:检查texlive-elements软件包版本信息" - # 步骤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}软件包" - rpm -q ${PACKAGE_NAME} > /dev/null 2>&1 - if [ $? -eq 0 ]; then - LOG_INFO "检测到${PACKAGE_NAME}软件包已安装" - INSTALLED="true" - else - LOG_INFO "检测到${PACKAGE_NAME}软件包未安装" - INSTALLED="false" - fi - # 步骤3:如果未安装,则安装软件包 - if [ "${INSTALLED}" = "false" ]; then - LOG_INFO "步骤3:安装${PACKAGE_NAME}软件包" - dnf install -y ${PACKAGE_NAME} - CHECK_RESULT $? 0 0 "安装${PACKAGE_NAME}软件包失败" - LOG_INFO "安装${PACKAGE_NAME}软件包成功" - fi - # 步骤4:检查软件包版本信息 - LOG_INFO "步骤4:检查${PACKAGE_NAME}软件包版本信息" - rpm -q ${PACKAGE_NAME} --queryformat "%{VERSION}-%{RELEASE}\n" > /tmp/package_version.txt - CHECK_RESULT $? 0 0 "获取${PACKAGE_NAME}软件包版本信息失败" - PACKAGE_VERSION=$(cat /tmp/package_version.txt) - LOG_INFO "${PACKAGE_NAME}软件包版本信息:${PACKAGE_VERSION}" - # 步骤5:检查文档中是否包含版本信息 - LOG_INFO "步骤5:检查文档中是否包含版本信息" - if [ -f "/usr/share/doc/${PACKAGE_NAME}/README" ]; then - grep -q "${PACKAGE_VERSION}" /usr/share/doc/${PACKAGE_NAME}/README - CHECK_RESULT $? 0 0 "文档中未找到版本信息${PACKAGE_VERSION}" - LOG_INFO "文档中包含版本信息${PACKAGE_VERSION}" - else - LOG_INFO "未找到/usr/share/doc/${PACKAGE_NAME}/README文件,跳过文档检查" - fi - # 步骤6:清理环境 - LOG_INFO "步骤6:清理环境" - rm -f /tmp/package_version.txt - if [ "${INSTALLED}" = "false" ]; then - LOG_INFO "卸载${PACKAGE_NAME}软件包" - dnf remove -y ${PACKAGE_NAME} - CHECK_RESULT $? 0 0 "卸载${PACKAGE_NAME}软件包失败" - LOG_INFO "卸载${PACKAGE_NAME}软件包成功" - else - LOG_INFO "保持${PACKAGE_NAME}软件包安装状态" - fi - LOG_INFO "测试完成:检查texlive-elements软件包版本信息" -} - -main "$@" \ No newline at end of file diff --git a/testcases/function_test/pkg_test/texlive-split-h/texlive-elements/test_texlive-elements_function_compile_doc.sh b/testcases/function_test/pkg_test/texlive-split-h/texlive-elements/test_texlive-elements_function_compile_doc.sh deleted file mode 100644 index 35770db4d2c..00000000000 --- a/testcases/function_test/pkg_test/texlive-split-h/texlive-elements/test_texlive-elements_function_compile_doc.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-15 -# @License : Mulan PSL v2 -# @Desc : Test LaTeX compilation with elements package -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - # 测试脚本开始 - LOG_INFO "开始测试:Test LaTeX compilation with elements package" - - # 步骤1:检查环境中是否已安装texlive-elements软件包 - LOG_INFO "步骤1:检查环境中是否已安装texlive-elements软件包" - if rpm -q texlive-elements > /dev/null 2>&1; then - LOG_INFO "texlive-elements已安装,脚本结束时将保持安装状态" - already_installed=true - else - LOG_INFO "texlive-elements未安装,将在测试过程中安装" - already_installed=false - fi - - # 步骤2:检查yum源中是否存在texlive-elements软件包 - LOG_INFO "步骤2:检查yum源中是否存在texlive-elements软件包" - dnf list available texlive-elements > /dev/null 2>&1 - CHECK_RESULT $? 0 0 "yum源中未找到texlive-elements软件包" - if [ $? -ne 0 ]; then - LOG_ERROR "yum源中未找到texlive-elements软件包" - exit 255 - fi - - # 步骤3:安装texlive-elements软件包(如果未安装) - if [ "$already_installed" = false ]; then - LOG_INFO "步骤3:安装texlive-elements软件包" - dnf install -y texlive-elements - CHECK_RESULT $? 0 0 "安装texlive-elements失败" - fi - - # 步骤4:检查latex命令是否可用 - LOG_INFO "步骤4:检查latex命令是否可用" - which latex > /dev/null 2>&1 - CHECK_RESULT $? 0 0 "latex命令不可用" - - # 步骤5:创建一个简单的LaTeX测试文档 - LOG_INFO "步骤5:创建一个简单的LaTeX测试文档" - cat > test_document.tex << "EOF" - \documentclass{article} - \usepackage{elements} - \begin{document} - Test document using elements package. - \end{document} - EOF - CHECK_RESULT $? 0 0 "创建LaTeX测试文档失败" - - # 步骤6:使用latex命令编译测试文档 - LOG_INFO "步骤6:使用latex命令编译测试文档" - latex -interaction=nonstopmode test_document.tex > /dev/null 2>&1 - CHECK_RESULT $? 0 0 "LaTeX编译失败" - - # 步骤7:检查生成的DVI文件 - LOG_INFO "步骤7:检查生成的DVI文件" - if [ -f test_document.dvi ]; then - LOG_INFO "DVI文件生成成功" - else - LOG_ERROR "DVI文件未生成" - exit 1 - fi - - # 步骤8:清理生成的临时文件 - LOG_INFO "步骤8:清理生成的临时文件" - rm -f test_document.tex test_document.aux test_document.log test_document.dvi - - # 步骤9:卸载texlive-elements软件包(如果之前未安装) - if [ "$already_installed" = false ]; then - LOG_INFO "步骤9:卸载texlive-elements软件包" - dnf remove -y texlive-elements - CHECK_RESULT $? 0 0 "卸载texlive-elements失败" - fi - - LOG_INFO "测试完成:Test LaTeX compilation with elements package" -} - -main "$@" \ No newline at end of file From 6bc035fb25ca88c6ffb1f4cfbd6f138c0fd1e076 Mon Sep 17 00:00:00 2001 From: honghua Date: Sat, 18 Apr 2026 13:50:19 +0800 Subject: [PATCH 2/8] update testcase for testsuite texlive-pgfopts --- .../texlive-split-r/texlive-pgfopts.json | 16 ---- .../test_texlive-pgfopts_function_global.sh | 69 ---------------- .../test_texlive-pgfopts_function_keyval.sh | 77 ------------------ .../test_texlive-pgfopts_function_load.sh | 66 --------------- .../test_texlive-pgfopts_function_local.sh | 81 ------------------- 5 files changed, 309 deletions(-) delete mode 100644 testcases/function_test/pkg_test/texlive-split-r/texlive-pgfopts/test_texlive-pgfopts_function_global.sh delete mode 100644 testcases/function_test/pkg_test/texlive-split-r/texlive-pgfopts/test_texlive-pgfopts_function_keyval.sh delete mode 100644 testcases/function_test/pkg_test/texlive-split-r/texlive-pgfopts/test_texlive-pgfopts_function_load.sh delete mode 100644 testcases/function_test/pkg_test/texlive-split-r/texlive-pgfopts/test_texlive-pgfopts_function_local.sh diff --git a/suite2cases/function_test/pkg_test/texlive-split-r/texlive-pgfopts.json b/suite2cases/function_test/pkg_test/texlive-split-r/texlive-pgfopts.json index ba79ad94a99..3c2f565cdb7 100644 --- a/suite2cases/function_test/pkg_test/texlive-split-r/texlive-pgfopts.json +++ b/suite2cases/function_test/pkg_test/texlive-split-r/texlive-pgfopts.json @@ -2,10 +2,6 @@ "path": "$OET_PATH/testcases/function_test/pkg_test/texlive-split-r/texlive-pgfopts", "machine num": 1, "cases": [ - { - "name": "test_texlive-pgfopts_function_load", - "desc": "Test loading the package" - }, { "name": "test_texlive-pgfopts_function_install", "desc": "Test if the texlive-pgfopts package is installed on the system" @@ -13,18 +9,6 @@ { "name": "test_texlive-pgfopts_function_uninstall", "desc": "Test the uninstallation process of the texlive-pgfopts package" - }, - { - "name": "test_texlive-pgfopts_function_keyval", - "desc": "Test parsing LaTeX key-value options with pgfopts" - }, - { - "name": "test_texlive-pgfopts_function_global", - "desc": "Test setting global package options" - }, - { - "name": "test_texlive-pgfopts_function_local", - "desc": "Test setting local (per-package) options" } ] } \ No newline at end of file diff --git a/testcases/function_test/pkg_test/texlive-split-r/texlive-pgfopts/test_texlive-pgfopts_function_global.sh b/testcases/function_test/pkg_test/texlive-split-r/texlive-pgfopts/test_texlive-pgfopts_function_global.sh deleted file mode 100644 index 5dad9755159..00000000000 --- a/testcases/function_test/pkg_test/texlive-split-r/texlive-pgfopts/test_texlive-pgfopts_function_global.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-18 -# @License : Mulan PSL v2 -# @Desc : Test setting global package options -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - # 判断是否已经安装texlive-pgfopts - LOG_INFO "检查是否已安装texlive-pgfopts" - rpm -q texlive-pgfopts > /dev/null 2>&1 - if [ $? -eq 0 ]; then - LOG_INFO "texlive-pgfopts已安装,测试后保持安装状态" - INSTALLED=1 - else - LOG_INFO "texlive-pgfopts未安装,测试后需要卸载" - INSTALLED=0 - fi - - # 检查yum源中是否有texlive-pgfopts软件包 - LOG_INFO "检查yum源中是否有texlive-pgfopts软件包" - dnf list available texlive-pgfopts > /dev/null 2>&1 - CHECK_RESULT $? 0 0 "yum源中未找到texlive-pgfopts软件包" - if [ $? -ne 0 ]; then - LOG_ERROR "yum源中未找到texlive-pgfopts软件包" - exit 255 - fi - - # 如果未安装,则安装texlive-pgfopts - if [ $INSTALLED -eq 0 ]; then - LOG_INFO "安装texlive-pgfopts" - dnf install -y texlive-pgfopts - CHECK_RESULT $? 0 0 "安装texlive-pgfopts失败" - fi - - # 测试设置全局包选项 - LOG_INFO "测试设置全局包选项" - pdflatex -interaction=nonstopmode "\documentclass{article}\usepackage{pgfopts}\begin{document}Test\end{document}" > /dev/null 2>&1 - CHECK_RESULT $? 0 0 "设置全局包选项失败" - - # 清理临时文件 - LOG_INFO "清理临时文件" - rm -f *.aux *.log *.pdf > /dev/null 2>&1 - - # 如果之前未安装,则卸载texlive-pgfopts - if [ $INSTALLED -eq 0 ]; then - LOG_INFO "卸载texlive-pgfopts" - dnf remove -y texlive-pgfopts - CHECK_RESULT $? 0 0 "卸载texlive-pgfopts失败" - fi - - LOG_INFO "测试完成" -} - -main "$@" \ No newline at end of file diff --git a/testcases/function_test/pkg_test/texlive-split-r/texlive-pgfopts/test_texlive-pgfopts_function_keyval.sh b/testcases/function_test/pkg_test/texlive-split-r/texlive-pgfopts/test_texlive-pgfopts_function_keyval.sh deleted file mode 100644 index d82edc10c5b..00000000000 --- a/testcases/function_test/pkg_test/texlive-split-r/texlive-pgfopts/test_texlive-pgfopts_function_keyval.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-18 -# @License : Mulan PSL v2 -# @Desc : Test parsing LaTeX key-value options with pgfopts -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - LOG_INFO "测试开始:Test parsing LaTeX key-value options with pgfopts" - - # 检查是否已安装 texlive-pgfopts 包 - LOG_INFO "检查 texlive-pgfopts 是否已安装" - dnf list installed texlive-pgfopts > /dev/null 2>&1 - if [ $? -eq 0 ]; then - LOG_INFO "texlive-pgfopts 已安装,测试结束后将保持安装状态" - INSTALLED=1 - else - LOG_INFO "texlive-pgfopts 未安装,将在测试步骤中安装" - INSTALLED=0 - fi - - # 检查 yum 源中是否有 texlive-pgfopts 包 - LOG_INFO "检查 yum 源中是否有 texlive-pgfopts 包" - dnf list available texlive-pgfopts > /dev/null 2>&1 - if [ $? -ne 0 ]; then - LOG_ERROR "yum 源中未找到 texlive-pgfopts 包" - exit 255 - fi - - # 如果未安装,则安装 texlive-pgfopts - if [ $INSTALLED -eq 0 ]; then - LOG_INFO "安装 texlive-pgfopts 包" - dnf install -y texlive-pgfopts - CHECK_RESULT $? 0 0 "安装 texlive-pgfopts 失败" - fi - - # 测试 pgfopts 命令解析 LaTeX key-value 选项 - LOG_INFO "测试 pgfopts 命令解析 LaTeX key-value 选项" - # 假设 pgfopts 命令接受 --help 参数,这里检查参数是否支持 - pgfopts --help > /dev/null 2>&1 - if [ $? -ne 0 ]; then - LOG_ERROR "pgfopts 命令不支持 --help 参数或命令不存在" - exit 255 - fi - - # 执行 pgfopts 命令进行测试 - LOG_INFO "执行 pgfopts 命令进行功能测试" - pgfopts --version - CHECK_RESULT $? 0 0 "pgfopts 命令执行失败" - - # 清理环境:如果测试前未安装,则卸载 texlive-pgfopts - if [ $INSTALLED -eq 0 ]; then - LOG_INFO "卸载 texlive-pgfopts 包" - dnf remove -y texlive-pgfopts - CHECK_RESULT $? 0 0 "卸载 texlive-pgfopts 失败" - else - LOG_INFO "测试前已安装 texlive-pgfopts,保持安装状态" - fi - - LOG_INFO "测试完成:Test parsing LaTeX key-value options with pgfopts" -} - -main "$@" \ No newline at end of file diff --git a/testcases/function_test/pkg_test/texlive-split-r/texlive-pgfopts/test_texlive-pgfopts_function_load.sh b/testcases/function_test/pkg_test/texlive-split-r/texlive-pgfopts/test_texlive-pgfopts_function_load.sh deleted file mode 100644 index f4af010241b..00000000000 --- a/testcases/function_test/pkg_test/texlive-split-r/texlive-pgfopts/test_texlive-pgfopts_function_load.sh +++ /dev/null @@ -1,66 +0,0 @@ -#!/usr/bin/bash - -# Copyright (c) 2024 ISCAS .ALL rights reserved. -# This program is licensed under Mulan PSL v2. -# You can use it according to the terms and conditions of the Mulan PSL v2. -# http://license.coscl.org.cn/MulanPSL2 -# THIS PROGRAM IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, -# EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, -# MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. -# See the Mulan PSL v2 for more details. - -# ############################################# -# @Author : honghua -# @Contact : honghua@iscas.ac.cn -# @Date : 2025-11-26 -# @License : Mulan PSL v2 -# @Desc : Test loading the package -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - LOG_INFO "开始测试:Test loading the package" - - # 检查是否已安装texlive-pgfopts - LOG_INFO "检查是否已安装texlive-pgfopts" - dnf list installed texlive-pgfopts > /dev/null 2>&1 - if [ $? -eq 0 ]; then - LOG_INFO "texlive-pgfopts已安装,测试结束后保持安装状态" - INSTALLED=true - else - LOG_INFO "texlive-pgfopts未安装,将在测试结束后卸载" - INSTALLED=false - fi - - # 检查yum源中是否有texlive-pgfopts - LOG_INFO "检查yum源中是否有texlive-pgfopts" - dnf list available texlive-pgfopts > /dev/null 2>&1 - if [ $? -ne 0 ]; then - LOG_ERROR "yum源中未找到texlive-pgfopts" - exit 255 - fi - - # 安装texlive-pgfopts - if [ "$INSTALLED" = false ]; then - LOG_INFO "安装texlive-pgfopts" - dnf install -y texlive-pgfopts - CHECK_RESULT $? 0 0 "安装texlive-pgfopts失败" - fi - - # 测试加载包功能 - LOG_INFO "测试加载包功能" - texdoc pgfopts > /dev/null 2>&1 - CHECK_RESULT $? 0 0 "加载texlive-pgfopts失败" - - # 清理环境 - if [ "$INSTALLED" = false ]; then - LOG_INFO "卸载texlive-pgfopts" - dnf remove -y texlive-pgfopts - CHECK_RESULT $? 0 0 "卸载texlive-pgfopts失败" - fi - - LOG_INFO "测试完成:Test loading the package" -} - -main "$@" \ No newline at end of file diff --git a/testcases/function_test/pkg_test/texlive-split-r/texlive-pgfopts/test_texlive-pgfopts_function_local.sh b/testcases/function_test/pkg_test/texlive-split-r/texlive-pgfopts/test_texlive-pgfopts_function_local.sh deleted file mode 100644 index 844e6295a77..00000000000 --- a/testcases/function_test/pkg_test/texlive-split-r/texlive-pgfopts/test_texlive-pgfopts_function_local.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-18 -# @License : Mulan PSL v2 -# @Desc : Test setting local (per-package) options -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - # 判断是否已经安装texlive-pgfopts软件包 - LOG_INFO "检查texlive-pgfopts软件包是否已安装" - rpm -q texlive-pgfopts > /dev/null 2>&1 - if [ $? -eq 0 ]; then - LOG_INFO "texlive-pgfopts软件包已安装,测试结束后将保持安装状态" - INSTALLED_FLAG=1 - else - LOG_INFO "texlive-pgfopts软件包未安装,将在测试过程中安装并在结束后卸载" - INSTALLED_FLAG=0 - fi - - # 检查yum源中是否有texlive-pgfopts软件包 - LOG_INFO "检查yum源中是否有texlive-pgfopts软件包" - dnf list available texlive-pgfopts > /dev/null 2>&1 - if [ $? -ne 0 ]; then - LOG_ERROR "yum源中未找到texlive-pgfopts软件包" - exit 255 - fi - - # 如果未安装,则安装软件包 - if [ $INSTALLED_FLAG -eq 0 ]; then - LOG_INFO "安装texlive-pgfopts软件包" - dnf install -y texlive-pgfopts - CHECK_RESULT $? 0 0 "安装texlive-pgfopts软件包失败" - fi - - # 测试设置本地(每个包)选项的功能 - LOG_INFO "测试设置本地(每个包)选项的功能" - # 这里假设有一个命令或操作来测试texlive-pgfopts的本地选项功能 - # 由于具体测试命令未知,这里使用一个示例命令,实际应根据texlive-pgfopts的具体功能替换 - TEST_COMMAND="some-texlive-pgfopts-command --local-option" - # 检查命令是否存在 - command -v some-texlive-pgfopts-command > /dev/null 2>&1 - if [ $? -ne 0 ]; then - LOG_ERROR "命令some-texlive-pgfopts-command不存在或不支持" - # 清理环境 - if [ $INSTALLED_FLAG -eq 0 ]; then - LOG_INFO "卸载texlive-pgfopts软件包" - dnf remove -y texlive-pgfopts - fi - exit 255 - fi - # 执行测试命令 - $TEST_COMMAND - CHECK_RESULT $? 0 0 "测试设置本地选项功能失败" - - # 清理环境:如果测试前未安装,则卸载软件包 - if [ $INSTALLED_FLAG -eq 0 ]; then - LOG_INFO "卸载texlive-pgfopts软件包" - dnf remove -y texlive-pgfopts - CHECK_RESULT $? 0 0 "卸载texlive-pgfopts软件包失败" - else - LOG_INFO "测试前已安装texlive-pgfopts,保持安装状态" - fi - - LOG_INFO "测试脚本执行完成" -} - -main "$@" \ No newline at end of file From 089a694dbe49b72d4409007279f788ece1cd33d3 Mon Sep 17 00:00:00 2001 From: honghua Date: Sat, 18 Apr 2026 13:50:48 +0800 Subject: [PATCH 3/8] update testcase for testsuite libndp-help --- .../pkg_test/libndp/libndp-help.json | 16 ---- .../test_libndp-help_function_ndptool_help.sh | 86 ----------------- .../test_libndp-help_function_ndptool_vers.sh | 95 ------------------- ...test_libndp-help_function_pkg_installed.sh | 74 --------------- .../test_libndp-help_function_pkg_remove.sh | 92 ------------------ 5 files changed, 363 deletions(-) delete mode 100644 testcases/function_test/pkg_test/libndp/libndp-help/test_libndp-help_function_ndptool_help.sh delete mode 100644 testcases/function_test/pkg_test/libndp/libndp-help/test_libndp-help_function_ndptool_vers.sh delete mode 100644 testcases/function_test/pkg_test/libndp/libndp-help/test_libndp-help_function_pkg_installed.sh delete mode 100644 testcases/function_test/pkg_test/libndp/libndp-help/test_libndp-help_function_pkg_remove.sh diff --git a/suite2cases/function_test/pkg_test/libndp/libndp-help.json b/suite2cases/function_test/pkg_test/libndp/libndp-help.json index 7ed30cb05e3..6f4f2bb22e0 100644 --- a/suite2cases/function_test/pkg_test/libndp/libndp-help.json +++ b/suite2cases/function_test/pkg_test/libndp/libndp-help.json @@ -6,25 +6,9 @@ "name": "test_libndp-help_function_show_help", "desc": "测试ndptool命令显示帮助信息" }, - { - "name": "test_libndp-help_function_pkg_installed", - "desc": "测试libndp-help软件包是否已正确安装" - }, { "name": "test_libndp-help_function_show_man", "desc": "测试ndptool命令的man手册页" - }, - { - "name": "test_libndp-help_function_ndptool_help", - "desc": "测试ndptool命令的-h或--help选项" - }, - { - "name": "test_libndp-help_function_ndptool_vers", - "desc": "测试ndptool命令的-V或--version选项" - }, - { - "name": "test_libndp-help_function_pkg_remove", - "desc": "测试libndp-help软件包的卸载" } ] } \ No newline at end of file diff --git a/testcases/function_test/pkg_test/libndp/libndp-help/test_libndp-help_function_ndptool_help.sh b/testcases/function_test/pkg_test/libndp/libndp-help/test_libndp-help_function_ndptool_help.sh deleted file mode 100644 index f61d026253f..00000000000 --- a/testcases/function_test/pkg_test/libndp/libndp-help/test_libndp-help_function_ndptool_help.sh +++ /dev/null @@ -1,86 +0,0 @@ -#!/usr/bin/bash - -# Copyright (c) 2024 ISCAS .ALL rights reserved. -# This program is licensed under Mulan PSL v2. -# You can use it according to the terms and conditions of the Mulan PSL v2. -# http://license.coscl.org.cn/MulanPSL2 -# THIS PROGRAM IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, -# EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, -# MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. -# See the Mulan PSL v2 for more details. - -# ############################################# -# @Author : honghua -# @Contact : honghua@iscas.ac.cn -# @Date : 2026-02-28 -# @License : Mulan PSL v2 -# @Desc : 测试ndptool命令的-h或--help选项 -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - # 定义测试软件包名称 - PACKAGE_NAME="libndp" - - # 检查yum源中是否存在指定软件包 - LOG_INFO "检查yum源中是否存在$PACKAGE_NAME软件包" - dnf list available $PACKAGE_NAME &>/dev/null - if [ $? -ne 0 ]; then - LOG_ERROR "yum源中不存在$PACKAGE_NAME软件包" - exit 255 - fi - - # 检查系统是否已安装该软件包 - LOG_INFO "检查系统是否已安装$PACKAGE_NAME软件包" - rpm -q $PACKAGE_NAME &>/dev/null - PACKAGE_INSTALLED=$? - - # 记录初始安装状态 - if [ $PACKAGE_INSTALLED -eq 0 ]; then - LOG_INFO "系统已安装$PACKAGE_NAME软件包,脚本结束时将保持安装状态" - NEED_CLEANUP=0 - else - LOG_INFO "系统未安装$PACKAGE_NAME软件包,将进行安装测试" - NEED_CLEANUP=1 - fi - - # 如果未安装,则安装软件包 - if [ $NEED_CLEANUP -eq 1 ]; then - LOG_INFO "安装$PACKAGE_NAME软件包" - dnf install -y $PACKAGE_NAME - CHECK_RESULT $? 0 0 "安装$PACKAGE_NAME软件包失败" - fi - - # 测试ndptool命令的-h选项 - LOG_INFO "测试ndptool命令的-h选项" - ndptool -h &>/dev/null - CHECK_RESULT $? 0 0 "ndptool -h命令执行失败" - - # 测试ndptool命令的--help选项 - LOG_INFO "测试ndptool命令的--help选项" - ndptool --help &>/dev/null - CHECK_RESULT $? 0 0 "ndptool --help命令执行失败" - - # 测试不支持的参数 - LOG_INFO "测试ndptool命令的不支持参数" - ndptool --invalid-param &>/dev/null - if [ $? -ne 255 ]; then - LOG_ERROR "ndptool不支持--invalid-param参数,但未返回255退出码" - exit 255 - fi - - # 环境清理 - if [ $NEED_CLEANUP -eq 1 ]; then - LOG_INFO "卸载$PACKAGE_NAME软件包" - dnf remove -y $PACKAGE_NAME - CHECK_RESULT $? 0 0 "卸载$PACKAGE_NAME软件包失败" - LOG_INFO "环境已恢复到测试前的状态" - else - LOG_INFO "保持$PACKAGE_NAME软件包安装状态" - fi - - LOG_INFO "测试完成" -} - -main "$@" \ No newline at end of file diff --git a/testcases/function_test/pkg_test/libndp/libndp-help/test_libndp-help_function_ndptool_vers.sh b/testcases/function_test/pkg_test/libndp/libndp-help/test_libndp-help_function_ndptool_vers.sh deleted file mode 100644 index da07aebfe77..00000000000 --- a/testcases/function_test/pkg_test/libndp/libndp-help/test_libndp-help_function_ndptool_vers.sh +++ /dev/null @@ -1,95 +0,0 @@ -#!/usr/bin/bash - -# Copyright (c) 2024 ISCAS .ALL rights reserved. -# This program is licensed under Mulan PSL v2. -# You can use it according to the terms and conditions of the Mulan PSL v2. -# http://license.coscl.org.cn/MulanPSL2 -# THIS PROGRAM IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, -# EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, -# MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. -# See the Mulan PSL v2 for more details. - -# ############################################# -# @Author : honghua -# @Contact : honghua@iscas.ac.cn -# @Date : 2026-02-28 -# @License : Mulan PSL v2 -# @Desc : 测试ndptool命令的-V或--version选项 -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - # 检查是否已安装libndp和ndptool - LOG_INFO "检查libndp和ndptool是否已安装" - rpm -q libndp ndptool > /dev/null 2>&1 - if [ $? -eq 0 ]; then - LOG_INFO "libndp和ndptool已安装,标记为已安装状态" - INSTALLED=1 - else - LOG_INFO "libndp和ndptool未安装,标记为未安装状态" - INSTALLED=0 - fi - - # 检查yum源中是否有libndp和ndptool软件包 - LOG_INFO "检查yum源中是否有libndp和ndptool软件包" - dnf list available libndp ndptool > /dev/null 2>&1 - if [ $? -ne 0 ]; then - LOG_ERROR "yum源中没有libndp或ndptool软件包" - exit 255 - fi - - # 如果未安装,则安装软件包 - if [ $INSTALLED -eq 0 ]; then - LOG_INFO "开始安装libndp和ndptool软件包" - dnf install -y libndp ndptool - CHECK_RESULT $? 0 0 "安装libndp和ndptool失败" - LOG_INFO "libndp和ndptool安装成功" - fi - - # 测试ndptool命令的-V选项 - LOG_INFO "测试ndptool命令的-V选项" - ndptool -V > /dev/null 2>&1 - if [ $? -ne 0 ]; then - LOG_ERROR "ndptool命令不支持-V选项" - # 如果之前未安装,需要卸载软件包 - if [ $INSTALLED -eq 0 ]; then - dnf remove -y libndp ndptool - CHECK_RESULT $? 0 0 "卸载libndp和ndptool失败" - LOG_INFO "已卸载libndp和ndptool" - fi - exit 255 - fi - CHECK_RESULT $? 0 0 "ndptool -V执行失败" - LOG_INFO "ndptool -V执行成功" - - # 测试ndptool命令的--version选项 - LOG_INFO "测试ndptool命令的--version选项" - ndptool --version > /dev/null 2>&1 - if [ $? -ne 0 ]; then - LOG_ERROR "ndptool命令不支持--version选项" - # 如果之前未安装,需要卸载软件包 - if [ $INSTALLED -eq 0 ]; then - dnf remove -y libndp ndptool - CHECK_RESULT $? 0 0 "卸载libndp和ndptool失败" - LOG_INFO "已卸载libndp和ndptool" - fi - exit 255 - fi - CHECK_RESULT $? 0 0 "ndptool --version执行失败" - LOG_INFO "ndptool --version执行成功" - - # 清理环境:如果之前未安装,则卸载软件包 - if [ $INSTALLED -eq 0 ]; then - LOG_INFO "清理环境:卸载libndp和ndptool软件包" - dnf remove -y libndp ndptool - CHECK_RESULT $? 0 0 "卸载libndp和ndptool失败" - LOG_INFO "已卸载libndp和ndptool" - else - LOG_INFO "保持libndp和ndptool的安装状态" - fi - - LOG_INFO "测试完成" -} - -main "$@" \ No newline at end of file diff --git a/testcases/function_test/pkg_test/libndp/libndp-help/test_libndp-help_function_pkg_installed.sh b/testcases/function_test/pkg_test/libndp/libndp-help/test_libndp-help_function_pkg_installed.sh deleted file mode 100644 index c24f2a0c57a..00000000000 --- a/testcases/function_test/pkg_test/libndp/libndp-help/test_libndp-help_function_pkg_installed.sh +++ /dev/null @@ -1,74 +0,0 @@ -#!/usr/bin/bash - -# Copyright (c) 2024 ISCAS .ALL rights reserved. -# This program is licensed under Mulan PSL v2. -# You can use it according to the terms and conditions of the Mulan PSL v2. -# http://license.coscl.org.cn/MulanPSL2 -# THIS PROGRAM IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, -# EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, -# MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. -# See the Mulan PSL v2 for more details. - -# ############################################# -# @Author : honghua -# @Contact : honghua@iscas.ac.cn -# @Date : 2026-02-28 -# @License : Mulan PSL v2 -# @Desc : 测试libndp-help软件包是否已正确安装 -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - LOG_INFO "开始测试libndp-help软件包是否已正确安装" - - # 检查libndp-help软件包是否已在yum源中 - LOG_INFO "检查libndp-help软件包是否在yum源中" - dnf list available libndp-help &>/dev/null - if [ $? -ne 0 ]; then - LOG_ERROR "yum源中未找到libndp-help软件包" - exit 255 - fi - - # 检查当前是否已安装libndp-help软件包 - LOG_INFO "检查当前是否已安装libndp-help软件包" - rpm -q libndp-help &>/dev/null - if [ $? -eq 0 ]; then - LOG_INFO "libndp-help软件包已安装,记录安装状态" - INSTALLED=true - else - LOG_INFO "libndp-help软件包未安装" - INSTALLED=false - fi - - # 如果未安装,则进行安装 - if [ "$INSTALLED" = "false" ]; then - LOG_INFO "安装libndp-help软件包" - dnf install -y libndp-help - CHECK_RESULT $? 0 0 "安装libndp-help软件包失败" - fi - - # 测试libndp-help命令的基本功能 - LOG_INFO "测试libndp-help命令的基本功能" - libndp-help --help &>/dev/null - CHECK_RESULT $? 0 0 "libndp-help命令--help参数测试失败" - - # 测试不支持的参数 - LOG_INFO "测试libndp-help命令不支持的参数" - libndp-help --invalid-param &>/dev/null - if [ $? -ne 255 ] && [ $? -ne 1 ]; then - LOG_ERROR "libndp-help命令不支持--invalid-param参数时应退出码为255或1" - exit 255 - fi - - # 清理环境:如果测试前未安装,则卸载软件包 - if [ "$INSTALLED" = "false" ]; then - LOG_INFO "卸载libndp-help软件包" - dnf remove -y libndp-help - CHECK_RESULT $? 0 0 "卸载libndp-help软件包失败" - fi - - LOG_INFO "libndp-help软件包安装测试完成" -} - -main "$@" \ No newline at end of file diff --git a/testcases/function_test/pkg_test/libndp/libndp-help/test_libndp-help_function_pkg_remove.sh b/testcases/function_test/pkg_test/libndp/libndp-help/test_libndp-help_function_pkg_remove.sh deleted file mode 100644 index af2ce96c2b7..00000000000 --- a/testcases/function_test/pkg_test/libndp/libndp-help/test_libndp-help_function_pkg_remove.sh +++ /dev/null @@ -1,92 +0,0 @@ -#!/usr/bin/bash - -# Copyright (c) 2024 ISCAS .ALL rights reserved. -# This program is licensed under Mulan PSL v2. -# You can use it according to the terms and conditions of the Mulan PSL v2. -# http://license.coscl.org.cn/MulanPSL2 -# THIS PROGRAM IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, -# EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, -# MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. -# See the Mulan PSL v2 for more details. - -# ############################################# -# @Author : honghua -# @Contact : honghua@iscas.ac.cn -# @Date : 2026-02-28 -# @License : Mulan PSL v2 -# @Desc : 测试libndp-help软件包的卸载 -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - set -e - - LOG_INFO "开始测试libndp-help软件包的卸载功能" - - LOG_INFO "步骤1:检查yum源中是否存在libndp-help软件包" - if ! dnf list available libndp-help &>/dev/null; then - LOG_ERROR "yum源中未找到libndp-help软件包" - exit 255 - fi - LOG_INFO "yum源中存在libndp-help软件包" - - LOG_INFO "步骤2:检查系统是否已安装libndp-help软件包" - if rpm -q libndp-help &>/dev/null; then - LOG_INFO "系统已安装libndp-help软件包,标记为已安装状态" - already_installed=1 - else - LOG_INFO "系统未安装libndp-help软件包,标记为未安装状态" - already_installed=0 - fi - - LOG_INFO "步骤3:如果未安装,则安装libndp-help软件包" - if [ $already_installed -eq 0 ]; then - dnf install -y libndp-help - CHECK_RESULT $? 0 0 "安装libndp-help软件包失败" - LOG_INFO "成功安装libndp-help软件包" - fi - - LOG_INFO "步骤4:验证libndp-help软件包已正确安装" - rpm -q libndp-help - CHECK_RESULT $? 0 0 "验证libndp-help软件包安装状态失败" - - LOG_INFO "步骤5:执行libndp-help软件包的卸载测试" - dnf remove -y libndp-help - CHECK_RESULT $? 0 0 "卸载libndp-help软件包失败" - LOG_INFO "成功卸载libndp-help软件包" - - LOG_INFO "步骤6:验证libndp-help软件包已被卸载" - if rpm -q libndp-help &>/dev/null; then - LOG_ERROR "libndp-help软件包卸载后仍然存在" - exit 1 - fi - LOG_INFO "验证通过,libndp-help软件包已成功卸载" - - LOG_INFO "步骤7:环境恢复" - if [ $already_installed -eq 1 ]; then - LOG_INFO "恢复原始安装状态:重新安装libndp-help软件包" - dnf install -y libndp-help - CHECK_RESULT $? 0 0 "重新安装libndp-help软件包失败" - LOG_INFO "成功恢复libndp-help软件包安装状态" - else - LOG_INFO "原始状态为未安装,无需重新安装" - fi - - LOG_INFO "步骤8:最终验证环境状态" - if [ $already_installed -eq 1 ]; then - rpm -q libndp-help - CHECK_RESULT $? 0 0 "最终验证:libndp-help软件包应处于安装状态" - LOG_INFO "环境已恢复到原始安装状态" - else - if rpm -q libndp-help &>/dev/null; then - LOG_ERROR "最终验证:libndp-help软件包应处于未安装状态" - exit 1 - fi - LOG_INFO "环境已恢复到原始未安装状态" - fi - - LOG_INFO "libndp-help软件包卸载测试完成" -} - -main "$@" \ No newline at end of file From 0db97dd71fa39c0f0cd6d6c1bff5c32d0ff958f1 Mon Sep 17 00:00:00 2001 From: honghua Date: Sat, 18 Apr 2026 13:54:17 +0800 Subject: [PATCH 4/8] update testcase for testsuite plexus-interactivity-help --- .../plexus-interactivity-help.json | 26 ------- ..._plexus-interactivity-help_function_cmd.sh | 75 ------------------- ...exus-interactivity-help_function_config.sh | 73 ------------------ ...plexus-interactivity-help_function_help.sh | 66 ---------------- ...plexus-interactivity-help_function_init.sh | 66 ---------------- ..._plexus-interactivity-help_function_svc.sh | 74 ------------------ 6 files changed, 380 deletions(-) delete mode 100644 suite2cases/function_test/pkg_test/plexus-interactivity/plexus-interactivity-help.json delete mode 100644 testcases/function_test/pkg_test/plexus-interactivity/plexus-interactivity-help/test_plexus-interactivity-help_function_cmd.sh delete mode 100644 testcases/function_test/pkg_test/plexus-interactivity/plexus-interactivity-help/test_plexus-interactivity-help_function_config.sh delete mode 100644 testcases/function_test/pkg_test/plexus-interactivity/plexus-interactivity-help/test_plexus-interactivity-help_function_help.sh delete mode 100644 testcases/function_test/pkg_test/plexus-interactivity/plexus-interactivity-help/test_plexus-interactivity-help_function_init.sh delete mode 100644 testcases/function_test/pkg_test/plexus-interactivity/plexus-interactivity-help/test_plexus-interactivity-help_function_svc.sh diff --git a/suite2cases/function_test/pkg_test/plexus-interactivity/plexus-interactivity-help.json b/suite2cases/function_test/pkg_test/plexus-interactivity/plexus-interactivity-help.json deleted file mode 100644 index 0f961dce1d0..00000000000 --- a/suite2cases/function_test/pkg_test/plexus-interactivity/plexus-interactivity-help.json +++ /dev/null @@ -1,26 +0,0 @@ -{ - "path": "$OET_PATH/testcases/function_test/pkg_test/plexus-interactivity/plexus-interactivity-help", - "machine num": 1, - "cases": [ - { - "name": "test_plexus-interactivity-help_function_init", - "desc": "Test initialization of the package" - }, - { - "name": "test_plexus-interactivity-help_function_cmd", - "desc": "Test command line interaction" - }, - { - "name": "test_plexus-interactivity-help_function_svc", - "desc": "Test service interaction" - }, - { - "name": "test_plexus-interactivity-help_function_help", - "desc": "Test help functionality" - }, - { - "name": "test_plexus-interactivity-help_function_config", - "desc": "Test configuration loading" - } - ] -} \ No newline at end of file diff --git a/testcases/function_test/pkg_test/plexus-interactivity/plexus-interactivity-help/test_plexus-interactivity-help_function_cmd.sh b/testcases/function_test/pkg_test/plexus-interactivity/plexus-interactivity-help/test_plexus-interactivity-help_function_cmd.sh deleted file mode 100644 index 86ec11ab668..00000000000 --- a/testcases/function_test/pkg_test/plexus-interactivity/plexus-interactivity-help/test_plexus-interactivity-help_function_cmd.sh +++ /dev/null @@ -1,75 +0,0 @@ -#!/usr/bin/bash - -# Copyright (c) 2024 ISCAS .ALL rights reserved. -# This program is licensed under Mulan PSL v2. -# You can use it according to the terms and conditions of the Mulan PSL v2. -# http://license.coscl.org.cn/MulanPSL2 -# THIS PROGRAM IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, -# EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, -# MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. -# See the Mulan PSL v2 for more details. - -# ############################################# -# @Author : honghua -# @Contact : honghua@iscas.ac.cn -# @Date : 2025-11-29 -# @License : Mulan PSL v2 -# @Desc : Test command line interaction -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - LOG_INFO "开始测试命令行交互功能" - - # 检查软件包是否已安装 - LOG_INFO "检查软件包是否已安装" - if ! dnf list installed plexus-interactivity-help-function-cmd &>/dev/null; then - LOG_INFO "软件包未安装,将进行安装" - INSTALLED=0 - else - LOG_INFO "软件包已安装" - INSTALLED=1 - fi - - # 检查yum源中是否有该软件包 - LOG_INFO "检查yum源中是否有plexus-interactivity-help-function-cmd软件包" - if ! dnf list available plexus-interactivity-help-function-cmd &>/dev/null; then - LOG_ERROR "yum源中未找到plexus-interactivity-help-function-cmd软件包" - exit 255 - fi - - # 如果未安装,则安装软件包 - if [ $INSTALLED -eq 0 ]; then - LOG_INFO "安装plexus-interactivity-help-function-cmd软件包" - dnf install -y plexus-interactivity-help-function-cmd - CHECK_RESULT $? 0 0 "安装plexus-interactivity-help-function-cmd失败" - fi - - # 测试命令参数是否存在或不支持 - LOG_INFO "测试命令参数是否存在或不支持" - if ! plexus-interactivity-help-function-cmd --help &>/dev/null; then - LOG_ERROR "命令参数不存在或不支持" - if [ $INSTALLED -eq 0 ]; then - dnf remove -y plexus-interactivity-help-function-cmd - CHECK_RESULT $? 0 0 "卸载plexus-interactivity-help-function-cmd失败" - fi - exit 255 - fi - - # 执行命令并检查结果 - LOG_INFO "执行plexus-interactivity-help-function-cmd命令" - plexus-interactivity-help-function-cmd --test-param - CHECK_RESULT $? 0 0 "执行plexus-interactivity-help-function-cmd命令失败" - - # 清理环境:如果脚本开始时未安装,则卸载软件包 - if [ $INSTALLED -eq 0 ]; then - LOG_INFO "卸载plexus-interactivity-help-function-cmd软件包" - dnf remove -y plexus-interactivity-help-function-cmd - CHECK_RESULT $? 0 0 "卸载plexus-interactivity-help-function-cmd失败" - fi - - LOG_INFO "测试命令行交互功能完成" -} - -main "$@" \ No newline at end of file diff --git a/testcases/function_test/pkg_test/plexus-interactivity/plexus-interactivity-help/test_plexus-interactivity-help_function_config.sh b/testcases/function_test/pkg_test/plexus-interactivity/plexus-interactivity-help/test_plexus-interactivity-help_function_config.sh deleted file mode 100644 index 02eca7b1fc2..00000000000 --- a/testcases/function_test/pkg_test/plexus-interactivity/plexus-interactivity-help/test_plexus-interactivity-help_function_config.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-10 -# @License : Mulan PSL v2 -# @Desc : Test configuration loading -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - # 测试脚本:test_plexus-interactivity-help_function_config - - LOG_INFO "开始测试配置加载功能" - - # 检查软件包是否已安装 - if dnf list installed plexus-interactivity-help-function-config &>/dev/null; then - LOG_INFO "软件包已安装,测试结束后保持安装状态" - INSTALLED=true - else - LOG_INFO "软件包未安装,测试结束后将卸载" - INSTALLED=false - fi - - # 检查yum源中是否存在软件包 - LOG_INFO "检查yum源中是否存在plexus-interactivity-help-function-config软件包" - if ! dnf list available plexus-interactivity-help-function-config &>/dev/null; then - LOG_ERROR "yum源中未找到plexus-interactivity-help-function-config软件包" - exit 255 - fi - - # 安装软件包 - if [ "$INSTALLED" = false ]; then - LOG_INFO "正在安装plexus-interactivity-help-function-config软件包" - dnf install -y plexus-interactivity-help-function-config - CHECK_RESULT $? 0 0 "安装软件包失败" - fi - - # 测试配置加载功能 - LOG_INFO "测试配置加载功能" - plexus-interactivity-help-function-config --load-config /etc/plexus-interactivity-help-function-config/config.yaml - CHECK_RESULT $? 0 0 "配置加载失败" - - # 测试不支持的参数 - LOG_INFO "测试不支持的参数" - plexus-interactivity-help-function-config --invalid-param - if [ $? -ne 255 ]; then - LOG_ERROR "不支持的参数未返回退出码255" - exit 255 - fi - - # 清理环境(如果之前未安装) - if [ "$INSTALLED" = false ]; then - LOG_INFO "卸载plexus-interactivity-help-function-config软件包" - dnf remove -y plexus-interactivity-help-function-config - CHECK_RESULT $? 0 0 "卸载软件包失败" - fi - - LOG_INFO "测试配置加载功能完成" -} - -main "$@" \ No newline at end of file diff --git a/testcases/function_test/pkg_test/plexus-interactivity/plexus-interactivity-help/test_plexus-interactivity-help_function_help.sh b/testcases/function_test/pkg_test/plexus-interactivity/plexus-interactivity-help/test_plexus-interactivity-help_function_help.sh deleted file mode 100644 index 69e7cc50ce1..00000000000 --- a/testcases/function_test/pkg_test/plexus-interactivity/plexus-interactivity-help/test_plexus-interactivity-help_function_help.sh +++ /dev/null @@ -1,66 +0,0 @@ -#!/usr/bin/bash - -# Copyright (c) 2024 ISCAS .ALL rights reserved. -# This program is licensed under Mulan PSL v2. -# You can use it according to the terms and conditions of the Mulan PSL v2. -# http://license.coscl.org.cn/MulanPSL2 -# THIS PROGRAM IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, -# EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, -# MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. -# See the Mulan PSL v2 for more details. - -# ############################################# -# @Author : honghua -# @Contact : honghua@iscas.ac.cn -# @Date : 2025-11-29 -# @License : Mulan PSL v2 -# @Desc : Test help functionality -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - LOG_INFO "开始测试帮助功能" - - # 检查软件包是否已安装 - LOG_INFO "检查软件包是否已安装" - dnf list installed plexus-interactivity-help > /dev/null 2>&1 - if [ $? -eq 0 ]; then - LOG_INFO "软件包已安装,脚本结束时将保持安装状态" - INSTALLED=1 - else - LOG_INFO "软件包未安装,将在测试步骤中安装并在结束时卸载" - INSTALLED=0 - fi - - # 检查yum源中是否有该软件包 - LOG_INFO "检查yum源中是否有plexus-interactivity-help软件包" - dnf list available plexus-interactivity-help > /dev/null 2>&1 - if [ $? -ne 0 ]; then - LOG_ERROR "yum源中未找到plexus-interactivity-help软件包" - exit 255 - fi - - # 如果未安装,则安装软件包 - if [ $INSTALLED -eq 0 ]; then - LOG_INFO "安装plexus-interactivity-help软件包" - dnf install -y plexus-interactivity-help > /dev/null 2>&1 - CHECK_RESULT $? 0 0 "安装plexus-interactivity-help失败" - fi - - # 测试帮助功能 - LOG_INFO "测试帮助功能" - plexus-interactivity-help --help > /dev/null 2>&1 - CHECK_RESULT $? 0 0 "执行帮助命令失败" - - # 清理环境 - if [ $INSTALLED -eq 0 ]; then - LOG_INFO "卸载plexus-interactivity-help软件包" - dnf remove -y plexus-interactivity-help > /dev/null 2>&1 - CHECK_RESULT $? 0 0 "卸载plexus-interactivity-help失败" - fi - - LOG_INFO "测试帮助功能完成" -} - -main "$@" \ No newline at end of file diff --git a/testcases/function_test/pkg_test/plexus-interactivity/plexus-interactivity-help/test_plexus-interactivity-help_function_init.sh b/testcases/function_test/pkg_test/plexus-interactivity/plexus-interactivity-help/test_plexus-interactivity-help_function_init.sh deleted file mode 100644 index b9cc029cb09..00000000000 --- a/testcases/function_test/pkg_test/plexus-interactivity/plexus-interactivity-help/test_plexus-interactivity-help_function_init.sh +++ /dev/null @@ -1,66 +0,0 @@ -#!/usr/bin/bash - -# Copyright (c) 2024 ISCAS .ALL rights reserved. -# This program is licensed under Mulan PSL v2. -# You can use it according to the terms and conditions of the Mulan PSL v2. -# http://license.coscl.org.cn/MulanPSL2 -# THIS PROGRAM IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, -# EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, -# MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. -# See the Mulan PSL v2 for more details. - -# ############################################# -# @Author : honghua -# @Contact : honghua@iscas.ac.cn -# @Date : 2025-11-29 -# @License : Mulan PSL v2 -# @Desc : Test initialization of the package -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - # 检查软件包是否已安装 - LOG_INFO "检查软件包是否已安装" - rpm -q plexus-interactivity-help-function > /dev/null 2>&1 - if [ $? -eq 0 ]; then - LOG_INFO "软件包已安装,脚本结束时保持安装状态" - INSTALLED=true - else - LOG_INFO "软件包未安装,将在测试结束后卸载" - INSTALLED=false - fi - - # 检查yum源中是否有该软件包 - LOG_INFO "检查yum源中是否有plexus-interactivity-help-function软件包" - dnf list available plexus-interactivity-help-function > /dev/null 2>&1 - CHECK_RESULT $? 0 255 "yum源中没有plexus-interactivity-help-function软件包" - - # 安装软件包 - if [ "$INSTALLED" = false ]; then - LOG_INFO "安装plexus-interactivity-help-function软件包" - dnf install -y plexus-interactivity-help-function > /dev/null 2>&1 - CHECK_RESULT $? 0 1 "安装plexus-interactivity-help-function软件包失败" - fi - - # 测试初始化功能 - LOG_INFO "测试初始化功能" - plexus-interactivity-help-function init --help > /dev/null 2>&1 - CHECK_RESULT $? 0 255 "参数不存在或不支持" - - # 执行初始化命令并验证结果 - LOG_INFO "执行初始化命令并验证结果" - plexus-interactivity-help-function init - CHECK_RESULT $? 0 1 "初始化命令执行失败" - - # 清理环境 - if [ "$INSTALLED" = false ]; then - LOG_INFO "卸载plexus-interactivity-help-function软件包" - dnf remove -y plexus-interactivity-help-function > /dev/null 2>&1 - CHECK_RESULT $? 0 1 "卸载plexus-interactivity-help-function软件包失败" - fi - - LOG_INFO "测试完成,环境已恢复" -} - -main "$@" \ No newline at end of file diff --git a/testcases/function_test/pkg_test/plexus-interactivity/plexus-interactivity-help/test_plexus-interactivity-help_function_svc.sh b/testcases/function_test/pkg_test/plexus-interactivity/plexus-interactivity-help/test_plexus-interactivity-help_function_svc.sh deleted file mode 100644 index b07ac0b09c4..00000000000 --- a/testcases/function_test/pkg_test/plexus-interactivity/plexus-interactivity-help/test_plexus-interactivity-help_function_svc.sh +++ /dev/null @@ -1,74 +0,0 @@ -#!/usr/bin/bash - -# Copyright (c) 2024 ISCAS .ALL rights reserved. -# This program is licensed under Mulan PSL v2. -# You can use it according to the terms and conditions of the Mulan PSL v2. -# http://license.coscl.org.cn/MulanPSL2 -# THIS PROGRAM IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, -# EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, -# MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. -# See the Mulan PSL v2 for more details. - -# ############################################# -# @Author : honghua -# @Contact : honghua@iscas.ac.cn -# @Date : 2025-11-29 -# @License : Mulan PSL v2 -# @Desc : Test service interaction -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - # 测试脚本:test_plexus-interactivity-help_function_svc - - LOG_INFO "开始测试服务交互功能" - - # 检查是否已安装软件包 - LOG_INFO "检查软件包是否已安装" - if dnf list installed plexus-interactivity-help-function-svc &>/dev/null; then - LOG_INFO "软件包已安装,测试完成后将保持安装状态" - installed=true - else - LOG_INFO "软件包未安装,将在测试完成后卸载" - installed=false - fi - - # 检查yum源中是否存在软件包 - LOG_INFO "检查yum源中是否存在软件包" - if ! dnf list available plexus-interactivity-help-function-svc &>/dev/null; then - LOG_ERROR "yum源中未找到软件包plexus-interactivity-help-function-svc" - exit 255 - fi - - # 安装软件包 - if [ "$installed" = false ]; then - LOG_INFO "正在安装软件包plexus-interactivity-help-function-svc" - dnf install -y plexus-interactivity-help-function-svc - CHECK_RESULT $? 0 0 "安装软件包失败" - fi - - # 测试服务功能 - LOG_INFO "测试服务功能" - systemctl start plexus-interactivity-help-function-svc - CHECK_RESULT $? 0 0 "启动服务失败" - - systemctl status plexus-interactivity-help-function-svc | grep "active (running)" - CHECK_RESULT $? 0 0 "服务未正常运行" - - # 测试命令参数 - LOG_INFO "测试命令参数支持情况" - plexus-interactivity-help-function-svc --help &>/dev/null - CHECK_RESULT $? 0 0 "命令参数不支持" - - # 清理环境 - if [ "$installed" = false ]; then - LOG_INFO "卸载软件包plexus-interactivity-help-function-svc" - dnf remove -y plexus-interactivity-help-function-svc - CHECK_RESULT $? 0 0 "卸载软件包失败" - fi - - LOG_INFO "测试服务交互功能完成" -} - -main "$@" \ No newline at end of file From 42873d40e4b0b2dd09497f25f1d89544bc074acf Mon Sep 17 00:00:00 2001 From: honghua Date: Sat, 18 Apr 2026 13:54:56 +0800 Subject: [PATCH 5/8] update testcase for testsuite texlive-substances-doc --- .../texlive-substances-doc.json | 10 --- ...texlive-substances-doc_function_install.sh | 80 ------------------- 2 files changed, 90 deletions(-) delete mode 100644 suite2cases/function_test/pkg_test/texlive-split-v/texlive-substances-doc.json delete mode 100644 testcases/function_test/pkg_test/texlive-split-v/texlive-substances-doc/test_texlive-substances-doc_function_install.sh diff --git a/suite2cases/function_test/pkg_test/texlive-split-v/texlive-substances-doc.json b/suite2cases/function_test/pkg_test/texlive-split-v/texlive-substances-doc.json deleted file mode 100644 index 3a259147833..00000000000 --- a/suite2cases/function_test/pkg_test/texlive-split-v/texlive-substances-doc.json +++ /dev/null @@ -1,10 +0,0 @@ -{ - "path": "$OET_PATH/testcases/function_test/pkg_test/texlive-split-v/texlive-substances-doc", - "machine num": 1, - "cases": [ - { - "name": "test_texlive-substances-doc_function_install", - "desc": "Verify installation of texlive-substances-doc" - } - ] -} \ No newline at end of file diff --git a/testcases/function_test/pkg_test/texlive-split-v/texlive-substances-doc/test_texlive-substances-doc_function_install.sh b/testcases/function_test/pkg_test/texlive-split-v/texlive-substances-doc/test_texlive-substances-doc_function_install.sh deleted file mode 100644 index e4c0a8caf87..00000000000 --- a/testcases/function_test/pkg_test/texlive-split-v/texlive-substances-doc/test_texlive-substances-doc_function_install.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-11-26 -# @License : Mulan PSL v2 -# @Desc : Verify installation of texlive-substances-doc -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - - # 检查texlive-substances-doc是否已安装 - LOG_INFO "检查texlive-substances-doc是否已安装" - rpm -q texlive-substances-doc > /dev/null 2>&1 - if [ $? -eq 0 ]; then - LOG_INFO "texlive-substances-doc已安装,脚本结束时将保持安装状态" - INSTALLED=1 - else - LOG_INFO "texlive-substances-doc未安装,将在测试后卸载" - INSTALLED=0 - fi - - # 检查yum源中是否存在texlive-substances-doc软件包 - LOG_INFO "检查yum源中是否存在texlive-substances-doc软件包" - dnf list available texlive-substances-doc > /dev/null 2>&1 - if [ $? -ne 0 ]; then - LOG_ERROR "yum源中不存在texlive-substances-doc软件包" - exit 255 - fi - - # 安装texlive-substances-doc软件包 - LOG_INFO "开始安装texlive-substances-doc软件包" - dnf install -y texlive-substances-doc - CHECK_RESULT $? 0 0 "安装texlive-substances-doc软件包失败" - - # 验证软件包是否成功安装 - LOG_INFO "验证texlive-substances-doc是否成功安装" - rpm -q texlive-substances-doc > /dev/null 2>&1 - CHECK_RESULT $? 0 0 "texlive-substances-doc未成功安装" - - # 执行测试用例:Verify installation of texlive-substances-doc - LOG_INFO "执行测试用例:Verify installation of texlive-substances-doc" - - # 检查命令参数是否支持(示例:假设texdoc是相关命令) - LOG_INFO "检查命令参数是否支持" - texdoc --help > /dev/null 2>&1 - if [ $? -ne 0 ]; then - LOG_ERROR "命令参数不支持或命令不存在" - exit 255 - fi - - # 使用SSH_CMD在第二个节点上执行命令(示例) - LOG_INFO "在第二个节点上执行命令(示例)" - SSH_CMD "rpm -q texlive-substances-doc" "$NODE2_IPV4" "$NODE2_PASSWORD" "$NODE2_USER" - CHECK_RESULT $? 0 0 "在第二个节点上执行命令失败" - - # 清理环境:如果之前未安装,则卸载软件包 - if [ $INSTALLED -eq 0 ]; then - LOG_INFO "清理环境:卸载texlive-substances-doc软件包" - dnf remove -y texlive-substances-doc - CHECK_RESULT $? 0 0 "卸载texlive-substances-doc软件包失败" - fi - - LOG_INFO "测试脚本执行完毕,环境已恢复" - -} - -main "$@" \ No newline at end of file From 31ae6e562eb4f842202ae57639ce0edd3ceac34a Mon Sep 17 00:00:00 2001 From: honghua Date: Sat, 18 Apr 2026 13:57:31 +0800 Subject: [PATCH 6/8] update testcase for testsuite texlive-grafcet --- .../texlive-split-j/texlive-grafcet.json | 4 - .../test_texlive-grafcet_function_usage.sh | 95 ------------------- 2 files changed, 99 deletions(-) delete mode 100644 testcases/function_test/pkg_test/texlive-split-j/texlive-grafcet/test_texlive-grafcet_function_usage.sh diff --git a/suite2cases/function_test/pkg_test/texlive-split-j/texlive-grafcet.json b/suite2cases/function_test/pkg_test/texlive-split-j/texlive-grafcet.json index 927072cfbd5..41d91fc3eb2 100644 --- a/suite2cases/function_test/pkg_test/texlive-split-j/texlive-grafcet.json +++ b/suite2cases/function_test/pkg_test/texlive-split-j/texlive-grafcet.json @@ -11,10 +11,6 @@ "name": "test_texlive-grafcet_function_install", "desc": "测试 texlive-grafcet 软件包的安装功能,验证其是否能够被成功安装到系统中。" }, - { - "name": "test_texlive-grafcet_function_usage", - "desc": "测试 texlive-grafcet 软件包的核心功能,验证其提供的 LaTeX 宏包能否在文档中正常编译并生成 Grafcet 图。" - }, { "name": "test_texlive-grafcet_function_uninstall", "desc": "测试 texlive-grafcet 软件包的卸载功能,验证其是否能被干净地从系统中移除。" diff --git a/testcases/function_test/pkg_test/texlive-split-j/texlive-grafcet/test_texlive-grafcet_function_usage.sh b/testcases/function_test/pkg_test/texlive-split-j/texlive-grafcet/test_texlive-grafcet_function_usage.sh deleted file mode 100644 index 3dcfb999632..00000000000 --- a/testcases/function_test/pkg_test/texlive-split-j/texlive-grafcet/test_texlive-grafcet_function_usage.sh +++ /dev/null @@ -1,95 +0,0 @@ -#!/usr/bin/bash - -# Copyright (c) 2024 ISCAS .ALL rights reserved. -# This program is licensed under Mulan PSL v2. -# You can use it according to the terms and conditions of the Mulan PSL v2. -# http://license.coscl.org.cn/MulanPSL2 -# THIS PROGRAM IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, -# EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, -# MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. -# See the Mulan PSL v2 for more details. - -# ############################################# -# @Author : honghua -# @Contact : honghua@iscas.ac.cn -# @Date : 2026-04-04 -# @License : Mulan PSL v2 -# @Desc : 测试 texlive-grafcet 软件包的核心功能,验证其提供的 LaTeX 宏包能否在文档中正常编译并生成 Grafcet 图。 -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - # 检查是否已安装texlive-grafcet软件包 - LOG_INFO "检查texlive-grafcet软件包是否已安装" - rpm -q texlive-grafcet - if [ $? -eq 0 ]; then - LOG_INFO "texlive-grafcet已安装,标记为保持安装状态" - KEEP_INSTALLED=true - else - LOG_INFO "texlive-grafcet未安装,标记为测试安装" - KEEP_INSTALLED=false - fi - - # 检查yum源中是否有texlive-grafcet软件包 - LOG_INFO "检查yum源中是否有texlive-grafcet软件包" - dnf list available texlive-grafcet - if [ $? -ne 0 ]; then - LOG_ERROR "yum源中未找到texlive-grafcet软件包" - exit 255 - fi - - # 如果未安装,则安装软件包 - if [ "$KEEP_INSTALLED" = "false" ]; then - LOG_INFO "开始安装texlive-grafcet软件包" - dnf install -y texlive-grafcet - CHECK_RESULT $? 0 0 "安装texlive-grafcet失败" - fi - - # 创建测试LaTeX文档 - LOG_INFO "创建测试LaTeX文档" - cat > test_grafcet.tex << "EOF" - \documentclass{article} - \usepackage{grafcet} - \begin{document} - \section{Grafcet测试} - \begin{grafcet} - \step{A} - \step{B} - \step{C} - \trans{}{A}{B} - \trans{}{B}{C} - \end{grafcet} - \end{document} - EOF - CHECK_RESULT $? 0 0 "创建测试文档失败" - - # 编译LaTeX文档 - LOG_INFO "编译LaTeX文档测试grafcet宏包功能" - pdflatex test_grafcet.tex - CHECK_RESULT $? 0 0 "编译LaTeX文档失败" - - # 检查是否生成了PDF文件 - LOG_INFO "检查是否生成了PDF文件" - if [ -f "test_grafcet.pdf" ]; then - LOG_INFO "成功生成PDF文件,grafcet宏包功能正常" - else - LOG_ERROR "未生成PDF文件,grafcet宏包功能异常" - exit 1 - fi - - # 清理测试文件 - LOG_INFO "清理测试文件" - rm -f test_grafcet.tex test_grafcet.aux test_grafcet.log test_grafcet.pdf - - # 如果测试前未安装,则卸载软件包 - if [ "$KEEP_INSTALLED" = "false" ]; then - LOG_INFO "卸载texlive-grafcet软件包" - dnf remove -y texlive-grafcet - CHECK_RESULT $? 0 0 "卸载texlive-grafcet失败" - fi - - LOG_INFO "测试完成,环境已恢复" -} - -main "$@" \ No newline at end of file From ee5f05aee01d3a15baf1b4e0c48626577ff224b9 Mon Sep 17 00:00:00 2001 From: honghua Date: Sat, 18 Apr 2026 14:04:27 +0800 Subject: [PATCH 7/8] update testcase for testsuite texlive-lpic-doc --- .../texlive-split-n/texlive-lpic-doc.json | 8 - ...est_texlive-lpic-doc_function_doc_files.sh | 144 ------------------ .../test_texlive-lpic-doc_function_verify.sh | 95 ------------ 3 files changed, 247 deletions(-) delete mode 100644 testcases/function_test/pkg_test/texlive-split-n/texlive-lpic-doc/test_texlive-lpic-doc_function_doc_files.sh delete mode 100644 testcases/function_test/pkg_test/texlive-split-n/texlive-lpic-doc/test_texlive-lpic-doc_function_verify.sh diff --git a/suite2cases/function_test/pkg_test/texlive-split-n/texlive-lpic-doc.json b/suite2cases/function_test/pkg_test/texlive-split-n/texlive-lpic-doc.json index 375f539d37a..505fd84f3d0 100644 --- a/suite2cases/function_test/pkg_test/texlive-split-n/texlive-lpic-doc.json +++ b/suite2cases/function_test/pkg_test/texlive-split-n/texlive-lpic-doc.json @@ -9,14 +9,6 @@ { "name": "test_texlive-lpic-doc_function_remove", "desc": "Test package removal" - }, - { - "name": "test_texlive-lpic-doc_function_verify", - "desc": "Verify package installation status" - }, - { - "name": "test_texlive-lpic-doc_function_doc_files", - "desc": "Check existence of documentation files" } ] } \ No newline at end of file diff --git a/testcases/function_test/pkg_test/texlive-split-n/texlive-lpic-doc/test_texlive-lpic-doc_function_doc_files.sh b/testcases/function_test/pkg_test/texlive-split-n/texlive-lpic-doc/test_texlive-lpic-doc_function_doc_files.sh deleted file mode 100644 index 8bcbae7bd6c..00000000000 --- a/testcases/function_test/pkg_test/texlive-split-n/texlive-lpic-doc/test_texlive-lpic-doc_function_doc_files.sh +++ /dev/null @@ -1,144 +0,0 @@ -#!/usr/bin/bash - -# Copyright (c) 2024 ISCAS .ALL rights reserved. -# This program is licensed under Mulan PSL v2. -# You can use it according to the terms and conditions of the Mulan PSL v2. -# http://license.coscl.org.cn/MulanPSL2 -# THIS PROGRAM IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, -# EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, -# MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. -# See the Mulan PSL v2 for more details. - -# ############################################# -# @Author : honghua -# @Contact : honghua@iscas.ac.cn -# @Date : 2026-03-19 -# @License : Mulan PSL v2 -# @Desc : Check existence of documentation files -# ############################################ - -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-lpic-doc" - - # 步骤1:检查软件包是否已在yum源中 - LOG_INFO "步骤1:检查软件包是否在yum源中" - dnf list available "$PACKAGE_NAME" &>/dev/null - if [ $? -ne 0 ]; then - LOG_ERROR "软件包 $PACKAGE_NAME 不在yum源中" - exit 255 - fi - LOG_INFO "软件包 $PACKAGE_NAME 在yum源中" - - # 步骤2:检查软件包是否已安装 - LOG_INFO "步骤2:检查软件包是否已安装" - rpm -q "$PACKAGE_NAME" &>/dev/null - if [ $? -eq 0 ]; then - LOG_INFO "软件包 $PACKAGE_NAME 已安装" - ALREADY_INSTALLED=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 失败" - LOG_INFO "软件包 $PACKAGE_NAME 安装成功" - else - LOG_INFO "步骤3:软件包已安装,跳过安装步骤" - fi - - # 步骤4:检查文档文件是否存在 - LOG_INFO "步骤4:检查文档文件是否存在" - - # 获取软件包安装的文件列表 - LOG_INFO "获取软件包 $PACKAGE_NAME 安装的文件列表" - FILES=$(rpm -ql "$PACKAGE_NAME" 2>/dev/null) - CHECK_RESULT $? 0 0 "获取软件包文件列表失败" - - # 检查是否存在文档文件 - DOC_FILES=$(echo "$FILES" | grep -E "\.(pdf|txt|html|info|tex|md)$" | head -10) - if [ -z "$DOC_FILES" ]; then - LOG_ERROR "未找到文档文件" - # 如果是测试安装的场景,需要清理环境 - if [ $ALREADY_INSTALLED -eq 0 ]; then - LOG_INFO "清理环境:卸载软件包 $PACKAGE_NAME" - dnf remove -y "$PACKAGE_NAME" - fi - exit 1 - fi - - LOG_INFO "找到文档文件:" - echo "$DOC_FILES" | while read -r file; do - if [ -f "$file" ]; then - LOG_INFO "文档文件存在: $file" - else - LOG_ERROR "文档文件不存在: $file" - # 如果是测试安装的场景,需要清理环境 - if [ $ALREADY_INSTALLED -eq 0 ]; then - LOG_INFO "清理环境:卸载软件包 $PACKAGE_NAME" - dnf remove -y "$PACKAGE_NAME" - fi - exit 1 - fi - done - - # 步骤5:随机选择几个文档文件检查内容 - LOG_INFO "步骤5:抽样检查文档文件内容" - SAMPLE_FILES=$(echo "$DOC_FILES" | grep -E "\.(pdf|txt|html|tex)$" | head -3) - for file in $SAMPLE_FILES; do - if [ -f "$file" ]; then - file_type=$(file -b "$file" 2>/dev/null) - if [ $? -eq 0 ]; then - LOG_INFO "文件 $file 类型: $file_type" - # 检查文件大小 - file_size=$(stat -c%s "$file" 2>/dev/null) - if [ $? -eq 0 ] && [ "$file_size" -gt 0 ]; then - LOG_INFO "文件 $file 大小: ${file_size} 字节" - else - LOG_ERROR "文件 $file 大小检查失败或文件为空" - # 如果是测试安装的场景,需要清理环境 - if [ $ALREADY_INSTALLED -eq 0 ]; then - LOG_INFO "清理环境:卸载软件包 $PACKAGE_NAME" - dnf remove -y "$PACKAGE_NAME" - fi - exit 1 - fi - else - LOG_ERROR "无法确定文件 $file 类型" - # 如果是测试安装的场景,需要清理环境 - if [ $ALREADY_INSTALLED -eq 0 ]; then - LOG_INFO "清理环境:卸载软件包 $PACKAGE_NAME" - dnf remove -y "$PACKAGE_NAME" - fi - exit 1 - fi - fi - done - - # 步骤6:清理环境 - LOG_INFO "步骤6:清理环境" - if [ $ALREADY_INSTALLED -eq 0 ]; then - LOG_INFO "卸载测试安装的软件包 $PACKAGE_NAME" - dnf remove -y "$PACKAGE_NAME" - CHECK_RESULT $? 0 0 "卸载软件包 $PACKAGE_NAME 失败" - LOG_INFO "软件包 $PACKAGE_NAME 卸载成功" - else - LOG_INFO "软件包 $PACKAGE_NAME 是之前安装的,保持安装状态" - fi - - LOG_INFO "测试完成:文档文件检查通过" -} - -main "$@" \ No newline at end of file diff --git a/testcases/function_test/pkg_test/texlive-split-n/texlive-lpic-doc/test_texlive-lpic-doc_function_verify.sh b/testcases/function_test/pkg_test/texlive-split-n/texlive-lpic-doc/test_texlive-lpic-doc_function_verify.sh deleted file mode 100644 index 51fc7430130..00000000000 --- a/testcases/function_test/pkg_test/texlive-split-n/texlive-lpic-doc/test_texlive-lpic-doc_function_verify.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-19 -# @License : Mulan PSL v2 -# @Desc : Verify package installation status -# ############################################ - -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" - } - - # 定义软件包名称 - PACKAGE_NAME="texlive-lpic-doc" - - # 检查软件包是否已在yum源中 - LOG_INFO "检查yum源中是否存在软件包 $PACKAGE_NAME" - dnf list available $PACKAGE_NAME &> /dev/null - if [ $? -ne 0 ]; then - LOG_ERROR "yum源中不存在软件包 $PACKAGE_NAME" - exit 255 - fi - - # 检查当前是否已安装软件包 - LOG_INFO "检查当前是否已安装软件包 $PACKAGE_NAME" - dnf list installed $PACKAGE_NAME &> /dev/null - if [ $? -eq 0 ]; then - LOG_INFO "软件包 $PACKAGE_NAME 已安装,测试结束后将保持安装状态" - INSTALLED_BEFORE=true - else - LOG_INFO "软件包 $PACKAGE_NAME 未安装,测试结束后将卸载" - INSTALLED_BEFORE=false - fi - - # 如果未安装,则安装软件包 - if [ "$INSTALLED_BEFORE" = false ]; then - LOG_INFO "安装软件包 $PACKAGE_NAME" - dnf install -y $PACKAGE_NAME - CHECK_RESULT $? 0 0 "安装软件包 $PACKAGE_NAME 失败" - fi - - # 验证软件包安装状态 - LOG_INFO "验证软件包安装状态" - dnf list installed $PACKAGE_NAME &> /dev/null - CHECK_RESULT $? 0 0 "软件包 $PACKAGE_NAME 安装状态验证失败" - - # 检查软件包是否提供特定命令(假设软件包提供命令 "texdoc") - LOG_INFO "检查软件包提供的命令是否存在" - command -v texdoc &> /dev/null - if [ $? -eq 0 ]; then - LOG_INFO "软件包提供的命令 "texdoc" 存在" - else - LOG_ERROR "软件包提供的命令 "texdoc" 不存在" - exit 255 - fi - - # 测试软件包提供的命令 - LOG_INFO "测试软件包提供的命令 "texdoc" 是否可用" - texdoc --help &> /dev/null - CHECK_RESULT $? 0 0 "命令 "texdoc" 执行失败" - - # 如果需要第二个服务器执行命令,使用SSH_CMD - # SSH_CMD "ls" $NODE2_IPV4 $NODE2_PASSWORD $NODE2_USER - # CHECK_RESULT $? 0 0 "在第二个服务器上执行命令失败" - - # 清理环境:如果之前未安装,则卸载软件包 - if [ "$INSTALLED_BEFORE" = false ]; then - LOG_INFO "卸载软件包 $PACKAGE_NAME" - dnf remove -y $PACKAGE_NAME - CHECK_RESULT $? 0 0 "卸载软件包 $PACKAGE_NAME 失败" - fi - - LOG_INFO "测试脚本执行完成,环境已恢复" -} - -main "$@" \ No newline at end of file From a8240cfdcf2b89b6d243e125726d3bef07f278b5 Mon Sep 17 00:00:00 2001 From: honghua Date: Sat, 18 Apr 2026 14:07:28 +0800 Subject: [PATCH 8/8] update testcase for testsuite texlive-greektex --- .../texlive-split-j/texlive-greektex.json | 12 --- ...xlive-greektex_function_check_installed.sh | 68 ------------ ...test_texlive-greektex_function_encoding.sh | 102 ------------------ ..._texlive-greektex_function_greek_in_doc.sh | 90 ---------------- 4 files changed, 272 deletions(-) delete mode 100644 testcases/function_test/pkg_test/texlive-split-j/texlive-greektex/test_texlive-greektex_function_check_installed.sh delete mode 100644 testcases/function_test/pkg_test/texlive-split-j/texlive-greektex/test_texlive-greektex_function_encoding.sh delete mode 100644 testcases/function_test/pkg_test/texlive-split-j/texlive-greektex/test_texlive-greektex_function_greek_in_doc.sh diff --git a/suite2cases/function_test/pkg_test/texlive-split-j/texlive-greektex.json b/suite2cases/function_test/pkg_test/texlive-split-j/texlive-greektex.json index 5f284631fe7..51dda1374a3 100644 --- a/suite2cases/function_test/pkg_test/texlive-split-j/texlive-greektex.json +++ b/suite2cases/function_test/pkg_test/texlive-split-j/texlive-greektex.json @@ -9,18 +9,6 @@ { "name": "test_texlive-greektex_function_uninstall", "desc": "Test package removal" - }, - { - "name": "test_texlive-greektex_function_check_installed", - "desc": "Verify package is installed" - }, - { - "name": "test_texlive-greektex_function_greek_in_doc", - "desc": "Test Greek text typesetting" - }, - { - "name": "test_texlive-greektex_function_encoding", - "desc": "Test input encoding support" } ] } \ No newline at end of file diff --git a/testcases/function_test/pkg_test/texlive-split-j/texlive-greektex/test_texlive-greektex_function_check_installed.sh b/testcases/function_test/pkg_test/texlive-split-j/texlive-greektex/test_texlive-greektex_function_check_installed.sh deleted file mode 100644 index 14ef5be775e..00000000000 --- a/testcases/function_test/pkg_test/texlive-split-j/texlive-greektex/test_texlive-greektex_function_check_installed.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-20 -# @License : Mulan PSL v2 -# @Desc : Verify package is installed -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - PACKAGE_NAME="texlive-greektex" - LOG_INFO "测试开始:验证软件包是否安装" - LOG_INFO "步骤1:检查软件包是否已在YUM源中" - dnf list available "$PACKAGE_NAME" >/dev/null 2>&1 - if [ $? -ne 0 ]; then - LOG_ERROR "软件包 $PACKAGE_NAME 不在YUM源中" - exit 255 - fi - - LOG_INFO "步骤2:检查软件包当前是否已安装" - dnf list installed "$PACKAGE_NAME" >/dev/null 2>&1 - if [ $? -eq 0 ]; then - LOG_INFO "软件包 $PACKAGE_NAME 已安装,将保持安装状态" - INSTALLED_BEFORE="true" - else - LOG_INFO "软件包 $PACKAGE_NAME 未安装,将进行安装测试" - INSTALLED_BEFORE="false" - fi - - if [ "$INSTALLED_BEFORE" = "false" ]; then - LOG_INFO "步骤3:安装软件包 $PACKAGE_NAME" - dnf install -y "$PACKAGE_NAME" - CHECK_RESULT $? 0 0 "安装软件包失败" - fi - - LOG_INFO "步骤4:验证软件包安装后功能" - which tex >/dev/null 2>&1 - CHECK_RESULT $? 0 0 "tex命令未找到" - - LOG_INFO "步骤5:验证软件包文件存在" - rpm -ql "$PACKAGE_NAME" | head -5 >/dev/null 2>&1 - CHECK_RESULT $? 0 0 "软件包文件列表获取失败" - - if [ "$INSTALLED_BEFORE" = "false" ]; then - LOG_INFO "步骤6:清理环境,卸载测试安装的软件包" - dnf remove -y "$PACKAGE_NAME" - CHECK_RESULT $? 0 0 "卸载软件包失败" - LOG_INFO "环境已恢复到测试前状态" - else - LOG_INFO "步骤6:保持原有安装状态,无需清理" - fi - - LOG_INFO "测试完成:软件包安装验证通过" -} - -main "$@" \ No newline at end of file diff --git a/testcases/function_test/pkg_test/texlive-split-j/texlive-greektex/test_texlive-greektex_function_encoding.sh b/testcases/function_test/pkg_test/texlive-split-j/texlive-greektex/test_texlive-greektex_function_encoding.sh deleted file mode 100644 index 6f2f7dff98d..00000000000 --- a/testcases/function_test/pkg_test/texlive-split-j/texlive-greektex/test_texlive-greektex_function_encoding.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-20 -# @License : Mulan PSL v2 -# @Desc : Test input encoding support -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - # 判断环境是否已安装texlive-greektex - LOG_INFO "检查texlive-greektex是否已安装" - rpm -q texlive-greektex > /dev/null 2>&1 - if [ $? -eq 0 ]; then - LOG_INFO "texlive-greektex已安装,脚本结束时将保持安装状态" - ALREADY_INSTALLED=1 - else - LOG_INFO "texlive-greektex未安装,将在测试中安装" - ALREADY_INSTALLED=0 - fi - - # 检查yum源中是否有该软件包 - LOG_INFO "检查yum源中是否有texlive-greektex软件包" - dnf list available texlive-greektex > /dev/null 2>&1 - CHECK_RESULT $? 0 0 "yum源中未找到texlive-greektex软件包" - if [ $? -ne 0 ]; then - LOG_ERROR "yum源中未找到texlive-greektex软件包" - exit 255 - fi - - # 如果未安装,则安装软件包 - if [ ${ALREADY_INSTALLED} -eq 0 ]; then - LOG_INFO "安装texlive-greektex软件包" - dnf install -y texlive-greektex > /dev/null 2>&1 - CHECK_RESULT $? 0 0 "安装texlive-greektex失败" - fi - - # 测试输入编码支持 - LOG_INFO "测试输入编码支持功能" - # 检查texlive-greektex提供的命令和功能,这里假设测试greektex命令 - which greektex > /dev/null 2>&1 - CHECK_RESULT $? 0 0 "greektex命令不存在" - if [ $? -ne 0 ]; then - LOG_ERROR "greektex命令不存在或不支持" - # 清理环境 - if [ ${ALREADY_INSTALLED} -eq 0 ]; then - LOG_INFO "清理环境:卸载texlive-greektex" - dnf remove -y texlive-greektex > /dev/null 2>&1 - fi - exit 255 - fi - - # 执行测试命令,检查编码支持 - LOG_INFO "执行测试命令验证编码支持" - greektex --help > /dev/null 2>&1 - CHECK_RESULT $? 0 0 "执行greektex命令失败" - - # 创建测试文件验证编码处理 - LOG_INFO "创建测试文件验证希腊语编码处理" - cat > test_greek.tex << "EOF" - \documentclass{article} - \usepackage[iso-8859-7]{inputenc} - \usepackage[greek]{babel} - \begin{document} - Καλημέρα κόσμε! - \end{document} - EOF - - # 尝试处理测试文件 - LOG_INFO "尝试处理希腊语测试文件" - greektex test_greek.tex > /dev/null 2>&1 - CHECK_RESULT $? 0 0 "处理希腊语编码文件失败" - - # 清理测试文件 - LOG_INFO "清理测试文件" - rm -f test_greek.tex test_greek.dvi test_greek.log test_greek.aux > /dev/null 2>&1 - - # 恢复环境 - if [ ${ALREADY_INSTALLED} -eq 0 ]; then - LOG_INFO "测试完成,清理环境:卸载texlive-greektex" - dnf remove -y texlive-greektex > /dev/null 2>&1 - CHECK_RESULT $? 0 0 "卸载texlive-greektex失败" - else - LOG_INFO "测试完成,保持texlive-greektex安装状态" - fi - - LOG_INFO "测试脚本执行完成" -} - -main "$@" \ No newline at end of file diff --git a/testcases/function_test/pkg_test/texlive-split-j/texlive-greektex/test_texlive-greektex_function_greek_in_doc.sh b/testcases/function_test/pkg_test/texlive-split-j/texlive-greektex/test_texlive-greektex_function_greek_in_doc.sh deleted file mode 100644 index 0501eb12fd3..00000000000 --- a/testcases/function_test/pkg_test/texlive-split-j/texlive-greektex/test_texlive-greektex_function_greek_in_doc.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-20 -# @License : Mulan PSL v2 -# @Desc : Test Greek text typesetting -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - LOG_INFO "开始测试:Test Greek text typesetting" - - # 定义软件包名称 - PACKAGE_NAME="texlive-greektex" - - # 检查软件包是否已安装 - LOG_INFO "检查软件包是否已安装" - if rpm -q $PACKAGE_NAME > /dev/null 2>&1; then - LOG_INFO "软件包 $PACKAGE_NAME 已安装" - INSTALLED_BEFORE="true" - else - LOG_INFO "软件包 $PACKAGE_NAME 未安装" - INSTALLED_BEFORE="false" - fi - - # 检查yum源中是否存在该软件包 - LOG_INFO "检查yum源中是否存在 $PACKAGE_NAME" - if ! dnf list available $PACKAGE_NAME > /dev/null 2>&1; then - LOG_ERROR "yum源中不存在 $PACKAGE_NAME" - exit 255 - fi - - # 如果未安装,则安装软件包 - if [ "$INSTALLED_BEFORE" = "false" ]; then - LOG_INFO "安装软件包 $PACKAGE_NAME" - dnf install -y $PACKAGE_NAME - CHECK_RESULT $? 0 0 "安装软件包失败" - fi - - # 测试希腊文本排版功能 - LOG_INFO "测试希腊文本排版功能" - cat > test_greek.tex << "EOF" - \documentclass{article} - \usepackage[greek]{babel} - \begin{document} - Καλημέρα, αυτό είναι ένα δοκιμαστικό κείμενο στα ελληνικά. - \end{document} - EOF - - # 编译LaTeX文档 - LOG_INFO "编译LaTeX文档" - pdflatex test_greek.tex - CHECK_RESULT $? 0 0 "编译LaTeX文档失败" - - # 检查生成的PDF文件 - LOG_INFO "检查生成的PDF文件" - if [ -f test_greek.pdf ]; then - LOG_INFO "PDF文件生成成功" - else - LOG_ERROR "PDF文件生成失败" - exit 1 - fi - - # 清理测试文件 - LOG_INFO "清理测试文件" - rm -f test_greek.tex test_greek.aux test_greek.log test_greek.pdf - - # 如果之前未安装,则卸载软件包 - if [ "$INSTALLED_BEFORE" = "false" ]; then - LOG_INFO "卸载软件包 $PACKAGE_NAME" - dnf remove -y $PACKAGE_NAME - CHECK_RESULT $? 0 0 "卸载软件包失败" - fi - - LOG_INFO "测试完成" -} - -main "$@" \ No newline at end of file