From 7dfc5df052287bc6d477b467ca1ca71e9f36e703 Mon Sep 17 00:00:00 2001 From: honghua Date: Tue, 21 Apr 2026 20:56:29 +0800 Subject: [PATCH] update testcase for testsuite texlive-placeat --- .../texlive-split-r/texlive-placeat.json | 30 ---- .../test_texlive-placeat_function_basic.sh | 64 --------- ...exlive-placeat_function_check_installed.sh | 112 --------------- ..._texlive-placeat_function_doc_available.sh | 73 ---------- .../test_texlive-placeat_function_install.sh | 72 ---------- ...st_texlive-placeat_function_latex_usage.sh | 136 ------------------ ...test_texlive-placeat_function_uninstall.sh | 68 --------- 7 files changed, 555 deletions(-) delete mode 100644 suite2cases/function_test/pkg_test/texlive-split-r/texlive-placeat.json delete mode 100644 testcases/function_test/pkg_test/texlive-split-r/texlive-placeat/test_texlive-placeat_function_basic.sh delete mode 100644 testcases/function_test/pkg_test/texlive-split-r/texlive-placeat/test_texlive-placeat_function_check_installed.sh delete mode 100644 testcases/function_test/pkg_test/texlive-split-r/texlive-placeat/test_texlive-placeat_function_doc_available.sh delete mode 100644 testcases/function_test/pkg_test/texlive-split-r/texlive-placeat/test_texlive-placeat_function_install.sh delete mode 100644 testcases/function_test/pkg_test/texlive-split-r/texlive-placeat/test_texlive-placeat_function_latex_usage.sh delete mode 100644 testcases/function_test/pkg_test/texlive-split-r/texlive-placeat/test_texlive-placeat_function_uninstall.sh diff --git a/suite2cases/function_test/pkg_test/texlive-split-r/texlive-placeat.json b/suite2cases/function_test/pkg_test/texlive-split-r/texlive-placeat.json deleted file mode 100644 index 64b5c665a2c..00000000000 --- a/suite2cases/function_test/pkg_test/texlive-split-r/texlive-placeat.json +++ /dev/null @@ -1,30 +0,0 @@ -{ - "path": "$OET_PATH/testcases/function_test/pkg_test/texlive-split-r/texlive-placeat", - "machine num": 1, - "cases": [ - { - "name": "test_texlive-placeat_function_install", - "desc": "Test package installation" - }, - { - "name": "test_texlive-placeat_function_uninstall", - "desc": "Test package removal" - }, - { - "name": "test_texlive-placeat_function_basic", - "desc": "Test basic command usage" - }, - { - "name": "test_texlive-placeat_function_check_installed", - "desc": "Verify texlive-placeat package is installed" - }, - { - "name": "test_texlive-placeat_function_latex_usage", - "desc": "Test basic LaTeX command usage with placeat" - }, - { - "name": "test_texlive-placeat_function_doc_available", - "desc": "Check if package documentation is available" - } - ] -} \ No newline at end of file diff --git a/testcases/function_test/pkg_test/texlive-split-r/texlive-placeat/test_texlive-placeat_function_basic.sh b/testcases/function_test/pkg_test/texlive-split-r/texlive-placeat/test_texlive-placeat_function_basic.sh deleted file mode 100644 index e428a319925..00000000000 --- a/testcases/function_test/pkg_test/texlive-split-r/texlive-placeat/test_texlive-placeat_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-09-28 -# @License : Mulan PSL v2 -# @Desc : Test basic command usage -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - - # 检查是否已经安装texlive - LOG_INFO "检查是否已经安装texlive..." - if dnf list installed texlive &>/dev/null; then - LOG_INFO "texlive已经安装,保持安装状态" - installed=true - else - LOG_INFO "texlive未安装,将在测试结束后卸载" - installed=false - fi - - # 检查yum源中是否有texlive软件包 - LOG_INFO "检查yum源中是否有texlive软件包..." - if ! dnf list available texlive &>/dev/null; then - LOG_ERROR "yum源中没有texlive软件包" - exit 255 - fi - - # 安装texlive软件包 - if [ "$installed" = false ]; then - LOG_INFO "开始安装texlive软件包..." - dnf install -y texlive - CHECK_RESULT $? 0 0 "安装texlive失败" - fi - - # 测试基本命令用法 - LOG_INFO "测试基本命令用法..." - tex --version - CHECK_RESULT $? 0 0 "获取tex版本失败" - - # 清理环境 - if [ "$installed" = false ]; then - LOG_INFO "卸载texlive软件包..." - dnf remove -y texlive - CHECK_RESULT $? 0 0 "卸载texlive失败" - fi - - LOG_INFO "测试脚本执行完毕" - -} - -main "$@" \ No newline at end of file diff --git a/testcases/function_test/pkg_test/texlive-split-r/texlive-placeat/test_texlive-placeat_function_check_installed.sh b/testcases/function_test/pkg_test/texlive-split-r/texlive-placeat/test_texlive-placeat_function_check_installed.sh deleted file mode 100644 index f92fe4be1d7..00000000000 --- a/testcases/function_test/pkg_test/texlive-split-r/texlive-placeat/test_texlive-placeat_function_check_installed.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-04-01 -# @License : Mulan PSL v2 -# @Desc : Verify texlive-placeat package is installed -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - # 测试texlive-placeat软件包是否安装的脚本 - - # 定义软件包名称 - PACKAGE_NAME="texlive-placeat" - - # 步骤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:检查系统是否已安装 ${PACKAGE_NAME} 软件包" - rpm -q ${PACKAGE_NAME} &> /dev/null - if [ $? -eq 0 ]; then - LOG_INFO "软件包 ${PACKAGE_NAME} 已安装" - INSTALLED_BEFORE="true" - else - LOG_INFO "软件包 ${PACKAGE_NAME} 未安装" - INSTALLED_BEFORE="false" - fi - - # 步骤3:如果未安装,则安装软件包 - if [ "${INSTALLED_BEFORE}" = "false" ]; then - LOG_INFO "步骤3:安装 ${PACKAGE_NAME} 软件包" - dnf install -y ${PACKAGE_NAME} - CHECK_RESULT $? 0 0 "安装 ${PACKAGE_NAME} 软件包失败" - LOG_INFO "软件包 ${PACKAGE_NAME} 安装成功" - fi - - # 步骤4:验证软件包是否正确安装 - LOG_INFO "步骤4:验证 ${PACKAGE_NAME} 软件包是否正确安装" - rpm -q ${PACKAGE_NAME} &> /dev/null - CHECK_RESULT $? 0 0 "验证 ${PACKAGE_NAME} 软件包安装状态失败" - LOG_INFO "软件包 ${PACKAGE_NAME} 验证成功" - - # 步骤5:检查软件包提供的文件 - LOG_INFO "步骤5:检查 ${PACKAGE_NAME} 软件包提供的文件" - rpm -ql ${PACKAGE_NAME} &> /dev/null - CHECK_RESULT $? 0 0 "检查 ${PACKAGE_NAME} 软件包文件列表失败" - LOG_INFO "软件包 ${PACKAGE_NAME} 文件列表检查成功" - - # 步骤6:测试软件包功能 - LOG_INFO "步骤6:测试 ${PACKAGE_NAME} 软件包功能" - # 这里可以添加具体的功能测试命令 - # 由于texlive-placeat是LaTeX宏包,我们可以检查相关文件是否存在 - TEXMF_PATH=$(kpsewhich -var-value TEXMFMAIN 2>/dev/null || echo "/usr/share/texlive") - if [ -d "${TEXMF_PATH}/tex/latex/${PACKAGE_NAME}" ]; then - LOG_INFO "找到 ${PACKAGE_NAME} 宏包目录" - CHECK_RESULT 0 0 0 "检查 ${PACKAGE_NAME} 宏包目录成功" - else - LOG_ERROR "未找到 ${PACKAGE_NAME} 宏包目录" - CHECK_RESULT 1 0 0 "检查 ${PACKAGE_NAME} 宏包目录失败" - fi - - # 步骤7:清理环境 - LOG_INFO "步骤7:清理测试环境" - if [ "${INSTALLED_BEFORE}" = "false" ]; then - LOG_INFO "卸载测试安装的 ${PACKAGE_NAME} 软件包" - dnf remove -y ${PACKAGE_NAME} - CHECK_RESULT $? 0 0 "卸载 ${PACKAGE_NAME} 软件包失败" - LOG_INFO "软件包 ${PACKAGE_NAME} 卸载成功" - else - LOG_INFO "保持 ${PACKAGE_NAME} 软件包的安装状态" - fi - - # 步骤8:最终验证 - LOG_INFO "步骤8:最终验证环境状态" - if [ "${INSTALLED_BEFORE}" = "false" ]; then - rpm -q ${PACKAGE_NAME} &> /dev/null - if [ $? -eq 0 ]; then - LOG_ERROR "清理后 ${PACKAGE_NAME} 软件包仍存在" - CHECK_RESULT 1 0 0 "环境清理不彻底" - else - LOG_INFO "环境已恢复到测试前状态" - CHECK_RESULT 0 0 0 "环境恢复成功" - fi - else - rpm -q ${PACKAGE_NAME} &> /dev/null - CHECK_RESULT $? 0 0 "测试后 ${PACKAGE_NAME} 软件包状态异常" - LOG_INFO "环境保持测试前安装状态" - fi - - LOG_INFO "测试完成:Verify texlive-placeat package is installed" -} - -main "$@" \ No newline at end of file diff --git a/testcases/function_test/pkg_test/texlive-split-r/texlive-placeat/test_texlive-placeat_function_doc_available.sh b/testcases/function_test/pkg_test/texlive-split-r/texlive-placeat/test_texlive-placeat_function_doc_available.sh deleted file mode 100644 index e2e07e5438f..00000000000 --- a/testcases/function_test/pkg_test/texlive-split-r/texlive-placeat/test_texlive-placeat_function_doc_available.sh +++ /dev/null @@ -1,73 +0,0 @@ -#!/usr/bin/bash - -# Copyright (c) 2024 ISCAS .ALL rights reserved. -# This program is licensed under Mulan PSL v2. -# You can use it according to the terms and conditions of the Mulan PSL v2. -# http://license.coscl.org.cn/MulanPSL2 -# THIS PROGRAM IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, -# EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, -# MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. -# See the Mulan PSL v2 for more details. - -# ############################################# -# @Author : honghua -# @Contact : honghua@iscas.ac.cn -# @Date : 2026-04-01 -# @License : Mulan PSL v2 -# @Desc : Check if package documentation is available -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - LOG_INFO "开始测试:检查texlive-placeat功能文档是否可用" - - # 定义软件包名称 - PACKAGE_NAME="texlive-placeat" - - # 步骤1:检查软件包是否已在环境中安装 - LOG_INFO "步骤1:检查系统中是否已安装 $PACKAGE_NAME" - if dnf list installed "$PACKAGE_NAME" &>/dev/null; then - LOG_INFO "系统中已安装 $PACKAGE_NAME,测试结束后将保持安装状态" - ALREADY_INSTALLED=true - else - LOG_INFO "系统中未安装 $PACKAGE_NAME,将在测试过程中安装并在测试后卸载" - ALREADY_INSTALLED=false - fi - - # 步骤2:检查yum源中是否存在该软件包 - LOG_INFO "步骤2:检查yum源中是否存在 $PACKAGE_NAME" - if ! dnf search "$PACKAGE_NAME" | grep -q "^$PACKAGE_NAME\."; then - LOG_ERROR "yum源中未找到软件包 $PACKAGE_NAME" - exit 255 - fi - - # 步骤3:如果未安装,则安装软件包 - if [ "$ALREADY_INSTALLED" = false ]; then - LOG_INFO "步骤3:安装 $PACKAGE_NAME" - dnf install -y "$PACKAGE_NAME" - CHECK_RESULT $? 0 0 "安装 $PACKAGE_NAME 失败" - fi - - # 步骤4:检查软件包文档是否可用 - LOG_INFO "步骤4:检查 $PACKAGE_NAME 文档是否可用" - if rpm -qd "$PACKAGE_NAME" &>/dev/null; then - LOG_INFO "软件包 $PACKAGE_NAME 的文档文件列表:" - rpm -qd "$PACKAGE_NAME" - CHECK_RESULT $? 0 0 "获取 $PACKAGE_NAME 文档信息失败" - else - LOG_ERROR "软件包 $PACKAGE_NAME 没有文档文件" - exit 255 - fi - - # 步骤5:清理环境,如果测试前未安装则卸载软件包 - if [ "$ALREADY_INSTALLED" = false ]; then - LOG_INFO "步骤5:卸载 $PACKAGE_NAME" - dnf remove -y "$PACKAGE_NAME" - CHECK_RESULT $? 0 0 "卸载 $PACKAGE_NAME 失败" - fi - - LOG_INFO "测试完成:texlive-placeat功能文档可用性检查通过" -} - -main "$@" \ No newline at end of file diff --git a/testcases/function_test/pkg_test/texlive-split-r/texlive-placeat/test_texlive-placeat_function_install.sh b/testcases/function_test/pkg_test/texlive-split-r/texlive-placeat/test_texlive-placeat_function_install.sh deleted file mode 100644 index 68a071f2761..00000000000 --- a/testcases/function_test/pkg_test/texlive-split-r/texlive-placeat/test_texlive-placeat_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 : 2025-09-28 -# @License : Mulan PSL v2 -# @Desc : Test package installation -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - LOG_INFO "开始测试:Test package installation" - - # 检查是否已安装texlive-placeat-function - LOG_INFO "检查是否已安装texlive-placeat-function" - dnf list installed texlive-placeat-function > /dev/null 2>&1 - if [ $? -eq 0 ]; then - LOG_INFO "texlive-placeat-function已安装,脚本结束后保持安装状态" - INSTALLED=true - else - LOG_INFO "texlive-placeat-function未安装,脚本结束后将卸载" - INSTALLED=false - fi - - # 检查yum源中是否有texlive-placeat-function - LOG_INFO "检查yum源中是否有texlive-placeat-function" - dnf list available texlive-placeat-function > /dev/null 2>&1 - if [ $? -ne 0 ]; then - LOG_ERROR "yum源中未找到texlive-placeat-function软件包" - exit 255 - fi - - # 安装texlive-placeat-function - LOG_INFO "开始安装texlive-placeat-function" - dnf install -y texlive-placeat-function - CHECK_RESULT $? 0 0 "安装texlive-placeat-function失败" - - # 验证安装是否成功 - LOG_INFO "验证texlive-placeat-function是否安装成功" - rpm -q texlive-placeat-function > /dev/null 2>&1 - CHECK_RESULT $? 0 0 "texlive-placeat-function未正确安装" - - # 执行测试命令 - LOG_INFO "执行测试命令" - command_to_test --param - if [ $? -ne 0 ]; then - LOG_ERROR "测试命令执行失败,参数可能不存在或不支持" - exit 255 - fi - - # 清理环境 - if [ "$INSTALLED" = false ]; then - LOG_INFO "卸载texlive-placeat-function" - dnf remove -y texlive-placeat-function - CHECK_RESULT $? 0 0 "卸载texlive-placeat-function失败" - fi - - LOG_INFO "测试完成:Test package installation" -} - -main "$@" \ No newline at end of file diff --git a/testcases/function_test/pkg_test/texlive-split-r/texlive-placeat/test_texlive-placeat_function_latex_usage.sh b/testcases/function_test/pkg_test/texlive-split-r/texlive-placeat/test_texlive-placeat_function_latex_usage.sh deleted file mode 100644 index bb5cb1d1e8f..00000000000 --- a/testcases/function_test/pkg_test/texlive-split-r/texlive-placeat/test_texlive-placeat_function_latex_usage.sh +++ /dev/null @@ -1,136 +0,0 @@ -#!/usr/bin/bash - -# Copyright (c) 2024 ISCAS .ALL rights reserved. -# This program is licensed under Mulan PSL v2. -# You can use it according to the terms and conditions of the Mulan PSL v2. -# http://license.coscl.org.cn/MulanPSL2 -# THIS PROGRAM IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, -# EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, -# 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 : Test basic LaTeX command usage with placeat -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - # 测试基本LaTeX命令使用placeat功能 - - LOG_INFO "1. 检查是否已安装texlive-placeat软件包" - if dnf list installed texlive-placeat &>/dev/null; then - LOG_INFO "检测到texlive-placeat已安装,测试后将保持安装状态" - INSTALLED_BEFORE=true - else - LOG_INFO "未检测到texlive-placeat安装" - INSTALLED_BEFORE=false - fi - - LOG_INFO "2. 检查yum源中是否存在texlive-placeat软件包" - if ! dnf list available texlive-placeat &>/dev/null; then - LOG_ERROR "yum源中未找到texlive-placeat软件包" - exit 255 - fi - - LOG_INFO "3. 检查placeat命令参数支持情况" - if ! man placeat &>/dev/null && ! placeat --help &>/dev/null; then - LOG_ERROR "无法获取placeat命令的帮助信息,可能参数不支持" - exit 255 - fi - - if [ "$INSTALLED_BEFORE" = "false" ]; then - LOG_INFO "4. 安装texlive-placeat软件包" - dnf install -y texlive-placeat - CHECK_RESULT $? 0 0 "安装texlive-placeat失败" - fi - - LOG_INFO "5. 创建测试LaTeX文档" - TEST_DIR="/tmp/test_latex_$(date +%s)" - mkdir -p "$TEST_DIR" - cd "$TEST_DIR" || exit 1 - - cat > test.tex << "EOF" - \documentclass{article} - \usepackage{placeat} - \begin{document} - This is a test document for placeat package. - - \placeat{2cm}{3cm}{Test text placed at specific coordinates} - - \placeat{5cm}{1cm}{Another text placement test} - - \end{document} - EOF - - CHECK_RESULT $? 0 0 "创建测试LaTeX文档失败" - - LOG_INFO "6. 使用pdflatex编译测试文档" - if command -v pdflatex &>/dev/null; then - pdflatex -interaction=nonstopmode test.tex - CHECK_RESULT $? 0 0 "编译LaTeX文档失败" - - LOG_INFO "7. 检查生成的PDF文件" - if [ -f "test.pdf" ]; then - LOG_INFO "成功生成PDF文件: test.pdf" - file test.pdf | grep -q "PDF document" - CHECK_RESULT $? 0 0 "生成的PDF文件格式不正确" - else - LOG_ERROR "未找到生成的PDF文件" - exit 1 - fi - else - LOG_INFO "7. 系统未安装pdflatex,跳过编译测试" - LOG_INFO "测试placeat包的基本功能:检查tex文件语法" - latex -interaction=nonstopmode test.tex 2>/dev/null - CHECK_RESULT $? 0 0 "LaTeX文件语法检查失败" - fi - - LOG_INFO "8. 测试placeat命令基本使用" - if command -v placeat &>/dev/null; then - placeat --version 2>&1 | head -1 - CHECK_RESULT $? 0 0 "placeat命令版本检查失败" - - echo "Test content" | placeat 2 3 2>/dev/null - CHECK_RESULT $? 0 0 "placeat命令执行失败" - fi - - LOG_INFO "9. 清理测试文件" - cd / - rm -rf "$TEST_DIR" - CHECK_RESULT $? 0 0 "清理测试文件失败" - - if [ "$INSTALLED_BEFORE" = "false" ]; then - LOG_INFO "10. 卸载texlive-placeat软件包" - dnf remove -y texlive-placeat - CHECK_RESULT $? 0 0 "卸载texlive-placeat失败" - LOG_INFO "环境已恢复到测试前状态" - else - LOG_INFO "10. 保持texlive-placeat安装状态" - fi - - LOG_INFO "11. 验证环境恢复" - if [ "$INSTALLED_BEFORE" = "false" ]; then - if dnf list installed texlive-placeat &>/dev/null; then - LOG_ERROR "环境恢复失败,texlive-placeat仍处于安装状态" - exit 1 - else - LOG_INFO "环境恢复成功,texlive-placeat已卸载" - fi - else - if ! dnf list installed texlive-placeat &>/dev/null; then - LOG_ERROR "环境恢复失败,texlive-placeat被意外卸载" - exit 1 - else - LOG_INFO "环境恢复成功,texlive-placeat保持安装状态" - fi - fi - - LOG_INFO "测试完成:Test basic LaTeX command usage with placeat" -} - -main "$@" \ No newline at end of file diff --git a/testcases/function_test/pkg_test/texlive-split-r/texlive-placeat/test_texlive-placeat_function_uninstall.sh b/testcases/function_test/pkg_test/texlive-split-r/texlive-placeat/test_texlive-placeat_function_uninstall.sh deleted file mode 100644 index 0ec1db2c35b..00000000000 --- a/testcases/function_test/pkg_test/texlive-split-r/texlive-placeat/test_texlive-placeat_function_uninstall.sh +++ /dev/null @@ -1,68 +0,0 @@ -#!/usr/bin/bash - -# Copyright (c) 2024 ISCAS .ALL rights reserved. -# This program is licensed under Mulan PSL v2. -# You can use it according to the terms and conditions of the Mulan PSL v2. -# http://license.coscl.org.cn/MulanPSL2 -# THIS PROGRAM IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, -# EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, -# MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. -# See the Mulan PSL v2 for more details. - -# ############################################# -# @Author : honghua -# @Contact : honghua@iscas.ac.cn -# @Date : 2025-09-28 -# @License : Mulan PSL v2 -# @Desc : Test package removal -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - LOG_INFO "开始测试包移除功能" - - # 检查是否已安装texlive-placeat - LOG_INFO "检查texlive-placeat是否已安装" - dnf list installed texlive-placeat > /dev/null 2>&1 - if [ $? -eq 0 ]; then - LOG_INFO "texlive-placeat已安装,测试结束后保持安装状态" - INSTALLED=1 - else - LOG_INFO "texlive-placeat未安装,将在测试结束后卸载" - INSTALLED=0 - fi - - # 检查yum源中是否有texlive-placeat - LOG_INFO "检查yum源中是否有texlive-placeat" - dnf list available texlive-placeat > /dev/null 2>&1 - if [ $? -ne 0 ]; then - LOG_ERROR "yum源中未找到texlive-placeat包" - exit 255 - fi - - # 安装texlive-placeat - if [ $INSTALLED -eq 0 ]; then - LOG_INFO "安装texlive-placeat" - dnf install -y texlive-placeat - CHECK_RESULT $? 0 0 "安装texlive-placeat失败" - fi - - # 测试卸载功能 - LOG_INFO "测试卸载texlive-placeat" - dnf remove -y texlive-placeat - CHECK_RESULT $? 0 0 "卸载texlive-placeat失败" - - # 恢复环境 - if [ $INSTALLED -eq 0 ]; then - LOG_INFO "恢复环境,卸载texlive-placeat" - dnf remove -y texlive-placeat > /dev/null 2>&1 - else - LOG_INFO "恢复环境,重新安装texlive-placeat" - dnf install -y texlive-placeat > /dev/null 2>&1 - fi - - LOG_INFO "测试包移除功能完成" -} - -main "$@" \ No newline at end of file