From 70b972d4064634a4a139dc5a29122ded12541d2b Mon Sep 17 00:00:00 2001 From: honghua Date: Tue, 21 Apr 2026 13:06:30 +0800 Subject: [PATCH 01/18] update testcase for testsuite kunpengsecl-qcaserver --- .../kunpengsecl/kunpengsecl-qcaserver.json | 14 --- ...t_kunpengsecl-qcaserver_function_config.sh | 64 ------------ .../test_kunpengsecl-qcaserver_qcaserver.sh | 99 ------------------- 3 files changed, 177 deletions(-) delete mode 100644 suite2cases/function_test/pkg_test/kunpengsecl/kunpengsecl-qcaserver.json delete mode 100644 testcases/function_test/pkg_test/kunpengsecl/kunpengsecl-qcaserver/test_kunpengsecl-qcaserver_function_config.sh delete mode 100644 testcases/function_test/pkg_test/kunpengsecl/kunpengsecl-qcaserver/test_kunpengsecl-qcaserver_qcaserver.sh diff --git a/suite2cases/function_test/pkg_test/kunpengsecl/kunpengsecl-qcaserver.json b/suite2cases/function_test/pkg_test/kunpengsecl/kunpengsecl-qcaserver.json deleted file mode 100644 index 9a7a74ba2f6..00000000000 --- a/suite2cases/function_test/pkg_test/kunpengsecl/kunpengsecl-qcaserver.json +++ /dev/null @@ -1,14 +0,0 @@ -{ - "path": "$OET_PATH/testcases/function_test/pkg_test/kunpengsecl/kunpengsecl-qcaserver", - "machine num": 1, - "cases": [ - { - "name": "test_kunpengsecl-qcaserver_qcaserver", - "desc": "测试 qcaserver 命令的基本功能" - }, - { - "name": "test_kunpengsecl-qcaserver_function_config", - "desc": "测试配置文件的加载和解析功能" - } - ] -} \ No newline at end of file diff --git a/testcases/function_test/pkg_test/kunpengsecl/kunpengsecl-qcaserver/test_kunpengsecl-qcaserver_function_config.sh b/testcases/function_test/pkg_test/kunpengsecl/kunpengsecl-qcaserver/test_kunpengsecl-qcaserver_function_config.sh deleted file mode 100644 index 799543db15d..00000000000 --- a/testcases/function_test/pkg_test/kunpengsecl/kunpengsecl-qcaserver/test_kunpengsecl-qcaserver_function_config.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-12-05 -# @License : Mulan PSL v2 -# @Desc : 测试配置文件的加载和解析功能 -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - LOG_INFO "开始测试配置文件的加载和解析功能" - - # 检查软件包是否已安装 - LOG_INFO "检查 kunpengsecl-qcaserver 是否已安装" - if rpm -q kunpengsecl-qcaserver &>/dev/null; then - LOG_INFO "kunpengsecl-qcaserver 已安装,跳过安装步骤" - INSTALLED=true - else - LOG_INFO "kunpengsecl-qcaserver 未安装,准备安装" - INSTALLED=false - fi - - # 检查 yum 源中是否有该软件包 - LOG_INFO "检查 yum 源中是否有 kunpengsecl-qcaserver" - if ! dnf list available kunpengsecl-qcaserver &>/dev/null; then - LOG_ERROR "yum 源中未找到 kunpengsecl-qcaserver,退出测试" - exit 255 - fi - - # 如果未安装,则安装软件包 - if [ "$INSTALLED" = false ]; then - LOG_INFO "安装 kunpengsecl-qcaserver" - dnf install -y kunpengsecl-qcaserver - CHECK_RESULT $? 0 0 "安装 kunpengsecl-qcaserver 失败" - fi - - # 测试配置文件的加载和解析功能 - LOG_INFO "测试配置文件的加载和解析功能" - qcaserver --config /etc/kunpengsecl/qcaserver.conf - CHECK_RESULT $? 0 0 "配置文件加载或解析失败" - - # 清理环境 - if [ "$INSTALLED" = false ]; then - LOG_INFO "卸载 kunpengsecl-qcaserver" - dnf remove -y kunpengsecl-qcaserver - CHECK_RESULT $? 0 0 "卸载 kunpengsecl-qcaserver 失败" - fi - - LOG_INFO "测试配置文件的加载和解析功能完成" -} - -main "$@" \ No newline at end of file diff --git a/testcases/function_test/pkg_test/kunpengsecl/kunpengsecl-qcaserver/test_kunpengsecl-qcaserver_qcaserver.sh b/testcases/function_test/pkg_test/kunpengsecl/kunpengsecl-qcaserver/test_kunpengsecl-qcaserver_qcaserver.sh deleted file mode 100644 index e663e69fbfe..00000000000 --- a/testcases/function_test/pkg_test/kunpengsecl/kunpengsecl-qcaserver/test_kunpengsecl-qcaserver_qcaserver.sh +++ /dev/null @@ -1,99 +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-12-05 -# @License : Mulan PSL v2 -# @Desc : 测试 qcaserver 命令的基本功能 -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - # 测试 qcaserver 命令的基本功能 - - LOG_INFO "开始测试 qcaserver 命令的基本功能" - - # 检查是否已安装 qcaserver - if dnf list installed qcaserver &>/dev/null; then - LOG_INFO "qcaserver 已安装,跳过安装步骤" - installed=true - else - LOG_INFO "qcaserver 未安装,将进行安装测试" - installed=false - fi - - # 检查 yum 源中是否有 qcaserver 软件包 - LOG_INFO "检查 yum 源中是否存在 qcaserver 软件包" - if ! dnf list available qcaserver &>/dev/null; then - LOG_ERROR "yum 源中未找到 qcaserver 软件包" - exit 255 - fi - - # 如果未安装,则安装 qcaserver - if [ "$installed" = false ]; then - LOG_INFO "正在安装 qcaserver" - dnf install -y qcaserver - CHECK_RESULT $? 0 0 "安装 qcaserver 失败" - fi - - # 测试 qcaserver --help 命令 - LOG_INFO "测试 qcaserver --help 命令" - qcaserver --help &>/dev/null - CHECK_RESULT $? 0 0 "qcaserver --help 命令执行失败" - - # 测试 qcaserver start(假设支持) - LOG_INFO "测试 qcaserver start 命令" - qcaserver start &>/dev/null - CHECK_RESULT $? 0 0 "qcaserver start 命令执行失败" - - # 测试 qca-server stop(假设支持) - LOG_INFO "测试 qca-server stop命令" - qca-server stop &>/dev/null - CHECK_RESULT $? 0 0 "qca-server stop命令执行失败" - - # 清理环境:如果脚本安装了软件包,则卸载它 - if [ "$installed" = false ]; then - LOG_INFO "正在卸载 qca-server" - dnf remove -y qca-server - CHECK_RESULT $? \ - \ - \ - \ - \ - - # If the uninstallation fails, log an error but do not exit with a failure code - # since we want to continue with other cleanup steps if any exist. - # However, in this case, there are no further cleanup steps after uninstallation. - - # Note: The above comment is for explanation only and should not be included in the final script. - - CHECK_RESULT $? \ - \ - \ - - # If the uninstallation fails, log an error but do not exit with a failure code since we want to continue with other cleanup steps if any exist. However, in this case, there are no further cleanup steps after uninstallation. Note: The above comment is for explanation only and should not be included in the final script. - - CHECK_RESULT $? \ - \ - - # If the uninstallation fails, log an error but do not exit with a failure code since we want to continue with other cleanup steps if any exist. However, in this case, there are no further cleanup steps after uninstallation. Note: The above comment is for explanation only and should not be included in the final script. - - CHECK_RESULT $? \ - - # If the uninstallation fails, log an error but do not exit with a failure code since we want to continue with other cleanup steps if any exist. However, in this case, there are no further cleanup steps after uninstallation. Note: The above comment is for explanation only and should not be included in the final script. - - fi -} - -main "$@" \ No newline at end of file From df23db3659e152dee6fc07bee5df51351ba7678b Mon Sep 17 00:00:00 2001 From: honghua Date: Tue, 21 Apr 2026 13:09:55 +0800 Subject: [PATCH 02/18] update testcase for testsuite target-restore --- .../python-rtslib/target-restore.json | 16 ---- .../test_target-restore_targetctl_restore.sh | 61 -------------- ..._targetctl_restore_file_to_restore_from.sh | 83 ------------------- .../test_target-restore_targetctl_save.sh | 62 -------------- ...-restore_targetctl_save_file_to_save_to.sh | 71 ---------------- 5 files changed, 293 deletions(-) delete mode 100644 testcases/function_test/pkg_test/python-rtslib/target-restore/test_target-restore_targetctl_restore.sh delete mode 100644 testcases/function_test/pkg_test/python-rtslib/target-restore/test_target-restore_targetctl_restore_file_to_restore_from.sh delete mode 100644 testcases/function_test/pkg_test/python-rtslib/target-restore/test_target-restore_targetctl_save.sh delete mode 100644 testcases/function_test/pkg_test/python-rtslib/target-restore/test_target-restore_targetctl_save_file_to_save_to.sh diff --git a/suite2cases/function_test/pkg_test/python-rtslib/target-restore.json b/suite2cases/function_test/pkg_test/python-rtslib/target-restore.json index 5e019ef7dc0..cf8b61231bd 100644 --- a/suite2cases/function_test/pkg_test/python-rtslib/target-restore.json +++ b/suite2cases/function_test/pkg_test/python-rtslib/target-restore.json @@ -2,22 +2,6 @@ "path": "$OET_PATH/testcases/function_test/pkg_test/python-rtslib/target-restore", "machine num": 1, "cases": [ - { - "name": "test_target-restore_targetctl_save", - "desc": "测试 targetctl save 命令,使用默认文件保存配置" - }, - { - "name": "test_target-restore_targetctl_save_file_to_save_to", - "desc": "测试 targetctl save 命令,指定文件保存配置" - }, - { - "name": "test_target-restore_targetctl_restore", - "desc": "测试 targetctl restore 命令,使用默认文件恢复配置" - }, - { - "name": "test_target-restore_targetctl_restore_file_to_restore_from", - "desc": "测试 targetctl restore 命令,指定文件恢复配置" - }, { "name": "test_target-restore_targetctl_clear", "desc": "测试 targetctl clear 命令,清除配置" diff --git a/testcases/function_test/pkg_test/python-rtslib/target-restore/test_target-restore_targetctl_restore.sh b/testcases/function_test/pkg_test/python-rtslib/target-restore/test_target-restore_targetctl_restore.sh deleted file mode 100644 index 569b426d1f8..00000000000 --- a/testcases/function_test/pkg_test/python-rtslib/target-restore/test_target-restore_targetctl_restore.sh +++ /dev/null @@ -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-11-27 -# @License : Mulan PSL v2 -# @Desc : 测试 targetctl restore 命令,使用默认文件恢复配置 -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - - # 检查软件包是否已安装 - if ! rpm -q targetcli &> /dev/null; then - LOG_INFO "环境未安装 targetcli 软件包,开始安装..." - # 检查 yum 源中是否有 targetcli 软件包 - if ! dnf list available targetcli &> /dev/null; then - LOG_ERROR "yum 源中未找到 targetcli 软件包" - exit 255 - fi - # 安装 targetcli - dnf install -y targetcli - CHECK_RESULT $? 0 0 "安装 targetcli 失败" - INSTALLED=true - else - LOG_INFO "环境已安装 targetcli 软件包" - INSTALLED=false - fi - - # 测试 targetctl restore 命令 - LOG_INFO "测试 targetctl restore 命令,使用默认文件恢复配置" - targetctl restore --help &> /dev/null - CHECK_RESULT $? 0 0 "targetctl restore 命令不支持或参数错误" - - # 执行恢复操作 - LOG_INFO "执行 targetctl restore" - targetctl restore - CHECK_RESULT $? 0 0 "targetctl restore 执行失败" - - # 清理环境 - if [ "$INSTALLED" = true ]; then - LOG_INFO "卸载临时安装的 targetcli 软件包" - dnf remove -y targetcli &> /dev/null - CHECK_RESULT $? 0 0 "卸载 targetcli 失败" - - LOG_INFO "测试完成,环境已恢复" - -} - -main "$@" \ No newline at end of file diff --git a/testcases/function_test/pkg_test/python-rtslib/target-restore/test_target-restore_targetctl_restore_file_to_restore_from.sh b/testcases/function_test/pkg_test/python-rtslib/target-restore/test_target-restore_targetctl_restore_file_to_restore_from.sh deleted file mode 100644 index 5f0b0ac4095..00000000000 --- a/testcases/function_test/pkg_test/python-rtslib/target-restore/test_target-restore_targetctl_restore_file_to_restore_from.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 : 2025-11-27 -# @License : Mulan PSL v2 -# @Desc : 测试 targetctl restore 命令,指定文件恢复配置 -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - LOG_INFO "开始测试 targetctl restore 命令,指定文件恢复配置" - - # 检查是否已安装目标软件包 - LOG_INFO "检查是否已安装目标软件包" - if ! dnf list installed target-restore-targetctl &>/dev/null; then - LOG_INFO "目标软件包未安装,将进行安装" - # 检查yum源中是否有该软件包 - if ! dnf list available target-restore-targetctl &>/dev/null; then - LOG_ERROR "yum源中未找到目标软件包" - exit 255 - fi - # 安装软件包 - dnf install -y target-restore-targetctl - CHECK_RESULT $? 0 0 "安装目标软件包失败" - # 标记为需要卸载 - NEED_UNINSTALL=1 - else - LOG_INFO "目标软件包已安装" - fi - - # 检查targetctl命令是否存在 - LOG_INFO "检查targetctl命令是否存在" - if ! command -v targetctl &>/dev/null; then - LOG_ERROR "targetctl命令不存在" - exit 255 - fi - - # 检查restore子命令是否支持 - LOG_INFO "检查restore子命令是否支持" - if ! targetctl --help | grep -q restore; then - LOG_ERROR "targetctl不支持restore子命令" - exit 255 - fi - - # 指定恢复文件 - RESTORE_FILE="/tmp/restore_config.txt" - LOG_INFO "指定恢复文件: $RESTORE_FILE" - - # 检查恢复文件是否存在 - LOG_INFO "检查恢复文件是否存在" - if [ ! -f "$RESTORE_FILE" ]; then - LOG_ERROR "恢复文件不存在: $RESTORE_FILE" - exit 255 - fi - - # 执行targetctl restore命令 - LOG_INFO "执行targetctl restore命令" - targetctl restore --file "$RESTORE_FILE" - CHECK_RESULT $? 0 0 "targetctl restore命令执行失败" - - # 清理环境(如果之前未安装) - if [ "$NEED_UNINSTALL" -eq 1 ]; then - LOG_INFO "卸载目标软件包" - dnf remove -y target-restore-targetctl - CHECK_RESULT $? 0 0 "卸载目标软件包失败" - fi - - LOG_INFO "测试完成,环境已恢复" -} - -main "$@" \ No newline at end of file diff --git a/testcases/function_test/pkg_test/python-rtslib/target-restore/test_target-restore_targetctl_save.sh b/testcases/function_test/pkg_test/python-rtslib/target-restore/test_target-restore_targetctl_save.sh deleted file mode 100644 index d23fc2ef45b..00000000000 --- a/testcases/function_test/pkg_test/python-rtslib/target-restore/test_target-restore_targetctl_save.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 : 2025-11-27 -# @License : Mulan PSL v2 -# @Desc : 测试 targetctl save 命令,使用默认文件保存配置 -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - LOG_INFO "开始测试 targetctl save 命令,使用默认文件保存配置" - - # 检查是否已安装 targetctl - if ! command -v targetctl &> /dev/null; then - LOG_INFO "检测到 targetctl 未安装,开始安装" - if ! dnf list available targetctl &> /dev/null; then - LOG_ERROR "yum 源中未找到 targetctl 软件包" - exit 255 - fi - dnf install -y targetctl - CHECK_RESULT $? 0 0 "安装 targetctl 失败" - INSTALLED=1 - else - LOG_INFO "检测到 targetctl 已安装" - INSTALLED=0 - fi - - # 测试 targetctl save 命令 - LOG_INFO "测试 targetctl save 命令,使用默认文件保存配置" - targetctl save - CHECK_RESULT $? 0 0 "targetctl save 命令执行失败" - - # 检查默认配置文件是否存在 - LOG_INFO "检查默认配置文件是否存在" - if [ ! -f /etc/target/save.json ]; then - LOG_ERROR "默认配置文件 /etc/target/save.json 不存在" - exit 1 - fi - - # 清理环境:如果脚本开始时安装了 targetctl,则卸载它 - if [ "$INSTALLED" -eq 1 ]; then - LOG_INFO "清理环境:卸载 targetctl" - dnf remove -y targetctl - CHECK_RESULT $? 0 0 "卸载 targetctl 失败" - fi - - LOG_INFO "测试完成,环境已恢复" -} - -main "$@" \ No newline at end of file diff --git a/testcases/function_test/pkg_test/python-rtslib/target-restore/test_target-restore_targetctl_save_file_to_save_to.sh b/testcases/function_test/pkg_test/python-rtslib/target-restore/test_target-restore_targetctl_save_file_to_save_to.sh deleted file mode 100644 index 63476de0e7f..00000000000 --- a/testcases/function_test/pkg_test/python-rtslib/target-restore/test_target-restore_targetctl_save_file_to_save_to.sh +++ /dev/null @@ -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-27 -# @License : Mulan PSL v2 -# @Desc : 测试 targetctl save 命令,指定文件保存配置 -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - LOG_INFO "开始测试 targetctl save 命令,指定文件保存配置" - - # 检查是否已安装目标软件包 - LOG_INFO "检查是否已安装目标软件包" - if ! dnf list installed target-restore &>/dev/null; then - LOG_INFO "目标软件包未安装,将进行安装" - # 检查yum源中是否有该软件包 - if ! dnf list available target-restore &>/dev/null; then - LOG_ERROR "yum源中未找到目标软件包" - exit 255 - fi - # 安装软件包 - dnf install -y target-restore - CHECK_RESULT $? 0 0 "安装目标软件包失败" - # 标记需要卸载 - UNINSTALL_NEEDED=1 - else - LOG_INFO "目标软件包已安装" - UNINSTALL_NEEDED=0 - fi - - # 测试 targetctl save 命令,指定文件保存配置 - LOG_INFO "测试 targetctl save 命令,指定文件保存配置" - SAVE_FILE="/tmp/targetctl_save_test.conf" - targetctl save --file $SAVE_FILE - CHECK_RESULT $? 0 0 "targetctl save 命令执行失败" - - # 检查文件是否存在 - LOG_INFO "检查保存的配置文件是否存在" - if [ ! -f "$SAVE_FILE" ]; then - LOG_ERROR "配置文件未生成" - exit 1 - fi - - # 清理临时文件 - LOG_INFO "清理临时文件" - rm -f "$SAVE_FILE" - - # 根据标记决定是否卸载软件包 - if [ "$UNINSTALL_NEEDED" -eq 1 ]; then - LOG_INFO "卸载目标软件包" - dnf remove -y target-restore - CHECK_RESULT $? 0 0 "卸载目标软件包失败" - fi - - LOG_INFO "测试完成,环境已恢复" -} - -main "$@" \ No newline at end of file From 80499df49a10b6823cc8d94d3061db430fef36df Mon Sep 17 00:00:00 2001 From: honghua Date: Tue, 21 Apr 2026 13:10:04 +0800 Subject: [PATCH 03/18] update testcase for testsuite texlive-ps2pk --- .../pkg_test/texlive-base/texlive-ps2pk.json | 38 -------- ...test_texlive-ps2pk_function_mag_default.sh | 64 -------------- ..._texlive-ps2pk_function_pfb2pfa_default.sh | 59 ------------- ...st_texlive-ps2pk_function_pk2bm_default.sh | 88 ------------------- ...st_texlive-ps2pk_function_ps2pk_default.sh | 69 --------------- .../test_texlive-ps2pk_mag__upper_v.sh | 68 -------------- .../test_texlive-ps2pk_pfb2pfa__v.sh | 61 ------------- .../test_texlive-ps2pk_pk2bm__upper_v.sh | 64 -------------- .../test_texlive-ps2pk_ps2pk__v.sh | 71 --------------- 9 files changed, 582 deletions(-) delete mode 100644 suite2cases/function_test/pkg_test/texlive-base/texlive-ps2pk.json delete mode 100644 testcases/function_test/pkg_test/texlive-base/texlive-ps2pk/test_texlive-ps2pk_function_mag_default.sh delete mode 100644 testcases/function_test/pkg_test/texlive-base/texlive-ps2pk/test_texlive-ps2pk_function_pfb2pfa_default.sh delete mode 100644 testcases/function_test/pkg_test/texlive-base/texlive-ps2pk/test_texlive-ps2pk_function_pk2bm_default.sh delete mode 100644 testcases/function_test/pkg_test/texlive-base/texlive-ps2pk/test_texlive-ps2pk_function_ps2pk_default.sh delete mode 100644 testcases/function_test/pkg_test/texlive-base/texlive-ps2pk/test_texlive-ps2pk_mag__upper_v.sh delete mode 100644 testcases/function_test/pkg_test/texlive-base/texlive-ps2pk/test_texlive-ps2pk_pfb2pfa__v.sh delete mode 100644 testcases/function_test/pkg_test/texlive-base/texlive-ps2pk/test_texlive-ps2pk_pk2bm__upper_v.sh delete mode 100644 testcases/function_test/pkg_test/texlive-base/texlive-ps2pk/test_texlive-ps2pk_ps2pk__v.sh diff --git a/suite2cases/function_test/pkg_test/texlive-base/texlive-ps2pk.json b/suite2cases/function_test/pkg_test/texlive-base/texlive-ps2pk.json deleted file mode 100644 index 69548f6d146..00000000000 --- a/suite2cases/function_test/pkg_test/texlive-base/texlive-ps2pk.json +++ /dev/null @@ -1,38 +0,0 @@ -{ - "path": "$OET_PATH/testcases/function_test/pkg_test/texlive-base/texlive-ps2pk", - "machine num": 1, - "cases": [ - { - "name": "test_texlive-ps2pk_mag__upper_v", - "desc": "测试 mag 命令的 V 参数" - }, - { - "name": "test_texlive-ps2pk_pfb2pfa__v", - "desc": "测试 pfb2pfa 命令的 -v 参数" - }, - { - "name": "test_texlive-ps2pk_pk2bm__upper_v", - "desc": "测试 pk2bm 命令的 -V 参数" - }, - { - "name": "test_texlive-ps2pk_ps2pk__v", - "desc": "测试 ps2pk 命令的 -v 参数" - }, - { - "name": "test_texlive-ps2pk_function_mag_default", - "desc": "测试 mag 命令的默认参数" - }, - { - "name": "test_texlive-ps2pk_function_pfb2pfa_default", - "desc": "测试 pfb2pfa 命令的默认参数" - }, - { - "name": "test_texlive-ps2pk_function_pk2bm_default", - "desc": "测试 pk2bm 命令的默认参数" - }, - { - "name": "test_texlive-ps2pk_function_ps2pk_default", - "desc": "测试 ps2pk 命令的默认参数" - } - ] -} \ No newline at end of file diff --git a/testcases/function_test/pkg_test/texlive-base/texlive-ps2pk/test_texlive-ps2pk_function_mag_default.sh b/testcases/function_test/pkg_test/texlive-base/texlive-ps2pk/test_texlive-ps2pk_function_mag_default.sh deleted file mode 100644 index fa36d930b80..00000000000 --- a/testcases/function_test/pkg_test/texlive-base/texlive-ps2pk/test_texlive-ps2pk_function_mag_default.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-11-27 -# @License : Mulan PSL v2 -# @Desc : 测试 mag 命令的默认参数 -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - LOG_INFO "开始测试 texlive-ps2pk 功能中的 mag 命令默认参数" - - # 检查是否已安装 texlive-ps2pk 软件包 - LOG_INFO "检查 texlive-ps2pk 是否已安装" - if dnf list installed texlive-ps2pk &>/dev/null; then - LOG_INFO "texlive-ps2pk 已安装,测试完成后将保持安装状态" - installed=true - else - LOG_INFO "texlive-ps2pk 未安装,将在测试完成后卸载" - installed=false - fi - - # 检查 yum 源中是否有 texlive-ps2pk 软件包 - LOG_INFO "检查 yum 源中是否有 texlive-ps2pk 软件包" - if ! dnf list available texlive-ps2pk &>/dev/null; then - LOG_ERROR "yum 源中未找到 texlive-ps2pk 软件包" - exit 255 - fi - - # 如果未安装,则安装 texlive-ps2pk - if [ "$installed" = false ]; then - LOG_INFO "安装 texlive-ps2pk 软件包" - dnf install -y texlive-ps2pk - CHECK_RESULT $? 0 0 "安装 texlive-ps2pk 失败" - fi - - # 测试 mag 命令的默认参数 - LOG_INFO "测试 mag 命令的默认参数" - mag --help &>/dev/null - CHECK_RESULT $? 0 0 "mag 命令不支持或参数错误" - - # 如果最初未安装,则在测试完成后卸载 - if [ "$installed" = false ]; then - LOG_INFO "卸载 texlive-ps2pk 软件包" - dnf remove -y texlive-ps2pk - CHECK_RESULT $? 0 0 "卸载 texlive-ps2pk 失败" - fi - - LOG_INFO "测试完成,环境已恢复" -} - -main "$@" \ No newline at end of file diff --git a/testcases/function_test/pkg_test/texlive-base/texlive-ps2pk/test_texlive-ps2pk_function_pfb2pfa_default.sh b/testcases/function_test/pkg_test/texlive-base/texlive-ps2pk/test_texlive-ps2pk_function_pfb2pfa_default.sh deleted file mode 100644 index 827a78021ce..00000000000 --- a/testcases/function_test/pkg_test/texlive-base/texlive-ps2pk/test_texlive-ps2pk_function_pfb2pfa_default.sh +++ /dev/null @@ -1,59 +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-27 -# @License : Mulan PSL v2 -# @Desc : 测试 pfb2pfa 命令的默认参数 -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - LOG_INFO "开始测试 pfb2pfa 命令的默认参数" - - LOG_INFO "检查是否已安装 texlive-ps2pk 软件包" - if ! dnf list installed texlive-ps2pk &>/dev/null; then - LOG_INFO "texlive-ps2pk 未安装,将进行安装" - if ! dnf list available texlive-ps2pk &>/dev/null; then - LOG_ERROR "yum源中未找到 texlive-ps2pk 软件包" - exit 255 - fi - dnf install -y texlive-ps2pk - CHECK_RESULT $? 0 0 "安装 texlive-ps2pk 失败" - INSTALLED=true - else - LOG_INFO "texlive-ps2pk 已安装" - INSTALLED=false - fi - - LOG_INFO "检查 pfb2pfa 命令是否存在" - if ! command -v pfb2pfa &>/dev/null; then - LOG_ERROR "pfb2pfa 命令不存在或不支持" - exit 255 - fi - - LOG_INFO "测试 pfb2pfa 命令的默认参数" - pfb2pfa --help &>/dev/null - CHECK_RESULT $? 0 0 "pfb2pfa 命令默认参数测试失败" - - if [ "$INSTALLED" = true ]; then - LOG_INFO "卸载 texlive-ps2pk 软件包" - dnf remove -y texlive-ps2pk - CHECK_RESULT $? 0 0 "卸载 texlive-ps2pk 失败" - fi - - LOG_INFO "测试完成,环境已恢复" -} - -main "$@" \ No newline at end of file diff --git a/testcases/function_test/pkg_test/texlive-base/texlive-ps2pk/test_texlive-ps2pk_function_pk2bm_default.sh b/testcases/function_test/pkg_test/texlive-base/texlive-ps2pk/test_texlive-ps2pk_function_pk2bm_default.sh deleted file mode 100644 index 53b44c66b4e..00000000000 --- a/testcases/function_test/pkg_test/texlive-base/texlive-ps2pk/test_texlive-ps2pk_function_pk2bm_default.sh +++ /dev/null @@ -1,88 +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-27 -# @License : Mulan PSL v2 -# @Desc : 测试 pk2bm 命令的默认参数 -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - # 测试脚本:test_texlive-ps2pk_function_pk2bm_default - - LOG_INFO "开始测试 pk2bm 命令的默认参数" - - # 检查是否已安装 texlive-ps2pk - LOG_INFO "检查 texlive-ps2pk 是否已安装" - dnf list installed texlive-ps2pk > /dev/null 2>&1 - if [ $? -eq 0 ]; then - LOG_INFO "texlive-ps2pk 已安装,测试结束后将保持安装状态" - INSTALLED=true - else - LOG_INFO "texlive-ps2pk 未安装,将在测试结束后卸载" - INSTALLED=false - fi - - # 检查 yum 源中是否有 texlive-ps2pk - LOG_INFO "检查 yum 源中是否有 texlive-ps2pk" - dnf list available texlive-ps2pk > /dev/null 2>&1 - if [ $? -ne 0 ]; then - LOG_ERROR "yum 源中未找到 texlive-ps2pk,退出测试" - exit 255 - fi - - # 如果未安装,则安装 texlive-ps2pk - if [ "$INSTALLED" = false ]; then - LOG_INFO "安装 texlive-ps2pk" - dnf install -y texlive-ps2pk - CHECK_RESULT $? 0 0 "安装 texlive-ps2pk 失败" - fi - - # 检查 pk2bm 命令是否存在 - LOG_INFO "检查 pk2bm 命令是否存在" - command -v pk2bm > /dev/null 2>&1 - if [ $? -ne 0 ]; then - LOG_ERROR "pk2bm 命令不存在,退出测试" - if [ "$INSTALLED" = false ]; then - dnf remove -y texlive-ps2pk - CHECK_RESULT $? 0 0 "卸载 texlive-ps2pk 失败" - fi - exit - fi - - # 执行 pk2bm 默认参数测试 - LOG_INFO 执行 pk 默认参数测试 - TEST_FILE="test.pk" - echo dummy content > ${TEST_FILE} - CHECK_RESULT ? 00 创建测试文件失败 - - LOG_INFO 执行 pk bm 默认参数 - pkb m ${TEST_FILE} >/dev/null 2>&1 - CHECK_RESULT $ ? 00 pk bm default parameter failed - - rm-f ${TEST_FILE} - CHECK_RESULT$ ? 00 删除测试文件失败 - - # Clean up environment if needed - if [ "$INSTALLED" = false ];then - LOG_INF O Uninstalling text live- ps P k - dn f remove-y tex live-p s P k - CHECK _RESULT$?00Uninstall text live-p s P k failed - fi - - LOG_INF O Test completed successfully -} - -main "$@" \ No newline at end of file diff --git a/testcases/function_test/pkg_test/texlive-base/texlive-ps2pk/test_texlive-ps2pk_function_ps2pk_default.sh b/testcases/function_test/pkg_test/texlive-base/texlive-ps2pk/test_texlive-ps2pk_function_ps2pk_default.sh deleted file mode 100644 index 48713f0fb3d..00000000000 --- a/testcases/function_test/pkg_test/texlive-base/texlive-ps2pk/test_texlive-ps2pk_function_ps2pk_default.sh +++ /dev/null @@ -1,69 +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-27 -# @License : Mulan PSL v2 -# @Desc : 测试 ps2pk 命令的默认参数 -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - LOG_INFO "开始测试 ps2pk 命令的默认参数" - - # 检查是否已安装 texlive-ps2pk 软件包 - LOG_INFO "检查 texlive-ps2pk 是否已安装" - if dnf list installed texlive-ps2pk &>/dev/null; then - LOG_INFO "texlive-ps2pk 已安装,脚本结束时将保持安装状态" - INSTALLED=true - else - LOG_INFO "texlive-ps2pk 未安装,将在测试后卸载" - INSTALLED=false - fi - - # 检查 yum 源中是否有 texlive-ps2pk 软件包 - LOG_INFO "检查 yum 源中是否有 texlive-ps2pk" - if ! dnf list available texlive-ps2pk &>/dev/null; then - LOG_ERROR "yum 源中未找到 texlive-ps2pk 软件包" - exit 255 - fi - - # 如果未安装,则安装 texlive-ps2pk - if [ "$INSTALLED" = false ]; then - LOG_INFO "正在安装 texlive-ps2pk" - dnf install -y texlive-ps2pk - CHECK_RESULT $? 0 0 "安装 texlive-ps2pk 失败" - fi - - # 测试 ps2pk 命令的默认参数 - LOG_INFO "测试 ps2pk 命令的默认参数" - if ! command -v ps2pk &>/dev/null; then - LOG_ERROR "ps2pk 命令不存在或不支持" - exit 255 - fi - - ps2pk --help &>/dev/null - CHECK_RESULT $? 0 0 "ps2pk --help 执行失败" - - # 清理环境:如果之前未安装,则卸载 texlive-ps2pk - if [ "$INSTALLED" = false ]; then - LOG_INFO "正在卸载 texlive-ps2pk" - dnf remove -y texlive-ps2pk - CHECK_RESULT $? 0 0 "卸载 texlive-ps2pk 失败" - fi - - LOG_INFO "测试 ps2pk -} - -main "$@" \ No newline at end of file diff --git a/testcases/function_test/pkg_test/texlive-base/texlive-ps2pk/test_texlive-ps2pk_mag__upper_v.sh b/testcases/function_test/pkg_test/texlive-base/texlive-ps2pk/test_texlive-ps2pk_mag__upper_v.sh deleted file mode 100644 index 0b37ce6544b..00000000000 --- a/testcases/function_test/pkg_test/texlive-base/texlive-ps2pk/test_texlive-ps2pk_mag__upper_v.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-11-27 -# @License : Mulan PSL v2 -# @Desc : 测试 mag 命令的 V 参数 -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - - # 测试 mag 命令的 V 参数 - - # 检查软件包是否已安装 - LOG_INFO "检查 texlive-ps2pk 软件包是否已安装" - rpm -q texlive-ps2pk > /dev/null 2>&1 - if [ $? -eq 0 ]; then - LOG_INFO "texlive-ps2pk 已安装,脚本结束后将保持安装状态" - INSTALLED=1 - else - LOG_INFO "texlive-ps2pk 未安装,脚本结束后将卸载" - INSTALLED=0 - fi - - # 检查 yum 源中是否有 texlive-ps2pk 软件包 - LOG_INFO "检查 yum 源中是否有 texlive-ps2pk 软件包" - dnf list available texlive-ps2pk > /dev/null 2>&1 - if [ $? -ne 0 ]; then - LOG_ERROR "yum 源中未找到 texlive-ps2pk 软件包" - exit 255 - fi - - # 如果未安装,则安装软件包 - if [ $INSTALLED -eq 0 ]; then - LOG_INFO "安装 texlive-ps2pk" - dnf install -y texlive-ps2pk > /dev/null 2>&1 - CHECK_RESULT $? 0 0 "安装 texlive-ps2pk 失败" - fi - - # 测试 mag 命令的 V 参数 - LOG_INFO "测试 mag 命令的 V 参数" - mag -V > /dev/null 2>&1 - CHECK_RESULT $? 0 0 "mag 命令的 V 参数不支持或执行失败" - - # 清理环境:如果脚本开始时未安装,则卸载软件包 - if [ $INSTALLED -eq 0 ]; then - LOG_INFO "卸载 texlive-ps2pk" - dnf remove -y texlive-ps2pk > /dev/null 2>&1 - CHECK_RESULT $? 0 0 "卸载 texlive-ps2pk 失败" - fi - - LOG_INFO "测试完成" - -} - -main "$@" \ No newline at end of file diff --git a/testcases/function_test/pkg_test/texlive-base/texlive-ps2pk/test_texlive-ps2pk_pfb2pfa__v.sh b/testcases/function_test/pkg_test/texlive-base/texlive-ps2pk/test_texlive-ps2pk_pfb2pfa__v.sh deleted file mode 100644 index 31a508a4bf3..00000000000 --- a/testcases/function_test/pkg_test/texlive-base/texlive-ps2pk/test_texlive-ps2pk_pfb2pfa__v.sh +++ /dev/null @@ -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-11-27 -# @License : Mulan PSL v2 -# @Desc : 测试 pfb2pfa 命令的 -v 参数 -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - LOG_INFO "开始测试 pfb2pfa 命令的 -v 参数" - - # 检查是否已安装 texlive-ps2pk 和 pfb2pfa 软件包 - LOG_INFO "检查 texlive-ps2pk 和 pfb2pfa 是否已安装" - if ! dnf list installed texlive-ps2pk &>/dev/null || ! dnf list installed pfb2pfa &>/dev/null; then - LOG_INFO "环境未安装,将进行安装" - # 检查 yum 源中是否有软件包 - if ! dnf list available texlive-ps2pk &>/dev/null || ! dnf list available pfb2pfa &>/dev/null; then - LOG_ERROR "yum 源中缺少 texlive-ps2pk 或 pfb2pfa 软件包" - exit 255 - fi - # 安装软件包 - dnf install -y texlive-ps2pk pfb2pfa - CHECK_RESULT $? 0 0 "安装 texlive-ps2pk 和 pfb2pfa 失败" - # 标记需要卸载 - NEED_UNINSTALL=1 - else - LOG_INFO "环境已安装,无需安装" - NEED_UNINSTALL=0 - fi - - # 测试 pfb2pfa 命令的 -v 参数 - LOG_INFO "测试 pfb2pfa -v 参数" - if ! pfb2pfa -v &>/dev/null; then - LOG_ERROR "pfb2pfa -v 参数不支持或命令执行失败" - exit 255 - fi - - # 清理环境(如果需要) - if [ $NEED_UNINSTALL -eq 1 ]; then - LOG_INFO "清理环境,卸载 texlive-ps2pk 和 pfb2pfa" - dnf remove -y texlive-ps2pk pfb2pfa - CHECK_RESULT $? 0 0 "卸载 texlive-ps2pk 和 pfb2pfa失败" - fi - - LOG_INFO "测试完成" -} - -main "$@" \ No newline at end of file diff --git a/testcases/function_test/pkg_test/texlive-base/texlive-ps2pk/test_texlive-ps2pk_pk2bm__upper_v.sh b/testcases/function_test/pkg_test/texlive-base/texlive-ps2pk/test_texlive-ps2pk_pk2bm__upper_v.sh deleted file mode 100644 index ee5c0413e43..00000000000 --- a/testcases/function_test/pkg_test/texlive-base/texlive-ps2pk/test_texlive-ps2pk_pk2bm__upper_v.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-11-27 -# @License : Mulan PSL v2 -# @Desc : 测试 pk2bm 命令的 -V 参数 -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - # 测试脚本:test_texlive-ps2pk_pk2bm__upper_v - - LOG_INFO "开始测试 pk2bm 命令的 -V 参数" - - # 检查是否已安装 texlive-ps2pk 软件包 - LOG_INFO "检查 texlive-ps2pk 是否已安装" - if ! dnf list installed texlive-ps2pk &>/dev/null; then - LOG_INFO "texlive-ps2pk 未安装,将进行安装" - # 检查 yum 源中是否有 texlive-ps2pk - if ! dnf list available texlive-ps2pk &>/dev/null; then - LOG_ERROR "yum 源中未找到 texlive-ps2pk 软件包" - exit 255 - fi - # 安装 texlive-ps2pk - dnf install -y texlive-ps2pk - CHECK_RESULT $? 0 0 "安装 texlive-ps2pk 失败" - # 标记为测试期间安装,需要在结束时卸载 - INSTALLED_DURING_TEST=1 - else - LOG_INFO "texlive-ps2pk 已安装" - INSTALLED_DURING_TEST=0 - fi - - # 测试 pk2bm 命令的 -V 参数 - LOG_INFO "测试 pk2bm -V" - if ! pk2bm -V &>/dev/null; then - LOG_ERROR "pk2bm -V 参数不支持或命令执行失败" - exit 255 - fi - CHECK_RESULT $? 0 0 "pk2bm -V 执行失败" - - # 环境恢复:如果测试期间安装了软件包,则卸载 - if [ "$INSTALLED_DURING_TEST" -eq 1 ]; then - LOG_INFO "卸载 texlive-ps2pk" - dnf remove -y texlive-ps2pk - CHECK_RESULT $? 0 0 "卸载 texlive-ps2pk 失败" - fi - - LOG_INFO "测试完成" -} - -main "$@" \ No newline at end of file diff --git a/testcases/function_test/pkg_test/texlive-base/texlive-ps2pk/test_texlive-ps2pk_ps2pk__v.sh b/testcases/function_test/pkg_test/texlive-base/texlive-ps2pk/test_texlive-ps2pk_ps2pk__v.sh deleted file mode 100644 index 93cea718611..00000000000 --- a/testcases/function_test/pkg_test/texlive-base/texlive-ps2pk/test_texlive-ps2pk_ps2pk__v.sh +++ /dev/null @@ -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-27 -# @License : Mulan PSL v2 -# @Desc : 测试 ps2pk 命令的 -v 参数 -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - LOG_INFO "开始测试 ps2pk 命令的 -v 参数" - - # 检查是否已安装 texlive-ps2pk 软件包 - LOG_INFO "检查 texlive-ps2pk 是否已安装" - if rpm -q texlive-ps2pk &>/dev/null; then - LOG_INFO "texlive-ps2pk 已安装,脚本结束时将保持安装状态" - INSTALLED=true - else - LOG_INFO "texlive-ps2pk 未安装,将在测试结束后卸载" - INSTALLED=false - fi - - # 检查 yum 源中是否有 texlive-ps2pk 软件包 - LOG_INFO "检查 yum 源中是否有 texlive-ps2pk" - if ! dnf list available texlive-ps2pk &>/dev/null; then - LOG_ERROR "yum 源中未找到 texlive-ps2pk 软件包" - exit 255 - fi - - # 如果未安装,则安装软件包 - if [ "$INSTALLED" = false ]; then - LOG_INFO "正在安装 texlive-ps2pk" - dnf install -y texlive-ps2pk - CHECK_RESULT $? 0 0 "安装 texlive-ps2pk 失败" - fi - - # 测试 ps2pk -v 参数 - LOG_INFO "测试 ps2pk -v 参数" - if ! ps2pk -v &>/dev/null; then - LOG_ERROR "ps2pk -v 参数不支持或命令执行失败" - exit 255 - fi - - # 检查命令执行结果是否符合预期 - LOG_INFO "验证 ps2pk -v 输出" - output=$(ps2pk -v) - CHECK_RESULT $? 0 0 "ps2pk -v 命令执行失败" - - # 清理环境:如果之前未安装,则卸载软件包 - if [ "$INSTALLED" = false ]; then - LOG_INFO "正在卸载 texlive-ps2pk" - dnf remove -y texlive-ps2pk - CHECK_RESULT $? 0 0 "卸载 texlive-ps2pk 失败" - fi - - LOG_INFO "测试完成,环境已恢复" -} - -main "$@" \ No newline at end of file From 23b25ff9b1326c98a89be3b9dbf99b7863331585 Mon Sep 17 00:00:00 2001 From: honghua Date: Tue, 21 Apr 2026 13:10:12 +0800 Subject: [PATCH 04/18] update testcase for testsuite google-http-java-client-xml --- .../google-http-java-client-xml.json | 36 ------- ...gle-http-java-client-xml_function_check.sh | 93 ------------------- ...le-http-java-client-xml_function_config.sh | 65 ------------- ...gle-http-java-client-xml_function_error.sh | 76 --------------- ...ogle-http-java-client-xml_function_http.sh | 70 -------------- ...e-http-java-client-xml_function_install.sh | 84 ----------------- ...gle-http-java-client-xml_function_parse.sh | 72 -------------- ...-http-java-client-xml_function_validate.sh | 66 ------------- 8 files changed, 562 deletions(-) delete mode 100644 testcases/function_test/pkg_test/google-http-java-client/google-http-java-client-xml/test_google-http-java-client-xml_function_check.sh delete mode 100644 testcases/function_test/pkg_test/google-http-java-client/google-http-java-client-xml/test_google-http-java-client-xml_function_config.sh delete mode 100644 testcases/function_test/pkg_test/google-http-java-client/google-http-java-client-xml/test_google-http-java-client-xml_function_error.sh delete mode 100644 testcases/function_test/pkg_test/google-http-java-client/google-http-java-client-xml/test_google-http-java-client-xml_function_http.sh delete mode 100644 testcases/function_test/pkg_test/google-http-java-client/google-http-java-client-xml/test_google-http-java-client-xml_function_install.sh delete mode 100644 testcases/function_test/pkg_test/google-http-java-client/google-http-java-client-xml/test_google-http-java-client-xml_function_parse.sh delete mode 100644 testcases/function_test/pkg_test/google-http-java-client/google-http-java-client-xml/test_google-http-java-client-xml_function_validate.sh diff --git a/suite2cases/function_test/pkg_test/google-http-java-client/google-http-java-client-xml.json b/suite2cases/function_test/pkg_test/google-http-java-client/google-http-java-client-xml.json index e72b6a57c5b..a1c5f286bc8 100644 --- a/suite2cases/function_test/pkg_test/google-http-java-client/google-http-java-client-xml.json +++ b/suite2cases/function_test/pkg_test/google-http-java-client/google-http-java-client-xml.json @@ -16,42 +16,6 @@ "name": "test_google-http-java-client-xml_reinstall", "desc": "测试google-http-java-client-xml软件包的重新安装功能", "machine num": 1 - }, - { - "name": "test_google-http-java-client-xml_function_parse", - "desc": "测试google-http-java-client-xml软件包的XML解析功能" - }, - { - "name": "test_google-http-java-client-xml_function_serialize", - "desc": "测试google-http-java-client-xml软件包的XML序列化功能" - }, - { - "name": "test_google-http-java-client-xml_function_validate", - "desc": "测试google-http-java-client-xml软件包的XML验证功能" - }, - { - "name": "test_google-http-java-client-xml_function_install", - "desc": "测试google-http-java-client-xml软件包的安装功能" - }, - { - "name": "test_google-http-java-client-xml_function_uninstall", - "desc": "测试google-http-java-client-xml软件包的卸载功能" - }, - { - "name": "test_google-http-java-client-xml_function_check", - "desc": "测试检查google-http-java-client-xml软件包是否已安装" - }, - { - "name": "test_google-http-java-client-xml_function_http", - "desc": "测试使用该库发送HTTP请求" - }, - { - "name": "test_google-http-java-client-xml_function_config", - "desc": "测试XML请求/响应的配置" - }, - { - "name": "test_google-http-java-client-xml_function_error", - "desc": "测试处理XML解析错误" } ] } \ No newline at end of file diff --git a/testcases/function_test/pkg_test/google-http-java-client/google-http-java-client-xml/test_google-http-java-client-xml_function_check.sh b/testcases/function_test/pkg_test/google-http-java-client/google-http-java-client-xml/test_google-http-java-client-xml_function_check.sh deleted file mode 100644 index aaf90545b50..00000000000 --- a/testcases/function_test/pkg_test/google-http-java-client/google-http-java-client-xml/test_google-http-java-client-xml_function_check.sh +++ /dev/null @@ -1,93 +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-02-21 -# @License : Mulan PSL v2 -# @Desc : 测试检查google-http-java-client-xml软件包是否已安装 -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - # 定义日志函数 - LOG_INFO() { - echo "[INFO] $1" - } - - LOG_ERROR() { - echo "[ERROR] $1" - } - - # 定义常量 - PACKAGE_NAME="google-http-java-client-xml" - - # 步骤1:检查软件包是否已在yum源中 - LOG_INFO "步骤1:检查yum源中是否存在${PACKAGE_NAME}软件包" - dnf list available ${PACKAGE_NAME} > /dev/null 2>&1 - if [ $? -ne 0 ]; then - LOG_ERROR "yum源中未找到${PACKAGE_NAME}软件包" - exit 255 - fi - - # 步骤2:检查软件包是否已安装 - LOG_INFO "步骤2:检查${PACKAGE_NAME}软件包是否已安装" - rpm -q ${PACKAGE_NAME} > /dev/null 2>&1 - 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 "步骤3:安装${PACKAGE_NAME}软件包" - dnf install -y ${PACKAGE_NAME} > /dev/null 2>&1 - CHECK_RESULT $? 0 0 "安装${PACKAGE_NAME}软件包失败" - fi - - # 步骤4:验证软件包安装成功 - LOG_INFO "步骤4:验证${PACKAGE_NAME}软件包安装成功" - rpm -q ${PACKAGE_NAME} > /dev/null 2>&1 - CHECK_RESULT $? 0 0 "${PACKAGE_NAME}软件包安装验证失败" - - # 步骤5:检查软件包提供的命令或文件 - LOG_INFO "步骤5:检查${PACKAGE_NAME}软件包提供的文件" - rpm -ql ${PACKAGE_NAME} > /dev/null 2>&1 - CHECK_RESULT $? 0 0 "${PACKAGE_NAME}软件包文件检查失败" - - # 步骤6:清理环境 - LOG_INFO "步骤6:清理测试环境" - if [ "${ALREADY_INSTALLED}" = "false" ]; then - LOG_INFO "卸载${PACKAGE_NAME}软件包" - dnf remove -y ${PACKAGE_NAME} > /dev/null 2>&1 - CHECK_RESULT $? 0 0 "卸载${PACKAGE_NAME}软件包失败" - - # 验证卸载成功 - rpm -q ${PACKAGE_NAME} > /dev/null 2>&1 - if [ $? -eq 0 ]; then - LOG_ERROR "${PACKAGE_NAME}软件包卸载失败" - exit 1 - else - LOG_INFO "${PACKAGE_NAME}软件包已成功卸载" - fi - else - LOG_INFO "${PACKAGE_NAME}软件包已安装,保持安装状态" - fi - - LOG_INFO "测试完成:${PACKAGE_NAME}软件包功能检查通过" -} - -main "$@" \ No newline at end of file diff --git a/testcases/function_test/pkg_test/google-http-java-client/google-http-java-client-xml/test_google-http-java-client-xml_function_config.sh b/testcases/function_test/pkg_test/google-http-java-client/google-http-java-client-xml/test_google-http-java-client-xml_function_config.sh deleted file mode 100644 index 8bff10776a5..00000000000 --- a/testcases/function_test/pkg_test/google-http-java-client/google-http-java-client-xml/test_google-http-java-client-xml_function_config.sh +++ /dev/null @@ -1,65 +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-02-21 -# @License : Mulan PSL v2 -# @Desc : 测试XML请求/响应的配置 -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - PACKAGE_NAME="google-http-java-client-xml" - - LOG_INFO "开始测试XML请求/响应的配置" - - LOG_INFO "检查系统是否已安装${PACKAGE_NAME}" - if dnf list installed ${PACKAGE_NAME} &>/dev/null; then - LOG_INFO "${PACKAGE_NAME}已安装,测试后将保持安装状态" - INSTALLED_BEFORE="true" - else - LOG_INFO "${PACKAGE_NAME}未安装,将在测试过程中安装" - INSTALLED_BEFORE="false" - fi - - LOG_INFO "检查yum源中是否存在${PACKAGE_NAME}软件包" - if ! dnf list available ${PACKAGE_NAME} &>/dev/null; then - LOG_ERROR "yum源中未找到${PACKAGE_NAME}软件包" - exit 255 - fi - - if [ "${INSTALLED_BEFORE}" = "false" ]; then - LOG_INFO "安装${PACKAGE_NAME}软件包" - dnf install -y ${PACKAGE_NAME} - CHECK_RESULT $? 0 0 "安装${PACKAGE_NAME}失败" - fi - - LOG_INFO "测试XML请求/响应的配置功能" - java -cp "$(rpm -ql ${PACKAGE_NAME} | grep -E "\.jar$" | tr "\n" ":")" \ - com.google.api.client.xml.Xml &>/dev/null - CHECK_RESULT $? 0 0 "XML请求/响应配置测试失败" - - LOG_INFO "XML请求/响应配置测试完成" - - if [ "${INSTALLED_BEFORE}" = "false" ]; then - LOG_INFO "清理环境:卸载${PACKAGE_NAME}软件包" - dnf remove -y ${PACKAGE_NAME} - CHECK_RESULT $? 0 0 "卸载${PACKAGE_NAME}失败" - LOG_INFO "环境已恢复到测试前状态" - else - LOG_INFO "保持${PACKAGE_NAME}的安装状态" - fi -} - -main "$@" \ No newline at end of file diff --git a/testcases/function_test/pkg_test/google-http-java-client/google-http-java-client-xml/test_google-http-java-client-xml_function_error.sh b/testcases/function_test/pkg_test/google-http-java-client/google-http-java-client-xml/test_google-http-java-client-xml_function_error.sh deleted file mode 100644 index 8cf502f6df7..00000000000 --- a/testcases/function_test/pkg_test/google-http-java-client/google-http-java-client-xml/test_google-http-java-client-xml_function_error.sh +++ /dev/null @@ -1,76 +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-02-21 -# @License : Mulan PSL v2 -# @Desc : 测试处理XML解析错误 -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - LOG_INFO "测试开始:测试处理XML解析错误" - LOG_INFO "步骤1:检查环境中是否已安装google-http-java-client-xml软件包" - rpm -qa | grep -q "google-http-java-client-xml" - if [ $? -eq 0 ]; then - LOG_INFO "环境中已安装google-http-java-client-xml软件包,脚本结束时保持安装状态" - installed=true - else - LOG_INFO "环境中未安装google-http-java-client-xml软件包,将在测试过程中安装,并在脚本结束前卸载" - installed=false - fi - - LOG_INFO "步骤2:检查yum源中是否有google-http-java-client-xml软件包" - dnf list available google-http-java-client-xml - CHECK_RESULT $? 0 255 "yum源中没有google-http-java-client-xml软件包,退出测试" - - if [ "$installed" = false ]; then - LOG_INFO "步骤3:安装google-http-java-client-xml软件包" - dnf install -y google-http-java-client-xml - CHECK_RESULT $? 0 0 "安装google-http-java-client-xml软件包失败" - fi - - LOG_INFO "步骤4:模拟XML解析错误场景" - LOG_INFO "步骤4.1:创建包含无效XML内容的文件" - cat > /tmp/invalid.xml << EOF - - - value - - EOF - CHECK_RESULT $? 0 0 "创建无效XML文件失败" - - LOG_INFO "步骤4.2:使用google-http-java-client-xml工具解析无效XML文件" - xml_parser_tool parse /tmp/invalid.xml - if [ $? -ne 0 ]; then - LOG_INFO "XML解析失败,符合预期" - else - LOG_ERROR "XML解析成功,不符合预期" - exit 1 - fi - - LOG_INFO "步骤5:清理测试过程中创建的文件" - rm -f /tmp/invalid.xml - CHECK_RESULT $? 0 0 "删除临时文件失败" - - if [ "$installed" = false ]; then - LOG_INFO "步骤6:卸载google-http-java-client-xml软件包" - dnf remove -y google-http-java-client-xml - CHECK_RESULT $? 0 0 "卸载google-http-java-client-xml软件包失败" - fi - - LOG_INFO "测试结束:测试处理XML解析错误完成" -} - -main "$@" \ No newline at end of file diff --git a/testcases/function_test/pkg_test/google-http-java-client/google-http-java-client-xml/test_google-http-java-client-xml_function_http.sh b/testcases/function_test/pkg_test/google-http-java-client/google-http-java-client-xml/test_google-http-java-client-xml_function_http.sh deleted file mode 100644 index 3f1d23d936f..00000000000 --- a/testcases/function_test/pkg_test/google-http-java-client/google-http-java-client-xml/test_google-http-java-client-xml_function_http.sh +++ /dev/null @@ -1,70 +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-02-21 -# @License : Mulan PSL v2 -# @Desc : 测试使用该库发送HTTP请求 -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - LOG_INFO "开始测试:测试使用该库发送HTTP请求" - - # 检查是否已安装google-http-java-client-xml软件包 - LOG_INFO "检查google-http-java-client-xml是否已安装" - dnf list installed google-http-java-client-xml &>/dev/null - if [ $? -eq 0 ]; then - LOG_INFO "google-http-java-client-xml已安装" - INSTALLED=1 - else - LOG_INFO "google-http-java-client-xml未安装" - INSTALLED=0 - fi - - # 检查yum源中是否有该软件包 - LOG_INFO "检查yum源中是否有google-http-java-client-xml软件包" - dnf list available google-http-java-client-xml &>/dev/null - if [ $? -ne 0 ]; then - LOG_ERROR "yum源中未找到google-http-java-client-xml软件包" - exit 255 - fi - - # 如果未安装,则安装软件包 - if [ $INSTALLED -eq 0 ]; then - LOG_INFO "安装google-http-java-client-xml软件包" - dnf install -y google-http-java-client-xml - CHECK_RESULT $? 0 0 "安装google-http-java-client-xml失败" - fi - - # 测试使用该库发送HTTP请求 - LOG_INFO "测试使用google-http-java-client-xml发送HTTP请求" - # 这里假设有一个测试程序或命令来验证库的功能,例如使用java命令运行一个测试程序 - # 由于实际测试程序未指定,这里使用一个示例命令,实际应根据具体测试程序替换 - java -cp /usr/share/java/google-http-java-client-xml.jar TestHttpRequest - CHECK_RESULT $? 0 0 "使用google-http-java-client-xml发送HTTP请求失败" - - # 清理环境:如果脚本开始时未安装,则卸载软件包 - if [ $INSTALLED -eq 0 ]; then - LOG_INFO "卸载google-http-java-client-xml软件包" - dnf remove -y google-http-java-client-xml - CHECK_RESULT $? 0 0 "卸载google-http-java-client-xml失败" - else - LOG_INFO "保持google-http-java-client-xml安装状态" - fi - - LOG_INFO "测试完成" -} - -main "$@" \ No newline at end of file diff --git a/testcases/function_test/pkg_test/google-http-java-client/google-http-java-client-xml/test_google-http-java-client-xml_function_install.sh b/testcases/function_test/pkg_test/google-http-java-client/google-http-java-client-xml/test_google-http-java-client-xml_function_install.sh deleted file mode 100644 index dedda561dfa..00000000000 --- a/testcases/function_test/pkg_test/google-http-java-client/google-http-java-client-xml/test_google-http-java-client-xml_function_install.sh +++ /dev/null @@ -1,84 +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-02-21 -# @License : Mulan PSL v2 -# @Desc : 测试google-http-java-client-xml软件包的安装功能 -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - set -e - - LOG_INFO "开始测试google-http-java-client-xml软件包的安装功能" - - LOG_INFO "步骤1:检查yum源中是否存在google-http-java-client-xml软件包" - if ! dnf list available google-http-java-client-xml &>/dev/null; then - LOG_ERROR "yum源中未找到google-http-java-client-xml软件包" - exit 255 - fi - - LOG_INFO "步骤2:检查当前是否已安装google-http-java-client-xml" - if rpm -q google-http-java-client-xml &>/dev/null; then - LOG_INFO "google-http-java-client-xml已安装,测试完成后将保持安装状态" - INSTALLED_BEFORE_TEST=true - else - LOG_INFO "google-http-java-client-xml未安装,将进行安装测试" - INSTALLED_BEFORE_TEST=false - fi - - if [ "$INSTALLED_BEFORE_TEST" = "false" ]; then - LOG_INFO "步骤3:安装google-http-java-client-xml软件包" - dnf install -y google-http-java-client-xml - CHECK_RESULT $? 0 0 "安装google-http-java-client-xml失败" - - LOG_INFO "步骤4:验证google-http-java-client-xml安装成功" - rpm -q google-http-java-client-xml - CHECK_RESULT $? 0 0 "验证google-http-java-client-xml安装失败" - fi - - LOG_INFO "步骤5:验证google-http-java-client-xml基本功能" - if [ -x "$(command -v java)" ]; then - LOG_INFO "Java环境存在,尝试验证jar包" - JAR_PATH=$(rpm -ql google-http-java-client-xml | grep -E "\.jar$" | head -1) - if [ -n "$JAR_PATH" ]; then - LOG_INFO "找到jar包: $JAR_PATH" - CHECK_RESULT $? 0 0 "未找到google-http-java-client-xml的jar包" - else - LOG_INFO "未找到jar包,跳过Java相关验证" - fi - else - LOG_INFO "Java环境不存在,跳过Java相关验证" - fi - - LOG_INFO "步骤6:清理测试环境" - if [ "$INSTALLED_BEFORE_TEST" = "false" ]; then - LOG_INFO "卸载测试安装的google-http-java-client-xml软件包" - dnf remove -y google-http-java-client-xml - CHECK_RESULT $? 0 0 "卸载google-http-java-client-xml失败" - - LOG_INFO "验证google-http-java-client-xml已卸载" - if rpm -q google-http-java-client-xml &>/dev/null; then - LOG_ERROR "google-http-java-client-xml卸载失败" - exit 1 - fi - else - LOG_INFO "测试前已安装google-http-java-client-xml,保持安装状态" - fi - - LOG_INFO "google-http-java-client-xml软件包安装功能测试完成" -} - -main "$@" \ No newline at end of file diff --git a/testcases/function_test/pkg_test/google-http-java-client/google-http-java-client-xml/test_google-http-java-client-xml_function_parse.sh b/testcases/function_test/pkg_test/google-http-java-client/google-http-java-client-xml/test_google-http-java-client-xml_function_parse.sh deleted file mode 100644 index bd598d88d91..00000000000 --- a/testcases/function_test/pkg_test/google-http-java-client/google-http-java-client-xml/test_google-http-java-client-xml_function_parse.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-12-03 -# @License : Mulan PSL v2 -# @Desc : 测试google-http-java-client-xml软件包的XML解析功能 -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - LOG_INFO "开始测试google-http-java-client-xml软件包的XML解析功能" - - # 检查软件包是否已安装 - LOG_INFO "检查google-http-java-client-xml是否已安装" - if dnf list installed google-http-java-client-xml &>/dev/null; then - LOG_INFO "google-http-java-client-xml已安装,跳过安装步骤" - INSTALLED=true - else - LOG_INFO "google-http-java-client-xml未安装,准备安装" - INSTALLED=false - fi - - # 检查yum源中是否有该软件包 - LOG_INFO "检查yum源中是否有google-http-java-client-xml" - if ! dnf list available google-http-java-client-xml &>/dev/null; then - LOG_ERROR "yum源中未找到google-http-java-client-xml软件包" - exit 255 - fi - - # 如果未安装,则安装软件包 - if [ "$INSTALLED" = false ]; then - LOG_INFO "正在安装google-http-java-client-xml" - dnf install -y google-http-java-client-xml - CHECK_RESULT $? 0 0 "安装google-http-java-client-xml失败" - fi - - # 测试XML解析功能 - LOG_INFO "测试XML解析功能" - java -cp /usr/share/java/google-http-java-client-xml.jar com.example.XmlParserTest &>/tmp/xml_parse_test.log - CHECK_RESULT $? 0 0 "XML解析功能测试失败" - - # 检查日志文件中的预期结果 - LOG_INFO "检查XML解析结果" - grep -q "Parsing successful" /tmp/xml_parse_test.log - CHECK_RESULT $? 0 0 "XML解析结果不符合预期" - - # 清理临时文件 - rm -f /tmp/xml_parse_test.log - - # 如果脚本开始时未安装,则卸载软件包以恢复环境 - if [ "$INSTALLED" = false ]; then - LOG_INFO "卸载google-http-java-client-xml以恢复环境" - dnf remove -y google-http-java-client-xml - CHECK_RESULT $? 0 0 "卸载google-http-java-client-xml失败" - fi - - LOG_INFO "测试完成,环境已恢复" -} - -main "$@" \ No newline at end of file diff --git a/testcases/function_test/pkg_test/google-http-java-client/google-http-java-client-xml/test_google-http-java-client-xml_function_validate.sh b/testcases/function_test/pkg_test/google-http-java-client/google-http-java-client-xml/test_google-http-java-client-xml_function_validate.sh deleted file mode 100644 index 4637e8f7703..00000000000 --- a/testcases/function_test/pkg_test/google-http-java-client/google-http-java-client-xml/test_google-http-java-client-xml_function_validate.sh +++ /dev/null @@ -1,66 +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-12-03 -# @License : Mulan PSL v2 -# @Desc : 测试google-http-java-client-xml软件包的XML验证功能 -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - LOG_INFO "开始测试google-http-java-client-xml软件包的XML验证功能" - - # 检查是否已安装google-http-java-client-xml - LOG_INFO "检查google-http-java-client-xml是否已安装" - dnf list installed google-http-java-client-xml > /dev/null 2>&1 - if [ $? -eq 0 ]; then - LOG_INFO "google-http-java-client-xml已安装,测试后保持安装状态" - installed=true - else - LOG_INFO "google-http-java-client-xml未安装,将在测试后卸载" - installed=false - fi - - # 检查yum源中是否有该软件包 - LOG_INFO "检查yum源中是否有google-http-java-client-xml" - dnf list available google-http-java-client-xml > /dev/null 2>&1 - if [ $? -ne 0 ]; then - LOG_ERROR "yum源中没有找到google-http-java-client-xml软件包" - exit 255 - fi - - # 安装软件包 - if [ "$installed" = false ]; then - LOG_INFO "正在安装google-http-java-client-xml" - dnf install -y google-http-java-client-xml > /dev/null 2>&1 - CHECK_RESULT $? 0 0 "安装google-http-java-client-xml失败" - fi - - # 测试XML验证功能 - LOG_INFO "测试XML验证功能" - java -cp /usr/share/java/google-http-java-client-xml.jar com.google.api.client.xml.Xml validate test.xml > /dev/null 2>&1 - CHECK_RESULT $? 0 0 "XML验证功能测试失败" - - # 清理环境(如果最初未安装) - if [ "$installed" = false ]; then - LOG_INFO "卸载google-http-java-client-xml" - dnf remove -y google-http-java-client-xml > /dev/null 2>&1 - CHECK_RESULT $? 0 0 "卸载google-http-java-client-xml失败" - fi - - LOG_INFO "测试完成" -} - -main "$@" \ No newline at end of file From 7713945015109521bc380656777ec4410d7e08dc Mon Sep 17 00:00:00 2001 From: honghua Date: Tue, 21 Apr 2026 13:10:23 +0800 Subject: [PATCH 05/18] update testcase for testsuite texlive-calcage --- .../texlive-split-d/texlive-calcage.json | 16 --- .../test_texlive-calcage_function_basic.sh | 67 ------------ .../test_texlive-calcage_function_check.sh | 102 ------------------ .../test_texlive-calcage_function_usage.sh | 80 -------------- .../test_texlive-calcage_function_version.sh | 80 -------------- 5 files changed, 345 deletions(-) delete mode 100644 testcases/function_test/pkg_test/texlive-split-d/texlive-calcage/test_texlive-calcage_function_basic.sh delete mode 100644 testcases/function_test/pkg_test/texlive-split-d/texlive-calcage/test_texlive-calcage_function_check.sh delete mode 100644 testcases/function_test/pkg_test/texlive-split-d/texlive-calcage/test_texlive-calcage_function_usage.sh delete mode 100644 testcases/function_test/pkg_test/texlive-split-d/texlive-calcage/test_texlive-calcage_function_version.sh diff --git a/suite2cases/function_test/pkg_test/texlive-split-d/texlive-calcage.json b/suite2cases/function_test/pkg_test/texlive-split-d/texlive-calcage.json index bea57e433ae..91da913db63 100644 --- a/suite2cases/function_test/pkg_test/texlive-split-d/texlive-calcage.json +++ b/suite2cases/function_test/pkg_test/texlive-split-d/texlive-calcage.json @@ -2,10 +2,6 @@ "path": "$OET_PATH/testcases/function_test/pkg_test/texlive-split-d/texlive-calcage", "machine num": 1, "cases": [ - { - "name": "test_texlive-calcage_function_basic", - "desc": "Basic functionality test" - }, { "name": "test_texlive-calcage_function_install", "desc": "Test the installation of the texlive-calcage package" @@ -13,18 +9,6 @@ { "name": "test_texlive-calcage_function_uninstall", "desc": "Test the removal of the texlive-calcage package" - }, - { - "name": "test_texlive-calcage_function_check", - "desc": "Check if texlive-calcage package is installed" - }, - { - "name": "test_texlive-calcage_function_usage", - "desc": "Test basic usage of the calcage LaTeX command" - }, - { - "name": "test_texlive-calcage_function_version", - "desc": "Test retrieving package version information" } ] } \ No newline at end of file diff --git a/testcases/function_test/pkg_test/texlive-split-d/texlive-calcage/test_texlive-calcage_function_basic.sh b/testcases/function_test/pkg_test/texlive-split-d/texlive-calcage/test_texlive-calcage_function_basic.sh deleted file mode 100644 index 22fcb101de1..00000000000 --- a/testcases/function_test/pkg_test/texlive-split-d/texlive-calcage/test_texlive-calcage_function_basic.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 : 2025-11-26 -# @License : Mulan PSL v2 -# @Desc : Basic functionality test -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - LOG_INFO "开始执行测试脚本:test_texlive-calcage_function_basic" - LOG_INFO "测试用例描述:Basic functionality test" - - # 检查是否已安装texlive-calcage - LOG_INFO "检查texlive-calcage是否已安装" - dnf list installed texlive-calcage > /dev/null 2>&1 - if [ $? -eq 0 ]; then - LOG_INFO "texlive-calcage已安装,脚本结束时将保持安装状态" - INSTALLED=true - else - LOG_INFO "texlive-calcage未安装,将在测试步骤中安装" - INSTALLED=false - fi - - # 检查yum源中是否有texlive-calcage - LOG_INFO "检查yum源中是否有texlive-calcage" - dnf list available texlive-calcage > /dev/null 2>&1 - if [ $? -ne 0 ]; then - LOG_ERROR "yum源中未找到texlive-calcage,退出码255" - exit 255 - fi - - # 如果未安装,则安装texlive-calcage - if [ "$INSTALLED" = false ]; then - LOG_INFO "开始安装texlive-calcage" - dnf install -y texlive-calcage > /dev/null 2>&1 - CHECK_RESULT $? 0 0 "安装texlive-calcage失败" - fi - - # 测试基本功能 - LOG_INFO "测试基本功能" - calcage --version > /dev/null 2>&1 - CHECK_RESULT $? 0 0 "calcage命令执行失败" - - # 清理环境 - if [ "$INSTALLED" = false ]; then - LOG_INFO "清理环境,卸载texlive-calcage" - dnf remove -y texlive-calcage > /dev/null 2>&1 - CHECK_RESULT $? 0 0 "卸载texlive-calcage失败" - fi - - LOG_INFO "测试脚本执行完毕" -} - -main "$@" \ No newline at end of file diff --git a/testcases/function_test/pkg_test/texlive-split-d/texlive-calcage/test_texlive-calcage_function_check.sh b/testcases/function_test/pkg_test/texlive-split-d/texlive-calcage/test_texlive-calcage_function_check.sh deleted file mode 100644 index 7505b7c7d12..00000000000 --- a/testcases/function_test/pkg_test/texlive-split-d/texlive-calcage/test_texlive-calcage_function_check.sh +++ /dev/null @@ -1,102 +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-07 -# @License : Mulan PSL v2 -# @Desc : Check if texlive-calcage package is installed -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - # 定义测试包名 - PACKAGE_NAME="texlive-calcage" - - # 步骤1:检查当前是否已安装测试包 - LOG_INFO "步骤1:检查当前是否已安装测试包" - rpm -q $PACKAGE_NAME > /dev/null 2>&1 - if [ $? -eq 0 ]; then - LOG_INFO "检测到 $PACKAGE_NAME 已安装,标记为保持安装状态" - KEEP_INSTALLED=true - else - LOG_INFO "检测到 $PACKAGE_NAME 未安装,标记为测试后卸载" - KEEP_INSTALLED=false - fi - - # 步骤2:检查yum源中是否存在该软件包 - LOG_INFO "步骤2:检查yum源中是否存在软件包 $PACKAGE_NAME" - dnf list available $PACKAGE_NAME > /dev/null 2>&1 - CHECK_RESULT $? 0 0 "yum源中未找到软件包 $PACKAGE_NAME" - if [ $? -ne 0 ]; then - LOG_ERROR "yum源中不存在软件包 $PACKAGE_NAME,退出测试" - exit 255 - fi - - # 步骤3:如果未安装,则安装软件包 - if [ "$KEEP_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 是否成功安装" - rpm -q $PACKAGE_NAME - CHECK_RESULT $? 0 0 "软件包 $PACKAGE_NAME 未正确安装" - - # 步骤5:检查texlive-calcage提供的calcage命令是否存在 - LOG_INFO "步骤5:检查texlive-calcage提供的calcage命令是否存在" - command -v calcage > /dev/null 2>&1 - if [ $? -ne 0 ]; then - LOG_ERROR "calcage命令不存在,可能安装不完整或命令路径未在PATH中" - exit 255 - fi - - # 步骤6:测试calcage命令的基本功能(检查参数支持) - LOG_INFO "步骤6:测试calcage命令的基本参数" - calcage --help > /dev/null 2>&1 - CHECK_RESULT $? 0 0 "calcage命令不支持--help参数或执行失败" - - # 步骤7:执行一个简单的calcage计算测试 - LOG_INFO "步骤7:执行一个简单的calcage计算测试" - calcage 2024-01-01 > /dev/null 2>&1 - CHECK_RESULT $? 0 0 "calcage命令执行简单日期计算失败" - - # 步骤8:测试calcage命令的错误参数处理 - LOG_INFO "步骤8:测试calcage命令的错误参数处理" - calcage --nonexistent-option 2>&1 | grep -q "unrecognized option\|invalid option\|用法" - CHECK_RESULT $? 0 0 "calcage命令未正确报告不支持参数" - - # 步骤9:清理环境(如果测试前未安装,则卸载软件包) - if [ "$KEEP_INSTALLED" = "false" ]; then - LOG_INFO "步骤9:卸载测试安装的软件包 $PACKAGE_NAME" - dnf remove -y $PACKAGE_NAME - CHECK_RESULT $? 0 0 "卸载软件包 $PACKAGE_NAME 失败" - - # 验证卸载是否成功 - rpm -q $PACKAGE_NAME > /dev/null 2>&1 - if [ $? -eq 0 ]; then - LOG_ERROR "软件包 $PACKAGE_NAME 卸载失败" - exit 1 - else - LOG_INFO "软件包 $PACKAGE_NAME 已成功卸载" - fi - else - LOG_INFO "步骤9:保持 $PACKAGE_NAME 安装状态,不进行卸载" - fi - - LOG_INFO "测试完成:texlive-calcage软件包功能检查通过" -} - -main "$@" \ No newline at end of file diff --git a/testcases/function_test/pkg_test/texlive-split-d/texlive-calcage/test_texlive-calcage_function_usage.sh b/testcases/function_test/pkg_test/texlive-split-d/texlive-calcage/test_texlive-calcage_function_usage.sh deleted file mode 100644 index b03ea933200..00000000000 --- a/testcases/function_test/pkg_test/texlive-split-d/texlive-calcage/test_texlive-calcage_function_usage.sh +++ /dev/null @@ -1,80 +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-07 -# @License : Mulan PSL v2 -# @Desc : Test basic usage of the calcage LaTeX command -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - LOG_INFO "测试开始:测试calcage LaTeX命令的基本用法" - - # 定义软件包名称 - PACKAGE_NAME="texlive-calcage" - - # 检查yum源中是否存在指定软件包 - LOG_INFO "步骤1:检查yum源中是否存在软件包 $PACKAGE_NAME" - dnf list available "$PACKAGE_NAME" &>/dev/null - if [ $? -ne 0 ]; then - LOG_ERROR "软件包 $PACKAGE_NAME 在yum源中不存在" - exit 255 - fi - - # 检查是否已安装软件包 - LOG_INFO "步骤2:检查系统是否已安装软件包 $PACKAGE_NAME" - if rpm -q "$PACKAGE_NAME" &>/dev/null; then - LOG_INFO "软件包 $PACKAGE_NAME 已安装,脚本结束后将保持安装状态" - INSTALLED_BEFORE=1 - else - LOG_INFO "软件包 $PACKAGE_NAME 未安装,将在测试步骤中安装" - INSTALLED_BEFORE=0 - fi - - # 如果未安装,则安装软件包 - if [ $INSTALLED_BEFORE -eq 0 ]; then - LOG_INFO "步骤3:安装软件包 $PACKAGE_NAME" - dnf install -y "$PACKAGE_NAME" - CHECK_RESULT $? 0 0 "安装软件包 $PACKAGE_NAME 失败" - fi - - # 测试calcage命令的基本用法 - LOG_INFO "步骤4:测试calcage命令的基本用法" - calcage 2023-01-01 2023-12-31 - CHECK_RESULT $? 0 0 "calcage命令执行失败" - - # 测试calcage命令的参数(示例:检查是否存在不支持的参数) - LOG_INFO "步骤5:测试calcage命令的参数检查" - calcage --invalid-option 2>/dev/null - if [ $? -eq 255 ]; then - LOG_INFO "calcage命令正确拒绝了无效参数" - else - LOG_ERROR "calcage命令未正确处理无效参数" - exit 255 - fi - - # 清理环境:如果之前未安装,则卸载软件包 - if [ $INSTALLED_BEFORE -eq 0 ]; then - LOG_INFO "步骤6:清理环境,卸载软件包 $PACKAGE_NAME" - dnf remove -y "$PACKAGE_NAME" - CHECK_RESULT $? 0 0 "卸载软件包 $PACKAGE_NAME 失败" - else - LOG_INFO "步骤6:环境清理,保持软件包 $PACKAGE_NAME 的安装状态" - fi - - LOG_INFO "测试完成:calcage LaTeX命令基本用法测试通过" -} - -main "$@" \ No newline at end of file diff --git a/testcases/function_test/pkg_test/texlive-split-d/texlive-calcage/test_texlive-calcage_function_version.sh b/testcases/function_test/pkg_test/texlive-split-d/texlive-calcage/test_texlive-calcage_function_version.sh deleted file mode 100644 index 5ce2bb73bdb..00000000000 --- a/testcases/function_test/pkg_test/texlive-split-d/texlive-calcage/test_texlive-calcage_function_version.sh +++ /dev/null @@ -1,80 +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-07 -# @License : Mulan PSL v2 -# @Desc : Test retrieving package version information -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - # 判断是否已安装texlive-calcage - LOG_INFO "检查是否已安装texlive-calcage软件包" - rpm -q texlive-calcage > /dev/null 2>&1 - if [ $? -eq 0 ]; then - LOG_INFO "texlive-calcage已安装,标记为已存在" - INSTALLED="true" - else - LOG_INFO "texlive-calcage未安装,标记为未安装" - INSTALLED="false" - fi - - # 检查yum源中是否存在texlive-calcage软件包 - LOG_INFO "检查yum源中是否存在texlive-calcage软件包" - dnf list available texlive-calcage > /dev/null 2>&1 - if [ $? -ne 0 ]; then - LOG_ERROR "yum源中未找到texlive-calcage软件包" - exit 255 - fi - - # 如果未安装,则安装软件包 - if [ "$INSTALLED" = "false" ]; then - LOG_INFO "开始安装texlive-calcage软件包" - dnf install -y texlive-calcage - CHECK_RESULT $? 0 0 "安装texlive-calcage失败" - fi - - # 测试获取软件包版本信息 - LOG_INFO "测试获取texlive-calcage版本信息" - rpm -q texlive-calcage --queryformat "%{VERSION}-%{RELEASE}\n" - CHECK_RESULT $? 0 0 "获取texlive-calcage版本信息失败" - - # 测试texlive-calcage命令是否支持--version参数 - LOG_INFO "测试texlive-calcage命令是否支持--version参数" - which texlive-calcage > /dev/null 2>&1 - if [ $? -eq 0 ]; then - texlive-calcage --version > /dev/null 2>&1 - if [ $? -ne 0 ]; then - LOG_ERROR "texlive-calcage命令不支持--version参数" - # 如果是未安装的情况,先卸载再退出 - if [ "$INSTALLED" = "false" ]; then - dnf remove -y texlive-calcage - fi - exit 255 - fi - LOG_INFO "texlive-calcage命令支持--version参数" - fi - - # 清理环境:如果测试前未安装,则卸载软件包 - if [ "$INSTALLED" = "false" ]; then - LOG_INFO "清理环境:卸载texlive-calcage软件包" - dnf remove -y texlive-calcage - CHECK_RESULT $? 0 0 "卸载texlive-calcage失败" - fi - - LOG_INFO "测试完成" -} - -main "$@" \ No newline at end of file From 25faa9cfd2c0561479d3a55671d63f1bf0359cc3 Mon Sep 17 00:00:00 2001 From: honghua Date: Tue, 21 Apr 2026 13:10:31 +0800 Subject: [PATCH 06/18] update testcase for testsuite texlive-nidanfloat --- .../texlive-split-p/texlive-nidanfloat.json | 16 --- ...test_texlive-nidanfloat_function_dblcol.sh | 101 ----------------- ...t_texlive-nidanfloat_function_float_env.sh | 105 ------------------ ...test_texlive-nidanfloat_function_floats.sh | 63 ----------- ...st_texlive-nidanfloat_function_sideways.sh | 89 --------------- 5 files changed, 374 deletions(-) delete mode 100644 testcases/function_test/pkg_test/texlive-split-p/texlive-nidanfloat/test_texlive-nidanfloat_function_dblcol.sh delete mode 100644 testcases/function_test/pkg_test/texlive-split-p/texlive-nidanfloat/test_texlive-nidanfloat_function_float_env.sh delete mode 100644 testcases/function_test/pkg_test/texlive-split-p/texlive-nidanfloat/test_texlive-nidanfloat_function_floats.sh delete mode 100644 testcases/function_test/pkg_test/texlive-split-p/texlive-nidanfloat/test_texlive-nidanfloat_function_sideways.sh diff --git a/suite2cases/function_test/pkg_test/texlive-split-p/texlive-nidanfloat.json b/suite2cases/function_test/pkg_test/texlive-split-p/texlive-nidanfloat.json index f7c43e8de51..503984f14d7 100644 --- a/suite2cases/function_test/pkg_test/texlive-split-p/texlive-nidanfloat.json +++ b/suite2cases/function_test/pkg_test/texlive-split-p/texlive-nidanfloat.json @@ -2,25 +2,9 @@ "path": "$OET_PATH/testcases/function_test/pkg_test/texlive-split-p/texlive-nidanfloat", "machine num": 1, "cases": [ - { - "name": "test_texlive-nidanfloat_function_floats", - "desc": "Test floating environment support" - }, { "name": "test_texlive-nidanfloat_function_install", "desc": "Test installation of the package" - }, - { - "name": "test_texlive-nidanfloat_function_float_env", - "desc": "Test basic float environment" - }, - { - "name": "test_texlive-nidanfloat_function_sideways", - "desc": "Test sidewaysfloat option" - }, - { - "name": "test_texlive-nidanfloat_function_dblcol", - "desc": "Test double column floats" } ] } \ No newline at end of file diff --git a/testcases/function_test/pkg_test/texlive-split-p/texlive-nidanfloat/test_texlive-nidanfloat_function_dblcol.sh b/testcases/function_test/pkg_test/texlive-split-p/texlive-nidanfloat/test_texlive-nidanfloat_function_dblcol.sh deleted file mode 100644 index 71c3e4b5045..00000000000 --- a/testcases/function_test/pkg_test/texlive-split-p/texlive-nidanfloat/test_texlive-nidanfloat_function_dblcol.sh +++ /dev/null @@ -1,101 +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-19 -# @License : Mulan PSL v2 -# @Desc : Test double column floats -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - # 测试脚本:Test double column floats - - # 检查软件包是否存在 - LOG_INFO "1. 检查texlive-nidanfloat软件包是否在yum源中" - dnf list available texlive-nidanfloat > /dev/null 2>&1 - if [ $? -ne 0 ]; then - LOG_ERROR "texlive-nidanfloat软件包不在yum源中" - exit 255 - fi - - # 检查环境是否已安装 - LOG_INFO "2. 检查texlive-nidanfloat是否已安装" - rpm -q texlive-nidanfloat > /dev/null 2>&1 - INSTALLED=$? - - # 如果未安装,则安装 - if [ $INSTALLED -ne 0 ]; then - LOG_INFO "3. 安装texlive-nidanfloat软件包" - dnf install -y texlive-nidanfloat - CHECK_RESULT $? 0 0 "安装texlive-nidanfloat失败" - fi - - # 测试命令参数 - LOG_INFO "4. 测试tex命令的--help参数" - tex --help > /dev/null 2>&1 - if [ $? -eq 255 ]; then - LOG_ERROR "tex命令不支持--help参数" - exit 255 - fi - - # 创建测试LaTeX文件 - LOG_INFO "5. 创建测试LaTeX文件" - cat > test_dblcol.tex << "EOF" - \documentclass[twocolumn]{article} - \usepackage{nidanfloat} - \begin{document} - \begin{figure*}[t] - \centering - \rule{10cm}{5cm} - \caption{A double column float} - \end{figure*} - \end{document} - EOF - CHECK_RESULT $? 0 0 "创建测试LaTeX文件失败" - - # 编译测试文件 - LOG_INFO "6. 编译测试LaTeX文件" - pdflatex test_dblcol.tex > /dev/null 2>&1 - CHECK_RESULT $? 0 0 "编译LaTeX文件失败" - - # 检查生成的PDF文件 - LOG_INFO "7. 检查生成的PDF文件" - if [ -f test_dblcol.pdf ]; then - LOG_INFO "PDF文件生成成功" - file test_dblcol.pdf | grep -q "PDF document" - CHECK_RESULT $? 0 0 "生成的PDF文件格式不正确" - else - LOG_ERROR "PDF文件未生成" - exit 1 - fi - - # 清理测试文件 - LOG_INFO "8. 清理测试文件" - rm -f test_dblcol.tex test_dblcol.pdf test_dblcol.log test_dblcol.aux test_dblcol.out - CHECK_RESULT $? 0 0 "清理测试文件失败" - - # 如果最初未安装,则卸载软件包 - if [ $INSTALLED -ne 0 ]; then - LOG_INFO "9. 卸载texlive-nidanfloat软件包" - dnf remove -y texlive-nidanfloat - CHECK_RESULT $? 0 0 "卸载texlive-nidanfloat失败" - else - LOG_INFO "9. 保持texlive-nidanfloat安装状态" - fi - - LOG_INFO "10. 测试完成" -} - -main "$@" \ No newline at end of file diff --git a/testcases/function_test/pkg_test/texlive-split-p/texlive-nidanfloat/test_texlive-nidanfloat_function_float_env.sh b/testcases/function_test/pkg_test/texlive-split-p/texlive-nidanfloat/test_texlive-nidanfloat_function_float_env.sh deleted file mode 100644 index 7600c28d206..00000000000 --- a/testcases/function_test/pkg_test/texlive-split-p/texlive-nidanfloat/test_texlive-nidanfloat_function_float_env.sh +++ /dev/null @@ -1,105 +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-19 -# @License : Mulan PSL v2 -# @Desc : Test basic float environment -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - # 检查是否已安装texlive-nidanfloat包 - LOG_INFO "检查是否已安装texlive-nidanfloat包" - rpm -q texlive-nidanfloat > /dev/null 2>&1 - if [ $? -eq 0 ]; then - LOG_INFO "texlive-nidanfloat已安装,测试完成后将保持安装状态" - INSTALLED=1 - else - LOG_INFO "texlive-nidanfloat未安装,将在测试过程中安装" - INSTALLED=0 - fi - - # 检查yum源中是否有texlive-nidanfloat包 - LOG_INFO "检查yum源中是否有texlive-nidanfloat包" - dnf list available texlive-nidanfloat > /dev/null 2>&1 - CHECK_RESULT $? 0 0 "yum源中未找到texlive-nidanfloat包,退出" - if [ $? -ne 0 ]; then - LOG_ERROR "yum源中未找到texlive-nidanfloat包" - exit 255 - fi - - # 测试基本float环境 - LOG_INFO "开始测试基本float环境" - - # 如果未安装,则安装texlive-nidanfloat - if [ $INSTALLED -eq 0 ]; then - LOG_INFO "安装texlive-nidanfloat包" - dnf install -y texlive-nidanfloat - CHECK_RESULT $? 0 0 "安装texlive-nidanfloat失败" - fi - - # 检查texlive-nidanfloat提供的命令 - LOG_INFO "检查texlive-nidanfloat提供的命令" - rpm -ql texlive-nidanfloat | grep -E "\.sty$" > /dev/null 2>&1 - CHECK_RESULT $? 0 0 "texlive-nidanfloat未提供预期的.sty文件" - - # 创建一个简单的LaTeX文件测试float环境 - LOG_INFO "创建测试LaTeX文件" - cat > test_float.tex << "EOF" - \documentclass{article} - \usepackage{nidanfloat} - \begin{document} - 测试基本的float环境。 - \begin{figure}[h] - \centering - 测试浮动环境 - \caption{测试浮动环境} - \end{figure} - \end{document} - EOF - - # 尝试编译LaTeX文件(如果系统安装了pdflatex) - LOG_INFO "检查是否安装了pdflatex" - which pdflatex > /dev/null 2>&1 - if [ $? -eq 0 ]; then - LOG_INFO "使用pdflatex编译测试文件" - pdflatex -interaction=nonstopmode test_float.tex > /dev/null 2>&1 - CHECK_RESULT $? 0 0 "pdflatex编译失败" - - # 检查是否生成了PDF文件 - LOG_INFO "检查是否生成了PDF文件" - [ -f test_float.pdf ] - CHECK_RESULT $? 0 0 "未生成PDF文件" - else - LOG_INFO "系统未安装pdflatex,跳过编译测试" - fi - - # 清理测试文件 - LOG_INFO "清理测试文件" - rm -f test_float.tex test_float.log test_float.aux test_float.pdf > /dev/null 2>&1 - - # 如果测试前未安装,则卸载texlive-nidanfloat - if [ $INSTALLED -eq 0 ]; then - LOG_INFO "卸载texlive-nidanfloat包" - dnf remove -y texlive-nidanfloat - CHECK_RESULT $? 0 0 "卸载texlive-nidanfloat失败" - else - LOG_INFO "测试前已安装texlive-nidanfloat,保持安装状态" - fi - - LOG_INFO "基本float环境测试完成" -} - -main "$@" \ No newline at end of file diff --git a/testcases/function_test/pkg_test/texlive-split-p/texlive-nidanfloat/test_texlive-nidanfloat_function_floats.sh b/testcases/function_test/pkg_test/texlive-split-p/texlive-nidanfloat/test_texlive-nidanfloat_function_floats.sh deleted file mode 100644 index b48d888428c..00000000000 --- a/testcases/function_test/pkg_test/texlive-split-p/texlive-nidanfloat/test_texlive-nidanfloat_function_floats.sh +++ /dev/null @@ -1,63 +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 floating environment support -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - - # 检查环境是否已安装texlive-nidanfloat软件包 - LOG_INFO "检查是否已安装texlive-nidanfloat软件包" - rpm -q texlive-nidanfloat > /dev/null 2>&1 - if [ $? -eq 0 ]; then - LOG_INFO "texlive-nidanfloat已安装,脚本结束时将保持安装状态" - INSTALLED=true - else - LOG_INFO "texlive-nidanfloat未安装,将在测试结束后卸载" - INSTALLED=false - fi - - # 检查yum源中是否有texlive-nidanfloat软件包 - LOG_INFO "检查yum源中是否有texlive-nidanfloat软件包" - dnf list available texlive-nidanfloat > /dev/null 2>&1 - CHECK_RESULT $? 0 255 "yum源中未找到texlive-nidanfloat软件包" - - # 安装texlive-nidanfloat软件包 - if [ "$INSTALLED" = false ]; then - LOG_INFO "开始安装texlive-nidanfloat软件包" - dnf install -y texlive-nidanfloat > /dev/null 2>&1 - CHECK_RESULT $? 0 0 "安装texlive-nidanfloat失败" - fi - - # 测试floating环境支持功能 - LOG_INFO "测试floating环境支持功能" - texdoc nidanfloat > /dev/null 2>&1 - CHECK_RESULT $? 0 0 "floating环境支持功能测试失败" - - # 清理环境 - if [ "$INSTALLED" = false ]; then - LOG_INFO "卸载texlive-nidanfloat软件包" - dnf remove -y texlive-nidanfloat > /dev/null 2>&1 - CHECK_RESULT $? 0 0 "卸载texlive-nidanfloat失败" - fi - - LOG_INFO "测试完成,环境已恢复" - -} - -main "$@" \ No newline at end of file diff --git a/testcases/function_test/pkg_test/texlive-split-p/texlive-nidanfloat/test_texlive-nidanfloat_function_sideways.sh b/testcases/function_test/pkg_test/texlive-split-p/texlive-nidanfloat/test_texlive-nidanfloat_function_sideways.sh deleted file mode 100644 index 6306b248fb0..00000000000 --- a/testcases/function_test/pkg_test/texlive-split-p/texlive-nidanfloat/test_texlive-nidanfloat_function_sideways.sh +++ /dev/null @@ -1,89 +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-19 -# @License : Mulan PSL v2 -# @Desc : Test sidewaysfloat option -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - LOG_INFO "测试开始: sidewaysfloat选项测试" - - LOG_INFO "步骤1: 检查texlive-nidanfloat软件包是否在yum源中" - dnf list texlive-nidanfloat > /dev/null 2>&1 - if [ $? -ne 0 ]; then - LOG_ERROR "texlive-nidanfloat软件包在yum源中不存在" - exit 255 - fi - - LOG_INFO "步骤2: 检查是否已安装texlive-nidanfloat软件包" - if rpm -q texlive-nidanfloat > /dev/null 2>&1; then - LOG_INFO "texlive-nidanfloat已安装,测试完成后将保持安装状态" - INSTALLED=1 - else - LOG_INFO "texlive-nidanfloat未安装,将进行安装" - INSTALLED=0 - fi - - if [ $INSTALLED -eq 0 ]; then - LOG_INFO "步骤3: 安装texlive-nidanfloat软件包" - dnf install -y texlive-nidanfloat - CHECK_RESULT $? 0 0 "安装texlive-nidanfloat失败" - fi - - LOG_INFO "步骤4: 检查sidewaysfloat选项是否支持" - texdoc -l nidanfloat | grep -q sidewaysfloat - CHECK_RESULT $? 0 0 "sidewaysfloat选项不存在或不支持" - - LOG_INFO "步骤5: 创建测试LaTeX文档" - cat > test_sidewaysfloat.tex << "EOF" - \documentclass{article} - \usepackage{nidanfloat} - \begin{document} - \begin{figure}[sidewaysfloat] - \centering - \rule{5cm}{3cm} - \caption{侧向浮动图示例} - \end{figure} - \end{document} - EOF - CHECK_RESULT $? 0 0 "创建测试文档失败" - - LOG_INFO "步骤6: 使用pdflatex编译测试文档" - pdflatex -interaction=nonstopmode test_sidewaysfloat.tex > /dev/null 2>&1 - CHECK_RESULT $? 0 0 "编译LaTeX文档失败" - - LOG_INFO "步骤7: 检查生成的PDF文件" - if [ -f test_sidewaysfloat.pdf ]; then - LOG_INFO "PDF文件生成成功" - else - LOG_ERROR "PDF文件生成失败" - exit 1 - fi - - LOG_INFO "步骤8: 清理生成的临时文件" - rm -f test_sidewaysfloat.aux test_sidewaysfloat.log test_sidewaysfloat.tex test_sidewaysfloat.pdf - - if [ $INSTALLED -eq 0 ]; then - LOG_INFO "步骤9: 卸载texlive-nidanfloat软件包" - dnf remove -y texlive-nidanfloat - CHECK_RESULT $? 0 0 "卸载texlive-nidanfloat失败" - fi - - LOG_INFO "测试完成: sidewaysfloat选项测试结束" -} - -main "$@" \ No newline at end of file From 14bba7543a80730378092c4fa87631ef16fc067d Mon Sep 17 00:00:00 2001 From: honghua Date: Tue, 21 Apr 2026 13:11:11 +0800 Subject: [PATCH 07/18] update testcase for testsuite texlive-skb-doc --- .../texlive-split-v/texlive-skb-doc.json | 14 ---- ...ive-skb-doc_documentation_offline_links.sh | 73 ---------------- ...est_texlive-skb-doc_documentation_usage.sh | 64 -------------- .../test_texlive-skb-doc_example_usage.sh | 83 ------------------- 4 files changed, 234 deletions(-) delete mode 100644 testcases/function_test/pkg_test/texlive-split-v/texlive-skb-doc/test_texlive-skb-doc_documentation_offline_links.sh delete mode 100644 testcases/function_test/pkg_test/texlive-split-v/texlive-skb-doc/test_texlive-skb-doc_documentation_usage.sh delete mode 100644 testcases/function_test/pkg_test/texlive-split-v/texlive-skb-doc/test_texlive-skb-doc_example_usage.sh diff --git a/suite2cases/function_test/pkg_test/texlive-split-v/texlive-skb-doc.json b/suite2cases/function_test/pkg_test/texlive-split-v/texlive-skb-doc.json index 2b1df275c5b..05d3f4c6dc8 100644 --- a/suite2cases/function_test/pkg_test/texlive-split-v/texlive-skb-doc.json +++ b/suite2cases/function_test/pkg_test/texlive-split-v/texlive-skb-doc.json @@ -7,16 +7,6 @@ "desc": "测试texlive-skb-doc软件包提供的服务日志查看功能,验证服务日志是否正常显示", "machine num": 1 }, - { - "name": "test_texlive-skb-doc_documentation_usage", - "desc": "测试texlive-skb-doc软件包的文档使用功能,验证文档中的使用说明是否完整且可执行", - "machine num": 1 - }, - { - "name": "test_texlive-skb-doc_documentation_offline_links", - "desc": "测试texlive-skb-doc软件包的文档离线链接功能,验证文档在无网络环境下的链接是否有效且无损坏", - "machine num": 1 - }, { "name": "test_texlive-skb-doc_package_install", "desc": "测试 texlive-skb-doc 软件包的安装功能,验证软件包能否通过包管理器成功安装" @@ -32,10 +22,6 @@ { "name": "test_texlive-skb-doc_documentation_integrity", "desc": "测试 texlive-skb-doc 软件包的文档完整性,验证核心文档文件(如README、手册)是否存在且可读" - }, - { - "name": "test_texlive-skb-doc_example_usage", - "desc": "测试 texlive-skb-doc 软件包的示例用法,验证文档中提供的简单示例能否被正确查找和引用" } ] } \ No newline at end of file diff --git a/testcases/function_test/pkg_test/texlive-split-v/texlive-skb-doc/test_texlive-skb-doc_documentation_offline_links.sh b/testcases/function_test/pkg_test/texlive-split-v/texlive-skb-doc/test_texlive-skb-doc_documentation_offline_links.sh deleted file mode 100644 index 568d1d71e5d..00000000000 --- a/testcases/function_test/pkg_test/texlive-split-v/texlive-skb-doc/test_texlive-skb-doc_documentation_offline_links.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 : 2025-07-06 -# @License : Mulan PSL v2 -# @Desc : 测试texlive-skb-doc软件包的文档离线链接功能,验证文档在无网络环境下的链接是否有效且无损坏 -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - LOG_INFO "开始测试texlive-skb-doc软件包的文档离线链接功能" - - # 检查是否已安装texlive-skb-doc - LOG_INFO "检查是否已安装texlive-skb-doc" - rpm -q texlive-skb-doc > /dev/null 2>&1 - if [ $? -eq 0 ]; then - LOG_INFO "texlive-skb-doc已安装,跳过安装步骤" - INSTALLED=1 - else - LOG_INFO "texlive-skb-doc未安装,准备安装" - INSTALLED=0 - fi - - # 检查yum源中是否有texlive-skb-doc - LOG_INFO "检查yum源中是否有texlive-skb-doc" - dnf list available texlive-skb-doc > /dev/null 2>&1 - CHECK_RESULT $? 0 255 "yum源中未找到texlive-skb-doc软件包" - - # 若未安装则安装软件包 - if [ $INSTALLED -eq 0 ]; then - LOG_INFO "开始安装texlive-skb-doc" - dnf install -y texlive-skb-doc > /dev/null 2>&1 - CHECK_RESULT $? 0 0 "安装texlive-skb-doc失败" - fi - - # 验证文档离线链接功能 - LOG_INFO "验证文档离线链接功能" - find /usr/share/doc/texlive-skb-doc -type f -name "*.pdf" | while read file; do - if [ ! -f "$file" ]; then - LOG_ERROR "文档文件不存在: $file" - exit 255 - fi - - file "$file" | grep -q "PDF document" - CHECK_RESULT $? 0 0 "文档文件损坏: $file" - - pdftotext "$file" /dev/null > /dev/null 2>&1 - CHECK_RESULT $? 0 0 "文档内容无法解析: $file" - done - - # 恢复环境 - if [ $INSTALLED -eq 0 ]; then - LOG_INFO "卸载texlive-skb-doc" - dnf remove -y texlive-skb-doc > /dev/null 2>&1 - CHECK_RESULT $? 0 0 "卸载texlive-skb-doc失败" - fi - - LOG_INFO "测试完成,环境已恢复" -} - -main "$@" \ No newline at end of file diff --git a/testcases/function_test/pkg_test/texlive-split-v/texlive-skb-doc/test_texlive-skb-doc_documentation_usage.sh b/testcases/function_test/pkg_test/texlive-split-v/texlive-skb-doc/test_texlive-skb-doc_documentation_usage.sh deleted file mode 100644 index 2ed84e37596..00000000000 --- a/testcases/function_test/pkg_test/texlive-split-v/texlive-skb-doc/test_texlive-skb-doc_documentation_usage.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-07-06 -# @License : Mulan PSL v2 -# @Desc : 测试texlive-skb-doc软件包的文档使用功能,验证文档中的使用说明是否完整且可执行 -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - - # 检查texlive-skb-doc软件包是否已安装 - LOG_INFO "检查texlive-skb-doc软件包是否已安装" - rpm -q texlive-skb-doc - if [ $? -eq 0 ]; then - LOG_INFO "texlive-skb-doc软件包已安装,脚本结束时将保持安装状态" - INSTALLED=true - else - LOG_INFO "texlive-skb-doc软件包未安装,将在测试完成后卸载" - INSTALLED=false - fi - - # 检查yum源中是否存在texlive-skb-doc软件包 - LOG_INFO "检查yum源中是否存在texlive-skb-doc软件包" - dnf list available texlive-skb-doc > /dev/null 2>&1 - CHECK_RESULT $? 0 255 "yum源中不存在texlive-skb-doc软件包" - - # 安装texlive-skb-doc软件包 - if [ "$INSTALLED" = false ]; then - LOG_INFO "开始安装texlive-skb-doc软件包" - dnf install -y texlive-skb-doc - CHECK_RESULT $? 0 0 "安装texlive-skb-doc软件包失败" - fi - - # 验证文档中的使用说明是否完整且可执行 - LOG_INFO "验证texlive-skb-doc文档中的使用说明是否完整且可执行" - # 假设文档中包含一个示例命令skb-example,这里进行测试(具体命令需根据实际文档调整) - skb-example --help > /dev/null 2>&1 - CHECK_RESULT $? 0 255 "文档中的示例命令skb-example不存在或不支持" - - # 清理环境:如果脚本开始时未安装texlive-skb-doc,则在测试完成后卸载 - if [ "$INSTALLED" = false ]; then - LOG_INFO "卸载texlive-skb-doc软件包" - dnf remove -y texlive-skb-doc - CHECK_RESULT $? 0 0 "卸载texlive-skb-doc软件包失败" - fi - - LOG_INFO "测试完成,环境已恢复" - -} - -main "$@" \ No newline at end of file diff --git a/testcases/function_test/pkg_test/texlive-split-v/texlive-skb-doc/test_texlive-skb-doc_example_usage.sh b/testcases/function_test/pkg_test/texlive-split-v/texlive-skb-doc/test_texlive-skb-doc_example_usage.sh deleted file mode 100644 index 97e06413845..00000000000 --- a/testcases/function_test/pkg_test/texlive-split-v/texlive-skb-doc/test_texlive-skb-doc_example_usage.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-02-22 -# @License : Mulan PSL v2 -# @Desc : 测试 texlive-skb-doc 软件包的示例用法,验证文档中提供的简单示例能否被正确查找和引用 -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - # 检查是否已经安装了texlive-skb-doc软件包 - LOG_INFO "检查是否已安装texlive-skb-doc软件包" - rpm -q texlive-skb-doc > /dev/null 2>&1 - if [ $? -eq 0 ]; then - LOG_INFO "texlive-skb-doc软件包已安装" - INSTALLED="yes" - else - LOG_INFO "texlive-skb-doc软件包未安装" - INSTALLED="no" - fi - - # 检查yum源中是否有texlive-skb-doc软件包 - LOG_INFO "检查yum源中是否有texlive-skb-doc软件包" - dnf list available texlive-skb-doc > /dev/null 2>&1 - if [ $? -ne 0 ]; then - LOG_ERROR "yum源中未找到texlive-skb-doc软件包" - exit 255 - fi - - # 如果未安装,则安装软件包 - if [ "$INSTALLED" = "no" ]; then - LOG_INFO "安装texlive-skb-doc软件包" - dnf install -y texlive-skb-doc - CHECK_RESULT $? 0 0 "安装texlive-skb-doc软件包失败" - fi - - # 测试texlive-skb-doc软件包的示例用法 - LOG_INFO "测试texlive-skb-doc软件包的示例用法" - # 查找文档中提供的简单示例 - LOG_INFO "查找文档中提供的简单示例" - find /usr/share/texlive/texmf-dist/doc -name "*.tex" -type f | grep -i skb > /dev/null 2>&1 - CHECK_RESULT $? 0 0 "未找到texlive-skb-doc软件包的示例文件" - - # 验证示例文件能否被正确引用 - LOG_INFO "验证示例文件能否被正确引用" - EXAMPLE_FILE=$(find /usr/share/texlive/texmf-dist/doc -name "*.tex" -type f | grep -i skb | head -1) - if [ -n "$EXAMPLE_FILE" ]; then - LOG_INFO "找到示例文件: $EXAMPLE_FILE" - # 尝试使用latex编译示例文件(仅检查语法,不生成输出) - pdflatex -halt-on-error -interaction=nonstopmode "$EXAMPLE_FILE" > /dev/null 2>&1 - CHECK_RESULT $? 0 0 "示例文件编译失败" - else - LOG_ERROR "未找到有效的示例文件" - exit 255 - fi - - # 清理测试过程中生成的临时文件 - LOG_INFO "清理测试过程中生成的临时文件" - rm -f *.aux *.log *.out *.toc *.nav *.snm *.vrb > /dev/null 2>&1 - - # 如果测试前未安装,则卸载软件包 - if [ "$INSTALLED" = "no" ]; then - LOG_INFO "卸载texlive-skb-doc软件包" - dnf remove -y texlive-skb-doc - CHECK_RESULT $? 0 0 "卸载texlive-skb-doc软件包失败" - fi - - LOG_INFO "测试完成" -} - -main "$@" \ No newline at end of file From 90c11a45624eb9f8572f5ced66618461d3b27efa Mon Sep 17 00:00:00 2001 From: honghua Date: Tue, 21 Apr 2026 13:13:37 +0800 Subject: [PATCH 08/18] update testcase for testsuite texlive-emf --- .../pkg_test/texlive-split-h/texlive-emf.json | 10 --- .../test_texlive-emf_function_convert.sh | 74 ------------------- 2 files changed, 84 deletions(-) delete mode 100644 suite2cases/function_test/pkg_test/texlive-split-h/texlive-emf.json delete mode 100644 testcases/function_test/pkg_test/texlive-split-h/texlive-emf/test_texlive-emf_function_convert.sh diff --git a/suite2cases/function_test/pkg_test/texlive-split-h/texlive-emf.json b/suite2cases/function_test/pkg_test/texlive-split-h/texlive-emf.json deleted file mode 100644 index 649e1bcdfc6..00000000000 --- a/suite2cases/function_test/pkg_test/texlive-split-h/texlive-emf.json +++ /dev/null @@ -1,10 +0,0 @@ -{ - "path": "$OET_PATH/testcases/function_test/pkg_test/texlive-split-h/texlive-emf", - "machine num": 1, - "cases": [ - { - "name": "test_texlive-emf_function_convert", - "desc": "Test conversion of EMF to other formats" - } - ] -} \ No newline at end of file diff --git a/testcases/function_test/pkg_test/texlive-split-h/texlive-emf/test_texlive-emf_function_convert.sh b/testcases/function_test/pkg_test/texlive-split-h/texlive-emf/test_texlive-emf_function_convert.sh deleted file mode 100644 index 7632ec591b7..00000000000 --- a/testcases/function_test/pkg_test/texlive-split-h/texlive-emf/test_texlive-emf_function_convert.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 : 2025-11-26 -# @License : Mulan PSL v2 -# @Desc : Test conversion of EMF to other formats -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - - # 检查是否已安装texlive-emf软件包 - LOG_INFO "检查texlive-emf是否已安装" - if dnf list installed texlive-emf &>/dev/null; then - LOG_INFO "texlive-emf已安装,测试结束后保持安装状态" - INSTALLED=true - else - LOG_INFO "texlive-emf未安装,将在测试结束后卸载" - INSTALLED=false - fi - - # 检查yum源中是否存在texlive-emf软件包 - LOG_INFO "检查yum源中是否存在texlive-emf软件包" - if ! dnf list available texlive-emf &>/dev/null; then - LOG_ERROR "yum源中不存在texlive-emf软件包" - exit 255 - fi - - # 若未安装则安装软件包 - if [ "$INSTALLED" = false ]; then - LOG_INFO "开始安装texlive-emf软件包" - dnf install -y texlive-emf - CHECK_RESULT $? 0 0 "安装texlive-emf失败" - fi - - # 测试EMF转换为其他格式的功能 - LOG_INFO "测试EMF转换为其他格式的功能" - - # 检查emftoeps命令是否存在且支持参数 - LOG_INFO "检查emftoeps命令是否存在且支持参数" - if ! command -v emftoeps &>/dev/null; then - LOG_ERROR "emftoeps命令不存在" - exit 255 - fi - - # 测试转换功能,假设test.emf为测试文件 - LOG_INFO "执行emftoeps命令进行转换" - emftoeps test.emf test.eps - CHECK_RESULT $? 0 0 "EMF转换为EPS失败" - - # 清理环境 - if [ "$INSTALLED" = false ]; then - LOG_INFO "卸载texlive-emf软件包" - dnf remove -y texlive-emf - CHECK_RESULT $? 0 0 "卸载texlive-emf失败" - fi - - LOG_INFO "测试完成,环境已恢复" - -} - -main "$@" \ No newline at end of file From 7f2a7cc7586194c2802b8530773ac13629d30226 Mon Sep 17 00:00:00 2001 From: honghua Date: Tue, 21 Apr 2026 13:13:55 +0800 Subject: [PATCH 09/18] update testcase for testsuite texlive-pstool --- .../texlive-split-s/texlive-pstool.json | 10 --- .../test_texlive-pstool_function_basic.sh | 64 ------------------- 2 files changed, 74 deletions(-) delete mode 100644 suite2cases/function_test/pkg_test/texlive-split-s/texlive-pstool.json delete mode 100644 testcases/function_test/pkg_test/texlive-split-s/texlive-pstool/test_texlive-pstool_function_basic.sh diff --git a/suite2cases/function_test/pkg_test/texlive-split-s/texlive-pstool.json b/suite2cases/function_test/pkg_test/texlive-split-s/texlive-pstool.json deleted file mode 100644 index bf10b4642a1..00000000000 --- a/suite2cases/function_test/pkg_test/texlive-split-s/texlive-pstool.json +++ /dev/null @@ -1,10 +0,0 @@ -{ - "path": "$OET_PATH/testcases/function_test/pkg_test/texlive-split-s/texlive-pstool", - "machine num": 1, - "cases": [ - { - "name": "test_texlive-pstool_function_basic", - "desc": "Basic functionality test" - } - ] -} \ No newline at end of file diff --git a/testcases/function_test/pkg_test/texlive-split-s/texlive-pstool/test_texlive-pstool_function_basic.sh b/testcases/function_test/pkg_test/texlive-split-s/texlive-pstool/test_texlive-pstool_function_basic.sh deleted file mode 100644 index 9b6ad4c1007..00000000000 --- a/testcases/function_test/pkg_test/texlive-split-s/texlive-pstool/test_texlive-pstool_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-11-26 -# @License : Mulan PSL v2 -# @Desc : Basic functionality test -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - - # 检查是否已安装texlive-pstool软件包 - LOG_INFO "检查是否已安装texlive-pstool软件包" - if rpm -q texlive-pstool &>/dev/null; then - LOG_INFO "texlive-pstool已安装,脚本结束时将保持安装状态" - INSTALLED=true - else - LOG_INFO "texlive-pstool未安装,将在测试结束后卸载" - INSTALLED=false - fi - - # 检查yum源中是否有texlive-pstool软件包 - LOG_INFO "检查yum源中是否有texlive-pstool软件包" - if ! dnf list available texlive-pstool &>/dev/null; then - LOG_ERROR "yum源中未找到texlive-pstool软件包" - exit 255 - fi - - # 安装texlive-pstool软件包(如果未安装) - if [ "$INSTALLED" = false ]; then - LOG_INFO "安装texlive-pstool软件包" - dnf install -y texlive-pstool - CHECK_RESULT $? 0 0 "安装texlive-pstool失败" - fi - - # 测试基本功能 - LOG_INFO "测试基本功能" - pstool --version - CHECK_RESULT $? 0 0 "pstool命令执行失败" - - # 清理环境(如果之前未安装) - if [ "$INSTALLED" = false ]; then - LOG_INFO "卸载texlive-pstool软件包" - dnf remove -y texlive-pstool - CHECK_RESULT $? 0 0 "卸载texlive-pstool失败" - fi - - LOG_INFO "Basic functionality test完成" - -} - -main "$@" \ No newline at end of file From 73eea4d2a7900c69ed6027dc559447ffbbbe2c95 Mon Sep 17 00:00:00 2001 From: honghua Date: Tue, 21 Apr 2026 13:14:29 +0800 Subject: [PATCH 10/18] update testcase for testsuite sane-backends --- .../pkg_test/sane-backends/sane-backends.json | 4 -- ...sane-backends_scanimage_accept_md5_only.sh | 67 ------------------- 2 files changed, 71 deletions(-) delete mode 100644 testcases/function_test/pkg_test/sane-backends/sane-backends/test_sane-backends_scanimage_accept_md5_only.sh diff --git a/suite2cases/function_test/pkg_test/sane-backends/sane-backends.json b/suite2cases/function_test/pkg_test/sane-backends/sane-backends.json index c1799f5f768..2b701bb5d9c 100644 --- a/suite2cases/function_test/pkg_test/sane-backends/sane-backends.json +++ b/suite2cases/function_test/pkg_test/sane-backends/sane-backends.json @@ -138,10 +138,6 @@ "name": "test_sane-backends_scanimage_b", "desc": "测试使用-b参数启用批处理扫描模式" }, - { - "name": "test_sane-backends_scanimage_accept_md5_only", - "desc": "测试使用--accept-md5-only参数仅接受使用MD5的授权请求" - }, { "name": "test_sane-backends_scanimage_p", "desc": "测试使用-p参数显示扫描进度信息" diff --git a/testcases/function_test/pkg_test/sane-backends/sane-backends/test_sane-backends_scanimage_accept_md5_only.sh b/testcases/function_test/pkg_test/sane-backends/sane-backends/test_sane-backends_scanimage_accept_md5_only.sh deleted file mode 100644 index 67bb13b88fb..00000000000 --- a/testcases/function_test/pkg_test/sane-backends/sane-backends/test_sane-backends_scanimage_accept_md5_only.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-26 -# @License : Mulan PSL v2 -# @Desc : 测试使用--accept-md5-only参数仅接受使用MD5的授权请求 -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - LOG_INFO "开始测试:测试使用--accept-md5-only参数仅接受使用MD5的授权请求" - - LOG_INFO "步骤1: 检查sane-backends软件包是否在yum源中" - dnf list sane-backends 2>/dev/null | grep -q "sane-backends" - if [ $? -ne 0 ]; then - LOG_ERROR "yum源中未找到sane-backends软件包" - exit 255 - fi - - LOG_INFO "步骤2: 检查scanimage命令是否支持--accept-md5-only参数" - scanimage --help 2>&1 | grep -q -- "--accept-md5-only" - if [ $? -ne 0 ]; then - LOG_ERROR "scanimage命令不支持--accept-md5-only参数" - exit 255 - fi - - LOG_INFO "步骤3: 检查sane-backends是否已安装" - if command -v scanimage &> /dev/null; then - LOG_INFO "sane-backends已安装,测试后保持安装状态" - INSTALLED=true - else - LOG_INFO "sane-backends未安装,将安装软件包作为测试步骤" - INSTALLED=false - LOG_INFO "安装sane-backends软件包" - dnf install -y sane-backends - CHECK_RESULT $? 0 0 "安装sane-backends失败" - fi - - LOG_INFO "步骤4: 执行scanimage命令测试--accept-md5-only参数" - scanimage --accept-md5-only --help 2>&1 | grep -q "accept-md5-only" - CHECK_RESULT $? 0 0 "scanimage命令执行--accept-md5-only参数失败" - - LOG_INFO "步骤5: 清理环境" - if [ "$INSTALLED" = false ]; then - LOG_INFO "卸载sane-backends软件包" - dnf remove -y sane-backends - CHECK_RESULT $? 0 0 "卸载sane-backends失败" - else - LOG_INFO "保持sane-backends安装状态" - fi - - LOG_INFO "测试完成" -} - -main "$@" \ No newline at end of file From f1d3968caf9c38cc584ed289af0959a53bf79b4a Mon Sep 17 00:00:00 2001 From: honghua Date: Tue, 21 Apr 2026 13:16:07 +0800 Subject: [PATCH 11/18] update testcase for testsuite texlive-ebgaramond --- .../texlive-split-h/texlive-ebgaramond.json | 12 -- ...texlive-ebgaramond_function_basic_usage.sh | 109 ------------------ ...t_texlive-ebgaramond_function_uninstall.sh | 74 ------------ ...test_texlive-ebgaramond_function_verify.sh | 105 ----------------- 4 files changed, 300 deletions(-) delete mode 100644 testcases/function_test/pkg_test/texlive-split-h/texlive-ebgaramond/test_texlive-ebgaramond_function_basic_usage.sh delete mode 100644 testcases/function_test/pkg_test/texlive-split-h/texlive-ebgaramond/test_texlive-ebgaramond_function_uninstall.sh delete mode 100644 testcases/function_test/pkg_test/texlive-split-h/texlive-ebgaramond/test_texlive-ebgaramond_function_verify.sh diff --git a/suite2cases/function_test/pkg_test/texlive-split-h/texlive-ebgaramond.json b/suite2cases/function_test/pkg_test/texlive-split-h/texlive-ebgaramond.json index 42ce3cb7744..a841345a93f 100644 --- a/suite2cases/function_test/pkg_test/texlive-split-h/texlive-ebgaramond.json +++ b/suite2cases/function_test/pkg_test/texlive-split-h/texlive-ebgaramond.json @@ -6,18 +6,6 @@ "name": "test_texlive-ebgaramond_function_install", "desc": "Test package installation" }, - { - "name": "test_texlive-ebgaramond_function_uninstall", - "desc": "Test package removal" - }, - { - "name": "test_texlive-ebgaramond_function_verify", - "desc": "Check package availability" - }, - { - "name": "test_texlive-ebgaramond_function_basic_usage", - "desc": "Test basic font usage" - }, { "name": "test_texlive-ebgaramond_function_list_files", "desc": "List installed font files" diff --git a/testcases/function_test/pkg_test/texlive-split-h/texlive-ebgaramond/test_texlive-ebgaramond_function_basic_usage.sh b/testcases/function_test/pkg_test/texlive-split-h/texlive-ebgaramond/test_texlive-ebgaramond_function_basic_usage.sh deleted file mode 100644 index 07578e97cd4..00000000000 --- a/testcases/function_test/pkg_test/texlive-split-h/texlive-ebgaramond/test_texlive-ebgaramond_function_basic_usage.sh +++ /dev/null @@ -1,109 +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-02-24 -# @License : Mulan PSL v2 -# @Desc : Test basic font usage -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - # 环境检查:检查是否已安装texlive-ebgaramond - LOG_INFO "检查是否已安装texlive-ebgaramond" - dnf list installed texlive-ebgaramond > /dev/null 2>&1 - if [ $? -eq 0 ]; then - LOG_INFO "texlive-ebgaramond已安装,脚本结束后将保持安装状态" - ALREADY_INSTALLED=1 - else - LOG_INFO "texlive-ebgaramond未安装,将在测试步骤中安装,并在脚本结束前卸载" - ALREADY_INSTALLED=0 - fi - - # 检查yum源中是否有texlive-ebgaramond软件包 - LOG_INFO "检查yum源中是否有texlive-ebgaramond软件包" - dnf list available texlive-ebgaramond > /dev/null 2>&1 - CHECK_RESULT $? 0 0 "yum源中未找到texlive-ebgaramond软件包" - if [ $? -ne 0 ]; then - LOG_ERROR "yum源中未找到texlive-ebgaramond软件包,退出测试" - exit 255 - fi - - # 如果未安装,则安装texlive-ebgaramond - if [ $ALREADY_INSTALLED -eq 0 ]; then - LOG_INFO "安装texlive-ebgaramond软件包" - dnf install -y texlive-ebgaramond - CHECK_RESULT $? 0 0 "安装texlive-ebgaramond失败" - fi - - # 测试基本字体使用:检查字体文件是否存在 - LOG_INFO "测试基本字体使用:检查字体文件是否存在" - FONT_FILE=$(find /usr/share/texlive/texmf-dist -name "ebgaramond.sty" -o -name "ebgaramond*.sty" 2>/dev/null | head -1) - if [ -z "$FONT_FILE" ]; then - FONT_FILE=$(find /usr/share/texmf -name "ebgaramond.sty" -o -name "ebgaramond*.sty" 2>/dev/null | head -1) - fi - if [ -n "$FONT_FILE" ]; then - LOG_INFO "找到字体文件:$FONT_FILE" - CHECK_RESULT $? 0 0 "未找到ebgaramond字体文件" - else - LOG_ERROR "未找到ebgaramond字体文件" - CHECK_RESULT 1 0 0 "未找到ebgaramond字体文件" - fi - - # 测试基本字体使用:创建一个简单的LaTeX文档测试字体 - LOG_INFO "测试基本字体使用:创建一个简单的LaTeX文档测试字体" - TEST_TEX_FILE="/tmp/test_ebgaramond.tex" - cat > $TEST_TEX_FILE << "EOF" - \documentclass{article} - \usepackage{ebgaramond} - \begin{document} - This is a test document using EB Garamond font. - \end{document} - EOF - CHECK_RESULT $? 0 0 "创建测试LaTeX文档失败" - - # 尝试编译LaTeX文档(如果pdflatex可用) - LOG_INFO "测试基本字体使用:尝试编译LaTeX文档" - if command -v pdflatex >/dev/null 2>&1; then - pdflatex -interaction=nonstopmode $TEST_TEX_FILE > /tmp/tex_compile.log 2>&1 - TEX_RESULT=$? - if [ $TEX_RESULT -eq 0 ]; then - LOG_INFO "LaTeX文档编译成功" - CHECK_RESULT 0 0 0 "LaTeX文档编译失败" - # 清理生成的临时文件 - rm -f /tmp/test_ebgaramond.aux /tmp/test_ebgaramond.log /tmp/test_ebgaramond.pdf - else - LOG_INFO "LaTeX文档编译失败,但这可能是由于缺少其他LaTeX包,不视为测试失败" - LOG_INFO "编译日志:" - cat /tmp/tex_compile.log - fi - else - LOG_INFO "未找到pdflatex命令,跳过编译测试" - fi - - # 清理临时文件 - LOG_INFO "清理临时文件" - rm -f $TEST_TEX_FILE /tmp/tex_compile.log - - # 环境恢复:如果脚本开始时未安装,则卸载软件包 - if [ $ALREADY_INSTALLED -eq 0 ]; then - LOG_INFO "卸载texlive-ebgaramond软件包" - dnf remove -y texlive-ebgaramond - CHECK_RESULT $? 0 0 "卸载texlive-ebgaramond失败" - fi - - LOG_INFO "测试完成" -} - -main "$@" \ No newline at end of file diff --git a/testcases/function_test/pkg_test/texlive-split-h/texlive-ebgaramond/test_texlive-ebgaramond_function_uninstall.sh b/testcases/function_test/pkg_test/texlive-split-h/texlive-ebgaramond/test_texlive-ebgaramond_function_uninstall.sh deleted file mode 100644 index 79cf69b7db4..00000000000 --- a/testcases/function_test/pkg_test/texlive-split-h/texlive-ebgaramond/test_texlive-ebgaramond_function_uninstall.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-02-24 -# @License : Mulan PSL v2 -# @Desc : Test package removal -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - set -e - - LOG_INFO "开始测试texlive-ebgaramond软件包卸载功能" - - LOG_INFO "1. 检查yum源中是否存在texlive-ebgaramond软件包" - dnf list available texlive-ebgaramond &>/dev/null - if [ $? -ne 0 ]; then - LOG_ERROR "yum源中未找到texlive-ebgaramond软件包" - exit 255 - fi - - LOG_INFO "2. 检查当前环境是否已安装texlive-ebgaramond软件包" - if rpm -q texlive-ebgaramond &>/dev/null; then - LOG_INFO "检测到texlive-ebgaramond已安装,测试后将保持安装状态" - WAS_INSTALLED=true - else - LOG_INFO "检测到texlive-ebgaramond未安装,将执行安装作为测试步骤" - WAS_INSTALLED=false - fi - - if [ "$WAS_INSTALLED" = "false" ]; then - LOG_INFO "3. 安装texlive-ebgaramond软件包" - dnf install -y texlive-ebgaramond - CHECK_RESULT $? 0 0 "安装texlive-ebgaramond软件包失败" - fi - - LOG_INFO "4. 验证软件包安装成功" - rpm -q texlive-ebgaramond - CHECK_RESULT $? 0 0 "验证texlive-ebgaramond软件包安装状态失败" - - LOG_INFO "5. 执行软件包卸载操作" - dnf remove -y texlive-ebgaramond - CHECK_RESULT $? 0 0 "卸载texlive-ebgaramond软件包失败" - - LOG_INFO "6. 验证软件包已成功卸载" - rpm -q texlive-ebgaramond &>/dev/null - CHECK_RESULT $? 1 0 "卸载后验证texlive-ebgaramond软件包状态失败,软件包可能未被正确移除" - - LOG_INFO "7. 根据初始状态恢复环境" - if [ "$WAS_INSTALLED" = "true" ]; then - LOG_INFO "初始状态为已安装,重新安装texlive-ebgaramond软件包" - dnf install -y texlive-ebgaramond - CHECK_RESULT $? 0 0 "重新安装texlive-ebgaramond软件包失败" - 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-h/texlive-ebgaramond/test_texlive-ebgaramond_function_verify.sh b/testcases/function_test/pkg_test/texlive-split-h/texlive-ebgaramond/test_texlive-ebgaramond_function_verify.sh deleted file mode 100644 index fdf50f73a78..00000000000 --- a/testcases/function_test/pkg_test/texlive-split-h/texlive-ebgaramond/test_texlive-ebgaramond_function_verify.sh +++ /dev/null @@ -1,105 +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-02-24 -# @License : Mulan PSL v2 -# @Desc : Check package availability -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - LOG_INFO "开始测试:检查texlive-ebgaramond软件包可用性" - LOG_INFO "步骤1:检查yum源中是否存在texlive-ebgaramond软件包" - if ! dnf list available texlive-ebgaramond &>/dev/null; then - LOG_ERROR "texlive-ebgaramond软件包在yum源中不存在" - exit 255 - fi - LOG_INFO "texlive-ebgaramond软件包在yum源中存在" - - LOG_INFO "步骤2:检查系统是否已安装texlive-ebgaramond" - if rpm -q texlive-ebgaramond &>/dev/null; then - LOG_INFO "texlive-ebgaramond已安装,测试后将保持安装状态" - INSTALLED=true - else - LOG_INFO "texlive-ebgaramond未安装,将进行安装测试" - INSTALLED=false - fi - - if [ "$INSTALLED" = false ]; then - LOG_INFO "步骤3:安装texlive-ebgaramond软件包" - dnf install -y texlive-ebgaramond - CHECK_RESULT $? 0 0 "安装texlive-ebgaramond失败" - LOG_INFO "texlive-ebgaramond安装成功" - fi - - LOG_INFO "步骤4:验证texlive-ebgaramond基本功能" - LOG_INFO "检查texlive-ebgaramond提供的字体文件" - if [ -d /usr/share/texlive/texmf-dist/fonts/opentype/public/ebgaramond ]; then - LOG_INFO "找到ebgaramond字体目录" - FONT_COUNT=$(find /usr/share/texlive/texmf-dist/fonts/opentype/public/ebgaramond -name "*.otf" | wc -l) - if [ "$FONT_COUNT" -gt 0 ]; then - LOG_INFO "发现 $FONT_COUNT 个.otf字体文件" - else - LOG_ERROR "未找到.otf字体文件" - CHECK_RESULT 1 0 0 "字体文件验证失败" - fi - else - LOG_ERROR "未找到ebgaramond字体目录" - CHECK_RESULT 1 0 0 "字体目录验证失败" - fi - - LOG_INFO "步骤5:测试texlive-ebgaramond在LaTeX中的使用" - TEST_FILE="/tmp/test_ebgaramond.tex" - cat > "$TEST_FILE" << "EOF" - \documentclass{article} - \usepackage{ebgaramond} - \begin{document} - Test document using EB Garamond font. - \end{document} - EOF - - if command -v pdflatex &>/dev/null; then - LOG_INFO "使用pdflatex编译测试文档" - pdflatex -interaction=nonstopmode "$TEST_FILE" &>/tmp/tex_output.log - TEX_RESULT=$? - if [ $TEX_RESULT -eq 0 ]; then - LOG_INFO "LaTeX编译成功" - if [ -f "test_ebgaramond.pdf" ]; then - LOG_INFO "成功生成PDF文档" - rm -f test_ebgaramond.pdf test_ebgaramond.aux test_ebgaramond.log - fi - else - LOG_ERROR "LaTeX编译失败" - cat /tmp/tex_output.log - CHECK_RESULT $TEX_RESULT 0 0 "LaTeX编译测试失败" - fi - else - LOG_INFO "pdflatex未安装,跳过LaTeX编译测试" - fi - rm -f "$TEST_FILE" - - if [ "$INSTALLED" = false ]; then - LOG_INFO "步骤6:清理环境,卸载texlive-ebgaramond" - dnf remove -y texlive-ebgaramond - CHECK_RESULT $? 0 0 "卸载texlive-ebgaramond失败" - LOG_INFO "texlive-ebgaramond卸载成功" - else - LOG_INFO "步骤6:保持texlive-ebgaramond安装状态" - fi - - LOG_INFO "测试完成:texlive-ebgaramond软件包可用性验证通过" -} - -main "$@" \ No newline at end of file From 350d093ccf4623fc7c7617fe9913d47774114efe Mon Sep 17 00:00:00 2001 From: honghua Date: Tue, 21 Apr 2026 13:16:17 +0800 Subject: [PATCH 12/18] update testcase for testsuite metrics-javadoc --- .../pkg_test/metrics/metrics-javadoc.json | 29 ---- .../test_metrics-javadoc_function_install.sh | 67 -------- ...test_metrics-javadoc_function_integrity.sh | 126 --------------- ...test_metrics-javadoc_function_uninstall.sh | 106 ------------- .../test_metrics-javadoc_function_upgrade.sh | 145 ------------------ .../test_metrics-javadoc_function_usage.sh | 102 ------------ .../test_metrics-javadoc_function_verify.sh | 117 -------------- .../test_metrics-javadoc_rollback.sh | 66 -------- 8 files changed, 758 deletions(-) delete mode 100644 testcases/function_test/pkg_test/metrics/metrics-javadoc/test_metrics-javadoc_function_install.sh delete mode 100644 testcases/function_test/pkg_test/metrics/metrics-javadoc/test_metrics-javadoc_function_integrity.sh delete mode 100644 testcases/function_test/pkg_test/metrics/metrics-javadoc/test_metrics-javadoc_function_uninstall.sh delete mode 100644 testcases/function_test/pkg_test/metrics/metrics-javadoc/test_metrics-javadoc_function_upgrade.sh delete mode 100644 testcases/function_test/pkg_test/metrics/metrics-javadoc/test_metrics-javadoc_function_usage.sh delete mode 100644 testcases/function_test/pkg_test/metrics/metrics-javadoc/test_metrics-javadoc_function_verify.sh delete mode 100644 testcases/function_test/pkg_test/metrics/metrics-javadoc/test_metrics-javadoc_rollback.sh diff --git a/suite2cases/function_test/pkg_test/metrics/metrics-javadoc.json b/suite2cases/function_test/pkg_test/metrics/metrics-javadoc.json index b9de7fc230c..716ea33fed8 100644 --- a/suite2cases/function_test/pkg_test/metrics/metrics-javadoc.json +++ b/suite2cases/function_test/pkg_test/metrics/metrics-javadoc.json @@ -6,35 +6,6 @@ "name": "test_metrics-javadoc_uninstall", "desc": "测试metrics-javadoc软件包的卸载功能,验证卸载过程是否正常完成。", "machine num": 1 - }, - { - "name": "test_metrics-javadoc_rollback", - "desc": "测试metrics-javadoc软件包的回滚功能,验证回滚过程是否正常完成。", - "machine num": 1 - }, - { - "name": "test_metrics-javadoc_function_install", - "desc": "测试metrics-javadoc软件包的安装功能,验证安装过程是否正常完成。" - }, - { - "name": "test_metrics-javadoc_function_uninstall", - "desc": "测试metrics-javadoc软件包的卸载功能,验证卸载过程是否正常完成,并确认软件包及其相关文件被完全移除。" - }, - { - "name": "test_metrics-javadoc_function_verify", - "desc": "验证metrics-javadoc软件包是否已正确安装且版本信息与预期一致。" - }, - { - "name": "test_metrics-javadoc_function_usage", - "desc": "测试metrics-javadoc软件包的基本用法,例如生成或查看项目的Javadoc文档,验证其核心功能是否正常工作。" - }, - { - "name": "test_metrics-javadoc_function_upgrade", - "desc": "测试metrics-javadoc软件包的升级功能,验证从旧版本升级到新版本的过程是否平滑且功能正常。" - }, - { - "name": "test_metrics-javadoc_function_integrity", - "desc": "测试metrics-javadoc软件包安装后的文件完整性,确保所有必要的文件都已存在且未被损坏。" } ] } \ No newline at end of file diff --git a/testcases/function_test/pkg_test/metrics/metrics-javadoc/test_metrics-javadoc_function_install.sh b/testcases/function_test/pkg_test/metrics/metrics-javadoc/test_metrics-javadoc_function_install.sh deleted file mode 100644 index 871ec8f1e9b..00000000000 --- a/testcases/function_test/pkg_test/metrics/metrics-javadoc/test_metrics-javadoc_function_install.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 : 2025-12-07 -# @License : Mulan PSL v2 -# @Desc : 测试metrics-javadoc软件包的安装功能,验证安装过程是否正常完成。 -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - - LOG_INFO "开始测试metrics-javadoc软件包的安装功能" - - # 检查yum源中是否存在metrics-javadoc软件包 - LOG_INFO "检查yum源中是否存在metrics-javadoc软件包" - dnf list available metrics-javadoc >/dev/null 2>&1 - if [ $? -ne 0 ]; then - LOG_ERROR "yum源中未找到metrics-javadoc软件包" - exit 255 - fi - - # 检查是否已安装metrics-javadoc软件包 - LOG_INFO "检查是否已安装metrics-javadoc软件包" - rpm -q metrics-javadoc >/dev/null 2>&1 - if [ $? -eq 0 ]; then - LOG_INFO "metrics-javadoc软件包已安装,跳过安装步骤" - installed=true - else - LOG_INFO "metrics-javadoc软件包未安装,开始安装" - installed=false - fi - - # 如果未安装,则执行安装 - if [ "$installed" = false ]; then - LOG_INFO "开始安装metrics-javadoc软件包" - dnf install -y metrics-javadoc >/dev/null 2>&1 - CHECK_RESULT $? 0 0 "安装metrics-javadoc软件包失败" - fi - - # 验证安装是否成功 - LOG_INFO "验证metrics-javadoc软件包是否安装成功" - rpm -q metrics-javadoc >/dev/null 2>&1 - CHECK_RESULT $? 0 0 "metrics-javadoc软件包未正确安装" - - # 如果脚本开始时未安装,则在结束时卸载 - if [ "$installed" = false ]; then - LOG_INFO "卸载metrics-javadoc软件包以恢复环境" - dnf remove -y metrics-javadoc >/dev/null 2>&1 - CHECK_RESULT $? 0 0 "卸载metrics-javadoc软件包失败" - fi - - LOG_INFO "测试完成,环境已恢复" -} - -main "$@" \ No newline at end of file diff --git a/testcases/function_test/pkg_test/metrics/metrics-javadoc/test_metrics-javadoc_function_integrity.sh b/testcases/function_test/pkg_test/metrics/metrics-javadoc/test_metrics-javadoc_function_integrity.sh deleted file mode 100644 index 22deb975cda..00000000000 --- a/testcases/function_test/pkg_test/metrics/metrics-javadoc/test_metrics-javadoc_function_integrity.sh +++ /dev/null @@ -1,126 +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-15 -# @License : Mulan PSL v2 -# @Desc : 测试metrics-javadoc软件包安装后的文件完整性,确保所有必要的文件都已存在且未被损坏。 -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - # 定义全局变量 - PACKAGE_NAME="metrics-javadoc" - LOG_INFO() { - echo "[INFO] $1" - } - LOG_ERROR() { - echo "[ERROR] $1" - } - # 检查软件包是否在yum源中 - check_package_in_repo() { - LOG_INFO "检查yum源中是否存在$PACKAGE_NAME软件包" - dnf list available "$PACKAGE_NAME" &>/dev/null - if [ $? -ne 0 ]; then - LOG_ERROR "yum源中不存在$PACKAGE_NAME软件包" - exit 255 - fi - LOG_INFO "yum源中存在$PACKAGE_NAME软件包" - } - # 检查命令参数是否存在或不支持 - check_command_param() { - local cmd=$1 - local param=$2 - LOG_INFO "检查命令$cmd是否支持参数$param" - $cmd --help 2>&1 | grep -q "$param" - if [ $? -ne 0 ]; then - LOG_ERROR "命令$cmd不支持参数$param" - exit 255 - fi - LOG_INFO "命令$cmd支持参数$param" - } - # 安装软件包 - install_package() { - LOG_INFO "安装$PACKAGE_NAME软件包" - dnf install -y "$PACKAGE_NAME" - CHECK_RESULT $? 0 0 "安装$PACKAGE_NAME软件包失败" - LOG_INFO "$PACKAGE_NAME软件包安装成功" - } - # 卸载软件包 - uninstall_package() { - LOG_INFO "卸载$PACKAGE_NAME软件包" - dnf remove -y "$PACKAGE_NAME" - CHECK_RESULT $? 0 0 "卸载$PACKAGE_NAME软件包失败" - LOG_INFO "$PACKAGE_NAME软件包卸载成功" - } - # 检查软件包是否已安装 - is_package_installed() { - rpm -q "$PACKAGE_NAME" &>/dev/null - return $? - } - # 测试文件完整性 - test_file_integrity() { - LOG_INFO "测试$PACKAGE_NAME软件包安装后的文件完整性" - # 获取软件包安装的文件列表 - local file_list=$(rpm -ql "$PACKAGE_NAME") - CHECK_RESULT $? 0 0 "获取$PACKAGE_NAME软件包文件列表失败" - # 检查每个文件是否存在且未被损坏 - for file in $file_list; do - if [ -e "$file" ]; then - LOG_INFO "文件$file存在" - # 检查文件是否损坏(通过md5sum校验) - rpm -V "$PACKAGE_NAME" | grep -q "$file" - if [ $? -eq 0 ]; then - LOG_ERROR "文件$file可能已被损坏" - exit 1 - fi - else - LOG_ERROR "文件$file不存在" - exit 1 - fi - done - LOG_INFO "$PACKAGE_NAME软件包所有文件均存在且未被损坏" - } - # 主函数 - main() { - LOG_INFO "开始测试metrics-javadoc软件包安装后的文件完整性" - # 检查yum源中是否存在该软件包 - check_package_in_repo - # 检查命令参数是否存在或不支持(示例:检查dnf命令是否支持install参数) - check_command_param dnf install - # 判断环境是否已经安装 - local was_installed=false - if is_package_installed; then - LOG_INFO "$PACKAGE_NAME软件包已安装" - was_installed=true - else - LOG_INFO "$PACKAGE_NAME软件包未安装" - # 安装软件包作为测试步骤 - install_package - fi - # 测试文件完整性 - test_file_integrity - # 清理环境,恢复到之前的状态 - if [ "$was_installed" = false ]; then - uninstall_package - else - LOG_INFO "保持$PACKAGE_NAME软件包安装状态" - fi - LOG_INFO "测试metrics-javadoc软件包安装后的文件完整性完成" - } - # 执行主函数 - main -} - -main "$@" \ No newline at end of file diff --git a/testcases/function_test/pkg_test/metrics/metrics-javadoc/test_metrics-javadoc_function_uninstall.sh b/testcases/function_test/pkg_test/metrics/metrics-javadoc/test_metrics-javadoc_function_uninstall.sh deleted file mode 100644 index 5ef019d41c1..00000000000 --- a/testcases/function_test/pkg_test/metrics/metrics-javadoc/test_metrics-javadoc_function_uninstall.sh +++ /dev/null @@ -1,106 +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-15 -# @License : Mulan PSL v2 -# @Desc : 测试metrics-javadoc软件包的卸载功能,验证卸载过程是否正常完成,并确认软件包及其相关文件被完全移除。 -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - # 检查是否已安装metrics-javadoc - LOG_INFO "检查是否已安装metrics-javadoc软件包" - rpm -q metrics-javadoc > /dev/null 2>&1 - if [ $? -eq 0 ]; then - already_installed=true - LOG_INFO "检测到metrics-javadoc已安装,脚本结束后将保持安装状态" - else - already_installed=false - LOG_INFO "未检测到metrics-javadoc安装,将在测试过程中安装并最终卸载" - fi - - # 检查yum源中是否有metrics-javadoc软件包 - LOG_INFO "检查yum源中是否有metrics-javadoc软件包" - dnf list available metrics-javadoc > /dev/null 2>&1 - if [ $? -ne 0 ]; then - LOG_ERROR "yum源中未找到metrics-javadoc软件包" - exit 255 - fi - - # 如果未安装,则安装metrics-javadoc - if [ "$already_installed" = false ]; then - LOG_INFO "开始安装metrics-javadoc软件包" - dnf install -y metrics-javadoc - CHECK_RESULT $? 0 0 "metrics-javadoc安装失败" - LOG_INFO "metrics-javadoc软件包安装成功" - fi - - # 验证软件包是否已安装 - LOG_INFO "验证metrics-javadoc软件包是否已安装" - rpm -q metrics-javadoc > /dev/null 2>&1 - CHECK_RESULT $? 0 0 "metrics-javadoc软件包未正确安装" - - # 查找软件包安装的文件 - LOG_INFO "查找metrics-javadoc软件包安装的文件" - installed_files=$(rpm -ql metrics-javadoc 2>/dev/null) - if [ $? -eq 0 ]; then - LOG_INFO "metrics-javadoc软件包安装的文件列表:" - echo "$installed_files" | head -10 - if [ -n "$installed_files" ]; then - # 随机选择一个文件验证存在性 - sample_file=$(echo "$installed_files" | head -1) - LOG_INFO "检查示例文件是否存在: $sample_file" - [ -e "$sample_file" ] - CHECK_RESULT $? 0 0 "metrics-javadoc安装的文件不存在" - fi - fi - - # 执行卸载测试 - LOG_INFO "开始卸载metrics-javadoc软件包" - dnf remove -y metrics-javadoc - CHECK_RESULT $? 0 0 "metrics-javadoc卸载失败" - LOG_INFO "metrics-javadoc软件包卸载成功" - - # 验证软件包是否已卸载 - LOG_INFO "验证metrics-javadoc软件包是否已完全卸载" - rpm -q metrics-javadoc > /dev/null 2>&1 - CHECK_RESULT $? 1 0 "metrics-javadoc软件包卸载后仍然存在" - - # 验证相关文件是否已移除 - LOG_INFO "验证metrics-javadoc相关文件是否已移除" - if [ -n "$installed_files" ]; then - for file in $installed_files; do - if [ -e "$file" ]; then - LOG_ERROR "文件未被正确移除: $file" - exit 1 - fi - done - LOG_INFO "所有metrics-javadoc相关文件均已成功移除" - fi - - # 环境恢复:如果测试前未安装,则保持未安装状态;如果测试前已安装,则重新安装 - if [ "$already_installed" = true ]; then - LOG_INFO "恢复原始环境:重新安装metrics-javadoc软件包" - dnf install -y metrics-javadoc - CHECK_RESULT $? 0 0 "metrics-javadoc重新安装失败" - LOG_INFO "metrics-javadoc软件包已重新安装,环境已恢复" - else - LOG_INFO "环境已恢复:metrics-javadoc软件包保持未安装状态" - fi - - LOG_INFO "metrics-javadoc软件包卸载功能测试完成" -} - -main "$@" \ No newline at end of file diff --git a/testcases/function_test/pkg_test/metrics/metrics-javadoc/test_metrics-javadoc_function_upgrade.sh b/testcases/function_test/pkg_test/metrics/metrics-javadoc/test_metrics-javadoc_function_upgrade.sh deleted file mode 100644 index 8137dceaf12..00000000000 --- a/testcases/function_test/pkg_test/metrics/metrics-javadoc/test_metrics-javadoc_function_upgrade.sh +++ /dev/null @@ -1,145 +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-15 -# @License : Mulan PSL v2 -# @Desc : 测试metrics-javadoc软件包的升级功能,验证从旧版本升级到新版本的过程是否平滑且功能正常。 -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - # 定义颜色变量(可选,用于日志高亮) - RED="\033[0;31m" - GREEN="\033[0;32m" - YELLOW="\033[1;33m" - NC="\033[0m" # No Color - - # 定义软件包名称 - PACKAGE_NAME="metrics-javadoc" - - # 检查软件包是否存在于yum源中 - LOG_INFO "步骤1:检查yum源中是否存在 ${PACKAGE_NAME} 软件包" - if ! dnf list available ${PACKAGE_NAME} &>/dev/null; then - LOG_ERROR "错误:yum源中未找到 ${PACKAGE_NAME} 软件包" - exit 255 - fi - LOG_INFO "软件包 ${PACKAGE_NAME} 存在于yum源中" - - # 检查当前是否已安装软件包 - LOG_INFO "步骤2:检查当前是否已安装 ${PACKAGE_NAME} 软件包" - if rpm -q ${PACKAGE_NAME} &>/dev/null; then - LOG_INFO "软件包 ${PACKAGE_NAME} 已安装,脚本结束后将保持安装状态" - ALREADY_INSTALLED=true - else - LOG_INFO "软件包 ${PACKAGE_NAME} 未安装,将在测试过程中安装并在结束后卸载" - ALREADY_INSTALLED=false - fi - - # 获取当前安装的版本(如果已安装) - if ${ALREADY_INSTALLED}; then - LOG_INFO "步骤3:获取当前已安装的 ${PACKAGE_NAME} 版本" - CURRENT_VERSION=$(rpm -q --queryformat "%{VERSION}-%{RELEASE}" ${PACKAGE_NAME}) - CHECK_RESULT $? 0 0 "获取当前版本失败" - LOG_INFO "当前安装版本:${CURRENT_VERSION}" - fi - - # 检查可用的最新版本 - LOG_INFO "步骤4:检查yum源中 ${PACKAGE_NAME} 的最新可用版本" - AVAILABLE_VERSION=$(dnf list available ${PACKAGE_NAME} | tail -1 | awk "{print $2}") - CHECK_RESULT $? 0 0 "获取可用版本失败" - LOG_INFO "可用最新版本:${AVAILABLE_VERSION}" - - # 如果已安装版本与可用版本相同,则无需升级 - if ${ALREADY_INSTALLED} && [ "${CURRENT_VERSION}" = "${AVAILABLE_VERSION}" ]; then - LOG_INFO "当前已安装最新版本,无需升级,测试通过" - exit 0 - fi - - # 如果未安装,则安装旧版本进行升级测试 - if ! ${ALREADY_INSTALLED}; then - LOG_INFO "步骤5:安装旧版本 ${PACKAGE_NAME} 以进行升级测试" - # 这里假设我们可以通过指定版本号安装旧版本,实际情况可能需要从特定仓库安装 - # 如果没有旧版本可安装,则跳过升级测试,直接安装最新版本并验证功能 - OLD_VERSION="1.0.0" # 假设的旧版本号,实际应根据仓库中的版本调整 - if dnf list available ${PACKAGE_NAME}-${OLD_VERSION} &>/dev/null; then - dnf install -y ${PACKAGE_NAME}-${OLD_VERSION} - CHECK_RESULT $? 0 0 "安装旧版本失败" - LOG_INFO "成功安装旧版本:${OLD_VERSION}" - else - LOG_INFO "未找到指定的旧版本,将直接安装最新版本并验证功能" - dnf install -y ${PACKAGE_NAME} - CHECK_RESULT $? 0 0 "安装最新版本失败" - LOG_INFO "成功安装最新版本:${AVAILABLE_VERSION}" - # 验证功能 - LOG_INFO "步骤6:验证 ${PACKAGE_NAME} 基本功能" - # 这里假设软件包提供了一个可执行命令或可以通过其他方式验证 - # 例如:运行 metrics-javadoc --help 检查是否正常 - if command -v metrics-javadoc &>/dev/null; then - metrics-javadoc --help &>/dev/null - CHECK_RESULT $? 0 0 "软件包功能验证失败" - LOG_INFO "软件包功能正常" - else - LOG_INFO "软件包未提供可执行命令,功能验证跳过" - fi - # 卸载软件包 - LOG_INFO "步骤7:卸载 ${PACKAGE_NAME} 软件包" - dnf remove -y ${PACKAGE_NAME} - CHECK_RESULT $? 0 0 "卸载软件包失败" - LOG_INFO "软件包卸载成功" - exit 0 - fi - fi - - # 执行升级操作 - LOG_INFO "步骤5:执行升级 ${PACKAGE_NAME} 到最新版本" - dnf upgrade -y ${PACKAGE_NAME} - CHECK_RESULT $? 0 0 "升级软件包失败" - LOG_INFO "软件包升级成功" - - # 验证升级后的版本 - LOG_INFO "步骤6:验证升级后的版本" - UPGRADED_VERSION=$(rpm -q --queryformat "%{VERSION}-%{RELEASE}" ${PACKAGE_NAME}) - CHECK_RESULT $? 0 0 "获取升级后版本失败" - if [ "${UPGRADED_VERSION}" = "${AVAILABLE_VERSION}" ]; then - LOG_INFO "升级后版本正确:${UPGRADED_VERSION}" - else - LOG_ERROR "升级后版本不正确,当前:${UPGRADED_VERSION},期望:${AVAILABLE_VERSION}" - exit 1 - fi - - # 验证升级后的功能 - LOG_INFO "步骤7:验证升级后 ${PACKAGE_NAME} 的基本功能" - if command -v metrics-javadoc &>/dev/null; then - metrics-javadoc --help &>/dev/null - CHECK_RESULT $? 0 0 "升级后软件包功能验证失败" - LOG_INFO "升级后软件包功能正常" - else - LOG_INFO "软件包未提供可执行命令,功能验证跳过" - fi - - # 环境恢复:如果测试前未安装,则卸载软件包 - if ! ${ALREADY_INSTALLED}; then - LOG_INFO "步骤8:恢复环境,卸载 ${PACKAGE_NAME} 软件包" - dnf remove -y ${PACKAGE_NAME} - CHECK_RESULT $? 0 0 "卸载软件包失败" - LOG_INFO "环境恢复成功,软件包已卸载" - else - LOG_INFO "步骤8:保持 ${PACKAGE_NAME} 软件包安装状态,无需恢复" - fi - - LOG_INFO "测试完成:${PACKAGE_NAME} 软件包升级功能验证通过" -} - -main "$@" \ No newline at end of file diff --git a/testcases/function_test/pkg_test/metrics/metrics-javadoc/test_metrics-javadoc_function_usage.sh b/testcases/function_test/pkg_test/metrics/metrics-javadoc/test_metrics-javadoc_function_usage.sh deleted file mode 100644 index d75085ef57e..00000000000 --- a/testcases/function_test/pkg_test/metrics/metrics-javadoc/test_metrics-javadoc_function_usage.sh +++ /dev/null @@ -1,102 +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-15 -# @License : Mulan PSL v2 -# @Desc : 测试metrics-javadoc软件包的基本用法,例如生成或查看项目的Javadoc文档,验证其核心功能是否正常工作。 -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - LOG_INFO "开始测试 metrics-javadoc 软件包的基本用法" - LOG_INFO "步骤1: 检查是否已安装 metrics-javadoc 软件包" - rpm -q metrics-javadoc > /dev/null 2>&1 - if [ $? -eq 0 ]; then - LOG_INFO "metrics-javadoc 软件包已安装,脚本结束后将保持安装状态" - already_installed=true - else - LOG_INFO "metrics-javadoc 软件包未安装,将在测试过程中安装" - already_installed=false - fi - - LOG_INFO "步骤2: 检查 yum 源中是否存在 metrics-javadoc 软件包" - dnf list available metrics-javadoc > /dev/null 2>&1 - if [ $? -ne 0 ]; then - LOG_ERROR "yum 源中未找到 metrics-javadoc 软件包" - exit 255 - fi - - if [ "$already_installed" = "false" ]; then - LOG_INFO "步骤3: 安装 metrics-javadoc 软件包" - dnf install -y metrics-javadoc - CHECK_RESULT $? 0 0 "安装 metrics-javadoc 软件包失败" - fi - - LOG_INFO "步骤4: 检查 metrics-javadoc 命令是否可用" - which metrics-javadoc > /dev/null 2>&1 - CHECK_RESULT $? 0 0 "metrics-javadoc 命令未找到" - - LOG_INFO "步骤5: 测试 metrics-javadoc 命令的基本参数(例如查看帮助)" - metrics-javadoc --help > /dev/null 2>&1 - if [ $? -ne 0 ]; then - LOG_ERROR "metrics-javadoc 命令不支持 --help 参数或执行失败" - exit 255 - fi - CHECK_RESULT $? 0 0 "执行 metrics-javadoc --help 失败" - - LOG_INFO "步骤6: 验证 metrics-javadoc 核心功能(示例:生成一个简单项目的 Javadoc)" - test_project_dir="/tmp/test_metrics_javadoc_project" - mkdir -p "$test_project_dir" - cat > "$test_project_dir/Test.java" << "EOF" - /** - * 测试类 - */ - public class Test { - /** - * 主方法 - * @param args 参数 - */ - public static void main(String[] args) { - System.out.println("Hello, metrics-javadoc!"); - } - } - EOF - cd "$test_project_dir" - metrics-javadoc Test.java -d ./doc > /dev/null 2>&1 - CHECK_RESULT $? 0 0 "metrics-javadoc 生成 Javadoc 失败" - if [ -f "./doc/index.html" ]; then - LOG_INFO "Javadoc 文档生成成功" - else - LOG_ERROR "未找到生成的 Javadoc 文档" - CHECK_RESULT 1 0 0 "Javadoc 文档生成失败" - fi - - LOG_INFO "步骤7: 清理测试项目" - cd / - rm -rf "$test_project_dir" - - if [ "$already_installed" = "false" ]; then - LOG_INFO "步骤8: 卸载 metrics-javadoc 软件包" - dnf remove -y metrics-javadoc - CHECK_RESULT $? 0 0 "卸载 metrics-javadoc 软件包失败" - LOG_INFO "metrics-javadoc 软件包已卸载,环境已恢复" - else - LOG_INFO "步骤8: 保持 metrics-javadoc 软件包安装状态,无需卸载" - fi - - LOG_INFO "测试完成" -} - -main "$@" \ No newline at end of file diff --git a/testcases/function_test/pkg_test/metrics/metrics-javadoc/test_metrics-javadoc_function_verify.sh b/testcases/function_test/pkg_test/metrics/metrics-javadoc/test_metrics-javadoc_function_verify.sh deleted file mode 100644 index 119e291745c..00000000000 --- a/testcases/function_test/pkg_test/metrics/metrics-javadoc/test_metrics-javadoc_function_verify.sh +++ /dev/null @@ -1,117 +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-15 -# @License : Mulan PSL v2 -# @Desc : 验证metrics-javadoc软件包是否已正确安装且版本信息与预期一致。 -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - # 定义日志函数(虽然题目说直接使用,但实际脚本中需要定义) - LOG_INFO() { - echo "[INFO] $1" - } - - LOG_ERROR() { - echo "[ERROR] $1" - } - - # 检查命令执行结果 - CHECK_RESULT() { - if [ $# -lt 4 ]; then - LOG_ERROR "CHECK_RESULT 参数不足" - exit 255 - fi - local actual=$1 - local expect=$2 - local exit_code=$3 - local error_msg=$4 - if [ $actual -ne $expect ]; then - LOG_ERROR "$error_msg" - exit $exit_code - fi - } - - # 定义软件包名称和预期版本(根据实际需要修改) - PACKAGE_NAME="metrics-javadoc" - EXPECTED_VERSION="" # 留空表示不检查特定版本 - - LOG_INFO "开始验证 $PACKAGE_NAME 软件包安装及版本信息" - - # 检查软件包是否在yum源中 - LOG_INFO "检查yum源中是否存在 $PACKAGE_NAME 软件包" - dnf list available $PACKAGE_NAME &>/dev/null - CHECK_RESULT $? 0 255 "yum源中不存在 $PACKAGE_NAME 软件包" - - # 检查当前是否已安装 - LOG_INFO "检查 $PACKAGE_NAME 是否已安装" - if rpm -q $PACKAGE_NAME &>/dev/null; then - LOG_INFO "$PACKAGE_NAME 已安装,记录当前状态" - WAS_INSTALLED=true - else - LOG_INFO "$PACKAGE_NAME 未安装,将进行安装测试" - WAS_INSTALLED=false - fi - - # 如果未安装,则安装软件包 - if [ "$WAS_INSTALLED" = "false" ]; then - LOG_INFO "安装 $PACKAGE_NAME 软件包" - dnf install -y $PACKAGE_NAME - CHECK_RESULT $? 0 1 "$PACKAGE_NAME 安装失败" - fi - - # 验证软件包是否成功安装 - LOG_INFO "验证 $PACKAGE_NAME 是否成功安装" - rpm -q $PACKAGE_NAME - CHECK_RESULT $? 0 1 "$PACKAGE_NAME 未正确安装" - - # 获取并显示版本信息 - LOG_INFO "获取 $PACKAGE_NAME 版本信息" - INSTALLED_VERSION=$(rpm -q --queryformat "%{VERSION}-%{RELEASE}" $PACKAGE_NAME) - CHECK_RESULT $? 0 1 "获取 $PACKAGE_NAME 版本信息失败" - LOG_INFO "已安装版本: $INSTALLED_VERSION" - - # 如果指定了预期版本,则进行比对 - if [ -n "$EXPECTED_VERSION" ]; then - LOG_INFO "验证版本是否符合预期" - if [ "$INSTALLED_VERSION" = "$EXPECTED_VERSION" ]; then - LOG_INFO "版本符合预期: $EXPECTED_VERSION" - else - LOG_ERROR "版本不符合预期: 期望 $EXPECTED_VERSION, 实际 $INSTALLED_VERSION" - exit 1 - fi - fi - - # 验证软件包基本功能 - LOG_INFO "验证 $PACKAGE_NAME 基本功能" - # 这里可以根据实际软件包特性添加功能验证 - # 例如:which javadoc 或 javadoc --version 等 - - # 环境清理 - LOG_INFO "清理测试环境" - if [ "$WAS_INSTALLED" = "false" ]; then - LOG_INFO "卸载测试安装的 $PACKAGE_NAME 软件包" - dnf remove -y $PACKAGE_NAME - CHECK_RESULT $? 0 1 "$PACKAGE_NAME 卸载失败" - LOG_INFO "$PACKAGE_NAME 已成功卸载" - else - LOG_INFO "$PACKAGE_NAME 原本已安装,保持安装状态" - fi - - LOG_INFO "$PACKAGE_NAME 软件包安装及版本验证完成" -} - -main "$@" \ No newline at end of file diff --git a/testcases/function_test/pkg_test/metrics/metrics-javadoc/test_metrics-javadoc_rollback.sh b/testcases/function_test/pkg_test/metrics/metrics-javadoc/test_metrics-javadoc_rollback.sh deleted file mode 100644 index 6cdf873e750..00000000000 --- a/testcases/function_test/pkg_test/metrics/metrics-javadoc/test_metrics-javadoc_rollback.sh +++ /dev/null @@ -1,66 +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-06-19 -# @License : Mulan PSL v2 -# @Desc : 测试metrics-javadoc软件包的回滚功能,验证回滚过程是否正常完成。 -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - LOG_INFO "开始测试metrics-javadoc软件包的回滚功能..." - - # 检查是否已安装metrics-javadoc软件包 - LOG_INFO "检查是否已安装metrics-javadoc软件包..." - dnf list installed metrics-javadoc &> /dev/null - if [ $? -eq 0 ]; then - LOG_INFO "metrics-javadoc软件包已安装,脚本结束时将保持安装状态..." - INSTALLED=true - else - LOG_INFO "metrics-javadoc软件包未安装,将在测试步骤中安装..." - INSTALLED=false - fi - - # 检查yum源中是否存在metrics-javadoc软件包 - LOG_INFO "检查yum源中是否存在metrics-javadoc软件包..." - dnf list available metrics-javadoc &> /dev/null - if [ $? -ne 0 ]; then - LOG_ERROR "yum源中未找到metrics-javadoc软件包,退出测试..." - exit 255 - fi - - # 如果未安装,则安装metrics-javadoc软件包 - if [ "$INSTALLED" = false ]; then - LOG_INFO "开始安装metrics-javadoc软件包..." - dnf install -y metrics-javadoc - CHECK_RESULT $? 0 0 "安装metrics-javadoc软件包失败" - fi - - # 验证回滚功能 - LOG_INFO "开始验证回滚功能..." - dnf history undo last -y &> /dev/null - CHECK_RESULT $? 0 0 "回滚metrics-javadoc软件包失败" - - # 清理环境:如果脚本开始时未安装,则卸载软件包 - if [ "$INSTALLED" = false ]; then - LOG_INFO "清理环境:卸载metrics-javadoc软件包..." - dnf remove -y metrics-javadoc &> /dev/null - CHECK_RESULT $? 0 0 "卸载metrics-javadoc软件包失败" - fi - - LOG_INFO "测试metrics-javadoc软件包的回滚功能完成..." -} - -main "$@" \ No newline at end of file From 953ee70aafa185ef3c4fe7dc2c2e0157c7dd1693 Mon Sep 17 00:00:00 2001 From: honghua Date: Tue, 21 Apr 2026 13:19:17 +0800 Subject: [PATCH 13/18] update testcase for testsuite texlive-babel-slovenian --- .../texlive-babel-slovenian.json | 4 -- ..._texlive-babel-slovenian_function_usage.sh | 69 ------------------- 2 files changed, 73 deletions(-) delete mode 100644 testcases/function_test/pkg_test/texlive-split-b/texlive-babel-slovenian/test_texlive-babel-slovenian_function_usage.sh diff --git a/suite2cases/function_test/pkg_test/texlive-split-b/texlive-babel-slovenian.json b/suite2cases/function_test/pkg_test/texlive-split-b/texlive-babel-slovenian.json index 958a574269d..fb1b6449a3c 100644 --- a/suite2cases/function_test/pkg_test/texlive-split-b/texlive-babel-slovenian.json +++ b/suite2cases/function_test/pkg_test/texlive-split-b/texlive-babel-slovenian.json @@ -13,10 +13,6 @@ { "name": "test_texlive-babel-slovenian_function_check", "desc": "Verify package is installed" - }, - { - "name": "test_texlive-babel-slovenian_function_usage", - "desc": "Test basic LaTeX usage" } ] } \ No newline at end of file diff --git a/testcases/function_test/pkg_test/texlive-split-b/texlive-babel-slovenian/test_texlive-babel-slovenian_function_usage.sh b/testcases/function_test/pkg_test/texlive-split-b/texlive-babel-slovenian/test_texlive-babel-slovenian_function_usage.sh deleted file mode 100644 index 89059138260..00000000000 --- a/testcases/function_test/pkg_test/texlive-split-b/texlive-babel-slovenian/test_texlive-babel-slovenian_function_usage.sh +++ /dev/null @@ -1,69 +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-20 -# @License : Mulan PSL v2 -# @Desc : Test basic LaTeX usage -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - LOG_INFO "测试开始:测试基本LaTeX使用情况" - - LOG_INFO "步骤1:检查texlive-babel-slovenian软件包是否在yum源中" - dnf list available texlive-babel-slovenian - if [ $? -ne 0 ]; then - LOG_ERROR "texlive-babel-slovenian软件包不在yum源中,退出测试" - exit 255 - fi - - LOG_INFO "步骤2:检查系统是否已安装texlive-babel-slovenian" - rpm -q texlive-babel-slovenian - if [ $? -eq 0 ]; then - LOG_INFO "系统已安装texlive-babel-slovenian,跳过安装步骤" - INSTALLED=true - else - LOG_INFO "系统未安装texlive-babel-slovenian,开始安装" - dnf install -y texlive-babel-slovenian - CHECK_RESULT $? 0 0 "安装texlive-babel-slovenian失败" - INSTALLED=false - fi - - LOG_INFO "步骤3:测试基本LaTeX命令,检查是否支持slovenian语言选项" - echo "\documentclass{article} - \usepackage[slovenian]{babel} - \begin{document} - Hello World! - \end{document}" > test_slovenian.tex - - pdflatex test_slovenian.tex - CHECK_RESULT $? 0 0 "LaTeX编译失败,不支持slovenian语言选项" - - LOG_INFO "步骤4:清理生成的临时文件" - rm -f test_slovenian.tex test_slovenian.aux test_slovenian.log test_slovenian.pdf - - LOG_INFO "步骤5:恢复环境状态" - if [ "$INSTALLED" = false ]; then - LOG_INFO "卸载texlive-babel-slovenian软件包" - dnf remove -y texlive-babel-slovenian - CHECK_RESULT $? 0 0 "卸载texlive-babel-slovenian失败" - else - LOG_INFO "系统原本已安装texlive-babel-slovenian,保持安装状态" - fi - - LOG_INFO "测试结束" -} - -main "$@" \ No newline at end of file From b2a848deffb1ad84114113497a04a397d13194d8 Mon Sep 17 00:00:00 2001 From: honghua Date: Tue, 21 Apr 2026 13:25:20 +0800 Subject: [PATCH 14/18] update testcase for testsuite texlive-bussproofs-extra --- .../texlive-bussproofs-extra.json | 8 - ...e-bussproofs-extra_function_use_example.sh | 157 ------------------ 2 files changed, 165 deletions(-) delete mode 100644 testcases/function_test/pkg_test/texlive-split-z/texlive-bussproofs-extra/test_texlive-bussproofs-extra_function_use_example.sh diff --git a/suite2cases/function_test/pkg_test/texlive-split-z/texlive-bussproofs-extra.json b/suite2cases/function_test/pkg_test/texlive-split-z/texlive-bussproofs-extra.json index bd3d3a17c4a..3ab30bb32c7 100644 --- a/suite2cases/function_test/pkg_test/texlive-split-z/texlive-bussproofs-extra.json +++ b/suite2cases/function_test/pkg_test/texlive-split-z/texlive-bussproofs-extra.json @@ -6,18 +6,10 @@ "name": "test_texlive-bussproofs-extra_function_install", "desc": "Test package installation" }, - { - "name": "test_texlive-bussproofs-extra_function_check_version", - "desc": "Test checking package version" - }, { "name": "test_texlive-bussproofs-extra_function_list_files", "desc": "Test listing package files" }, - { - "name": "test_texlive-bussproofs-extra_function_use_example", - "desc": "Test basic LaTeX usage example" - }, { "name": "test_texlive-bussproofs-extra_function_uninstall", "desc": "Test package removal" diff --git a/testcases/function_test/pkg_test/texlive-split-z/texlive-bussproofs-extra/test_texlive-bussproofs-extra_function_use_example.sh b/testcases/function_test/pkg_test/texlive-split-z/texlive-bussproofs-extra/test_texlive-bussproofs-extra_function_use_example.sh deleted file mode 100644 index a5417d68674..00000000000 --- a/testcases/function_test/pkg_test/texlive-split-z/texlive-bussproofs-extra/test_texlive-bussproofs-extra_function_use_example.sh +++ /dev/null @@ -1,157 +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-26 -# @License : Mulan PSL v2 -# @Desc : Test basic LaTeX usage example -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - # 检查是否以root用户运行 - if [ $(id -u) -ne 0 ]; then - LOG_ERROR "必须使用root权限运行此脚本" - exit 1 - fi - - LOG_INFO "开始测试: Test basic LaTeX usage example" - - # 定义软件包名称 - PACKAGE_NAME="texlive-bussproofs-extra" - - # 步骤1: 检查软件包是否已在yum源中 - LOG_INFO "步骤1: 检查yum源中是否存在${PACKAGE_NAME}软件包" - dnf list available ${PACKAGE_NAME} > /dev/null 2>&1 - if [ $? -ne 0 ]; then - LOG_ERROR "yum源中未找到${PACKAGE_NAME}软件包" - exit 255 - fi - CHECK_RESULT $? 0 0 "检查yum源中软件包失败" - - # 步骤2: 检查软件包是否已安装 - LOG_INFO "步骤2: 检查${PACKAGE_NAME}软件包是否已安装" - rpm -q ${PACKAGE_NAME} > /dev/null 2>&1 - IS_INSTALLED=$? - - # 记录初始安装状态 - if [ $IS_INSTALLED -eq 0 ]; then - LOG_INFO "检测到${PACKAGE_NAME}已安装,测试完成后将保持安装状态" - INITIAL_INSTALLED=true - else - LOG_INFO "检测到${PACKAGE_NAME}未安装,测试完成后将卸载软件包" - INITIAL_INSTALLED=false - fi - - # 步骤3: 如果未安装,则安装软件包 - if [ $IS_INSTALLED -ne 0 ]; then - LOG_INFO "步骤3: 安装${PACKAGE_NAME}软件包" - dnf install -y ${PACKAGE_NAME} > /dev/null 2>&1 - CHECK_RESULT $? 0 0 "安装${PACKAGE_NAME}软件包失败" - LOG_INFO "成功安装${PACKAGE_NAME}软件包" - fi - - # 步骤4: 验证软件包安装 - LOG_INFO "步骤4: 验证${PACKAGE_NAME}软件包安装" - rpm -q ${PACKAGE_NAME} > /dev/null 2>&1 - CHECK_RESULT $? 0 0 "验证${PACKAGE_NAME}软件包安装失败" - - # 步骤5: 检查bussproofs包是否可用 - LOG_INFO "步骤5: 检查bussproofs包是否在LaTeX中可用" - TEX_TEST_FILE="/tmp/test_bussproofs.tex" - cat > ${TEX_TEST_FILE} << "EOF" - \documentclass{article} - \usepackage{bussproofs} - \begin{document} - This is a test document for bussproofs package. - \end{document} - EOF - - # 检查文件是否创建成功 - if [ ! -f ${TEX_TEST_FILE} ]; then - LOG_ERROR "创建测试LaTeX文件失败" - exit 1 - fi - - # 步骤6: 尝试使用pdflatex编译测试文件 - LOG_INFO "步骤6: 尝试编译包含bussproofs包的LaTeX文件" - which pdflatex > /dev/null 2>&1 - if [ $? -eq 0 ]; then - pdflatex -halt-on-error -interaction=nonstopmode ${TEX_TEST_FILE} > /tmp/tex_compile.log 2>&1 - TEX_COMPILE_RESULT=$? - - if [ $TEX_COMPILE_RESULT -eq 0 ]; then - LOG_INFO "LaTeX文件编译成功" - else - LOG_INFO "LaTeX编译失败(可能是缺少其他依赖),但bussproofs包已正确安装" - # 检查编译日志中是否有bussproofs相关的错误 - grep -i "bussproofs" /tmp/tex_compile.log > /dev/null 2>&1 - if [ $? -eq 0 ]; then - LOG_ERROR "编译日志中包含bussproofs相关错误" - exit 1 - fi - fi - else - LOG_INFO "未找到pdflatex命令,跳过编译测试" - fi - - # 步骤7: 检查bussproofs包文档 - LOG_INFO "步骤7: 检查bussproofs包文档" - find /usr/share/texlive/texmf-dist/ -name "*bussproofs*" -type f 2>/dev/null | head -5 > /tmp/bussproofs_files.txt - if [ -s /tmp/bussproofs_files.txt ]; then - LOG_INFO "找到bussproofs相关文件" - cat /tmp/bussproofs_files.txt | while read line; do - LOG_INFO "文件: $line" - done - else - # 尝试在其他位置查找 - find /usr/share/texmf/ -name "*bussproofs*" -type f 2>/dev/null | head -5 > /tmp/bussproofs_files.txt - if [ -s /tmp/bussproofs_files.txt ]; then - LOG_INFO "找到bussproofs相关文件" - else - LOG_INFO "未找到bussproofs文档文件(可能是最小化安装)" - fi - fi - - # 步骤8: 清理临时文件 - LOG_INFO "步骤8: 清理临时文件" - rm -f ${TEX_TEST_FILE} ${TEX_TEST_FILE%.tex}.aux ${TEX_TEST_FILE%.tex}.log ${TEX_TEST_FILE%.tex}.pdf 2>/dev/null - rm -f /tmp/tex_compile.log /tmp/bussproofs_files.txt 2>/dev/null - - # 步骤9: 环境恢复 - LOG_INFO "步骤9: 恢复测试环境" - if [ "$INITIAL_INSTALLED" = "false" ]; then - LOG_INFO "卸载${PACKAGE_NAME}软件包" - dnf remove -y ${PACKAGE_NAME} > /dev/null 2>&1 - if [ $? -eq 0 ]; then - LOG_INFO "成功卸载${PACKAGE_NAME}软件包" - else - LOG_ERROR "卸载${PACKAGE_NAME}软件包失败" - exit 1 - fi - - # 验证卸载 - rpm -q ${PACKAGE_NAME} > /dev/null 2>&1 - if [ $? -eq 0 ]; then - LOG_ERROR "软件包卸载验证失败" - exit 1 - fi - else - LOG_INFO "保持${PACKAGE_NAME}软件包安装状态" - fi - - LOG_INFO "测试完成: Test basic LaTeX usage example 通过" -} - -main "$@" \ No newline at end of file From 2bd530e378330ee42749dd725c7b45bb206d3c2f Mon Sep 17 00:00:00 2001 From: honghua Date: Tue, 21 Apr 2026 13:28:50 +0800 Subject: [PATCH 15/18] update testcase for testsuite libsemanage-devel --- .../libsemanage/libsemanage-devel.json | 61 --------- .../test_libsemanage-devel_chcat_help.sh | 61 --------- ...ibsemanage-devel_function_basic_install.sh | 116 ---------------- ...est_libsemanage-devel_function_cmd_help.sh | 77 ----------- ...libsemanage-devel_function_compile_link.sh | 91 ------------- ...libsemanage-devel_function_existing_cmd.sh | 71 ---------- ...libsemanage-devel_function_header_check.sh | 70 ---------- ...libsemanage-devel_function_header_usage.sh | 88 ------------ ...test_libsemanage-devel_function_install.sh | 71 ---------- ...ibsemanage-devel_function_library_check.sh | 74 ---------- ...libsemanage-devel_function_link_library.sh | 88 ------------ ...st_libsemanage-devel_function_pkgconfig.sh | 114 ---------------- ...st_libsemanage-devel_function_uninstall.sh | 81 ----------- ...test_libsemanage-devel_function_version.sh | 126 ------------------ .../test_libsemanage-devel_install.sh | 59 -------- .../test_libsemanage-devel_secon_current.sh | 60 --------- 16 files changed, 1308 deletions(-) delete mode 100644 testcases/function_test/pkg_test/libsemanage/libsemanage-devel/test_libsemanage-devel_chcat_help.sh delete mode 100644 testcases/function_test/pkg_test/libsemanage/libsemanage-devel/test_libsemanage-devel_function_basic_install.sh delete mode 100644 testcases/function_test/pkg_test/libsemanage/libsemanage-devel/test_libsemanage-devel_function_cmd_help.sh delete mode 100644 testcases/function_test/pkg_test/libsemanage/libsemanage-devel/test_libsemanage-devel_function_compile_link.sh delete mode 100644 testcases/function_test/pkg_test/libsemanage/libsemanage-devel/test_libsemanage-devel_function_existing_cmd.sh delete mode 100644 testcases/function_test/pkg_test/libsemanage/libsemanage-devel/test_libsemanage-devel_function_header_check.sh delete mode 100644 testcases/function_test/pkg_test/libsemanage/libsemanage-devel/test_libsemanage-devel_function_header_usage.sh delete mode 100644 testcases/function_test/pkg_test/libsemanage/libsemanage-devel/test_libsemanage-devel_function_install.sh delete mode 100644 testcases/function_test/pkg_test/libsemanage/libsemanage-devel/test_libsemanage-devel_function_library_check.sh delete mode 100644 testcases/function_test/pkg_test/libsemanage/libsemanage-devel/test_libsemanage-devel_function_link_library.sh delete mode 100644 testcases/function_test/pkg_test/libsemanage/libsemanage-devel/test_libsemanage-devel_function_pkgconfig.sh delete mode 100644 testcases/function_test/pkg_test/libsemanage/libsemanage-devel/test_libsemanage-devel_function_uninstall.sh delete mode 100644 testcases/function_test/pkg_test/libsemanage/libsemanage-devel/test_libsemanage-devel_function_version.sh delete mode 100644 testcases/function_test/pkg_test/libsemanage/libsemanage-devel/test_libsemanage-devel_install.sh delete mode 100644 testcases/function_test/pkg_test/libsemanage/libsemanage-devel/test_libsemanage-devel_secon_current.sh diff --git a/suite2cases/function_test/pkg_test/libsemanage/libsemanage-devel.json b/suite2cases/function_test/pkg_test/libsemanage/libsemanage-devel.json index f6a97269436..cbdebe33d3b 100644 --- a/suite2cases/function_test/pkg_test/libsemanage/libsemanage-devel.json +++ b/suite2cases/function_test/pkg_test/libsemanage/libsemanage-devel.json @@ -2,15 +2,6 @@ "path": "$OET_PATH/testcases/function_test/pkg_test/libsemanage/libsemanage-devel", "machine num": 1, "cases": [ - { - "name": "test_libsemanage-devel_install", - "desc": "测试libsemanage-devel软件包的安装功能,验证是否能够正确安装到系统中。", - "machine num": 1 - }, - { - "name": "test_libsemanage-devel_chcat_help", - "desc": "测试 chcat 命令的帮助文档是否可用" - }, { "name": "test_libsemanage-devel_secon_h", "desc": "测试 secon 命令的 --help 参数,显示帮助信息" @@ -23,61 +14,9 @@ "name": "test_libsemanage-devel_secon_up_p", "desc": "测试 secon 命令的 --prompt 参数,输出适合提示的格式" }, - { - "name": "test_libsemanage-devel_secon_current", - "desc": "测试 secon 命令的 --current/--self选项,获取当前进程的上下文" - }, { "name": "test_libsemanage-devel_uninstall", "desc": "测试libsemanage-devel软件包的卸载功能,验证是否能够正确从系统中卸载。" - }, - { - "name": "test_libsemanage-devel_function_basic_install", - "desc": "测试libsemanage-devel开发包的基础安装和完整性验证,包括关键头文件和库文件的存在性检查。" - }, - { - "name": "test_libsemanage-devel_function_header_usage", - "desc": "测试能否成功包含并编译基于libsemanage开发头文件(如semanage/semanage.h)的简单C程序。" - }, - { - "name": "test_libsemanage-devel_function_link_library", - "desc": "测试在编译程序时能够正确链接libsemanage共享库(-lsemanage),验证开发环境可用性。" - }, - { - "name": "test_libsemanage-devel_function_pkgconfig", - "desc": "测试pkg-config(如可用)能够正确提供libsemanage的编译和链接参数(cflags, libs)。" - }, - { - "name": "test_libsemanage-devel_function_existing_cmd", - "desc": "验证软件包安装后,相关的用户命令(如secon, chcat)是否可用并返回帮助信息。" - }, - { - "name": "test_libsemanage-devel_function_install", - "desc": "测试libsemanage-devel软件包的基本安装功能,验证其是否能够成功安装到系统中。" - }, - { - "name": "test_libsemanage-devel_function_uninstall", - "desc": "测试libsemanage-devel软件包的卸载功能,验证其能否被完全且干净地从系统中移除。" - }, - { - "name": "test_libsemanage-devel_function_header_check", - "desc": "验证安装后关键的开发头文件(如semanage/semanage.h)是否存在于标准系统路径中。" - }, - { - "name": "test_libsemanage-devel_function_library_check", - "desc": "验证安装后关键的共享库文件(如libsemanage.so)是否存在于标准系统库路径中。" - }, - { - "name": "test_libsemanage-devel_function_compile_link", - "desc": "测试一个简单的C程序能否成功包含头文件并使用-lsemanage选项进行编译和链接,验证开发环境可用性。" - }, - { - "name": "test_libsemanage-devel_function_cmd_help", - "desc": "验证软件包提供的用户命令(如secon, chcat)在安装后是否可用,并能通过--help参数输出帮助信息。" - }, - { - "name": "test_libsemanage-devel_function_version", - "desc": "验证软件包提供的用户命令(如secon)能否通过--version参数正确输出版本信息。" } ] } \ No newline at end of file diff --git a/testcases/function_test/pkg_test/libsemanage/libsemanage-devel/test_libsemanage-devel_chcat_help.sh b/testcases/function_test/pkg_test/libsemanage/libsemanage-devel/test_libsemanage-devel_chcat_help.sh deleted file mode 100644 index d7cba68183a..00000000000 --- a/testcases/function_test/pkg_test/libsemanage/libsemanage-devel/test_libsemanage-devel_chcat_help.sh +++ /dev/null @@ -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-08-02 -# @License : Mulan PSL v2 -# @Desc : 测试 chcat 命令的帮助文档是否可用 -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - # 检查是否已安装libsemanage-devel软件包 - LOG_INFO "检查是否已安装libsemanage-devel软件包" - rpm -q libsemanage-devel - if [ $? -eq 0 ]; then - LOG_INFO "libsemanage-devel已安装,脚本结束时将保持安装状态" - installed=true - else - LOG_INFO "libsemanage-devel未安装,将在测试结束后卸载" - installed=false - fi - - # 检查yum源中是否有libsemanage-devel软件包 - LOG_INFO "检查yum源中是否有libsemanage-devel软件包" - dnf list available libsemanage-devel > /dev/null 2>&1 - CHECK_RESULT $? 0 255 "yum源中未找到libsemanage-devel软件包" - - # 安装libsemanage-devel软件包 - if [ "$installed" = false ]; then - LOG_INFO "正在安装libsemanage-devel软件包" - dnf install -y libsemanage-devel - CHECK_RESULT $? 0 255 "安装libsemanage-devel软件包失败" - fi - - # 测试chcat命令的帮助文档是否可用 - LOG_INFO "测试chcat命令的帮助文档是否可用" - chcat --help > /dev/null 2>&1 - CHECK_RESULT $? 0 255 "chcat命令的帮助文档不可用" - - # 清理环境 - if [ "$installed" = false ]; then - LOG_INFO "正在卸载libsemanage-devel软件包" - dnf remove -y libsemanage-devel - CHECK_RESULT $? 0 255 "卸载libsemanage-devel软件包失败" - fi - - LOG_INFO "测试脚本执行完毕" -} - -main "$@" \ No newline at end of file diff --git a/testcases/function_test/pkg_test/libsemanage/libsemanage-devel/test_libsemanage-devel_function_basic_install.sh b/testcases/function_test/pkg_test/libsemanage/libsemanage-devel/test_libsemanage-devel_function_basic_install.sh deleted file mode 100644 index 57f4cbad237..00000000000 --- a/testcases/function_test/pkg_test/libsemanage/libsemanage-devel/test_libsemanage-devel_function_basic_install.sh +++ /dev/null @@ -1,116 +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-01-28 -# @License : Mulan PSL v2 -# @Desc : 测试libsemanage-devel开发包的基础安装和完整性验证,包括关键头文件和库文件的存在性检查。 -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - # 测试libsemanage-devel开发包的基础安装和完整性验证 - LOG_INFO "开始测试libsemanage-devel开发包的基础安装和完整性验证" - - # 定义软件包名称 - PACKAGE_NAME="libsemanage-devel" - - # 步骤1:检查yum源中是否存在libsemanage-devel软件包 - LOG_INFO "步骤1:检查yum源中是否存在${PACKAGE_NAME}软件包" - dnf list available ${PACKAGE_NAME} &>/dev/null - if [ $? -ne 0 ]; then - LOG_ERROR "yum源中未找到${PACKAGE_NAME}软件包" - exit 255 - fi - LOG_INFO "yum源中存在${PACKAGE_NAME}软件包" - - # 步骤2:检查当前是否已安装libsemanage-devel - LOG_INFO "步骤2:检查当前是否已安装${PACKAGE_NAME}" - IS_INSTALLED=0 - if rpm -q ${PACKAGE_NAME} &>/dev/null; then - LOG_INFO "${PACKAGE_NAME}已安装" - IS_INSTALLED=1 - else - LOG_INFO "${PACKAGE_NAME}未安装" - fi - - # 步骤3:如果未安装,则安装libsemanage-devel - if [ ${IS_INSTALLED} -eq 0 ]; then - LOG_INFO "步骤3:安装${PACKAGE_NAME}软件包" - dnf install -y ${PACKAGE_NAME} - CHECK_RESULT $? 0 0 "安装${PACKAGE_NAME}失败" - LOG_INFO "成功安装${PACKAGE_NAME}软件包" - fi - - # 步骤4:验证libsemanage-devel的关键头文件 - LOG_INFO "步骤4:验证libsemanage-devel的关键头文件" - HEADER_FILES=( - "/usr/include/semanage/semanage.h" - "/usr/include/semanage/booleans.h" - "/usr/include/semanage/ibendports.h" - "/usr/include/semanage/ibpkeys.h" - "/usr/include/semanage/interfaces.h" - "/usr/include/semanage/ports.h" - "/usr/include/semanage/users.h" - ) - - for header in "${HEADER_FILES[@]}"; do - if [ -f "${header}" ]; then - LOG_INFO "头文件 ${header} 存在" - else - LOG_ERROR "头文件 ${header} 不存在" - exit 1 - fi - done - LOG_INFO "所有关键头文件验证通过" - - # 步骤5:验证libsemanage-devel的库文件 - LOG_INFO "步骤5:验证libsemanage-devel的库文件" - LIB_FILES=( - "/usr/lib64/libsemanage.so" - ) - - for lib in "${LIB_FILES[@]}"; do - if [ -f "${lib}" ]; then - LOG_INFO "库文件 ${lib} 存在" - else - LOG_ERROR "库文件 ${lib} 不存在" - exit 1 - fi - done - LOG_INFO "所有关键库文件验证通过" - - # 步骤6:验证pkg-config文件 - LOG_INFO "步骤6:验证pkg-config文件" - if pkg-config --exists libsemanage; then - LOG_INFO "pkg-config配置正确" - else - LOG_ERROR "pkg-config配置不正确" - exit 1 - fi - - # 步骤7:如果测试前未安装,则卸载软件包 - if [ ${IS_INSTALLED} -eq 0 ]; then - LOG_INFO "步骤7:卸载${PACKAGE_NAME}软件包" - dnf remove -y ${PACKAGE_NAME} - CHECK_RESULT $? 0 0 "卸载${PACKAGE_NAME}失败" - LOG_INFO "成功卸载${PACKAGE_NAME}软件包" - else - LOG_INFO "步骤7:保持${PACKAGE_NAME}已安装状态" - fi - - LOG_INFO "测试libsemanage-devel开发包的基础安装和完整性验证完成" -} - -main "$@" \ No newline at end of file diff --git a/testcases/function_test/pkg_test/libsemanage/libsemanage-devel/test_libsemanage-devel_function_cmd_help.sh b/testcases/function_test/pkg_test/libsemanage/libsemanage-devel/test_libsemanage-devel_function_cmd_help.sh deleted file mode 100644 index 9bbbacb908f..00000000000 --- a/testcases/function_test/pkg_test/libsemanage/libsemanage-devel/test_libsemanage-devel_function_cmd_help.sh +++ /dev/null @@ -1,77 +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-01-28 -# @License : Mulan PSL v2 -# @Desc : 验证软件包提供的用户命令(如secon, chcat)在安装后是否可用,并能通过--help参数输出帮助信息。 -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - # 定义软件包名称 - PACKAGE_NAME="libsemanage-devel" - - # 步骤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 - - # 步骤2: 检查软件包是否已安装 - LOG_INFO "步骤2: 检查软件包是否已安装" - IS_INSTALLED=0 - rpm -q $PACKAGE_NAME &> /dev/null - if [ $? -eq 0 ]; then - LOG_INFO "软件包 $PACKAGE_NAME 已安装" - IS_INSTALLED=1 - else - LOG_INFO "软件包 $PACKAGE_NAME 未安装" - fi - - # 步骤3: 如果未安装,则安装软件包 - if [ $IS_INSTALLED -eq 0 ]; then - LOG_INFO "步骤3: 安装软件包 $PACKAGE_NAME" - dnf install -y $PACKAGE_NAME - CHECK_RESULT $? 0 0 "安装软件包 $PACKAGE_NAME 失败" - fi - - # 步骤4: 验证secon命令是否可用 - LOG_INFO "步骤4: 验证secon命令是否可用" - secon --help &> /dev/null - CHECK_RESULT $? 0 0 "secon命令不可用或--help参数不支持" - LOG_INFO "secon命令--help参数执行成功" - - # 步骤5: 验证chcat命令是否可用 - LOG_INFO "步骤5: 验证chcat命令是否可用" - chcat --help &> /dev/null - CHECK_RESULT $? 0 0 "chcat命令不可用或--help参数不支持" - LOG_INFO "chcat命令--help参数执行成功" - - # 步骤6: 环境恢复 - LOG_INFO "步骤6: 环境恢复" - if [ $IS_INSTALLED -eq 0 ]; then - LOG_INFO "卸载软件包 $PACKAGE_NAME" - dnf remove -y $PACKAGE_NAME - CHECK_RESULT $? 0 0 "卸载软件包 $PACKAGE_NAME 失败" - else - LOG_INFO "保持软件包 $PACKAGE_NAME 安装状态" - fi - - LOG_INFO "测试脚本执行完成" -} - -main "$@" \ No newline at end of file diff --git a/testcases/function_test/pkg_test/libsemanage/libsemanage-devel/test_libsemanage-devel_function_compile_link.sh b/testcases/function_test/pkg_test/libsemanage/libsemanage-devel/test_libsemanage-devel_function_compile_link.sh deleted file mode 100644 index 4e6afa13711..00000000000 --- a/testcases/function_test/pkg_test/libsemanage/libsemanage-devel/test_libsemanage-devel_function_compile_link.sh +++ /dev/null @@ -1,91 +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-01-28 -# @License : Mulan PSL v2 -# @Desc : 测试一个简单的C程序能否成功包含头文件并使用-lsemanage选项进行编译和链接,验证开发环境可用性。 -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - LOG_INFO "开始测试libsemanage-devel软件包编译链接功能" - - # 检查是否已安装libsemanage-devel - LOG_INFO "步骤1:检查libsemanage-devel是否已安装" - rpm -q libsemanage-devel > /dev/null 2>&1 - if [ $? -eq 0 ]; then - LOG_INFO "libsemanage-devel已安装,标记为已安装状态" - already_installed=1 - else - LOG_INFO "libsemanage-devel未安装,标记为未安装状态" - already_installed=0 - fi - - # 检查yum源中是否有libsemanage-devel软件包 - LOG_INFO "步骤2:检查yum源中是否有libsemanage-devel软件包" - dnf list available libsemanage-devel > /dev/null 2>&1 - if [ $? -ne 0 ]; then - LOG_ERROR "yum源中没有libsemanage-devel软件包" - exit 255 - fi - - # 如果未安装,则安装libsemanage-devel - if [ $already_installed -eq 0 ]; then - LOG_INFO "步骤3:安装libsemanage-devel软件包" - dnf install -y libsemanage-devel - CHECK_RESULT $? 0 0 "安装libsemanage-devel失败" - fi - - # 创建测试C程序 - LOG_INFO "步骤4:创建测试C程序" - cat > test_libsemanage.c << "EOF" - #include - int main() { - semanage_handle_t *sh = NULL; - sh = semanage_handle_create(); - if (sh == NULL) { - return 1; - } - semanage_handle_destroy(sh); - return 0; - } - EOF - CHECK_RESULT $? 0 0 "创建测试C程序失败" - - # 编译测试程序 - LOG_INFO "步骤5:编译测试程序" - gcc -o test_libsemanage test_libsemanage.c -lsemanage - CHECK_RESULT $? 0 0 "编译测试程序失败" - - # 运行测试程序 - LOG_INFO "步骤6:运行测试程序" - ./test_libsemanage - CHECK_RESULT $? 0 0 "运行测试程序失败" - - LOG_INFO "步骤7:清理测试文件" - rm -f test_libsemanage.c test_libsemanage - CHECK_RESULT $? 0 0 "清理测试文件失败" - - # 如果之前未安装,则卸载libsemanage-devel - if [ $already_installed -eq 0 ]; then - LOG_INFO "步骤8:卸载libsemanage-devel软件包" - dnf remove -y libsemanage-devel - CHECK_RESULT $? 0 0 "卸载libsemanage-devel失败" - fi - - LOG_INFO "测试完成,环境已恢复" -} - -main "$@" \ No newline at end of file diff --git a/testcases/function_test/pkg_test/libsemanage/libsemanage-devel/test_libsemanage-devel_function_existing_cmd.sh b/testcases/function_test/pkg_test/libsemanage/libsemanage-devel/test_libsemanage-devel_function_existing_cmd.sh deleted file mode 100644 index 860f93f3804..00000000000 --- a/testcases/function_test/pkg_test/libsemanage/libsemanage-devel/test_libsemanage-devel_function_existing_cmd.sh +++ /dev/null @@ -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 : 2026-01-28 -# @License : Mulan PSL v2 -# @Desc : 验证软件包安装后,相关的用户命令(如secon, chcat)是否可用并返回帮助信息。 -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - # 检查是否已经安装了libsemanage-devel软件包 - LOG_INFO "检查libsemanage-devel软件包是否已经安装" - rpm -q libsemanage-devel > /dev/null 2>&1 - if [ $? -eq 0 ]; then - LOG_INFO "libsemanage-devel软件包已经安装,测试结束后保持安装状态" - INSTALLED=1 - else - LOG_INFO "libsemanage-devel软件包未安装,将在测试前安装并在测试后卸载" - INSTALLED=0 - fi - - # 检查yum源中是否有libsemanage-devel软件包 - LOG_INFO "检查yum源中是否有libsemanage-devel软件包" - dnf list available libsemanage-devel > /dev/null 2>&1 - if [ $? -ne 0 ]; then - LOG_ERROR "yum源中未找到libsemanage-devel软件包" - exit 255 - fi - - # 如果未安装,则安装软件包 - if [ $INSTALLED -eq 0 ]; then - LOG_INFO "安装libsemanage-devel软件包" - dnf install -y libsemanage-devel > /dev/null 2>&1 - CHECK_RESULT $? 0 0 "安装libsemanage-devel软件包失败" - fi - - # 验证secon命令是否可用并返回帮助信息 - LOG_INFO "验证secon命令是否可用并返回帮助信息" - secon --help > /dev/null 2>&1 - CHECK_RESULT $? 0 0 "secon命令不可用或未返回帮助信息" - - # 验证chcat命令是否可用并返回帮助信息 - LOG_INFO "验证chcat命令是否可用并返回帮助信息" - chcat --help > /dev/null 2>&1 - CHECK_RESULT $? 0 0 "chcat命令不可用或未返回帮助信息" - - # 清理环境:如果测试前未安装,则卸载软件包 - if [ $INSTALLED -eq 0 ]; then - LOG_INFO "卸载libsemanage-devel软件包" - dnf remove -y libsemanage-devel > /dev/null 2>&1 - CHECK_RESULT $? 0 0 "卸载libsemanage-devel软件包失败" - else - LOG_INFO "测试前已安装libsemanage-devel,保持安装状态" - fi - - LOG_INFO "测试完成" -} - -main "$@" \ No newline at end of file diff --git a/testcases/function_test/pkg_test/libsemanage/libsemanage-devel/test_libsemanage-devel_function_header_check.sh b/testcases/function_test/pkg_test/libsemanage/libsemanage-devel/test_libsemanage-devel_function_header_check.sh deleted file mode 100644 index 94609feeb7f..00000000000 --- a/testcases/function_test/pkg_test/libsemanage/libsemanage-devel/test_libsemanage-devel_function_header_check.sh +++ /dev/null @@ -1,70 +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-01-28 -# @License : Mulan PSL v2 -# @Desc : 验证安装后关键的开发头文件(如semanage/semanage.h)是否存在于标准系统路径中。 -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - # 定义软件包名称 - PACKAGE_NAME="libsemanage-devel" - HEADER_FILE="/usr/include/semanage/semanage.h" - - # 步骤1:检查yum源中是否存在指定软件包 - LOG_INFO "检查yum源中是否存在${PACKAGE_NAME}软件包" - if ! dnf list available "${PACKAGE_NAME}" &>/dev/null; then - LOG_ERROR "yum源中未找到${PACKAGE_NAME}软件包" - exit 255 - fi - - # 步骤2:检查当前环境中是否已安装指定软件包 - LOG_INFO "检查当前环境中是否已安装${PACKAGE_NAME}软件包" - if rpm -q "${PACKAGE_NAME}" &>/dev/null; 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 "检查关键的开发头文件${HEADER_FILE}是否存在于标准系统路径中" - if [ -f "${HEADER_FILE}" ]; then - LOG_INFO "开发头文件${HEADER_FILE}存在" - else - LOG_ERROR "开发头文件${HEADER_FILE}不存在" - exit 1 - fi - - # 步骤5:如果测试前未安装,则在脚本结束前卸载软件包 - if [ "${ALREADY_INSTALLED}" = "false" ]; then - LOG_INFO "卸载${PACKAGE_NAME}软件包" - dnf remove -y "${PACKAGE_NAME}" - CHECK_RESULT $? 0 0 "卸载${PACKAGE_NAME}软件包失败" - fi - - LOG_INFO "测试完成" -} - -main "$@" \ No newline at end of file diff --git a/testcases/function_test/pkg_test/libsemanage/libsemanage-devel/test_libsemanage-devel_function_header_usage.sh b/testcases/function_test/pkg_test/libsemanage/libsemanage-devel/test_libsemanage-devel_function_header_usage.sh deleted file mode 100644 index f787d34944f..00000000000 --- a/testcases/function_test/pkg_test/libsemanage/libsemanage-devel/test_libsemanage-devel_function_header_usage.sh +++ /dev/null @@ -1,88 +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-01-28 -# @License : Mulan PSL v2 -# @Desc : 测试能否成功包含并编译基于libsemanage开发头文件(如semanage/semanage.h)的简单C程序。 -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - set -e - - LOG_INFO "开始测试libsemanage-devel头文件使用情况" - - LOG_INFO "步骤1:检查系统中是否已安装libsemanage-devel软件包" - if rpm -q libsemanage-devel &> /dev/null; then - LOG_INFO "libsemanage-devel已安装,测试后将保持安装状态" - INSTALLED_BEFORE=true - else - LOG_INFO "libsemanage-devel未安装,将在测试中安装并最终卸载" - INSTALLED_BEFORE=false - fi - - LOG_INFO "步骤2:检查yum源中是否存在libsemanage-devel软件包" - if ! dnf list available libsemanage-devel &> /dev/null; then - LOG_ERROR "yum源中未找到libsemanage-devel软件包" - exit 255 - fi - - LOG_INFO "步骤3:安装libsemanage-devel软件包(如未安装)" - if [ "$INSTALLED_BEFORE" = false ]; then - dnf install -y libsemanage-devel - CHECK_RESULT $? 0 0 "安装libsemanage-devel失败" - fi - - LOG_INFO "步骤4:创建测试C程序" - cat > test_libsemanage.c << "EOF" - #include - #include - int main() { - semanage_handle_t *sh = NULL; - sh = semanage_handle_create(); - if (sh == NULL) { - printf("Failed to create semanage handle\n"); - return 1; - } - printf("Successfully included semanage/semanage.h and created handle\n"); - semanage_handle_destroy(sh); - return 0; - } - EOF - - LOG_INFO "步骤5:编译测试程序" - gcc -o test_libsemanage test_libsemanage.c -lsemanage - CHECK_RESULT $? 0 0 "编译测试程序失败" - - LOG_INFO "步骤6:运行测试程序" - ./test_libsemanage - CHECK_RESULT $? 0 0 "运行测试程序失败" - - LOG_INFO "步骤7:清理测试文件" - rm -f test_libsemanage.c test_libsemanage - - LOG_INFO "步骤8:恢复环境" - if [ "$INSTALLED_BEFORE" = false ]; then - LOG_INFO "卸载测试安装的libsemanage-devel软件包" - dnf remove -y libsemanage-devel - CHECK_RESULT $? 0 0 "卸载libsemanage-devel失败" - else - LOG_INFO "保持libsemanage-devel安装状态不变" - fi - - LOG_INFO "测试完成" -} - -main "$@" \ No newline at end of file diff --git a/testcases/function_test/pkg_test/libsemanage/libsemanage-devel/test_libsemanage-devel_function_install.sh b/testcases/function_test/pkg_test/libsemanage/libsemanage-devel/test_libsemanage-devel_function_install.sh deleted file mode 100644 index 25a9acf8934..00000000000 --- a/testcases/function_test/pkg_test/libsemanage/libsemanage-devel/test_libsemanage-devel_function_install.sh +++ /dev/null @@ -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 : 2026-01-28 -# @License : Mulan PSL v2 -# @Desc : 测试libsemanage-devel软件包的基本安装功能,验证其是否能够成功安装到系统中。 -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - # 检查是否已经安装libsemanage-devel软件包 - LOG_INFO "检查libsemanage-devel软件包是否已安装" - rpm -q libsemanage-devel > /dev/null 2>&1 - if [ $? -eq 0 ]; then - LOG_INFO "libsemanage-devel软件包已安装,脚本结束后将保持安装状态" - INSTALLED="true" - else - LOG_INFO "libsemanage-devel软件包未安装,将在测试步骤中进行安装" - INSTALLED="false" - fi - - # 检查yum源中是否有libsemanage-devel软件包 - LOG_INFO "检查yum源中是否存在libsemanage-devel软件包" - dnf list available libsemanage-devel > /dev/null 2>&1 - if [ $? -ne 0 ]; then - LOG_ERROR "yum源中未找到libsemanage-devel软件包" - exit 255 - fi - - # 如果未安装,则安装libsemanage-devel软件包 - if [ "$INSTALLED" = "false" ]; then - LOG_INFO "开始安装libsemanage-devel软件包" - dnf install -y libsemanage-devel - CHECK_RESULT $? 0 0 "安装libsemanage-devel软件包失败" - LOG_INFO "libsemanage-devel软件包安装成功" - fi - - # 验证libsemanage-devel软件包是否安装成功 - LOG_INFO "验证libsemanage-devel软件包是否安装成功" - rpm -q libsemanage-devel > /dev/null 2>&1 - CHECK_RESULT $? 0 0 "libsemanage-devel软件包未正确安装" - - # 验证libsemanage-devel软件包是否包含必要的文件 - LOG_INFO "验证libsemanage-devel软件包是否包含必要的文件" - rpm -ql libsemanage-devel | grep -E "\.h$|\.so$" > /dev/null 2>&1 - CHECK_RESULT $? 0 0 "libsemanage-devel软件包未包含必要的头文件或库文件" - - # 如果之前未安装,则在脚本结束前卸载libsemanage-devel软件包 - if [ "$INSTALLED" = "false" ]; then - LOG_INFO "开始卸载libsemanage-devel软件包" - dnf remove -y libsemanage-devel - CHECK_RESULT $? 0 0 "卸载libsemanage-devel软件包失败" - LOG_INFO "libsemanage-devel软件包卸载成功,环境已恢复" - fi - - LOG_INFO "libsemanage-devel软件包基本安装功能测试完成" -} - -main "$@" \ No newline at end of file diff --git a/testcases/function_test/pkg_test/libsemanage/libsemanage-devel/test_libsemanage-devel_function_library_check.sh b/testcases/function_test/pkg_test/libsemanage/libsemanage-devel/test_libsemanage-devel_function_library_check.sh deleted file mode 100644 index 2c6fe958c7e..00000000000 --- a/testcases/function_test/pkg_test/libsemanage/libsemanage-devel/test_libsemanage-devel_function_library_check.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-01-28 -# @License : Mulan PSL v2 -# @Desc : 验证安装后关键的共享库文件(如libsemanage.so)是否存在于标准系统库路径中。 -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - LOG_INFO "开始测试:验证安装后关键的共享库文件(如libsemanage.so)是否存在于标准系统库路径中" - - LOG_INFO "步骤1:检查是否已安装libsemanage-devel软件包" - if dnf list installed libsemanage-devel &>/dev/null; then - LOG_INFO "libsemanage-devel已安装,测试结束后将保持安装状态" - INSTALLED_BEFORE=1 - else - LOG_INFO "libsemanage-devel未安装,将在测试步骤中安装" - INSTALLED_BEFORE=0 - fi - - LOG_INFO "步骤2:检查yum源中是否有libsemanage-devel软件包" - if ! dnf list available libsemanage-devel &>/dev/null; then - LOG_ERROR "yum源中未找到libsemanage-devel软件包" - exit 255 - fi - - if [ $INSTALLED_BEFORE -eq 0 ]; then - LOG_INFO "步骤3:安装libsemanage-devel软件包" - dnf install -y libsemanage-devel - CHECK_RESULT $? 0 0 "安装libsemanage-devel失败" - fi - - LOG_INFO "步骤4:检查关键的共享库文件是否存在" - LIB_PATHS="/lib /lib64 /usr/lib /usr/lib64" - LIB_FOUND=0 - for path in $LIB_PATHS; do - if [ -f "$path/libsemanage.so" ]; then - LOG_INFO "找到共享库文件: $path/libsemanage.so" - LIB_FOUND=1 - break - fi - done - - if [ $LIB_FOUND -eq 0 ]; then - LOG_ERROR "未在标准系统库路径中找到libsemanage.so" - exit 1 - fi - - LOG_INFO "步骤5:环境恢复" - if [ $INSTALLED_BEFORE -eq 0 ]; then - LOG_INFO "卸载libsemanage-devel软件包" - dnf remove -y libsemanage-devel - CHECK_RESULT $? 0 0 "卸载libsemanage-devel失败" - else - LOG_INFO "保持libsemanage-devel安装状态" - fi - - LOG_INFO "测试完成" -} - -main "$@" \ No newline at end of file diff --git a/testcases/function_test/pkg_test/libsemanage/libsemanage-devel/test_libsemanage-devel_function_link_library.sh b/testcases/function_test/pkg_test/libsemanage/libsemanage-devel/test_libsemanage-devel_function_link_library.sh deleted file mode 100644 index c65af51d72e..00000000000 --- a/testcases/function_test/pkg_test/libsemanage/libsemanage-devel/test_libsemanage-devel_function_link_library.sh +++ /dev/null @@ -1,88 +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-01-28 -# @License : Mulan PSL v2 -# @Desc : 测试在编译程序时能够正确链接libsemanage共享库(-lsemanage),验证开发环境可用性。 -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - # 测试libsemanage-devel功能链接库 - LOG_INFO "开始测试libsemanage-devel功能链接库" - - # 检查环境是否已安装libsemanage-devel - LOG_INFO "检查libsemanage-devel是否已安装" - if rpm -q libsemanage-devel > /dev/null 2>&1; then - LOG_INFO "libsemanage-devel已安装,测试结束后将保持安装状态" - INSTALLED=1 - else - LOG_INFO "libsemanage-devel未安装,将在测试中安装" - INSTALLED=0 - fi - - # 检查yum源中是否有libsemanage-devel软件包 - LOG_INFO "检查yum源中是否有libsemanage-devel软件包" - if ! dnf list available libsemanage-devel > /dev/null 2>&1; then - LOG_ERROR "yum源中未找到libsemanage-devel软件包" - exit 255 - fi - - # 如果未安装,则安装libsemanage-devel - if [ $INSTALLED -eq 0 ]; then - LOG_INFO "安装libsemanage-devel软件包" - dnf install -y libsemanage-devel - CHECK_RESULT $? 0 0 "安装libsemanage-devel失败" - fi - - # 检查-lsemanage链接参数是否有效 - LOG_INFO "测试-lsemanage链接参数" - cat > test_libsemanage.c << "EOF" - #include - int main() { - semanage_handle_t *handle = NULL; - handle = semanage_handle_create(); - if (handle) { - semanage_handle_destroy(handle); - } - return 0; - } - EOF - - # 编译测试程序 - LOG_INFO "编译测试程序" - gcc test_libsemanage.c -o test_libsemanage -lsemanage - CHECK_RESULT $? 0 0 "编译失败,无法链接libsemanage库" - - # 运行测试程序 - LOG_INFO "运行测试程序" - ./test_libsemanage - CHECK_RESULT $? 0 0 "运行测试程序失败" - - # 清理临时文件 - LOG_INFO "清理临时文件" - rm -f test_libsemanage.c test_libsemanage - - # 如果测试前未安装,则卸载libsemanage-devel - if [ $INSTALLED -eq 0 ]; then - LOG_INFO "卸载libsemanage-devel软件包" - dnf remove -y libsemanage-devel - CHECK_RESULT $? 0 0 "卸载libsemanage-devel失败" - fi - - LOG_INFO "测试完成,环境已恢复" -} - -main "$@" \ No newline at end of file diff --git a/testcases/function_test/pkg_test/libsemanage/libsemanage-devel/test_libsemanage-devel_function_pkgconfig.sh b/testcases/function_test/pkg_test/libsemanage/libsemanage-devel/test_libsemanage-devel_function_pkgconfig.sh deleted file mode 100644 index 03ea41f6e0e..00000000000 --- a/testcases/function_test/pkg_test/libsemanage/libsemanage-devel/test_libsemanage-devel_function_pkgconfig.sh +++ /dev/null @@ -1,114 +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-01-28 -# @License : Mulan PSL v2 -# @Desc : 测试pkg-config(如可用)能够正确提供libsemanage的编译和链接参数(cflags, libs)。 -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - # 测试pkg-config(如可用)能够正确提供libsemanage的编译和链接参数(cflags, libs) - # 测试脚本:test_libsemanage-devel_function_pkgconfig - - # 定义软件包名称 - PACKAGE_NAME="libsemanage-devel" - PKGCONFIG_NAME="libsemanage" - - # 检查yum源中是否存在指定软件包 - 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 - - # 检查当前环境是否已安装软件包 - LOG_INFO "检查当前环境是否已安装软件包 $PACKAGE_NAME" - rpm -q $PACKAGE_NAME > /dev/null 2>&1 - if [ $? -eq 0 ]; then - INSTALLED="true" - LOG_INFO "软件包 $PACKAGE_NAME 已安装,测试结束后将保持安装状态" - else - INSTALLED="false" - LOG_INFO "软件包 $PACKAGE_NAME 未安装,将在测试过程中安装并最终卸载" - fi - - # 检查pkg-config命令是否可用 - LOG_INFO "检查pkg-config命令是否可用" - command -v pkg-config > /dev/null 2>&1 - if [ $? -ne 0 ]; then - LOG_INFO "pkg-config命令不可用,跳过pkg-config相关测试" - PKGCONFIG_AVAILABLE="false" - else - PKGCONFIG_AVAILABLE="true" - LOG_INFO "pkg-config命令可用,将进行相关测试" - fi - - # 如果未安装软件包,则进行安装 - if [ "$INSTALLED" = "false" ]; then - LOG_INFO "安装软件包 $PACKAGE_NAME" - dnf install -y $PACKAGE_NAME - CHECK_RESULT $? 0 0 "安装软件包 $PACKAGE_NAME 失败" - fi - - # 如果pkg-config可用,则测试其功能 - if [ "$PKGCONFIG_AVAILABLE" = "true" ]; then - LOG_INFO "测试pkg-config是否能够识别 $PKGCONFIG_NAME" - pkg-config --exists $PKGCONFIG_NAME - CHECK_RESULT $? 0 0 "pkg-config无法识别 $PKGCONFIG_NAME" - - LOG_INFO "测试pkg-config提供的cflags参数" - pkg-config --cflags $PKGCONFIG_NAME > /dev/null 2>&1 - CHECK_RESULT $? 0 0 "获取 $PKGCONFIG_NAME 的cflags参数失败" - - LOG_INFO "测试pkg-config提供的libs参数" - pkg-config --libs $PKGCONFIG_NAME > /dev/null 2>&1 - CHECK_RESULT $? 0 0 "获取 $PKGCONFIG_NAME 的libs参数失败" - - LOG_INFO "验证cflags和libs参数内容" - CFLAGS_OUTPUT=$(pkg-config --cflags $PKGCONFIG_NAME) - LIBS_OUTPUT=$(pkg-config --libs $PKGCONFIG_NAME) - - if [ -z "$CFLAGS_OUTPUT" ]; then - LOG_ERROR "cflags参数为空" - exit 1 - else - LOG_INFO "cflags参数: $CFLAGS_OUTPUT" - fi - - if [ -z "$LIBS_OUTPUT" ]; then - LOG_ERROR "libs参数为空" - exit 1 - else - LOG_INFO "libs参数: $LIBS_OUTPUT" - fi - else - LOG_INFO "pkg-config不可用,跳过相关测试步骤" - fi - - # 清理环境:如果测试前未安装软件包,则在测试后卸载 - if [ "$INSTALLED" = "false" ]; then - LOG_INFO "卸载软件包 $PACKAGE_NAME" - dnf remove -y $PACKAGE_NAME - CHECK_RESULT $? 0 0 "卸载软件包 $PACKAGE_NAME 失败" - else - LOG_INFO "测试前软件包已安装,测试后保持安装状态" - fi - - LOG_INFO "测试完成,环境已恢复" -} - -main "$@" \ No newline at end of file diff --git a/testcases/function_test/pkg_test/libsemanage/libsemanage-devel/test_libsemanage-devel_function_uninstall.sh b/testcases/function_test/pkg_test/libsemanage/libsemanage-devel/test_libsemanage-devel_function_uninstall.sh deleted file mode 100644 index 2fb218660e8..00000000000 --- a/testcases/function_test/pkg_test/libsemanage/libsemanage-devel/test_libsemanage-devel_function_uninstall.sh +++ /dev/null @@ -1,81 +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-01-28 -# @License : Mulan PSL v2 -# @Desc : 测试libsemanage-devel软件包的卸载功能,验证其能否被完全且干净地从系统中移除。 -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - # 设置脚本名称 - SCRIPT_NAME="test_libsemanage-devel_function_uninstall" - - # 初始化变量 - PACKAGE_NAME="libsemanage-devel" - IS_INSTALLED=0 - - # 打印步骤信息 - LOG_INFO "步骤1:检查${PACKAGE_NAME}软件包在yum源中的可用性" - if ! dnf list available ${PACKAGE_NAME} &> /dev/null; then - LOG_ERROR "yum源中不存在软件包:${PACKAGE_NAME}" - exit 255 - fi - CHECK_RESULT $? 0 0 "检查${PACKAGE_NAME}软件包在yum源中的可用性失败" - - LOG_INFO "步骤2:检查环境中是否已安装${PACKAGE_NAME}软件包" - if rpm -q ${PACKAGE_NAME} &> /dev/null; then - LOG_INFO "${PACKAGE_NAME}软件包已安装" - IS_INSTALLED=1 - else - LOG_INFO "${PACKAGE_NAME}软件包未安装" - IS_INSTALLED=0 - fi - - LOG_INFO "步骤3:执行软件包的安装步骤" - if [ ${IS_INSTALLED} -eq 0 ]; then - dnf install -y ${PACKAGE_NAME} - CHECK_RESULT $? 0 0 "安装${PACKAGE_NAME}软件包失败" - LOG_INFO "安装${PACKAGE_NAME}软件包成功" - else - LOG_INFO "环境中已安装${PACKAGE_NAME}软件包,跳过安装步骤" - fi - - LOG_INFO "步骤4:验证${PACKAGE_NAME}软件包的卸载功能" - dnf remove -y ${PACKAGE_NAME} - CHECK_RESULT $? 0 0 "卸载${PACKAGE_NAME}软件包失败" - LOG_INFO "卸载${PACKAGE_NAME}软件包成功" - - LOG_INFO "步骤5:检查软件包是否被完全移除" - if rpm -q ${PACKAGE_NAME} &> /dev/null; then - LOG_ERROR "${PACKAGE_NAME}软件包未完全移除" - CHECK_RESULT $? 1 0 "${PACKAGE_NAME}软件包未完全移除" - else - LOG_INFO "${PACKAGE_NAME}软件包已完全移除" - fi - - LOG_INFO "步骤6:清理环境,恢复到之前的状态" - if [ ${IS_INSTALLED} -eq 0 ]; then - LOG_INFO "初始状态未安装${PACKAGE_NAME}软件包,无需恢复" - else - dnf install -y ${PACKAGE_NAME} &> /dev/null - CHECK_RESULT $? 0 0 "恢复安装${PACKAGE_NAME}软件包失败" - LOG_INFO "成功恢复到初始安装状态" - fi - - LOG_INFO "测试脚本执行完毕" -} - -main "$@" \ No newline at end of file diff --git a/testcases/function_test/pkg_test/libsemanage/libsemanage-devel/test_libsemanage-devel_function_version.sh b/testcases/function_test/pkg_test/libsemanage/libsemanage-devel/test_libsemanage-devel_function_version.sh deleted file mode 100644 index 4f6ffe1fcd6..00000000000 --- a/testcases/function_test/pkg_test/libsemanage/libsemanage-devel/test_libsemanage-devel_function_version.sh +++ /dev/null @@ -1,126 +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-01-28 -# @License : Mulan PSL v2 -# @Desc : 验证软件包提供的用户命令(如secon)能否通过--version参数正确输出版本信息。 -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - set -e - - LOG_INFO "开始测试:验证软件包提供的用户命令(如secon)能否通过--version参数正确输出版本信息" - - # 检查是否已安装libsemanage-devel - LOG_INFO "步骤1:检查libsemanage-devel是否已安装" - if dnf list installed libsemanage-devel &>/dev/null; then - LOG_INFO "libsemanage-devel已安装,测试后将保持安装状态" - already_installed=true - else - LOG_INFO "libsemanage-devel未安装,将作为测试步骤安装" - already_installed=false - fi - - # 检查yum源中是否有libsemanage-devel软件包 - LOG_INFO "步骤2:检查yum源中是否有libsemanage-devel软件包" - if ! dnf list available libsemanage-devel &>/dev/null; then - LOG_ERROR "yum源中未找到libsemanage-devel软件包" - exit 255 - fi - - # 如果未安装,则安装软件包 - if [ "$already_installed" = false ]; then - LOG_INFO "步骤3:安装libsemanage-devel软件包" - dnf install -y libsemanage-devel - CHECK_RESULT $? 0 0 "安装libsemanage-devel失败" - fi - - # 查找软件包提供的用户命令(以secon为例) - LOG_INFO "步骤4:查找libsemanage-devel提供的用户命令" - # 这里以secon为例,实际可能还有其他命令 - command_name="secon" - if ! command -v "$command_name" &>/dev/null; then - LOG_INFO "未找到命令 $command_name,尝试查找其他可能命令" - # 可以添加其他可能的命令查找逻辑,例如: - # command_name="another_command" - # 这里简化处理,如果secon不存在,则尝试查找semanage - if command -v semanage &>/dev/null; then - command_name="semanage" - else - LOG_ERROR "未找到libsemanage-devel提供的用户命令" - # 如果是测试步骤安装的,则卸载后退出 - if [ "$already_installed" = false ]; then - dnf remove -y libsemanage-devel - fi - exit 1 - fi - fi - - LOG_INFO "使用命令: $command_name" - - # 检查命令是否支持--version参数 - LOG_INFO "步骤5:检查 $command_name 是否支持 --version 参数" - if ! "$command_name" --help 2>&1 | grep -q "\-\-version"; then - LOG_ERROR "命令 $command_name 不支持 --version 参数" - # 如果是测试步骤安装的,则卸载后退出 - if [ "$already_installed" = false ]; then - dnf remove -y libsemanage-devel - fi - exit 255 - fi - - # 执行命令并检查版本输出 - LOG_INFO "步骤6:执行 $command_name --version 并检查输出" - version_output=$("$command_name" --version 2>&1) - CHECK_RESULT $? 0 0 "执行 $command_name --version 失败" - - # 检查版本输出是否有效(非空且包含版本信息) - LOG_INFO "步骤7:验证版本输出内容" - if [ -z "$version_output" ]; then - LOG_ERROR "版本输出为空" - # 如果是测试步骤安装的,则卸载后退出 - if [ "$already_installed" = false ]; then - dnf remove -y libsemanage-devel - fi - exit 1 - fi - - # 简单检查输出中是否包含数字和点号(基本版本格式) - if ! echo "$version_output" | grep -q -E "[0-9]+\.[0-9]+"; then - LOG_ERROR "版本输出格式不正确: $version_output" - # 如果是测试步骤安装的,则卸载后退出 - if [ "$already_installed" = false ]; then - dnf remove -y libsemanage-devel - fi - exit 1 - fi - - LOG_INFO "版本输出正确: $version_output" - - # 环境清理:如果测试前未安装,则卸载软件包 - LOG_INFO "步骤8:清理测试环境" - if [ "$already_installed" = false ]; then - LOG_INFO "卸载测试安装的libsemanage-devel软件包" - dnf remove -y libsemanage-devel - CHECK_RESULT $? 0 0 "卸载libsemanage-devel失败" - else - LOG_INFO "保持libsemanage-devel安装状态" - fi - - LOG_INFO "测试完成:成功验证软件包提供的用户命令能通过--version参数正确输出版本信息" -} - -main "$@" \ No newline at end of file diff --git a/testcases/function_test/pkg_test/libsemanage/libsemanage-devel/test_libsemanage-devel_install.sh b/testcases/function_test/pkg_test/libsemanage/libsemanage-devel/test_libsemanage-devel_install.sh deleted file mode 100644 index 8b8544e3f6f..00000000000 --- a/testcases/function_test/pkg_test/libsemanage/libsemanage-devel/test_libsemanage-devel_install.sh +++ /dev/null @@ -1,59 +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-08-02 -# @License : Mulan PSL v2 -# @Desc : 测试libsemanage-devel软件包的安装功能,验证是否能够正确安装到系统中。 -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - # 检查libsemanage-devel软件包是否已安装 - LOG_INFO "检查libsemanage-devel软件包是否已安装" - rpm -q libsemanage-devel > /dev/null 2>&1 - if [ $? -eq 0 ]; then - LOG_INFO "libsemanage-devel软件包已安装,脚本结束时将保持安装状态" - installed=true - else - LOG_INFO "libsemanage-devel软件包未安装,将在测试结束后卸载" - installed=false - fi - - # 检查yum源中是否存在libsemanage-devel软件包 - LOG_INFO "检查yum源中是否存在libsemanage-devel软件包" - dnf list available libsemanage-devel > /dev/null 2>&1 - CHECK_RESULT $? 0 255 "yum源中不存在libsemanage-devel软件包" - - # 安装libsemanage-devel软件包 - LOG_INFO "开始安装libsemanage-devel软件包" - dnf install -y libsemanage-devel - CHECK_RESULT $? 0 0 "安装libsemanage-devel软件包失败" - - # 验证libsemanage-devel软件包是否成功安装 - LOG_INFO "验证libsemanage-devel软件包是否成功安装" - rpm -q libsemanage-devel > /dev/null 2>&1 - CHECK_RESULT $? 0 0 "libsemanage-devel软件包未正确安装" - - # 如果脚本开始时未安装,则在测试结束后卸载 - if [ "$installed" = false ]; then - LOG_INFO "卸载libsemanage-devel软件包" - dnf remove -y libsemanage-devel - CHECK_RESULT $? 0 0 "卸载libsemanage-devel软件包失败" - fi - - LOG_INFO "测试完成,环境已恢复" -} - -main "$@" \ No newline at end of file diff --git a/testcases/function_test/pkg_test/libsemanage/libsemanage-devel/test_libsemanage-devel_secon_current.sh b/testcases/function_test/pkg_test/libsemanage/libsemanage-devel/test_libsemanage-devel_secon_current.sh deleted file mode 100644 index c699ed6ef11..00000000000 --- a/testcases/function_test/pkg_test/libsemanage/libsemanage-devel/test_libsemanage-devel_secon_current.sh +++ /dev/null @@ -1,60 +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-08-02 -# @License : Mulan PSL v2 -# @Desc : 测试 secon 命令的 --current/--self选项,获取当前进程的上下文 -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - LOG_INFO "开始测试 secon 命令的 --current/--self 选项,获取当前进程的上下文" - - # 检查是否已安装 libsemanage-devel - LOG_INFO "检查 libsemanage-devel 是否已安装" - if ! dnf list installed libsemanage-devel &>/dev/null; then - LOG_INFO "libsemanage-devel 未安装,尝试从 yum 源安装" - if ! dnf list available libsemanage-devel &>/dev/null; then - LOG_ERROR "yum 源中未找到 libsemanage-devel 软件包" - exit 255 - fi - dnf install -y libsemanage-devel - CHECK_RESULT $? 0 0 "安装 libsemanage-devel 失败" - INSTALLED=1 - else - LOG_INFO "libsemanage-devel 已安装" - INSTALLED=0 - fi - - # 测试 secon --current/--self 选项 - LOG_INFO "测试 secon --current 选项" - secon --current &>/dev/null - CHECK_RESULT $? 0 0 "secon --current 执行失败" - - LOG_INFO "测试 secon --self 选项" - secon --self &>/dev/null - CHECK_RESULT $? 0 0 "secon --self 执行失败" - - # 清理环境 - if [ "$INSTALLED" -eq 1 ]; then - LOG_INFO "卸载 libsemanage-devel" - dnf remove -y libsemanage-devel - CHECK_RESULT $?-eq-1 0 255 || CHECK_RESULT $? -eq 255 && exit $? || CHECK_RESULT $? -ne-1 && CHECK_RESULT $? -ne-255 && CHECK_RESULT $? -eq 0 0 "卸载 libsemanage-devel失败" || true - fi - - LOG_INFO "测试完成" -} - -main "$@" \ No newline at end of file From f9e0292e51c2dbfed0987aef65a06cb3d3a53d2b Mon Sep 17 00:00:00 2001 From: honghua Date: Tue, 21 Apr 2026 13:31:48 +0800 Subject: [PATCH 16/18] update testcase for testsuite texlive-fifinddo-info-doc --- .../pkg_test/texlive-split-i/texlive-fifinddo-info-doc.json | 4 ---- 1 file changed, 4 deletions(-) diff --git a/suite2cases/function_test/pkg_test/texlive-split-i/texlive-fifinddo-info-doc.json b/suite2cases/function_test/pkg_test/texlive-split-i/texlive-fifinddo-info-doc.json index 7fd9dae94ba..06d07423344 100644 --- a/suite2cases/function_test/pkg_test/texlive-split-i/texlive-fifinddo-info-doc.json +++ b/suite2cases/function_test/pkg_test/texlive-split-i/texlive-fifinddo-info-doc.json @@ -7,10 +7,6 @@ "desc": "测试 texlive-fifinddo-info-doc 软件包的安装功能,验证是否能够正确安装到系统中。", "machine num": 1 }, - { - "name": "test_texlive-fifinddo-info-doc_function_install", - "desc": "测试 texlive-fifinddo-info-doc 软件包是否能够通过系统包管理器成功安装,并验证安装后相关文档文件的存在性。" - }, { "name": "test_texlive-fifinddo-info-doc_function_uninstall", "desc": "测试 texlive-fifinddo-info-doc 软件包的卸载功能,确保能够完全移除且不残留关键文件。" From f6fe31dedd5766fcadd6b1670d30fb1eeb8625f3 Mon Sep 17 00:00:00 2001 From: honghua Date: Tue, 21 Apr 2026 13:32:28 +0800 Subject: [PATCH 17/18] update testcase for testsuite dconf-devel --- .../pkg_test/dconf/dconf-devel.json | 10 --- .../test_dconf-devel_function_config.sh | 74 ------------------- 2 files changed, 84 deletions(-) delete mode 100644 suite2cases/function_test/pkg_test/dconf/dconf-devel.json delete mode 100644 testcases/function_test/pkg_test/dconf/dconf-devel/test_dconf-devel_function_config.sh diff --git a/suite2cases/function_test/pkg_test/dconf/dconf-devel.json b/suite2cases/function_test/pkg_test/dconf/dconf-devel.json deleted file mode 100644 index ea247b3d23f..00000000000 --- a/suite2cases/function_test/pkg_test/dconf/dconf-devel.json +++ /dev/null @@ -1,10 +0,0 @@ -{ - "path": "$OET_PATH/testcases/function_test/pkg_test/dconf/dconf-devel", - "machine num": 1, - "cases": [ - { - "name": "test_dconf-devel_function_config", - "desc": "Test the configuration functionality of dconf-devel" - } - ] -} \ No newline at end of file diff --git a/testcases/function_test/pkg_test/dconf/dconf-devel/test_dconf-devel_function_config.sh b/testcases/function_test/pkg_test/dconf/dconf-devel/test_dconf-devel_function_config.sh deleted file mode 100644 index fef22560c9f..00000000000 --- a/testcases/function_test/pkg_test/dconf/dconf-devel/test_dconf-devel_function_config.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 : 2025-11-27 -# @License : Mulan PSL v2 -# @Desc : Test the configuration functionality of dconf-devel -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - - # 测试dconf-devel的配置功能 - LOG_INFO "开始测试dconf-devel的配置功能" - - # 检查是否已安装dconf-devel - LOG_INFO "检查是否已安装dconf-devel" - if rpm -q dconf-devel &>/dev/null; then - LOG_INFO "dconf-devel已安装,脚本结束时将保持安装状态" - INSTALLED=true - else - LOG_INFO "dconf-devel未安装,将在测试步骤中安装" - INSTALLED=false - fi - - # 检查yum源中是否有dconf-devel软件包 - LOG_INFO "检查yum源中是否有dconf-devel软件包" - if ! dnf list available dconf-devel &>/dev/null; then - LOG_ERROR "yum源中未找到dconf-devel软件包" - exit 255 - fi - - # 安装dconf-devel(如果未安装) - if [ "$INSTALLED" = false ]; then - LOG_INFO "安装dconf-devel软件包" - dnf install -y dconf-devel - CHECK_RESULT $? 0 0 "安装dconf-devel失败" - fi - - # 测试配置功能 - LOG_INFO "测试dconf-devel的配置功能" - if ! command -v dconf &>/dev/null; then - LOG_ERROR "dconf命令不存在或不支持" - exit 255 - fi - - # 执行配置命令 - LOG_INFO "执行配置命令" - dconf reset -f /org/example/test - CHECK_RESULT $? 0 0 "dconf配置命令执行失败" - - # 清理环境(如果脚本开始时未安装) - if [ "$INSTALLED" = false ]; then - LOG_INFO "卸载dconf-devel软件包" - dnf remove -y dconf-devel - CHECK_RESULT $? 0 0 "卸载dconf-devel失败" - fi - - LOG_INFO "测试完成,环境已恢复" - -} - -main "$@" \ No newline at end of file From ad3f28750e36b455e6b1a2211a515ce89e2c7352 Mon Sep 17 00:00:00 2001 From: honghua Date: Tue, 21 Apr 2026 13:36:19 +0800 Subject: [PATCH 18/18] update testcase for testsuite texlive-realscripts --- .../texlive-split-t/texlive-realscripts.json | 4 - ...test_texlive-realscripts_function_usage.sh | 92 ------------------- 2 files changed, 96 deletions(-) delete mode 100644 testcases/function_test/pkg_test/texlive-split-t/texlive-realscripts/test_texlive-realscripts_function_usage.sh diff --git a/suite2cases/function_test/pkg_test/texlive-split-t/texlive-realscripts.json b/suite2cases/function_test/pkg_test/texlive-split-t/texlive-realscripts.json index 741696895f7..5f3e2e0f553 100644 --- a/suite2cases/function_test/pkg_test/texlive-split-t/texlive-realscripts.json +++ b/suite2cases/function_test/pkg_test/texlive-split-t/texlive-realscripts.json @@ -13,10 +13,6 @@ { "name": "test_texlive-realscripts_function_check", "desc": "Check if texlive-realscripts is installed" - }, - { - "name": "test_texlive-realscripts_function_usage", - "desc": "Test basic LaTeX usage with realscripts" } ] } \ No newline at end of file diff --git a/testcases/function_test/pkg_test/texlive-split-t/texlive-realscripts/test_texlive-realscripts_function_usage.sh b/testcases/function_test/pkg_test/texlive-split-t/texlive-realscripts/test_texlive-realscripts_function_usage.sh deleted file mode 100644 index 5d273bc9523..00000000000 --- a/testcases/function_test/pkg_test/texlive-split-t/texlive-realscripts/test_texlive-realscripts_function_usage.sh +++ /dev/null @@ -1,92 +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-02-26 -# @License : Mulan PSL v2 -# @Desc : Test basic LaTeX usage with realscripts -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - LOG_INFO "开始测试:Test basic LaTeX usage with realscripts" - - # 定义软件包名称 - PACKAGE_NAME="texlive-realscripts" - - # 检查软件包是否已在yum源中 - LOG_INFO "检查yum源中是否存在软件包 $PACKAGE_NAME" - dnf list available $PACKAGE_NAME &>/dev/null - if [ $? -ne 0 ]; then - LOG_ERROR "软件包 $PACKAGE_NAME 在yum源中不存在" - exit 255 - fi - - # 检查是否已安装 - LOG_INFO "检查系统是否已安装 $PACKAGE_NAME" - if rpm -q $PACKAGE_NAME &>/dev/null; then - LOG_INFO "软件包 $PACKAGE_NAME 已安装,测试结束后保持安装状态" - INSTALLED_BEFORE_TEST=1 - else - LOG_INFO "软件包 $PACKAGE_NAME 未安装,将在测试过程中安装" - INSTALLED_BEFORE_TEST=0 - fi - - # 如果未安装,则安装软件包 - if [ $INSTALLED_BEFORE_TEST -eq 0 ]; then - LOG_INFO "安装软件包 $PACKAGE_NAME" - dnf install -y $PACKAGE_NAME - CHECK_RESULT $? 0 0 "安装软件包 $PACKAGE_NAME 失败" - fi - - # 测试基本LaTeX使用realscripts - LOG_INFO "测试基本LaTeX使用realscripts功能" - # 创建一个简单的LaTeX测试文件 - cat > test_realscripts.tex << "EOF" - \documentclass{article} - \usepackage{realscripts} - \begin{document} - Test of realscripts package. - \end{document} - EOF - - # 编译LaTeX文件 - LOG_INFO "编译LaTeX测试文件" - pdflatex test_realscripts.tex - CHECK_RESULT $? 0 0 "编译LaTeX文件失败" - - # 检查生成的PDF文件 - LOG_INFO "检查生成的PDF文件" - if [ -f test_realscripts.pdf ]; then - LOG_INFO "PDF文件生成成功" - else - LOG_ERROR "PDF文件未生成" - exit 1 - fi - - # 清理测试文件 - LOG_INFO "清理测试文件" - rm -f test_realscripts.tex test_realscripts.pdf test_realscripts.log test_realscripts.aux test_realscripts.out - - # 如果测试前未安装,则卸载软件包 - if [ $INSTALLED_BEFORE_TEST -eq 0 ]; then - LOG_INFO "卸载软件包 $PACKAGE_NAME" - dnf remove -y $PACKAGE_NAME - CHECK_RESULT $? 0 0 "卸载软件包 $PACKAGE_NAME 失败" - fi - - LOG_INFO "测试完成:Test basic LaTeX usage with realscripts" -} - -main "$@" \ No newline at end of file