update testcase for testsuite texlive-photo

This commit is contained in:
2026-04-19 01:29:06 +08:00
parent 2fcc9b0004
commit 033263d14b
2 changed files with 0 additions and 72 deletions

View File

@@ -1,11 +0,0 @@
{
"path": "$OET_PATH/testcases/function_test/pkg_test/texlive-split-r/texlive-photo",
"machine num": 1,
"cases": [
{
"name": "test_texlive-photo_upgrade",
"desc": "测试 texlive-photo 软件包的升级功能,验证升级过程是否正常完成。",
"machine num": 1
}
]
}

View File

@@ -1,61 +0,0 @@
#!/usr/bin/bash
# Copyright (c) 2024 ISCAS .ALL rights reserved.
# This program is licensed under Mulan PSL v2.
# You can use it according to the terms and conditions of the Mulan PSL v2.
# http://license.coscl.org.cn/MulanPSL2
# THIS PROGRAM IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND,
# EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT,
# MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE.
# See the Mulan PSL v2 for more details.
# #############################################
# @Author : honghua
# @Contact : honghua@iscas.ac.cn
# @Date : 2025-07-04
# @License : Mulan PSL v2
# @Desc : 测试 texlive-photo 软件包的升级功能,验证升级过程是否正常完成。
# ############################################
source "$OET_PATH/libs/locallibs/common_lib.sh"
function run_test() {
# 检查是否已经安装了 texlive-photo 软件包
LOG_INFO "检查是否已经安装了 texlive-photo 软件包"
rpm -q texlive-photo > /dev/null 2>&1
if [ $? -eq 0 ]; then
LOG_INFO "texlive-photo 已安装,脚本结束后将保持安装状态"
INSTALLED=true
else
LOG_INFO "texlive-phote 未安装,脚本结束后将卸载"
INSTALLED=false
fi
# 检查 yum 源中是否有 texlive-photo 软件包
LOG_INFO "检查 yum 源中是否有 texlive-photo 软件包"
dnf list available texlive-photo > /dev/null 2>&1
CHECK_RESULT $? 0 255 "yum 源中不存在 texlive-photo 软件包"
# 安装 texlive-photo
if [ "$INSTALLED" = false ]; then
LOG_INFO "开始安装 texlive-photo 软件包"
dnf install -y texlive-photo
CHECK_RESULT $? 0 $? "安装 texlive-photo 失败"
fi
# 验证升级功能
LOG_INFO "测试升级功能"
dnf upgrade -y texlive-photo
CHECK_RESULT $? 0 $? "升级 texlive-photo 失败"
# 清理环境:如果脚本开始时未安装,则卸载 texlive-phote否则保持安装状态
if [ "$INSTALLED" = false ]; then
LOG_INFO "卸载 texlive-phote"
dnf remove -y texlive-phote
CHECK_RESULT $? 0 $? "卸载 texlate_photo 失败"
else
LOG_INFO "保持原状,不卸载 texlate_photo"
fi
}
main "$@"