From 72db622a21bc015d040284a0989ee5b8553d7d78 Mon Sep 17 00:00:00 2001 From: honghua Date: Thu, 23 Apr 2026 11:35:19 +0800 Subject: [PATCH 01/21] update testcase for testsuite texlive-emptypage --- .../texlive-split-h/texlive-emptypage.json | 16 --- .../test_texlive-emptypage_function_basic.sh | 63 ------------ ..._texlive-emptypage_function_basic_usage.sh | 99 ------------------- ...live-emptypage_function_check_installed.sh | 87 ---------------- ...test_texlive-emptypage_function_version.sh | 74 -------------- 5 files changed, 339 deletions(-) delete mode 100644 testcases/function_test/pkg_test/texlive-split-h/texlive-emptypage/test_texlive-emptypage_function_basic.sh delete mode 100644 testcases/function_test/pkg_test/texlive-split-h/texlive-emptypage/test_texlive-emptypage_function_basic_usage.sh delete mode 100644 testcases/function_test/pkg_test/texlive-split-h/texlive-emptypage/test_texlive-emptypage_function_check_installed.sh delete mode 100644 testcases/function_test/pkg_test/texlive-split-h/texlive-emptypage/test_texlive-emptypage_function_version.sh diff --git a/suite2cases/function_test/pkg_test/texlive-split-h/texlive-emptypage.json b/suite2cases/function_test/pkg_test/texlive-split-h/texlive-emptypage.json index 93c2eeab144..059854c14f0 100644 --- a/suite2cases/function_test/pkg_test/texlive-split-h/texlive-emptypage.json +++ b/suite2cases/function_test/pkg_test/texlive-split-h/texlive-emptypage.json @@ -2,10 +2,6 @@ "path": "$OET_PATH/testcases/function_test/pkg_test/texlive-split-h/texlive-emptypage", "machine num": 1, "cases": [ - { - "name": "test_texlive-emptypage_function_basic", - "desc": "Test basic functionality of texlive-emptypage" - }, { "name": "test_texlive-emptypage_function_install", "desc": "Test installation of texlive-emptypage package" @@ -13,18 +9,6 @@ { "name": "test_texlive-emptypage_function_uninstall", "desc": "Test uninstallation of texlive-emptypage package" - }, - { - "name": "test_texlive-emptypage_function_check_installed", - "desc": "Test if texlive-emptypage is installed" - }, - { - "name": "test_texlive-emptypage_function_basic_usage", - "desc": "Test basic usage of emptypage package in LaTeX" - }, - { - "name": "test_texlive-emptypage_function_version", - "desc": "Test version information of texlive-emptypage" } ] } \ No newline at end of file diff --git a/testcases/function_test/pkg_test/texlive-split-h/texlive-emptypage/test_texlive-emptypage_function_basic.sh b/testcases/function_test/pkg_test/texlive-split-h/texlive-emptypage/test_texlive-emptypage_function_basic.sh deleted file mode 100644 index 80cdc280951..00000000000 --- a/testcases/function_test/pkg_test/texlive-split-h/texlive-emptypage/test_texlive-emptypage_function_basic.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 basic functionality of texlive-emptypage -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - - # 检查是否已经安装texlive-emptypage - if rpm -q texlive-emptypage &>/dev/null; then - LOG_INFO "texlive-emptypage已经安装,测试结束后将保持安装状态" - INSTALLED=true - else - LOG_INFO "texlive-emptypage未安装,将在测试结束后卸载" - INSTALLED=false - fi - - # 检查yum源中是否有texlive-emptypage软件包 - LOG_INFO "检查yum源中是否存在texlive-emptypage软件包" - if ! dnf list available texlive-emptypage &>/dev/null; then - LOG_ERROR "yum源中未找到texlive-emptypage软件包" - exit 255 - fi - - # 安装texlive-emptypage软件包 - if [ "$INSTALLED" = false ]; then - LOG_INFO "安装texlive-emptypage软件包" - dnf install -y texlive-emptypage - CHECK_RESULT $? 0 0 "安装texlive-emptypage失败" - fi - - # 测试texlive-emptypage基本功能 - LOG_INFO "测试texlive-emptypage基本功能" - texlive-emptypage --help &>/dev/null - CHECK_RESULT $? 0 0 "texlive-emptypage基本功能测试失败" - - # 清理环境 - if [ "$INSTALLED" = false ]; then - LOG_INFO "卸载texlive-emptypage软件包" - dnf remove -y texlive-emptypage - CHECK_RESULT $? 0 0 "卸载texlive-emptypage失败" - fi - - LOG_INFO "测试完成,环境已恢复" - -} - -main "$@" \ No newline at end of file diff --git a/testcases/function_test/pkg_test/texlive-split-h/texlive-emptypage/test_texlive-emptypage_function_basic_usage.sh b/testcases/function_test/pkg_test/texlive-split-h/texlive-emptypage/test_texlive-emptypage_function_basic_usage.sh deleted file mode 100644 index d98a839ed3c..00000000000 --- a/testcases/function_test/pkg_test/texlive-split-h/texlive-emptypage/test_texlive-emptypage_function_basic_usage.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 : 2026-03-26 -# @License : Mulan PSL v2 -# @Desc : Test basic usage of emptypage package in LaTeX -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - # 定义颜色输出 - LOG_INFO() { - echo -e "\033[32m[INFO]\033[0m $1" - } - LOG_ERROR() { - echo -e "\033[31m[ERROR]\033[0m $1" - } - - # 定义软件包名称 - PACKAGE_NAME="texlive-emptypage" - COMMAND="emptypage" - - # 步骤1:检查yum源中是否存在指定软件包 - 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 - - # 步骤2:检查系统是否已安装该软件包 - LOG_INFO "步骤2:检查系统是否已安装 $PACKAGE_NAME 软件包" - rpm -q $PACKAGE_NAME &>/dev/null - if [ $? -eq 0 ]; then - LOG_INFO "$PACKAGE_NAME 已安装,脚本结束后将保持安装状态" - INSTALLED=true - else - LOG_INFO "$PACKAGE_NAME 未安装,将在测试步骤中安装" - INSTALLED=false - fi - - # 步骤3:如果未安装,则安装软件包 - if [ "$INSTALLED" = false ]; then - LOG_INFO "步骤3:安装 $PACKAGE_NAME 软件包" - dnf install -y $PACKAGE_NAME - CHECK_RESULT $? 0 0 "安装 $PACKAGE_NAME 失败" - fi - - # 步骤4:检查命令是否可用 - LOG_INFO "步骤4:检查 $COMMAND 命令是否可用" - which $COMMAND &>/dev/null - CHECK_RESULT $? 0 0 "$COMMAND 命令不存在" - - # 步骤5:测试命令基本使用 - LOG_INFO "步骤5:测试 $COMMAND 命令基本使用" - $COMMAND --help &>/dev/null - CHECK_RESULT $? 0 0 "$COMMAND 命令不支持 --help 参数" - - # 步骤6:测试命令具体功能 - LOG_INFO "步骤6:测试 $COMMAND 命令具体功能" - echo "\documentclass{article} - \usepackage{emptypage} - \begin{document} - Test page. - \clearpage - % 空白页 - \end{document}" > test_emptypage.tex - $COMMAND test_emptypage.tex &>/dev/null - CHECK_RESULT $? 0 0 "$COMMAND 命令执行失败" - - # 步骤7:清理测试文件 - LOG_INFO "步骤7:清理测试文件" - rm -f test_emptypage.tex test_emptypage.pdf - - # 步骤8:如果之前未安装,则卸载软件包 - if [ "$INSTALLED" = false ]; then - LOG_INFO "步骤8:卸载 $PACKAGE_NAME 软件包" - dnf remove -y $PACKAGE_NAME - CHECK_RESULT $? 0 0 "卸载 $PACKAGE_NAME 失败" - else - LOG_INFO "步骤8:保持 $PACKAGE_NAME 软件包安装状态" - fi - - LOG_INFO "测试完成,环境已恢复" -} - -main "$@" \ No newline at end of file diff --git a/testcases/function_test/pkg_test/texlive-split-h/texlive-emptypage/test_texlive-emptypage_function_check_installed.sh b/testcases/function_test/pkg_test/texlive-split-h/texlive-emptypage/test_texlive-emptypage_function_check_installed.sh deleted file mode 100644 index 60d9a25e702..00000000000 --- a/testcases/function_test/pkg_test/texlive-split-h/texlive-emptypage/test_texlive-emptypage_function_check_installed.sh +++ /dev/null @@ -1,87 +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 if texlive-emptypage is installed -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - # 设置脚本遇到错误时退出 - set -e - - # 定义软件包名称 - PACKAGE_NAME="texlive-emptypage" - - # 步骤1: 检查软件包是否已在yum源中 - LOG_INFO "步骤1: 检查软件包 $PACKAGE_NAME 是否在yum源中" - if ! dnf list available $PACKAGE_NAME &>/dev/null; then - LOG_ERROR "软件包 $PACKAGE_NAME 不在yum源中" - exit 255 - fi - - # 步骤2: 检查当前是否已安装该软件包 - 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 - - # 步骤3: 如果未安装,则执行安装 - if [ "$ALREADY_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: 测试软件包基本功能 - LOG_INFO "步骤5: 测试 $PACKAGE_NAME 基本功能" - # 这里可以根据实际软件包的功能添加测试命令 - # 例如:如果软件包提供了某个命令,可以测试该命令 - # command_from_package --help - # CHECK_RESULT $? 0 0 "测试 $PACKAGE_NAME 功能失败" - - # 步骤6: 环境清理 - LOG_INFO "步骤6: 环境清理" - if [ "$ALREADY_INSTALLED" = "false" ]; then - LOG_INFO "卸载 $PACKAGE_NAME" - dnf remove -y $PACKAGE_NAME - CHECK_RESULT $? 0 0 "卸载 $PACKAGE_NAME 失败" - - # 验证卸载是否成功 - rpm -q $PACKAGE_NAME - 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/texlive-split-h/texlive-emptypage/test_texlive-emptypage_function_version.sh b/testcases/function_test/pkg_test/texlive-split-h/texlive-emptypage/test_texlive-emptypage_function_version.sh deleted file mode 100644 index 8b81dd7f818..00000000000 --- a/testcases/function_test/pkg_test/texlive-split-h/texlive-emptypage/test_texlive-emptypage_function_version.sh +++ /dev/null @@ -1,74 +0,0 @@ -#!/usr/bin/bash - -# Copyright (c) 2024 ISCAS .ALL rights reserved. -# This program is licensed under Mulan PSL v2. -# You can use it according to the terms and conditions of the Mulan PSL v2. -# http://license.coscl.org.cn/MulanPSL2 -# THIS PROGRAM IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, -# EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, -# MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. -# See the Mulan PSL v2 for more details. - -# ############################################# -# @Author : honghua -# @Contact : honghua@iscas.ac.cn -# @Date : 2026-03-26 -# @License : Mulan PSL v2 -# @Desc : Test version information of texlive-emptypage -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - LOG_INFO "测试开始:Test version information of texlive-emptypage" - - LOG_INFO "步骤1: 检查yum源中是否存在texlive-emptypage软件包" - dnf list available texlive-emptypage > /dev/null 2>&1 - if [ $? -ne 0 ]; then - LOG_ERROR "yum源中未找到texlive-emptypage软件包" - exit 255 - fi - - LOG_INFO "步骤2: 检查是否已安装texlive-emptypage" - rpm -q texlive-emptypage > /dev/null 2>&1 - if [ $? -eq 0 ]; then - LOG_INFO "texlive-emptypage已安装,标记为已安装状态" - INSTALLED=true - else - LOG_INFO "texlive-emptypage未安装,标记为未安装状态" - INSTALLED=false - fi - - if [ "$INSTALLED" = "false" ]; then - LOG_INFO "步骤3: 安装texlive-emptypage软件包" - dnf install -y texlive-emptypage - CHECK_RESULT $? 0 0 "安装texlive-emptypage失败" - fi - - LOG_INFO "步骤4: 测试texlive-emptypage的版本信息命令" - rpm -q texlive-emptypage --queryformat "%{VERSION}-%{RELEASE}\n" - CHECK_RESULT $? 0 0 "查询texlive-emptypage版本信息失败" - - LOG_INFO "步骤5: 检查texlive-emptypage命令是否支持--version参数" - texlive-emptypage --version > /dev/null 2>&1 - if [ $? -ne 0 ]; then - LOG_ERROR "texlive-emptypage命令不支持--version参数" - exit 255 - fi - - LOG_INFO "步骤6: 执行texlive-emptypage --version命令" - texlive-emptypage --version - CHECK_RESULT $? 0 0 "执行texlive-emptypage --version命令失败" - - if [ "$INSTALLED" = "false" ]; then - LOG_INFO "步骤7: 卸载texlive-emptypage软件包" - dnf remove -y texlive-emptypage - CHECK_RESULT $? 0 0 "卸载texlive-emptypage失败" - else - LOG_INFO "步骤7: 保持texlive-emptypage安装状态,无需卸载" - fi - - LOG_INFO "测试结束:Test version information of texlive-emptypage完成" -} - -main "$@" \ No newline at end of file From 36aba07abb888734ef309212551440cb9f1e8e62 Mon Sep 17 00:00:00 2001 From: honghua Date: Thu, 23 Apr 2026 11:45:42 +0800 Subject: [PATCH 02/21] update testcase for testsuite texlive-hhtensor --- .../texlive-split-k/texlive-hhtensor.json | 10 --- .../test_texlive-hhtensor_function_basic.sh | 65 ------------------- 2 files changed, 75 deletions(-) delete mode 100644 suite2cases/function_test/pkg_test/texlive-split-k/texlive-hhtensor.json delete mode 100644 testcases/function_test/pkg_test/texlive-split-k/texlive-hhtensor/test_texlive-hhtensor_function_basic.sh diff --git a/suite2cases/function_test/pkg_test/texlive-split-k/texlive-hhtensor.json b/suite2cases/function_test/pkg_test/texlive-split-k/texlive-hhtensor.json deleted file mode 100644 index 41bafc9ebe4..00000000000 --- a/suite2cases/function_test/pkg_test/texlive-split-k/texlive-hhtensor.json +++ /dev/null @@ -1,10 +0,0 @@ -{ - "path": "$OET_PATH/testcases/function_test/pkg_test/texlive-split-k/texlive-hhtensor", - "machine num": 1, - "cases": [ - { - "name": "test_texlive-hhtensor_function_basic", - "desc": "Test basic functionality of texlive-hhtensor" - } - ] -} \ No newline at end of file diff --git a/testcases/function_test/pkg_test/texlive-split-k/texlive-hhtensor/test_texlive-hhtensor_function_basic.sh b/testcases/function_test/pkg_test/texlive-split-k/texlive-hhtensor/test_texlive-hhtensor_function_basic.sh deleted file mode 100644 index e891782f2f5..00000000000 --- a/testcases/function_test/pkg_test/texlive-split-k/texlive-hhtensor/test_texlive-hhtensor_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-11-26 -# @License : Mulan PSL v2 -# @Desc : Test basic functionality of texlive-hhtensor -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - LOG_INFO "开始测试 texlive-hhtensor 的基本功能" - - # 检查是否已安装 texlive-hhtensor - LOG_INFO "检查是否已安装 texlive-hhtensor" - if dnf list installed texlive-hhtensor &>/dev/null; then - LOG_INFO "texlive-hhtensor 已安装,测试结束后将保持安装状态" - INSTALLED=true - else - LOG_INFO "texlive-hhtensor 未安装,将在测试结束后卸载" - INSTALLED=false - fi - - # 检查 yum 源中是否有 texlive-hhtensor - LOG_INFO "检查 yum 源中是否有 texlive-hhtensor" - if ! dnf list available texlive-hhtensor &>/dev/null; then - LOG_ERROR "yum 源中未找到 texlive-hhtensor,退出测试" - exit 255 - fi - - # 如果未安装,则安装 texlive-hhtensor - if [ "$INSTALLED" = false ]; then - LOG_INFO "安装 texlive-hhtensor" - dnf install -y texlive-hhtensor - CHECK_RESULT $? 0 0 "安装 texlive-hhtensor 失败" - fi - - # 测试 texlive-hhtensor 的基本功能 - LOG_INFO "测试 texlive-hhtensor 的基本功能" - texlive_command="tex --version" - $texlive_command - CHECK_RESULT $? 0 0 "执行 $texlive_command 失败" - - # 清理环境 - if [ "$INSTALLED" = false ]; then - LOG_INFO "卸载 texlive-hhtensor" - dnf remove -y texlive-hhtensor - CHECK_RESULT $? 0 0 "卸载 texlive-hhtensor 失败" - fi - - LOG_INFO "测试完成" -} - -main "$@" \ No newline at end of file From 9b921c5b4454a2563778c3f8e68906e78cfefc2f Mon Sep 17 00:00:00 2001 From: honghua Date: Thu, 23 Apr 2026 11:45:56 +0800 Subject: [PATCH 03/21] update testcase for testsuite qt5-qtwebchannel-doc --- .../qt5-doc/qt5-qtwebchannel-doc.json | 4 - ...t5-qtwebchannel-doc_function_doc_access.sh | 76 ------------------- 2 files changed, 80 deletions(-) delete mode 100644 testcases/function_test/pkg_test/qt5-doc/qt5-qtwebchannel-doc/test_qt5-qtwebchannel-doc_function_doc_access.sh diff --git a/suite2cases/function_test/pkg_test/qt5-doc/qt5-qtwebchannel-doc.json b/suite2cases/function_test/pkg_test/qt5-doc/qt5-qtwebchannel-doc.json index 09f34b17e05..ba795c818d5 100644 --- a/suite2cases/function_test/pkg_test/qt5-doc/qt5-qtwebchannel-doc.json +++ b/suite2cases/function_test/pkg_test/qt5-doc/qt5-qtwebchannel-doc.json @@ -6,10 +6,6 @@ "name": "test_qt5-qtwebchannel-doc_uninstall", "desc": "测试软件包qt5-qtwebchannel-doc的卸载功能,验证卸载过程是否正常完成。", "machine num": 1 - }, - { - "name": "test_qt5-qtwebchannel-doc_function_doc_access", - "desc": "测试软件包qt5-qtwebchannel-doc的文档访问功能,验证文档是否可正常访问。" } ] } \ No newline at end of file diff --git a/testcases/function_test/pkg_test/qt5-doc/qt5-qtwebchannel-doc/test_qt5-qtwebchannel-doc_function_doc_access.sh b/testcases/function_test/pkg_test/qt5-doc/qt5-qtwebchannel-doc/test_qt5-qtwebchannel-doc_function_doc_access.sh deleted file mode 100644 index 14d745bc562..00000000000 --- a/testcases/function_test/pkg_test/qt5-doc/qt5-qtwebchannel-doc/test_qt5-qtwebchannel-doc_function_doc_access.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 : 2025-12-05 -# @License : Mulan PSL v2 -# @Desc : 测试软件包qt5-qtwebchannel-doc的文档访问功能,验证文档是否可正常访问。 -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - LOG_INFO "开始测试qt5-qtwebchannel-doc的文档访问功能" - - # 检查软件包是否在yum源中 - LOG_INFO "检查yum源中是否存在qt5-qtwebchannel-doc软件包" - dnf list available qt5-qtwebchannel-doc &>/dev/null - if [ $? -ne 0 ]; then - LOG_ERROR "yum源中未找到qt5-qtwebchannel-doc软件包" - exit 255 - fi - - # 检查是否已安装qt5-qtwebchannel-doc - LOG_INFO "检查系统是否已安装qt5-qtwebchannel-doc" - rpm -q qt5-qtwebchannel-doc &>/dev/null - if [ $? -eq 0 ]; then - installed=true - LOG_INFO "qt5-qtwebchannel-doc已安装,测试完成后将保持安装状态" - else - installed=false - LOG_INFO "qt5-qtwebchannel-doc未安装,将在测试完成后卸载" - fi - - # 安装软件包(如果未安装) - if [ "$installed" = false ]; then - LOG_INFO "安装qt5-qtwebchannel-doc软件包" - dnf install -y qt5-qtwebchannel-doc - CHECK_RESULT $? 0 0 "安装qt5-qtwebchannel-doc失败" - fi - - # 验证文档访问功能 - LOG_INFO "验证qt5-qtwebchannel-doc文档是否可正常访问" - doc_path=$(rpm -ql qt5-qtwebchannel-doc | grep -m 1 "/usr/share/doc/qt5-qtwebchannel") - if [ -z "$doc_path" ]; then - LOG_ERROR "未找到qt5-qtwebchannel-doc文档路径" - exit 255 - fi - - # 检查文档目录是否存在 - if [ ! -d "$doc_path" ]; then - LOG_ERROR "文档目录不存在: $doc_path" - exit 1 - fi - - # 检查文档文件是否可访问 - LOG_INFO "检查文档文件是否可读" - find "$doc_path" -type f -exec test -r {} \; &>/dev/null - CHECK_RESULT $? 0 0 "文档文件不可读" - - # 清理环境(如果测试前未安装) - if [ "$installed" = false ]; then - LOG_INFO "卸载qt5-qtwebchannel-doc软件包" - dnf remove -y qt5- -} - -main "$@" \ No newline at end of file From 998ee61a6e61592d3f6bc94f2e1f6c126f805e6b Mon Sep 17 00:00:00 2001 From: honghua Date: Thu, 23 Apr 2026 11:48:05 +0800 Subject: [PATCH 04/21] update testcase for testsuite texlive-lithuanian --- .../texlive-split-l/texlive-lithuanian.json | 10 --- ...est_texlive-lithuanian_function_install.sh | 64 ------------------- 2 files changed, 74 deletions(-) delete mode 100644 suite2cases/function_test/pkg_test/texlive-split-l/texlive-lithuanian.json delete mode 100644 testcases/function_test/pkg_test/texlive-split-l/texlive-lithuanian/test_texlive-lithuanian_function_install.sh diff --git a/suite2cases/function_test/pkg_test/texlive-split-l/texlive-lithuanian.json b/suite2cases/function_test/pkg_test/texlive-split-l/texlive-lithuanian.json deleted file mode 100644 index 47b8af23837..00000000000 --- a/suite2cases/function_test/pkg_test/texlive-split-l/texlive-lithuanian.json +++ /dev/null @@ -1,10 +0,0 @@ -{ - "path": "$OET_PATH/testcases/function_test/pkg_test/texlive-split-l/texlive-lithuanian", - "machine num": 1, - "cases": [ - { - "name": "test_texlive-lithuanian_function_install", - "desc": "Test package installation" - } - ] -} \ No newline at end of file diff --git a/testcases/function_test/pkg_test/texlive-split-l/texlive-lithuanian/test_texlive-lithuanian_function_install.sh b/testcases/function_test/pkg_test/texlive-split-l/texlive-lithuanian/test_texlive-lithuanian_function_install.sh deleted file mode 100644 index 985eabd4967..00000000000 --- a/testcases/function_test/pkg_test/texlive-split-l/texlive-lithuanian/test_texlive-lithuanian_function_install.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-09-26 -# @License : Mulan PSL v2 -# @Desc : Test package installation -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - # 检查是否已安装texlive-lithuanian包 - LOG_INFO "检查是否已安装texlive-lithuanian包" - rpm -q texlive-lithuanian - if [ $? -eq 0 ]; then - LOG_INFO "texlive-lithuanian已安装,脚本结束后保持安装状态" - INSTALLED=1 - else - LOG_INFO "texlive-lithuanian未安装,将在测试后卸载" - INSTALLED=0 - fi - - # 检查yum源中是否存在texlive-lithuanian包 - LOG_INFO "检查yum源中是否存在texlive-lithuanian包" - dnf list available texlive-lithuanian &>/dev/null - CHECK_RESULT $? 0 255 "yum源中不存在texlive-lithuanian包" - - # 安装texlive-lithuanian包 - LOG_INFO "安装texlive-lithuanian包" - dnf install -y texlive-lithuanian - CHECK_RESULT $? 0 0 "安装texlive-lithuanian包失败" - - # 验证安装是否成功 - LOG_INFO "验证texlive-lithuanian包是否安装成功" - rpm -q texlive-lithuanian - CHECK_RESULT $? 0 0 "texlive-lithuanian包未成功安装" - - # 测试texlive-lithuanian功能(假设有一个命令可以测试) - LOG_INFO "测试texlive-lithuanian功能" - texlua --help &>/dev/null - CHECK_RESULT $? 0 255 "texlua命令不支持或参数错误" - - # 清理环境 - if [ $INSTALLED -eq 0 ]; then - LOG_INFO "卸载texlive-lithuanian包" - dnf remove -y texlive-lithuanian - CHECK_RESULT $? 0 0 "卸载texlive-lithuanian包失败" - fi - - LOG_INFO "测试完成,环境已恢复" -} - -main "$@" \ No newline at end of file From 282ab0a1807e1b0f0ab89284ef45035031cd5e46 Mon Sep 17 00:00:00 2001 From: honghua Date: Thu, 23 Apr 2026 11:48:34 +0800 Subject: [PATCH 05/21] update testcase for testsuite python-chardet-help --- .../python-chardet/python-chardet-help.json | 10 --- ...est_python-chardet-help_function_detect.sh | 70 ------------------- 2 files changed, 80 deletions(-) delete mode 100644 suite2cases/function_test/pkg_test/python-chardet/python-chardet-help.json delete mode 100644 testcases/function_test/pkg_test/python-chardet/python-chardet-help/test_python-chardet-help_function_detect.sh diff --git a/suite2cases/function_test/pkg_test/python-chardet/python-chardet-help.json b/suite2cases/function_test/pkg_test/python-chardet/python-chardet-help.json deleted file mode 100644 index 2217cc17938..00000000000 --- a/suite2cases/function_test/pkg_test/python-chardet/python-chardet-help.json +++ /dev/null @@ -1,10 +0,0 @@ -{ - "path": "$OET_PATH/testcases/function_test/pkg_test/python-chardet/python-chardet-help", - "machine num": 1, - "cases": [ - { - "name": "test_python-chardet-help_function_detect", - "desc": "Test chardet detect function" - } - ] -} \ No newline at end of file diff --git a/testcases/function_test/pkg_test/python-chardet/python-chardet-help/test_python-chardet-help_function_detect.sh b/testcases/function_test/pkg_test/python-chardet/python-chardet-help/test_python-chardet-help_function_detect.sh deleted file mode 100644 index 8741bd6f538..00000000000 --- a/testcases/function_test/pkg_test/python-chardet/python-chardet-help/test_python-chardet-help_function_detect.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-11-27 -# @License : Mulan PSL v2 -# @Desc : Test chardet detect function -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - - # 检查是否已安装python3-chardet - LOG_INFO "检查是否已安装python3-chardet" - rpm -q python3-chardet > /dev/null 2>&1 - if [ $? -eq 0 ]; then - LOG_INFO "python3-chardet已安装,脚本结束时保持安装状态" - INSTALLED=true - else - LOG_INFO "python3-chardet未安装,将在测试后卸载" - INSTALLED=false - fi - - # 检查yum源中是否有python3-chardet软件包 - LOG_INFO "检查yum源中是否有python3-chardet软件包" - dnf list available python3-chardet > /dev/null 2>&1 - if [ $? -ne 0 ]; then - LOG_ERROR "yum源中未找到python3-chardet软件包" - exit 255 - fi - - # 安装python3-chardet - if [ "$INSTALLED" = false ]; then - LOG_INFO "安装python3-chardet" - dnf install -y python3-chardet - CHECK_RESULT $? 0 0 "安装python3-chardet失败" - fi - - # 测试chardet的detect功能 - LOG_INFO "测试chardet的detect功能" - echo "测试文本" > test.txt - python3 -c "import chardet; print(chardet.detect(open("test.txt", "rb").read()))" > result.txt - CHECK_RESULT $? 0 0 "执行chardet.detect失败" - - # 清理测试文件 - rm -f test.txt result.txt - - # 如果之前未安装,则卸载python3-chardet - if [ "$INSTALLED" = false ]; then - LOG_INFO "卸载python3-chardet" - dnf remove -y python3-chardet - CHECK_RESULT $? 0 0 "卸载python3-chardet失败" - fi - - LOG_INFO "测试完成,环境已恢复" - -} - -main "$@" \ No newline at end of file From dcf880f06cca48b8c67c046f76e16cca23a4596d Mon Sep 17 00:00:00 2001 From: honghua Date: Thu, 23 Apr 2026 11:49:12 +0800 Subject: [PATCH 06/21] update testcase for testsuite libslirp-devel --- .../pkg_test/libslirp/libslirp-devel.json | 10 --- .../test_libslirp-devel_function_init.sh | 64 ------------------- 2 files changed, 74 deletions(-) delete mode 100644 suite2cases/function_test/pkg_test/libslirp/libslirp-devel.json delete mode 100644 testcases/function_test/pkg_test/libslirp/libslirp-devel/test_libslirp-devel_function_init.sh diff --git a/suite2cases/function_test/pkg_test/libslirp/libslirp-devel.json b/suite2cases/function_test/pkg_test/libslirp/libslirp-devel.json deleted file mode 100644 index 634d1165527..00000000000 --- a/suite2cases/function_test/pkg_test/libslirp/libslirp-devel.json +++ /dev/null @@ -1,10 +0,0 @@ -{ - "path": "$OET_PATH/testcases/function_test/pkg_test/libslirp/libslirp-devel", - "machine num": 1, - "cases": [ - { - "name": "test_libslirp-devel_function_init", - "desc": "Test initialization of libslirp-devel" - } - ] -} \ No newline at end of file diff --git a/testcases/function_test/pkg_test/libslirp/libslirp-devel/test_libslirp-devel_function_init.sh b/testcases/function_test/pkg_test/libslirp/libslirp-devel/test_libslirp-devel_function_init.sh deleted file mode 100644 index d657737a8cb..00000000000 --- a/testcases/function_test/pkg_test/libslirp/libslirp-devel/test_libslirp-devel_function_init.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 : Test initialization of libslirp-devel -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - - # 检查libslirp-devel是否已安装 - LOG_INFO "检查libslirp-devel是否已安装" - rpm -q libslirp-devel > /dev/null 2>&1 - if [ $? -eq 0 ]; then - LOG_INFO "libslirp-devel已安装,脚本结束时将保持安装状态" - installed=true - else - LOG_INFO "libslirp-devel未安装,将在测试步骤中安装" - installed=false - fi - - # 检查yum源中是否有libslirp-devel软件包 - LOG_INFO "检查yum源中是否有libslirp-devel软件包" - dnf list available libslirp-devel > /dev/null 2>&1 - CHECK_RESULT $? 0 255 "yum源中没有libslirp-devel软件包" - - # 安装libslirp-devel软件包(如果未安装) - if [ "$installed" = false ]; then - LOG_INFO "安装libslirp-devel软件包" - dnf install -y libslirp-devel - CHECK_RESULT $? 0 0 "安装libslirp-devel失败" - fi - - # 测试libslirp-devel的初始化功能 - LOG_INFO "测试libslirp-devel的初始化功能" - # 假设初始化命令为init_libslirp,这里仅为示例 - init_libslirp --version > /dev/null 2>&1 - CHECK_RESULT $? 0 255 "init_libslirp命令不支持或参数错误" - - # 清理环境(如果之前未安装) - if [ "$installed" = false ]; then - LOG_INFO "卸载libslirp-devel软件包" - dnf remove -y libslirp-devel - CHECK_RESULT $? 0 0 "卸载libslirp-devel失败" - fi - - LOG_INFO "测试完成,环境已恢复" - -} - -main "$@" \ No newline at end of file From c44569d416d7f49e05f46395fe8837c1bdfe3ecf Mon Sep 17 00:00:00 2001 From: honghua Date: Thu, 23 Apr 2026 11:51:08 +0800 Subject: [PATCH 07/21] update testcase for testsuite python3-webtest --- .../python-webtest/python3-webtest.json | 24 ---- .../test_python3-webtest_function_basic.sh | 61 ---------- ...test_python3-webtest_function_basic_get.sh | 81 ------------- .../test_python3-webtest_function_headers.sh | 108 ----------------- .../test_python3-webtest_function_json.sh | 89 -------------- ...test_python3-webtest_function_post_form.sh | 111 ------------------ .../test_python3-webtest_function_status.sh | 70 ----------- 7 files changed, 544 deletions(-) delete mode 100644 testcases/function_test/pkg_test/python-webtest/python3-webtest/test_python3-webtest_function_basic.sh delete mode 100644 testcases/function_test/pkg_test/python-webtest/python3-webtest/test_python3-webtest_function_basic_get.sh delete mode 100644 testcases/function_test/pkg_test/python-webtest/python3-webtest/test_python3-webtest_function_headers.sh delete mode 100644 testcases/function_test/pkg_test/python-webtest/python3-webtest/test_python3-webtest_function_json.sh delete mode 100644 testcases/function_test/pkg_test/python-webtest/python3-webtest/test_python3-webtest_function_post_form.sh delete mode 100644 testcases/function_test/pkg_test/python-webtest/python3-webtest/test_python3-webtest_function_status.sh diff --git a/suite2cases/function_test/pkg_test/python-webtest/python3-webtest.json b/suite2cases/function_test/pkg_test/python-webtest/python3-webtest.json index ec9fb73d0b7..16e5e531de8 100644 --- a/suite2cases/function_test/pkg_test/python-webtest/python3-webtest.json +++ b/suite2cases/function_test/pkg_test/python-webtest/python3-webtest.json @@ -2,10 +2,6 @@ "path": "$OET_PATH/testcases/function_test/pkg_test/python-webtest/python3-webtest", "machine num": 1, "cases": [ - { - "name": "test_python3-webtest_function_basic", - "desc": "Test basic functionality of python3-webtest" - }, { "name": "test_python3-webtest_function_install", "desc": "Test installation of python3-webtest package" @@ -13,26 +9,6 @@ { "name": "test_python3-webtest_function_import", "desc": "Test importing the webtest module" - }, - { - "name": "test_python3-webtest_function_basic_get", - "desc": "Test basic HTTP GET request" - }, - { - "name": "test_python3-webtest_function_post_form", - "desc": "Test HTTP POST with form data" - }, - { - "name": "test_python3-webtest_function_json", - "desc": "Test handling JSON request/response" - }, - { - "name": "test_python3-webtest_function_status", - "desc": "Test HTTP response status codes" - }, - { - "name": "test_python3-webtest_function_headers", - "desc": "Test HTTP headers in response" } ] } \ No newline at end of file diff --git a/testcases/function_test/pkg_test/python-webtest/python3-webtest/test_python3-webtest_function_basic.sh b/testcases/function_test/pkg_test/python-webtest/python3-webtest/test_python3-webtest_function_basic.sh deleted file mode 100644 index 49e8687eca8..00000000000 --- a/testcases/function_test/pkg_test/python-webtest/python3-webtest/test_python3-webtest_function_basic.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-04 -# @License : Mulan PSL v2 -# @Desc : Test basic functionality of python3-webtest -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - # 检查python3-webtest是否已安装 - LOG_INFO "检查python3-webtest是否已安装" - rpm -q python3-webtest > /dev/null 2>&1 - if [ $? -eq 0 ]; then - LOG_INFO "python3-webtest已安装,脚本结束后保持安装状态" - installed=true - else - installed=false - fi - - # 检查yum源中是否有python3-webtest - LOG_INFO "检查yum源中是否有python3-webtest" - dnf list available python3-webtest > /dev/null 2>&1 - if [ $? -ne 0 ]; then - LOG_ERROR "yum源中未找到python3-webtest" - exit 255 - fi - - # 安装python3-webtest - if [ "$installed" = false ]; then - LOG_INFO "安装python3-webtest" - dnf install -y python3-webtest - CHECK_RESULT $? 0 0 "安装python3-webtest失败" - fi - - # 测试python3-webtest基本功能 - LOG_INFO "测试python3-webtest基本功能" - webtest --help > /dev/null 2>&1 - CHECK_RESULT $? 0 0 "webtest命令不支持或参数错误" - - # 清理环境(如果脚本开始时未安装) - if [ "$installed" = false ]; then - LOG_INFO "卸载python3-webtest" - dnf remove -y python3-webtest - CHECK_RESULT $? 0 0 "卸载python3-webtest失败" - fi -} - -main "$@" \ No newline at end of file diff --git a/testcases/function_test/pkg_test/python-webtest/python3-webtest/test_python3-webtest_function_basic_get.sh b/testcases/function_test/pkg_test/python-webtest/python3-webtest/test_python3-webtest_function_basic_get.sh deleted file mode 100644 index 981095da14f..00000000000 --- a/testcases/function_test/pkg_test/python-webtest/python3-webtest/test_python3-webtest_function_basic_get.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-02-19 -# @License : Mulan PSL v2 -# @Desc : Test basic HTTP GET request -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - LOG_INFO "开始测试:Test basic HTTP GET request" - - LOG_INFO "步骤1: 检查环境是否已安装python3-webtest软件包" - if dnf list installed python3-webtest &> /dev/null; then - LOG_INFO "python3-webtest已安装,测试结束后将保持安装状态" - INSTALLED_BEFORE=true - else - LOG_INFO "python3-webtest未安装,将在测试过程中安装" - INSTALLED_BEFORE=false - fi - - LOG_INFO "步骤2: 检查yum源中是否有python3-webtest软件包" - if ! dnf list available python3-webtest &> /dev/null; then - LOG_ERROR "yum源中未找到python3-webtest软件包" - exit 255 - fi - - LOG_INFO "步骤3: 如果未安装则安装python3-webtest" - if [ "$INSTALLED_BEFORE" = false ]; then - dnf install -y python3-webtest - CHECK_RESULT $? 0 0 "安装python3-webtest失败" - fi - - LOG_INFO "步骤4: 检查webtest命令是否存在" - if ! command -v webtest &> /dev/null; then - LOG_ERROR "webtest命令不存在" - exit 255 - fi - - LOG_INFO "步骤5: 检查webtest命令是否支持GET参数" - webtest --help | grep -q "GET" - CHECK_RESULT $? 0 0 "webtest命令不支持GET参数" - - LOG_INFO "步骤6: 启动一个简单的HTTP服务器用于测试" - python3 -m http.server 8080 & - SERVER_PID=$! - sleep 2 - - LOG_INFO "步骤7: 执行基本的HTTP GET请求测试" - webtest GET http://localhost:8080/ - CHECK_RESULT $? 0 0 "HTTP GET请求测试失败" - - LOG_INFO "步骤8: 停止测试HTTP服务器" - kill $SERVER_PID - wait $SERVER_PID 2>/dev/null - - LOG_INFO "步骤9: 清理环境" - if [ "$INSTALLED_BEFORE" = false ]; then - LOG_INFO "卸载测试期间安装的python3-webtest" - dnf remove -y python3-webtest - CHECK_RESULT $? 0 0 "卸载python3-webtest失败" - else - LOG_INFO "保持python3-webtest安装状态" - fi - - LOG_INFO "测试完成:Test basic HTTP GET request" -} - -main "$@" \ No newline at end of file diff --git a/testcases/function_test/pkg_test/python-webtest/python3-webtest/test_python3-webtest_function_headers.sh b/testcases/function_test/pkg_test/python-webtest/python3-webtest/test_python3-webtest_function_headers.sh deleted file mode 100644 index 8bdb65e3339..00000000000 --- a/testcases/function_test/pkg_test/python-webtest/python3-webtest/test_python3-webtest_function_headers.sh +++ /dev/null @@ -1,108 +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-19 -# @License : Mulan PSL v2 -# @Desc : Test HTTP headers in response -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - # 判断是否已安装python3-webtest - LOG_INFO "检查python3-webtest是否已安装" - rpm -q python3-webtest > /dev/null 2>&1 - if [ $? -eq 0 ]; then - LOG_INFO "python3-webtest已安装,测试后保持安装状态" - INSTALLED=1 - else - LOG_INFO "python3-webtest未安装,测试后需要卸载" - INSTALLED=0 - fi - - # 检查yum源中是否有python3-webtest - LOG_INFO "检查yum源中是否有python3-webtest" - dnf list available python3-webtest > /dev/null 2>&1 - CHECK_RESULT $? 0 0 "yum源中没有python3-webtest软件包" - if [ $? -ne 0 ]; then - LOG_ERROR "yum源中没有python3-webtest软件包" - exit 255 - fi - - # 如果未安装则安装python3-webtest - if [ $INSTALLED -eq 0 ]; then - LOG_INFO "安装python3-webtest" - dnf install -y python3-webtest > /dev/null 2>&1 - CHECK_RESULT $? 0 0 "安装python3-webtest失败" - fi - - # 测试HTTP headers in response功能 - LOG_INFO "测试HTTP headers in response功能" - python3 -c " - import webtest - import webob - - def test_app(environ, start_response): - headers = [ - ("Content-Type", "text/plain"), - ("X-Custom-Header", "TestValue"), - ("Server", "TestServer") - ] - start_response("200 OK", headers) - return [b"Hello World"] - - app = test_app - test_app = webtest.TestApp(app) - - resp = test_app.get("/") - print("Status:", resp.status) - print("Headers:", resp.headers) - print("Body:", resp.text) - - # 检查特定header是否存在 - if "X-Custom-Header" in resp.headers: - print("X-Custom-Header found:", resp.headers["X-Custom-Header"]) - else: - print("X-Custom-Header not found") - exit(1) - - # 检查header值 - if resp.headers["X-Custom-Header"] == "TestValue": - print("X-Custom-Header value is correct") - else: - print("X-Custom-Header value is incorrect") - exit(1) - " > /tmp/webtest_output.txt 2>&1 - - CHECK_RESULT $? 0 0 "测试HTTP headers功能失败" - LOG_INFO "HTTP headers测试输出:" - cat /tmp/webtest_output.txt - - # 清理临时文件 - rm -f /tmp/webtest_output.txt - - # 环境恢复 - LOG_INFO "恢复测试环境" - if [ $INSTALLED -eq 0 ]; then - LOG_INFO "卸载python3-webtest" - dnf remove -y python3-webtest > /dev/null 2>&1 - CHECK_RESULT $? 0 0 "卸载python3-webtest失败" - else - LOG_INFO "保持python3-webtest安装状态" - fi - - LOG_INFO "测试完成" -} - -main "$@" \ No newline at end of file diff --git a/testcases/function_test/pkg_test/python-webtest/python3-webtest/test_python3-webtest_function_json.sh b/testcases/function_test/pkg_test/python-webtest/python3-webtest/test_python3-webtest_function_json.sh deleted file mode 100644 index a880b0886cb..00000000000 --- a/testcases/function_test/pkg_test/python-webtest/python3-webtest/test_python3-webtest_function_json.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-02-19 -# @License : Mulan PSL v2 -# @Desc : Test handling JSON request/response -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - LOG_INFO "开始测试:Test handling JSON request/response" - - # 定义软件包名称 - PACKAGE_NAME="python3-webtest" - - # 检查软件包是否已在yum源中 - LOG_INFO "检查软件包是否在yum源中" - if ! dnf list available ${PACKAGE_NAME} &> /dev/null; then - LOG_ERROR "软件包 ${PACKAGE_NAME} 不在yum源中" - exit 255 - fi - - # 检查当前环境是否已安装该软件包 - LOG_INFO "检查当前环境是否已安装软件包" - if rpm -q ${PACKAGE_NAME} &> /dev/null; then - LOG_INFO "软件包已安装,测试结束后保持安装状态" - ALREADY_INSTALLED=true - else - LOG_INFO "软件包未安装,将在测试结束后卸载" - ALREADY_INSTALLED=false - fi - - # 如果未安装,则安装软件包 - if [ "${ALREADY_INSTALLED}" = "false" ]; then - LOG_INFO "安装软件包 ${PACKAGE_NAME}" - dnf install -y ${PACKAGE_NAME} - CHECK_RESULT $? 0 0 "安装软件包失败" - fi - - # 测试JSON请求/响应的处理 - LOG_INFO "测试JSON请求/响应的处理" - python3 -c " - import json - import sys - - # 模拟JSON请求 - request_data = {"key": "value", "number": 123} - json_request = json.dumps(request_data) - print("JSON请求:", json_request) - - # 模拟JSON响应 - response_data = {"status": "success", "data": request_data} - json_response = json.dumps(response_data) - print("JSON响应:", json_response) - - # 解析JSON响应 - parsed_response = json.loads(json_response) - if parsed_response["status"] == "success" and parsed_response["data"] == request_data: - print("JSON处理成功") - sys.exit(0) - else: - print("JSON处理失败") - sys.exit(1) - " - CHECK_RESULT $? 0 0 "JSON请求/响应处理测试失败" - - # 清理环境:如果测试前未安装,则卸载软件包 - if [ "${ALREADY_INSTALLED}" = "false" ]; then - LOG_INFO "卸载软件包 ${PACKAGE_NAME}" - dnf remove -y ${PACKAGE_NAME} - CHECK_RESULT $? 0 0 "卸载软件包失败" - fi - - LOG_INFO "测试完成:Test handling JSON request/response" -} - -main "$@" \ No newline at end of file diff --git a/testcases/function_test/pkg_test/python-webtest/python3-webtest/test_python3-webtest_function_post_form.sh b/testcases/function_test/pkg_test/python-webtest/python3-webtest/test_python3-webtest_function_post_form.sh deleted file mode 100644 index a82ee8c2875..00000000000 --- a/testcases/function_test/pkg_test/python-webtest/python3-webtest/test_python3-webtest_function_post_form.sh +++ /dev/null @@ -1,111 +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-19 -# @License : Mulan PSL v2 -# @Desc : Test HTTP POST with form data -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - # 检查是否已经安装了python3-webtest软件包 - LOG_INFO "检查python3-webtest软件包是否已安装" - rpm -q python3-webtest > /dev/null 2>&1 - if [ $? -eq 0 ]; then - LOG_INFO "python3-webtest软件包已安装,标记为已存在" - INSTALLED_FLAG=1 - else - LOG_INFO "python3-webtest软件包未安装,标记为未安装" - INSTALLED_FLAG=0 - fi - - # 检查yum源中是否有python3-webtest软件包 - LOG_INFO "检查yum源中是否有python3-webtest软件包" - dnf list available python3-webtest > /dev/null 2>&1 - if [ $? -ne 0 ]; then - LOG_ERROR "yum源中未找到python3-webtest软件包" - exit 255 - fi - LOG_INFO "yum源中存在python3-webtest软件包" - - # 如果未安装,则安装python3-webtest软件包 - if [ $INSTALLED_FLAG -eq 0 ]; then - LOG_INFO "开始安装python3-webtest软件包" - dnf install -y python3-webtest - CHECK_RESULT $? 0 0 "安装python3-webtest软件包失败" - LOG_INFO "python3-webtest软件包安装成功" - fi - - # 创建测试用的Python脚本 - LOG_INFO "创建测试用的Python脚本" - cat > /tmp/test_post_form.py << "EOF" - import sys - from webtest import TestApp - from webob import Request - import json - - def simple_app(environ, start_response): - request = Request(environ) - if request.method == "POST": - # 获取表单数据 - form_data = request.POST - response_body = json.dumps(dict(form_data)) - else: - response_body = "Not a POST request" - - status = "200 OK" - response_headers = [("Content-Type", "application/json")] - start_response(status, response_headers) - return [response_body.encode("utf-8")] - - if __name__ == "__main__": - app = TestApp(simple_app) - # 发送POST请求,附带表单数据 - resp = app.post("/test", {"key1": "value1", "key2": "value2"}) - print(resp.status) - print(resp.body.decode("utf-8")) - # 检查响应状态码是否为200 - if resp.status == "200 OK": - sys.exit(0) - else: - sys.exit(1) - EOF - - CHECK_RESULT $? 0 0 "创建测试用的Python脚本失败" - - # 执行测试脚本 - LOG_INFO "执行测试脚本,测试HTTP POST with form data功能" - python3 /tmp/test_post_form.py - CHECK_RESULT $? 0 0 "测试HTTP POST with form data功能失败" - - # 清理临时文件 - LOG_INFO "清理临时文件" - rm -f /tmp/test_post_form.py - CHECK_RESULT $? 0 0 "清理临时文件失败" - - # 如果之前未安装python3-webtest,则卸载它 - if [ $INSTALLED_FLAG -eq 0 ]; then - LOG_INFO "卸载python3-webtest软件包" - dnf remove -y python3-webtest - CHECK_RESULT $? 0 0 "卸载python3-webtest软件包失败" - LOG_INFO "python3-webtest软件包卸载成功" - else - LOG_INFO "保持python3-webtest软件包安装状态" - fi - - LOG_INFO "测试完成,环境已恢复" -} - -main "$@" \ No newline at end of file diff --git a/testcases/function_test/pkg_test/python-webtest/python3-webtest/test_python3-webtest_function_status.sh b/testcases/function_test/pkg_test/python-webtest/python3-webtest/test_python3-webtest_function_status.sh deleted file mode 100644 index 10bc3ebe4b5..00000000000 --- a/testcases/function_test/pkg_test/python-webtest/python3-webtest/test_python3-webtest_function_status.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-19 -# @License : Mulan PSL v2 -# @Desc : Test HTTP response status codes -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - set -e - - LOG_INFO "开始测试:Test HTTP response status codes" - - LOG_INFO "步骤1:检查python3-webtest软件包是否在yum源中" - if ! dnf list python3-webtest &>/dev/null; then - LOG_ERROR "python3-webtest软件包不在yum源中" - exit 255 - fi - - LOG_INFO "步骤2:检查当前环境是否已安装python3-webtest" - if rpm -q python3-webtest &>/dev/null; then - LOG_INFO "python3-webtest已安装,标记为需要保持安装状态" - keep_installed=true - else - LOG_INFO "python3-webtest未安装,标记为需要清理安装" - keep_installed=false - fi - - LOG_INFO "步骤3:安装python3-webtest软件包" - if [ "$keep_installed" = "false" ]; then - dnf install -y python3-webtest - CHECK_RESULT $? 0 0 "安装python3-webtest失败" - fi - - LOG_INFO "步骤4:检查webtest命令是否支持status参数" - if ! webtest --help | grep -q "status"; then - LOG_ERROR "webtest命令不支持status参数" - exit 255 - fi - - LOG_INFO "步骤5:测试HTTP响应状态码" - webtest status http://example.com - CHECK_RESULT $? 0 0 "测试HTTP响应状态码失败" - - LOG_INFO "步骤6:清理环境" - if [ "$keep_installed" = "false" ]; then - LOG_INFO "卸载python3-webtest软件包" - dnf remove -y python3-webtest - CHECK_RESULT $? 0 0 "卸载python3-webtest失败" - else - LOG_INFO "保持python3-webtest安装状态" - fi - - LOG_INFO "测试完成" -} - -main "$@" \ No newline at end of file From 9670a4550efaeacc6fa9ac848d0549065af19432 Mon Sep 17 00:00:00 2001 From: honghua Date: Thu, 23 Apr 2026 11:51:39 +0800 Subject: [PATCH 08/21] update testcase for testsuite python-memory-profiler-help --- .../python-memory-profiler-help.json | 10 --- ...on-memory-profiler-help_function_memory.sh | 72 ------------------- 2 files changed, 82 deletions(-) delete mode 100644 suite2cases/function_test/pkg_test/python-memory-profiler/python-memory-profiler-help.json delete mode 100644 testcases/function_test/pkg_test/python-memory-profiler/python-memory-profiler-help/test_python-memory-profiler-help_function_memory.sh diff --git a/suite2cases/function_test/pkg_test/python-memory-profiler/python-memory-profiler-help.json b/suite2cases/function_test/pkg_test/python-memory-profiler/python-memory-profiler-help.json deleted file mode 100644 index 8aad0de548a..00000000000 --- a/suite2cases/function_test/pkg_test/python-memory-profiler/python-memory-profiler-help.json +++ /dev/null @@ -1,10 +0,0 @@ -{ - "path": "$OET_PATH/testcases/function_test/pkg_test/python-memory-profiler/python-memory-profiler-help", - "machine num": 1, - "cases": [ - { - "name": "test_python-memory-profiler-help_function_memory", - "desc": "Test memory profiling functionality" - } - ] -} \ No newline at end of file diff --git a/testcases/function_test/pkg_test/python-memory-profiler/python-memory-profiler-help/test_python-memory-profiler-help_function_memory.sh b/testcases/function_test/pkg_test/python-memory-profiler/python-memory-profiler-help/test_python-memory-profiler-help_function_memory.sh deleted file mode 100644 index b2c28c04c29..00000000000 --- a/testcases/function_test/pkg_test/python-memory-profiler/python-memory-profiler-help/test_python-memory-profiler-help_function_memory.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-09 -# @License : Mulan PSL v2 -# @Desc : Test memory profiling functionality -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - # 检查是否已安装python3-memory-profiler - LOG_INFO "检查是否已安装python3-memory-profiler" - dnf list installed python3-memory-profiler > /dev/null 2>&1 - if [ $? -eq 0 ]; then - LOG_INFO "python3-memory-profiler已安装,脚本结束时将保持安装状态" - INSTALLED=1 - else - LOG_INFO "python3-memory-profiler未安装,将在测试结束后卸载" - INSTALLED=0 - fi - - # 检查yum源中是否存在python3-memory-profiler - LOG_INFO "检查yum源中是否存在python3-memory-profiler" - dnf list available python3-memory-profiler > /dev/null 2>&1 - if [ $? -ne 0 ]; then - LOG_ERROR "yum源中未找到python3-memory-profiler" - exit 255 - fi - - # 安装python3-memory-profiler(如果未安装) - if [ $INSTALLED -eq 0 ]; then - LOG_INFO "安装python3-memory-profiler" - dnf install -y python3-memory-profiler - CHECK_RESULT $? 0 0 "安装python3-memory-profiler失败" - fi - - # 测试memory profiling功能 - LOG_INFO "测试memory-profiling功能" - memory_profiler --help > /dev/null 2>&1 - if [ $? -ne 0 ]; then - LOG_ERROR "memory-profiling参数不支持或不存在" - exit 255 - fi - - # 检查命令执行是否成功 - LOG_INFO "执行memory-profiling命令测试" - python3 -m memory_profiler --version > /dev/null 2>&1 - CHECK_RESULT $? 0 0 "memory-profiling功能测试失败" - - # 清理环境(如果脚本开始时未安装) - if [ $INSTALLED -eq 0 ]; then - LOG_INFO "卸载python3-memory-profiler" - dnf remove -y python3-memory-profiler - CHECK_RESULT $? 0 0 "卸载python3-memory-profiler失败" - fi - - LOG_INFO "测试完成,环境已恢复" -} - -main "$@" \ No newline at end of file From c17b173322242c7d813b8d167b62d6e40ad8dded Mon Sep 17 00:00:00 2001 From: honghua Date: Thu, 23 Apr 2026 11:53:40 +0800 Subject: [PATCH 09/21] update testcase for testsuite resteasy-jackson-provider --- .../resteasy/resteasy-jackson-provider.json | 12 -- ...asy-jackson-provider_function_http_json.sh | 189 ------------------ 2 files changed, 201 deletions(-) delete mode 100644 testcases/function_test/pkg_test/resteasy/resteasy-jackson-provider/test_resteasy-jackson-provider_function_http_json.sh diff --git a/suite2cases/function_test/pkg_test/resteasy/resteasy-jackson-provider.json b/suite2cases/function_test/pkg_test/resteasy/resteasy-jackson-provider.json index 6086f302f24..0e773d12d75 100644 --- a/suite2cases/function_test/pkg_test/resteasy/resteasy-jackson-provider.json +++ b/suite2cases/function_test/pkg_test/resteasy/resteasy-jackson-provider.json @@ -14,18 +14,6 @@ { "name": "test_resteasy-jackson-provider_function_uninstall", "desc": "验证软件包是否能够被完全且干净地卸载。" - }, - { - "name": "test_resteasy-jackson-provider_function_json_serialize", - "desc": "验证软件包能够正确地将Java对象序列化为JSON字符串。" - }, - { - "name": "test_resteasy-jackson-provider_function_json_deserialize", - "desc": "验证软件包能够正确地将JSON字符串反序列化为Java对象。" - }, - { - "name": "test_resteasy-jackson-provider_function_http_json", - "desc": "验证在RESTEasy框架下,软件包能够正确处理HTTP请求和响应中的JSON数据。" } ] } \ No newline at end of file diff --git a/testcases/function_test/pkg_test/resteasy/resteasy-jackson-provider/test_resteasy-jackson-provider_function_http_json.sh b/testcases/function_test/pkg_test/resteasy/resteasy-jackson-provider/test_resteasy-jackson-provider_function_http_json.sh deleted file mode 100644 index f5ce14421a9..00000000000 --- a/testcases/function_test/pkg_test/resteasy/resteasy-jackson-provider/test_resteasy-jackson-provider_function_http_json.sh +++ /dev/null @@ -1,189 +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 : 验证在RESTEasy框架下,软件包能够正确处理HTTP请求和响应中的JSON数据。 -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - # 测试环境初始化 - LOG_INFO "开始测试:验证在RESTEasy框架下,软件包能够正确处理HTTP请求和响应中的JSON数据" - - # 定义软件包名称 - PACKAGE_NAME="resteasy-jackson-provider" - - # 检查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}" - INSTALLED_FLAG=0 - if rpm -q ${PACKAGE_NAME} &>/dev/null; then - LOG_INFO "软件包 ${PACKAGE_NAME} 已安装" - INSTALLED_FLAG=1 - else - LOG_INFO "软件包 ${PACKAGE_NAME} 未安装" - fi - - # 如果未安装,则安装软件包 - if [ ${INSTALLED_FLAG} -eq 0 ]; then - LOG_INFO "步骤3:安装软件包 ${PACKAGE_NAME}" - dnf install -y ${PACKAGE_NAME} - CHECK_RESULT $? 0 0 "安装软件包 ${PACKAGE_NAME} 失败" - fi - - # 验证RESTEasy Jackson Provider功能 - LOG_INFO "步骤4:验证RESTEasy Jackson Provider功能" - - # 创建测试Java应用 - LOG_INFO "步骤4.1:创建测试Java应用" - cat > TestJsonApp.java << "EOF" - import javax.ws.rs.*; - import javax.ws.rs.core.Application; - import javax.ws.rs.core.MediaType; - import javax.ws.rs.core.Response; - import java.util.HashSet; - import java.util.Set; - - @Path("/test") - class TestResource { - @GET - @Path("/json") - @Produces(MediaType.APPLICATION_JSON) - public TestData getJson() { - TestData data = new TestData(); - data.setId(1); - data.setName("测试数据"); - data.setValue(100.5); - return data; - } - - @POST - @Path("/json") - @Consumes(MediaType.APPLICATION_JSON) - @Produces(MediaType.APPLICATION_JSON) - public TestData postJson(TestData data) { - data.setId(data.getId() + 100); - data.setName("处理后的" + data.getName()); - data.setValue(data.getValue() * 2); - return data; - } - } - - class TestData { - private int id; - private String name; - private double value; - - public int getId() { return id; } - public void setId(int id) { this.id = id; } - - public String getName() { return name; } - public void setName(String name) { this.name = name; } - - public double getValue() { return value; } - public void setValue(double value) { this.value = value; } - } - - class TestApplication extends Application { - @Override - public Set> getClasses() { - Set> classes = new HashSet<>(); - classes.add(TestResource.class); - return classes; - } - } - EOF - - # 编译测试应用 - LOG_INFO "步骤4.2:编译测试Java应用" - javac -cp "/usr/share/java/*" TestJsonApp.java - CHECK_RESULT $? 0 0 "编译Java应用失败" - - # 启动测试服务器(模拟) - LOG_INFO "步骤4.3:启动测试服务器" - # 这里使用简单的curl测试来验证JSON处理功能 - # 实际环境中可能需要启动真正的RESTEasy服务器 - - # 测试JSON序列化 - LOG_INFO "步骤4.4:测试JSON序列化功能" - cat > test_input.json << "EOF" - { - "id": 10, - "name": "输入数据", - "value": 50.25 - } - EOF - - # 验证软件包提供的类是否存在 - LOG_INFO "步骤4.5:验证RESTEasy Jackson Provider类" - find /usr/share/java -name "*jackson*" -type f | grep -i resteasy - CHECK_RESULT $? 0 0 "未找到RESTEasy Jackson Provider相关类" - - # 检查关键JAR文件 - LOG_INFO "步骤4.6:检查关键JAR文件" - if [ -f "/usr/share/java/resteasy-jackson-provider.jar" ] || \ - find /usr/share/java -name "*resteasy*jackson*.jar" | grep -q .; then - LOG_INFO "找到RESTEasy Jackson Provider JAR文件" - else - LOG_ERROR "未找到RESTEasy Jackson Provider JAR文件" - CHECK_RESULT 1 0 0 "JAR文件检查失败" - fi - - # 验证JSON处理库 - LOG_INFO "步骤4.7:验证JSON处理库" - java -cp "/usr/share/java/*:." TestData 2>/dev/null || true - # 这里主要是验证类路径设置正确 - - # 清理测试文件 - LOG_INFO "步骤5:清理测试文件" - rm -f TestJsonApp.java test_input.json *.class - - # 环境恢复 - LOG_INFO "步骤6:环境恢复" - if [ ${INSTALLED_FLAG} -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 "步骤7:最终环境验证" - if [ ${INSTALLED_FLAG} -eq 1 ]; then - rpm -q ${PACKAGE_NAME} &>/dev/null - CHECK_RESULT $? 0 0 "环境未恢复到初始安装状态" - else - rpm -q ${PACKAGE_NAME} &>/dev/null - if [ $? -eq 0 ]; then - LOG_ERROR "环境清理不彻底,软件包 ${PACKAGE_NAME} 仍存在" - CHECK_RESULT 1 0 0 "环境清理失败" - else - LOG_INFO "环境已完全清理" - fi - fi - - LOG_INFO "测试完成:RESTEasy Jackson Provider功能验证结束" -} - -main "$@" \ No newline at end of file From 682156bb7857447385762d9906bb3b8315dcc8ea Mon Sep 17 00:00:00 2001 From: honghua Date: Thu, 23 Apr 2026 11:55:19 +0800 Subject: [PATCH 10/21] update testcase for testsuite gupnp-devel --- .../pkg_test/gupnp/gupnp-devel.json | 10 --- .../test_gupnp-devel_function_init.sh | 67 ------------------- 2 files changed, 77 deletions(-) delete mode 100644 suite2cases/function_test/pkg_test/gupnp/gupnp-devel.json delete mode 100644 testcases/function_test/pkg_test/gupnp/gupnp-devel/test_gupnp-devel_function_init.sh diff --git a/suite2cases/function_test/pkg_test/gupnp/gupnp-devel.json b/suite2cases/function_test/pkg_test/gupnp/gupnp-devel.json deleted file mode 100644 index 88b1b6bb2a9..00000000000 --- a/suite2cases/function_test/pkg_test/gupnp/gupnp-devel.json +++ /dev/null @@ -1,10 +0,0 @@ -{ - "path": "$OET_PATH/testcases/function_test/pkg_test/gupnp/gupnp-devel", - "machine num": 1, - "cases": [ - { - "name": "test_gupnp-devel_function_init", - "desc": "Test initialization of gupnp-devel" - } - ] -} \ No newline at end of file diff --git a/testcases/function_test/pkg_test/gupnp/gupnp-devel/test_gupnp-devel_function_init.sh b/testcases/function_test/pkg_test/gupnp/gupnp-devel/test_gupnp-devel_function_init.sh deleted file mode 100644 index cc416bb16e4..00000000000 --- a/testcases/function_test/pkg_test/gupnp/gupnp-devel/test_gupnp-devel_function_init.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-27 -# @License : Mulan PSL v2 -# @Desc : Test initialization of gupnp-devel -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - # 测试脚本:test_gupnp-devel_function_init - - LOG_INFO "开始测试:Test initialization of gupnp-devel" - - # 检查是否已安装gupnp-devel - LOG_INFO "检查gupnp-devel是否已安装" - if dnf list installed gupnp-devel &>/dev/null; then - LOG_INFO "gupnp-devel已安装,跳过安装步骤" - installed=true - else - LOG_INFO "gupnp-devel未安装,准备安装" - installed=false - fi - - # 检查yum源中是否有gupnp-devel - LOG_INFO "检查yum源中是否有gupnp-devel" - if ! dnf list available gupnp-devel &>/dev/null; then - LOG_ERROR "yum源中未找到gupnp-devel软件包" - exit 255 - fi - - # 如果未安装,则安装gupnp-devel - if [ "$installed" = false ]; then - LOG_INFO "正在安装gupnp-devel" - dnf install -y gupnp-devel - CHECK_RESULT $? 0 0 "安装gupnp-devel失败" - fi - - # 测试初始化功能 - LOG_INFO "测试初始化功能" - command_to_test="gssdp-debug-ctl --version" # 假设这是初始化命令 - $command_to_test - CHECK_RESULT $? 0 0 "初始化功能测试失败" - - # 清理环境:如果脚本开始时未安装,则卸载gupnp-devel - if [ "$installed" = false ]; then - LOG_INFO "清理环境:卸载gupnp-devel" - dnf remove -y gupnp-devel - CHECK_RESULT $? 0 0 "卸载gupnp-devel失败" - fi - - LOG_INFO "测试完成:Test initialization of gupnp-devel" -} - -main "$@" \ No newline at end of file From accef46f3373b05b68d072234e26f763ec6420aa Mon Sep 17 00:00:00 2001 From: honghua Date: Thu, 23 Apr 2026 11:56:05 +0800 Subject: [PATCH 11/21] update testcase for testsuite texlive-basque-date --- .../texlive-split-b/texlive-basque-date.json | 8 -- ...exlive-basque-date_function_basque_date.sh | 83 ------------------- ...t_texlive-basque-date_function_document.sh | 83 ------------------- 3 files changed, 174 deletions(-) delete mode 100644 testcases/function_test/pkg_test/texlive-split-b/texlive-basque-date/test_texlive-basque-date_function_basque_date.sh delete mode 100644 testcases/function_test/pkg_test/texlive-split-b/texlive-basque-date/test_texlive-basque-date_function_document.sh diff --git a/suite2cases/function_test/pkg_test/texlive-split-b/texlive-basque-date.json b/suite2cases/function_test/pkg_test/texlive-split-b/texlive-basque-date.json index 79918704ad8..5ae90708dd3 100644 --- a/suite2cases/function_test/pkg_test/texlive-split-b/texlive-basque-date.json +++ b/suite2cases/function_test/pkg_test/texlive-split-b/texlive-basque-date.json @@ -13,14 +13,6 @@ { "name": "test_texlive-basque-date_function_check", "desc": "Test if package is installed and version" - }, - { - "name": "test_texlive-basque-date_function_basque_date", - "desc": "Test the basic date formatting command" - }, - { - "name": "test_texlive-basque-date_function_document", - "desc": "Test usage in a simple LaTeX document" } ] } \ No newline at end of file diff --git a/testcases/function_test/pkg_test/texlive-split-b/texlive-basque-date/test_texlive-basque-date_function_basque_date.sh b/testcases/function_test/pkg_test/texlive-split-b/texlive-basque-date/test_texlive-basque-date_function_basque_date.sh deleted file mode 100644 index 7f79f95cf7c..00000000000 --- a/testcases/function_test/pkg_test/texlive-split-b/texlive-basque-date/test_texlive-basque-date_function_basque_date.sh +++ /dev/null @@ -1,83 +0,0 @@ -#!/usr/bin/bash - -# Copyright (c) 2024 ISCAS .ALL rights reserved. -# This program is licensed under Mulan PSL v2. -# You can use it according to the terms and conditions of the Mulan PSL v2. -# http://license.coscl.org.cn/MulanPSL2 -# THIS PROGRAM IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, -# EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, -# MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. -# See the Mulan PSL v2 for more details. - -# ############################################# -# @Author : honghua -# @Contact : honghua@iscas.ac.cn -# @Date : 2026-03-06 -# @License : Mulan PSL v2 -# @Desc : Test the basic date formatting command -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - LOG_INFO "开始测试: Test the basic date formatting command" - - # 检查环境是否已安装texlive-basque包 - LOG_INFO "检查texlive-basque是否已安装" - if dnf list installed texlive-basque &>/dev/null; then - LOG_INFO "texlive-basque已安装,测试后将保持安装状态" - INSTALLED=1 - else - LOG_INFO "texlive-basque未安装,将在测试中安装" - INSTALLED=0 - fi - - # 检查yum源中是否有texlive-basque包 - LOG_INFO "检查yum源中是否有texlive-basque包" - if ! dnf list available texlive-basque &>/dev/null; then - LOG_ERROR "yum源中未找到texlive-basque包" - exit 255 - fi - - # 如果未安装,则安装texlive-basque - if [ $INSTALLED -eq 0 ]; then - LOG_INFO "安装texlive-basque" - dnf install -y texlive-basque - CHECK_RESULT $? 0 0 "安装texlive-basque失败" - fi - - # 测试basque_date命令是否存在 - LOG_INFO "检查basque_date命令是否存在" - if ! command -v basque_date &>/dev/null; then - LOG_ERROR "basque_date命令不存在" - exit 255 - fi - - # 测试basque_date命令的基本功能 - LOG_INFO "测试basque_date命令基本日期格式化" - basque_date "+%Y-%m-%d" - CHECK_RESULT $? 0 0 "basque_date命令执行失败" - - # 测试basque_date命令的特定参数 - LOG_INFO "测试basque_date命令的特定参数" - basque_date "+%A, %d %B %Y" - CHECK_RESULT $? 0 0 "basque_date命令特定参数执行失败" - - # 测试basque_date命令不支持的参数 - LOG_INFO "测试basque_date命令不支持的参数" - if basque_date "+%Z" &>/dev/null; then - LOG_ERROR "basque_date命令不支持%Z参数但未报错" - exit 255 - fi - - # 清理环境:如果测试前未安装,则卸载texlive-basque - if [ $INSTALLED -eq 0 ]; then - LOG_INFO "卸载texlive-basque" - dnf remove -y texlive-basque - CHECK_RESULT $? 0 0 "卸载texlive-basque失败" - fi - - LOG_INFO "测试完成" -} - -main "$@" \ No newline at end of file diff --git a/testcases/function_test/pkg_test/texlive-split-b/texlive-basque-date/test_texlive-basque-date_function_document.sh b/testcases/function_test/pkg_test/texlive-split-b/texlive-basque-date/test_texlive-basque-date_function_document.sh deleted file mode 100644 index 22d6d147b19..00000000000 --- a/testcases/function_test/pkg_test/texlive-split-b/texlive-basque-date/test_texlive-basque-date_function_document.sh +++ /dev/null @@ -1,83 +0,0 @@ -#!/usr/bin/bash - -# Copyright (c) 2024 ISCAS .ALL rights reserved. -# This program is licensed under Mulan PSL v2. -# You can use it according to the terms and conditions of the Mulan PSL v2. -# http://license.coscl.org.cn/MulanPSL2 -# THIS PROGRAM IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, -# EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, -# MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. -# See the Mulan PSL v2 for more details. - -# ############################################# -# @Author : honghua -# @Contact : honghua@iscas.ac.cn -# @Date : 2026-03-06 -# @License : Mulan PSL v2 -# @Desc : Test usage in a simple LaTeX document -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - LOG_INFO "测试用例:Test usage in a simple LaTeX document" - LOG_INFO "步骤1:检查测试环境是否已安装texlive-basque-date软件包" - rpm -q texlive-basque-date - if [ $? -eq 0 ]; then - LOG_INFO "texlive-basque-date已安装,测试后保持安装状态" - INSTALLED="true" - else - LOG_INFO "texlive-basque-date未安装,将在测试过程中安装" - INSTALLED="false" - fi - - LOG_INFO "步骤2:检查yum源中是否存在texlive-basque-date软件包" - dnf list available texlive-basque-date &>/dev/null - CHECK_RESULT $? 0 0 "yum源中未找到texlive-basque-date软件包" - if [ $? -ne 0 ]; then - LOG_ERROR "yum源中未找到texlive-basque-date软件包" - exit 255 - fi - - if [ "$INSTALLED" == "false" ]; then - LOG_INFO "步骤3:安装texlive-basque-date软件包" - dnf install -y texlive-basque-date - CHECK_RESULT $? 0 0 "安装texlive-basque-date失败" - fi - - LOG_INFO "步骤4:创建一个简单的LaTeX测试文档" - cat > test_basque_date.tex << "EOF" - \documentclass{article} - \usepackage{basque-date} - \begin{document} - Today"s date: \today - \end{document} - EOF - CHECK_RESULT $? 0 0 "创建LaTeX测试文档失败" - - LOG_INFO "步骤5:使用pdflatex编译LaTeX文档" - pdflatex -interaction=nonstopmode test_basque_date.tex &>/dev/null - CHECK_RESULT $? 0 0 "pdflatex编译失败,可能缺少相关命令或包" - - LOG_INFO "步骤6:检查是否成功生成PDF文件" - if [ -f "test_basque_date.pdf" ]; then - LOG_INFO "成功生成PDF文件:test_basque_date.pdf" - else - LOG_ERROR "未找到生成的PDF文件" - exit 1 - fi - - LOG_INFO "步骤7:清理测试生成的临时文件" - rm -f test_basque_date.tex test_basque_date.pdf test_basque_date.log test_basque_date.aux test_basque_date.out - CHECK_RESULT $? 0 0 "清理临时文件失败" - - if [ "$INSTALLED" == "false" ]; then - LOG_INFO "步骤8:卸载测试安装的texlive-basque-date软件包" - dnf remove -y texlive-basque-date - CHECK_RESULT $? 0 0 "卸载texlive-basque-date失败" - fi - - LOG_INFO "测试完成" -} - -main "$@" \ No newline at end of file From 1f4ff74be6a08764a8637cfa3515298d2f3e709a Mon Sep 17 00:00:00 2001 From: honghua Date: Thu, 23 Apr 2026 11:56:15 +0800 Subject: [PATCH 12/21] update testcase for testsuite apache-commons-javaflow-javadoc --- .../apache-commons-javaflow-javadoc.json | 8 -------- 1 file changed, 8 deletions(-) diff --git a/suite2cases/function_test/pkg_test/apache-commons-javaflow/apache-commons-javaflow-javadoc.json b/suite2cases/function_test/pkg_test/apache-commons-javaflow/apache-commons-javaflow-javadoc.json index f4a2f9754c7..cc975b07fd0 100644 --- a/suite2cases/function_test/pkg_test/apache-commons-javaflow/apache-commons-javaflow-javadoc.json +++ b/suite2cases/function_test/pkg_test/apache-commons-javaflow/apache-commons-javaflow-javadoc.json @@ -6,14 +6,6 @@ "name": "test_apache-commons-javaflow-javadoc_install", "desc": "测试软件包的安装功能,验证是否能够正确安装到系统中。", "machine num": 1 - }, - { - "name": "test_apache-commons-javaflow-javadoc_function_docgen", - "desc": "测试软件包的文档生成功能,验证是否能正确生成Javadoc文档。" - }, - { - "name": "test_apache-commons-javaflow-javadoc_function_usage", - "desc": "测试软件包的基本使用功能,验证是否能正确调用核心API。" } ] } \ No newline at end of file From b439a02fa84c9d5f25e2e2a648a4e2cc936c312d Mon Sep 17 00:00:00 2001 From: honghua Date: Thu, 23 Apr 2026 11:58:01 +0800 Subject: [PATCH 13/21] update testcase for testsuite python3-pyroute2 --- .../python-pyroute2/python3-pyroute2.json | 88 ------------- .../test_python3-pyroute2_function_addr.sh | 64 --------- .../test_python3-pyroute2_function_link.sh | 81 ------------ .../test_python3-pyroute2_function_netns.sh | 124 ------------------ .../test_python3-pyroute2_function_route.sh | 85 ------------ .../test_python3-pyroute2_pyroute2-cli_a.sh | 67 ---------- .../test_python3-pyroute2_pyroute2-cli_c.sh | 66 ---------- .../test_python3-pyroute2_pyroute2-cli_h.sh | 57 -------- .../test_python3-pyroute2_pyroute2-cli_l.sh | 69 ---------- .../test_python3-pyroute2_pyroute2-cli_m.sh | 67 ---------- .../test_python3-pyroute2_pyroute2-cli_p.sh | 59 --------- .../test_python3-pyroute2_pyroute2-cli_r.sh | 65 --------- .../test_python3-pyroute2_pyroute2-cli_s.sh | 67 ---------- .../test_python3-pyroute2_pyroute2-cli_x.sh | 68 ---------- ...n3-pyroute2_pyroute2-dhcp-client_ifname.sh | 69 ---------- .../test_python3-pyroute2_ss2__a.sh | 63 --------- .../test_python3-pyroute2_ss2__h.sh | 61 --------- .../test_python3-pyroute2_ss2__r.sh | 66 ---------- .../test_python3-pyroute2_ss2__t.sh | 67 ---------- .../test_python3-pyroute2_ss2__x.sh | 60 --------- 20 files changed, 1413 deletions(-) delete mode 100644 testcases/function_test/pkg_test/python-pyroute2/python3-pyroute2/test_python3-pyroute2_function_addr.sh delete mode 100644 testcases/function_test/pkg_test/python-pyroute2/python3-pyroute2/test_python3-pyroute2_function_link.sh delete mode 100644 testcases/function_test/pkg_test/python-pyroute2/python3-pyroute2/test_python3-pyroute2_function_netns.sh delete mode 100644 testcases/function_test/pkg_test/python-pyroute2/python3-pyroute2/test_python3-pyroute2_function_route.sh delete mode 100644 testcases/function_test/pkg_test/python-pyroute2/python3-pyroute2/test_python3-pyroute2_pyroute2-cli_a.sh delete mode 100644 testcases/function_test/pkg_test/python-pyroute2/python3-pyroute2/test_python3-pyroute2_pyroute2-cli_c.sh delete mode 100644 testcases/function_test/pkg_test/python-pyroute2/python3-pyroute2/test_python3-pyroute2_pyroute2-cli_h.sh delete mode 100644 testcases/function_test/pkg_test/python-pyroute2/python3-pyroute2/test_python3-pyroute2_pyroute2-cli_l.sh delete mode 100644 testcases/function_test/pkg_test/python-pyroute2/python3-pyroute2/test_python3-pyroute2_pyroute2-cli_m.sh delete mode 100644 testcases/function_test/pkg_test/python-pyroute2/python3-pyroute2/test_python3-pyroute2_pyroute2-cli_p.sh delete mode 100644 testcases/function_test/pkg_test/python-pyroute2/python3-pyroute2/test_python3-pyroute2_pyroute2-cli_r.sh delete mode 100644 testcases/function_test/pkg_test/python-pyroute2/python3-pyroute2/test_python3-pyroute2_pyroute2-cli_s.sh delete mode 100644 testcases/function_test/pkg_test/python-pyroute2/python3-pyroute2/test_python3-pyroute2_pyroute2-cli_x.sh delete mode 100644 testcases/function_test/pkg_test/python-pyroute2/python3-pyroute2/test_python3-pyroute2_pyroute2-dhcp-client_ifname.sh delete mode 100644 testcases/function_test/pkg_test/python-pyroute2/python3-pyroute2/test_python3-pyroute2_ss2__a.sh delete mode 100644 testcases/function_test/pkg_test/python-pyroute2/python3-pyroute2/test_python3-pyroute2_ss2__h.sh delete mode 100644 testcases/function_test/pkg_test/python-pyroute2/python3-pyroute2/test_python3-pyroute2_ss2__r.sh delete mode 100644 testcases/function_test/pkg_test/python-pyroute2/python3-pyroute2/test_python3-pyroute2_ss2__t.sh delete mode 100644 testcases/function_test/pkg_test/python-pyroute2/python3-pyroute2/test_python3-pyroute2_ss2__x.sh diff --git a/suite2cases/function_test/pkg_test/python-pyroute2/python3-pyroute2.json b/suite2cases/function_test/pkg_test/python-pyroute2/python3-pyroute2.json index 2879d100f2d..092f8764bb5 100644 --- a/suite2cases/function_test/pkg_test/python-pyroute2/python3-pyroute2.json +++ b/suite2cases/function_test/pkg_test/python-pyroute2/python3-pyroute2.json @@ -2,106 +2,18 @@ "path": "$OET_PATH/testcases/function_test/pkg_test/python-pyroute2/python3-pyroute2", "machine num": 1, "cases": [ - { - "name": "test_python3-pyroute2_pyroute2-cli_h", - "desc": "测试帮助文档显示" - }, - { - "name": "test_python3-pyroute2_pyroute2-cli_a", - "desc": "测试指定IP地址监听" - }, - { - "name": "test_python3-pyroute2_pyroute2-cli_c", - "desc": "测试命令行运行" - }, - { - "name": "test_python3-pyroute2_pyroute2-cli_l", - "desc": "测试日志规范设置" - }, - { - "name": "test_python3-pyroute2_pyroute2-cli_m", - "desc": "测试设置模式" - }, - { - "name": "test_python3-pyroute2_pyroute2-cli_p", - "desc": "测试指定监听端口" - }, - { - "name": "test_python3-pyroute2_pyroute2-cli_r", - "desc": "测试加载rc文件" - }, - { - "name": "test_python3-pyroute2_pyroute2-cli_s", - "desc": "测试从json文件加载源" - }, - { - "name": "test_python3-pyroute2_pyroute2-cli_x", - "desc": "测试严格认证设置" - }, - { - "name": "test_python3-pyroute2_pyroute2-dhcp-client_ifname", - "desc": "测试使用有效的接口名称运行 pyroute2-dhcp-client 命令" - }, - { - "name": "test_python3-pyroute2_pyroute2-test-platform_create_bond", - "desc": "测试创建bond接口的功能" - }, - { - "name": "test_python3-pyroute2_pyroute2-test-platform_create_bridge", - "desc": "测试创建bridge接口的功能" - }, - { - "name": "test_python3-pyroute2_pyroute2-test-platform_create_dummy", - "desc": "测试创建dummy接口的功能" - }, - { - "name": "test_python3-pyroute2_ss2__h", - "desc": "测试 ss2 命令的帮助文档显示功能" - }, - { - "name": "test_python3-pyroute2_ss2__x", - "desc": "测试 ss2 命令显示 Unix 域套接字功能" - }, - { - "name": "test_python3-pyroute2_ss2__t", - "desc": "测试 ss2 命令显示 TCP 套接字功能" - }, { "name": "test_python3-pyroute2_ss2__l", "desc": "测试 ss2 命令显示监听套接字功能" }, - { - "name": "test_python3-pyroute2_ss2__a", - "desc": "测试 ss2 命令显示所有套接字功能" - }, { "name": "test_python3-pyroute2_ss2__p", "desc": "测试 ss2 命令显示套接字持有进程上下文功能" }, - { - "name": "test_python3-pyroute2_ss2__r", - "desc": "测试 ss2 命令解析主机名功能" - }, { "name": "test_python3-pyroute2_function_iproute", "desc": "测试IP路由功能" }, - { - "name": "test_python3-pyroute2_function_netns", - "desc": "测试网络命名空间功能" - }, - { - "name": "test_python3-pyroute2_function_link", - "desc": "测试网络链接管理功能" - }, - { - "name": "test_python3-pyroute2_function_addr", - "desc": "测试IP地址管理功能" - }, - { - "name": "test_python3-pyroute2_function_route", - "desc": "测试路由表管理功能" - }, { "name": "test_python3-pyroute2_function_neigh", "desc": "测试邻居表管理功能" diff --git a/testcases/function_test/pkg_test/python-pyroute2/python3-pyroute2/test_python3-pyroute2_function_addr.sh b/testcases/function_test/pkg_test/python-pyroute2/python3-pyroute2/test_python3-pyroute2_function_addr.sh deleted file mode 100644 index b755bbe09b5..00000000000 --- a/testcases/function_test/pkg_test/python-pyroute2/python3-pyroute2/test_python3-pyroute2_function_addr.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-10 -# @License : Mulan PSL v2 -# @Desc : 测试IP地址管理功能 -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - LOG_INFO "开始测试IP地址管理功能" - - # 检查是否已安装python3-pyroute2 - LOG_INFO "检查是否已安装python3-pyroute2" - if dnf list installed python3-pyroute2 &>/dev/null; then - LOG_INFO "python3-pyroute2已安装,脚本结束后保持安装状态" - installed=true - else - LOG_INFO "python3-pyroute2未安装,将在测试后卸载" - installed=false - fi - - # 检查yum源中是否有python3-pyroute2 - LOG_INFO "检查yum源中是否有python3-pyroute2" - if ! dnf list available python3-pyroute2 &>/dev/null; then - LOG_ERROR "yum源中未找到python3-pyroute2" - exit 255 - fi - - # 安装python3-pyroute2 - if [ "$installed" = false ]; then - LOG_INFO "安装python3-pyroute2" - dnf install -y python3-pyroute2 - CHECK_RESULT $? 0 0 "安装python3-pyroute2失败" - fi - - # 测试IP地址管理功能 - LOG_INFO "测试IP地址管理功能" - ip addr show &>/dev/null - CHECK_RESULT $? 0 0 "IP地址管理功能测试失败" - - # 清理环境 - if [ "$installed" = false ]; then - LOG_INFO "卸载python3-pyroute2" - dnf remove -y python3-pyroute2 - CHECK_RESULT $? 0 0 "卸载python3-pyroute2失败" - fi - - LOG_INFO "测试完成,环境已恢复" -} - -main "$@" \ No newline at end of file diff --git a/testcases/function_test/pkg_test/python-pyroute2/python3-pyroute2/test_python3-pyroute2_function_link.sh b/testcases/function_test/pkg_test/python-pyroute2/python3-pyroute2/test_python3-pyroute2_function_link.sh deleted file mode 100644 index f0e4b622921..00000000000 --- a/testcases/function_test/pkg_test/python-pyroute2/python3-pyroute2/test_python3-pyroute2_function_link.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-10 -# @License : Mulan PSL v2 -# @Desc : 测试网络链接管理功能 -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - - # 检查是否已安装python3-pyroute2 - LOG_INFO "检查是否已安装python3-pyroute2" - if dnf list installed python3-pyroute2 &>/dev/null; then - LOG_INFO "python3-pyroute2已安装,脚本结束后保持安装状态" - installed=true - else - LOG_INFO "python3-pyroute2未安装,将在脚本结束后卸载" - installed=false - fi - - # 检查yum源中是否有python3-pyroute2 - LOG_INFO "检查yum源中是否有python3-pyroute2" - if ! dnf list available python3-pyroute2 &>/dev/null; then - LOG_ERROR "yum源中未找到python3-pyroute2" - exit 255 - fi - - # 安装python3-pyroute2 - if [ "$installed" = false ]; then - LOG_INFO "安装python3-pyroute2" - dnf install -y python3-pyroute2 - CHECK_RESULT $? 0 0 "安装python3-pyroute2失败" - fi - - # 测试网络链接管理功能 - LOG_INFO "测试网络链接管理功能" - # 示例命令:检查iproute2工具是否支持link命令 - if ! ip link help &>/dev/null; then - LOG_ERROR "ip命令不支持link参数" - exit 255 - fi - - # 示例测试:创建一个虚拟网络接口 - LOG_INFO "创建一个虚拟网络接口测试" - ip link add test0 type dummy - CHECK_RESULT $? 0 0 "创建虚拟网络接口失败" - - # 检查接口是否创建成功 - ip link show test0 &>/dev/null - CHECK_RESULT $? 0 0 "虚拟网络接口未创建成功" - - # 删除虚拟网络接口 - LOG_INFO "删除虚拟网络接口" - ip link del test0 - CHECK_RESULT $? 0 0 "删除虚拟网络接口失败" - - # 清理环境 - if [ "$installed" = false ]; then - LOG_INFO "卸载python3-pyroute2" - dnf remove -y python3-pyroute2 - CHECK_RESULT $? 0 0 "卸载python3-pyroute2失败" - fi - - LOG_INFO "测试脚本执行完毕" - -} - -main "$@" \ No newline at end of file diff --git a/testcases/function_test/pkg_test/python-pyroute2/python3-pyroute2/test_python3-pyroute2_function_netns.sh b/testcases/function_test/pkg_test/python-pyroute2/python3-pyroute2/test_python3-pyroute2_function_netns.sh deleted file mode 100644 index a23ea334e50..00000000000 --- a/testcases/function_test/pkg_test/python-pyroute2/python3-pyroute2/test_python3-pyroute2_function_netns.sh +++ /dev/null @@ -1,124 +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 : 测试网络命名空间功能 -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - - # 检查yum源中是否存在指定软件包 - check_package_in_repo() { - local package_name=$1 - if ! dnf list available "$package_name" &>/dev/null; then - LOG_ERROR "软件包 $package_name 不在yum源中" - exit 255 - fi - } - - # 检查命令参数是否有效 - check_command_parameter() { - local command=$1 - local parameter=$2 - if ! $command --help | grep -q "$parameter"; then - LOG_ERROR "命令 $command 不支持参数 $parameter" - exit 255 - fi - } - - # 安装软件包 - install_package() { - local package_name=$1 - LOG_INFO "正在安装软件包 $package_name" - dnf install -y "$package_name" - CHECK_RESULT $? 0 0 "安装软件包 $package_name 失败" - } - - # 卸载软件包 - uninstall_package() { - local package_name=$1 - LOG_INFO "正在卸载软件包 $package_name" - dnf remove -y "$package_name" - CHECK_RESULT $? 0 0 "卸载软件包 $package_name 失败" - } - - # 检查环境是否已安装软件包 - check_installed() { - local package_name=$1 - if rpm -q "$package_name" &>/dev/null; then - LOG_INFO "软件包 $package_name 已安装" - return 0 - else - LOG_INFO "软件包 $package_name 未安装" - return 1 - fi - } - - # 测试网络命名空间功能的主函数 - test_python3_pyroute2_function_netns() { - local package_name="python3-pyroute2" - - # 步骤1:检查yum源中是否存在python3-pyroute2软件包 - LOG_INFO "步骤1:检查yum源中是否存在 $package_name" - check_package_in_repo "$package_name" - - # 步骤2:检查环境是否已安装python3-pyroute2 - LOG_INFO "步骤2:检查环境是否已安装 $package_name" - local installed=false - if check_installed "$package_name"; then - installed=true - fi - - # 如果未安装,则执行安装步骤 - if ! $installed; then - LOG_INFO "步骤3:安装 $package_name" - install_package "$package_name" - fi - - # 步骤4:测试网络命名空间功能(示例命令) - LOG_INFO "步骤4:测试网络命名空间功能" - - # ip netns add testns - ip netns add testns - CHECK_RESULT $? 0 0 "创建网络命名空间失败" - - # ip netns list | grep testns - ip netns list | grep -q testns - CHECK_RESULT $? 0 0 "验证网络命名空间存在失败" - - # ip netns delete testns - ip netns delete testns - CHECK_RESULT $? 0 0 "删除网络命名空间失败" - - # SSH_CMD示例(如果需要) - # SSH_CMD "ip netns add remotens" "$NODE2_IPV4" "$NODE2_PASSWORD" "$NODE2_USER" - - # 恢复环境(如果最初未安装,则卸载) - if ! $installed; then - LOG_INFO “恢复环境:卸载$package_name” - uninstall_package “$package_name” - fi - - LOG_INFO “测试完成” - } - - #执行主函数 - test_python3_pyroute2_function_netns - -} - -main "$@" \ No newline at end of file diff --git a/testcases/function_test/pkg_test/python-pyroute2/python3-pyroute2/test_python3-pyroute2_function_route.sh b/testcases/function_test/pkg_test/python-pyroute2/python3-pyroute2/test_python3-pyroute2_function_route.sh deleted file mode 100644 index 45dede8e985..00000000000 --- a/testcases/function_test/pkg_test/python-pyroute2/python3-pyroute2/test_python3-pyroute2_function_route.sh +++ /dev/null @@ -1,85 +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 : 测试路由表管理功能 -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - - # 测试路由表管理功能 - - LOG_INFO "开始测试路由表管理功能" - - # 检查是否已安装python3-pyroute2 - LOG_INFO "检查是否已安装python3-pyroute2" - dnf list installed python3-pyroute2 > /dev/null 2>&1 - if [ $? -eq 0 ]; then - LOG_INFO "python3-pyroute2已安装,脚本结束时保持安装状态" - INSTALLED=true - else - LOG_INFO "python3-pyroute2未安装,将在测试结束后卸载" - INSTALLED=false - fi - - # 检查yum源中是否有python3-pyroute2软件包 - LOG_INFO "检查yum源中是否有python3-pyroute2软件包" - dnf list available python3-pyroute2 > /dev/null 2>&1 - if [ $? -ne 0 ]; then - LOG_ERROR "yum源中未找到python3-pyroute2软件包" - exit 255 - fi - - # 如果未安装,则安装python3-pyroute2 - if [ "$INSTALLED" = false ]; then - LOG_INFO "安装python3-pyroute2" - dnf install -y python3-pyroute2 - CHECK_RESULT $? 0 0 "安装python3-pyroute2失败" - fi - - # 测试路由表管理功能 - LOG_INFO "测试路由表管理功能" - ip route show > /dev/null 2>&1 - CHECK_RESULT $? 0 0 "ip route show命令执行失败" - - # 测试添加路由表(示例) - LOG_INFO "测试添加路由表" - ip route add default via 192.168.1.1 > /dev/null 2>&1 - CHECK_RESULT $? 0 0 "添加路由表失败" - - # 测试删除路由表(示例) - LOG_INFO "测试删除路由表" - ip route del default via 192.168.1.1 > /dev/null 2>&1 - CHECK_RESULT $? 0 0 "删除路由表失败" - - # SSH到第二个节点测试(示例) - LOG_INFO "在第二个节点上执行命令" - SSH_CMD "ip route show" "$NODE2_IPV4" "$NODE2_PASSWORD" "$NODE2_USER" > /dev/null 2>&1 - CHECK_RESULT $? 0 0 "在第二个节点上执行ip route show失败" - - #如果脚本开始时未安装,则在结束时卸载python3-pyroute2 - if [ "$INSTALLED" = false ]; then - LOG_INFO "卸载python3-pyroute2" - dnf remove -y python3-pyroute2 - CHECK_RESULT $? 0 0 "卸载python3-pyroute2失败" - fi - - LOG_INFO "测试路由表管理功能完成" - -} - -main "$@" \ No newline at end of file diff --git a/testcases/function_test/pkg_test/python-pyroute2/python3-pyroute2/test_python3-pyroute2_pyroute2-cli_a.sh b/testcases/function_test/pkg_test/python-pyroute2/python3-pyroute2/test_python3-pyroute2_pyroute2-cli_a.sh deleted file mode 100644 index 458b4a79db4..00000000000 --- a/testcases/function_test/pkg_test/python-pyroute2/python3-pyroute2/test_python3-pyroute2_pyroute2-cli_a.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-10 -# @License : Mulan PSL v2 -# @Desc : 测试指定IP地址监听 -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - # 测试指定IP地址监听 - - LOG_INFO "开始测试:测试指定IP地址监听" - - # 检查是否已安装python3-pyroute2和pyroute2-cli - LOG_INFO "检查是否已安装python3-pyroute2和pyroute2-cli" - if ! dnf list installed python3-pyroute2 &> /dev/null || ! dnf list installed pyroute2-cli &> /dev/null; then - LOG_INFO "未安装python3-pyroute2或pyroute2-cli,将进行安装" - # 检查yum源中是否有python3-pyroute2和pyroute2-cli - if ! dnf list available python3-pyroute2 &> /dev/null || ! dnf list available pyroute2-cli &> /dev/null; then - LOG_ERROR "yum源中未找到python3-pyroute2或pyroute2-cli" - exit 255 - fi - # 安装软件包 - dnf install -y python3-pyroute2 pyroute2-cli - CHECK_RESULT $? 0 0 "安装python3-pyroute2和pyroute2-cli失败" - else - LOG_INFO "python3-pyroute2和pyroute2-cli已安装" - fi - - # 测试指定IP地址监听 - LOG_INFO "测试指定IP地址监听" - ip addr add 192.168.1.100/24 dev lo &> /dev/null - CHECK_RESULT $? 0 0 "添加IP地址失败" - - # 检查IP地址是否已添加 - ip addr show lo | grep -q "192.168.1.100" - CHECK_RESULT $? 0 0 "IP地址未成功添加" - - # 清理添加的IP地址 - LOG_INFO "清理环境:删除添加的IP地址" - ip addr del 192.168.1.100/24 dev lo &> /dev/null - CHECK_RESULT $? 0 0 "删除IP地址失败" - - # 如果脚本开始时未安装软件包,则在结束时卸载 - if [[ "$(dnf list installed python3-pyroute2 &> /dev/null; echo $?)" != "0" || "$(dnf list installed pyroute2-cli &> /dev/null; echo $?)" != "0" ]]; then - LOG_INFO "卸载python3-pyroute2和pyroute2-cli" - dnf remove -y python3-pyroute2 pyroute2-cli - CHECK_RESULT $? 0 0 "卸载python3-pyroute2和pyroute2-cli失败" - fi - - LOG_INFO "测试完成:测试指定IP地址监听" -} - -main "$@" \ No newline at end of file diff --git a/testcases/function_test/pkg_test/python-pyroute2/python3-pyroute2/test_python3-pyroute2_pyroute2-cli_c.sh b/testcases/function_test/pkg_test/python-pyroute2/python3-pyroute2/test_python3-pyroute2_pyroute2-cli_c.sh deleted file mode 100644 index 4b3a9236aa7..00000000000 --- a/testcases/function_test/pkg_test/python-pyroute2/python3-pyroute2/test_python3-pyroute2_pyroute2-cli_c.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 : 测试命令行运行 -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - - # 检查是否已安装python3-pyroute2和pyroute2-cli - LOG_INFO "检查是否已安装python3-pyroute2和pyroute2-cli" - if rpm -q python3-pyroute2 pyroute2-cli &>/dev/null; then - LOG_INFO "python3-pyroute2和pyroute2-cli已安装" - installed=true - else - LOG_INFO "python3-pyroute2和pyroute2-cli未安装" - installed=false - fi - - # 检查yum源中是否有python3-pyroute2和pyroute2-cli - LOG_INFO "检查yum源中是否有python3-pyroute2和pyroute2-cli" - if ! dnf list available python3-pyroute2 pyroute2-cli &>/dev/null; then - LOG_ERROR "yum源中未找到python3-pyroute2或pyroute2-cli" - exit 255 - fi - - # 如果未安装,则安装软件包 - if [ "$installed" = false ]; then - LOG_INFO "开始安装python3-pyroute2和pyroute2-cli" - dnf install -y python3-pyroute2 pyroute2-cli - CHECK_RESULT $? 0 0 "安装python3-pyroute2和pyroute2-cli失败" - fi - - # 测试命令行运行 - LOG_INFO "测试命令行运行" - prcmd_output=$(pyroute2-cli --help) - CHECK_RESULT $? 0 0 "pyroute2-cli命令执行失败" - if [[ "$prcmd_output" != *"usage"* ]]; then - LOG_ERROR "pyroute2-cli命令参数不支持或不存在" - exit 255 - fi - - # 清理环境 - if [ "$installed" = false ]; then - LOG_INFO "卸载python3-pyroute2和pyroute2-cli" - dnf remove -y python3-pyroute2 pyrate1cli - fi - - LOG_INFO "测试脚本执行完毕" -} - -main "$@" \ No newline at end of file diff --git a/testcases/function_test/pkg_test/python-pyroute2/python3-pyroute2/test_python3-pyroute2_pyroute2-cli_h.sh b/testcases/function_test/pkg_test/python-pyroute2/python3-pyroute2/test_python3-pyroute2_pyroute2-cli_h.sh deleted file mode 100644 index af7abfc24ec..00000000000 --- a/testcases/function_test/pkg_test/python-pyroute2/python3-pyroute2/test_python3-pyroute2_pyroute2-cli_h.sh +++ /dev/null @@ -1,57 +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 : 测试帮助文档显示 -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - LOG_INFO "开始测试帮助文档显示功能" - - # 检查是否已安装python3-pyroute2和pyroute2-cli - if ! dnf list installed python3-pyroute2 &> /dev/null || ! dnf list installed pyroute2-cli &> /dev/null; then - LOG_INFO "环境未安装python3-pyroute2或pyroute2-cli,将进行安装" - # 检查yum源中是否有python3-pyroute2和pyroute2-cli - if ! dnf list available python3-pyroute2 &> /dev/null || ! dnf list available pyroute2-cli &> /dev/null; then - LOG_ERROR "yum源中未找到python3-pyroute2或pyroute2-cli软件包" - exit 255 - fi - # 安装软件包 - dnf install -y python3-pyroute2 pyroute2-cli - CHECK_RESULT $? 0 0 "安装python3-pyroute2和pyroute2-cli失败" - else - LOG_INFO "环境已安装python3-pyroute2和pyroute2-cli" - fi - - # 测试帮助文档显示功能 - LOG_INFO "测试帮助文档显示功能" - pr --help &> /dev/null - CHECK_RESULT $? 0 0 "帮助文档显示失败" - - # 清理环境(如果脚本开始时未安装软件包,则卸载) - if ! dnf list installed python3-pyroute2 &> /dev/null || ! dnf list installed pyroute2-cli &> /dev/null; then - LOG_INFO "清理环境,卸载python3-pyroute2和pyroute2-cli" - dnf remove -y python3-pyroute2 pyroute2-cli - CHECK_RESULT $? 0 0 "卸载python3-pyroute2和pyroute2-cli失败" - else - LOG_INFO "保持环境安装状态" - fi - - LOG_INFO "测试完成" -} - -main "$@" \ No newline at end of file diff --git a/testcases/function_test/pkg_test/python-pyroute2/python3-pyroute2/test_python3-pyroute2_pyroute2-cli_l.sh b/testcases/function_test/pkg_test/python-pyroute2/python3-pyroute2/test_python3-pyroute2_pyroute2-cli_l.sh deleted file mode 100644 index b288aadf01c..00000000000 --- a/testcases/function_test/pkg_test/python-pyroute2/python3-pyroute2/test_python3-pyroute2_pyroute2-cli_l.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-12-10 -# @License : Mulan PSL v2 -# @Desc : 测试日志规范设置 -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - # 测试脚本 test_python3-pyroute2_pyroute2-cli_l - - # 步骤1:检查环境是否已安装软件包 - LOG_INFO "检查环境是否已安装 python3-pyroute2 和 pyroute2-cli" - if rpm -q python3-pyroute2 pyroute2-cli &>/dev/null; then - LOG_INFO "软件包已安装,脚本结束时将保持安装状态" - INSTALLED=true - else - LOG_INFO "软件包未安装,将在测试结束后卸载" - INSTALLED=false - fi - - # 步骤2:检查yum源中是否有软件包 - LOG_INFO "检查yum源中是否有 python3-pyroute2 和 pyroute2-cli" - if ! dnf list available python3-pyroute2 pyroute2-cli &>/dev/null; then - LOG_ERROR "yum源中未找到 python3-pyroute2 或 pyroute2-cli" - exit 255 - fi - - # 步骤3:安装软件包 - if [ "$INSTALLED" = false ]; then - LOG_INFO "开始安装 python3-pyroute2 和 pyroute2-cli" - dnf install -y python3-pyroute2 pyroute2-cli - CHECK_RESULT $? 0 0 "安装软件包失败" - fi - - # 步骤4:测试 pyroute2-cli 命令参数支持 - LOG_INFO "测试 pyroute2-cli 命令参数支持" - pyroute2-cli --help &>/dev/null - CHECK_RESULT $? 0 255 "pyroute2-cli 命令参数不支持" - - # 步骤5:执行测试命令 - LOG_INFO "执行测试命令:pyroute2-cli link show" - pyroute2-cli link show &>/dev/null - CHECK_RESULT $? 0 0 "执行命令失败" - - # 步骤6:清理环境 - if [ "$INSTALLED" = false ]; then - LOG_INFO "卸载 python3-pyroute2 和 pyroute2-cli" - dnf remove -y python3-pyroute2 pyroute2-cli - CHECK_RESULT $? 0 0 "卸载软件包失败" - fi - - LOG_INFO "测试完成,环境已恢复" -} - -main "$@" \ No newline at end of file diff --git a/testcases/function_test/pkg_test/python-pyroute2/python3-pyroute2/test_python3-pyroute2_pyroute2-cli_m.sh b/testcases/function_test/pkg_test/python-pyroute2/python3-pyroute2/test_python3-pyroute2_pyroute2-cli_m.sh deleted file mode 100644 index 9207337bc01..00000000000 --- a/testcases/function_test/pkg_test/python-pyroute2/python3-pyroute2/test_python3-pyroute2_pyroute2-cli_m.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-10 -# @License : Mulan PSL v2 -# @Desc : 测试设置模式 -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - - # 检查是否已安装python3-pyroute2和pyroute2-cli - LOG_INFO "检查环境是否已安装python3-pyroute2和pyroute2-cli" - if dnf list installed python3-pyroute2 &>/dev/null && dnf list installed pyroute2-cli &>/dev/null; then - LOG_INFO "环境已安装python3-pyroute2和pyroute2-cli" - INSTALLED=true - else - LOG_INFO "环境未安装python3-pyroute2和pyroute2-cli" - INSTALLED=false - fi - - # 检查yum源中是否有python3-pyroute2和pyroute2-cli - LOG_INFO "检查yum源中是否有python3-pyroute2和pyroute2-cli" - if ! dnf list available python3-pyroute2 &>/dev/null || ! dnf list available pyroute2-cli &>/dev/null; then - LOG_ERROR "yum源中缺少python3-pyroute2或pyroute2-cli软件包" - exit 255 - fi - - # 如果未安装,则安装软件包 - if [ "$INSTALLED" = false ]; then - LOG_INFO "开始安装python3-pyroute2和pyroute2-cli" - dnf install -y python3-pyroute2 pyroute2-cli - CHECK_RESULT $? 0 0 "安装python3-pyroute2和pyroute2-cli失败" - fi - - # 测试设置模式 - LOG_INFO "测试设置模式" - - # 执行测试命令 - LOG_INFO "执行测试命令" - ip route show > /dev/null # 示例命令,实际应根据需求调整 - CHECK_RESULT $? 0 0 "执行测试命令失败" - - # 清理环境:如果脚本开始时未安装,则卸载软件包 - if [ "$INSTALLED" = false ]; then - LOG_INFO "卸载python3-pyroute2和pyroute2-cli" - dnf remove -y python3-pyoute pyoute-cl # 修正为正确的包名以避免卸载错误(示例) - CHECK_RESULT $? 0 0 "卸载python-poute和poutecli失败" - fi - - LOG_INFO "测试脚本执行完毕" - -} - -main "$@" \ No newline at end of file diff --git a/testcases/function_test/pkg_test/python-pyroute2/python3-pyroute2/test_python3-pyroute2_pyroute2-cli_p.sh b/testcases/function_test/pkg_test/python-pyroute2/python3-pyroute2/test_python3-pyroute2_pyroute2-cli_p.sh deleted file mode 100644 index 1dcd331aa85..00000000000 --- a/testcases/function_test/pkg_test/python-pyroute2/python3-pyroute2/test_python3-pyroute2_pyroute2-cli_p.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-12-10 -# @License : Mulan PSL v2 -# @Desc : 测试指定监听端口 -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - # 测试指定监听端口 - - LOG_INFO "开始测试指定监听端口" - - # 检查是否已安装python3-pyroute2和pyroute2-cli - if ! dnf list installed python3-pyroute2 &>/dev/null || ! dnf list installed pyroute2-cli &>/dev/null; then - LOG_INFO "检测到未安装python3-pyroute2或pyroute2-cli,将进行安装" - # 检查yum源中是否有该软件包 - if ! dnf list available python3-pyroute2 &>/dev/null || ! dnf list available pyroute2-cli &>/dev/null; then - LOG_ERROR "yum源中未找到python3-pyroute2或pyroute2-cli软件包" - exit 255 - fi - # 安装软件包 - dnf install -y python3-pyroute2 pyroute2-cli - CHECK_RESULT $? 0 0 "安装python3-pyroute2和pyroute2-cli失败" - INSTALLED=true - else - LOG_INFO "检测到已安装python3-pyroute2和pyroute2-cli" - INSTALLED=false - fi - - # 测试指定监听端口功能 - LOG_INFO "开始测试指定监听端口功能" - ip route show > /dev/null - CHECK_RESULT $? 0 0 "ip route show命令执行失败" - - # 清理环境 - if [ "$INSTALLED" = true ]; then - LOG_INFO "清理安装的软件包" - dnf remove -y python3-pyroute2 pyroute2-cli - CHECK_RESULT $? 0 0 "卸载python3-pyroute2和pyroute2-cli失败" - fi - - LOG_INFO "测试指定监听端口完成" -} - -main "$@" \ No newline at end of file diff --git a/testcases/function_test/pkg_test/python-pyroute2/python3-pyroute2/test_python3-pyroute2_pyroute2-cli_r.sh b/testcases/function_test/pkg_test/python-pyroute2/python3-pyroute2/test_python3-pyroute2_pyroute2-cli_r.sh deleted file mode 100644 index 4fc96bfe625..00000000000 --- a/testcases/function_test/pkg_test/python-pyroute2/python3-pyroute2/test_python3-pyroute2_pyroute2-cli_r.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-10 -# @License : Mulan PSL v2 -# @Desc : 测试加载rc文件 -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - - LOG_INFO "开始测试:测试加载rc文件" - - # 检查是否已安装python3-pyroute2和pyroute2-cli - LOG_INFO "检查是否已安装python3-pyroute2和pyroute2-cli" - if ! dnf list installed python3-pyroute2 &> /dev/null || ! dnf list installed pyroute2-cli &> /dev/null; then - LOG_INFO "环境未安装python3-pyroute2或pyroute2-cli,将进行安装" - # 检查yum源中是否有软件包 - LOG_INFO "检查yum源中是否有python3-pyroute2和pyroute2-cli" - if ! dnf list available python3-pyroute2 &> /dev/null || ! dnf list available pyroute2-cli &> /dev/null; then - LOG_ERROR "yum源中缺少python3-pyroute2或pyroute2-cli软件包" - exit 255 - fi - # 安装软件包 - LOG_INFO "安装python3-pyroute2和pyroute2-cli" - dnf install -y python3-pyroute2 pyroute2-cli - CHECK_RESULT $? 0 0 "安装python3-pyroute2和pyroute2-cli失败" - # 标记需要卸载 - NEED_UNINSTALL=1 - else - LOG_INFO "环境已安装python3-pyroute2和pyroute2-cli" - NEED_UNINSTALL=0 - fi - - # 测试加载rc文件 - LOG_INFO "测试加载rc文件" - if ! command -v pr2cmd &> /dev/null; then - LOG_ERROR "pr2cmd命令不存在或不支持" - exit 255 - fi - - # 执行pr2cmd命令测试加载rc文件 - LOG_INFO "执行pr2cmd命令测试加载rc文件" - pr2cmd --help &> /dev/null - CHECK_RESULT $? 0 0 "pr2cmd命令执行失败" - - # 清理环境,如果之前未安装则卸载软件包 - if [ $NEED_UNINSTALL -eq 1 ]; then - LOG_INFO "卸载python3-pyroute2和pyroute2-cli" - dnf remove -y python3-pyroute2 pyroute -} - -main "$@" \ No newline at end of file diff --git a/testcases/function_test/pkg_test/python-pyroute2/python3-pyroute2/test_python3-pyroute2_pyroute2-cli_s.sh b/testcases/function_test/pkg_test/python-pyroute2/python3-pyroute2/test_python3-pyroute2_pyroute2-cli_s.sh deleted file mode 100644 index 90e3ad785fe..00000000000 --- a/testcases/function_test/pkg_test/python-pyroute2/python3-pyroute2/test_python3-pyroute2_pyroute2-cli_s.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-10 -# @License : Mulan PSL v2 -# @Desc : 测试从json文件加载源 -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - - # 检查是否已安装python3-pyroute2和pyroute2-cli - LOG_INFO "检查是否已安装python3-pyroute2和pyroute2-cli" - if rpm -q python3-pyroute2 pyroute2-cli &>/dev/null; then - LOG_INFO "python3-pyroute2和pyroute2-cli已安装" - installed=true - else - LOG_INFO "python3-pyroute2和pyroute2-cli未安装" - installed=false - fi - - # 检查yum源中是否有python3-pyroute2和pyroute2-cli软件包 - LOG_INFO "检查yum源中是否有python3-pyroute2和pyroute2-cli软件包" - if ! dnf list available python3-pyroute2 pyroute2-cli &>/dev/null; then - LOG_ERROR "yum源中未找到python3-pyroute2或pyroute2-cli软件包" - exit 255 - fi - - # 若未安装,则安装软件包 - if [ "$installed" = false ]; then - LOG_INFO "开始安装python3-pyroute2和pyroute2-cli" - dnf install -y python3-pyroute2 pyroute2-cli - CHECK_RESULT $? 0 0 "安装python3-pyroute2和pyroute2-cli失败" - fi - - # 测试从json文件加载源 - LOG_INFO "测试从json文件加载源" - echo "{"test": "data"}" > test.json - py route load test.json - CHECK_RESULT $? 0 0 "从json文件加载源失败" - - # 清理测试文件 - rm -f test.json - - # 若脚本开始时未安装,则卸载软件包以恢复环境 - if [ "$installed" = false ]; then - LOG_INFO "卸载python3-pyroute2和pyrite_cliee" - dnf remove -y python3-ppyroutelient pyroutee22--cli - CHECK_RESULT $? 0 0 "卸载python33-pyroutelient和pyroutelient--cli失败" - fi - - LOG_INFO_("测试脚本执行完毕") -} - -main "$@" \ No newline at end of file diff --git a/testcases/function_test/pkg_test/python-pyroute2/python3-pyroute2/test_python3-pyroute2_pyroute2-cli_x.sh b/testcases/function_test/pkg_test/python-pyroute2/python3-pyroute2/test_python3-pyroute2_pyroute2-cli_x.sh deleted file mode 100644 index 4c5f10c6c5f..00000000000 --- a/testcases/function_test/pkg_test/python-pyroute2/python3-pyroute2/test_python3-pyroute2_pyroute2-cli_x.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-12-10 -# @License : Mulan PSL v2 -# @Desc : 测试严格认证设置 -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - - # 测试严格认证设置 - - LOG_INFO "开始测试严格认证设置" - - # 检查是否已安装python3-pyroute2和pyroute2-cli - LOG_INFO "检查python3-pyroute2和pyroute2-cli是否已安装" - if rpm -q python3-pyroute2 pyroute2-cli &>/dev/null; then - LOG_INFO "python3-pyroute2和pyroute2-cli已安装" - installed=true - else - LOG_INFO "python3-pyroute2和pyroute2-cli未安装" - installed=false - fi - - # 检查yum源中是否有python3-pyroute2和pyroute2-cli - LOG_INFO "检查yum源中是否有python3-pyroute2和pyroute2-cli" - if ! dnf list available python3-pyroute2 pyroute2-cli &>/dev/null; then - LOG_ERROR "yum源中未找到python3-pyroute2或pyroute2-cli" - exit 255 - fi - - # 如果未安装,则安装软件包 - if [ "$installed" = false ]; then - LOG_INFO "开始安装python3-pyroute2和pyroute2-cli" - dnf install -y python3-pyroute2 pyroute2-cli - CHECK_RESULT $? 0 0 "安装python3-pyroute2和pyroute2-cli失败" - fi - - # 测试严格认证设置命令 - LOG_INFO "测试严格认证设置命令" - output=$(pyroute2-cli --strict-auth) - CHECK_RESULT $? 0 0 "执行严格认证设置命令失败" - - # 清理环境 - if [ "$installed" = false ]; then - LOG_INFO "卸载python3-pyroute2和pyroute2-cli" - dnf remove -y python3-pyroute2 pyrotecli - CHECK_RESULT $? 0 0 "卸载python3-pyroute1或 pyrotecli失败" - fi - - LOG_INFO "测试严格认证设置完成" - -} - -main "$@" \ No newline at end of file diff --git a/testcases/function_test/pkg_test/python-pyroute2/python3-pyroute2/test_python3-pyroute2_pyroute2-dhcp-client_ifname.sh b/testcases/function_test/pkg_test/python-pyroute2/python3-pyroute2/test_python3-pyroute2_pyroute2-dhcp-client_ifname.sh deleted file mode 100644 index 469d7256798..00000000000 --- a/testcases/function_test/pkg_test/python-pyroute2/python3-pyroute2/test_python3-pyroute2_pyroute2-dhcp-client_ifname.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-12-10 -# @License : Mulan PSL v2 -# @Desc : 测试使用有效的接口名称运行 pyroute2-dhcp-client 命令 -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - - LOG_INFO "开始测试:测试使用有效的接口名称运行 pyroute2-dhcp-client 命令" - - # 检查是否已安装 pyroute2-dhcp-client - LOG_INFO "检查 pyroute2-dhcp-client 是否已安装" - if ! dnf list installed pyroute2-dhcp-client &> /dev/null; then - LOG_INFO "pyroute2-dhcp-client 未安装,将进行安装" - # 检查 yum 源中是否有该软件包 - if ! dnf list available pyroute2-dhcp-client &> /dev/null; then - LOG_ERROR "yum 源中未找到 pyroute2-dhcp-client 软件包" - exit 255 - fi - # 安装软件包 - dnf install -y pyroute2-dhcp-client - CHECK_RESULT $? 0 0 "安装 pyroute2-dhcp-client 失败" - INSTALLED=true - else - LOG_INFO "pyroute2-dhcp-client 已安装" - INSTALLED=false - fi - - # 获取有效的网络接口名称 - LOG_INFO "获取有效的网络接口名称" - INTERFACE=$(ip link show | grep -oP "^[0-9]+: \K[^:]+" | head -1) - if [ -z "$INTERFACE" ]; then - LOG_ERROR "未找到有效的网络接口名称" - exit 255 - fi - LOG_INFO "使用的网络接口名称为: $INTERFACE" - - # 运行 pyroute2-dhcp-client 命令 - LOG_INFO "运行 pyroute2-dhcp-client --ifname $INTERFACE" - pyroute2-dhcp-client --ifname "$INTERFACE" &> /dev/null - CHECK_RESULT $? 0 0 "pyroute2-dhcp-client 命令执行失败" - - # 清理环境:如果之前未安装则卸载软件包 - if [ "$INSTALLED" = false ]; then - LOG_INFO "卸载 pyroute2-dhcp-client" - dnf remove -y pyroute2-dhcp-client &> /dev/null - CHECK_RESULT $? 0 0 "卸载 pyroute2-dhcp-client 失败" - fi - - LOG_INFO "[测试完成]:测试使用有效的接口名称运行 pyroute2-dhcp-client 命令成功" - -} - -main "$@" \ No newline at end of file diff --git a/testcases/function_test/pkg_test/python-pyroute2/python3-pyroute2/test_python3-pyroute2_ss2__a.sh b/testcases/function_test/pkg_test/python-pyroute2/python3-pyroute2/test_python3-pyroute2_ss2__a.sh deleted file mode 100644 index 49c4b91ddb3..00000000000 --- a/testcases/function_test/pkg_test/python-pyroute2/python3-pyroute2/test_python3-pyroute2_ss2__a.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-12-10 -# @License : Mulan PSL v2 -# @Desc : 测试 ss2 命令显示所有套接字功能 -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - - # 检查是否已安装python3-pyroute2 - if ! rpm -q python3-pyroute2 &>/dev/null; then - LOG_INFO "环境未安装python3-pyroute2,将进行安装" - # 检查yum源中是否有该软件包 - if ! dnf list available python3-pyroute2 &>/dev/null; then - LOG_ERROR "yum源中未找到python3-pyroute2软件包" - exit 255 - fi - # 安装软件包 - dnf install -y python3-pyroute2 - CHECK_RESULT $? 0 0 "安装python3-pyroute2失败" - # 标记需要卸载 - UNINSTALL_NEEDED=1 - else - LOG_INFO "环境已安装python3-pyroute2,无需重复安装" - fi - - # 测试ss2命令显示所有套接字功能 - LOG_INFO "测试ss2命令显示所有套接字功能" - ss2 -a &>/dev/null - CHECK_RESULT $? 0 0 "ss2命令执行失败" - - # 检查ss2命令是否支持-a参数 - if ! ss2 --help | grep -q "\-a"; then - LOG_ERROR "ss2命令不支持-a参数" - exit 255 - fi - - # 清理环境 - if [ "$UNINSTALL_NEEDED" -eq 1 ]; then - LOG_INFO "卸载python3-pyroute2" - dnf remove -y python3-pyroute2 - CHECK_RESULT $? 0 0 "卸载python3-pyroute2失败" - fi - - LOG_INFO "测试完成,环境已恢复" - -} - -main "$@" \ No newline at end of file diff --git a/testcases/function_test/pkg_test/python-pyroute2/python3-pyroute2/test_python3-pyroute2_ss2__h.sh b/testcases/function_test/pkg_test/python-pyroute2/python3-pyroute2/test_python3-pyroute2_ss2__h.sh deleted file mode 100644 index 1ad759fc662..00000000000 --- a/testcases/function_test/pkg_test/python-pyroute2/python3-pyroute2/test_python3-pyroute2_ss2__h.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-10 -# @License : Mulan PSL v2 -# @Desc : 测试 ss2 命令的帮助文档显示功能 -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - LOG_INFO "开始测试 ss2 命令的帮助文档显示功能" - - # 检查是否已安装 python3-pyroute2 包 - LOG_INFO "检查是否已安装 python3-pyroute2 包" - if ! dnf list installed python3-pyroute2 &> /dev/null; then - LOG_INFO "python3-pyroute2 未安装,开始安装" - # 检查 yum 源中是否有该软件包 - if ! dnf list available python3-pyroute2 &> /dev/null; then - LOG_ERROR "yum 源中未找到 python3-pyroute2 包" - exit 255 - fi - dnf install -y python3-pyroute2 - CHECK_RESULT $? 0 0 "安装 python3-pyroute2 失败" - # 标记为需要卸载 - NEED_UNINSTALL=1 - else - LOG_INFO "python3-pyroute2 已安装,无需重复安装" - fi - - # 检查 ss2 命令是否存在 - LOG_INFO "检查 ss2 命令是否存在" - if ! command -v ss2 &> /dev/null; then - LOG_ERROR "ss2 命令不存在或不支持" - exit 255 - fi - - # 测试 ss2 --help 命令的功能 - LOG_INFO "测试 ss2 --help 命令的功能" - ss2 --help &> /dev/null - CHECK_RESULT $? 0 0 "ss2 --help 命令执行失败" - - # 环境恢复:如果之前安装了软件包,则卸载 - if [[ $NEED_UNINSTALL -eq 1 ]]; then - LOG_INFO "卸载 python3-pyroute2 包" - dnf remove -y python3-pyroute2 - CHECK_RESULT $?5 -} - -main "$@" \ No newline at end of file diff --git a/testcases/function_test/pkg_test/python-pyroute2/python3-pyroute2/test_python3-pyroute2_ss2__r.sh b/testcases/function_test/pkg_test/python-pyroute2/python3-pyroute2/test_python3-pyroute2_ss2__r.sh deleted file mode 100644 index 1b3049949fa..00000000000 --- a/testcases/function_test/pkg_test/python-pyroute2/python3-pyroute2/test_python3-pyroute2_ss2__r.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 : 测试 ss2 命令解析主机名功能 -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - - # 测试 ss2 命令解析主机名功能 - - LOG_INFO "开始测试 ss2 命令解析主机名功能" - - # 检查是否已安装 python3-pyroute2 - if ! dnf list installed python3-pyroute2 &>/dev/null; then - LOG_INFO "环境未安装 python3-pyroute2,将进行安装" - # 检查 yum 源中是否有该软件包 - if ! dnf list available python3-pyroute2 &>/dev/null; then - LOG_ERROR "yum 源中未找到 python3-pyroute2 软件包" - exit 255 - fi - # 安装软件包 - dnf install -y python3-pyroute2 - CHECK_RESULT $? 0 0 "安装 python3-pyroute2 失败" - # 标记需要卸载 - NEED_UNINSTALL=1 - else - LOG_INFO "环境已安装 python3-pyroute2,无需重新安装" - fi - - # 测试 ss2 命令解析主机名功能 - LOG_INFO "测试 ss2 命令解析主机名功能" - ss2 --help | grep -q "hostname" - CHECK_RESULT $? 0 0 "ss2 命令不支持 hostname 参数" - - # 执行 ss2 hostname 命令测试 - LOG_INFO "执行 ss2 hostname example.com 命令" - ss2 hostname example.com &>/dev/null - CHECK_RESULT $? 0 0 "ss2 hostname example.com 执行失败" - - #清理环境 - if [ "$NEED_UNINSTALL" -eq 1 ]; then - LOG_INFO "卸载 python3-pyroute2" - dnf remove -y python3-pyroute2 - CHECK_RESULT $? 0 0 "卸载 python3-pyroute失败 " - fi - - LOG_INFO "测试完成" - -} - -main "$@" \ No newline at end of file diff --git a/testcases/function_test/pkg_test/python-pyroute2/python3-pyroute2/test_python3-pyroute2_ss2__t.sh b/testcases/function_test/pkg_test/python-pyroute2/python3-pyroute2/test_python3-pyroute2_ss2__t.sh deleted file mode 100644 index 1f31497a943..00000000000 --- a/testcases/function_test/pkg_test/python-pyroute2/python3-pyroute2/test_python3-pyroute2_ss2__t.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-10 -# @License : Mulan PSL v2 -# @Desc : 测试 ss2 命令显示 TCP 套接字功能 -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - LOG_INFO "开始测试 ss2 命令显示 TCP 套接字功能" - - # 检查是否已安装 python3-pyroute2 - LOG_INFO "检查是否已安装 python3-pyroute2" - if ! dnf list installed python3-pyroute2 &>/dev/null; then - LOG_INFO "python3-pyroute2 未安装,开始安装" - if ! dnf list available python3-pyroute2 &>/dev/null; then - LOG_ERROR "yum源中未找到 python3-pyroute2 软件包" - exit 255 - fi - dnf install -y python3-pyroute2 - CHECK_RESULT $? 0 0 "安装 python3-pyroute2 失败" - INSTALLED=true - else - LOG_INFO "python3-pyroute2 已安装" - INSTALLED=false - fi - - # 测试 ss2 命令显示 TCP 套接字功能 - LOG_INFO "测试 ss2 命令显示 TCP 套接字功能" - ss_output=$(ss -t 2>&1) - if [ $? -ne 0 ]; then - LOG_ERROR "ss 命令执行失败或参数不支持" - exit 255 - fi - CHECK_RESULT $? 0 0 "ss 命令执行失败" - - # 检查输出是否包含 TCP socket信息 - if ! echo "$ss_output" | grep -q "tcp"; then - LOG_ERROR "ss 命令未显示 TCP socket信息" - exit 1 - fi - LOG_INFO "ss 命令成功显示 TCP socket信息" - - #清理环境 - if [ "$INSTALLED" = true ]; then - LOG_INFO "卸载 python3-pyroute2" - dnf remove -y python3-pyroute2 - CHECK_RESULT $? 0 0 \"卸载python3-pyroute2失败\" - fi - - LOG_INFO \"测试完成\" -} - -main "$@" \ No newline at end of file diff --git a/testcases/function_test/pkg_test/python-pyroute2/python3-pyroute2/test_python3-pyroute2_ss2__x.sh b/testcases/function_test/pkg_test/python-pyroute2/python3-pyroute2/test_python3-pyroute2_ss2__x.sh deleted file mode 100644 index 4a3758d7d41..00000000000 --- a/testcases/function_test/pkg_test/python-pyroute2/python3-pyroute2/test_python3-pyroute2_ss2__x.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-12-10 -# @License : Mulan PSL v2 -# @Desc : 测试 ss2 命令显示 Unix 域套接字功能 -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - # 检查是否已安装python3-pyroute2 - LOG_INFO "检查是否已安装python3-pyroute2" - if dnf list installed python3-pyroute2 &>/dev/null; then - LOG_INFO "python3-pyroute2已安装,脚本结束后保持安装状态" - installed=true - else - LOG_INFO "python3-pyroute2未安装,将在脚本结束后卸载" - installed=false - fi - - # 检查yum源中是否有python3-pyroute2软件包 - LOG_INFO "检查yum源中是否有python3-pyroute2软件包" - if ! dnf list available python3-pyroute2 &>/dev/null; then - LOG_ERROR "yum源中未找到python3-pyroute2软件包" - exit 255 - fi - - # 安装python3-pyroute2(如果未安装) - if [ "$installed" = false ]; then - LOG_INFO "安装python3-pyroute2" - dnf install -y python3-pyroute2 - CHECK_RESULT $? 0 0 "安装python3-pyroute2失败" - fi - - # 测试ss2命令显示Unix域套接字功能 - LOG_INFO "测试ss2命令显示Unix域套接字功能" - ss2 -a | grep -q "unix" - CHECK_RESULT $? 0 0 "ss2命令显示Unix域套接字功能测试失败" - - # 清理环境(如果脚本开始时未安装) - if [ "$installed" = false ]; then - LOG_INFO "卸载python3-pyroute2" - dnf remove -y python3-pyroute2 - CHECK_RESULT $? 0 0 "卸载python3-pyroute2失败" - fi -} - -main "$@" \ No newline at end of file From 15a9a40a2484da3ecce2371c91ca49a8c75d0898 Mon Sep 17 00:00:00 2001 From: honghua Date: Thu, 23 Apr 2026 11:58:20 +0800 Subject: [PATCH 14/21] update testcase for testsuite texlive-gaceta --- .../texlive-split-j/texlive-gaceta.json | 10 --- .../test_texlive-gaceta_function_basic.sh | 67 ------------------- 2 files changed, 77 deletions(-) delete mode 100644 suite2cases/function_test/pkg_test/texlive-split-j/texlive-gaceta.json delete mode 100644 testcases/function_test/pkg_test/texlive-split-j/texlive-gaceta/test_texlive-gaceta_function_basic.sh diff --git a/suite2cases/function_test/pkg_test/texlive-split-j/texlive-gaceta.json b/suite2cases/function_test/pkg_test/texlive-split-j/texlive-gaceta.json deleted file mode 100644 index 550135d4432..00000000000 --- a/suite2cases/function_test/pkg_test/texlive-split-j/texlive-gaceta.json +++ /dev/null @@ -1,10 +0,0 @@ -{ - "path": "$OET_PATH/testcases/function_test/pkg_test/texlive-split-j/texlive-gaceta", - "machine num": 1, - "cases": [ - { - "name": "test_texlive-gaceta_function_basic", - "desc": "Basic functionality test for texlive-gaceta" - } - ] -} \ No newline at end of file diff --git a/testcases/function_test/pkg_test/texlive-split-j/texlive-gaceta/test_texlive-gaceta_function_basic.sh b/testcases/function_test/pkg_test/texlive-split-j/texlive-gaceta/test_texlive-gaceta_function_basic.sh deleted file mode 100644 index d19a8f458aa..00000000000 --- a/testcases/function_test/pkg_test/texlive-split-j/texlive-gaceta/test_texlive-gaceta_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 for texlive-gaceta -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - LOG_INFO "开始执行测试脚本:Basic functionality test for texlive-gaceta" - - # 检查环境是否已安装texlive-gaceta - LOG_INFO "检查texlive-gaceta是否已安装" - if dnf list installed texlive-gaceta &>/dev/null; then - LOG_INFO "texlive-gaceta已安装,脚本结束时将保持安装状态" - INSTALLED=true - else - LOG_INFO "texlive-gaceta未安装,将在测试结束后卸载" - INSTALLED=false - fi - - # 检查yum源中是否有texlive-gaceta软件包 - LOG_INFO "检查yum源中是否有texlive-gaceta软件包" - if ! dnf list available texlive-gaceta &>/dev/null; then - LOG_ERROR "yum源中未找到texlive-gaceta软件包" - exit 255 - fi - - # 若未安装则安装texlive-gaceta - if [ "$INSTALLED" = false ]; then - LOG_INFO "开始安装texlive-gaceta" - dnf install -y texlive-gaceta - CHECK_RESULT $? 0 0 "安装texlive-gaceta失败" - fi - - # 测试texlive-gaceta基本功能 - LOG_INFO "测试texlive-gaceta基本功能" - command_to_test="texlive-gaceta --version" # 假设--version是支持的参数 - if ! $command_to_test &>/dev/null; then - LOG_ERROR "参数不支持或命令执行失败" - exit 255 - fi - - # 清理环境 - if [ "$INSTALLED" = false ]; then - LOG_INFO "卸载texlive-gaceta以恢复环境" - dnf remove -y texlive-gaceta - CHECK_RESULT $? 0 0 "卸载texlive-gaceta失败" - fi - - LOG_INFO "测试脚本执行完毕" -} - -main "$@" \ No newline at end of file From 240abf2e10c52d139e33643bce287dd8a9369527 Mon Sep 17 00:00:00 2001 From: honghua Date: Thu, 23 Apr 2026 11:59:07 +0800 Subject: [PATCH 15/21] update testcase for testsuite texlive-datetime2-latin --- .../texlive-datetime2-latin.json | 8 - ...ve-datetime2-latin_function_basic_usage.sh | 173 ------------------ ...ve-datetime2-latin_function_lang_option.sh | 88 --------- 3 files changed, 269 deletions(-) delete mode 100644 testcases/function_test/pkg_test/texlive-split-f/texlive-datetime2-latin/test_texlive-datetime2-latin_function_basic_usage.sh delete mode 100644 testcases/function_test/pkg_test/texlive-split-f/texlive-datetime2-latin/test_texlive-datetime2-latin_function_lang_option.sh diff --git a/suite2cases/function_test/pkg_test/texlive-split-f/texlive-datetime2-latin.json b/suite2cases/function_test/pkg_test/texlive-split-f/texlive-datetime2-latin.json index abf3f2af586..58483e2a06a 100644 --- a/suite2cases/function_test/pkg_test/texlive-split-f/texlive-datetime2-latin.json +++ b/suite2cases/function_test/pkg_test/texlive-split-f/texlive-datetime2-latin.json @@ -13,14 +13,6 @@ { "name": "test_texlive-datetime2-latin_function_verify", "desc": "Verify package installation" - }, - { - "name": "test_texlive-datetime2-latin_function_basic_usage", - "desc": "Test basic LaTeX date typesetting" - }, - { - "name": "test_texlive-datetime2-latin_function_lang_option", - "desc": "Test Latin language date output" } ] } \ No newline at end of file diff --git a/testcases/function_test/pkg_test/texlive-split-f/texlive-datetime2-latin/test_texlive-datetime2-latin_function_basic_usage.sh b/testcases/function_test/pkg_test/texlive-split-f/texlive-datetime2-latin/test_texlive-datetime2-latin_function_basic_usage.sh deleted file mode 100644 index 8c1d46911b3..00000000000 --- a/testcases/function_test/pkg_test/texlive-split-f/texlive-datetime2-latin/test_texlive-datetime2-latin_function_basic_usage.sh +++ /dev/null @@ -1,173 +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-20 -# @License : Mulan PSL v2 -# @Desc : Test basic LaTeX date typesetting -# ############################################ - -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 expect=$2 - local mode=$3 - local message=$4 - if [ $mode -eq 0 ]; then - if [ $actual -ne $expect ]; then - LOG_ERROR "$message" - exit 1 - fi - else - if [ $actual -eq $expect ]; then - LOG_ERROR "$message" - exit 1 - fi - fi - } - - # 检查软件包是否在yum源中 - check_package_in_repo() { - local package_name=$1 - 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 存在于yum源中" - } - - # 检查命令参数是否支持 - check_command_param() { - local command=$1 - local param=$2 - LOG_INFO "检查命令 $command 是否支持参数 $param" - $command --help 2>&1 | grep -q "$param" - if [ $? -ne 0 ]; then - LOG_ERROR "命令 $command 不支持参数 $param" - exit 255 - fi - LOG_INFO "命令 $command 支持参数 $param" - } - - # 主测试函数 - test_texlive-datetime2-latin_function_basic_usage() { - LOG_INFO "开始测试: Test basic LaTeX date typesetting" - - # 定义软件包名称 - PACKAGE_NAME="texlive-datetime2-latin" - - # 检查软件包是否已安装 - LOG_INFO "检查系统是否已安装 $PACKAGE_NAME" - rpm -q "$PACKAGE_NAME" &>/dev/null - local installed=$? - - # 记录初始安装状态 - if [ $installed -eq 0 ]; then - LOG_INFO "系统已安装 $PACKAGE_NAME,测试后将保持安装状态" - WAS_INSTALLED=1 - else - LOG_INFO "系统未安装 $PACKAGE_NAME,测试后将卸载" - WAS_INSTALLED=0 - fi - - # 检查yum源中是否有该软件包 - check_package_in_repo "$PACKAGE_NAME" - - # 如果未安装,则安装软件包 - if [ $WAS_INSTALLED -eq 0 ]; then - LOG_INFO "安装软件包: $PACKAGE_NAME" - dnf install -y "$PACKAGE_NAME" - CHECK_RESULT $? 0 0 "安装软件包 $PACKAGE_NAME 失败" - LOG_INFO "软件包 $PACKAGE_NAME 安装成功" - fi - - # 创建测试LaTeX文件 - LOG_INFO "创建测试LaTeX文件" - TEST_FILE="test_date.tex" - cat > "$TEST_FILE" << "EOF" - \documentclass{article} - \usepackage[utf8]{inputenc} - \usepackage{datetime2} - \usepackage[useregional]{datetime2-latin} - \begin{document} - Current date and time: \DTMnow. - \end{document} - EOF - CHECK_RESULT $? 0 0 "创建测试LaTeX文件失败" - - # 检查pdflatex命令是否可用 - LOG_INFO "检查pdflatex命令是否可用" - which pdflatex &>/dev/null - if [ $? -ne 0 ]; then - LOG_INFO "pdflatex未安装,尝试安装texlive" - dnf install -y texlive - CHECK_RESULT $? 0 0 "安装texlive失败" - fi - - # 编译LaTeX文件 - LOG_INFO "编译LaTeX文件" - pdflatex -interaction=nonstopmode "$TEST_FILE" - CHECK_RESULT $? 0 0 "编译LaTeX文件失败" - - # 检查生成的PDF文件 - LOG_INFO "检查生成的PDF文件" - PDF_FILE="test_date.pdf" - if [ -f "$PDF_FILE" ]; then - LOG_INFO "PDF文件生成成功: $PDF_FILE" - # 检查文件大小 - local file_size=$(stat -c%s "$PDF_FILE") - if [ $file_size -gt 0 ]; then - LOG_INFO "PDF文件大小正常: ${file_size}字节" - else - LOG_ERROR "PDF文件大小为0" - exit 1 - fi - else - LOG_ERROR "PDF文件未生成" - exit 1 - fi - - # 清理测试文件 - LOG_INFO "清理测试文件" - rm -f "$TEST_FILE" "$PDF_FILE" test_date.aux test_date.log test_date.out - CHECK_RESULT $? 0 0 "清理测试文件失败" - - # 如果测试前未安装,则卸载软件包 - if [ $WAS_INSTALLED -eq 0 ]; then - LOG_INFO "卸载软件包: $PACKAGE_NAME" - dnf remove -y "$PACKAGE_NAME" - CHECK_RESULT $? 0 0 "卸载软件包 $PACKAGE_NAME 失败" - LOG_INFO "软件包 $PACKAGE_NAME 卸载成功" - fi - - LOG_INFO "测试完成: Test basic LaTeX date typesetting" - } - - # 执行测试 - test_texlive-datetime2-latin_function_basic_usage -} - -main "$@" \ No newline at end of file diff --git a/testcases/function_test/pkg_test/texlive-split-f/texlive-datetime2-latin/test_texlive-datetime2-latin_function_lang_option.sh b/testcases/function_test/pkg_test/texlive-split-f/texlive-datetime2-latin/test_texlive-datetime2-latin_function_lang_option.sh deleted file mode 100644 index 5a08c3ba1fa..00000000000 --- a/testcases/function_test/pkg_test/texlive-split-f/texlive-datetime2-latin/test_texlive-datetime2-latin_function_lang_option.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-02-20 -# @License : Mulan PSL v2 -# @Desc : Test Latin language date output -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - # 检查是否已安装texlive-datetime2-latin包 - LOG_INFO "检查是否已安装texlive-datetime2-latin包" - rpm -q texlive-datetime2-latin > /dev/null 2>&1 - is_installed=$? - - # 定义清理函数 - cleanup() { - if [ $is_installed -ne 0 ]; then - LOG_INFO "清理环境:卸载texlive-datetime2-latin包" - dnf remove -y texlive-datetime2-latin > /dev/null 2>&1 - CHECK_RESULT $? 0 0 "卸载texlive-datetime2-latin失败" - fi - } - - # 设置trap确保脚本退出时执行清理 - trap cleanup EXIT - - # 检查yum源中是否存在texlive-datetime2-latin包 - LOG_INFO "检查yum源中是否存在texlive-datetime2-latin包" - dnf list available texlive-datetime2-latin > /dev/null 2>&1 - if [ $? -ne 0 ]; then - LOG_ERROR "yum源中未找到texlive-datetime2-latin包" - exit 255 - fi - - # 如果未安装,则安装软件包 - if [ $is_installed -ne 0 ]; then - LOG_INFO "安装texlive-datetime2-latin包" - dnf install -y texlive-datetime2-latin > /dev/null 2>&1 - CHECK_RESULT $? 0 0 "安装texlive-datetime2-latin失败" - fi - - # 测试Latin语言日期输出 - LOG_INFO "测试Latin语言日期输出" - # 创建测试LaTeX文档 - cat > test_latin.tex << "EOF" - \documentclass{article} - \usepackage[useregional]{datetime2} - \usepackage[english,latin]{datetime2-latin} - \begin{document} - \DTMsetdatestyle{latinex} - \DTMsetup{datesep={.}} - \DTMdisplaydate{2023}{10}{15}{} - \end{document} - EOF - - # 编译LaTeX文档测试 - pdflatex -interaction=nonstopmode test_latin.tex > /dev/null 2>&1 - CHECK_RESULT $? 0 0 "LaTeX编译失败" - - # 检查生成的PDF文件 - if [ -f test_latin.pdf ]; then - LOG_INFO "PDF文件生成成功" - else - LOG_ERROR "PDF文件生成失败" - exit 1 - fi - - # 清理测试文件 - LOG_INFO "清理测试文件" - rm -f test_latin.tex test_latin.log test_latin.aux test_latin.pdf - - LOG_INFO "测试完成:Latin语言日期输出功能正常" -} - -main "$@" \ No newline at end of file From bda8b07ecd5724cd29466a8932961d2ce0be1259 Mon Sep 17 00:00:00 2001 From: honghua Date: Thu, 23 Apr 2026 12:02:31 +0800 Subject: [PATCH 16/21] update testcase for testsuite python3-pympress --- .../pkg_test/pympress/python3-pympress.json | 30 --------- .../test_python3-pympress_function_notes.sh | 66 ------------------- ...test_python3-pympress_function_openfile.sh | 61 ----------------- .../test_python3-pympress_function_slide.sh | 64 ------------------ .../test_python3-pympress_function_timer.sh | 66 ------------------- .../test_python3-pympress_function_zoom.sh | 64 ------------------ .../test_python3-pympress_pympress.sh | 63 ------------------ 7 files changed, 414 deletions(-) delete mode 100644 suite2cases/function_test/pkg_test/pympress/python3-pympress.json delete mode 100644 testcases/function_test/pkg_test/pympress/python3-pympress/test_python3-pympress_function_notes.sh delete mode 100644 testcases/function_test/pkg_test/pympress/python3-pympress/test_python3-pympress_function_openfile.sh delete mode 100644 testcases/function_test/pkg_test/pympress/python3-pympress/test_python3-pympress_function_slide.sh delete mode 100644 testcases/function_test/pkg_test/pympress/python3-pympress/test_python3-pympress_function_timer.sh delete mode 100644 testcases/function_test/pkg_test/pympress/python3-pympress/test_python3-pympress_function_zoom.sh delete mode 100644 testcases/function_test/pkg_test/pympress/python3-pympress/test_python3-pympress_pympress.sh diff --git a/suite2cases/function_test/pkg_test/pympress/python3-pympress.json b/suite2cases/function_test/pkg_test/pympress/python3-pympress.json deleted file mode 100644 index a7f8433a46c..00000000000 --- a/suite2cases/function_test/pkg_test/pympress/python3-pympress.json +++ /dev/null @@ -1,30 +0,0 @@ -{ - "path": "$OET_PATH/testcases/function_test/pkg_test/pympress/python3-pympress", - "machine num": 1, - "cases": [ - { - "name": "test_python3-pympress_pympress", - "desc": "测试不带任何参数的 pympress 命令" - }, - { - "name": "test_python3-pympress_function_openfile", - "desc": "测试打开文件功能" - }, - { - "name": "test_python3-pympress_function_slide", - "desc": "测试幻灯片切换功能" - }, - { - "name": "test_python3-pympress_function_zoom", - "desc": "测试缩放功能" - }, - { - "name": "test_python3-pympress_function_notes", - "desc": "测试备注显示功能" - }, - { - "name": "test_python3-pympress_function_timer", - "desc": "测试计时器功能" - } - ] -} \ No newline at end of file diff --git a/testcases/function_test/pkg_test/pympress/python3-pympress/test_python3-pympress_function_notes.sh b/testcases/function_test/pkg_test/pympress/python3-pympress/test_python3-pympress_function_notes.sh deleted file mode 100644 index 80086086962..00000000000 --- a/testcases/function_test/pkg_test/pympress/python3-pympress/test_python3-pympress_function_notes.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-06 -# @License : Mulan PSL v2 -# @Desc : 测试备注显示功能 -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - - # 检查是否已安装python3-pympress - LOG_INFO "检查是否已安装python3-pympress" - dnf list installed python3-pympress > /dev/null 2>&1 - if [ $? -eq 0 ]; then - LOG_INFO "python3-pympress已安装,脚本结束时保持安装状态" - INSTALLED=true - else - LOG_INFO "python3-pympress未安装,将在测试结束后卸载" - INSTALLED=false - fi - - # 检查yum源中是否有python3-pympress软件包 - LOG_INFO "检查yum源中是否有python3-pympress软件包" - dnf list available python3-pympress > /dev/null 2>&1 - if [ $? -ne 0 ]; then - LOG_ERROR "yum源中未找到python3-pympress软件包" - exit 255 - fi - - # 安装python3-pympress - if [ "$INSTALLED" = false ]; then - LOG_INFO "开始安装python3-pympress" - dnf install -y python3-pympress > /dev/null 2>&1 - CHECK_RESULT $? 0 0 "安装python3-pympress失败" - fi - - # 测试备注显示功能 - LOG_INFO "测试备注显示功能" - pympress --help | grep "notes" > /dev/null 2>&1 - CHECK_RESULT $? 0 0 "备注显示功能不支持或参数错误" - - # 清理环境 - if [ "$INSTALLED" = false ]; then - LOG_INFO "卸载python3-pympress" - dnf remove -y python3-pympress > /dev/null 2>&1 - CHECK_RESULT $? 0 0 "卸载python3-pympress失败" - fi - - LOG_INFO "测试完成" - -} - -main "$@" \ No newline at end of file diff --git a/testcases/function_test/pkg_test/pympress/python3-pympress/test_python3-pympress_function_openfile.sh b/testcases/function_test/pkg_test/pympress/python3-pympress/test_python3-pympress_function_openfile.sh deleted file mode 100644 index b9b156bd50b..00000000000 --- a/testcases/function_test/pkg_test/pympress/python3-pympress/test_python3-pympress_function_openfile.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-06 -# @License : Mulan PSL v2 -# @Desc : 测试打开文件功能 -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - LOG_INFO "开始测试打开文件功能" - - # 检查yum源中是否存在python3-pympress软件包 - LOG_INFO "检查yum源中是否存在python3-pympress软件包" - dnf list available python3-pympress > /dev/null 2>&1 - if [ $? -ne 0 ]; then - LOG_ERROR "yum源中不存在python3-pympress软件包" - exit 255 - fi - - # 检查是否已安装python3-pympress - LOG_INFO "检查是否已安装python3-pympress" - rpm -q python3-pympress > /dev/null 2>&1 - if [ $? -eq 0 ]; then - LOG_INFO "python3-pympress已安装,跳过安装步骤" - installed=true - else - LOG_INFO "python3-pympress未安装,开始安装" - dnf install -y python3-pympress - CHECK_RESULT $? 0 0 "安装python3-pympress失败" - installed=false - fi - - # 测试打开文件功能 - LOG_INFO "测试打开文件功能" - pympress --help > /dev/null 2>&1 - CHECK_RESULT $? 0 0 "pympress命令不支持或参数错误" - - # 清理环境 - if [ "$installed" = false ]; then - LOG_INFO "卸载python3-pympress" - dnf remove -y python3-pympress - CHECK_RESULT $? 0 0 "卸载python3-pympress失败" - fi - - LOG_INFO "测试打开文件功能完成" -} - -main "$@" \ No newline at end of file diff --git a/testcases/function_test/pkg_test/pympress/python3-pympress/test_python3-pympress_function_slide.sh b/testcases/function_test/pkg_test/pympress/python3-pympress/test_python3-pympress_function_slide.sh deleted file mode 100644 index 585341c8383..00000000000 --- a/testcases/function_test/pkg_test/pympress/python3-pympress/test_python3-pympress_function_slide.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-06 -# @License : Mulan PSL v2 -# @Desc : 测试幻灯片切换功能 -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - LOG_INFO "开始测试幻灯片切换功能" - - # 检查是否已安装python3-pympress - LOG_INFO "检查是否已安装python3-pympress" - if dnf list installed python3-pympress &>/dev/null; then - LOG_INFO "python3-pympress已安装" - INSTALLED=true - else - LOG_INFO "python3-pympress未安装" - INSTALLED=false - fi - - # 检查yum源中是否有python3-pympress - LOG_INFO "检查yum源中是否有python3-pympress" - if ! dnf list available python3-pympress &>/dev/null; then - LOG_ERROR "yum源中未找到python3-pympress" - exit 255 - fi - - # 如果未安装,则安装python3-pympress - if [ "$INSTALLED" = false ]; then - LOG_INFO "安装python3-pympress" - dnf install -y python3-pympress - CHECK_RESULT $? 0 0 "安装python3-pympress失败" - fi - - # 测试幻灯片切换功能 - LOG_INFO "测试幻灯片切换功能" - pympress --help | grep -q "slide" - CHECK_RESULT $? 0 0 "pympress不支持幻灯片切换功能" - - # 如果之前未安装,则卸载python3-pympress - if [ "$INSTALLED" = false ]; then - LOG_INFO "卸载python3-pympress" - dnf remove -y python3-pympress - CHECK_RESULT $? 0 0 "卸载python3-pympress失败" - fi - - LOG_INFO "测试幻灯片切换功能完成" -} - -main "$@" \ No newline at end of file diff --git a/testcases/function_test/pkg_test/pympress/python3-pympress/test_python3-pympress_function_timer.sh b/testcases/function_test/pkg_test/pympress/python3-pympress/test_python3-pympress_function_timer.sh deleted file mode 100644 index 4fbe287b5b4..00000000000 --- a/testcases/function_test/pkg_test/pympress/python3-pympress/test_python3-pympress_function_timer.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-06 -# @License : Mulan PSL v2 -# @Desc : 测试计时器功能 -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - - # 检查yum源中是否存在pympress软件包 - LOG_INFO "检查yum源中是否存在pympress软件包" - dnf list available python3-pympress &> /dev/null - if [ $? -ne 0 ]; then - LOG_ERROR "yum源中不存在python3-pympress软件包" - exit 255 - fi - - # 检查是否已安装python3-pympress - LOG_INFO "检查是否已安装python3-pympress" - rpm -q python3-pympress &> /dev/null - if [ $? -eq 0 ]; then - already_installed=true - LOG_INFO "python3-pympress已安装,脚本结束后将保持安装状态" - else - already_installed=false - LOG_INFO "python3-pympress未安装,将在测试后卸载" - fi - - # 安装python3-pympress - if [ "$already_installed" = false ]; then - LOG_INFO "安装python3-pympress" - dnf install -y python3-pympress - CHECK_RESULT $? 0 0 "安装python3-pympress失败" - fi - - # 测试计时器功能 - LOG_INFO "测试计时器功能" - pympress --timer 10 - CHECK_RESULT $? 0 0 "计时器功能测试失败" - - # 清理环境(如果之前未安装) - if [ "$already_installed" = false ]; then - LOG_INFO "卸载python3-pympress" - dnf remove -y python3-pympress - CHECK_RESULT $? 0 0 "卸载python3-pympress失败" - fi - - LOG_INFO "测试脚本执行完成" - -} - -main "$@" \ No newline at end of file diff --git a/testcases/function_test/pkg_test/pympress/python3-pympress/test_python3-pympress_function_zoom.sh b/testcases/function_test/pkg_test/pympress/python3-pympress/test_python3-pympress_function_zoom.sh deleted file mode 100644 index f600fec44e4..00000000000 --- a/testcases/function_test/pkg_test/pympress/python3-pympress/test_python3-pympress_function_zoom.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-06 -# @License : Mulan PSL v2 -# @Desc : 测试缩放功能 -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - LOG_INFO "开始测试缩放功能" - - # 检查是否已安装pympress - LOG_INFO "检查是否已安装pympress" - if dnf list installed python3-pympress &> /dev/null; then - LOG_INFO "python3-pympress已安装" - INSTALLED=true - else - LOG_INFO "python3-pympress未安装" - INSTALLED=false - fi - - # 检查yum源中是否有python3-pympress - LOG_INFO "检查yum源中是否有python3-pympress" - if ! dnf list available python3-pympress &> /dev/null; then - LOG_ERROR "yum源中未找到python3-pympress" - exit 255 - fi - - # 如果未安装,则安装python3-pympress - if [ "$INSTALLED" = false ]; then - LOG_INFO "安装python3-pympress" - dnf install -y python3-pympress - CHECK_RESULT $? 0 0 "安装python3-pympress失败" - fi - - # 测试缩放功能 - LOG_INFO "测试缩放功能" - pympress --zoom in &> /dev/null - CHECK_RESULT $? 0 0 "缩放功能测试失败" - - # 恢复环境 - if [ "$INSTALLED" = false ]; then - LOG_INFO "卸载python3-pympress" - dnf remove -y python3-pympress - CHECK_RESULT $? 0 0 "卸载python3-pympress失败" - fi - - LOG_INFO "测试缩放功能完成" -} - -main "$@" \ No newline at end of file diff --git a/testcases/function_test/pkg_test/pympress/python3-pympress/test_python3-pympress_pympress.sh b/testcases/function_test/pkg_test/pympress/python3-pympress/test_python3-pympress_pympress.sh deleted file mode 100644 index 9fd94d3399c..00000000000 --- a/testcases/function_test/pkg_test/pympress/python3-pympress/test_python3-pympress_pympress.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-12-06 -# @License : Mulan PSL v2 -# @Desc : 测试不带任何参数的 pympress 命令 -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - LOG_INFO "开始测试 pympress 命令" - - # 检查是否已安装 pympress - if dnf list installed python3-pympress &>/dev/null; then - LOG_INFO "python3-pympress 已安装" - installed=true - else - LOG_INFO "python3-pympress 未安装" - installed=false - fi - - # 检查 yum 源中是否存在 python3-pympress - LOG_INFO "检查 yum 源中是否存在 python3-pympress" - if ! dnf list available python3-pympress &>/dev/null; then - LOG_ERROR "yum 源中不存在 python3-pympress" - exit 255 - fi - - # 如果未安装,则安装 - if [ "$installed" = false ]; then - LOG_INFO "安装 python3-pympress" - dnf install -y python3-pympress - CHECK_RESULT $? 0 0 "安装 python3-pympress 失败" - fi - - # 测试不带任何参数的 pympress 命令 - LOG_INFO "测试不带任何参数的 pympress 命令" - pympress --help &>/dev/null - CHECK_RESULT $? 0 0 "pympress --help 执行失败" - - # 恢复环境:如果脚本开始时未安装,则卸载 - if [ "$installed" = false ]; then - LOG_INFO "卸载 python3-pympress" - dnf remove -y python3-pympress - CHECK_RESULT $? 0 0 "卸载 python3-pympress 失败" - fi - - LOG_INFO "测试完成" -} - -main "$@" \ No newline at end of file From 2ecb84ece23b3800102d5a1a8c18f568ae3a8130 Mon Sep 17 00:00:00 2001 From: honghua Date: Thu, 23 Apr 2026 12:02:38 +0800 Subject: [PATCH 17/21] update testcase for testsuite texlive-catcodes-doc --- .../texlive-split-d/texlive-catcodes-doc.json | 10 --- ...est_texlive-catcodes-doc_function_basic.sh | 66 ------------------- 2 files changed, 76 deletions(-) delete mode 100644 suite2cases/function_test/pkg_test/texlive-split-d/texlive-catcodes-doc.json delete mode 100644 testcases/function_test/pkg_test/texlive-split-d/texlive-catcodes-doc/test_texlive-catcodes-doc_function_basic.sh diff --git a/suite2cases/function_test/pkg_test/texlive-split-d/texlive-catcodes-doc.json b/suite2cases/function_test/pkg_test/texlive-split-d/texlive-catcodes-doc.json deleted file mode 100644 index 65e026c495f..00000000000 --- a/suite2cases/function_test/pkg_test/texlive-split-d/texlive-catcodes-doc.json +++ /dev/null @@ -1,10 +0,0 @@ -{ - "path": "$OET_PATH/testcases/function_test/pkg_test/texlive-split-d/texlive-catcodes-doc", - "machine num": 1, - "cases": [ - { - "name": "test_texlive-catcodes-doc_function_basic", - "desc": "Test basic functionality of texlive-catcodes-doc" - } - ] -} \ No newline at end of file diff --git a/testcases/function_test/pkg_test/texlive-split-d/texlive-catcodes-doc/test_texlive-catcodes-doc_function_basic.sh b/testcases/function_test/pkg_test/texlive-split-d/texlive-catcodes-doc/test_texlive-catcodes-doc_function_basic.sh deleted file mode 100644 index b8fc0451c99..00000000000 --- a/testcases/function_test/pkg_test/texlive-split-d/texlive-catcodes-doc/test_texlive-catcodes-doc_function_basic.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-11-26 -# @License : Mulan PSL v2 -# @Desc : Test basic functionality of texlive-catcodes-doc -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - # 检查texlive-catcodes-doc软件包是否已安装 - LOG_INFO "检查texlive-catcodes-doc是否已安装" - rpm -q texlive-catcodes-doc > /dev/null 2>&1 - if [ $? -eq 0 ]; then - LOG_INFO "texlive-catcodes-doc已安装,脚本结束后将保持安装状态" - installed=true - else - LOG_INFO "texlive-catcodes-doc未安装,将在测试结束后卸载" - installed=false - fi - - # 检查yum源中是否存在texlive-catcodes-doc软件包 - LOG_INFO "检查yum源中是否存在texlive-catcodes-doc软件包" - dnf list available texlive-catcodes-doc > /dev/null 2>&1 - CHECK_RESULT $? 0 0 "yum源中不存在texlive-catcodes-doc软件包" - if [ $? -ne 0 ]; then - LOG_ERROR "yum源中不存在texlive-catcodes-doc软件包" - exit 255 - fi - - # 安装texlive-catcodes-doc软件包 - if [ "$installed" = false ]; then - LOG_INFO "安装texlive-catcodes-doc软件包" - dnf install -y texlive-catcodes-doc - CHECK_RESULT $? 0 0 "安装texlive-catcodes-doc失败" - fi - - # 测试基本功能 - LOG_INFO "测试texlive-catcodes-doc基本功能" - command_to_test="some_texlive_command" # 替换为实际测试命令 - $command_to_test > /dev/null 2>&1 - CHECK_RESULT $? 0 0 "测试基本功能失败" - - # 清理环境 - if [ "$installed" = false ]; then - LOG_INFO "卸载texlive-catcodes-doc软件包" - dnf remove -y texlive-catcodes-doc - CHECK_RESULT $? 0 0 "卸载texlive-catcodes-doc失败" - fi - - LOG_INFO "测试脚本执行完成" -} - -main "$@" \ No newline at end of file From ad4e5ae5ec0ce6abba2c9f3ca5697c0725223088 Mon Sep 17 00:00:00 2001 From: honghua Date: Thu, 23 Apr 2026 12:02:47 +0800 Subject: [PATCH 18/21] update testcase for testsuite jasypt-javadoc --- .../pkg_test/jasypt/jasypt-javadoc.json | 16 ---- .../test_jasypt-javadoc_function_config.sh | 74 ------------------- .../test_jasypt-javadoc_function_decrypt.sh | 72 ------------------ .../test_jasypt-javadoc_function_encrypt.sh | 70 ------------------ ...est_jasypt-javadoc_function_integration.sh | 65 ---------------- 5 files changed, 297 deletions(-) delete mode 100644 testcases/function_test/pkg_test/jasypt/jasypt-javadoc/test_jasypt-javadoc_function_config.sh delete mode 100644 testcases/function_test/pkg_test/jasypt/jasypt-javadoc/test_jasypt-javadoc_function_decrypt.sh delete mode 100644 testcases/function_test/pkg_test/jasypt/jasypt-javadoc/test_jasypt-javadoc_function_encrypt.sh delete mode 100644 testcases/function_test/pkg_test/jasypt/jasypt-javadoc/test_jasypt-javadoc_function_integration.sh diff --git a/suite2cases/function_test/pkg_test/jasypt/jasypt-javadoc.json b/suite2cases/function_test/pkg_test/jasypt/jasypt-javadoc.json index fe4d5353cac..9defc4b51e1 100644 --- a/suite2cases/function_test/pkg_test/jasypt/jasypt-javadoc.json +++ b/suite2cases/function_test/pkg_test/jasypt/jasypt-javadoc.json @@ -5,22 +5,6 @@ { "name": "test_jasypt-javadoc_function_install", "desc": "Test the installation of jasypt-javadoc package" - }, - { - "name": "test_jasypt-javadoc_function_encrypt", - "desc": "Test the encryption feature of jasypt-javadoc" - }, - { - "name": "test_jasypt-javadoc_function_decrypt", - "desc": "Test the decryption feature of jasypt-javadoc" - }, - { - "name": "test_jasypt-javadoc_function_config", - "desc": "Test configuration loading with jasypt-javadoc" - }, - { - "name": "test_jasypt-javadoc_function_integration", - "desc": "Test integration with other libraries" } ] } \ No newline at end of file diff --git a/testcases/function_test/pkg_test/jasypt/jasypt-javadoc/test_jasypt-javadoc_function_config.sh b/testcases/function_test/pkg_test/jasypt/jasypt-javadoc/test_jasypt-javadoc_function_config.sh deleted file mode 100644 index 3e53b55ed53..00000000000 --- a/testcases/function_test/pkg_test/jasypt/jasypt-javadoc/test_jasypt-javadoc_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-12-03 -# @License : Mulan PSL v2 -# @Desc : Test configuration loading with jasypt-javadoc -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - - # 检查是否已经安装jasypt-javadoc软件包 - LOG_INFO "检查jasypt-javadoc是否已安装..." - if dnf list installed jasypt-javadoc &>/dev/null; then - LOG_INFO "jasypt-javadoc已安装,脚本结束后将保持安装状态。" - INSTALLED=true - else - LOG_INFO "jasypt-javadoc未安装,将在测试完成后卸载。" - INSTALLED=false - fi - - # 检查yum源中是否有jasypt-javadoc软件包 - LOG_INFO "检查yum源中是否有jasypt-javadoc软件包..." - if ! dnf list available jasypt-javadoc &>/dev/null; then - LOG_ERROR "yum源中未找到jasypt-javadoc软件包。" - exit 255 - fi - - # 安装jasypt-javadoc软件包 - if [ "$INSTALLED" = false ]; then - LOG_INFO "正在安装jasypt-javadoc软件包..." - dnf install -y jasypt-javadoc - CHECK_RESULT $? 0 0 "安装jasypt-javadoc失败。" - fi - - # 测试配置加载功能 - LOG_INFO "测试jasypt-javadoc的配置加载功能..." - COMMAND="jasypt-javadoc --config /path/to/config" - $COMMAND &>/dev/null - CHECK_RESULT $? 0 0 "执行命令 "$COMMAND" 失败。" - - # 检查命令参数是否支持 - LOG_INFO "检查命令参数是否支持..." - COMMAND="jasypt-javadoc --invalid-arg" - $COMMAND &>/dev/null - if [ $? -ne 255 ]; then - LOG_ERROR "命令参数 "--invalid-arg" 不应被支持。" - exit 255 - fi - - # 清理环境:如果脚本开始时未安装,则卸载软件包 - if [ "$INSTALLED" = false ]; then - LOG_INFO "正在卸载jasypt-javadoc软件包..." - dnf remove -y jasypt-javadoc - CHECK_RESULT $? 0 0 "卸载jasypt-javadoc失败。" - fi - - LOG_INFO "测试完成,环境已恢复。" - -} - -main "$@" \ No newline at end of file diff --git a/testcases/function_test/pkg_test/jasypt/jasypt-javadoc/test_jasypt-javadoc_function_decrypt.sh b/testcases/function_test/pkg_test/jasypt/jasypt-javadoc/test_jasypt-javadoc_function_decrypt.sh deleted file mode 100644 index 8e2a906aba5..00000000000 --- a/testcases/function_test/pkg_test/jasypt/jasypt-javadoc/test_jasypt-javadoc_function_decrypt.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 : Test the decryption feature of jasypt-javadoc -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - LOG_INFO "开始测试 jasypt-javadoc 的解密功能" - - # 检查软件包是否已安装 - LOG_INFO "检查 jasypt-javadoc 是否已安装" - if dnf list installed jasypt-javadoc &>/dev/null; then - LOG_INFO "jasypt-javadoc 已安装,跳过安装步骤" - INSTALLED=true - else - LOG_INFO "jasypt-javadoc 未安装,准备安装" - INSTALLED=false - fi - - # 检查 yum 源中是否有 jasypt-javadoc - LOG_INFO "检查 yum 源中是否有 jasypt-javadoc" - if ! dnf list available jasypt-javadoc &>/dev/null; then - LOG_ERROR "yum 源中没有 jasypt-javadoc 软件包" - exit 255 - fi - - # 如果未安装,则安装软件包 - if [ "$INSTALLED" = false ]; then - LOG_INFO "正在安装 jasypt-javadoc" - dnf install -y jasypt-javadoc - CHECK_RESULT $? 0 0 "安装 jasypt-javadoc 失败" - fi - - # 测试解密功能 - LOG_INFO "测试解密功能" - jasypt-javadoc --decrypt --input encrypted.txt --output decrypted.txt - CHECK_RESULT $? 0 0 "解密失败" - - # 检查参数是否存在或不支持 - LOG_INFO "检查不支持的参数" - jasypt-javadoc --invalid-arg &>/dev/null - if [ $? -ne 255 ]; then - LOG_ERROR "不支持的参数未正确处理" - exit 255 - fi - - # 清理环境:如果脚本开始时未安装,则卸载软件包 - if [ "$INSTALLED" = false ]; then - LOG_INFO "卸载 jasypt-javadoc" - dnf remove -y jasypt-javadoc - CHECK_RESULT $? 0 0 "卸载 jasypt-javadoc 失败" - fi - - LOG_INFO "测试完成,环境已恢复" -} - -main "$@" \ No newline at end of file diff --git a/testcases/function_test/pkg_test/jasypt/jasypt-javadoc/test_jasypt-javadoc_function_encrypt.sh b/testcases/function_test/pkg_test/jasypt/jasypt-javadoc/test_jasypt-javadoc_function_encrypt.sh deleted file mode 100644 index 510fdf9b5e8..00000000000 --- a/testcases/function_test/pkg_test/jasypt/jasypt-javadoc/test_jasypt-javadoc_function_encrypt.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-03 -# @License : Mulan PSL v2 -# @Desc : Test the encryption feature of jasypt-javadoc -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - LOG_INFO "开始测试jasypt-javadoc的加密功能" - - # 检查是否已安装jasypt-javadoc - LOG_INFO "检查jasypt-javadoc是否已安装" - if dnf list installed jasypt-javadoc &>/dev/null; then - LOG_INFO "jasypt-javadoc已安装,测试完成后将保持安装状态" - installed=true - else - LOG_INFO "jasypt-javadoc未安装,将在测试完成后卸载" - installed=false - fi - - # 检查yum源中是否有jasypt-javadoc - LOG_INFO "检查yum源中是否有jasypt-javadoc" - if ! dnf list available jasypt-javadoc &>/dev/null; then - LOG_ERROR "yum源中未找到jasypt-javadoc软件包" - exit 255 - fi - - # 安装jasypt-javadoc - if [ "$installed" = false ]; then - LOG_INFO "开始安装jasypt-javadoc" - dnf install -y jasypt-javadoc - CHECK_RESULT $? 0 0 "安装jasypt-javadoc失败" - fi - - # 测试加密功能 - LOG_INFO "测试jasypt-javadoc的加密功能" - jasypt_encrypt_output=$(jasypt-javadoc encrypt --input "testdata" --password "testpassword" 2>&1) - if [ $? -ne 0 ]; then - LOG_ERROR "加密命令执行失败: $jasypt_encrypt_output" - exit 255 - fi - CHECK_RESULT $? 0 0 "加密功能测试失败" - - LOG_INFO "加密功能测试成功,输出: $jasypt_encrypt_output" - - # 清理环境 - if [ "$installed" = false ]; then - LOG_INFO "卸载jasypt-javadoc" - dnf remove -y jasypt-javadoc - CHECK_RESULT $? 0 0 "卸载jasypt-javadoc失败" - fi - - LOG_INFO "测试完成,环境已恢复" -} - -main "$@" \ No newline at end of file diff --git a/testcases/function_test/pkg_test/jasypt/jasypt-javadoc/test_jasypt-javadoc_function_integration.sh b/testcases/function_test/pkg_test/jasypt/jasypt-javadoc/test_jasypt-javadoc_function_integration.sh deleted file mode 100644 index 78df860dffe..00000000000 --- a/testcases/function_test/pkg_test/jasypt/jasypt-javadoc/test_jasypt-javadoc_function_integration.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-03 -# @License : Mulan PSL v2 -# @Desc : Test integration with other libraries -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - LOG_INFO "开始测试 jasypt-javadoc 与其他库的集成功能" - - # 检查是否已安装 jasypt-javadoc - LOG_INFO "检查 jasypt-javadoc 是否已安装" - if dnf list installed jasypt-javadoc &>/dev/null; then - LOG_INFO "jasypt-javadoc 已安装,跳过安装步骤" - INSTALLED=true - else - LOG_INFO "jasypt-javadoc 未安装,将进行安装" - INSTALLED=false - fi - - # 检查 yum 源中是否有 jasypt-javadoc - LOG_INFO "检查 yum 源中是否有 jasypt-javadoc" - if ! dnf list available jasypt-javadoc &>/dev/null; then - LOG_ERROR "yum 源中未找到 jasypt-javadoc,退出测试" - exit 255 - fi - - # 如果未安装,则安装 jasypt-javadoc - if [ "$INSTALLED" = false ]; then - LOG_INFO "开始安装 jasypt-javadoc" - dnf install -y jasypt-javadoc - CHECK_RESULT $? 0 0 "安装 jasypt-javadoc 失败" - fi - - # 测试集成功能 - LOG_INFO "测试 jasypt-javadoc 与其他库的集成" - jasypt_command="jasypt-cli.sh --integration-test" #假设命令 - $jasypt_command - CHECK_RESULT $? 0 0 "jasypt-cli 集成测试失败" - - # 清理环境:如果之前未安装,则卸载 jasypt-javadoc - if [ "$INSTALLED" = false ]; then - LOG_INFO "清理环境:卸载 jasypt-javadoc" - dnf remove -y jasypt-javadoc - CHECK_RESULT $? 0 0 "卸载 jasypt-javadoc 失败" - fi - - LOG_INFO "测试 jasypt-javadoc 与其他库的集成功能完成" -} - -main "$@" \ No newline at end of file From 2e15637df4e2e1e0a1473f7b5f6c5d492a87c9b1 Mon Sep 17 00:00:00 2001 From: honghua Date: Thu, 23 Apr 2026 12:03:02 +0800 Subject: [PATCH 19/21] update testcase for testsuite openEuler-gpg-keys --- .../openEuler-repos/openEuler-gpg-keys.json | 22 ----- ...t_openEuler-gpg-keys_function_list_keys.sh | 89 ------------------- ...Euler-gpg-keys_function_package_install.sh | 76 ---------------- ...nEuler-gpg-keys_function_package_remove.sh | 80 ----------------- ..._openEuler-gpg-keys_function_verify_gpg.sh | 69 -------------- 5 files changed, 336 deletions(-) delete mode 100644 suite2cases/function_test/pkg_test/openEuler-repos/openEuler-gpg-keys.json delete mode 100644 testcases/function_test/pkg_test/openEuler-repos/openEuler-gpg-keys/test_openEuler-gpg-keys_function_list_keys.sh delete mode 100644 testcases/function_test/pkg_test/openEuler-repos/openEuler-gpg-keys/test_openEuler-gpg-keys_function_package_install.sh delete mode 100644 testcases/function_test/pkg_test/openEuler-repos/openEuler-gpg-keys/test_openEuler-gpg-keys_function_package_remove.sh delete mode 100644 testcases/function_test/pkg_test/openEuler-repos/openEuler-gpg-keys/test_openEuler-gpg-keys_function_verify_gpg.sh diff --git a/suite2cases/function_test/pkg_test/openEuler-repos/openEuler-gpg-keys.json b/suite2cases/function_test/pkg_test/openEuler-repos/openEuler-gpg-keys.json deleted file mode 100644 index 8e8a5b0de1e..00000000000 --- a/suite2cases/function_test/pkg_test/openEuler-repos/openEuler-gpg-keys.json +++ /dev/null @@ -1,22 +0,0 @@ -{ - "path": "$OET_PATH/testcases/function_test/pkg_test/openEuler-repos/openEuler-gpg-keys", - "machine num": 1, - "cases": [ - { - "name": "test_openEuler-gpg-keys_function_package_install", - "desc": "测试 openEuler-gpg-keys 软件包是否正确安装。" - }, - { - "name": "test_openEuler-gpg-keys_function_verify_gpg", - "desc": "测试使用软件包中的 GPG 密钥验证 openEuler 官方仓库元数据签名。" - }, - { - "name": "test_openEuler-gpg-keys_function_list_keys", - "desc": "测试列出 openEuler-gpg-keys 软件包安装的所有 GPG 公钥。" - }, - { - "name": "test_openEuler-gpg-keys_function_package_remove", - "desc": "测试 openEuler-gpg-keys 软件包的正确卸载。" - } - ] -} \ No newline at end of file diff --git a/testcases/function_test/pkg_test/openEuler-repos/openEuler-gpg-keys/test_openEuler-gpg-keys_function_list_keys.sh b/testcases/function_test/pkg_test/openEuler-repos/openEuler-gpg-keys/test_openEuler-gpg-keys_function_list_keys.sh deleted file mode 100644 index 0525b818310..00000000000 --- a/testcases/function_test/pkg_test/openEuler-repos/openEuler-gpg-keys/test_openEuler-gpg-keys_function_list_keys.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-02-26 -# @License : Mulan PSL v2 -# @Desc : 测试列出 openEuler-gpg-keys 软件包安装的所有 GPG 公钥。 -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - # 定义日志函数 - LOG_INFO() { - echo "[INFO] $1" - } - - LOG_ERROR() { - echo "[ERROR] $1" - } - - # 定义软件包名称 - PACKAGE_NAME="openEuler-gpg-keys" - COMMAND="rpm" - COMMAND_ARGS="-ql" - - # 步骤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:检查环境是否已安装软件包" - rpm -q $PACKAGE_NAME &>/dev/null - if [ $? -eq 0 ]; then - LOG_INFO "软件包 $PACKAGE_NAME 已安装,标记为已安装状态" - INSTALLED=true - else - LOG_INFO "软件包 $PACKAGE_NAME 未安装,标记为未安装状态" - INSTALLED=false - fi - - # 步骤3:如果未安装,则安装软件包 - if [ "$INSTALLED" = false ]; then - LOG_INFO "步骤3:安装软件包 $PACKAGE_NAME" - dnf install -y $PACKAGE_NAME - CHECK_RESULT $? 0 0 "安装软件包 $PACKAGE_NAME 失败" - fi - - # 步骤4:检查命令参数是否支持 - LOG_INFO "步骤4:检查命令参数是否支持" - $COMMAND --help 2>&1 | grep -q "$COMMAND_ARGS" - if [ $? -ne 0 ]; then - LOG_ERROR "命令 $COMMAND 不支持参数 $COMMAND_ARGS" - exit 255 - fi - - # 步骤5:执行列出GPG公钥的命令 - LOG_INFO "步骤5:执行列出GPG公钥的命令" - $COMMAND $COMMAND_ARGS $PACKAGE_NAME | grep -E "\.gpg$|\.asc$" - CHECK_RESULT $? 0 0 "列出 $PACKAGE_NAME 安装的GPG公钥失败" - - # 步骤6:清理环境,恢复到之前的状态 - LOG_INFO "步骤6:清理环境,恢复到之前的状态" - if [ "$INSTALLED" = false ]; 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/openEuler-repos/openEuler-gpg-keys/test_openEuler-gpg-keys_function_package_install.sh b/testcases/function_test/pkg_test/openEuler-repos/openEuler-gpg-keys/test_openEuler-gpg-keys_function_package_install.sh deleted file mode 100644 index d0d274af961..00000000000 --- a/testcases/function_test/pkg_test/openEuler-repos/openEuler-gpg-keys/test_openEuler-gpg-keys_function_package_install.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-26 -# @License : Mulan PSL v2 -# @Desc : 测试 openEuler-gpg-keys 软件包是否正确安装。 -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - PACKAGE_NAME="openEuler-gpg-keys" - LOG_INFO "测试开始:测试openEuler-gpg-keys软件包是否正确安装" - - LOG_INFO "步骤1:检查dnf工具是否可用" - command -v dnf > /dev/null 2>&1 - CHECK_RESULT $? 0 0 "dnf工具不可用" - - LOG_INFO "步骤2:检查软件包是否在yum源中" - dnf list available "$PACKAGE_NAME" > /dev/null 2>&1 - if [ $? -ne 0 ]; then - LOG_ERROR "软件包 $PACKAGE_NAME 不在yum源中" - exit 255 - fi - - LOG_INFO "步骤3:检查软件包当前是否已安装" - rpm -q "$PACKAGE_NAME" > /dev/null 2>&1 - if [ $? -eq 0 ]; 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 "步骤4:安装软件包 $PACKAGE_NAME" - dnf install -y "$PACKAGE_NAME" - CHECK_RESULT $? 0 0 "安装软件包 $PACKAGE_NAME 失败" - fi - - LOG_INFO "步骤5:验证软件包是否正确安装" - rpm -q "$PACKAGE_NAME" > /dev/null 2>&1 - CHECK_RESULT $? 0 0 "软件包 $PACKAGE_NAME 未正确安装" - - LOG_INFO "步骤6:验证软件包文件完整性" - rpm -V "$PACKAGE_NAME" - CHECK_RESULT $? 0 0 "软件包 $PACKAGE_NAME 文件完整性检查失败" - - LOG_INFO "步骤7:检查软件包提供的GPG密钥文件" - rpm -ql "$PACKAGE_NAME" | grep -E "\.(gpg|asc)$" > /dev/null 2>&1 - CHECK_RESULT $? 0 0 "软件包 $PACKAGE_NAME 未提供GPG密钥文件" - - if [ $INSTALLED_BEFORE_TEST -eq 0 ]; then - LOG_INFO "步骤8:清理环境,卸载测试安装的软件包" - dnf remove -y "$PACKAGE_NAME" - CHECK_RESULT $? 0 0 "卸载软件包 $PACKAGE_NAME 失败" - else - LOG_INFO "步骤8:保持环境,不卸载已安装的软件包" - fi - - LOG_INFO "测试完成:openEuler-gpg-keys软件包安装测试通过" -} - -main "$@" \ No newline at end of file diff --git a/testcases/function_test/pkg_test/openEuler-repos/openEuler-gpg-keys/test_openEuler-gpg-keys_function_package_remove.sh b/testcases/function_test/pkg_test/openEuler-repos/openEuler-gpg-keys/test_openEuler-gpg-keys_function_package_remove.sh deleted file mode 100644 index 18a55f032b0..00000000000 --- a/testcases/function_test/pkg_test/openEuler-repos/openEuler-gpg-keys/test_openEuler-gpg-keys_function_package_remove.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-02-26 -# @License : Mulan PSL v2 -# @Desc : 测试 openEuler-gpg-keys 软件包的正确卸载。 -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - LOG_INFO "开始测试 openEuler-gpg-keys 软件包的正确卸载功能。" - - # 检查软件包是否已在yum源中 - LOG_INFO "检查 openEuler-gpg-keys 软件包是否在yum源中。" - dnf list available openEuler-gpg-keys > /dev/null 2>&1 - if [ $? -ne 0 ]; then - LOG_ERROR "yum源中未找到 openEuler-gpg-keys 软件包。" - exit 255 - fi - - # 检查当前软件包是否已安装 - LOG_INFO "检查 openEuler-gpg-keys 软件包是否已安装。" - dnf list installed openEuler-gpg-keys > /dev/null 2>&1 - if [ $? -eq 0 ]; then - LOG_INFO "openEuler-gpg-keys 软件包已安装,标记为已安装状态。" - INSTALLED=1 - else - LOG_INFO "openEuler-gpg-keys 软件包未安装,将进行安装测试。" - INSTALLED=0 - fi - - # 如果未安装,则安装软件包 - if [ $INSTALLED -eq 0 ]; then - LOG_INFO "开始安装 openEuler-gpg-keys 软件包。" - dnf install -y openEuler-gpg-keys - CHECK_RESULT $? 0 0 "安装 openEuler-gpg-keys 软件包失败。" - LOG_INFO "openEuler-gpg-keys 软件包安装成功。" - fi - - # 测试卸载功能 - LOG_INFO "开始卸载 openEuler-gpg-keys 软件包。" - dnf remove -y openEuler-gpg-keys - CHECK_RESULT $? 0 0 "卸载 openEuler-gpg-keys 软件包失败。" - - # 验证软件包是否已卸载 - LOG_INFO "验证 openEuler-gpg-keys 软件包是否已卸载。" - dnf list installed openEuler-gpg-keys > /dev/null 2>&1 - if [ $? -eq 0 ]; then - LOG_ERROR "openEuler-gpg-keys 软件包卸载后仍存在。" - exit 1 - else - LOG_INFO "openEuler-gpg-keys 软件包已成功卸载。" - fi - - # 如果最初未安装,则重新安装以恢复环境 - if [ $INSTALLED -eq 0 ]; then - LOG_INFO "恢复环境:重新安装 openEuler-gpg-keys 软件包。" - dnf install -y openEuler-gpg-keys - CHECK_RESULT $? 0 0 "恢复环境时安装 openEuler-gpg-keys 软件包失败。" - LOG_INFO "环境恢复完成,openEuler-gpg-keys 软件包已重新安装。" - else - LOG_INFO "环境恢复:openEuler-gpg-keys 软件包保持已安装状态。" - fi - - LOG_INFO "openEuler-gpg-keys 软件包的正确卸载功能测试完成。" -} - -main "$@" \ No newline at end of file diff --git a/testcases/function_test/pkg_test/openEuler-repos/openEuler-gpg-keys/test_openEuler-gpg-keys_function_verify_gpg.sh b/testcases/function_test/pkg_test/openEuler-repos/openEuler-gpg-keys/test_openEuler-gpg-keys_function_verify_gpg.sh deleted file mode 100644 index 0d0ac15a82e..00000000000 --- a/testcases/function_test/pkg_test/openEuler-repos/openEuler-gpg-keys/test_openEuler-gpg-keys_function_verify_gpg.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-02-26 -# @License : Mulan PSL v2 -# @Desc : 测试使用软件包中的 GPG 密钥验证 openEuler 官方仓库元数据签名。 -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - LOG_INFO "开始测试:使用软件包中的 GPG 密钥验证 openEuler 官方仓库元数据签名" - - LOG_INFO "步骤1:检查系统中是否已安装 openEuler-gpg-keys 软件包" - rpm -q openEuler-gpg-keys > /dev/null 2>&1 - if [ $? -eq 0 ]; then - LOG_INFO "openEuler-gpg-keys 已安装,测试结束后将保持安装状态" - INSTALLED=1 - else - LOG_INFO "openEuler-gpg-keys 未安装,将在测试过程中安装并最后卸载" - INSTALLED=0 - fi - - LOG_INFO "步骤2:检查 yum 源中是否有 openEuler-gpg-keys 软件包" - dnf list available openEuler-gpg-keys > /dev/null 2>&1 - CHECK_RESULT $? 0 255 "yum 源中未找到 openEuler-gpg-keys 软件包" - - if [ $INSTALLED -eq 0 ]; then - LOG_INFO "步骤3:安装 openEuler-gpg-keys 软件包" - dnf install -y openEuler-gpg-keys - CHECK_RESULT $? 0 0 "安装 openEuler-gpg-keys 失败" - fi - - LOG_INFO "步骤4:检查 gpg 命令是否支持 --list-keys 参数" - gpg --help | grep -q "\-\-list-keys" - CHECK_RESULT $? 0 255 "gpg 命令不支持 --list-keys 参数" - - LOG_INFO "步骤5:列出系统中导入的 GPG 密钥" - gpg --list-keys - CHECK_RESULT $? 0 0 "列出 GPG 密钥失败" - - LOG_INFO "步骤6:验证 openEuler 官方仓库元数据签名" - dnf repolist --verbose | grep -q "gpgcheck" - CHECK_RESULT $? 0 0 "openEuler 官方仓库未启用 GPG 检查" - - LOG_INFO "步骤7:清理环境" - if [ $INSTALLED -eq 0 ]; then - LOG_INFO "卸载 openEuler-gpg-keys 软件包" - dnf remove -y openEuler-gpg-keys - CHECK_RESULT $? 0 0 "卸载 openEuler-gpg-keys 失败" - else - LOG_INFO "保持 openEuler-gpg-keys 安装状态" - fi - - LOG_INFO "测试完成" -} - -main "$@" \ No newline at end of file From 5aaaaface782f8a0cfb051f51d520a63c9cbe5a0 Mon Sep 17 00:00:00 2001 From: honghua Date: Thu, 23 Apr 2026 12:03:15 +0800 Subject: [PATCH 20/21] update testcase for testsuite device-mapper --- .../pkg_test/lvm2/device-mapper.json | 30 ----- .../test_device-mapper_function_check.sh | 75 ------------- ...st_device-mapper_function_create_linear.sh | 91 ---------------- .../test_device-mapper_function_dmsetup.sh | 96 ---------------- .../test_device-mapper_function_install.sh | 69 ------------ .../test_device-mapper_function_remove.sh | 86 --------------- ...st_device-mapper_function_remove_device.sh | 103 ------------------ 7 files changed, 550 deletions(-) delete mode 100644 suite2cases/function_test/pkg_test/lvm2/device-mapper.json delete mode 100644 testcases/function_test/pkg_test/lvm2/device-mapper/test_device-mapper_function_check.sh delete mode 100644 testcases/function_test/pkg_test/lvm2/device-mapper/test_device-mapper_function_create_linear.sh delete mode 100644 testcases/function_test/pkg_test/lvm2/device-mapper/test_device-mapper_function_dmsetup.sh delete mode 100644 testcases/function_test/pkg_test/lvm2/device-mapper/test_device-mapper_function_install.sh delete mode 100644 testcases/function_test/pkg_test/lvm2/device-mapper/test_device-mapper_function_remove.sh delete mode 100644 testcases/function_test/pkg_test/lvm2/device-mapper/test_device-mapper_function_remove_device.sh diff --git a/suite2cases/function_test/pkg_test/lvm2/device-mapper.json b/suite2cases/function_test/pkg_test/lvm2/device-mapper.json deleted file mode 100644 index 439f1c564e4..00000000000 --- a/suite2cases/function_test/pkg_test/lvm2/device-mapper.json +++ /dev/null @@ -1,30 +0,0 @@ -{ - "path": "$OET_PATH/testcases/function_test/pkg_test/lvm2/device-mapper", - "machine num": 1, - "cases": [ - { - "name": "test_device-mapper_function_install", - "desc": "测试device-mapper软件包的安装功能,验证是否能成功安装到系统中" - }, - { - "name": "test_device-mapper_function_check", - "desc": "测试检查device-mapper软件包是否已安装及版本信息" - }, - { - "name": "test_device-mapper_function_remove", - "desc": "测试device-mapper软件包的卸载功能,验证是否能从系统中干净移除" - }, - { - "name": "test_device-mapper_function_dmsetup", - "desc": "测试dmsetup命令的基础功能,如查看设备映射表信息" - }, - { - "name": "test_device-mapper_function_create_linear", - "desc": "测试使用device-mapper创建线性(linear)映射设备" - }, - { - "name": "test_device-mapper_function_remove_device", - "desc": "测试使用dmsetup移除已创建的device-mapper设备" - } - ] -} \ No newline at end of file diff --git a/testcases/function_test/pkg_test/lvm2/device-mapper/test_device-mapper_function_check.sh b/testcases/function_test/pkg_test/lvm2/device-mapper/test_device-mapper_function_check.sh deleted file mode 100644 index d4fe74f493d..00000000000 --- a/testcases/function_test/pkg_test/lvm2/device-mapper/test_device-mapper_function_check.sh +++ /dev/null @@ -1,75 +0,0 @@ -#!/usr/bin/bash - -# Copyright (c) 2024 ISCAS .ALL rights reserved. -# This program is licensed under Mulan PSL v2. -# You can use it according to the terms and conditions of the Mulan PSL v2. -# http://license.coscl.org.cn/MulanPSL2 -# THIS PROGRAM IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, -# EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, -# MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. -# See the Mulan PSL v2 for more details. - -# ############################################# -# @Author : honghua -# @Contact : honghua@iscas.ac.cn -# @Date : 2026-03-29 -# @License : Mulan PSL v2 -# @Desc : 测试检查device-mapper软件包是否已安装及版本信息 -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - set -e - - LOG_INFO "开始测试:检查device-mapper软件包是否已安装及版本信息" - - LOG_INFO "步骤1:检查device-mapper软件包是否在yum源中可用" - if dnf list available device-mapper 2>/dev/null | grep -q device-mapper; then - LOG_INFO "yum源中存在device-mapper软件包" - else - LOG_ERROR "yum源中未找到device-mapper软件包" - exit 255 - fi - - LOG_INFO "步骤2:检查当前环境是否已安装device-mapper" - if rpm -q device-mapper >/dev/null 2>&1; then - LOG_INFO "device-mapper已安装,记录安装状态以便恢复" - INSTALLED=true - else - LOG_INFO "device-mapper未安装,将在测试过程中安装" - INSTALLED=false - fi - - if [ "$INSTALLED" = "false" ]; then - LOG_INFO "步骤3:安装device-mapper软件包" - dnf install -y device-mapper - CHECK_RESULT $? 0 0 "安装device-mapper失败" - fi - - LOG_INFO "步骤4:检查device-mapper版本信息" - rpm -qi device-mapper - CHECK_RESULT $? 0 0 "查询device-mapper版本信息失败" - - LOG_INFO "步骤5:验证dmsetup命令是否可用" - dmsetup version - CHECK_RESULT $? 0 0 "dmsetup命令执行失败" - - LOG_INFO "步骤6:验证dmsetup命令的参数支持" - if dmsetup help 2>&1 | grep -q "version"; then - LOG_INFO "dmsetup命令支持version参数" - else - LOG_ERROR "dmsetup命令不支持version参数" - exit 255 - fi - - if [ "$INSTALLED" = "false" ]; then - LOG_INFO "步骤7:清理环境,卸载测试安装的device-mapper软件包" - dnf remove -y device-mapper - CHECK_RESULT $? 0 0 "卸载device-mapper失败" - fi - - LOG_INFO "测试完成:device-mapper软件包检查及版本信息验证成功" -} - -main "$@" \ No newline at end of file diff --git a/testcases/function_test/pkg_test/lvm2/device-mapper/test_device-mapper_function_create_linear.sh b/testcases/function_test/pkg_test/lvm2/device-mapper/test_device-mapper_function_create_linear.sh deleted file mode 100644 index ae1b3dbad08..00000000000 --- a/testcases/function_test/pkg_test/lvm2/device-mapper/test_device-mapper_function_create_linear.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-03-29 -# @License : Mulan PSL v2 -# @Desc : 测试使用device-mapper创建线性(linear)映射设备 -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - LOG_INFO "开始测试使用device-mapper创建线性(linear)映射设备" - LOG_INFO "检查是否已安装device-mapper相关软件包" - if rpm -q device-mapper device-mapper-libs device-mapper-persistent-data lvm2 > /dev/null 2>&1; then - LOG_INFO "device-mapper相关软件包已安装,测试结束后将保持安装状态" - INSTALLED=true - else - LOG_INFO "device-mapper相关软件包未安装,将在测试过程中安装" - INSTALLED=false - fi - - LOG_INFO "检查yum源中是否有device-mapper相关软件包" - dnf list available device-mapper device-mapper-libs device-mapper-persistent-data lvm2 > /dev/null 2>&1 - CHECK_RESULT $? 0 0 "yum源中缺少device-mapper相关软件包" - if [ $? -ne 0 ]; then - LOG_ERROR "yum源中缺少必要的device-mapper软件包" - exit 255 - fi - - if [ "$INSTALLED" = false ]; then - LOG_INFO "安装device-mapper相关软件包" - dnf install -y device-mapper device-mapper-libs device-mapper-persistent-data lvm2 - CHECK_RESULT $? 0 0 "安装device-mapper软件包失败" - fi - - LOG_INFO "检查系统是否支持device-mapper" - lsmod | grep -q dm_mod - CHECK_RESULT $? 0 0 "系统不支持device-mapper模块" - - LOG_INFO "创建测试用的回环设备" - dd if=/dev/zero of=/tmp/test_dm.img bs=1M count=10 > /dev/null 2>&1 - CHECK_RESULT $? 0 0 "创建测试镜像文件失败" - losetup -f /tmp/test_dm.img - LOOP_DEVICE=$(losetup -j /tmp/test_dm.img | cut -d: -f1) - CHECK_RESULT $? 0 0 "设置回环设备失败" - LOG_INFO "创建的回环设备为: $LOOP_DEVICE" - - LOG_INFO "创建测试用的device-mapper线性映射设备" - echo "0 20480 linear $LOOP_DEVICE 0" | dmsetup create test-linear - CHECK_RESULT $? 0 0 "创建线性映射设备失败" - - LOG_INFO "检查线性映射设备是否创建成功" - dmsetup status test-linear > /dev/null 2>&1 - CHECK_RESULT $? 0 0 "线性映射设备创建后状态检查失败" - - LOG_INFO "验证线性映射设备的基本功能" - ls -l /dev/mapper/test-linear > /dev/null 2>&1 - CHECK_RESULT $? 0 0 "线性映射设备文件不存在" - - LOG_INFO "清理测试创建的device-mapper设备" - dmsetup remove test-linear - CHECK_RESULT $? 0 0 "删除线性映射设备失败" - - LOG_INFO "清理回环设备" - losetup -d $LOOP_DEVICE - CHECK_RESULT $? 0 0 "删除回环设备失败" - rm -f /tmp/test_dm.img - - if [ "$INSTALLED" = false ]; then - LOG_INFO "卸载测试安装的device-mapper软件包" - dnf remove -y device-mapper device-mapper-libs device-mapper-persistent-data lvm2 - CHECK_RESULT $? 0 0 "卸载device-mapper软件包失败" - else - LOG_INFO "保持device-mapper软件包的安装状态" - fi - - LOG_INFO "测试使用device-mapper创建线性映射设备完成" -} - -main "$@" \ No newline at end of file diff --git a/testcases/function_test/pkg_test/lvm2/device-mapper/test_device-mapper_function_dmsetup.sh b/testcases/function_test/pkg_test/lvm2/device-mapper/test_device-mapper_function_dmsetup.sh deleted file mode 100644 index fae18067e64..00000000000 --- a/testcases/function_test/pkg_test/lvm2/device-mapper/test_device-mapper_function_dmsetup.sh +++ /dev/null @@ -1,96 +0,0 @@ -#!/usr/bin/bash - -# Copyright (c) 2024 ISCAS .ALL rights reserved. -# This program is licensed under Mulan PSL v2. -# You can use it according to the terms and conditions of the Mulan PSL v2. -# http://license.coscl.org.cn/MulanPSL2 -# THIS PROGRAM IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, -# EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, -# MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. -# See the Mulan PSL v2 for more details. - -# ############################################# -# @Author : honghua -# @Contact : honghua@iscas.ac.cn -# @Date : 2026-03-29 -# @License : Mulan PSL v2 -# @Desc : 测试dmsetup命令的基础功能,如查看设备映射表信息 -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - set -e - - LOG_INFO "开始测试dmsetup命令基础功能" - - LOG_INFO "检查环境是否已安装device-mapper和dmsetup" - if rpm -q device-mapper dmsetup &>/dev/null; then - LOG_INFO "检测到device-mapper和dmsetup已安装,测试后保持安装状态" - INSTALLED_BEFORE=true - else - LOG_INFO "未检测到device-mapper和dmsetup安装,将在测试中安装" - INSTALLED_BEFORE=false - fi - - LOG_INFO "检查yum源中是否存在device-mapper和dmsetup软件包" - if ! dnf list available device-mapper dmsetup &>/dev/null; then - LOG_ERROR "yum源中未找到device-mapper或dmsetup软件包" - exit 255 - fi - - if [ "$INSTALLED_BEFORE" = "false" ]; then - LOG_INFO "安装device-mapper和dmsetup软件包" - dnf install -y device-mapper dmsetup - CHECK_RESULT $? 0 0 "安装device-mapper和dmsetup失败" - fi - - LOG_INFO "测试dmsetup命令是否存在" - if ! command -v dmsetup &>/dev/null; then - LOG_ERROR "dmsetup命令不存在" - exit 255 - fi - - LOG_INFO "测试dmsetup --help查看帮助信息" - dmsetup --help - CHECK_RESULT $? 0 0 "执行dmsetup --help失败" - - LOG_INFO "测试dmsetup version查看版本信息" - dmsetup version - CHECK_RESULT $? 0 0 "执行dmsetup version失败" - - LOG_INFO "测试dmsetup ls查看设备映射表列表" - dmsetup ls - CHECK_RESULT $? 0 0 "执行dmsetup ls失败" - - LOG_INFO "测试dmsetup info查看设备映射表信息" - dmsetup info - CHECK_RESULT $? 0 0 "执行dmsetup info失败" - - LOG_INFO "测试dmsetup status查看设备映射表状态" - dmsetup status - CHECK_RESULT $? 0 0 "执行dmsetup status失败" - - LOG_INFO "测试dmsetup table查看设备映射表详细信息" - dmsetup table - CHECK_RESULT $? 0 0 "执行dmsetup table失败" - - LOG_INFO "测试dmsetup依赖项命令是否存在" - if ! command -v lsblk &>/dev/null; then - LOG_ERROR "lsblk命令不存在,为dmsetup依赖项" - exit 255 - fi - - LOG_INFO "清理测试环境" - if [ "$INSTALLED_BEFORE" = "false" ]; then - LOG_INFO "卸载测试安装的device-mapper和dmsetup软件包" - dnf remove -y device-mapper dmsetup - CHECK_RESULT $? 0 0 "卸载device-mapper和dmsetup失败" - else - LOG_INFO "环境已安装,保持原状" - fi - - LOG_INFO "dmsetup基础功能测试完成" -} - -main "$@" \ No newline at end of file diff --git a/testcases/function_test/pkg_test/lvm2/device-mapper/test_device-mapper_function_install.sh b/testcases/function_test/pkg_test/lvm2/device-mapper/test_device-mapper_function_install.sh deleted file mode 100644 index fe06eb883a8..00000000000 --- a/testcases/function_test/pkg_test/lvm2/device-mapper/test_device-mapper_function_install.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-29 -# @License : Mulan PSL v2 -# @Desc : 测试device-mapper软件包的安装功能,验证是否能成功安装到系统中 -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - LOG_INFO "开始测试device-mapper软件包的安装功能" - LOG_INFO "步骤1:检查device-mapper软件包是否已在yum源中" - dnf list available device-mapper > /dev/null 2>&1 - if [ $? -ne 0 ]; then - LOG_ERROR "yum源中未找到device-mapper软件包" - exit 255 - fi - LOG_INFO "device-mapper软件包存在于yum源中" - - LOG_INFO "步骤2:检查当前系统是否已安装device-mapper" - rpm -q device-mapper > /dev/null 2>&1 - if [ $? -eq 0 ]; then - LOG_INFO "device-mapper软件包已安装,测试结束后将保持安装状态" - INSTALLED=1 - else - LOG_INFO "device-mapper软件包未安装,将在测试步骤中安装" - INSTALLED=0 - fi - - if [ $INSTALLED -eq 0 ]; then - LOG_INFO "步骤3:使用dnf安装device-mapper软件包" - dnf install -y device-mapper - CHECK_RESULT $? 0 0 "安装device-mapper软件包失败" - LOG_INFO "device-mapper软件包安装成功" - fi - - LOG_INFO "步骤4:验证device-mapper软件包安装成功" - rpm -q device-mapper > /dev/null 2>&1 - CHECK_RESULT $? 0 0 "验证device-mapper软件包安装状态失败" - - LOG_INFO "步骤5:测试device-mapper相关命令是否可用" - dmsetup version > /dev/null 2>&1 - CHECK_RESULT $? 0 0 "dmsetup命令不可用" - - if [ $INSTALLED -eq 0 ]; then - LOG_INFO "步骤6:清理环境,卸载测试安装的device-mapper软件包" - dnf remove -y device-mapper - CHECK_RESULT $? 0 0 "卸载device-mapper软件包失败" - LOG_INFO "device-mapper软件包卸载成功" - else - LOG_INFO "步骤6:环境已安装device-mapper,无需卸载" - fi - - LOG_INFO "测试完成,环境已恢复" -} - -main "$@" \ No newline at end of file diff --git a/testcases/function_test/pkg_test/lvm2/device-mapper/test_device-mapper_function_remove.sh b/testcases/function_test/pkg_test/lvm2/device-mapper/test_device-mapper_function_remove.sh deleted file mode 100644 index aaed1f9adcc..00000000000 --- a/testcases/function_test/pkg_test/lvm2/device-mapper/test_device-mapper_function_remove.sh +++ /dev/null @@ -1,86 +0,0 @@ -#!/usr/bin/bash - -# Copyright (c) 2024 ISCAS .ALL rights reserved. -# This program is licensed under Mulan PSL v2. -# You can use it according to the terms and conditions of the Mulan PSL v2. -# http://license.coscl.org.cn/MulanPSL2 -# THIS PROGRAM IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, -# EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, -# MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. -# See the Mulan PSL v2 for more details. - -# ############################################# -# @Author : honghua -# @Contact : honghua@iscas.ac.cn -# @Date : 2026-03-29 -# @License : Mulan PSL v2 -# @Desc : 测试device-mapper软件包的卸载功能,验证是否能从系统中干净移除 -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - set -e - - LOG_INFO "开始测试device-mapper软件包的卸载功能" - - LOG_INFO "1. 检查当前系统是否已安装device-mapper软件包" - if dnf list installed device-mapper &>/dev/null; then - LOG_INFO "device-mapper软件包已安装,测试结束后将保持安装状态" - ALREADY_INSTALLED=1 - else - LOG_INFO "device-mapper软件包未安装,将在测试过程中安装" - ALREADY_INSTALLED=0 - fi - - LOG_INFO "2. 检查yum源中是否存在device-mapper软件包" - if ! dnf list available device-mapper &>/dev/null; then - LOG_ERROR "yum源中未找到device-mapper软件包" - exit 255 - fi - - LOG_INFO "3. 检查device-mapper软件包卸载命令参数" - if ! dnf help remove &>/dev/null; then - LOG_ERROR "dnf remove命令不存在或不支持" - exit 255 - fi - - if [ $ALREADY_INSTALLED -eq 0 ]; then - LOG_INFO "4. 安装device-mapper软件包作为测试准备" - dnf install -y device-mapper - CHECK_RESULT $? 0 0 "安装device-mapper软件包失败" - fi - - LOG_INFO "5. 验证device-mapper软件包已正确安装" - dnf list installed device-mapper - CHECK_RESULT $? 0 0 "验证device-mapper安装状态失败" - - LOG_INFO "6. 执行device-mapper软件包卸载测试" - dnf remove -y device-mapper - CHECK_RESULT $? 0 0 "卸载device-mapper软件包失败" - - LOG_INFO "7. 验证device-mapper软件包已完全移除" - if dnf list installed device-mapper &>/dev/null; then - LOG_ERROR "device-mapper软件包卸载不干净" - exit 1 - else - LOG_INFO "device-mapper软件包已成功从系统中移除" - fi - - LOG_INFO "8. 环境清理和恢复" - if [ $ALREADY_INSTALLED -eq 0 ]; then - LOG_INFO "测试前未安装,无需恢复安装状态" - else - LOG_INFO "恢复device-mapper软件包安装状态" - dnf install -y device-mapper - CHECK_RESULT $? 0 0 "恢复安装device-mapper软件包失败" - - LOG_INFO "验证恢复后的安装状态" - dnf list installed device-mapper - CHECK_RESULT $? 0 0 "验证恢复后的安装状态失败" - fi - - LOG_INFO "device-mapper软件包卸载功能测试完成" -} - -main "$@" \ No newline at end of file diff --git a/testcases/function_test/pkg_test/lvm2/device-mapper/test_device-mapper_function_remove_device.sh b/testcases/function_test/pkg_test/lvm2/device-mapper/test_device-mapper_function_remove_device.sh deleted file mode 100644 index 9ba500f465c..00000000000 --- a/testcases/function_test/pkg_test/lvm2/device-mapper/test_device-mapper_function_remove_device.sh +++ /dev/null @@ -1,103 +0,0 @@ -#!/usr/bin/bash - -# Copyright (c) 2024 ISCAS .ALL rights reserved. -# This program is licensed under Mulan PSL v2. -# You can use it according to the terms and conditions of the Mulan PSL v2. -# http://license.coscl.org.cn/MulanPSL2 -# THIS PROGRAM IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, -# EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, -# MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. -# See the Mulan PSL v2 for more details. - -# ############################################# -# @Author : honghua -# @Contact : honghua@iscas.ac.cn -# @Date : 2026-03-29 -# @License : Mulan PSL v2 -# @Desc : 测试使用dmsetup移除已创建的device-mapper设备 -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - LOG_INFO "开始测试:使用dmsetup移除已创建的device-mapper设备" - - LOG_INFO "步骤1:检查环境是否已安装device-mapper相关软件包" - if dnf list installed device-mapper* &>/dev/null; then - LOG_INFO "环境已安装device-mapper相关软件包,脚本结束时将保持安装状态" - INSTALLED=1 - else - LOG_INFO "环境未安装device-mapper相关软件包,将在测试过程中安装" - INSTALLED=0 - fi - - LOG_INFO "步骤2:检查yum源中是否有device-mapper软件包" - if ! dnf list available device-mapper &>/dev/null; then - LOG_ERROR "yum源中未找到device-mapper软件包,退出测试" - exit 255 - fi - - if ! dnf list available device-mapper-devel &>/dev/null; then - LOG_ERROR "yum源中未找到device-mapper-devel软件包,退出测试" - exit 255 - fi - - if [ $INSTALLED -eq 0 ]; then - LOG_INFO "步骤3:安装device-mapper相关软件包" - dnf install -y device-mapper device-mapper-devel - CHECK_RESULT $? 0 0 "安装device-mapper软件包失败" - fi - - LOG_INFO "步骤4:加载device-mapper内核模块" - modprobe dm_mod - CHECK_RESULT $? 0 0 "加载device-mapper内核模块失败" - - LOG_INFO "步骤5:创建测试用的回环设备" - dd if=/dev/zero of=/tmp/test_dm.img bs=1M count=10 - CHECK_RESULT $? 0 0 "创建测试镜像文件失败" - - losetup -f /tmp/test_dm.img - CHECK_RESULT $? 0 0 "创建回环设备失败" - - LOOP_DEVICE=$(losetup -j /tmp/test_dm.img | cut -d: -f1) - LOG_INFO "创建的回环设备为:$LOOP_DEVICE" - - LOG_INFO "步骤6:创建device-mapper设备" - echo "0 20480 linear $LOOP_DEVICE 0" | dmsetup create test_dm - CHECK_RESULT $? 0 0 "创建device-mapper设备失败" - - LOG_INFO "步骤7:检查device-mapper设备是否创建成功" - dmsetup info test_dm - CHECK_RESULT $? 0 0 "device-mapper设备创建后检查失败" - - LOG_INFO "步骤8:使用dmsetup移除device-mapper设备" - dmsetup remove test_dm - CHECK_RESULT $? 0 0 "移除device-mapper设备失败" - - LOG_INFO "步骤9:验证device-mapper设备是否已移除" - if dmsetup info test_dm &>/dev/null; then - LOG_ERROR "device-mapper设备移除失败" - exit 1 - else - LOG_INFO "device-mapper设备已成功移除" - fi - - LOG_INFO "步骤10:清理测试环境" - if [ -n "$LOOP_DEVICE" ]; then - losetup -d $LOOP_DEVICE - CHECK_RESULT $? 0 0 "删除回环设备失败" - fi - - rm -f /tmp/test_dm.img - CHECK_RESULT $? 0 0 "删除测试镜像文件失败" - - if [ $INSTALLED -eq 0 ]; then - LOG_INFO "步骤11:卸载测试期间安装的软件包" - dnf remove -y device-mapper device-mapper-devel - CHECK_RESULT $? 0 0 "卸载device-mapper软件包失败" - fi - - LOG_INFO "步骤12:测试完成,环境已恢复" -} - -main "$@" \ No newline at end of file From b5ece9fce72da086199717b64d67e4f437448123 Mon Sep 17 00:00:00 2001 From: honghua Date: Thu, 23 Apr 2026 12:03:35 +0800 Subject: [PATCH 21/21] update testcase for testsuite nodejs-lodash-isnan --- .../pkg_test/lodash/nodejs-lodash-isnan.json | 36 ----- ...test_nodejs-lodash-isnan_function_check.sh | 134 ------------------ ...t_nodejs-lodash-isnan_function_infinity.sh | 72 ---------- ...st_nodejs-lodash-isnan_function_install.sh | 74 ---------- .../test_nodejs-lodash-isnan_function_null.sh | 79 ----------- ...est_nodejs-lodash-isnan_function_number.sh | 98 ------------- ...est_nodejs-lodash-isnan_function_object.sh | 88 ------------ ...st_nodejs-lodash-isnan_function_require.sh | 121 ---------------- ...est_nodejs-lodash-isnan_function_string.sh | 76 ---------- ..._nodejs-lodash-isnan_function_undefined.sh | 89 ------------ 10 files changed, 867 deletions(-) delete mode 100644 testcases/function_test/pkg_test/lodash/nodejs-lodash-isnan/test_nodejs-lodash-isnan_function_check.sh delete mode 100644 testcases/function_test/pkg_test/lodash/nodejs-lodash-isnan/test_nodejs-lodash-isnan_function_infinity.sh delete mode 100644 testcases/function_test/pkg_test/lodash/nodejs-lodash-isnan/test_nodejs-lodash-isnan_function_install.sh delete mode 100644 testcases/function_test/pkg_test/lodash/nodejs-lodash-isnan/test_nodejs-lodash-isnan_function_null.sh delete mode 100644 testcases/function_test/pkg_test/lodash/nodejs-lodash-isnan/test_nodejs-lodash-isnan_function_number.sh delete mode 100644 testcases/function_test/pkg_test/lodash/nodejs-lodash-isnan/test_nodejs-lodash-isnan_function_object.sh delete mode 100644 testcases/function_test/pkg_test/lodash/nodejs-lodash-isnan/test_nodejs-lodash-isnan_function_require.sh delete mode 100644 testcases/function_test/pkg_test/lodash/nodejs-lodash-isnan/test_nodejs-lodash-isnan_function_string.sh delete mode 100644 testcases/function_test/pkg_test/lodash/nodejs-lodash-isnan/test_nodejs-lodash-isnan_function_undefined.sh diff --git a/suite2cases/function_test/pkg_test/lodash/nodejs-lodash-isnan.json b/suite2cases/function_test/pkg_test/lodash/nodejs-lodash-isnan.json index 0fb19b583e3..b8e25fdd9b0 100644 --- a/suite2cases/function_test/pkg_test/lodash/nodejs-lodash-isnan.json +++ b/suite2cases/function_test/pkg_test/lodash/nodejs-lodash-isnan.json @@ -2,42 +2,6 @@ "path": "$OET_PATH/testcases/function_test/pkg_test/lodash/nodejs-lodash-isnan", "machine num": 1, "cases": [ - { - "name": "test_nodejs-lodash-isnan_function_install", - "desc": "Test the installation of the nodejs-lodash-isnan package." - }, - { - "name": "test_nodejs-lodash-isnan_function_check", - "desc": "Test the basic function of checking if a value is NaN." - }, - { - "name": "test_nodejs-lodash-isnan_function_number", - "desc": "Test that a regular number is not identified as NaN." - }, - { - "name": "test_nodejs-lodash-isnan_function_string", - "desc": "Test that a non-numeric string is not identified as NaN." - }, - { - "name": "test_nodejs-lodash-isnan_function_undefined", - "desc": "Test that undefined is not identified as NaN." - }, - { - "name": "test_nodejs-lodash-isnan_function_null", - "desc": "Test that null is not identified as NaN." - }, - { - "name": "test_nodejs-lodash-isnan_function_infinity", - "desc": "Test that Infinity is not identified as NaN." - }, - { - "name": "test_nodejs-lodash-isnan_function_object", - "desc": "Test that an object is not identified as NaN." - }, - { - "name": "test_nodejs-lodash-isnan_function_require", - "desc": "Test the ability to require the lodash.isnan module in a script." - }, { "name": "test_nodejs-lodash-isnan_function_uninstall", "desc": "Test the uninstallation of the nodejs-lodash-isnan package." diff --git a/testcases/function_test/pkg_test/lodash/nodejs-lodash-isnan/test_nodejs-lodash-isnan_function_check.sh b/testcases/function_test/pkg_test/lodash/nodejs-lodash-isnan/test_nodejs-lodash-isnan_function_check.sh deleted file mode 100644 index 6fb862e3269..00000000000 --- a/testcases/function_test/pkg_test/lodash/nodejs-lodash-isnan/test_nodejs-lodash-isnan_function_check.sh +++ /dev/null @@ -1,134 +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 : Test the basic function of checking if a value is NaN. -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - LOG_INFO "开始测试lodash的isNaN函数基本功能" - - # 检查是否已安装nodejs和npm - LOG_INFO "检查是否已安装nodejs和npm" - if command -v node &> /dev/null && command -v npm &> /dev/null; then - LOG_INFO "nodejs和npm已安装" - already_installed=true - else - LOG_INFO "nodejs和npm未安装" - already_installed=false - fi - - # 检查yum源中是否有nodejs软件包 - LOG_INFO "检查yum源中是否有nodejs软件包" - if ! dnf list available nodejs &> /dev/null; then - LOG_ERROR "yum源中没有nodejs软件包" - exit 255 - fi - - if ! dnf list available npm &> /dev/null; then - LOG_ERROR "yum源中没有npm软件包" - exit 255 - fi - - # 如果未安装,则安装nodejs和npm - if [ "$already_installed" = false ]; then - LOG_INFO "安装nodejs和npm" - dnf install -y nodejs npm - CHECK_RESULT $? 0 0 "安装nodejs和npm失败" - fi - - # 创建测试目录 - LOG_INFO "创建测试目录" - test_dir="/tmp/test_lodash_isnan" - mkdir -p "$test_dir" - cd "$test_dir" || exit 1 - - # 初始化npm项目 - LOG_INFO "初始化npm项目" - npm init -y - CHECK_RESULT $? 0 0 "npm初始化失败" - - # 安装lodash - LOG_INFO "安装lodash" - npm install lodash - CHECK_RESULT $? 0 0 "安装lodash失败" - - # 创建测试脚本 - LOG_INFO "创建测试脚本" - cat > test_isnan.js << "EOF" - const _ = require("lodash"); - - console.log("测试lodash的isNaN函数:"); - - // 测试用例 - const testCases = [ - { value: NaN, expected: true }, - { value: 0 / 0, expected: true }, - { value: Number.NaN, expected: true }, - { value: 123, expected: false }, - { value: "123", expected: false }, - { value: "hello", expected: false }, - { value: undefined, expected: false }, - { value: null, expected: false }, - { value: Infinity, expected: false }, - { value: -Infinity, expected: false } - ]; - - let allPassed = true; - - testCases.forEach((testCase, index) => { - const result = _.isNaN(testCase.value); - const passed = result === testCase.expected; - - if (!passed) { - allPassed = false; - console.log(`测试用例 ${index + 1} 失败: _.isNaN(${testCase.value}) = ${result}, 期望: ${testCase.expected}`); - } - }); - - if (allPassed) { - console.log("所有测试用例通过!"); - process.exit(0); - } else { - console.log("部分测试用例失败!"); - process.exit(1); - } - EOF - - # 运行测试脚本 - LOG_INFO "运行lodash isNaN函数测试" - node test_isnan.js - CHECK_RESULT $? 0 0 "lodash isNaN函数测试失败" - - # 清理测试目录 - LOG_INFO "清理测试目录" - cd /tmp && rm -rf "$test_dir" - - # 如果测试前未安装,则卸载nodejs和npm - if [ "$already_installed" = false ]; then - LOG_INFO "卸载nodejs和npm" - dnf remove -y nodejs npm - CHECK_RESULT $? 0 0 "卸载nodejs和npm失败" - LOG_INFO "环境已恢复到测试前状态" - else - LOG_INFO "保持nodejs和npm安装状态" - fi - - LOG_INFO "lodash的isNaN函数基本功能测试完成" -} - -main "$@" \ No newline at end of file diff --git a/testcases/function_test/pkg_test/lodash/nodejs-lodash-isnan/test_nodejs-lodash-isnan_function_infinity.sh b/testcases/function_test/pkg_test/lodash/nodejs-lodash-isnan/test_nodejs-lodash-isnan_function_infinity.sh deleted file mode 100644 index 60eb80cadb4..00000000000 --- a/testcases/function_test/pkg_test/lodash/nodejs-lodash-isnan/test_nodejs-lodash-isnan_function_infinity.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 : 2026-03-18 -# @License : Mulan PSL v2 -# @Desc : Test that Infinity is not identified as NaN. -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - set -e - - LOG_INFO "开始测试:Test that Infinity is not identified as NaN." - - LOG_INFO "步骤1:检查测试环境是否已安装nodejs-lodash-isnan软件包" - if dnf list installed nodejs-lodash-isnan &>/dev/null; then - LOG_INFO "环境已安装nodejs-lodash-isnan软件包,测试结束后将保持安装状态。" - ENV_PREINSTALLED=true - else - LOG_INFO "环境未安装nodejs-lodash-isnan软件包,将作为测试步骤安装。" - ENV_PREINSTALLED=false - fi - - LOG_INFO "步骤2:检查yum源中是否存在nodejs-lodash-isnan软件包" - if ! dnf list available nodejs-lodash-isnan &>/dev/null; then - LOG_ERROR "yum源中未找到nodejs-lodash-isnan软件包。" - exit 255 - fi - - if [ "$ENV_PREINSTALLED" = "false" ]; then - LOG_INFO "步骤3:安装nodejs-lodash-isnan软件包" - dnf install -y nodejs-lodash-isnan - CHECK_RESULT $? 0 0 "安装nodejs-lodash-isnan软件包失败" - fi - - LOG_INFO "步骤4:验证nodejs-lodash-isnan模块功能,测试Infinity不应被识别为NaN" - NODE_SCRIPT=$(cat <<"EOF" - const _ = require("lodash"); - const isNanResult = _.isNaN(Infinity); - console.log(isNanResult ? "true" : "false"); - EOF - ) - RESULT=$(node -e "$NODE_SCRIPT") - EXPECTED="false" - CHECK_RESULT "$?" 0 0 "执行Node.js脚本失败" - CHECK_RESULT "$RESULT" "$EXPECTED" 0 "测试失败:Infinity被错误地识别为NaN。实际结果:$RESULT,预期结果:$EXPECTED" - - LOG_INFO "步骤5:环境清理与恢复" - if [ "$ENV_PREINSTALLED" = "false" ]; then - LOG_INFO "卸载测试安装的nodejs-lodash-isnan软件包" - dnf remove -y nodejs-lodash-isnan - CHECK_RESULT $? 0 0 "卸载nodejs-lodash-isnan软件包失败" - else - LOG_INFO "测试环境已预装软件包,保持安装状态,无需卸载。" - fi - - LOG_INFO "测试完成:Test that Infinity is not identified as NaN." -} - -main "$@" \ No newline at end of file diff --git a/testcases/function_test/pkg_test/lodash/nodejs-lodash-isnan/test_nodejs-lodash-isnan_function_install.sh b/testcases/function_test/pkg_test/lodash/nodejs-lodash-isnan/test_nodejs-lodash-isnan_function_install.sh deleted file mode 100644 index 5f4334d7606..00000000000 --- a/testcases/function_test/pkg_test/lodash/nodejs-lodash-isnan/test_nodejs-lodash-isnan_function_install.sh +++ /dev/null @@ -1,74 +0,0 @@ -#!/usr/bin/bash - -# Copyright (c) 2024 ISCAS .ALL rights reserved. -# This program is licensed under Mulan PSL v2. -# You can use it according to the terms and conditions of the Mulan PSL v2. -# http://license.coscl.org.cn/MulanPSL2 -# THIS PROGRAM IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, -# EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, -# MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. -# See the Mulan PSL v2 for more details. - -# ############################################# -# @Author : honghua -# @Contact : honghua@iscas.ac.cn -# @Date : 2026-03-18 -# @License : Mulan PSL v2 -# @Desc : Test the installation of the nodejs-lodash-isnan package. -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - # 判断是否已安装nodejs-lodash-isnan软件包 - LOG_INFO "检查nodejs-lodash-isnan软件包是否已安装" - rpm -q nodejs-lodash-isnan >/dev/null 2>&1 - if [ $? -eq 0 ]; then - LOG_INFO "nodejs-lodash-isnan软件包已安装,标记为已存在" - PACKAGE_INSTALLED="true" - else - LOG_INFO "nodejs-lodash-isnan软件包未安装" - PACKAGE_INSTALLED="false" - fi - - # 检查yum源中是否存在nodejs-lodash-isnan软件包 - LOG_INFO "检查yum源中是否存在nodejs-lodash-isnan软件包" - dnf list available nodejs-lodash-isnan >/dev/null 2>&1 - if [ $? -ne 0 ]; then - LOG_ERROR "yum源中未找到nodejs-lodash-isnan软件包" - exit 255 - fi - LOG_INFO "yum源中存在nodejs-lodash-isnan软件包" - - # 如果未安装,则安装软件包 - if [ "$PACKAGE_INSTALLED" = "false" ]; then - LOG_INFO "开始安装nodejs-lodash-isnan软件包" - dnf install -y nodejs-lodash-isnan - CHECK_RESULT $? 0 0 "安装nodejs-lodash-isnan软件包失败" - LOG_INFO "nodejs-lodash-isnan软件包安装成功" - fi - - # 验证软件包是否安装成功 - LOG_INFO "验证nodejs-lodash-isnan软件包是否安装成功" - rpm -q nodejs-lodash-isnan >/dev/null 2>&1 - CHECK_RESULT $? 0 0 "nodejs-lodash-isnan软件包未正确安装" - - # 验证软件包功能 - LOG_INFO "验证nodejs-lodash-isnan软件包功能" - npm list lodash.isnan >/dev/null 2>&1 - CHECK_RESULT $? 0 0 "nodejs-lodash-isnan软件包功能验证失败" - - # 清理环境:如果测试前未安装,则卸载软件包 - if [ "$PACKAGE_INSTALLED" = "false" ]; then - LOG_INFO "清理环境:卸载nodejs-lodash-isnan软件包" - dnf remove -y nodejs-lodash-isnan - CHECK_RESULT $? 0 0 "卸载nodejs-lodash-isnan软件包失败" - LOG_INFO "nodejs-lodash-isnan软件包卸载成功" - else - LOG_INFO "测试前已安装nodejs-lodash-isnan,保持安装状态" - fi - - LOG_INFO "测试完成:nodejs-lodash-isnan软件包安装测试成功" -} - -main "$@" \ No newline at end of file diff --git a/testcases/function_test/pkg_test/lodash/nodejs-lodash-isnan/test_nodejs-lodash-isnan_function_null.sh b/testcases/function_test/pkg_test/lodash/nodejs-lodash-isnan/test_nodejs-lodash-isnan_function_null.sh deleted file mode 100644 index 147fdacb80c..00000000000 --- a/testcases/function_test/pkg_test/lodash/nodejs-lodash-isnan/test_nodejs-lodash-isnan_function_null.sh +++ /dev/null @@ -1,79 +0,0 @@ -#!/usr/bin/bash - -# Copyright (c) 2024 ISCAS .ALL rights reserved. -# This program is licensed under Mulan PSL v2. -# You can use it according to the terms and conditions of the Mulan PSL v2. -# http://license.coscl.org.cn/MulanPSL2 -# THIS PROGRAM IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, -# EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, -# MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. -# See the Mulan PSL v2 for more details. - -# ############################################# -# @Author : honghua -# @Contact : honghua@iscas.ac.cn -# @Date : 2026-03-18 -# @License : Mulan PSL v2 -# @Desc : Test that null is not identified as NaN. -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - LOG_INFO "测试开始:验证null不被识别为NaN" - LOG_INFO "步骤1:检查nodejs-lodash-isnan软件包是否在yum源中" - dnf list available nodejs-lodash-isnan &> /dev/null - if [ $? -ne 0 ]; then - LOG_ERROR "yum源中未找到nodejs-lodash-isnan软件包" - exit 255 - fi - - LOG_INFO "步骤2:检查当前环境是否已安装nodejs-lodash-isnan" - if dnf list installed nodejs-lodash-isnan &> /dev/null; then - LOG_INFO "软件包已安装,标记为无需卸载" - NEED_CLEANUP=0 - else - LOG_INFO "软件包未安装,标记为需要安装和卸载" - NEED_CLEANUP=1 - LOG_INFO "步骤3:安装nodejs-lodash-isnan软件包" - dnf install -y nodejs-lodash-isnan - CHECK_RESULT $? 0 0 "安装nodejs-lodash-isnan失败" - fi - - LOG_INFO "步骤4:验证null不被识别为NaN" - LOG_INFO "创建测试脚本test_nan.js" - cat > test_nan.js << "EOF" - const _ = require("lodash"); - console.log(_.isNaN(null)); - EOF - - LOG_INFO "执行测试脚本" - node test_nan.js - CHECK_RESULT $? 0 0 "执行node脚本失败" - - LOG_INFO "步骤5:检查输出结果" - output=$(node test_nan.js) - expected="false" - if [ "$output" != "$expected" ]; then - LOG_ERROR "测试失败:null被错误地识别为NaN" - exit 1 - else - LOG_INFO "测试成功:null未被识别为NaN" - fi - - LOG_INFO "步骤6:清理临时文件" - rm -f test_nan.js - - LOG_INFO "步骤7:环境恢复" - if [ $NEED_CLEANUP -eq 1 ]; then - LOG_INFO "卸载nodejs-lodash-isnan软件包" - dnf remove -y nodejs-lodash-isnan - CHECK_RESULT $? 0 0 "卸载nodejs-lodash-isnan失败" - else - LOG_INFO "保持软件包安装状态" - fi - - LOG_INFO "测试结束" -} - -main "$@" \ No newline at end of file diff --git a/testcases/function_test/pkg_test/lodash/nodejs-lodash-isnan/test_nodejs-lodash-isnan_function_number.sh b/testcases/function_test/pkg_test/lodash/nodejs-lodash-isnan/test_nodejs-lodash-isnan_function_number.sh deleted file mode 100644 index 1cb04e755af..00000000000 --- a/testcases/function_test/pkg_test/lodash/nodejs-lodash-isnan/test_nodejs-lodash-isnan_function_number.sh +++ /dev/null @@ -1,98 +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 : Test that a regular number is not identified as NaN. -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - set -e - - LOG_INFO "检查nodejs-lodash-isnan软件包是否在yum源中" - if ! dnf list available nodejs-lodash-isnan 2>/dev/null | grep -q "nodejs-lodash-isnan"; then - LOG_ERROR "yum源中未找到nodejs-lodash-isnan软件包" - exit 255 - fi - - LOG_INFO "检查nodejs软件包是否已安装" - if rpm -q nodejs >/dev/null 2>&1; then - LOG_INFO "nodejs已安装,标记为环境已安装" - ENV_INSTALLED=1 - else - LOG_INFO "nodejs未安装,标记为环境未安装" - ENV_INSTALLED=0 - fi - - LOG_INFO "检查lodash.isnan模块是否已安装" - if [ $ENV_INSTALLED -eq 1 ] && npm list -g lodash.isnan >/dev/null 2>&1; then - LOG_INFO "lodash.isnan已安装,标记为模块已安装" - MODULE_INSTALLED=1 - else - LOG_INFO "lodash.isnan未安装,标记为模块未安装" - MODULE_INSTALLED=0 - fi - - if [ $ENV_INSTALLED -eq 0 ]; then - LOG_INFO "安装nodejs软件包" - dnf install -y nodejs - CHECK_RESULT $? 0 0 "安装nodejs失败" - fi - - if [ $MODULE_INSTALLED -eq 0 ]; then - LOG_INFO "全局安装lodash.isnan模块" - npm install -g lodash.isnan - CHECK_RESULT $? 0 0 "安装lodash.isnan模块失败" - fi - - LOG_INFO "创建测试JavaScript脚本" - cat > test_nan.js << "EOF" - const isNaN = require("lodash.isnan"); - console.log("Testing regular number 42:"); - console.log("isNaN(42) =", isNaN(42)); - if (!isNaN(42)) { - console.log("PASS: 42 is correctly identified as NOT NaN"); - process.exit(0); - } else { - console.log("FAIL: 42 is incorrectly identified as NaN"); - process.exit(1); - } - EOF - - LOG_INFO "执行测试脚本,验证常规数字42不被识别为NaN" - node test_nan.js - CHECK_RESULT $? 0 0 "测试失败:常规数字被错误识别为NaN" - - LOG_INFO "清理临时测试文件" - rm -f test_nan.js - - LOG_INFO "环境恢复:卸载测试安装的软件包" - if [ $MODULE_INSTALLED -eq 0 ]; then - LOG_INFO "卸载lodash.isnan模块" - npm uninstall -g lodash.isnan - CHECK_RESULT $? 0 0 "卸载lodash.isnan模块失败" - fi - - if [ $ENV_INSTALLED -eq 0 ]; then - LOG_INFO "卸载nodejs软件包" - dnf remove -y nodejs - CHECK_RESULT $? 0 0 "卸载nodejs失败" - fi - - LOG_INFO "测试完成,环境已恢复" -} - -main "$@" \ No newline at end of file diff --git a/testcases/function_test/pkg_test/lodash/nodejs-lodash-isnan/test_nodejs-lodash-isnan_function_object.sh b/testcases/function_test/pkg_test/lodash/nodejs-lodash-isnan/test_nodejs-lodash-isnan_function_object.sh deleted file mode 100644 index 216deafebab..00000000000 --- a/testcases/function_test/pkg_test/lodash/nodejs-lodash-isnan/test_nodejs-lodash-isnan_function_object.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-03-18 -# @License : Mulan PSL v2 -# @Desc : Test that an object is not identified as NaN. -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - LOG_INFO "开始测试: Test that an object is not identified as NaN." - - LOG_INFO "步骤1: 检查是否已安装nodejs-lodash-isnan软件包" - if dnf list installed nodejs-lodash-isnan &>/dev/null; then - LOG_INFO "nodejs-lodash-isnan已安装,测试结束后将保持安装状态" - ALREADY_INSTALLED=true - else - LOG_INFO "nodejs-lodash-isnan未安装,将在测试过程中安装" - ALREADY_INSTALLED=false - fi - - LOG_INFO "步骤2: 检查yum源中是否有nodejs-lodash-isnan软件包" - if ! dnf list available nodejs-lodash-isnan &>/dev/null; then - LOG_ERROR "yum源中未找到nodejs-lodash-isnan软件包" - exit 255 - fi - - if [ "$ALREADY_INSTALLED" = false ]; then - LOG_INFO "步骤3: 安装nodejs-lodash-isnan软件包" - dnf install -y nodejs-lodash-isnan - CHECK_RESULT $? 0 0 "安装nodejs-lodash-isnan失败" - fi - - LOG_INFO "步骤4: 验证_.isNaN函数对非NaN对象的识别" - node -e " - const _ = require("lodash"); - console.log("Testing _.isNaN with non-NaN objects:"); - const testCases = [ - { value: {}, expected: false }, - { value: { a: 1 }, expected: false }, - { value: new Object(), expected: false }, - { value: null, expected: false }, - { value: undefined, expected: false }, - { value: 0, expected: false }, - { value: "string", expected: false }, - { value: true, expected: false }, - { value: [], expected: false }, - { value: function(){}, expected: false } - ]; - let allPassed = true; - testCases.forEach(({value, expected}) => { - const result = _.isNaN(value); - if (result !== expected) { - console.error(\`FAIL: _.isNaN(\${JSON.stringify(value)}) returned \${result}, expected \${expected}\`); - allPassed = false; - } else { - console.log(\`PASS: _.isNaN(\${JSON.stringify(value)}) returned \${result}\`); - } - }); - process.exit(allPassed ? 0 : 1); - " - CHECK_RESULT $? 0 0 "_.isNaN函数未能正确识别非NaN对象" - - LOG_INFO "步骤5: 清理测试环境" - if [ "$ALREADY_INSTALLED" = false ]; then - LOG_INFO "卸载nodejs-lodash-isnan软件包" - dnf remove -y nodejs-lodash-isnan - CHECK_RESULT $? 0 0 "卸载nodejs-lodash-isnan失败" - else - LOG_INFO "保持nodejs-lodash-isnan软件包安装状态" - fi - - LOG_INFO "测试完成: Test that an object is not identified as NaN." -} - -main "$@" \ No newline at end of file diff --git a/testcases/function_test/pkg_test/lodash/nodejs-lodash-isnan/test_nodejs-lodash-isnan_function_require.sh b/testcases/function_test/pkg_test/lodash/nodejs-lodash-isnan/test_nodejs-lodash-isnan_function_require.sh deleted file mode 100644 index fdeddf3c2ed..00000000000 --- a/testcases/function_test/pkg_test/lodash/nodejs-lodash-isnan/test_nodejs-lodash-isnan_function_require.sh +++ /dev/null @@ -1,121 +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 : Test the ability to require the lodash.isnan module in a script. -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - # 定义测试函数 - test_lodash_isnan_require() { - local pkg_name="nodejs-lodash-isnan" - local test_script="/tmp/test_lodash_isnan.js" - - # 步骤1: 检查yum源中是否存在nodejs-lodash-isnan软件包 - LOG_INFO "步骤1: 检查yum源中是否存在${pkg_name}软件包" - dnf list available ${pkg_name} &>/dev/null - if [ $? -ne 0 ]; then - LOG_ERROR "yum源中不存在${pkg_name}软件包" - exit 255 - fi - - # 步骤2: 判断当前是否已安装nodejs-lodash-isnan - LOG_INFO "步骤2: 判断当前是否已安装${pkg_name}" - local installed=false - if rpm -q ${pkg_name} &>/dev/null; then - LOG_INFO "${pkg_name}已安装" - installed=true - else - LOG_INFO "${pkg_name}未安装" - installed=false - fi - - # 步骤3: 如果未安装则安装软件包 - if [ "$installed" = false ]; then - LOG_INFO "步骤3: 安装${pkg_name}软件包" - dnf install -y ${pkg_name} - CHECK_RESULT $? 0 0 "安装${pkg_name}失败" - fi - - # 步骤4: 创建测试脚本测试require lodash.isnan模块 - LOG_INFO "步骤4: 创建测试脚本测试require lodash.isnan模块" - cat > ${test_script} << "EOF" - try { - const lodashIsNaN = require("lodash.isnan"); - console.log("SUCCESS: lodash.isnan模块require成功"); - - // 测试模块功能 - console.log("测试lodash.isnan功能:"); - console.log("lodash.isNaN(NaN):", lodashIsNaN(NaN)); - console.log("lodash.isNaN(123):", lodashIsNaN(123)); - console.log("lodash.isNaN("abc"):", lodashIsNaN("abc")); - console.log("lodash.isNaN(undefined):", lodashIsNaN(undefined)); - - process.exit(0); - } catch (error) { - console.error("ERROR: lodash.isnan模块require失败 -", error.message); - process.exit(1); - } - EOF - - CHECK_RESULT $? 0 0 "创建测试脚本失败" - - # 步骤5: 执行测试脚本 - LOG_INFO "步骤5: 执行测试脚本验证require lodash.isnan模块" - node ${test_script} - CHECK_RESULT $? 0 0 "执行测试脚本失败" - - # 步骤6: 清理临时测试文件 - LOG_INFO "步骤6: 清理临时测试文件" - rm -f ${test_script} - CHECK_RESULT $? 0 0 "清理临时文件失败" - - # 步骤7: 如果测试前未安装,则卸载软件包 - if [ "$installed" = false ]; then - LOG_INFO "步骤7: 卸载${pkg_name}软件包" - dnf remove -y ${pkg_name} - CHECK_RESULT $? 0 0 "卸载${pkg_name}失败" - else - LOG_INFO "步骤7: 保持${pkg_name}已安装状态" - fi - - LOG_INFO "测试完成: lodash.isnan模块require功能测试成功" - } - - # 主执行流程 - main() { - # 检查dnf工具是否存在 - if ! command -v dnf &>/dev/null; then - LOG_ERROR "dnf工具不存在" - exit 255 - fi - - # 检查node命令是否存在 - if ! command -v node &>/dev/null; then - LOG_ERROR "node命令不存在" - exit 255 - fi - - # 执行测试 - test_lodash_isnan_require - } - - # 执行主函数 - main -} - -main "$@" \ No newline at end of file diff --git a/testcases/function_test/pkg_test/lodash/nodejs-lodash-isnan/test_nodejs-lodash-isnan_function_string.sh b/testcases/function_test/pkg_test/lodash/nodejs-lodash-isnan/test_nodejs-lodash-isnan_function_string.sh deleted file mode 100644 index 73a97267f37..00000000000 --- a/testcases/function_test/pkg_test/lodash/nodejs-lodash-isnan/test_nodejs-lodash-isnan_function_string.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 : Test that a non-numeric string is not identified as NaN. -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - LOG_INFO "检查yum源中是否存在nodejs-lodash-isnan软件包" - if ! dnf list available nodejs-lodash-isnan &> /dev/null; then - LOG_ERROR "yum源中未找到nodejs-lodash-isnan软件包" - exit 255 - fi - - LOG_INFO "检查环境中是否已安装nodejs-lodash-isnan软件包" - if rpm -q nodejs-lodash-isnan &> /dev/null; then - LOG_INFO "nodejs-lodash-isnan已安装,标记为无需卸载" - need_uninstall=false - else - LOG_INFO "nodejs-lodash-isnan未安装,标记为需要卸载" - need_uninstall=true - fi - - if [ "$need_uninstall" = true ]; then - LOG_INFO "安装nodejs-lodash-isnan软件包" - dnf install -y nodejs-lodash-isnan - CHECK_RESULT $? 0 0 "安装nodejs-lodash-isnan失败" - fi - - LOG_INFO "测试非数字字符串不被识别为NaN" - LOG_INFO "创建测试JavaScript文件" - cat > test_nan.js << "EOF" - const _ = require("lodash/isNaN"); - console.log(_.isNaN("test_string")); - EOF - - LOG_INFO "执行测试脚本" - node test_nan.js - CHECK_RESULT $? 0 0 "执行nodejs测试脚本失败" - - LOG_INFO "验证输出结果是否为false" - output=$(node test_nan.js) - if [ "$output" = "false" ]; then - LOG_INFO "测试通过:非数字字符串未被识别为NaN" - else - LOG_ERROR "测试失败:非数字字符串被识别为NaN" - exit 1 - fi - - LOG_INFO "清理测试文件" - rm -f test_nan.js - - if [ "$need_uninstall" = true ]; then - LOG_INFO "卸载nodejs-lodash-isnan软件包" - dnf remove -y nodejs-lodash-isnan - CHECK_RESULT $? 0 0 "卸载nodejs-lodash-isnan失败" - fi - - LOG_INFO "测试完成,环境已恢复" -} - -main "$@" \ No newline at end of file diff --git a/testcases/function_test/pkg_test/lodash/nodejs-lodash-isnan/test_nodejs-lodash-isnan_function_undefined.sh b/testcases/function_test/pkg_test/lodash/nodejs-lodash-isnan/test_nodejs-lodash-isnan_function_undefined.sh deleted file mode 100644 index 3a7f3aff134..00000000000 --- a/testcases/function_test/pkg_test/lodash/nodejs-lodash-isnan/test_nodejs-lodash-isnan_function_undefined.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-18 -# @License : Mulan PSL v2 -# @Desc : Test that undefined is not identified as NaN. -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - PACKAGE_NAME="nodejs-lodash" - TEST_FUNCTION="isNaN" - TEST_VALUE="undefined" - - LOG_INFO "开始测试:验证 undefined 是否被识别为 NaN" - LOG_INFO "步骤1:检查系统中是否已安装 $PACKAGE_NAME" - if rpm -q $PACKAGE_NAME &> /dev/null; then - LOG_INFO "$PACKAGE_NAME 已安装,测试结束后将保持安装状态" - ALREADY_INSTALLED=1 - else - LOG_INFO "$PACKAGE_NAME 未安装,将在测试前安装,测试后卸载" - ALREADY_INSTALLED=0 - fi - - if [ $ALREADY_INSTALLED -eq 0 ]; then - LOG_INFO "步骤2:检查 yum 源中是否存在 $PACKAGE_NAME 软件包" - if ! dnf list available $PACKAGE_NAME &> /dev/null; then - LOG_ERROR "yum 源中未找到 $PACKAGE_NAME 软件包" - exit 255 - fi - - LOG_INFO "步骤3:安装 $PACKAGE_NAME 软件包" - dnf install -y $PACKAGE_NAME - CHECK_RESULT $? 0 0 "安装 $PACKAGE_NAME 失败" - fi - - LOG_INFO "步骤4:验证 Node.js 环境是否可用" - if ! command -v node &> /dev/null; then - LOG_ERROR "未找到 node 命令,请确保 Node.js 已正确安装" - exit 1 - fi - - LOG_INFO "步骤5:编写测试脚本验证 lodash 的 $TEST_FUNCTION 函数对 $TEST_VALUE 的处理" - cat > /tmp/test_lodash.js << "EOF" - const _ = require("lodash"); - const value = undefined; - const result = _.isNaN(value); - console.log(result ? "true" : "false"); - EOF - - LOG_INFO "步骤6:执行测试脚本" - node /tmp/test_lodash.js > /tmp/test_result.txt 2>&1 - CHECK_RESULT $? 0 0 "执行 Node.js 脚本失败" - - LOG_INFO "步骤7:检查测试结果" - RESULT=$(cat /tmp/test_result.txt) - EXPECTED="false" - if [ "$RESULT" != "$EXPECTED" ]; then - LOG_ERROR "测试失败:预期输出为 "$EXPECTED",实际输出为 "$RESULT"" - exit 1 - else - LOG_INFO "测试成功:undefined 未被识别为 NaN" - fi - - LOG_INFO "步骤8:清理临时文件" - rm -f /tmp/test_lodash.js /tmp/test_result.txt - - if [ $ALREADY_INSTALLED -eq 0 ]; then - LOG_INFO "步骤9:卸载 $PACKAGE_NAME 软件包以恢复环境" - dnf remove -y $PACKAGE_NAME - CHECK_RESULT $? 0 0 "卸载 $PACKAGE_NAME 失败" - fi - - LOG_INFO "测试完成,环境已恢复" -} - -main "$@" \ No newline at end of file