update testcase for testsuite texlive-annee-scolaire
This commit is contained in:
@@ -1,10 +0,0 @@
|
||||
{
|
||||
"path": "$OET_PATH/testcases/function_test/pkg_test/texlive-split-y/texlive-annee-scolaire",
|
||||
"machine num": 1,
|
||||
"cases": [
|
||||
{
|
||||
"name": "test_texlive-annee-scolaire_function_install",
|
||||
"desc": "Test package installation"
|
||||
}
|
||||
]
|
||||
}
|
||||
@@ -1,71 +0,0 @@
|
||||
#!/usr/bin/bash
|
||||
|
||||
# Copyright (c) 2024 ISCAS .ALL rights reserved.
|
||||
# This program is licensed under Mulan PSL v2.
|
||||
# You can use it according to the terms and conditions of the Mulan PSL v2.
|
||||
# http://license.coscl.org.cn/MulanPSL2
|
||||
# THIS PROGRAM IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND,
|
||||
# EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT,
|
||||
# MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE.
|
||||
# See the Mulan PSL v2 for more details.
|
||||
|
||||
# #############################################
|
||||
# @Author : honghua
|
||||
# @Contact : honghua@iscas.ac.cn
|
||||
# @Date : 2025-11-26
|
||||
# @License : Mulan PSL v2
|
||||
# @Desc : Test package installation
|
||||
# ############################################
|
||||
|
||||
source "$OET_PATH/libs/locallibs/common_lib.sh"
|
||||
|
||||
function run_test() {
|
||||
LOG_INFO "开始测试软件包安装功能"
|
||||
|
||||
# 检查软件包是否已安装
|
||||
if dnf list installed texlive-annee-scolaire &>/dev/null; then
|
||||
LOG_INFO "软件包 texlive-annee-scolaire 已安装"
|
||||
installed=true
|
||||
else
|
||||
LOG_INFO "软件包 texlive-annee-scolaire 未安装"
|
||||
installed=false
|
||||
fi
|
||||
|
||||
# 检查yum源中是否有该软件包
|
||||
LOG_INFO "检查yum源中是否存在 texlive-annee-scolaire 软件包"
|
||||
if ! dnf list available texlive-annee-scolaire &>/dev/null; then
|
||||
LOG_ERROR "yum源中不存在 texlive-annee-scolaire 软件包"
|
||||
exit 255
|
||||
fi
|
||||
|
||||
# 如果未安装,则进行安装
|
||||
if [ "$installed" = false ]; then
|
||||
LOG_INFO "开始安装 texlive-annee-scolaire 软件包"
|
||||
dnf install -y texlive-annee-scolaire
|
||||
CHECK_RESULT $? 0 0 "安装 texlive-annee-scolaire 软件包失败"
|
||||
fi
|
||||
|
||||
# 测试命令参数
|
||||
LOG_INFO "测试命令参数"
|
||||
texlive-annee-scolaire --invalid-param &>/dev/null
|
||||
if [ $? -ne 255 ]; then
|
||||
LOG_ERROR "命令参数检查失败"
|
||||
exit 255
|
||||
fi
|
||||
|
||||
# 检查命令是否成功执行
|
||||
LOG_INFO "执行测试命令"
|
||||
texlive-annee-scolaire --version &>/dev/null
|
||||
CHECK_RESULT $? 0 0 "执行 texlive-annee-scolaire --version 失败"
|
||||
|
||||
# 如果之前未安装,则卸载软件包
|
||||
if [ "$installed" = false ]; then
|
||||
LOG_INFO "卸载 texlive-annee-scolaire 软件包"
|
||||
dnf remove -y texlive-annee-scolaire
|
||||
CHECK_RESULT $? 0 0 "卸载 texlive-annee-scolaire 软件包失败"
|
||||
fi
|
||||
|
||||
LOG_INFO "测试完成,环境已恢复"
|
||||
}
|
||||
|
||||
main "$@"
|
||||
Reference in New Issue
Block a user