diff --git a/suite2cases/function_test/pkg_test/texlive-split-z/texlive-changelog.json b/suite2cases/function_test/pkg_test/texlive-split-z/texlive-changelog.json deleted file mode 100644 index 1dd11f6453a..00000000000 --- a/suite2cases/function_test/pkg_test/texlive-split-z/texlive-changelog.json +++ /dev/null @@ -1,30 +0,0 @@ -{ - "path": "$OET_PATH/testcases/function_test/pkg_test/texlive-split-z/texlive-changelog", - "machine num": 1, - "cases": [ - { - "name": "test_texlive-changelog_function_version", - "desc": "Verify version info" - }, - { - "name": "test_texlive-changelog_function_install", - "desc": "Verify package installation" - }, - { - "name": "test_texlive-changelog_function_uninstall", - "desc": "Verify package removal" - }, - { - "name": "test_texlive-changelog_function_help", - "desc": "Verify help command output" - }, - { - "name": "test_texlive-changelog_function_list", - "desc": "Verify list changelog files" - }, - { - "name": "test_texlive-changelog_function_view", - "desc": "Verify view changelog content" - } - ] -} \ No newline at end of file diff --git a/testcases/function_test/pkg_test/texlive-split-z/texlive-changelog/test_texlive-changelog_function_help.sh b/testcases/function_test/pkg_test/texlive-split-z/texlive-changelog/test_texlive-changelog_function_help.sh deleted file mode 100644 index a227ea185f3..00000000000 --- a/testcases/function_test/pkg_test/texlive-split-z/texlive-changelog/test_texlive-changelog_function_help.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-03-29 -# @License : Mulan PSL v2 -# @Desc : Verify help command output -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - LOG_INFO "开始测试:验证帮助命令输出" - LOG_INFO "步骤1:检查是否已安装 texlive-changelog 软件包" - rpm -q texlive-changelog > /dev/null 2>&1 - if [ $? -eq 0 ]; then - LOG_INFO "texlive-changelog 已安装,测试结束后将保持安装状态" - INSTALLED=true - else - LOG_INFO "texlive-changelog 未安装,将在测试过程中安装,并在测试结束后卸载" - INSTALLED=false - fi - - LOG_INFO "步骤2:检查yum源中是否有 texlive-changelog 软件包" - dnf list available texlive-changelog > /dev/null 2>&1 - CHECK_RESULT $? 0 0 "yum源中未找到 texlive-changelog 软件包" - if [ $? -ne 0 ]; then - LOG_ERROR "yum源中未找到 texlive-changelog 软件包" - exit 255 - fi - - if [ "$INSTALLED" = false ]; then - LOG_INFO "步骤3:安装 texlive-changelog 软件包" - dnf install -y texlive-changelog > /dev/null 2>&1 - CHECK_RESULT $? 0 0 "安装 texlive-changelog 软件包失败" - if [ $? -ne 0 ]; then - LOG_ERROR "安装 texlive-changelog 软件包失败" - exit 1 - fi - fi - - LOG_INFO "步骤4:执行帮助命令并验证输出" - texlive-changelog --help > /dev/null 2>&1 - CHECK_RESULT $? 0 0 "帮助命令执行失败或参数不支持" - if [ $? -ne 0 ]; then - LOG_ERROR "帮助命令执行失败或参数不支持" - exit 255 - fi - - LOG_INFO "步骤5:验证帮助命令输出包含预期内容" - texlive-changelog --help | grep -q "Usage:" 2>&1 - CHECK_RESULT $? 0 0 "帮助命令输出不符合预期" - - LOG_INFO "步骤6:清理环境" - if [ "$INSTALLED" = false ]; then - LOG_INFO "卸载 texlive-changelog 软件包" - dnf remove -y texlive-changelog > /dev/null 2>&1 - CHECK_RESULT $? 0 0 "卸载 texlive-changelog 软件包失败" - fi - - LOG_INFO "测试完成" -} - -main "$@" \ No newline at end of file diff --git a/testcases/function_test/pkg_test/texlive-split-z/texlive-changelog/test_texlive-changelog_function_install.sh b/testcases/function_test/pkg_test/texlive-split-z/texlive-changelog/test_texlive-changelog_function_install.sh deleted file mode 100644 index df9d6a7fea6..00000000000 --- a/testcases/function_test/pkg_test/texlive-split-z/texlive-changelog/test_texlive-changelog_function_install.sh +++ /dev/null @@ -1,62 +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-29 -# @License : Mulan PSL v2 -# @Desc : Verify package installation -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - LOG_INFO "开始测试:验证软件包安装功能" - LOG_INFO "步骤1:检查当前环境中是否已安装texlive-changelog软件包" - if rpm -q texlive-changelog &> /dev/null; then - LOG_INFO "当前环境已安装texlive-changelog,脚本结束后将保持安装状态" - already_installed=true - else - LOG_INFO "当前环境未安装texlive-changelog,将在测试过程中安装" - already_installed=false - fi - LOG_INFO "步骤2:检查yum源中是否存在texlive-changelog软件包" - dnf list available texlive-changelog &> /dev/null - if [ $? -ne 0 ]; then - LOG_ERROR "yum源中未找到texlive-changelog软件包" - exit 255 - fi - LOG_INFO "步骤3:安装texlive-changelog软件包" - if [ "$already_installed" = "false" ]; then - dnf install -y texlive-changelog - CHECK_RESULT $? 0 0 "安装texlive-changelog软件包失败" - LOG_INFO "安装texlive-changelog软件包成功" - fi - LOG_INFO "步骤4:验证软件包安装后功能" - rpm -q texlive-changelog - CHECK_RESULT $? 0 0 "验证软件包安装后功能失败" - LOG_INFO "步骤5:验证软件包命令执行" - texlive-changelog --help &> /dev/null - CHECK_RESULT $? 0 0 "texlive-changelog命令执行失败" - LOG_INFO "步骤6:清理环境" - if [ "$already_installed" = "false" ]; then - LOG_INFO "卸载测试安装的texlive-changelog软件包" - dnf remove -y texlive-changelog - CHECK_RESULT $? 0 0 "卸载texlive-changelog软件包失败" - LOG_INFO "卸载texlive-changelog软件包成功" - else - LOG_INFO "环境已安装texlive-changelog,保持安装状态" - fi - LOG_INFO "测试完成:验证软件包安装功能" -} - -main "$@" \ No newline at end of file diff --git a/testcases/function_test/pkg_test/texlive-split-z/texlive-changelog/test_texlive-changelog_function_list.sh b/testcases/function_test/pkg_test/texlive-split-z/texlive-changelog/test_texlive-changelog_function_list.sh deleted file mode 100644 index 2b6cc15c224..00000000000 --- a/testcases/function_test/pkg_test/texlive-split-z/texlive-changelog/test_texlive-changelog_function_list.sh +++ /dev/null @@ -1,79 +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-29 -# @License : Mulan PSL v2 -# @Desc : Verify list changelog files -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - LOG_INFO "开始测试:Verify list changelog files" - - # 定义软件包名称 - PACKAGE_NAME="texlive-changelog" - - # 检查yum源中是否有texlive-changelog软件包 - LOG_INFO "检查yum源中是否有${PACKAGE_NAME}软件包" - dnf list available ${PACKAGE_NAME} > /dev/null 2>&1 - if [ $? -ne 0 ]; then - LOG_ERROR "yum源中未找到${PACKAGE_NAME}软件包" - exit 255 - fi - - # 检查是否已安装texlive-changelog - LOG_INFO "检查是否已安装${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 - - # 如果未安装,则安装软件包 - if [ "${INSTALLED}" = "false" ]; then - LOG_INFO "安装${PACKAGE_NAME}软件包" - dnf install -y ${PACKAGE_NAME} - CHECK_RESULT $? 0 0 "安装${PACKAGE_NAME}失败" - fi - - # 测试list changelog files功能 - LOG_INFO "测试list changelog files功能" - rpm -q --changelog ${PACKAGE_NAME} > /dev/null 2>&1 - CHECK_RESULT $? 0 0 "获取${PACKAGE_NAME}变更日志失败" - - # 检查--changelog参数是否存在 - LOG_INFO "检查--changelog参数是否存在" - rpm --help | grep -q "\-\-changelog" - CHECK_RESULT $? 0 0 "rpm命令不支持--changelog参数" - - # 执行具体的changelog列表命令 - LOG_INFO "执行rpm -q --changelog ${PACKAGE_NAME}命令" - rpm -q --changelog ${PACKAGE_NAME} - CHECK_RESULT $? 0 0 "列出${PACKAGE_NAME}变更日志失败" - - # 清理环境:如果测试前未安装,则卸载软件包 - if [ "${INSTALLED}" = "false" ]; then - LOG_INFO "卸载${PACKAGE_NAME}软件包" - dnf remove -y ${PACKAGE_NAME} - CHECK_RESULT $? 0 0 "卸载${PACKAGE_NAME}失败" - fi - - LOG_INFO "测试完成:Verify list changelog files" -} - -main "$@" \ No newline at end of file diff --git a/testcases/function_test/pkg_test/texlive-split-z/texlive-changelog/test_texlive-changelog_function_uninstall.sh b/testcases/function_test/pkg_test/texlive-split-z/texlive-changelog/test_texlive-changelog_function_uninstall.sh deleted file mode 100644 index 795b9ee86b4..00000000000 --- a/testcases/function_test/pkg_test/texlive-split-z/texlive-changelog/test_texlive-changelog_function_uninstall.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-03-29 -# @License : Mulan PSL v2 -# @Desc : Verify package removal -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - # 定义软件包名称 - PACKAGE_NAME="texlive-changelog" - - # 步骤1: 检查软件包是否在yum源中 - LOG_INFO "检查软件包 $PACKAGE_NAME 是否在yum源中" - dnf list available $PACKAGE_NAME &>/dev/null - if [ $? -ne 0 ]; then - LOG_ERROR "软件包 $PACKAGE_NAME 不在yum源中" - exit 255 - fi - - # 步骤2: 检查当前环境是否已安装该软件包 - LOG_INFO "检查当前环境是否已安装 $PACKAGE_NAME" - rpm -q $PACKAGE_NAME &>/dev/null - if [ $? -eq 0 ]; then - LOG_INFO "软件包 $PACKAGE_NAME 已安装,脚本结束时将保持安装状态" - ALREADY_INSTALLED=true - else - LOG_INFO "软件包 $PACKAGE_NAME 未安装,将在测试中安装并最终卸载" - ALREADY_INSTALLED=false - fi - - # 步骤3: 如果未安装,则安装软件包 - if [ "$ALREADY_INSTALLED" = false ]; then - LOG_INFO "安装软件包 $PACKAGE_NAME" - dnf install -y $PACKAGE_NAME - CHECK_RESULT $? 0 0 "安装软件包 $PACKAGE_NAME 失败" - fi - - # 步骤4: 验证软件包已安装 - LOG_INFO "验证软件包 $PACKAGE_NAME 已安装" - rpm -q $PACKAGE_NAME - CHECK_RESULT $? 0 0 "验证软件包 $PACKAGE_NAME 安装失败" - - # 步骤5: 卸载软件包 - LOG_INFO "卸载软件包 $PACKAGE_NAME" - dnf remove -y $PACKAGE_NAME - CHECK_RESULT $? 0 0 "卸载软件包 $PACKAGE_NAME 失败" - - # 步骤6: 验证软件包已卸载 - LOG_INFO "验证软件包 $PACKAGE_NAME 已卸载" - rpm -q $PACKAGE_NAME - if [ $? -eq 0 ]; then - LOG_ERROR "软件包 $PACKAGE_NAME 卸载后仍然存在" - exit 1 - else - LOG_INFO "软件包 $PACKAGE_NAME 已成功卸载" - fi - - # 步骤7: 环境恢复 - LOG_INFO "恢复测试环境" - if [ "$ALREADY_INSTALLED" = true ]; then - LOG_INFO "重新安装软件包 $PACKAGE_NAME 以恢复到初始状态" - dnf install -y $PACKAGE_NAME - CHECK_RESULT $? 0 0 "重新安装软件包 $PACKAGE_NAME 失败" - LOG_INFO "环境已恢复到初始安装状态" - else - LOG_INFO "环境已恢复到初始未安装状态" - fi - - LOG_INFO "测试脚本执行完成" -} - -main "$@" \ No newline at end of file diff --git a/testcases/function_test/pkg_test/texlive-split-z/texlive-changelog/test_texlive-changelog_function_version.sh b/testcases/function_test/pkg_test/texlive-split-z/texlive-changelog/test_texlive-changelog_function_version.sh deleted file mode 100644 index d54244c256b..00000000000 --- a/testcases/function_test/pkg_test/texlive-split-z/texlive-changelog/test_texlive-changelog_function_version.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-11-26 -# @License : Mulan PSL v2 -# @Desc : Verify version info -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - - # 检查是否已安装texlive-changelog - LOG_INFO "检查是否已安装texlive-changelog" - rpm -q texlive-changelog > /dev/null 2>&1 - if [ $? -eq 0 ]; then - LOG_INFO "texlive-changelog已安装,脚本结束时将保持安装状态" - INSTALLED=true - else - LOG_INFO "texlive-changelog未安装,将在测试结束后卸载" - INSTALLED=false - fi - - # 检查yum源中是否有texlive-changelog包 - LOG_INFO "检查yum源中是否有texlive-changelog包" - dnf list available texlive-changelog > /dev/null 2>&1 - CHECK_RESULT $? 0 255 "yum源中未找到texlive-changelog包" - - # 安装texlive-changelog包 - if [ "$INSTALLED" = false ]; then - LOG_INFO "安装texlive-changelog包" - dnf install -y texlive-changelog > /dev/null 2>&1 - CHECK_RESULT $? 0 0 "安装texlive-changelog包失败" - fi - - # 验证版本信息 - LOG_INFO "验证版本信息" - version_output=$(texlive-changelog --version) - CHECK_RESULT $? 0 255 "获取版本信息失败" - - # 检查版本信息是否符合预期 - LOG_INFO "检查版本信息是否符合预期" - if [[ "$version_output" == *"TeX Live"* ]]; then - LOG_INFO "版本信息验证成功: $version_output" - else - LOG_ERROR "版本信息验证失败: $version_output" - exit 255 - fi - - # 清理环境,恢复到之前的状态 - if [ "$INSTALLED" = false ]; then - LOG_INFO "卸载texlive-changelog包" - dnf remove -y texlive-changelog > /dev/null 2>&1 - CHECK_RESULT $? 0 0 "卸载texlive-changelog包失败" - fi - - LOG_INFO "测试脚本执行完毕,环境已恢复" - -} - -main "$@" \ No newline at end of file diff --git a/testcases/function_test/pkg_test/texlive-split-z/texlive-changelog/test_texlive-changelog_function_view.sh b/testcases/function_test/pkg_test/texlive-split-z/texlive-changelog/test_texlive-changelog_function_view.sh deleted file mode 100644 index 7bcab29058d..00000000000 --- a/testcases/function_test/pkg_test/texlive-split-z/texlive-changelog/test_texlive-changelog_function_view.sh +++ /dev/null @@ -1,83 +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-29 -# @License : Mulan PSL v2 -# @Desc : Verify view changelog content -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - # 定义颜色输出函数(如果未定义) - if ! type LOG_INFO &>/dev/null; then - LOG_INFO() { echo "[INFO] $*"; } - fi - if ! type LOG_ERROR &>/dev/null; then - LOG_ERROR() { echo "[ERROR] $*" >&2; } - fi - - # 定义软件包名称 - PACKAGE_NAME="texlive-changelog" - - # 步骤1:检查yum源中是否存在指定的软件包 - LOG_INFO "步骤1:检查yum源中是否存在指定的软件包" - if ! dnf list available "$PACKAGE_NAME" &>/dev/null; then - LOG_ERROR "软件包 $PACKAGE_NAME 在yum源中不存在" - exit 255 - fi - - # 步骤2:检查是否已经安装了指定的软件包 - LOG_INFO "步骤2:检查是否已经安装了指定的软件包" - if rpm -q "$PACKAGE_NAME" &>/dev/null; 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 "安装软件包失败" - fi - - # 步骤4:验证view changelog content功能 - LOG_INFO "步骤4:验证view changelog content功能" - # 假设texlive-changelog提供了查看changelog的命令,这里使用示例命令 - # 实际命令可能需要根据软件包的具体实现进行调整 - if command -v texlive-changelog &>/dev/null; then - texlive-changelog --help - CHECK_RESULT $? 0 0 "texlive-changelog命令执行失败" - else - LOG_ERROR "texlive-changelog命令不存在" - exit 255 - fi - - # 步骤5:清理环境,恢复到之前的状态 - LOG_INFO "步骤5:清理环境,恢复到之前的状态" - if [ "$INSTALLED_BEFORE" = false ]; then - LOG_INFO "卸载软件包 $PACKAGE_NAME" - dnf remove -y "$PACKAGE_NAME" - CHECK_RESULT $? 0 0 "卸载软件包失败" - else - LOG_INFO "保持软件包 $PACKAGE_NAME 的安装状态" - fi - - LOG_INFO "测试脚本执行完毕" -} - -main "$@" \ No newline at end of file