diff --git a/suite2cases/function_test/pkg_test/texlive-split-k/texlive-har2nat-doc.json b/suite2cases/function_test/pkg_test/texlive-split-k/texlive-har2nat-doc.json index 1d0cfee3f8c..b769dc76f6a 100644 --- a/suite2cases/function_test/pkg_test/texlive-split-k/texlive-har2nat-doc.json +++ b/suite2cases/function_test/pkg_test/texlive-split-k/texlive-har2nat-doc.json @@ -10,10 +10,6 @@ "name": "test_texlive-har2nat-doc_function_remove", "desc": "Test package removal" }, - { - "name": "test_texlive-har2nat-doc_function_check", - "desc": "Check package is installed" - }, { "name": "test_texlive-har2nat-doc_function_doc", "desc": "Verify documentation files" diff --git a/testcases/function_test/pkg_test/texlive-split-k/texlive-har2nat-doc/test_texlive-har2nat-doc_function_check.sh b/testcases/function_test/pkg_test/texlive-split-k/texlive-har2nat-doc/test_texlive-har2nat-doc_function_check.sh deleted file mode 100644 index 1d59354f62b..00000000000 --- a/testcases/function_test/pkg_test/texlive-split-k/texlive-har2nat-doc/test_texlive-har2nat-doc_function_check.sh +++ /dev/null @@ -1,67 +0,0 @@ -#!/usr/bin/bash - -# Copyright (c) 2024 ISCAS .ALL rights reserved. -# This program is licensed under Mulan PSL v2. -# You can use it according to the terms and conditions of the Mulan PSL v2. -# http://license.coscl.org.cn/MulanPSL2 -# THIS PROGRAM IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, -# EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, -# MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. -# See the Mulan PSL v2 for more details. - -# ############################################# -# @Author : honghua -# @Contact : honghua@iscas.ac.cn -# @Date : 2026-03-21 -# @License : Mulan PSL v2 -# @Desc : Check package is installed -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - # 检查是否已安装指定软件包 - LOG_INFO "检查是否已安装 texlive-har2nat-doc 软件包" - rpm -q texlive-har2nat-doc > /dev/null 2>&1 - if [ $? -eq 0 ]; then - LOG_INFO "texlive-har2nat-doc 已安装,标记为已安装状态" - INSTALLED_FLAG=1 - else - LOG_INFO "texlive-har2nat-doc 未安装,标记为未安装状态" - INSTALLED_FLAG=0 - fi - - # 检查 yum 源中是否存在该软件包 - LOG_INFO "检查 yum 源中是否存在 texlive-har2nat-doc 软件包" - dnf list available texlive-har2nat-doc > /dev/null 2>&1 - CHECK_RESULT $? 0 255 "yum 源中不存在 texlive-har2nat-doc 软件包" - - # 如果未安装,则安装软件包 - if [ $INSTALLED_FLAG -eq 0 ]; then - LOG_INFO "开始安装 texlive-har2nat-doc 软件包" - dnf install -y texlive-har2nat-doc - CHECK_RESULT $? 0 0 "安装 texlive-har2nat-doc 失败" - LOG_INFO "texlive-har2nat-doc 安装成功" - else - LOG_INFO "texlive-har2nat-doc 已安装,跳过安装步骤" - fi - - # 验证软件包是否成功安装 - LOG_INFO "验证 texlive-har2nat-doc 软件包是否成功安装" - rpm -q texlive-har2nat-doc > /dev/null 2>&1 - CHECK_RESULT $? 0 0 "texlive-har2nat-doc 软件包未正确安装" - - # 清理环境:如果之前未安装,则卸载软件包 - if [ $INSTALLED_FLAG -eq 0 ]; then - LOG_INFO "清理环境:卸载 texlive-har2nat-doc 软件包" - dnf remove -y texlive-har2nat-doc - CHECK_RESULT $? 0 0 "卸载 texlive-har2nat-doc 失败" - LOG_INFO "texlive-har2nat-doc 卸载成功" - else - LOG_INFO "保持 texlive-har2nat-doc 安装状态,无需清理" - fi - - LOG_INFO "测试完成" -} - -main "$@" \ No newline at end of file