diff --git a/suite2cases/function_test/pkg_test/mksh/mksh-help.json b/suite2cases/function_test/pkg_test/mksh/mksh-help.json index 2fab26f3636..93039e6d1bb 100644 --- a/suite2cases/function_test/pkg_test/mksh/mksh-help.json +++ b/suite2cases/function_test/pkg_test/mksh/mksh-help.json @@ -2,29 +2,9 @@ "path": "$OET_PATH/testcases/function_test/pkg_test/mksh/mksh-help", "machine num": 1, "cases": [ - { - "name": "test_mksh-help_function_install", - "desc": "Test installation of mksh-help package" - }, { "name": "test_mksh-help_function_basic", "desc": "Test basic command functionality" - }, - { - "name": "test_mksh-help_function_uninstall", - "desc": "Test package removal" - }, - { - "name": "test_mksh-help_function_help_display", - "desc": "Test help info display" - }, - { - "name": "test_mksh-help_function_manpage", - "desc": "Test man page access" - }, - { - "name": "test_mksh-help_function_version", - "desc": "Test version info check" } ] } \ No newline at end of file diff --git a/suite2cases/function_test/pkg_test/python-isodate/python-isodate-help.json b/suite2cases/function_test/pkg_test/python-isodate/python-isodate-help.json index 20febd6fda2..5f6f3f83e6a 100644 --- a/suite2cases/function_test/pkg_test/python-isodate/python-isodate-help.json +++ b/suite2cases/function_test/pkg_test/python-isodate/python-isodate-help.json @@ -2,37 +2,9 @@ "path": "$OET_PATH/testcases/function_test/pkg_test/python-isodate/python-isodate-help", "machine num": 1, "cases": [ - { - "name": "test_python-isodate-help_function_parse", - "desc": "Test parsing ISO date strings" - }, - { - "name": "test_python-isodate-help_function_install", - "desc": "Test installation of the python-isodate-help package" - }, { "name": "test_python-isodate-help_function_import", "desc": "Test basic import of the isodate module" - }, - { - "name": "test_python-isodate-help_function_parse_date", - "desc": "Test parsing ISO 8601 date strings" - }, - { - "name": "test_python-isodate-help_function_parse_time", - "desc": "Test parsing ISO 8601 time strings" - }, - { - "name": "test_python-isodate-help_function_parse_duration", - "desc": "Test parsing ISO 8601 duration strings" - }, - { - "name": "test_python-isodate-help_function_format_date", - "desc": "Test formatting date to ISO string" - }, - { - "name": "test_python-isodate-help_function_uninstall", - "desc": "Test uninstallation of the package" } ] } \ No newline at end of file diff --git a/suite2cases/function_test/pkg_test/python-tomlkit/python3-tomlkit.json b/suite2cases/function_test/pkg_test/python-tomlkit/python3-tomlkit.json deleted file mode 100644 index 1f0308000b9..00000000000 --- a/suite2cases/function_test/pkg_test/python-tomlkit/python3-tomlkit.json +++ /dev/null @@ -1,10 +0,0 @@ -{ - "path": "$OET_PATH/testcases/function_test/pkg_test/python-tomlkit/python3-tomlkit", - "machine num": 1, - "cases": [ - { - "name": "test_python3-tomlkit_function_load", - "desc": "Test loading TOML file" - } - ] -} \ No newline at end of file diff --git a/suite2cases/function_test/pkg_test/texlive-base/texlive-lib-devel.json b/suite2cases/function_test/pkg_test/texlive-base/texlive-lib-devel.json deleted file mode 100644 index c00f3221ac8..00000000000 --- a/suite2cases/function_test/pkg_test/texlive-base/texlive-lib-devel.json +++ /dev/null @@ -1,10 +0,0 @@ -{ - "path": "$OET_PATH/testcases/function_test/pkg_test/texlive-base/texlive-lib-devel", - "machine num": 1, - "cases": [ - { - "name": "test_texlive-lib-devel_function_basic", - "desc": "Test basic library functionality" - } - ] -} \ No newline at end of file diff --git a/suite2cases/function_test/pkg_test/texlive-split-f/texlive-datetime2-estonian.json b/suite2cases/function_test/pkg_test/texlive-split-f/texlive-datetime2-estonian.json deleted file mode 100644 index 201dcbe533a..00000000000 --- a/suite2cases/function_test/pkg_test/texlive-split-f/texlive-datetime2-estonian.json +++ /dev/null @@ -1,10 +0,0 @@ -{ - "path": "$OET_PATH/testcases/function_test/pkg_test/texlive-split-f/texlive-datetime2-estonian", - "machine num": 1, - "cases": [ - { - "name": "test_texlive-datetime2-estonian_function_install", - "desc": "Test package installation" - } - ] -} \ No newline at end of file diff --git a/suite2cases/function_test/pkg_test/texlive-split-h/texlive-epsf-dvipdfmx-doc.json b/suite2cases/function_test/pkg_test/texlive-split-h/texlive-epsf-dvipdfmx-doc.json deleted file mode 100644 index 7ea3c9295aa..00000000000 --- a/suite2cases/function_test/pkg_test/texlive-split-h/texlive-epsf-dvipdfmx-doc.json +++ /dev/null @@ -1,10 +0,0 @@ -{ - "path": "$OET_PATH/testcases/function_test/pkg_test/texlive-split-h/texlive-epsf-dvipdfmx-doc", - "machine num": 1, - "cases": [ - { - "name": "test_texlive-epsf-dvipdfmx-doc_function_epsf", - "desc": "Test EPSF functionality" - } - ] -} \ No newline at end of file diff --git a/suite2cases/function_test/pkg_test/texlive-split-v/texlive-simplified-latex-doc.json b/suite2cases/function_test/pkg_test/texlive-split-v/texlive-simplified-latex-doc.json deleted file mode 100644 index dfe5986127b..00000000000 --- a/suite2cases/function_test/pkg_test/texlive-split-v/texlive-simplified-latex-doc.json +++ /dev/null @@ -1,10 +0,0 @@ -{ - "path": "$OET_PATH/testcases/function_test/pkg_test/texlive-split-v/texlive-simplified-latex-doc", - "machine num": 1, - "cases": [ - { - "name": "test_texlive-simplified-latex-doc_function_basic", - "desc": "Verify basic LaTeX doc functionality" - } - ] -} \ No newline at end of file diff --git a/suite2cases/function_test/pkg_test/texlive-split-z/texlive-xcookybooky.json b/suite2cases/function_test/pkg_test/texlive-split-z/texlive-xcookybooky.json index 06596ef167d..28ea1b33ea3 100644 --- a/suite2cases/function_test/pkg_test/texlive-split-z/texlive-xcookybooky.json +++ b/suite2cases/function_test/pkg_test/texlive-split-z/texlive-xcookybooky.json @@ -7,11 +7,6 @@ "desc": "测试texlive-xcookybooky软件包的安装功能", "machine num": 1 }, - { - "name": "test_texlive-xcookybooky_uninstall", - "desc": "测试texlive-xcookybooky软件包的卸载功能", - "machine num": 1 - }, { "name": "test_texlive-xcookybooky_upgrade", "desc": "测试texlive-xcookybooky软件包的升级功能", @@ -22,11 +17,6 @@ "desc": "测试texlive-xcookybooky软件包的降级功能", "machine num": 1 }, - { - "name": "test_texlive-xcookybooky_rollback", - "desc": "测试texlive-xcookybooky软件包的回滚功能", - "machine num": 1 - }, { "name": "test_texlive-xcookybooky_reinstall", "desc": "测试texlive-xcookybooky软件包的重新安装功能", diff --git a/testcases/function_test/pkg_test/mksh/mksh-help/test_mksh-help_function_help_display.sh b/testcases/function_test/pkg_test/mksh/mksh-help/test_mksh-help_function_help_display.sh deleted file mode 100644 index 1020d156393..00000000000 --- a/testcases/function_test/pkg_test/mksh/mksh-help/test_mksh-help_function_help_display.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-21 -# @License : Mulan PSL v2 -# @Desc : Test help info display -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - LOG_INFO "开始测试:Test help info display" - LOG_INFO "步骤1:检查环境中是否已安装mksh软件包" - if rpm -q mksh >/dev/null 2>&1; then - LOG_INFO "环境中已安装mksh软件包,测试结束后将保持安装状态" - INSTALLED=true - else - LOG_INFO "环境中未安装mksh软件包,将在测试步骤中安装" - INSTALLED=false - fi - - LOG_INFO "步骤2:检查yum源中是否存在mksh软件包" - if ! dnf list available mksh >/dev/null 2>&1; then - LOG_ERROR "yum源中未找到mksh软件包,退出测试" - exit 255 - fi - - if [ "$INSTALLED" = false ]; then - LOG_INFO "步骤3:安装mksh软件包" - dnf install -y mksh - CHECK_RESULT $? 0 0 "安装mksh软件包失败" - fi - - LOG_INFO "步骤4:测试mksh --help命令显示帮助信息" - mksh --help >/dev/null 2>&1 - CHECK_RESULT $? 0 0 "mksh --help命令执行失败" - - LOG_INFO "步骤5:测试mksh -h命令显示帮助信息" - mksh -h >/dev/null 2>&1 - CHECK_RESULT $? 0 0 "mksh -h命令执行失败" - - LOG_INFO "步骤6:测试mksh --version命令显示版本信息" - mksh --version >/dev/null 2>&1 - CHECK_RESULT $? 0 0 "mksh --version命令执行失败" - - LOG_INFO "步骤7:测试不支持的参数,预期失败" - mksh --invalid-param >/dev/null 2>&1 - if [ $? -ne 255 ]; then - LOG_ERROR "不支持的参数未按预期退出码255退出" - exit 255 - fi - - if [ "$INSTALLED" = false ]; then - LOG_INFO "步骤8:卸载mksh软件包,恢复环境" - dnf remove -y mksh - CHECK_RESULT $? 0 0 "卸载mksh软件包失败" - else - LOG_INFO "环境中已安装mksh软件包,测试结束后保持安装状态,无需卸载" - fi - - LOG_INFO "测试完成:Test help info display" -} - -main "$@" \ No newline at end of file diff --git a/testcases/function_test/pkg_test/mksh/mksh-help/test_mksh-help_function_install.sh b/testcases/function_test/pkg_test/mksh/mksh-help/test_mksh-help_function_install.sh deleted file mode 100644 index 58214e8c0dc..00000000000 --- a/testcases/function_test/pkg_test/mksh/mksh-help/test_mksh-help_function_install.sh +++ /dev/null @@ -1,59 +0,0 @@ -#!/usr/bin/bash - -# Copyright (c) 2024 ISCAS .ALL rights reserved. -# This program is licensed under Mulan PSL v2. -# You can use it according to the terms and conditions of the Mulan PSL v2. -# http://license.coscl.org.cn/MulanPSL2 -# THIS PROGRAM IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, -# EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, -# MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. -# See the Mulan PSL v2 for more details. - -# ############################################# -# @Author : honghua -# @Contact : honghua@iscas.ac.cn -# @Date : 2025-09-12 -# @License : Mulan PSL v2 -# @Desc : Test installation of mksh-help package -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - # 检查是否已安装mksh-help软件包 - LOG_INFO "检查是否已安装mksh-help软件包" - rpm -q mksh-help > /dev/null 2>&1 - if [ $? -eq 0 ]; then - LOG_INFO "mksh-help已安装,脚本结束后将保持安装状态" - INSTALLED=1 - else - LOG_INFO "mksh-help未安装,脚本结束后将卸载" - INSTALLED=0 - fi - - # 检查yum源中是否存在mksh-help软件包 - LOG_INFO "检查yum源中是否存在mksh-help软件包" - dnf list available mksh-help > /dev/null 2>&1 - CHECK_RESULT $? 0 255 "yum源中不存在mksh-help软件包" - - # 安装mksh-help软件包 - LOG_INFO "开始安装mksh-help软件包" - dnf install -y mksh-help - CHECK_RESULT $? 0 0 "安装mksh-help软件包失败" - - # 测试mksh-help命令的帮助参数 - LOG_INFO "测试mksh-help命令的帮助参数" - mksh --help > /dev/null 2>&1 - CHECK_RESULT $? 0 255 "mksh-help命令的帮助参数不支持或不存在" - - # 根据初始状态决定是否卸载 - if [ $INSTALLED -eq 0 ]; then - LOG_INFO "卸载mksh-help软件包" - dnf remove -y mksh-help - CHECK_RESULT $? 0 0 "卸载mksh-help软件包失败" - fi - - LOG_INFO "测试完成,环境已恢复" -} - -main "$@" \ No newline at end of file diff --git a/testcases/function_test/pkg_test/mksh/mksh-help/test_mksh-help_function_manpage.sh b/testcases/function_test/pkg_test/mksh/mksh-help/test_mksh-help_function_manpage.sh deleted file mode 100644 index 697c3b59754..00000000000 --- a/testcases/function_test/pkg_test/mksh/mksh-help/test_mksh-help_function_manpage.sh +++ /dev/null @@ -1,73 +0,0 @@ -#!/usr/bin/bash - -# Copyright (c) 2024 ISCAS .ALL rights reserved. -# This program is licensed under Mulan PSL v2. -# You can use it according to the terms and conditions of the Mulan PSL v2. -# http://license.coscl.org.cn/MulanPSL2 -# THIS PROGRAM IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, -# EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, -# MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. -# See the Mulan PSL v2 for more details. - -# ############################################# -# @Author : honghua -# @Contact : honghua@iscas.ac.cn -# @Date : 2026-03-21 -# @License : Mulan PSL v2 -# @Desc : Test man page access -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - LOG_INFO "开始测试man页面访问功能" - LOG_INFO "检查是否已安装mksh软件包" - rpm -q mksh > /dev/null 2>&1 - INSTALLED=$? - - if [ $INSTALLED -eq 0 ]; then - LOG_INFO "mksh已安装,测试后保持安装状态" - NEED_UNINSTALL=false - else - LOG_INFO "mksh未安装,将在测试过程中安装" - NEED_UNINSTALL=true - - LOG_INFO "检查yum源中是否存在mksh软件包" - dnf list available mksh > /dev/null 2>&1 - CHECK_RESULT $? 0 0 "yum源中未找到mksh软件包" - - if [ $? -ne 0 ]; then - LOG_ERROR "yum源中无mksh软件包,退出测试" - exit 255 - fi - - LOG_INFO "安装mksh软件包" - dnf install -y mksh - CHECK_RESULT $? 0 0 "安装mksh失败" - fi - - LOG_INFO "测试mksh的man页面访问" - man mksh > /dev/null 2>&1 - CHECK_RESULT $? 0 0 "无法访问mksh的man页面" - - LOG_INFO "测试mksh --help参数" - mksh --help > /dev/null 2>&1 - CHECK_RESULT $? 0 0 "mksh不支持--help参数" - - LOG_INFO "测试mksh不支持的参数" - mksh --invalid-param > /dev/null 2>&1 - if [ $? -ne 255 ]; then - LOG_ERROR "mksh应返回255退出码对于不支持的参数" - exit 255 - fi - - if [ "$NEED_UNINSTALL" = true ]; then - LOG_INFO "清理环境:卸载mksh软件包" - dnf remove -y mksh - CHECK_RESULT $? 0 0 "卸载mksh失败" - fi - - LOG_INFO "测试完成,环境已恢复" -} - -main "$@" \ No newline at end of file diff --git a/testcases/function_test/pkg_test/mksh/mksh-help/test_mksh-help_function_uninstall.sh b/testcases/function_test/pkg_test/mksh/mksh-help/test_mksh-help_function_uninstall.sh deleted file mode 100644 index a7d209237b1..00000000000 --- a/testcases/function_test/pkg_test/mksh/mksh-help/test_mksh-help_function_uninstall.sh +++ /dev/null @@ -1,82 +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-21 -# @License : Mulan PSL v2 -# @Desc : Test package removal -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - set -e - - LOG_INFO "开始测试软件包卸载功能" - - # 检查是否已安装mksh软件包 - if dnf list installed mksh &>/dev/null; then - LOG_INFO "检测到mksh已安装,测试结束后将保持安装状态" - already_installed=true - else - LOG_INFO "检测到mksh未安装,将在测试过程中安装并最终卸载" - already_installed=false - fi - - # 检查yum源中是否有mksh软件包 - LOG_INFO "检查yum源中是否存在mksh软件包" - if ! dnf list available mksh &>/dev/null; then - LOG_ERROR "yum源中未找到mksh软件包" - exit 255 - fi - - # 如果未安装,则安装mksh - if [ "$already_installed" = false ]; then - LOG_INFO "开始安装mksh软件包" - dnf install -y mksh - CHECK_RESULT $? 0 0 "安装mksh失败" - fi - - # 测试mksh --help命令 - LOG_INFO "测试mksh --help命令" - mksh --help - CHECK_RESULT $? 0 0 "mksh --help命令执行失败" - - # 测试不支持的参数 - LOG_INFO "测试mksh不支持的命令参数" - if mksh --invalid-param &>/dev/null; then - LOG_ERROR "mksh接受了无效参数--invalid-param" - exit 255 - fi - - # 测试卸载功能(仅当测试前未安装时才执行) - if [ "$already_installed" = false ]; then - LOG_INFO "开始卸载mksh软件包" - dnf remove -y mksh - CHECK_RESULT $? 0 0 "卸载mksh失败" - - # 验证卸载是否成功 - if dnf list installed mksh &>/dev/null; then - LOG_ERROR "卸载后mksh仍然存在" - exit 1 - else - LOG_INFO "mksh卸载成功" - fi - else - LOG_INFO "测试前已安装mksh,跳过卸载步骤" - fi - - LOG_INFO "测试完成,环境已恢复" -} - -main "$@" \ No newline at end of file diff --git a/testcases/function_test/pkg_test/mksh/mksh-help/test_mksh-help_function_version.sh b/testcases/function_test/pkg_test/mksh/mksh-help/test_mksh-help_function_version.sh deleted file mode 100644 index c8000fd73fd..00000000000 --- a/testcases/function_test/pkg_test/mksh/mksh-help/test_mksh-help_function_version.sh +++ /dev/null @@ -1,84 +0,0 @@ -#!/usr/bin/bash - -# Copyright (c) 2024 ISCAS .ALL rights reserved. -# This program is licensed under Mulan PSL v2. -# You can use it according to the terms and conditions of the Mulan PSL v2. -# http://license.coscl.org.cn/MulanPSL2 -# THIS PROGRAM IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, -# EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, -# MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. -# See the Mulan PSL v2 for more details. - -# ############################################# -# @Author : honghua -# @Contact : honghua@iscas.ac.cn -# @Date : 2026-03-21 -# @License : Mulan PSL v2 -# @Desc : Test version info check -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - # 测试版本信息检查 - LOG_INFO "开始测试版本信息检查功能" - - # 检查mksh软件包是否已安装 - LOG_INFO "检查mksh软件包是否已安装" - if rpm -q mksh >/dev/null 2>&1; then - LOG_INFO "mksh软件包已安装,测试结束后将保持安装状态" - already_installed=true - else - LOG_INFO "mksh软件包未安装,将在测试过程中安装" - already_installed=false - fi - - # 检查yum源中是否有mksh软件包 - LOG_INFO "检查yum源中是否有mksh软件包" - if ! dnf list available mksh >/dev/null 2>&1; then - LOG_ERROR "yum源中未找到mksh软件包" - exit 255 - fi - - # 如果未安装,则安装mksh软件包 - if [ "$already_installed" = false ]; then - LOG_INFO "安装mksh软件包" - dnf install -y mksh - CHECK_RESULT $? 0 0 "安装mksh软件包失败" - fi - - # 测试mksh --help命令 - LOG_INFO "测试mksh --help命令" - mksh --help >/dev/null 2>&1 - CHECK_RESULT $? 0 0 "mksh --help命令执行失败" - - # 测试mksh -c "echo $KSH_VERSION"命令 - LOG_INFO "测试mksh版本信息" - mksh_version=$(mksh -c "echo $KSH_VERSION" 2>/dev/null) - if [ -z "$mksh_version" ]; then - LOG_ERROR "无法获取mksh版本信息" - exit 255 - fi - LOG_INFO "mksh版本信息: $mksh_version" - - # 测试不支持的参数 - LOG_INFO "测试不支持的参数--invalid-param" - mksh --invalid-param >/dev/null 2>&1 - if [ $? -ne 255 ]; then - LOG_ERROR "不支持的参数检查失败" - exit 255 - fi - - # 清理环境:如果测试前未安装,则卸载软件包 - if [ "$already_installed" = false ]; then - LOG_INFO "清理环境:卸载mksh软件包" - dnf remove -y mksh - CHECK_RESULT $? 0 0 "卸载mksh软件包失败" - else - LOG_INFO "测试前已安装mksh,保持安装状态" - fi - - LOG_INFO "版本信息检查测试完成" -} - -main "$@" \ No newline at end of file diff --git a/testcases/function_test/pkg_test/python-isodate/python-isodate-help/test_python-isodate-help_function_format_date.sh b/testcases/function_test/pkg_test/python-isodate/python-isodate-help/test_python-isodate-help_function_format_date.sh deleted file mode 100644 index cac968ef74c..00000000000 --- a/testcases/function_test/pkg_test/python-isodate/python-isodate-help/test_python-isodate-help_function_format_date.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-03-18 -# @License : Mulan PSL v2 -# @Desc : Test formatting date to ISO string -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - LOG_INFO "测试开始:Test formatting date to ISO string" - LOG_INFO "步骤1:检查python3-isodate软件包是否已在系统中安装" - if rpm -q python3-isodate &> /dev/null; then - LOG_INFO "python3-isodate已安装,脚本结束时将保持安装状态" - INSTALLED=1 - else - LOG_INFO "python3-isodate未安装,将在测试过程中安装" - INSTALLED=0 - fi - LOG_INFO "步骤2:检查yum源中是否存在python3-isodate软件包" - if ! dnf list available python3-isodate &> /dev/null; then - LOG_ERROR "yum源中未找到python3-isodate软件包" - exit 255 - fi - if [ $INSTALLED -eq 0 ]; then - LOG_INFO "步骤3:安装python3-isodate软件包" - dnf install -y python3-isodate - CHECK_RESULT $? 0 0 "安装python3-isodate失败" - fi - LOG_INFO "步骤4:验证python3-isodate的help函数format_date功能" - LOG_INFO "步骤4.1:检查format_date函数是否存在" - python3 -c "import isodate; help(isodate.format_date)" &> /dev/null - CHECK_RESULT $? 0 0 "format_date函数不存在或不支持" - LOG_INFO "步骤4.2:测试format_date函数基本功能" - python3 -c " - import isodate - from datetime import date - d = date(2023, 10, 5) - result = isodate.format_date(d) - expected = "2023-10-05" - if result == expected: - print("PASS") - else: - print("FAIL") - " | grep -q "PASS" - CHECK_RESULT $? 0 0 "format_date函数基本功能测试失败" - LOG_INFO "步骤5:清理测试环境" - if [ $INSTALLED -eq 0 ]; then - LOG_INFO "卸载python3-isodate软件包" - dnf remove -y python3-isodate - CHECK_RESULT $? 0 0 "卸载python3-isodate失败" - else - LOG_INFO "保持python3-isodate软件包安装状态" - fi - LOG_INFO "测试完成:Test formatting date to ISO string" -} - -main "$@" \ No newline at end of file diff --git a/testcases/function_test/pkg_test/python-isodate/python-isodate-help/test_python-isodate-help_function_install.sh b/testcases/function_test/pkg_test/python-isodate/python-isodate-help/test_python-isodate-help_function_install.sh deleted file mode 100644 index c9f05ccbbef..00000000000 --- a/testcases/function_test/pkg_test/python-isodate/python-isodate-help/test_python-isodate-help_function_install.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-03-18 -# @License : Mulan PSL v2 -# @Desc : Test installation of the python-isodate-help package -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - LOG_INFO "开始测试:Test installation of the python-isodate-help package" - LOG_INFO "步骤1:检查当前环境是否已安装python-isodate-help软件包" - dnf list installed python-isodate-help > /dev/null 2>&1 - if [ $? -eq 0 ]; then - LOG_INFO "环境已安装python-isodate-help,测试将保持安装状态" - INSTALLED_FLAG=1 - else - LOG_INFO "环境未安装python-isodate-help,将在测试过程中安装" - INSTALLED_FLAG=0 - fi - - LOG_INFO "步骤2:检查yum源中是否存在python-isodate-help软件包" - dnf list available python-isodate-help > /dev/null 2>&1 - CHECK_RESULT $? 0 0 "yum源中未找到python-isodate-help软件包" - if [ $? -ne 0 ]; then - LOG_ERROR "yum源中不存在python-isodate-help软件包,无法继续测试" - exit 255 - fi - - if [ $INSTALLED_FLAG -eq 0 ]; then - LOG_INFO "步骤3:安装python-isodate-help软件包" - dnf install -y python-isodate-help - CHECK_RESULT $? 0 0 "安装python-isodate-help软件包失败" - LOG_INFO "python-isodate-help软件包安装成功" - fi - - LOG_INFO "步骤4:验证python-isodate-help软件包基本功能" - python3 -c "import isodate" > /dev/null 2>&1 - CHECK_RESULT $? 0 0 "python-isodate-help软件包导入失败,功能异常" - - LOG_INFO "步骤5:检查python-isodate-help软件包帮助信息" - python3 -c "help("isodate")" > /dev/null 2>&1 - CHECK_RESULT $? 0 0 "获取python-isodate-help帮助信息失败" - - LOG_INFO "步骤6:清理测试环境" - if [ $INSTALLED_FLAG -eq 0 ]; then - LOG_INFO "卸载测试安装的python-isodate-help软件包" - dnf remove -y python-isodate-help - CHECK_RESULT $? 0 0 "卸载python-isodate-help软件包失败" - LOG_INFO "python-isodate-help软件包卸载成功,环境已恢复" - else - LOG_INFO "环境已安装python-isodate-help,保持安装状态,无需卸载" - fi - - LOG_INFO "测试完成:python-isodate-help软件包安装测试通过" -} - -main "$@" \ No newline at end of file diff --git a/testcases/function_test/pkg_test/python-isodate/python-isodate-help/test_python-isodate-help_function_parse.sh b/testcases/function_test/pkg_test/python-isodate/python-isodate-help/test_python-isodate-help_function_parse.sh deleted file mode 100644 index 4325ec1a23f..00000000000 --- a/testcases/function_test/pkg_test/python-isodate/python-isodate-help/test_python-isodate-help_function_parse.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-04 -# @License : Mulan PSL v2 -# @Desc : Test parsing ISO date strings -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - LOG_INFO "开始测试:解析ISO日期字符串" - - # 检查是否已安装python3-isodate - LOG_INFO "检查是否已安装python3-isodate" - if dnf list installed python3-isodate &> /dev/null; then - LOG_INFO "python3-isodate已安装" - installed=true - else - LOG_INFO "python3-isodate未安装" - installed=false - fi - - # 检查yum源中是否有python3-isodate - LOG_INFO "检查yum源中是否有python3-isodate" - if ! dnf list available python3-isodate &> /dev/null; then - LOG_ERROR "yum源中未找到python3-isodate" - exit 255 - fi - - # 如果未安装,则安装python3-isodate - if [ "$installed" = false ]; then - LOG_INFO "正在安装python3-isodate" - dnf install -y python3-isodate - CHECK_RESULT $? 0 0 "安装python3-isodate失败" - fi - - # 测试解析ISO日期字符串 - LOG_INFO "测试解析ISO日期字符串" - python3 -c "from isodate import parse_datetime; print(parse_datetime("2023-01-01T12:00:00Z"))" &> /dev/null - CHECK_RESULT $? 0 0 "解析ISO日期字符串失败" - - # 清理环境 - if [ "$installed" = false ]; then - LOG_INFO "卸载python3-isodate" - dnf remove -y python3-isodate - CHECK_RESULT $? 0 0 "卸载python3-isodate失败" - fi - - LOG_INFO "测试完成:解析ISO日期字符串" -} - -main "$@" \ No newline at end of file diff --git a/testcases/function_test/pkg_test/python-isodate/python-isodate-help/test_python-isodate-help_function_parse_date.sh b/testcases/function_test/pkg_test/python-isodate/python-isodate-help/test_python-isodate-help_function_parse_date.sh deleted file mode 100644 index 5afea3de8c1..00000000000 --- a/testcases/function_test/pkg_test/python-isodate/python-isodate-help/test_python-isodate-help_function_parse_date.sh +++ /dev/null @@ -1,138 +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 parsing ISO 8601 date strings -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - set -e - - LOG_INFO "开始测试:Test parsing ISO 8601 date strings" - - LOG_INFO "步骤1: 检查当前环境是否已安装python3-isodate软件包" - if rpm -q python3-isodate > /dev/null 2>&1; then - LOG_INFO "python3-isodate已安装,脚本结束后将保持安装状态" - INSTALLED_BEFORE=true - else - LOG_INFO "python3-isodate未安装,将在测试过程中安装并在脚本结束前卸载" - INSTALLED_BEFORE=false - fi - - LOG_INFO "步骤2: 检查yum源中是否存在python3-isodate软件包" - if ! dnf list available python3-isodate > /dev/null 2>&1; then - LOG_ERROR "yum源中未找到python3-isodate软件包" - exit 255 - fi - - if [ "$INSTALLED_BEFORE" = false ]; then - LOG_INFO "步骤3: 安装python3-isodate软件包" - dnf install -y python3-isodate - CHECK_RESULT $? 0 0 "安装python3-isodate失败" - fi - - LOG_INFO "步骤4: 验证python3-isodate的parse_date函数基本功能" - cat > /tmp/test_parse_date.py << "EOF" - import isodate - def test_parse_date(): - # Test case 1: 解析标准ISO日期 - result = isodate.parse_date("2023-10-01") - assert str(result) == "2023-10-01", f"Expected 2023-10-01, got {result}" - - # Test case 2: 解析带时区的日期(parse_date应忽略时区信息) - result = isodate.parse_date("2023-10-01Z") - assert str(result) == "2023-10-01", f"Expected 2023-10-01, got {result}" - - # Test case 3: 解析简写日期 - result = isodate.parse_date("20231001") - assert str(result) == "2023-10-01", f"Expected 2023-10-01, got {result}" - - print("所有parse_date测试用例通过") - if __name__ == "__main__": - test_parse_date() - EOF - - python3 /tmp/test_parse_date.py - CHECK_RESULT $? 0 0 "parse_date函数基本功能测试失败" - - LOG_INFO "步骤5: 测试parse_date函数不支持的错误参数" - cat > /tmp/test_parse_date_error.py << "EOF" - import isodate - def test_error_cases(): - try: - # 测试不支持的参数:时间部分(parse_date只解析日期) - isodate.parse_date("2023-10-01T10:30:00") - return False, "应抛出异常但未抛出" - except isodate.ISO8601Error: - pass - - try: - # 测试无效日期格式 - isodate.parse_date("2023-13-01") - return False, "应抛出异常但未抛出" - except isodate.ISO8601Error: - pass - - return True, "所有错误用例测试通过" - if __name__ == "__main__": - success, msg = test_error_cases() - if not success: - raise AssertionError(msg) - print(msg) - EOF - - python3 /tmp/test_parse_date_error.py - CHECK_RESULT $? 0 0 "parse_date函数错误参数测试失败" - - LOG_INFO "步骤6: 测试parse_date函数边界情况" - cat > /tmp/test_parse_date_edge.py << "EOF" - import isodate - def test_edge_cases(): - # 测试闰年日期 - result = isodate.parse_date("2024-02-29") - assert str(result) == "2024-02-29", f"Expected 2024-02-29, got {result}" - - # 测试最小日期(isodate支持的范围) - result = isodate.parse_date("0001-01-01") - assert str(result) == "0001-01-01", f"Expected 0001-01-01, got {result}" - - # 测试最大日期(isodate支持的范围) - result = isodate.parse_date("9999-12-31") - assert str(result) == "9999-12-31", f"Expected 9999-12-31, got {result}" - - print("所有边界用例测试通过") - if __name__ == "__main__": - test_edge_cases() - EOF - - python3 /tmp/test_parse_date_edge.py - CHECK_RESULT $? 0 0 "parse_date函数边界情况测试失败" - - LOG_INFO "步骤7: 清理临时文件" - rm -f /tmp/test_parse_date.py /tmp/test_parse_date_error.py /tmp/test_parse_date_edge.py - CHECK_RESULT $? 0 0 "清理临时文件失败" - - if [ "$INSTALLED_BEFORE" = false ]; then - LOG_INFO "步骤8: 卸载测试安装的python3-isodate软件包" - dnf remove -y python3-isodate - CHECK_RESULT $? 0 0 "卸载python3-isodate失败" - fi - - LOG_INFO "测试完成:Test parsing ISO 8601 date strings" -} - -main "$@" \ No newline at end of file diff --git a/testcases/function_test/pkg_test/python-isodate/python-isodate-help/test_python-isodate-help_function_parse_duration.sh b/testcases/function_test/pkg_test/python-isodate/python-isodate-help/test_python-isodate-help_function_parse_duration.sh deleted file mode 100644 index 67ce6320e77..00000000000 --- a/testcases/function_test/pkg_test/python-isodate/python-isodate-help/test_python-isodate-help_function_parse_duration.sh +++ /dev/null @@ -1,119 +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 parsing ISO 8601 duration strings -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - set -e - - # 定义软件包名称 - PACKAGE_NAME="python3-isodate" - - # 检查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 - - # 检查环境是否已安装该软件包 - LOG_INFO "2. 检查环境是否已安装软件包: ${PACKAGE_NAME}" - INSTALLED_FLAG=0 - if rpm -q ${PACKAGE_NAME} &>/dev/null; then - LOG_INFO "软件包已安装" - INSTALLED_FLAG=1 - else - LOG_INFO "软件包未安装" - fi - - # 如果未安装,则安装软件包 - if [ ${INSTALLED_FLAG} -eq 0 ]; then - LOG_INFO "3. 安装软件包: ${PACKAGE_NAME}" - dnf install -y ${PACKAGE_NAME} - CHECK_RESULT $? 0 0 "安装软件包失败" - fi - - # 测试解析ISO 8601持续时间字符串 - LOG_INFO "4. 测试解析ISO 8601持续时间字符串" - - # 检查python3-isodate-help命令是否存在并支持parse_duration参数 - LOG_INFO "4.1 检查python3-isodate-help命令及parse_duration参数" - if ! python3 -m isodate --help 2>&1 | grep -q "parse_duration"; then - LOG_ERROR "python3-isodate-help命令不支持parse_duration参数" - # 如果之前未安装,则需要卸载 - if [ ${INSTALLED_FLAG} -eq 0 ]; then - dnf remove -y ${PACKAGE_NAME} - fi - exit 255 - fi - - # 测试有效的ISO 8601持续时间字符串 - LOG_INFO "4.2 测试有效的ISO 8601持续时间字符串: P1Y2M3DT4H5M6S" - python3 -c " - import isodate - try: - duration = isodate.parse_duration("P1Y2M3DT4H5M6S") - print("解析成功:", duration) - except Exception as e: - print("解析失败:", e) - exit(1) - " - CHECK_RESULT $? 0 0 "解析有效的ISO 8601持续时间字符串失败" - - # 测试无效的ISO 8601持续时间字符串 - LOG_INFO "4.3 测试无效的ISO 8601持续时间字符串: P1Y2M3DT4H5M6SX" - python3 -c " - import isodate - try: - duration = isodate.parse_duration("P1Y2M3DT4H5M6SX") - print("解析成功(不应成功):", duration) - exit(1) - except Exception as e: - print("解析失败(预期):", e) - " - CHECK_RESULT $? 0 0 "解析无效的ISO 8601持续时间字符串未按预期失败" - - # 测试空字符串 - LOG_INFO "4.4 测试空字符串" - python3 -c " - import isodate - try: - duration = isodate.parse_duration("") - print("解析成功(不应成功):", duration) - exit(1) - except Exception as e: - print("解析失败(预期):", e) - " - CHECK_RESULT $? 0 0 "解析空字符串未按预期失败" - - # 环境恢复 - LOG_INFO "5. 环境恢复" - if [ ${INSTALLED_FLAG} -eq 0 ]; then - LOG_INFO "5.1 卸载测试安装的软件包: ${PACKAGE_NAME}" - dnf remove -y ${PACKAGE_NAME} - CHECK_RESULT $? 0 0 "卸载软件包失败" - else - LOG_INFO "5.1 保持软件包安装状态" - fi - - LOG_INFO "测试完成" -} - -main "$@" \ No newline at end of file diff --git a/testcases/function_test/pkg_test/python-isodate/python-isodate-help/test_python-isodate-help_function_parse_time.sh b/testcases/function_test/pkg_test/python-isodate/python-isodate-help/test_python-isodate-help_function_parse_time.sh deleted file mode 100644 index 30a9818c3c9..00000000000 --- a/testcases/function_test/pkg_test/python-isodate/python-isodate-help/test_python-isodate-help_function_parse_time.sh +++ /dev/null @@ -1,136 +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 parsing ISO 8601 time strings -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - # 判断是否已安装python3-isodate包 - LOG_INFO "检查是否已安装python3-isodate包" - if dnf list installed python3-isodate &>/dev/null; then - LOG_INFO "python3-isodate已安装,记录安装状态" - INSTALLED=1 - else - LOG_INFO "python3-isodate未安装" - INSTALLED=0 - fi - - # 检查yum源中是否存在python3-isodate包 - LOG_INFO "检查yum源中是否存在python3-isodate包" - if ! dnf list available python3-isodate &>/dev/null; then - LOG_ERROR "yum源中不存在python3-isodate包" - exit 255 - fi - - # 如果未安装,则安装python3-isodate包 - if [ $INSTALLED -eq 0 ]; then - LOG_INFO "开始安装python3-isodate包" - dnf install -y python3-isodate - CHECK_RESULT $? 0 0 "安装python3-isodate包失败" - LOG_INFO "安装python3-isodate包成功" - fi - - # 测试parse_time函数解析ISO 8601时间字符串 - LOG_INFO "测试parse_time函数解析ISO 8601时间字符串" - python3 -c " - from isodate import parse_time - try: - # 测试解析完整时间字符串 - result = parse_time("12:30:45") - print("解析12:30:45成功:", result) - - # 测试解析带小数秒的时间字符串 - result = parse_time("12:30:45.123") - print("解析12:30:45.123成功:", result) - - # 测试解析带时区的时间字符串 - result = parse_time("12:30:45Z") - print("解析12:30:45Z成功:", result) - - # 测试解析带时区偏移的时间字符串 - result = parse_time("12:30:45+05:30") - print("解析12:30:45+05:30成功:", result) - - # 测试无效时间字符串(预期失败) - try: - result = parse_time("25:30:45") - print("解析25:30:45成功(不应该成功):", result) - except Exception as e: - print("解析25:30:45失败(预期):", str(e)) - - print("所有测试完成") - except Exception as e: - print("测试过程中发生错误:", str(e)) - exit(1) - " - CHECK_RESULT $? 0 0 "parse_time函数测试失败" - - # 测试parse_time函数不支持参数的情况 - LOG_INFO "测试parse_time函数不支持参数的情况" - python3 -c " - from isodate import parse_time - try: - # 测试不支持的时间格式 - result = parse_time("invalid_time") - print("解析invalid_time成功(不应该成功):", result) - except Exception as e: - print("解析invalid_time失败(预期):", str(e)) - " - # 检查命令是否成功执行(这里预期会失败,因为参数无效) - if [ $? -eq 0 ]; then - LOG_ERROR "parse_time函数接受了无效参数但未报错" - exit 255 - else - LOG_INFO "parse_time函数正确拒绝了无效参数" - fi - - # 测试parse_time函数不存在的参数 - LOG_INFO "测试parse_time函数不存在的参数" - python3 -c " - from isodate import parse_time - try: - # 测试不存在的参数(这里使用不存在的关键字参数) - result = parse_time("12:30:45", nonexistent_arg=True) - print("使用不存在的参数成功(不应该成功):", result) - except TypeError as e: - print("使用不存在的参数失败(预期):", str(e)) - except Exception as e: - print("其他错误:", str(e)) - " - # 检查命令是否成功执行(这里预期会失败,因为参数不存在) - if [ $? -eq 0 ]; then - LOG_ERROR "parse_time函数接受了不存在的参数但未报错" - exit 255 - else - LOG_INFO "parse_time函数正确拒绝了不存在的参数" - fi - - # 清理环境:如果测试前未安装,则卸载python3-isodate包 - if [ $INSTALLED -eq 0 ]; then - LOG_INFO "清理环境:卸载python3-isodate包" - dnf remove -y python3-isodate - CHECK_RESULT $? 0 0 "卸载python3-isodate包失败" - LOG_INFO "卸载python3-isodate包成功" - else - LOG_INFO "保持python3-isodate包安装状态" - fi - - LOG_INFO "测试脚本执行完成" -} - -main "$@" \ No newline at end of file diff --git a/testcases/function_test/pkg_test/python-isodate/python-isodate-help/test_python-isodate-help_function_uninstall.sh b/testcases/function_test/pkg_test/python-isodate/python-isodate-help/test_python-isodate-help_function_uninstall.sh deleted file mode 100644 index 6a7355691cc..00000000000 --- a/testcases/function_test/pkg_test/python-isodate/python-isodate-help/test_python-isodate-help_function_uninstall.sh +++ /dev/null @@ -1,65 +0,0 @@ -#!/usr/bin/bash - -# Copyright (c) 2024 ISCAS .ALL rights reserved. -# This program is licensed under Mulan PSL v2. -# You can use it according to the terms and conditions of the Mulan PSL v2. -# http://license.coscl.org.cn/MulanPSL2 -# THIS PROGRAM IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, -# EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, -# MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. -# See the Mulan PSL v2 for more details. - -# ############################################# -# @Author : honghua -# @Contact : honghua@iscas.ac.cn -# @Date : 2026-03-18 -# @License : Mulan PSL v2 -# @Desc : Test uninstallation of the package -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - LOG_INFO "开始测试软件包卸载功能" - LOG_INFO "检查是否已安装python3-isodate-help软件包" - rpm -q python3-isodate-help - if [ $? -eq 0 ]; then - LOG_INFO "软件包已安装,记录当前状态" - INSTALLED=1 - else - LOG_INFO "软件包未安装" - INSTALLED=0 - fi - LOG_INFO "检查yum源中是否存在python3-isodate-help软件包" - dnf list available python3-isodate-help - CHECK_RESULT $? 0 0 "yum源中未找到python3-isodate-help软件包" - LOG_INFO "安装python3-isodate-help软件包" - dnf install -y python3-isodate-help - CHECK_RESULT $? 0 0 "安装python3-isodate-help软件包失败" - LOG_INFO "验证python3-isodate-help软件包已安装" - rpm -q python3-isodate-help - CHECK_RESULT $? 0 0 "python3-isodate-help软件包未正确安装" - LOG_INFO "执行卸载python3-isodate-help软件包" - dnf remove -y python3-isodate-help - CHECK_RESULT $? 0 0 "卸载python3-isodate-help软件包失败" - LOG_INFO "验证python3-isodate-help软件包已卸载" - rpm -q python3-isodate-help - if [ $? -eq 0 ]; then - LOG_ERROR "python3-isodate-help软件包卸载后仍然存在" - exit 1 - else - LOG_INFO "python3-isodate-help软件包已成功卸载" - fi - LOG_INFO "根据初始状态恢复环境" - if [ $INSTALLED -eq 1 ]; then - LOG_INFO "初始状态为已安装,重新安装python3-isodate-help软件包" - dnf install -y python3-isodate-help - CHECK_RESULT $? 0 0 "重新安装python3-isodate-help软件包失败" - LOG_INFO "环境已恢复到初始安装状态" - else - LOG_INFO "初始状态为未安装,无需额外操作" - fi - LOG_INFO "测试完成" -} - -main "$@" \ No newline at end of file diff --git a/testcases/function_test/pkg_test/python-tomlkit/python3-tomlkit/test_python3-tomlkit_function_load.sh b/testcases/function_test/pkg_test/python-tomlkit/python3-tomlkit/test_python3-tomlkit_function_load.sh deleted file mode 100644 index d3edd4b5689..00000000000 --- a/testcases/function_test/pkg_test/python-tomlkit/python3-tomlkit/test_python3-tomlkit_function_load.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-12 -# @License : Mulan PSL v2 -# @Desc : Test loading TOML file -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - - # 检查是否已安装python3-tomlkit - LOG_INFO "检查是否已安装python3-tomlkit" - if rpm -q python3-tomlkit &>/dev/null; then - LOG_INFO "python3-tomlkit已安装,脚本结束时将保持安装状态" - INSTALLED=true - else - LOG_INFO "python3-tomlkit未安装,将在测试结束后卸载" - INSTALLED=false - fi - - # 检查yum源中是否有python3-tomlkit - LOG_INFO "检查yum源中是否有python3-tomlkit" - if ! dnf list available python3-tomlkit &>/dev/null; then - LOG_ERROR "yum源中未找到python3-tomlkit" - exit 255 - fi - - # 安装python3-tomlkit(如果未安装) - if [ "$INSTALLED" = false ]; then - LOG_INFO "开始安装python3-tomlkit" - dnf install -y python3-tomlkit - CHECK_RESULT $? 0 0 "安装python3-tomlkit失败" - fi - - # 测试加载TOML文件功能 - LOG_INFO "测试加载TOML文件功能" - cat < test.toml - [test] - key = "value" - EOF - - python3 -c " - import tomlkit - with open("test.toml", "r") as f: - data = tomlkit.load(f) - print(data) - " > output.log 2>&1 - CHECK_RESULT $? 0 0 "加载TOML文件失败" - - # 验证输出内容 - grep -q "{"test": {"key": "value"}}" output.log - CHECK_RESULT $? 0 0 "TOML文件内容不符合预期" - - # 清理测试文件 - rm -f test.toml output.log - - # 卸载python3-tomlkit(如果脚本开始时未安装) - if [ "$INSTALLED" = false ]; then - LOG_INFO "卸载python3-tomlkit" - dnf remove -y python3-tomlkit - CHECK_RESULT $? 0 0 "卸载python3-tomlkit失败" - fi - - LOG_INFO "测试脚本执行完成" - -} - -main "$@" \ No newline at end of file diff --git a/testcases/function_test/pkg_test/texlive-base/texlive-lib-devel/test_texlive-lib-devel_function_basic.sh b/testcases/function_test/pkg_test/texlive-base/texlive-lib-devel/test_texlive-lib-devel_function_basic.sh deleted file mode 100644 index c7714f2f09b..00000000000 --- a/testcases/function_test/pkg_test/texlive-base/texlive-lib-devel/test_texlive-lib-devel_function_basic.sh +++ /dev/null @@ -1,72 +0,0 @@ -#!/usr/bin/bash - -# Copyright (c) 2024 ISCAS .ALL rights reserved. -# This program is licensed under Mulan PSL v2. -# You can use it according to the terms and conditions of the Mulan PSL v2. -# http://license.coscl.org.cn/MulanPSL2 -# THIS PROGRAM IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, -# EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, -# MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. -# See the Mulan PSL v2 for more details. - -# ############################################# -# @Author : honghua -# @Contact : honghua@iscas.ac.cn -# @Date : 2025-11-27 -# @License : Mulan PSL v2 -# @Desc : Test basic library functionality -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - - # 检查是否已安装texlive-lib-devel软件包 - LOG_INFO "检查是否已安装texlive-lib-devel软件包" - rpm -q texlive-lib-devel > /dev/null 2>&1 - if [ $? -eq 0 ]; then - LOG_INFO "texlive-lib-devel软件包已安装,脚本结束时将保持安装状态" - INSTALLED=true - else - LOG_INFO "texlive-lib-devel软件包未安装,将在测试结束后卸载" - INSTALLED=false - fi - - # 检查yum源中是否有texlive-lib-devel软件包 - LOG_INFO "检查yum源中是否有texlive-lib-devel软件包" - dnf list available texlive-lib-devel > /dev/null 2>&1 - if [ $? -ne 0 ]; then - LOG_ERROR "yum源中未找到texlive-lib-devel软件包" - exit 255 - fi - - # 安装texlive-lib-devel软件包 - if [ "$INSTALLED" = false ]; then - LOG_INFO "正在安装texlive-lib-devel软件包" - dnf install -y texlive-lib-devel > /dev/null 2>&1 - CHECK_RESULT $? 0 0 "安装texlive-lib-devel软件包失败" - fi - - # 测试基本库功能 - LOG_INFO "测试基本库功能" - test_command="some_library_test_command" # 替换为实际的测试命令 - if ! command -v $test_command > /dev/null 2>&1; then - LOG_ERROR "命令$test_command不存在或不支持" - exit 255 - fi - - $test_command > /dev/null 2>&1 - CHECK_RESULT $? 0 0 "测试基本库功能失败" - - # 清理环境:如果之前未安装,则卸载texlive-lib-devel软件包 - if [ "$INSTALLED" = false ]; then - LOG_INFO "正在卸载texlive-lib-devel软件包" - dnf remove -y texlive-lib-devel > /dev/null 2>&1 - CHECK_RESULT $? 0 0 "卸载texlive-lib-devel软件包失败" - fi - - LOG_INFO "测试脚本执行完毕,环境已恢复" - -} - -main "$@" \ No newline at end of file diff --git a/testcases/function_test/pkg_test/texlive-split-f/texlive-datetime2-estonian/test_texlive-datetime2-estonian_function_install.sh b/testcases/function_test/pkg_test/texlive-split-f/texlive-datetime2-estonian/test_texlive-datetime2-estonian_function_install.sh deleted file mode 100644 index 421a9f7f8f3..00000000000 --- a/testcases/function_test/pkg_test/texlive-split-f/texlive-datetime2-estonian/test_texlive-datetime2-estonian_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-18 -# @License : Mulan PSL v2 -# @Desc : Test package installation -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - LOG_INFO "开始测试:Test package installation" - - # 检查是否已安装texlive-datetime2-estonian - LOG_INFO "检查texlive-datetime2-estonian是否已安装" - rpm -q texlive-datetime2-estonian > /dev/null 2>&1 - if [ $? -eq 0 ]; then - LOG_INFO "texlive-datetime2-estonian已安装,跳过安装步骤" - INSTALLED=1 - else - LOG_INFO "texlive-datetime2-estonian未安装,准备安装" - INSTALLED=0 - fi - - # 检查yum源中是否有该软件包 - LOG_INFO "检查yum源中是否有texlive-datetime2-estonian" - dnf list available texlive-datetime2-estonian > /dev/null 2>&1 - CHECK_RESULT $? 0 255 "yum源中不存在texlive-datetime2-estonian" - - if [ $INSTALLED -eq 0 ]; then - # 安装软件包 - LOG_INFO "安装texlive-datetime2-estonian" - dnf install -y texlive-datetime2-estonian - CHECK_RESULT $? 0 0 "安装texlive-datetime2-estonian失败" - fi - - # 测试软件包功能 - LOG_INFO "测试texlive-datetime2-estonian功能" - # 示例命令,实际应根据软件包功能调整 - some_command_related_to_estonian - CHECK_RESULT $? 0 255 "测试命令执行失败或参数不支持" - - # 清理环境 - if [ $INSTALLED -eq 0 ]; then - LOG_INFO "卸载texlive-datetime2-estonian" - dnf remove -y texlive-datetime2-estonian - CHECK_RESULT $? 0 0 "卸载texlive-datetime2-estonian失败" - fi - - LOG_INFO "测试完成:Test package installation" -} - -main "$@" \ No newline at end of file diff --git a/testcases/function_test/pkg_test/texlive-split-h/texlive-epsf-dvipdfmx-doc/test_texlive-epsf-dvipdfmx-doc_function_epsf.sh b/testcases/function_test/pkg_test/texlive-split-h/texlive-epsf-dvipdfmx-doc/test_texlive-epsf-dvipdfmx-doc_function_epsf.sh deleted file mode 100644 index 83c23054ff2..00000000000 --- a/testcases/function_test/pkg_test/texlive-split-h/texlive-epsf-dvipdfmx-doc/test_texlive-epsf-dvipdfmx-doc_function_epsf.sh +++ /dev/null @@ -1,69 +0,0 @@ -#!/usr/bin/bash - -# Copyright (c) 2024 ISCAS .ALL rights reserved. -# This program is licensed under Mulan PSL v2. -# You can use it according to the terms and conditions of the Mulan PSL v2. -# http://license.coscl.org.cn/MulanPSL2 -# THIS PROGRAM IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, -# EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, -# MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. -# See the Mulan PSL v2 for more details. - -# ############################################# -# @Author : honghua -# @Contact : honghua@iscas.ac.cn -# @Date : 2025-11-26 -# @License : Mulan PSL v2 -# @Desc : Test EPSF functionality -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - - # 检查软件包是否已安装 - if dnf list installed texlive-epsf-dvipdfmx-doc &>/dev/null; then - LOG_INFO "texlive-epsf-dvipdfmx-doc 已安装,脚本结束时将保持安装状态" - INSTALLED=true - else - LOG_INFO "texlive-epsf-dvipdfmx-doc 未安装,脚本结束时将卸载" - INSTALLED=false - fi - - # 检查yum源中是否有该软件包 - LOG_INFO "检查yum源中是否存在 texlive-epsf-dvipdfmx-doc" - if ! dnf list available texlive-epsf-dvipdfmx-doc &>/dev/null; then - LOG_ERROR "yum源中不存在 texlive-epsf-dvipdfmx-doc" - exit 255 - fi - - # 安装软件包 - if [ "$INSTALLED" = false ]; then - LOG_INFO "安装 texlive-epsf-dvipdfmx-doc" - dnf install -y texlive-epsf-dvipdfmx-doc - CHECK_RESULT $? 0 0 "安装 texlive-epsf-dvipdfmx-doc 失败" - fi - - # 测试EPSF功能 - LOG_INFO "测试EPSF功能" - command_to_test="some_epsf_command --test" # 替换为实际的EPSF测试命令 - if ! command -v $(echo "$command_to_test" | awk "{print $1}") &>/dev/null; then - LOG_ERROR "命令不支持或不存在: $command_to_test" - exit 255 - fi - - $command_to_test - CHECK_RESULT $? 0 0 "EPSF功能测试失败" - - # 清理环境(如果脚本开始时未安装) - if [ "$INSTALLED" = false ]; then - LOG_INFO "卸载 texlive-epsf-dvipdfmx-doc" - dnf remove -y texlive-epsf-dvipdfmx-doc - CHECK_RESULT $? 0 0 "卸载 texlive-epsf-dvipdfmx-doc 失败" - fi - - LOG_INFO "测试脚本执行完成" - -} - -main "$@" \ No newline at end of file diff --git a/testcases/function_test/pkg_test/texlive-split-v/texlive-simplified-latex-doc/test_texlive-simplified-latex-doc_function_basic.sh b/testcases/function_test/pkg_test/texlive-split-v/texlive-simplified-latex-doc/test_texlive-simplified-latex-doc_function_basic.sh deleted file mode 100644 index 9cacdad49ae..00000000000 --- a/testcases/function_test/pkg_test/texlive-split-v/texlive-simplified-latex-doc/test_texlive-simplified-latex-doc_function_basic.sh +++ /dev/null @@ -1,77 +0,0 @@ -#!/usr/bin/bash - -# Copyright (c) 2024 ISCAS .ALL rights reserved. -# This program is licensed under Mulan PSL v2. -# You can use it according to the terms and conditions of the Mulan PSL v2. -# http://license.coscl.org.cn/MulanPSL2 -# THIS PROGRAM IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, -# EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, -# MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. -# See the Mulan PSL v2 for more details. - -# ############################################# -# @Author : honghua -# @Contact : honghua@iscas.ac.cn -# @Date : 2025-11-26 -# @License : Mulan PSL v2 -# @Desc : Verify basic LaTeX doc functionality -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - - # 检查是否已安装texlive-simplified-latex-doc - LOG_INFO "检查是否已安装texlive-simplified-latex-doc" - rpm -q texlive-simplified-latex-doc - if [ $? -eq 0 ]; then - LOG_INFO "texlive-simplified-latex-doc已安装,测试完成后将保持安装状态" - INSTALLED=true - else - LOG_INFO "texlive-simplified-latex-doc未安装,测试完成后将卸载" - INSTALLED=false - fi - - # 检查yum源中是否有texlive-simplified-latex-doc软件包 - LOG_INFO "检查yum源中是否有texlive-simplified-latex-doc软件包" - dnf list available texlive-simplified-latex-doc - if [ $? -ne 0 ]; then - LOG_ERROR "yum源中未找到texlive-simplified-latex-doc软件包" - exit 255 - fi - - # 安装texlive-simplified-latex-doc软件包(如果未安装) - if [ "$INSTALLED" = false ]; then - LOG_INFO "开始安装texlive-simplified-latex-doc软件包" - dnf install -y texlive-simplified-latex-doc - CHECK_RESULT $? 0 0 "安装texlive-simplified-latex-doc失败" - fi - - # 验证LaTeX基本文档功能 - LOG_INFO "验证LaTeX基本文档功能" - cat > test.tex < /dev/null - if [ $? -eq 0 ]; then - LOG_INFO "texlive-xcookybooky已安装,脚本结束时将保持安装状态" - INSTALLED=1 - else - LOG_INFO "texlive-xcookybooky未安装,将在测试结束后卸载" - INSTALLED=0 - fi - - # 检查yum源中是否有texlive-xcookybooky软件包 - LOG_INFO "检查yum源中是否存在texlive-xcookybooky软件包" - dnf list available texlive-xcookybooky &> /dev/null - if [ $? -ne 0 ]; then - LOG_ERROR "yum源中不存在texlive-xcookybooky软件包" - exit 255 - fi - - # 安装texlive-xcookybooky软件包 - LOG_INFO "安装texlive-xcookybooky软件包" - dnf install -y texlive-xcookybooky &> /dev/null - CHECK_RESULT $? 0 0 "安装texlive-xcookybooky失败" - - # 测试回滚功能 - LOG_INFO "测试回滚功能" - dnf history undo last -y &> /dev/null - CHECK_RESULT $? 0 0 "回滚操作失败" - - # 根据初始状态决定是否卸载软件包 - if [ $INSTALLED -eq 0 ]; then - LOG_INFO "卸载texlive-xcookybooky软件包以恢复环境" - dnf remove -y texlive-xcookybooky &> /dev/null - CHECK_RESULT $? 0 0 "卸载texlive-xcookybooky失败" - else - LOG_INFO "保持texlive-xcookybooky的安装状态" - fi - - LOG_INFO "测试完成,环境已恢复" -} - -main "$@" \ No newline at end of file diff --git a/testcases/function_test/pkg_test/texlive-split-z/texlive-xcookybooky/test_texlive-xcookybooky_uninstall.sh b/testcases/function_test/pkg_test/texlive-split-z/texlive-xcookybooky/test_texlive-xcookybooky_uninstall.sh deleted file mode 100644 index 285e6394920..00000000000 --- a/testcases/function_test/pkg_test/texlive-split-z/texlive-xcookybooky/test_texlive-xcookybooky_uninstall.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-06-26 -# @License : Mulan PSL v2 -# @Desc : 测试texlive-xcookybooky软件包的卸载功能 -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - # 检查是否已经安装texlive-xcookybooky软件包 - LOG_INFO "检查是否已安装texlive-xcookybooky软件包" - rpm -q texlive-xcookybooky > /dev/null 2>&1 - if [ $? -eq 0 ]; then - LOG_INFO "texlive-xcookybooky已安装,脚本结束时将保持安装状态" - INSTALLED=1 - else - LOG_INFO "texlive-xcookybooky未安装,将在测试后卸载" - INSTALLED=0 - fi - - # 检查yum源中是否存在texlive-xcookybooky软件包 - LOG_INFO "检查yum源中是否存在texlive-xcookybooky软件包" - dnf list available texlive-xcookybooky > /dev/null 2>&1 - CHECK_RESULT $? 0 255 "yum源中不存在texlive-xcookybooky软件包" - - # 如果未安装,则安装软件包 - if [ $INSTALLED -eq 0 ]; then - LOG_INFO "安装texlive-xcookybooky软件包" - dnf install -y texlive-xcookybooky - CHECK_RESULT $? 0 0 "安装texlive-xcookybooky软件包失败" - fi - - # 测试卸载功能 - LOG_INFO "测试卸载texlive-xcookybooky软件包" - dnf remove -y texlive-xcookybooky - CHECK_RESULT $? 0 0 "卸载texlive-xcookybooky软件包失败" - - # 如果最初未安装,则重新安装以恢复环境 - if [ $INSTALLED -eq 0 ]; then - LOG_INFO "恢复环境,重新安装texlive-xcookybooky软件包" - dnf install -y texlive-xcookybooky - CHECK_RESULT $? 0 0 "重新安装texlive-xcookybooky软件包失败" - fi - - LOG_INFO "测试完成,环境已恢复" -} - -main "$@" \ No newline at end of file