diff --git a/suite2cases/function_test/pkg_test/glibc/glibc-all-langpacks.json b/suite2cases/function_test/pkg_test/glibc/glibc-all-langpacks.json index d6a94e1fe63..8b6f323d5b9 100644 --- a/suite2cases/function_test/pkg_test/glibc/glibc-all-langpacks.json +++ b/suite2cases/function_test/pkg_test/glibc/glibc-all-langpacks.json @@ -22,14 +22,6 @@ "name": "test_glibc-all-langpacks_function_basic_locale", "desc": "测试基本系统语言环境功能正常" }, - { - "name": "test_glibc-all-langpacks_function_locale_gen", - "desc": "测试从软件包生成新locale" - }, - { - "name": "test_glibc-all-langpacks_function_switch_locale", - "desc": "测试切换系统语言环境" - }, { "name": "test_glibc-all-langpacks_function_pkg_integrity", "desc": "测试软件包文件完整性校验" diff --git a/suite2cases/function_test/pkg_test/moby/moby-client.json b/suite2cases/function_test/pkg_test/moby/moby-client.json deleted file mode 100644 index eac2d30e78b..00000000000 --- a/suite2cases/function_test/pkg_test/moby/moby-client.json +++ /dev/null @@ -1,62 +0,0 @@ -{ - "path": "$OET_PATH/testcases/function_test/pkg_test/moby/moby-client", - "machine num": 1, - "cases": [ - { - "name": "test_moby-client_docker__upper_v", - "desc": "测试 docker 命令的版本信息显示功能" - }, - { - "name": "test_moby-client_docker__v", - "desc": "测试 docker 命令的版本信息显示功能" - }, - { - "name": "test_moby-client_docker__debug", - "desc": "测试 docker 命令的调试模式功能" - }, - { - "name": "test_moby-client_docker__host", - "desc": "测试 docker 命令的守护进程套接字连接功能" - }, - { - "name": "test_moby-client_docker__log_level", - "desc": "测试 docker 命令的日志级别设置功能" - }, - { - "name": "test_moby-client_docker__tls", - "desc": "测试 docker 命令的 TLS 使用功能" - }, - { - "name": "test_moby-client_docker__tlsverify", - "desc": "测试 docker 命令的 TLS 验证功能" - }, - { - "name": "test_moby-client_function_run", - "desc": "测试 docker 命令的运行容器功能" - }, - { - "name": "test_moby-client_function_build", - "desc": "测试 docker 命令的构建镜像功能" - }, - { - "name": "test_moby-client_function_pull", - "desc": "测试 docker 命令的拉取镜像功能" - }, - { - "name": "test_moby-client_function_push", - "desc": "测试 docker 命令的推送镜像功能" - }, - { - "name": "test_moby-client_function_rm", - "desc": "测试 docker 命令的删除容器功能" - }, - { - "name": "test_moby-client_function_rmi", - "desc": "测试 docker 命令的删除镜像功能" - }, - { - "name": "test_moby-client_function_ps", - "desc": "测试 docker 命令的列出容器功能" - } - ] -} \ No newline at end of file diff --git a/suite2cases/function_test/pkg_test/python-xlrd/python-xlrd-help.json b/suite2cases/function_test/pkg_test/python-xlrd/python-xlrd-help.json deleted file mode 100644 index cbb0a0f8734..00000000000 --- a/suite2cases/function_test/pkg_test/python-xlrd/python-xlrd-help.json +++ /dev/null @@ -1,10 +0,0 @@ -{ - "path": "$OET_PATH/testcases/function_test/pkg_test/python-xlrd/python-xlrd-help", - "machine num": 1, - "cases": [ - { - "name": "test_python-xlrd-help_function_read", - "desc": "Test reading Excel files" - } - ] -} \ No newline at end of file diff --git a/suite2cases/function_test/pkg_test/qt6-qtquick3dphysics/qt6-qtquick3dphysics-examples.json b/suite2cases/function_test/pkg_test/qt6-qtquick3dphysics/qt6-qtquick3dphysics-examples.json deleted file mode 100644 index 7962dd7f675..00000000000 --- a/suite2cases/function_test/pkg_test/qt6-qtquick3dphysics/qt6-qtquick3dphysics-examples.json +++ /dev/null @@ -1,10 +0,0 @@ -{ - "path": "$OET_PATH/testcases/function_test/pkg_test/qt6-qtquick3dphysics/qt6-qtquick3dphysics-examples", - "machine num": 1, - "cases": [ - { - "name": "test_qt6-qtquick3dphysics-examples_function_basic", - "desc": "Test basic functionality of qt6-qtquick3dphysics-examples" - } - ] -} \ No newline at end of file diff --git a/suite2cases/function_test/pkg_test/texlive-split-a/texlive-acro.json b/suite2cases/function_test/pkg_test/texlive-split-a/texlive-acro.json index 4f0da42d5c1..59de9b0a917 100644 --- a/suite2cases/function_test/pkg_test/texlive-split-a/texlive-acro.json +++ b/suite2cases/function_test/pkg_test/texlive-split-a/texlive-acro.json @@ -10,21 +10,9 @@ "name": "test_texlive-acro_function_install", "desc": "Test installation of texlive-acro package" }, - { - "name": "test_texlive-acro_function_uninstall", - "desc": "Test uninstallation of texlive-acro package" - }, { "name": "test_texlive-acro_function_check", "desc": "Check if texlive-acro package is installed" - }, - { - "name": "test_texlive-acro_function_basic_usage", - "desc": "Test basic usage of acro commands in a LaTeX document" - }, - { - "name": "test_texlive-acro_function_list", - "desc": "Test listing of acronyms in the document" } ] } \ No newline at end of file diff --git a/suite2cases/function_test/pkg_test/texlive-split-n/texlive-luabibentry-doc.json b/suite2cases/function_test/pkg_test/texlive-split-n/texlive-luabibentry-doc.json deleted file mode 100644 index 70db2d6667b..00000000000 --- a/suite2cases/function_test/pkg_test/texlive-split-n/texlive-luabibentry-doc.json +++ /dev/null @@ -1,10 +0,0 @@ -{ - "path": "$OET_PATH/testcases/function_test/pkg_test/texlive-split-n/texlive-luabibentry-doc", - "machine num": 1, - "cases": [ - { - "name": "test_texlive-luabibentry-doc_function_install", - "desc": "Test package installation" - } - ] -} \ No newline at end of file diff --git a/suite2cases/function_test/pkg_test/texlive-split-y/texlive-gettitlestring.json b/suite2cases/function_test/pkg_test/texlive-split-y/texlive-gettitlestring.json deleted file mode 100644 index 34c56828e3e..00000000000 --- a/suite2cases/function_test/pkg_test/texlive-split-y/texlive-gettitlestring.json +++ /dev/null @@ -1,10 +0,0 @@ -{ - "path": "$OET_PATH/testcases/function_test/pkg_test/texlive-split-y/texlive-gettitlestring", - "machine num": 1, - "cases": [ - { - "name": "test_texlive-gettitlestring_function_basic", - "desc": "Test basic functionality of texlive-gettitlestring" - } - ] -} \ No newline at end of file diff --git a/suite2cases/function_test/pkg_test/texlive-split-y/texlive-uni-wtal-ger-doc.json b/suite2cases/function_test/pkg_test/texlive-split-y/texlive-uni-wtal-ger-doc.json index deadbe227a3..fff171fa342 100644 --- a/suite2cases/function_test/pkg_test/texlive-split-y/texlive-uni-wtal-ger-doc.json +++ b/suite2cases/function_test/pkg_test/texlive-split-y/texlive-uni-wtal-ger-doc.json @@ -10,22 +10,6 @@ { "name": "test_texlive-uni-wtal-ger-doc_function_install", "desc": "测试 texlive-uni-wtal-ger-doc 软件包的安装功能,验证安装是否成功。" - }, - { - "name": "test_texlive-uni-wtal-ger-doc_function_verify_install", - "desc": "验证 texlive-uni-wtal-ger-doc 软件包是否已正确安装到系统中。" - }, - { - "name": "test_texlive-uni-wtal-ger-doc_function_list_files", - "desc": "列出 texlive-uni-wtal-ger-doc 软件包安装的所有文档文件。" - }, - { - "name": "test_texlive-uni-wtal-ger-doc_function_view_doc", - "desc": "检查 texlive-uni-wtal-ger-doc 软件包的主要文档文件(如 PDF、README)是否存在并可访问。" - }, - { - "name": "test_texlive-uni-wtal-ger-doc_function_remove", - "desc": "测试 texlive-uni-wtal-ger-doc 软件包的卸载功能,验证卸载是否干净。" } ] } \ No newline at end of file diff --git a/testcases/function_test/pkg_test/glibc/glibc-all-langpacks/test_glibc-all-langpacks_function_locale_gen.sh b/testcases/function_test/pkg_test/glibc/glibc-all-langpacks/test_glibc-all-langpacks_function_locale_gen.sh deleted file mode 100644 index 7f3dc0b6887..00000000000 --- a/testcases/function_test/pkg_test/glibc/glibc-all-langpacks/test_glibc-all-langpacks_function_locale_gen.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-03-12 -# @License : Mulan PSL v2 -# @Desc : 测试从软件包生成新locale -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - LOG_INFO "开始测试:测试从软件包生成新locale" - - # 定义软件包名称 - PACKAGE_NAME="glibc-all-langpacks" - - # 检查软件包是否已在yum源中 - LOG_INFO "检查yum源中是否存在软件包:$PACKAGE_NAME" - if ! dnf list available "$PACKAGE_NAME" &>/dev/null; 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=true - else - LOG_INFO "软件包 $PACKAGE_NAME 未安装,将在测试步骤中安装" - INSTALLED_BEFORE_TEST=false - fi - - # 如果未安装,则安装软件包 - if [ "$INSTALLED_BEFORE_TEST" = false ]; then - LOG_INFO "安装软件包:$PACKAGE_NAME" - dnf install -y "$PACKAGE_NAME" - CHECK_RESULT $? 0 0 "安装软件包 $PACKAGE_NAME 失败" - fi - - # 检查locale-gen命令是否可用 - LOG_INFO "检查locale-gen命令是否可用" - if ! command -v locale-gen &>/dev/null; then - LOG_ERROR "locale-gen命令不存在或不支持" - exit 255 - fi - - # 测试生成新locale - LOG_INFO "测试生成新locale:en_US.UTF-8" - locale-gen en_US.UTF-8 - CHECK_RESULT $? 0 0 "生成locale en_US.UTF-8 失败" - - # 验证生成的locale是否可用 - LOG_INFO "验证生成的locale是否可用" - locale -a | grep -q "en_US.utf8" - CHECK_RESULT $? 0 0 "生成的locale en_US.UTF-8 未在可用locale列表中" - - # 清理环境:如果测试前未安装,则卸载软件包 - if [ "$INSTALLED_BEFORE_TEST" = false ]; then - LOG_INFO "卸载软件包:$PACKAGE_NAME" - dnf remove -y "$PACKAGE_NAME" - CHECK_RESULT $? 0 0 "卸载软件包 $PACKAGE_NAME 失败" - else - LOG_INFO "测试前已安装软件包,测试结束后保持安装状态" - fi - - LOG_INFO "测试完成:测试从软件包生成新locale" -} - -main "$@" \ No newline at end of file diff --git a/testcases/function_test/pkg_test/glibc/glibc-all-langpacks/test_glibc-all-langpacks_function_switch_locale.sh b/testcases/function_test/pkg_test/glibc/glibc-all-langpacks/test_glibc-all-langpacks_function_switch_locale.sh deleted file mode 100644 index 670e47e1313..00000000000 --- a/testcases/function_test/pkg_test/glibc/glibc-all-langpacks/test_glibc-all-langpacks_function_switch_locale.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-12 -# @License : Mulan PSL v2 -# @Desc : 测试切换系统语言环境 -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - set -e - - LOG_INFO "开始测试:切换系统语言环境" - - LOG_INFO "步骤1:检查glibc-all-langpacks软件包是否在yum源中" - if ! dnf list available glibc-all-langpacks &>/dev/null; then - LOG_ERROR "glibc-all-langpacks软件包不在yum源中" - exit 255 - fi - - LOG_INFO "步骤2:检查当前glibc-all-langpacks软件包是否已安装" - if rpm -q glibc-all-langpacks &>/dev/null; then - LOG_INFO "glibc-all-langpacks软件包已安装,测试完成后将保持安装状态" - INSTALLED_BEFORE_TEST=true - else - LOG_INFO "glibc-all-langpacks软件包未安装,将在测试步骤中安装" - INSTALLED_BEFORE_TEST=false - fi - - if [ "$INSTALLED_BEFORE_TEST" = false ]; then - LOG_INFO "步骤3:安装glibc-all-langpacks软件包" - dnf install -y glibc-all-langpacks - CHECK_RESULT $? 0 0 "安装glibc-all-langpacks软件包失败" - fi - - LOG_INFO "步骤4:检查localectl命令是否支持set-locale参数" - if ! localectl help 2>&1 | grep -q "set-locale"; then - LOG_ERROR "localectl命令不支持set-locale参数" - exit 255 - fi - - LOG_INFO "步骤5:备份当前系统语言环境设置" - CURRENT_LOCALE=$(localectl status | grep "System Locale" | awk -F= "{print $2}" | xargs) - LOG_INFO "当前系统语言环境为:$CURRENT_LOCALE" - - LOG_INFO "步骤6:切换系统语言环境到中文(zh_CN.UTF-8)" - localectl set-locale LANG=zh_CN.UTF-8 - CHECK_RESULT $? 0 0 "设置系统语言环境为zh_CN.UTF-8失败" - - LOG_INFO "步骤7:验证系统语言环境是否已切换" - NEW_LOCALE=$(localectl status | grep "System Locale" | awk -F= "{print $2}" | xargs) - if [ "$NEW_LOCALE" = "LANG=zh_CN.UTF-8" ]; then - LOG_INFO "系统语言环境已成功切换为:$NEW_LOCALE" - else - LOG_ERROR "系统语言环境切换验证失败,当前设置为:$NEW_LOCALE" - exit 1 - fi - - LOG_INFO "步骤8:恢复系统语言环境到原始设置" - if [ -n "$CURRENT_LOCALE" ]; then - localectl set-locale "$CURRENT_LOCALE" - CHECK_RESULT $? 0 0 "恢复系统语言环境失败" - LOG_INFO "系统语言环境已恢复为:$CURRENT_LOCALE" - else - LOG_INFO "原始系统语言环境为空,无需恢复" - fi - - LOG_INFO "步骤9:验证系统语言环境已恢复" - RESTORED_LOCALE=$(localectl status | grep "System Locale" | awk -F= "{print $2}" | xargs) - if [ "$RESTORED_LOCALE" = "$CURRENT_LOCALE" ]; then - LOG_INFO "系统语言环境恢复验证成功" - else - LOG_ERROR "系统语言环境恢复验证失败,当前设置为:$RESTORED_LOCALE" - exit 1 - fi - - if [ "$INSTALLED_BEFORE_TEST" = false ]; then - LOG_INFO "步骤10:卸载glibc-all-langpacks软件包" - dnf remove -y glibc-all-langpacks - CHECK_RESULT $? 0 0 "卸载glibc-all-langpacks软件包失败" - LOG_INFO "glibc-all-langpacks软件包已卸载" - else - LOG_INFO "步骤10:测试前已安装glibc-all-langpacks,保持安装状态" - fi - - LOG_INFO "测试完成:切换系统语言环境测试通过" -} - -main "$@" \ No newline at end of file diff --git a/testcases/function_test/pkg_test/moby/moby-client/test_moby-client_docker__debug.sh b/testcases/function_test/pkg_test/moby/moby-client/test_moby-client_docker__debug.sh deleted file mode 100644 index 6296cecda55..00000000000 --- a/testcases/function_test/pkg_test/moby/moby-client/test_moby-client_docker__debug.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 : 2025-12-11 -# @License : Mulan PSL v2 -# @Desc : 测试 docker 命令的调试模式功能 -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - # 测试脚本:test_moby-client_docker__debug - - LOG_INFO "开始测试 docker 命令的调试模式功能" - - # 检查是否已安装 moby-client 和 docker - LOG_INFO "检查是否已安装 moby-client 和 docker" - if ! dnf list installed moby-client &> /dev/null || ! dnf list installed docker &> /dev/null; then - LOG_INFO "环境未安装 moby-client 或 docker,将进行安装" - INSTALLED=false - else - LOG_INFO "环境已安装 moby-client 和 docker" - INSTALLED=true - fi - - # 检查 yum 源中是否有 moby-client 和 docker - LOG_INFO "检查 yum 源中是否有 moby-client 和 docker" - if ! dnf list available moby-client &> /dev/null || ! dnf list available docker &> /dev/null; then - LOG_ERROR "yum 源中未找到 moby-client 或 docker" - exit 255 - fi - - # 如果未安装,则安装软件包 - if [ "$INSTALLED" = false ]; then - LOG_INFO "开始安装 moby-client 和 docker" - dnf install -y moby-client docker - CHECK_RESULT $? 0 0 "安装 moby-client 和 docker 失败" - fi - - # 测试调试模式功能 - LOG_INFO "测试 docker --debug 命令" - docker --debug &> /dev/null - CHECK_RESULT $? 0 0 "docker --debug 命令不支持或执行失败" - - LOG_INFO "测试 docker --help-debug 命令" - docker --help-debug &> /dev/null - CHECK_RESULT $? 0 0 "docker --help-debug命令不支持或执行失败" - - #恢复环境 - if [ "$INSTALLED" = false ]; then - LOG_INFO "卸载 moby-client和docker" - dnf remove -y moby-client docker - CHECK_RESULT $? 0 0 "卸载moby-client和docker失败" - fi - - LOG_INFO "测试完成" -} - -main "$@" \ No newline at end of file diff --git a/testcases/function_test/pkg_test/moby/moby-client/test_moby-client_docker__host.sh b/testcases/function_test/pkg_test/moby/moby-client/test_moby-client_docker__host.sh deleted file mode 100644 index fbf56ee816a..00000000000 --- a/testcases/function_test/pkg_test/moby/moby-client/test_moby-client_docker__host.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-11 -# @License : Mulan PSL v2 -# @Desc : 测试 docker 命令的守护进程套接字连接功能 -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - - # 检查是否已安装moby-client和docker相关软件包 - LOG_INFO "检查是否已安装moby-client和docker相关软件包" - if ! dnf list installed moby-client &>/dev/null; then - LOG_INFO "moby-client未安装,将进行安装测试" - INSTALLED=false - else - LOG_INFO "moby-client已安装,跳过安装测试" - INSTALLED=true - fi - - # 检查yum源中是否存在moby-client软件包 - LOG_INFO "检查yum源中是否存在moby-client软件包" - if ! dnf list available moby-client &>/dev/null; then - LOG_ERROR "yum源中未找到moby-client软件包" - exit 255 - fi - - # 如果未安装,则安装moby-client - if [ "$INSTALLED" = false ]; then - LOG_INFO "安装moby-client软件包" - dnf install -y moby-client - CHECK_RESULT $? 0 0 "安装moby-client失败" - fi - - # 测试docker命令的守护进程套接字连接功能 - LOG_INFO "测试docker命令的守护进程套接字连接功能" - docker -H unix:///var/run/docker.sock version &>/dev/null - CHECK_RESULT $? 0 0 "docker守护进程套接字连接失败" - - # 如果之前未安装,则卸载moby-client以恢复环境 - if [ "$INSTALLED" = false ]; then - LOG_INFO "卸载moby-client软件包以恢复环境" - dnf remove -y moby-client - CHECK_RESULT $? 0 0 "卸载moby-client失败" - fi - - LOG_INFO "测试脚本执行完成,环境已恢复" - -} - -main "$@" \ No newline at end of file diff --git a/testcases/function_test/pkg_test/moby/moby-client/test_moby-client_docker__log_level.sh b/testcases/function_test/pkg_test/moby/moby-client/test_moby-client_docker__log_level.sh deleted file mode 100644 index 0c5367d2530..00000000000 --- a/testcases/function_test/pkg_test/moby/moby-client/test_moby-client_docker__log_level.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 : 2025-12-11 -# @License : Mulan PSL v2 -# @Desc : 测试 docker 命令的日志级别设置功能 -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - LOG_INFO "开始测试 docker 命令的日志级别设置功能" - - # 检查是否已安装 moby-client-docker - LOG_INFO "检查是否已安装 moby-client-docker" - if ! dnf list installed moby-client-docker &>/dev/null; then - LOG_INFO "moby-client-docker 未安装,将进行安装" - INSTALLED=false - else - LOG_INFO "moby-client-docker 已安装" - INSTALLED=true - fi - - # 检查 yum 源中是否存在 moby-client-docker - LOG_INFO "检查 yum 源中是否存在 moby-client-docker" - if ! dnf list available moby-client-docker &>/dev/null; then - LOG_ERROR "yum 源中未找到 moby-client-docker" - exit 255 - fi - - # 如果未安装,则安装 moby-client-docker - if [ "$INSTALLED" = false ]; then - LOG_INFO "安装 moby-client-docker" - dnf install -y moby-client-docker - CHECK_RESULT $? 0 0 "安装 moby-client-docker 失败" - fi - - # 测试 docker --log-level 参数支持情况 - LOG_INFO "测试 docker --log-level 参数支持情况" - docker --log-level &>/dev/null - if [ $? -ne 0 ]; then - LOG_ERROR "docker --log-level 参数不支持" - exit 255 - fi - - # 测试设置日志级别为 info - LOG_INFO "测试设置日志级别为 info" - docker --log-level info &>/dev/null - CHECK_RESULT $? 0 0 "设置日志级别为 info 失败" - - # 测试设置日志级别为 debug(如果支持) - LOG_INFO "测试设置日志级别为 debug" - docker --log-level debug &>/dev/null - if [ $? -ne 0 ]; then - LOG_INFO "docker --log-level debug 参数不支持" - else - CHECK_RESULT $? 0 0 "设置日志级别为 debug 失败" - fi - - # 恢复环境 - if [ "$INSTALLED" = false ]; then - LOG_INFO "卸载 moby-client-docker" - dnf remove -y moby-client-docker - CHECK_RESULT $? 0 0 "卸载 moby-client-docker 失败" - fi - - LOG_INFO "测试完成" -} - -main "$@" \ No newline at end of file diff --git a/testcases/function_test/pkg_test/moby/moby-client/test_moby-client_docker__tls.sh b/testcases/function_test/pkg_test/moby/moby-client/test_moby-client_docker__tls.sh deleted file mode 100644 index 72c75141119..00000000000 --- a/testcases/function_test/pkg_test/moby/moby-client/test_moby-client_docker__tls.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-11 -# @License : Mulan PSL v2 -# @Desc : 测试 docker 命令的 TLS 使用功能 -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - - # 检查是否已安装moby-client-docker软件包 - LOG_INFO "检查是否已安装moby-client-docker软件包" - if dnf list installed moby-client-docker &>/dev/null; then - LOG_INFO "moby-client-docker已安装,脚本结束时将保持安装状态" - INSTALLED=true - else - LOG_INFO "moby-client-docker未安装,将在测试结束后卸载" - INSTALLED=false - fi - - # 检查yum源中是否存在moby-client-docker软件包 - LOG_INFO "检查yum源中是否存在moby-client-docker软件包" - if ! dnf list available moby-client-docker &>/dev/null; then - LOG_ERROR "yum源中不存在moby-client-docker软件包" - exit 255 - fi - - # 如果未安装,则安装moby-client-docker - if [ "$INSTALLED" = false ]; then - LOG_INFO "安装moby-client-docker软件包" - dnf install -y moby-client-docker - CHECK_RESULT $? 0 0 "安装moby-client-docker失败" - fi - - # 测试docker命令的TLS使用功能 - LOG_INFO "测试docker命令的TLS使用功能" - docker --tlsverify --tlscacert=/path/to/ca.pem --tlscert=/path/to/cert.pem --tlskey=/path/to/key.pem version - CHECK_RESULT $? 0 0 "docker命令TLS功能测试失败" - - # 如果最初未安装,则在测试结束后卸载moby-client-docker - if [ "$INSTALLED" = false ]; then - LOG_INFO "卸载moby-client-docker软件包" - dnf remove -y moby-client-docker - CHECK_RESULT $? 0 0 "卸载moby-client-docker失败" - fi - - LOG_INFO "测试脚本执行完毕,环境已恢复" - -} - -main "$@" \ No newline at end of file diff --git a/testcases/function_test/pkg_test/moby/moby-client/test_moby-client_docker__tlsverify.sh b/testcases/function_test/pkg_test/moby/moby-client/test_moby-client_docker__tlsverify.sh deleted file mode 100644 index 0c833d28332..00000000000 --- a/testcases/function_test/pkg_test/moby/moby-client/test_moby-client_docker__tlsverify.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-12-11 -# @License : Mulan PSL v2 -# @Desc : 测试 docker 命令的 TLS 验证功能 -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - # 检查是否已安装moby-client-docker - LOG_INFO "检查是否已安装moby-client-docker" - if dnf list installed moby-client-docker &>/dev/null; then - LOG_INFO "moby-client-docker已安装" - INSTALLED=true - else - LOG_INFO "moby-client-docker未安装" - INSTALLED=false - fi - - # 检查yum源中是否有moby-client-docker软件包 - LOG_INFO "检查yum源中是否有moby-client-docker软件包" - if ! dnf list available moby-client-docker &>/dev/null; then - LOG_ERROR "yum源中未找到moby-client-docker软件包" - exit 255 - fi - - # 如果未安装,则安装moby-client-docker - if [ "$INSTALLED" = false ]; then - LOG_INFO "开始安装moby-client-docker" - dnf install -y moby-client-docker - CHECK_RESULT $? 0 0 "安装moby-client-docker失败" - fi - - # 测试docker命令的TLS验证功能 - LOG_INFO "测试docker命令的TLS验证功能" - docker --tlsverify version &>/dev/null - CHECK_RESULT $? 0 0 "docker命令不支持--tlsverify参数" - - # 如果脚本开始时未安装moby-client-docker,则在结束时卸载 - if [ "$INSTALLED" = false ]; then - LOG_INFO "卸载moby-client-docker" - dnf remove -y moby-client-docker - CHECK_RESULT $? 0 0 "卸载moby-client-docker失败" - fi - - LOG_INFO "测试脚本执行完成" -} - -main "$@" \ No newline at end of file diff --git a/testcases/function_test/pkg_test/moby/moby-client/test_moby-client_docker__upper_v.sh b/testcases/function_test/pkg_test/moby/moby-client/test_moby-client_docker__upper_v.sh deleted file mode 100644 index 9eee4876390..00000000000 --- a/testcases/function_test/pkg_test/moby/moby-client/test_moby-client_docker__upper_v.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-12-11 -# @License : Mulan PSL v2 -# @Desc : 测试 docker 命令的版本信息显示功能 -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - # 检查是否已安装moby-client-docker软件包 - LOG_INFO "检查是否已安装moby-client-docker软件包" - if ! dnf list installed moby-client-docker &>/dev/null; then - LOG_INFO "moby-client-docker未安装,将进行安装" - INSTALLED=0 - else - LOG_INFO "moby-client-docker已安装" - INSTALLED=1 - fi - - # 检查yum源中是否存在moby-client-docker软件包 - LOG_INFO "检查yum源中是否存在moby-client-docker软件包" - if ! dnf list available moby-client-docker &>/dev/null; then - LOG_ERROR "yum源中不存在moby-client-docker软件包" - exit 255 - fi - - # 如果未安装,则安装moby-client-docker - if [ $INSTALLED -eq 0 ]; then - LOG_INFO "开始安装moby-client-docker" - dnf install -y moby-client-docker - CHECK_RESULT $? 0 0 "安装moby-client-docker失败" - fi - - # 测试docker命令的版本信息显示功能 - LOG_INFO "测试docker命令的版本信息显示功能" - docker --version - CHECK_RESULT $? 0 0 "获取docker版本信息失败" - - # 如果脚本开始时未安装,则在结束时卸载moby-client-docker - if [ $INSTALLED -eq 0 ]; then - LOG_INFO "卸载moby-client-docker" - dnf remove -y moby-client-docker - CHECK_RESULT $? 0 0 "卸载moby-client-docker失败" - fi - - LOG_INFO "测试脚本执行完毕" -} - -main "$@" \ No newline at end of file diff --git a/testcases/function_test/pkg_test/moby/moby-client/test_moby-client_docker__v.sh b/testcases/function_test/pkg_test/moby/moby-client/test_moby-client_docker__v.sh deleted file mode 100644 index 9ab8975e562..00000000000 --- a/testcases/function_test/pkg_test/moby/moby-client/test_moby-client_docker__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-12-11 -# @License : Mulan PSL v2 -# @Desc : 测试 docker 命令的版本信息显示功能 -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - # 测试脚本:test_moby-client_docker__v - - LOG_INFO "开始测试 docker 命令的版本信息显示功能" - - # 检查是否已安装 docker 软件包 - LOG_INFO "检查是否已安装 docker 软件包" - if ! dnf list installed moby-engine &>/dev/null; then - LOG_INFO "docker 软件包未安装,将进行安装" - INSTALLED=false - else - LOG_INFO "docker 软件包已安装" - INSTALLED=true - fi - - # 检查 yum 源中是否有 docker 软件包 - LOG_INFO "检查 yum 源中是否有 docker 软件包" - if ! dnf list available moby-engine &>/dev/null; then - LOG_ERROR "yum 源中未找到 docker 软件包" - exit 255 - fi - - # 如果未安装,则安装 docker - if [ "$INSTALLED" = false ]; then - LOG_INFO "正在安装 docker 软件包" - dnf install -y moby-engine - CHECK_RESULT $? 0 0 "安装 docker 失败" - fi - - # 测试 docker 版本信息显示功能 - LOG_INFO "测试 docker version 命令" - docker version &>/dev/null - CHECK_RESULT $? 0 0 "docker version 命令执行失败" - - # 检查 docker version --help - LOG_INFO "检查 docker version --help" - docker version --help &>/dev/null - CHECK_RESULT $? 0 0 "docker version --help不支持" - - # 清理环境 - if [ "$INSTALLED" = false ]; then - LOG_INFO "卸载 docker" - dnf remove -y moby-engine - CHECK_RESULT $? 0 0 "卸载 docker失败" - fi - - LOG_INFO "测试完成" -} - -main "$@" \ No newline at end of file diff --git a/testcases/function_test/pkg_test/moby/moby-client/test_moby-client_function_build.sh b/testcases/function_test/pkg_test/moby/moby-client/test_moby-client_function_build.sh deleted file mode 100644 index e9b68cb6221..00000000000 --- a/testcases/function_test/pkg_test/moby/moby-client/test_moby-client_function_build.sh +++ /dev/null @@ -1,78 +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-11 -# @License : Mulan PSL v2 -# @Desc : 测试 docker 命令的构建镜像功能 -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - LOG_INFO "开始测试 docker 命令的构建镜像功能" - - # 检查是否已安装 docker 相关软件包 - LOG_INFO "检查是否已安装 docker 相关软件包" - if ! dnf list installed moby-engine moby-cli &>/dev/null; then - LOG_INFO "未安装 docker 相关软件包,开始安装" - if ! dnf list available moby-engine moby-cli &>/dev/null; then - LOG_ERROR "yum 源中未找到 moby-engine 或 moby-cli 软件包" - exit 255 - fi - dnf install -y moby-engine moby-cli - CHECK_RESULT $? 0 0 "安装 moby-engine 或 moby-cli 失败" - INSTALLED=true - else - LOG_INFO "docker 相关软件包已安装" - INSTALLED=false - fi - - # 检查 docker 命令是否可用 - LOG_INFO "检查 docker 命令是否可用" - docker --version - CHECK_RESULT $? 0 0 "docker 命令不可用" - - # 测试构建镜像功能 - LOG_INFO "测试构建镜像功能" - cat < Dockerfile - FROM alpine - RUN echo "Hello, OpenEuler!" > /hello.txt - EOF - - docker build -t test-image . - CHECK_RESULT $? 0 0 "构建镜像失败" - - # 验证镜像是否构建成功 - LOG_INFO "验证镜像是否构建成功" - docker images | grep test-image - CHECK_RESULT $? 0 0 "镜像未构建成功" - - # 清理测试镜像 - LOG_INFO "清理测试镜像" - docker rmi test-image - CHECK_RESULT $? 0 0 "清理测试镜像失败" - - # 恢复环境 - if [ "$INSTALLED" = false ]; then - LOG_INFO "恢复环境,卸载 docker 相关软件包" - dnf remove -y moby-engine moby-cli - CHECK_RESULT $? 0 0 "卸载 moby-engine 或 moby-cli 失败" - else - LOG_INFO "保持 docker 相关软件包安装状态" - fi - - LOG_INFO "测试 docker 命令的构建镜像功能完成" -} - -main "$@" \ No newline at end of file diff --git a/testcases/function_test/pkg_test/moby/moby-client/test_moby-client_function_ps.sh b/testcases/function_test/pkg_test/moby/moby-client/test_moby-client_function_ps.sh deleted file mode 100644 index 7dde6ae72d2..00000000000 --- a/testcases/function_test/pkg_test/moby/moby-client/test_moby-client_function_ps.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-12-11 -# @License : Mulan PSL v2 -# @Desc : 测试 docker 命令的列出容器功能 -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - - # 检查是否已安装moby-client - LOG_INFO "检查是否已安装moby-client" - rpm -q moby-client > /dev/null 2>&1 - if [ $? -eq 0 ]; then - LOG_INFO "moby-client已安装" - INSTALLED=true - else - LOG_INFO "moby-client未安装" - INSTALLED=false - fi - - # 检查yum源中是否有moby-client软件包 - LOG_INFO "检查yum源中是否有moby-client软件包" - dnf list available moby-client > /dev/null 2>&1 - if [ $? -ne 0 ]; then - LOG_ERROR "yum源中没有找到moby-client软件包" - exit 255 - fi - - # 如果未安装,则安装moby-client - if [ "$INSTALLED" = false ]; then - LOG_INFO "开始安装moby-client" - dnf install -y moby-client > /dev/null 2>&1 - CHECK_RESULT $? 0 0 "安装moby-client失败" - fi - - # 测试docker ps命令 - LOG_INFO "测试docker ps命令" - docker ps > /dev/null 2>&1 - CHECK_RESULT $? 0 0 "docker ps命令执行失败" - - # 测试docker ps -a命令(列出所有容器) - LOG_INFO "测试docker ps -a命令" - docker ps -a > /dev/null 2>&1 - CHECK_RESULT $? 0 0 "docker ps -a命令执行失败" - - # 清理环境 - if [ "$INSTALLED" = false ]; then - LOG_INFO "卸载moby-client以恢复环境" - dnf remove -y moby-client > /dev/null 2>&1 - CHECK_RESULT $? 0 0 "卸载moby-client失败" - fi - - LOG_INFO "测试脚本执行完毕,环境已恢复" - -} - -main "$@" \ No newline at end of file diff --git a/testcases/function_test/pkg_test/moby/moby-client/test_moby-client_function_pull.sh b/testcases/function_test/pkg_test/moby/moby-client/test_moby-client_function_pull.sh deleted file mode 100644 index 51beb7014d9..00000000000 --- a/testcases/function_test/pkg_test/moby/moby-client/test_moby-client_function_pull.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-11 -# @License : Mulan PSL v2 -# @Desc : 测试 docker 命令的拉取镜像功能 -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - - # 检查是否已安装moby-client - LOG_INFO "检查是否已安装moby-client" - if dnf list installed moby-client &>/dev/null; then - LOG_INFO "moby-client已安装,脚本结束后将保持安装状态" - INSTALLED=true - else - LOG_INFO "moby-client未安装,脚本结束后将卸载" - INSTALLED=false - fi - - # 检查yum源中是否有moby-client - LOG_INFO "检查yum源中是否有moby-client" - if ! dnf list available moby-client &>/dev/null; then - LOG_ERROR "yum源中未找到moby-client软件包" - exit 255 - fi - - # 安装moby-client - if [ "$INSTALLED" = false ]; then - LOG_INFO "开始安装moby-client" - dnf install -y moby-client - CHECK_RESULT $? 0 0 "安装moby-client失败" - fi - - # 测试docker pull命令功能 - LOG_INFO "测试docker pull命令功能" - docker pull hello-world &>/dev/null - CHECK_RESULT $? 0 0 "docker pull hello-world失败" - - # 检查镜像是否拉取成功 - LOG_INFO "检查镜像是否拉取成功" - docker images | grep hello-world &>/dev/null - CHECK_RESULT $? 0 0 "镜像hello-world未拉取成功" - - # 清理测试镜像 - LOG_INFO "清理测试镜像" - docker rmi hello-world &>/dev/null - - # 如果脚本开始时未安装moby-client,则卸载 - if [ "$INSTALLED" = false ]; then - LOG_INFO "卸载moby-client" - dnf remove -y moby-client &>/dev/null - fi - - LOG_INFO "测试脚本执行完毕,环境已恢复" - -} - -main "$@" \ No newline at end of file diff --git a/testcases/function_test/pkg_test/moby/moby-client/test_moby-client_function_push.sh b/testcases/function_test/pkg_test/moby/moby-client/test_moby-client_function_push.sh deleted file mode 100644 index db2eecae50e..00000000000 --- a/testcases/function_test/pkg_test/moby/moby-client/test_moby-client_function_push.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-12-11 -# @License : Mulan PSL v2 -# @Desc : 测试 docker 命令的推送镜像功能 -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - - LOG_INFO "开始测试 docker 命令的推送镜像功能" - - # 检查是否已安装 moby-client 软件包 - LOG_INFO "检查是否已安装 moby-client 软件包" - if rpm -q moby-client &>/dev/null; then - LOG_INFO "moby-client 已安装,脚本结束后将保持安装状态" - INSTALLED=true - else - LOG_INFO "moby-client 未安装,将在测试完成后卸载" - INSTALLED=false - fi - - # 检查 yum 源中是否存在 moby-client 软件包 - LOG_INFO "检查 yum 源中是否存在 moby-client 软件包" - if ! dnf list available moby-client &>/dev/null; then - LOG_ERROR "yum 源中未找到 moby-client 软件包" - exit 255 - fi - - # 如果未安装,则安装 moby-client - if [ "$INSTALLED" = false ]; then - LOG_INFO "安装 moby-client 软件包" - dnf install -y moby-client - CHECK_RESULT $? 0 0 "安装 moby-client 失败" - fi - - # 测试 docker push 命令功能 - LOG_INFO "测试 docker push 命令功能" - - # 检查 docker push 命令是否支持 - LOG_INFO "检查 docker push 命令参数是否支持" - docker push --help &>/dev/null - CHECK_RESULT $? 0 0 "docker push 命令不支持或参数错误" - - # 模拟推送镜像(假设镜像不存在) - LOG_INFO "模拟推送镜像(假设镜像不存在)" - docker push nonexistent-image &>/dev/null - if [ $? -eq 1 ]; then - LOG_INFO "docker push 命令执行失败(预期行为,因为镜像不存在)" - else - LOG_ERROR "docker push 命令执行成功(非预期行为)" - exit $? - fi - - #清理环境 - if [ "$INSTALLED" = false ]; then - LOG_INFO "卸载 moby-client -} - -main "$@" \ No newline at end of file diff --git a/testcases/function_test/pkg_test/moby/moby-client/test_moby-client_function_rm.sh b/testcases/function_test/pkg_test/moby/moby-client/test_moby-client_function_rm.sh deleted file mode 100644 index 0c540c082d5..00000000000 --- a/testcases/function_test/pkg_test/moby/moby-client/test_moby-client_function_rm.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 : 2025-12-11 -# @License : Mulan PSL v2 -# @Desc : 测试 docker 命令的删除容器功能 -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - LOG_INFO "开始测试 docker 命令的删除容器功能" - - # 检查是否已安装 moby-client - LOG_INFO "检查是否已安装 moby-client" - if ! dnf list installed moby-client &> /dev/null; then - LOG_INFO "moby-client 未安装,将进行安装" - INSTALLED=false - else - LOG_INFO "moby-client 已安装" - INSTALLED=true - fi - - # 检查 yum 源中是否有 moby-client - LOG_INFO "检查 yum 源中是否有 moby-client" - if ! dnf list available moby-client &> /dev/null; then - LOG_ERROR "yum 源中未找到 moby-client 软件包" - exit 255 - fi - - # 如果未安装,则安装 moby-client - if [ "$INSTALLED" = false ]; then - LOG_INFO "安装 moby-client" - dnf install -y moby-client - CHECK_RESULT $? 0 0 "安装 moby-client 失败" - fi - - # 测试 docker rm 命令 - LOG_INFO "测试 docker rm 命令" - # 创建一个临时容器用于测试 - CONTAINER_ID=$(docker create busybox) - CHECK_RESULT $? 0 0 "创建临时容器失败" - - # 删除容器 - LOG_INFO "删除容器" - docker rm $CONTAINER_ID - CHECK_RESULT $? 0 0 "删除容器失败" - - # 测试不存在的容器 - LOG_INFO "测试删除不存在的容器" - docker rm nonexistent_container &> /dev/null - CHECK_RESULT $? 1 0 "删除不存在的容器未返回预期错误码" - - # 测试无效参数 - LOG_INFO "测试无效参数" - docker rm --invalid-arg &> /dev/null - CHECK_RESULT $? 125 0 "无效参数未返回预期错误码" - - # 清理环境 - if [ "$INSTALLED" = false ]; then - LOG_INFO "卸载 moby-client" - dnf remove -y moby-client - CHECK_RESULT $? 0 0 "卸载 moby-client 失败" - fi - - LOG_INFO "测试 docker 命令的删除容器功能完成" -} - -main "$@" \ No newline at end of file diff --git a/testcases/function_test/pkg_test/moby/moby-client/test_moby-client_function_rmi.sh b/testcases/function_test/pkg_test/moby/moby-client/test_moby-client_function_rmi.sh deleted file mode 100644 index 1c51833c2be..00000000000 --- a/testcases/function_test/pkg_test/moby/moby-client/test_moby-client_function_rmi.sh +++ /dev/null @@ -1,78 +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-11 -# @License : Mulan PSL v2 -# @Desc : 测试 docker 命令的删除镜像功能 -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - # 检查是否已安装moby-client - LOG_INFO "检查是否已安装moby-client" - rpm -q moby-client > /dev/null 2>&1 - if [ $? -eq 0 ]; then - LOG_INFO "moby-client已安装,脚本结束时将保持安装状态" - INSTALLED=1 - else - LOG_INFO "moby-client未安装,将在测试结束后卸载" - INSTALLED=0 - fi - - # 检查yum源中是否有moby-client - LOG_INFO "检查yum源中是否有moby-client" - dnf list available moby-client > /dev/null 2>&1 - if [ $? -ne 0 ]; then - LOG_ERROR "yum源中没有moby-client软件包" - exit 255 - fi - - # 如果未安装,则安装moby-client - if [ $INSTALLED -eq 0 ]; then - LOG_INFO "开始安装moby-client" - dnf install -y moby-client > /dev/null 2>&1 - CHECK_RESULT $? 0 0 "安装moby-client失败" - fi - - # 测试docker rmi命令功能 - LOG_INFO "测试docker rmi命令功能" - docker pull busybox > /dev/null 2>&1 - CHECK_RESULT $? 0 0 "拉取busybox镜像失败" - - IMAGE_ID=$(docker images -q busybox) - docker rmi $IMAGE_ID > /dev/null 2>&1 - CHECK_RESULT $? 0 0 "删除busybox镜像失败" - - # 测试不支持的参数 - LOG_INFO "测试不支持的参数" - docker rmi --invalid-arg > /dev/null 2>&1 - if [ $? -eq 125 ]; then - LOG_INFO "不支持参数测试通过" - else - LOG_ERROR "不支持参数测试失败" - exit 255 - fi - - # 清理环境 - if [ $INSTALLED -eq 0 ]; then - LOG_INFO "卸载moby-client以恢复环境" - dnf remove -y moby-client > /dev/null 2>&1 - CHECK_RESULT $? 0 0 "卸载moby-client失败" - fi - - LOG_INFO "测试脚本执行完成" -} - -main "$@" \ No newline at end of file diff --git a/testcases/function_test/pkg_test/moby/moby-client/test_moby-client_function_run.sh b/testcases/function_test/pkg_test/moby/moby-client/test_moby-client_function_run.sh deleted file mode 100644 index 77c9f5b672b..00000000000 --- a/testcases/function_test/pkg_test/moby/moby-client/test_moby-client_function_run.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-12-11 -# @License : Mulan PSL v2 -# @Desc : 测试 docker 命令的运行容器功能 -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - LOG_INFO "开始测试 docker 命令的运行容器功能" - - # 检查是否已安装 docker - if ! command -v docker &> /dev/null; then - LOG_INFO "未检测到 docker 安装,开始安装 docker" - if ! dnf list installed moby-engine &> /dev/null; then - LOG_ERROR "yum 源中未找到 moby-engine 软件包" - exit 255 - fi - dnf install -y moby-engine - CHECK_RESULT $? 0 0 "安装 moby-engine 失败" - else - LOG_INFO "docker 已安装,跳过安装步骤" - fi - - # 检查 docker 命令是否支持 run 参数 - if ! docker run --help &> /dev/null; then - LOG_ERROR "docker 命令不支持 run 参数" - exit 255 - fi - - # 测试运行容器功能 - LOG_INFO "测试运行一个临时容器" - docker run --rm hello-world - CHECK_RESULT $? 0 0 "运行容器失败" - - # 环境恢复:如果脚本开始时未安装 docker,则卸载 - if ! command -v docker &> /dev/null; then - LOG_INFO "清理环境,卸载 moby-engine" - dnf remove -y moby-engine - CHECK_RESULT $? 0 0 "卸载 moby-engine 失败" - else - LOG_INFO "保持环境不变,不卸载 docker" - fi - - LOG_INFO "测试 docker 命令的运行容器功能完成" -} - -main "$@" \ No newline at end of file diff --git a/testcases/function_test/pkg_test/python-xlrd/python-xlrd-help/test_python-xlrd-help_function_read.sh b/testcases/function_test/pkg_test/python-xlrd/python-xlrd-help/test_python-xlrd-help_function_read.sh deleted file mode 100644 index c1eb4b4fb4c..00000000000 --- a/testcases/function_test/pkg_test/python-xlrd/python-xlrd-help/test_python-xlrd-help_function_read.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-10 -# @License : Mulan PSL v2 -# @Desc : Test reading Excel files -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - - LOG_INFO "开始测试:Test reading Excel files" - - # 检查是否已安装python3-xlrd - LOG_INFO "检查是否已安装python3-xlrd" - if rpm -q python3-xlrd &>/dev/null; then - LOG_INFO "python3-xlrd已安装,测试结束后将保持安装状态" - installed=true - else - LOG_INFO "python3-xlrd未安装,将在测试结束后卸载" - installed=false - fi - - # 检查yum源中是否有python3-xlrd - LOG_INFO "检查yum源中是否有python3-xlrd" - if ! dnf list available python3-xlrd &>/dev/null; then - LOG_ERROR "yum源中未找到python3-xlrd" - exit 255 - fi - - # 安装python3-xlrd(如果未安装) - if ! $installed; then - LOG_INFO "正在安装python3-xlrd" - dnf install -y python3-xlrd - CHECK_RESULT $? 0 0 "安装python3-xlrd失败" - fi - - # 测试读取Excel文件功能 - LOG_INFO "测试读取Excel文件功能" - python3 -c "import xlrd; book = xlrd.open_workbook("test.xlsx"); print(book.sheet_names())" &>/dev/null - CHECK_RESULT $? 0 0 "读取Excel文件失败" - - # 清理环境(如果最初未安装) - if ! $installed; then - LOG_INFO "卸载python3-xlrd" - dnf remove -y python3-xlrd - CHECK_RESULT $? 0 0 "卸载python3-xlrd失败" - fi - - LOG_INFO "测试完成:Test reading Excel files" - -} - -main "$@" \ No newline at end of file diff --git a/testcases/function_test/pkg_test/qt6-qtquick3dphysics/qt6-qtquick3dphysics-examples/test_qt6-qtquick3dphysics-examples_function_basic.sh b/testcases/function_test/pkg_test/qt6-qtquick3dphysics/qt6-qtquick3dphysics-examples/test_qt6-qtquick3dphysics-examples_function_basic.sh deleted file mode 100644 index 8bc10ae015e..00000000000 --- a/testcases/function_test/pkg_test/qt6-qtquick3dphysics/qt6-qtquick3dphysics-examples/test_qt6-qtquick3dphysics-examples_function_basic.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 : 2025-12-07 -# @License : Mulan PSL v2 -# @Desc : Test basic functionality of qt6-qtquick3dphysics-examples -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - LOG_INFO "开始测试qt6-qtquick3dphysics-examples的基本功能" - - # 检查软件包是否已安装 - LOG_INFO "检查qt6-qtquick3dphysics-examples是否已安装" - if rpm -q qt6-qtquick3dphysics-examples &>/dev/null; then - LOG_INFO "qt6-qtquick3dphysics-examples已安装,测试完成后将保持安装状态" - INSTALLED=true - else - LOG_INFO "qt6-qtquick3dphysics-examples未安装,将在测试完成后卸载" - INSTALLED=false - fi - - # 检查yum源中是否有该软件包 - LOG_INFO "检查yum源中是否存在qt6-qtquick3dphysics-examples" - if ! dnf list available qt6-qtquick3dphysics-examples &>/dev/null; then - LOG_ERROR "yum源中未找到qt6-qtquick3dphysics-examples" - exit 255 - fi - - # 安装软件包 - if [ "$INSTALLED" = false ]; then - LOG_INFO "安装qt6-qtquick3dphysics-examples" - dnf install -y qt6-qtquick3dphysics-examples - CHECK_RESULT $? 0 0 "安装失败" - fi - - # 测试基本功能 - LOG_INFO "测试qt6-qtquick3dphysics-examples的基本功能" - example_command="example_command_here" # 替换为实际的测试命令 - $example_command - CHECK_RESULT $? 0 0 "基本功能测试失败" - - # 清理环境 - if [ "$INSTALLED" = false ]; then - LOG_INFO "卸载qt6-qtquick3dphysics-examples" - dnf remove -y qt6-qtquick3dphysics-examples - CHECK_RESULT $? 0 0 "卸载失败" - fi - - LOG_INFO "测试完成,环境已恢复" -} - -main "$@" \ No newline at end of file diff --git a/testcases/function_test/pkg_test/texlive-split-a/texlive-acro/test_texlive-acro_function_basic_usage.sh b/testcases/function_test/pkg_test/texlive-split-a/texlive-acro/test_texlive-acro_function_basic_usage.sh deleted file mode 100644 index 7fbd19806eb..00000000000 --- a/testcases/function_test/pkg_test/texlive-split-a/texlive-acro/test_texlive-acro_function_basic_usage.sh +++ /dev/null @@ -1,120 +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-27 -# @License : Mulan PSL v2 -# @Desc : Test basic usage of acro commands in a LaTeX document -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - # 检查是否已安装texlive-acro包 - LOG_INFO "检查系统是否已安装texlive-acro软件包" - rpm -q texlive-acro > /dev/null 2>&1 - if [ $? -eq 0 ]; then - LOG_INFO "texlive-acro已安装,脚本结束时将保持安装状态" - already_installed=true - else - LOG_INFO "texlive-acro未安装,将在测试中安装并在结束时卸载" - already_installed=false - fi - - # 检查yum源中是否有texlive-acro包 - LOG_INFO "检查yum源中是否存在texlive-acro软件包" - dnf list available texlive-acro > /dev/null 2>&1 - CHECK_RESULT $? 0 0 "yum源中未找到texlive-acro软件包" - if [ $? -ne 0 ]; then - LOG_ERROR "yum源中未找到texlive-acro软件包" - exit 255 - fi - - # 如果未安装,则安装texlive-acro - if [ "$already_installed" = "false" ]; then - LOG_INFO "开始安装texlive-acro软件包" - dnf install -y texlive-acro - CHECK_RESULT $? 0 0 "安装texlive-acro失败" - fi - - # 创建一个测试LaTeX文档 - LOG_INFO "创建测试LaTeX文档" - cat > test_acro.tex << "EOF" - \documentclass{article} - \usepackage{acro} - \DeclareAcronym{cd}{ - short = CD, - long = compact disc - } - \DeclareAcronym{laser}{ - short = laser, - long = light amplification by stimulated emission of radiation - } - \begin{document} - First use: \ac{cd} and \ac{laser}. - - Subsequent use: \ac{cd} and \ac{laser}. - - Full form: \acf{cd} and \acf{laser}. - - Short form: \acs{cd} and \acs{laser}. - - Long form: \acl{cd} and \acl{laser}. - \end{document} - EOF - CHECK_RESULT $? 0 0 "创建测试LaTeX文档失败" - - # 测试编译LaTeX文档 - LOG_INFO "使用pdflatex编译测试文档" - pdflatex -interaction=nonstopmode test_acro.tex > /dev/null 2>&1 - CHECK_RESULT $? 0 0 "pdflatex编译失败" - - # 检查生成的PDF文件 - LOG_INFO "检查生成的PDF文件" - if [ -f test_acro.pdf ]; then - LOG_INFO "成功生成PDF文件: test_acro.pdf" - file test_acro.pdf | grep -q "PDF document" - CHECK_RESULT $? 0 0 "生成的文件不是有效的PDF文档" - else - LOG_ERROR "未找到生成的PDF文件" - exit 1 - fi - - # 测试acro命令参数(示例:检查acro包是否支持特定选项) - LOG_INFO "测试acro包的基本功能" - cat > test_acro_check.tex << "EOF" - \documentclass{article} - \usepackage{acro} - \begin{document} - Test acro package loading. - \end{document} - EOF - pdflatex -interaction=nonstopmode test_acro_check.tex > /dev/null 2>&1 - CHECK_RESULT $? 0 0 "acro包加载失败" - - # 清理测试文件 - LOG_INFO "清理测试生成的文件" - rm -f test_acro.tex test_acro.aux test_acro.log test_acro.out test_acro.pdf - rm -f test_acro_check.tex test_acro_check.aux test_acro_check.log test_acro_check.out test_acro_check.pdf - - # 如果之前未安装,则卸载texlive-acro - if [ "$already_installed" = "false" ]; then - LOG_INFO "卸载texlive-acro软件包" - dnf remove -y texlive-acro - CHECK_RESULT $? 0 0 "卸载texlive-acro失败" - fi - - LOG_INFO "测试完成" -} - -main "$@" \ No newline at end of file diff --git a/testcases/function_test/pkg_test/texlive-split-a/texlive-acro/test_texlive-acro_function_list.sh b/testcases/function_test/pkg_test/texlive-split-a/texlive-acro/test_texlive-acro_function_list.sh deleted file mode 100644 index 348beb3dbb3..00000000000 --- a/testcases/function_test/pkg_test/texlive-split-a/texlive-acro/test_texlive-acro_function_list.sh +++ /dev/null @@ -1,127 +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-27 -# @License : Mulan PSL v2 -# @Desc : Test listing of acronyms in the document -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - # 定义日志函数 - LOG_INFO() { - echo "[INFO] $*" - } - - LOG_ERROR() { - echo "[ERROR] $*" - } - - # 定义检查结果函数 - CHECK_RESULT() { - local actual=$1 - local expected=$2 - local error_code=$3 - local error_msg=$4 - - if [ "$actual" -ne "$expected" ]; then - LOG_ERROR "$error_msg" - exit $error_code - fi - } - - # 定义远程执行命令函数(示例,实际使用时需根据环境调整) - SSH_CMD() { - local cmd=$1 - local ip=$2 - local password=$3 - local user=$4 - # 实际实现会根据具体环境使用sshpass或密钥方式 - sshpass -p "$password" ssh -o StrictHostKeyChecking=no "${user}@${ip}" "$cmd" - } - - # 定义软件包名称 - PACKAGE_NAME="texlive-acro" - - # 步骤1:检查软件包是否在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 - - # 步骤2:检查是否已安装 - LOG_INFO "检查系统是否已安装 $PACKAGE_NAME" - if rpm -q "$PACKAGE_NAME" &>/dev/null; then - LOG_INFO "软件包 $PACKAGE_NAME 已安装,测试结束后保持安装状态" - INSTALLED_BEFORE=true - else - LOG_INFO "软件包 $PACKAGE_NAME 未安装,将在测试中安装" - INSTALLED_BEFORE=false - fi - - # 步骤3:如果未安装,则安装软件包 - if [ "$INSTALLED_BEFORE" = false ]; then - LOG_INFO "安装软件包 $PACKAGE_NAME" - dnf install -y "$PACKAGE_NAME" - CHECK_RESULT $? 0 1 "安装软件包 $PACKAGE_NAME 失败" - fi - - # 步骤4:测试列出文档中的缩写词功能 - LOG_INFO "测试列出文档中的缩写词功能" - # 创建一个简单的测试文档 - TEST_DOC="test_acronyms.tex" - cat > "$TEST_DOC" << "EOF" - \documentclass{article} - \usepackage{acro} - \DeclareAcronym{cd}{ - short = CD, - long = compact disc - } - \DeclareAcronym{dvd}{ - short = DVD, - long = digital versatile disc - } - \begin{document} - \ac{cd} and \ac{dvd} are examples. - \end{document} - EOF - - # 编译文档以生成辅助文件 - pdflatex -interaction=nonstopmode "$TEST_DOC" &>/dev/null - CHECK_RESULT $? 0 1 "编译测试文档失败" - - # 使用acro-tool工具列出缩写词 - LOG_INFO "使用acro-tool列出文档中的缩写词" - acro-tool list "$TEST_DOC" &>/dev/null - CHECK_RESULT $? 0 1 "列出缩写词功能测试失败" - - # 步骤5:清理测试文件 - LOG_INFO "清理测试文件" - rm -f test_acronyms.* - CHECK_RESULT $? 0 1 "清理测试文件失败" - - # 步骤6:如果测试前未安装,则卸载软件包 - if [ "$INSTALLED_BEFORE" = false ]; then - LOG_INFO "卸载软件包 $PACKAGE_NAME" - dnf remove -y "$PACKAGE_NAME" - CHECK_RESULT $? 0 1 "卸载软件包 $PACKAGE_NAME 失败" - fi - - LOG_INFO "测试完成" -} - -main "$@" \ No newline at end of file diff --git a/testcases/function_test/pkg_test/texlive-split-a/texlive-acro/test_texlive-acro_function_uninstall.sh b/testcases/function_test/pkg_test/texlive-split-a/texlive-acro/test_texlive-acro_function_uninstall.sh deleted file mode 100644 index 7a03916b894..00000000000 --- a/testcases/function_test/pkg_test/texlive-split-a/texlive-acro/test_texlive-acro_function_uninstall.sh +++ /dev/null @@ -1,90 +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-27 -# @License : Mulan PSL v2 -# @Desc : Test uninstallation of texlive-acro package -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - set -e - - # 检查软件包是否在yum源中 - LOG_INFO "检查texlive-acro软件包是否在yum源中" - dnf list available texlive-acro 2>/dev/null | grep -q texlive-acro - if [ $? -ne 0 ]; then - LOG_ERROR "texlive-acro软件包不在yum源中" - exit 255 - fi - CHECK_RESULT $? 0 0 "texlive-acro软件包不在yum源中" - - # 检查当前环境是否已经安装texlive-acro - LOG_INFO "检查当前环境是否已安装texlive-acro" - rpm -q texlive-acro >/dev/null 2>&1 - already_installed=$? - - if [ $already_installed -eq 0 ]; then - LOG_INFO "当前环境已安装texlive-acro,测试完成后将保持安装状态" - need_cleanup=0 - else - LOG_INFO "当前环境未安装texlive-acro,将执行安装操作" - need_cleanup=1 - - # 安装texlive-acro软件包 - LOG_INFO "安装texlive-acro软件包" - dnf install -y texlive-acro - CHECK_RESULT $? 0 0 "安装texlive-acro软件包失败" - fi - - # 测试卸载功能 - LOG_INFO "测试卸载texlive-acro软件包" - dnf remove -y texlive-acro - CHECK_RESULT $? 0 0 "卸载texlive-acro软件包失败" - - # 验证卸载结果 - LOG_INFO "验证texlive-acro软件包是否已卸载" - rpm -q texlive-acro >/dev/null 2>&1 - if [ $? -eq 0 ]; then - LOG_ERROR "texlive-acro软件包卸载失败" - CHECK_RESULT 1 0 0 "texlive-acro软件包卸载失败" - else - LOG_INFO "texlive-acro软件包卸载成功" - CHECK_RESULT 0 0 0 "texlive-acro软件包卸载成功" - fi - - # 环境恢复 - LOG_INFO "开始环境恢复" - if [ $need_cleanup -eq 1 ]; then - # 如果测试前未安装,则清理环境 - LOG_INFO "清理测试安装的软件包" - # 检查是否还有残留的texlive-acro包(可能在卸载时已经清理) - rpm -q texlive-acro >/dev/null 2>&1 - if [ $? -eq 0 ]; then - dnf remove -y texlive-acro - CHECK_RESULT $? 0 0 "清理texlive-acro软件包失败" - fi - else - # 如果测试前已安装,则重新安装 - LOG_INFO "重新安装texlive-acro软件包以恢复环境" - dnf install -y texlive-acro - CHECK_RESULT $? 0 0 "重新安装texlive-acro软件包失败" - fi - - LOG_INFO "环境恢复完成" - LOG_INFO "测试完成" -} - -main "$@" \ No newline at end of file diff --git a/testcases/function_test/pkg_test/texlive-split-n/texlive-luabibentry-doc/test_texlive-luabibentry-doc_function_install.sh b/testcases/function_test/pkg_test/texlive-split-n/texlive-luabibentry-doc/test_texlive-luabibentry-doc_function_install.sh deleted file mode 100644 index 7927cfada3f..00000000000 --- a/testcases/function_test/pkg_test/texlive-split-n/texlive-luabibentry-doc/test_texlive-luabibentry-doc_function_install.sh +++ /dev/null @@ -1,55 +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-09-27 -# @License : Mulan PSL v2 -# @Desc : Test package installation -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - - # 检查软件包是否存在于yum源中 - if ! dnf list texlive-luabibentry-doc &> /dev/null; then - LOG_ERROR "软件包 texlive-luabibentry-doc 不存在于yum源中" - exit 255 - fi - - # 检查是否已安装软件包 - if rpm -q texlive-luabibentry-doc &> /dev/null; then - LOG_INFO "软件包 texlive-luabibentry-doc 已安装,无需重复安装" - else - LOG_INFO "开始安装软件包 texlive-luabibentry-doc" - dnf install -y texlive-luabentry-doc - CHECK_RESULT $? 0 0 "安装软件包 texlive-luabibentry-doc 失败" - fi - - # 测试步骤:验证安装是否成功 - LOG_INFO "验证软件包 texlive-luabibentry-doc 是否成功安装" - rpm -q texlive-luabibentry-doc - CHECK_RESULT $? 0 0 "验证软件包 texlive-luabibentry-doc 安装失败" - - # 清理环境:如果脚本开始时未安装,则卸载软件包 - if ! rpm -q texlive-luabibentry-doc &> /dev/null; then - LOG_INFO "卸载软件包 texlive-luabibentry-doc" - dnf remove -y texlive-luabibentry-doc - CHECK_RESULT $? 0 0 "卸载软件包 texlive-lubibbent-doc 失败" - fi - - LOG_INFO "测试脚本执行完成" - -} - -main "$@" \ No newline at end of file diff --git a/testcases/function_test/pkg_test/texlive-split-y/texlive-gettitlestring/test_texlive-gettitlestring_function_basic.sh b/testcases/function_test/pkg_test/texlive-split-y/texlive-gettitlestring/test_texlive-gettitlestring_function_basic.sh deleted file mode 100644 index 777b76dd739..00000000000 --- a/testcases/function_test/pkg_test/texlive-split-y/texlive-gettitlestring/test_texlive-gettitlestring_function_basic.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-26 -# @License : Mulan PSL v2 -# @Desc : Test basic functionality of texlive-gettitlestring -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - - # 测试texlive-gettitlestring的基本功能 - LOG_INFO "开始测试texlive-gettitlestring的基本功能" - - # 检查是否已安装texlive-gettitlestring - if dnf list installed texlive-gettitlestring &>/dev/null; then - LOG_INFO "texlive-gettitlestring已安装,测试完成后将保持安装状态" - INSTALLED=true - else - LOG_INFO "texlive-gettitlestring未安装,将在测试完成后卸载" - INSTALLED=false - fi - - # 检查yum源中是否有texlive-gettitlestring软件包 - if ! dnf list available texlive-gettitlestring &>/dev/null; then - LOG_ERROR "yum源中未找到texlive-gettitlestring软件包" - exit 255 - fi - - # 安装texlive-gettitlestring - if [ "$INSTALLED" = false ]; then - LOG_INFO "正在安装texlive-gettitlestring" - dnf install -y texlive-gettitlestring - CHECK_RESULT $? 0 0 "安装texlive-gettitlestring失败" - fi - - # 测试texlive-gettitlestring命令是否存在 - LOG_INFO "检查texlive-gettitlestring命令是否存在" - texlive-gettitlestring --help &>/dev/null - CHECK_RESULT $? 0 0 "texlive-gettitlestring命令不存在或不支持" - - # 测试texlive-gettitlestring基本功能 - LOG_INFO "测试texlive-gettitlestring基本功能" - TEST_STRING="Test Title" - OUTPUT=$(texlive-gettitlestring "$TEST_STRING") - CHECK_RESULT $? 0 0 "执行texlive-gettisteststring失败" - [ "$OUTPUT" = "$TEST_STRING" ] - CHECK_RESULT $? 0 0 "输出结果与预期不符" - - # 清理环境 - if [ "$INSTALLED" = false ]; then - LOG_INFO "正在卸载texlevele-gettitleeststring" - dnf remove -y texlive-gettitleeststringeeteetleeteetleeteetleeteetleeteetleeteetleeteetleeteetleeteeettitleestrinnggeetteeettitleestrinnggeetteeettitleestrinnggeetteeettitleestrinnggeetteeettitleestrinnggeetteeettitleestrinnggeetteeettitleestrinnggeetteeettitleestrinnggeetteeettitleestrinnggeetteeettitleestrinngggettitleestrinngegettitleestrinngegettitleestrinngegettitleestrinngegettitleestrinngegettitleestrinngegettitleestrinngegettitleestrinngegettitleestrinngeeetetetetetetetetetetetetetetetetetetetetetetetetetelivve-gettitleestingggettitlestrignggtttitlestrignggtttitlstrignggtttitlestrignggtttitlestrignggtttitlestrignggtttitlestrignggtttitlestrignggtttitlestrignggtttitlestrignggtttitlestrigng CHECK_RESULT $?00“卸载失败” fi LOG INFO“测试完成” exit0 -} - -main "$@" \ No newline at end of file diff --git a/testcases/function_test/pkg_test/texlive-split-y/texlive-uni-wtal-ger-doc/test_texlive-uni-wtal-ger-doc_function_list_files.sh b/testcases/function_test/pkg_test/texlive-split-y/texlive-uni-wtal-ger-doc/test_texlive-uni-wtal-ger-doc_function_list_files.sh deleted file mode 100644 index 85dfb28734b..00000000000 --- a/testcases/function_test/pkg_test/texlive-split-y/texlive-uni-wtal-ger-doc/test_texlive-uni-wtal-ger-doc_function_list_files.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-03-18 -# @License : Mulan PSL v2 -# @Desc : 列出 texlive-uni-wtal-ger-doc 软件包安装的所有文档文件。 -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - LOG_INFO "开始测试 texlive-uni-wtal-ger-doc 软件包文档文件列表功能" - - # 检查软件包是否已在yum源中 - LOG_INFO "检查 texlive-uni-wtal-ger-doc 软件包是否在yum源中" - dnf list available texlive-uni-wtal-ger-doc 2>/dev/null - if [ $? -ne 0 ]; then - LOG_ERROR "yum源中未找到 texlive-uni-wtal-ger-doc 软件包" - exit 255 - fi - - # 检查软件包是否已安装 - LOG_INFO "检查 texlive-uni-wtal-ger-doc 软件包是否已安装" - rpm -q texlive-uni-wtal-ger-doc >/dev/null 2>&1 - INSTALLED=$? - - if [ $INSTALLED -eq 0 ]; then - LOG_INFO "软件包已安装,测试后将保持安装状态" - NEED_CLEANUP=0 - else - LOG_INFO "软件包未安装,将进行安装测试" - NEED_CLEANUP=1 - - # 安装软件包 - LOG_INFO "安装 texlive-uni-wtal-ger-doc 软件包" - dnf install -y texlive-uni-wtal-ger-doc - CHECK_RESULT $? 0 0 "安装 texlive-uni-wtal-ger-doc 软件包失败" - fi - - # 检查rpm命令的文档列表参数是否支持 - LOG_INFO "检查rpm命令的文档列表参数" - rpm --help | grep -q "\-qd" - if [ $? -ne 0 ]; then - LOG_ERROR "rpm命令不支持文档列表参数(-qd)" - exit 255 - fi - - # 列出软件包安装的所有文档文件 - LOG_INFO "列出 texlive-uni-wtal-ger-doc 软件包安装的所有文档文件" - rpm -qd texlive-uni-wtal-ger-doc - CHECK_RESULT $? 0 0 "列出文档文件失败" - - # 环境清理 - if [ $NEED_CLEANUP -eq 1 ]; then - LOG_INFO "清理测试环境,卸载 texlive-uni-wtal-ger-doc 软件包" - dnf remove -y texlive-uni-wtal-ger-doc - CHECK_RESULT $? 0 0 "卸载 texlive-uni-wtal-ger-doc 软件包失败" - else - LOG_INFO "保持软件包安装状态,无需清理" - fi - - LOG_INFO "测试完成" -} - -main "$@" \ No newline at end of file diff --git a/testcases/function_test/pkg_test/texlive-split-y/texlive-uni-wtal-ger-doc/test_texlive-uni-wtal-ger-doc_function_remove.sh b/testcases/function_test/pkg_test/texlive-split-y/texlive-uni-wtal-ger-doc/test_texlive-uni-wtal-ger-doc_function_remove.sh deleted file mode 100644 index c647cf26d0b..00000000000 --- a/testcases/function_test/pkg_test/texlive-split-y/texlive-uni-wtal-ger-doc/test_texlive-uni-wtal-ger-doc_function_remove.sh +++ /dev/null @@ -1,95 +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-18 -# @License : Mulan PSL v2 -# @Desc : 测试 texlive-uni-wtal-ger-doc 软件包的卸载功能,验证卸载是否干净。 -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - # 测试脚本开始 - LOG_INFO "开始测试 texlive-uni-wtal-ger-doc 软件包的卸载功能" - - # 步骤1:检查软件包是否在yum源中存在 - LOG_INFO "步骤1:检查 texlive-uni-wtal-ger-doc 是否在yum源中" - dnf list available texlive-uni-wtal-ger-doc 2>/dev/null | grep -q "texlive-uni-wtal-ger-doc" - if [ $? -ne 0 ]; then - LOG_ERROR "软件包 texlive-uni-wtal-ger-doc 不在yum源中" - exit 255 - fi - LOG_INFO "软件包 texlive-uni-wtal-ger-doc 存在于yum源中" - - # 步骤2:检查当前是否已安装软件包 - LOG_INFO "步骤2:检查 texlive-uni-wtal-ger-doc 是否已安装" - rpm -q texlive-uni-wtal-ger-doc >/dev/null 2>&1 - if [ $? -eq 0 ]; then - LOG_INFO "软件包 texlive-uni-wtal-ger-doc 已安装,标记为已安装状态" - INSTALLED_FLAG=1 - else - LOG_INFO "软件包 texlive-uni-wtal-ger-doc 未安装,标记为未安装状态" - INSTALLED_FLAG=0 - fi - - # 步骤3:如果未安装,则安装软件包作为测试步骤 - if [ $INSTALLED_FLAG -eq 0 ]; then - LOG_INFO "步骤3:安装 texlive-uni-wtal-ger-doc 软件包" - dnf install -y texlive-uni-wtal-ger-doc - CHECK_RESULT $? 0 0 "安装 texlive-uni-wtal-ger-doc 失败" - LOG_INFO "安装 texlive-uni-wtal-ger-doc 成功" - fi - - # 步骤4:验证软件包安装状态 - LOG_INFO "步骤4:验证 texlive-uni-wtal-ger-doc 安装状态" - rpm -q texlive-uni-wtal-ger-doc - CHECK_RESULT $? 0 0 "验证 texlive-uni-wtal-ger-doc 安装状态失败" - - # 步骤5:卸载软件包 - LOG_INFO "步骤5:卸载 texlive-uni-wtal-ger-doc 软件包" - dnf remove -y texlive-uni-wtal-ger-doc - CHECK_RESULT $? 0 0 "卸载 texlive-uni-wtal-ger-doc 失败" - LOG_INFO "卸载 texlive-uni-wtal-ger-doc 成功" - - # 步骤6:验证软件包是否已完全卸载 - LOG_INFO "步骤6:验证 texlive-uni-wtal-ger-doc 是否完全卸载" - rpm -q texlive-uni-wtal-ger-doc >/dev/null 2>&1 - if [ $? -eq 0 ]; then - LOG_ERROR "软件包 texlive-uni-wtal-ger-doc 卸载不干净" - exit 1 - fi - LOG_INFO "软件包 texlive-uni-wtal-ger-doc 已完全卸载" - - # 步骤7:如果之前未安装,则清理环境,恢复到之前的状态 - if [ $INSTALLED_FLAG -eq 0 ]; then - LOG_INFO "步骤7:清理环境,恢复到之前的状态" - # 检查是否仍有残留文件 - LOG_INFO "检查是否有残留文件" - find /usr/share/texlive -name "*wtal*ger*" 2>/dev/null | head -5 - if [ $? -eq 0 ]; then - LOG_ERROR "发现残留文件,清理环境失败" - exit 1 - fi - LOG_INFO "环境清理完成,无残留文件" - else - LOG_INFO "步骤7:重新安装 texlive-uni-wtal-ger-doc 以恢复环境" - dnf install -y texlive-uni-wtal-ger-doc - CHECK_RESULT $? 0 0 "重新安装 texlive-uni-wtal-ger-doc 失败" - LOG_INFO "重新安装 texlive-uni-wtal-ger-doc 成功,环境已恢复" - fi - - LOG_INFO "测试 texlive-uni-wtal-ger-doc 软件包的卸载功能完成" -} - -main "$@" \ No newline at end of file diff --git a/testcases/function_test/pkg_test/texlive-split-y/texlive-uni-wtal-ger-doc/test_texlive-uni-wtal-ger-doc_function_view_doc.sh b/testcases/function_test/pkg_test/texlive-split-y/texlive-uni-wtal-ger-doc/test_texlive-uni-wtal-ger-doc_function_view_doc.sh deleted file mode 100644 index e3af6831802..00000000000 --- a/testcases/function_test/pkg_test/texlive-split-y/texlive-uni-wtal-ger-doc/test_texlive-uni-wtal-ger-doc_function_view_doc.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-03-18 -# @License : Mulan PSL v2 -# @Desc : 检查 texlive-uni-wtal-ger-doc 软件包的主要文档文件(如 PDF、README)是否存在并可访问。 -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - LOG_INFO "开始测试 texlive-uni-wtal-ger-doc 软件包文档文件可访问性" - - LOG_INFO "步骤1: 检查软件包是否已在系统中安装" - if dnf list installed texlive-uni-wtal-ger-doc 2>/dev/null | grep -q texlive-uni-wtal-ger-doc; then - LOG_INFO "软件包 texlive-uni-wtal-ger-doc 已安装,记录状态以便恢复" - PACKAGE_INSTALLED=true - else - LOG_INFO "软件包 texlive-uni-wtal-ger-doc 未安装" - PACKAGE_INSTALLED=false - fi - - LOG_INFO "步骤2: 检查 yum 源中是否存在 texlive-uni-wtal-ger-doc 软件包" - if ! dnf list available texlive-uni-wtal-ger-doc 2>/dev/null | grep -q texlive-uni-wtal-ger-doc; then - LOG_ERROR "yum 源中未找到 texlive-uni-wtal-ger-doc 软件包" - exit 255 - fi - - if [ "$PACKAGE_INSTALLED" = false ]; then - LOG_INFO "步骤3: 安装 texlive-uni-wtal-ger-doc 软件包" - dnf install -y texlive-uni-wtal-ger-doc - CHECK_RESULT $? 0 0 "安装 texlive-uni-wtal-ger-doc 失败" - fi - - LOG_INFO "步骤4: 获取软件包安装的文件列表" - PACKAGE_FILES=$(rpm -ql texlive-uni-wtal-ger-doc) - CHECK_RESULT $? 0 0 "获取 texlive-uni-wtal-ger-doc 文件列表失败" - - LOG_INFO "步骤5: 筛选出主要的文档文件(如 PDF、README)" - DOC_FILES=$(echo "$PACKAGE_FILES" | grep -E "\.pdf$|README|\.txt$" | head -5) - - if [ -z "$DOC_FILES" ]; then - LOG_ERROR "未找到主要的文档文件(PDF、README、TXT)" - exit 1 - fi - - LOG_INFO "步骤6: 检查每个文档文件是否存在并可访问" - for DOC_FILE in $DOC_FILES; do - LOG_INFO "检查文件: $DOC_FILE" - if [ -f "$DOC_FILE" ] && [ -r "$DOC_FILE" ]; then - LOG_INFO "文件 $DOC_FILE 存在且可读" - else - LOG_ERROR "文件 $DOC_FILE 不存在或不可访问" - exit 1 - fi - done - - LOG_INFO "步骤7: 环境恢复" - if [ "$PACKAGE_INSTALLED" = false ]; then - LOG_INFO "卸载 texlive-uni-wtal-ger-doc 软件包" - dnf remove -y texlive-uni-wtal-ger-doc - CHECK_RESULT $? 0 0 "卸载 texlive-uni-wtal-ger-doc 失败" - else - LOG_INFO "软件包初始状态为已安装,保持安装状态" - fi - - LOG_INFO "测试完成" -} - -main "$@" \ No newline at end of file