From 25300a54f08494758abd912419a80c984feffdf9 Mon Sep 17 00:00:00 2001 From: honghua Date: Fri, 17 Apr 2026 12:17:35 +0800 Subject: [PATCH 01/16] update testcase for testsuite texlive-vgrid --- .../texlive-split-y/texlive-vgrid.json | 10 --- .../test_texlive-vgrid_function_install.sh | 63 ------------------- 2 files changed, 73 deletions(-) delete mode 100644 suite2cases/function_test/pkg_test/texlive-split-y/texlive-vgrid.json delete mode 100644 testcases/function_test/pkg_test/texlive-split-y/texlive-vgrid/test_texlive-vgrid_function_install.sh diff --git a/suite2cases/function_test/pkg_test/texlive-split-y/texlive-vgrid.json b/suite2cases/function_test/pkg_test/texlive-split-y/texlive-vgrid.json deleted file mode 100644 index 2895046c9b9..00000000000 --- a/suite2cases/function_test/pkg_test/texlive-split-y/texlive-vgrid.json +++ /dev/null @@ -1,10 +0,0 @@ -{ - "path": "$OET_PATH/testcases/function_test/pkg_test/texlive-split-y/texlive-vgrid", - "machine num": 1, - "cases": [ - { - "name": "test_texlive-vgrid_function_install", - "desc": "Test installation of texlive-vgrid package" - } - ] -} \ No newline at end of file diff --git a/testcases/function_test/pkg_test/texlive-split-y/texlive-vgrid/test_texlive-vgrid_function_install.sh b/testcases/function_test/pkg_test/texlive-split-y/texlive-vgrid/test_texlive-vgrid_function_install.sh deleted file mode 100644 index e9a9b115628..00000000000 --- a/testcases/function_test/pkg_test/texlive-split-y/texlive-vgrid/test_texlive-vgrid_function_install.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 installation of texlive-vgrid package -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - - # 检查texlive-vgrid软件包是否已安装 - if rpm -q texlive-vgrid &>/dev/null; then - LOG_INFO "texlive-vgrid软件包已安装,脚本将保持安装状态" - installed=true - else - LOG_INFO "texlive-vgrid软件包未安装,脚本将进行安装测试" - installed=false - fi - - # 检查yum源中是否有texlive-vgrid软件包 - LOG_INFO "检查yum源中是否存在texlive-vgrid软件包" - if ! dnf list available texlive-vgrid &>/dev/null; then - LOG_ERROR "yum源中未找到texlive-vgrid软件包" - exit 255 - fi - - # 安装texlive-vgrid软件包 - if [ "$installed" = false ]; then - LOG_INFO "开始安装texlive-vgrid软件包" - dnf install -y texlive-vgrid - CHECK_RESULT $? 0 0 "安装texlive-vgrid软件包失败" - fi - - # 测试texlive-vgrid功能是否正常 - LOG_INFO "测试texlive-vgrid功能是否正常" - tex --version &>/dev/null - CHECK_RESULT $? 0 0 "texlive-vgrid功能测试失败" - - # 如果脚本开始时未安装,则在结束时卸载软件包 - if [ "$installed" = false ]; then - LOG_INFO "卸载texlive-vgrid软件包以恢复环境" - dnf remove -y texlive-vgrid - CHECK_RESULT $? 0 0 "卸载texlive-vgrid软件包失败" - fi - - LOG_INFO "测试完成,环境已恢复" - -} - -main "$@" \ No newline at end of file From a873637a55725975ab658fb1929cda1edebf5f2c Mon Sep 17 00:00:00 2001 From: honghua Date: Fri, 17 Apr 2026 12:22:19 +0800 Subject: [PATCH 02/16] update testcase for testsuite qt5-qtenginio-help --- .../qt5-qtenginio/qt5-qtenginio-help.json | 10 --- .../test_qt5-qtenginio-help_function_basic.sh | 73 ------------------- 2 files changed, 83 deletions(-) delete mode 100644 suite2cases/function_test/pkg_test/qt5-qtenginio/qt5-qtenginio-help.json delete mode 100644 testcases/function_test/pkg_test/qt5-qtenginio/qt5-qtenginio-help/test_qt5-qtenginio-help_function_basic.sh diff --git a/suite2cases/function_test/pkg_test/qt5-qtenginio/qt5-qtenginio-help.json b/suite2cases/function_test/pkg_test/qt5-qtenginio/qt5-qtenginio-help.json deleted file mode 100644 index 4197cc546a4..00000000000 --- a/suite2cases/function_test/pkg_test/qt5-qtenginio/qt5-qtenginio-help.json +++ /dev/null @@ -1,10 +0,0 @@ -{ - "path": "$OET_PATH/testcases/function_test/pkg_test/qt5-qtenginio/qt5-qtenginio-help", - "machine num": 1, - "cases": [ - { - "name": "test_qt5-qtenginio-help_function_basic", - "desc": "Test basic functionality of qt5-qtenginio-help" - } - ] -} \ No newline at end of file diff --git a/testcases/function_test/pkg_test/qt5-qtenginio/qt5-qtenginio-help/test_qt5-qtenginio-help_function_basic.sh b/testcases/function_test/pkg_test/qt5-qtenginio/qt5-qtenginio-help/test_qt5-qtenginio-help_function_basic.sh deleted file mode 100644 index 11cd528794e..00000000000 --- a/testcases/function_test/pkg_test/qt5-qtenginio/qt5-qtenginio-help/test_qt5-qtenginio-help_function_basic.sh +++ /dev/null @@ -1,73 +0,0 @@ -#!/usr/bin/bash - -# Copyright (c) 2024 ISCAS .ALL rights reserved. -# This program is licensed under Mulan PSL v2. -# You can use it according to the terms and conditions of the Mulan PSL v2. -# http://license.coscl.org.cn/MulanPSL2 -# THIS PROGRAM IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, -# EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, -# MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. -# See the Mulan PSL v2 for more details. - -# ############################################# -# @Author : honghua -# @Contact : honghua@iscas.ac.cn -# @Date : 2025-12-06 -# @License : Mulan PSL v2 -# @Desc : Test basic functionality of qt5-qtenginio-help -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - - # 检查是否已安装qt5-qtenginio-help - LOG_INFO "检查qt5-qtenginio-help是否已安装" - rpm -q qt5-qtenginio-help > /dev/null 2>&1 - if [ $? -eq 0 ]; then - LOG_INFO "qt5-qtenginio-help已安装,脚本结束时将保持安装状态" - INSTALLED=true - else - LOG_INFO "qt5-qtenginio-help未安装,将在测试结束后卸载" - INSTALLED=false - fi - - # 检查yum源中是否有qt5-qtenginio-help - LOG_INFO "检查yum源中是否存在qt5-qtenginio-help" - dnf list available qt5-qtenginio-help > /dev/null 2>&1 - if [ $? -ne 0 ]; then - LOG_ERROR "yum源中未找到qt5-qtenginio-help" - exit 255 - fi - - # 安装qt5-qtenginio-help - if [ "$INSTALLED" = false ]; then - LOG_INFO "安装qt5-qtenginio-help" - dnf install -y qt5-qtenginio-help - CHECK_RESULT $? 0 0 "安装失败" - fi - - # 测试基本功能 - LOG_INFO "测试基本功能:执行"qt5-qtenginio-help --help"" - output=$(qt5-qtenginio-help --help 2>&1) - CHECK_RESULT $? 0 0 "执行失败" - - # 检查参数是否存在或不支持 - LOG_INFO "检查不支持的参数:"qt5-qtenginio-help --invalid-arg"" - qt5-qtenginio-help --invalid-arg > /dev/null 2>&1 - if [ $? -ne 255 ]; then - LOG_ERROR "不支持参数检测失败" - exit 255 - fi - - # 清理环境 - if [ "$INSTALLED" = false ]; then - LOG_INFO "卸载qt5-qrtengineo-help" - dnf remove -y qt5-qrtengineo-help - CHECK_RESULT $? 0 0 \"卸载失败\" - fi - - LOG_INFO \"测试完成\"" -} - -main "$@" \ No newline at end of file From 9fd558cca360a0b8035514242b5fdb9ac84e137c Mon Sep 17 00:00:00 2001 From: honghua Date: Fri, 17 Apr 2026 12:22:34 +0800 Subject: [PATCH 03/16] update testcase for testsuite gtksourceview4-devel --- .../gtksourceview4/gtksourceview4-devel.json | 12 ---- ...test_gtksourceview4-devel_function_lang.sh | 65 ------------------ ...st_gtksourceview4-devel_function_search.sh | 64 ------------------ ...st_gtksourceview4-devel_function_syntax.sh | 66 ------------------- 4 files changed, 207 deletions(-) delete mode 100644 testcases/function_test/pkg_test/gtksourceview4/gtksourceview4-devel/test_gtksourceview4-devel_function_lang.sh delete mode 100644 testcases/function_test/pkg_test/gtksourceview4/gtksourceview4-devel/test_gtksourceview4-devel_function_search.sh delete mode 100644 testcases/function_test/pkg_test/gtksourceview4/gtksourceview4-devel/test_gtksourceview4-devel_function_syntax.sh diff --git a/suite2cases/function_test/pkg_test/gtksourceview4/gtksourceview4-devel.json b/suite2cases/function_test/pkg_test/gtksourceview4/gtksourceview4-devel.json index aa6f151bf31..cb45ffff1eb 100644 --- a/suite2cases/function_test/pkg_test/gtksourceview4/gtksourceview4-devel.json +++ b/suite2cases/function_test/pkg_test/gtksourceview4/gtksourceview4-devel.json @@ -2,21 +2,9 @@ "path": "$OET_PATH/testcases/function_test/pkg_test/gtksourceview4/gtksourceview4-devel", "machine num": 1, "cases": [ - { - "name": "test_gtksourceview4-devel_function_syntax", - "desc": "Test syntax highlighting functionality" - }, - { - "name": "test_gtksourceview4-devel_function_lang", - "desc": "Test language detection functionality" - }, { "name": "test_gtksourceview4-devel_function_style", "desc": "Test style scheme loading" - }, - { - "name": "test_gtksourceview4-devel_function_search", - "desc": "Test text search feature" } ] } \ No newline at end of file diff --git a/testcases/function_test/pkg_test/gtksourceview4/gtksourceview4-devel/test_gtksourceview4-devel_function_lang.sh b/testcases/function_test/pkg_test/gtksourceview4/gtksourceview4-devel/test_gtksourceview4-devel_function_lang.sh deleted file mode 100644 index 844d465483a..00000000000 --- a/testcases/function_test/pkg_test/gtksourceview4/gtksourceview4-devel/test_gtksourceview4-devel_function_lang.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-09 -# @License : Mulan PSL v2 -# @Desc : Test language detection functionality -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - # 测试语言检测功能 - LOG_INFO "开始测试语言检测功能" - - # 检查是否已安装gtksourceview4-devel软件包 - LOG_INFO "检查gtksourceview4-devel是否已安装" - if rpm -q gtksourceview4-devel > /dev/null; then - LOG_INFO "gtksourceview4-devel已安装,测试完成后将保持安装状态" - installed=true - else - LOG_INFO "gtksourceview4-devel未安装,测试完成后将卸载" - installed=false - fi - - # 检查yum源中是否有gtksourceview4-devel软件包 - LOG_INFO "检查yum源中是否有gtksourceview4-devel软件包" - if ! dnf list available gtksourceview4-devel > /dev/null 2>&1; then - LOG_ERROR "yum源中未找到gtksourceview4-devel软件包" - exit 255 - fi - - # 如果未安装,则安装软件包 - if [ "$installed" = false ]; then - LOG_INFO "安装gtksourceview4-devel软件包" - dnf install -y gtksourceview4-devel - CHECK_RESULT $? 0 0 "安装gtksourceview4-devel失败" - fi - - # 测试语言检测功能 - LOG_INFO "测试语言检测功能" - command_output=$(gtksourceview4-devel --lang-detect testfile.txt) - CHECK_RESULT $? 0 0 "语言检测功能测试失败" - - # 如果最初未安装,则卸载软件包 - if [ "$installed" = false ]; then - LOG_INFO "卸载gtksourceview4-devel软件包" - dnf remove -y gtksourceview4-devel - CHECK_RESULT $? 0 0 "卸载gtksourceview4-devel失败" - fi - - LOG_INFO "测试完成,环境已恢复" -} - -main "$@" \ No newline at end of file diff --git a/testcases/function_test/pkg_test/gtksourceview4/gtksourceview4-devel/test_gtksourceview4-devel_function_search.sh b/testcases/function_test/pkg_test/gtksourceview4/gtksourceview4-devel/test_gtksourceview4-devel_function_search.sh deleted file mode 100644 index b1bb07e8899..00000000000 --- a/testcases/function_test/pkg_test/gtksourceview4/gtksourceview4-devel/test_gtksourceview4-devel_function_search.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-09 -# @License : Mulan PSL v2 -# @Desc : Test text search feature -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - LOG_INFO "开始测试文本搜索功能" - - # 检查是否已安装gtksourceview4-devel软件包 - LOG_INFO "检查gtksourceview4-devel是否已安装" - if rpm -q gtksourceview4-devel &>/dev/null; then - LOG_INFO "gtksourceview4-devel已安装,脚本结束时将保持安装状态" - INSTALLED=true - else - LOG_INFO "gtksourceview4-devel未安装,将在测试结束后卸载" - INSTALLED=false - fi - - # 检查yum源中是否有gtksourceview4-devel软件包 - LOG_INFO "检查yum源中是否存在gtksourceview4-devel软件包" - if ! dnf list available gtksourceview4-devel &>/dev/null; then - LOG_ERROR "yum源中未找到gtksourceview4-devel软件包" - exit 255 - fi - - # 如果未安装,则安装软件包 - if [ "$INSTALLED" = false ]; then - LOG_INFO "正在安装gtksourceview4-devel软件包" - dnf install -y gtksourceview4-devel - CHECK_RESULT $? 0 0 "安装gtksourceview4-devel失败" - fi - - # 测试文本搜索功能 - LOG_INFO "测试文本搜索功能" - gtksourceview4-search "test" - CHECK_RESULT $? 0 0 "文本搜索功能测试失败" - - # 清理环境 - if [ "$INSTALLED" = false ]; then - LOG_INFO "正在卸载gtksourceview4-devel软件包" - dnf remove -y gtksourceview4-devel - CHECK_RESULT $? 0 0 "卸载gtksourceview4-devel失败" - fi - - LOG_INFO "测试完成,环境已恢复" -} - -main "$@" \ No newline at end of file diff --git a/testcases/function_test/pkg_test/gtksourceview4/gtksourceview4-devel/test_gtksourceview4-devel_function_syntax.sh b/testcases/function_test/pkg_test/gtksourceview4/gtksourceview4-devel/test_gtksourceview4-devel_function_syntax.sh deleted file mode 100644 index 83f3152eb9c..00000000000 --- a/testcases/function_test/pkg_test/gtksourceview4/gtksourceview4-devel/test_gtksourceview4-devel_function_syntax.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-30 -# @License : Mulan PSL v2 -# @Desc : Test syntax highlighting functionality -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - - # 检查是否已安装gtksourceview4-devel软件包 - LOG_INFO "检查gtksourceview4-devel是否已安装" - rpm -q gtksourceview4-devel > /dev/null 2>&1 - if [ $? -eq 0 ]; then - LOG_INFO "gtksourceview4-devel已安装,脚本结束时保持安装状态" - INSTALLED=1 - else - LOG_INFO "gtksourceview4-devel未安装,将在测试后卸载" - INSTALLED=0 - fi - - # 检查yum源中是否有gtksourceview4-devel软件包 - LOG_INFO "检查yum源中是否有gtksourceview4-devel软件包" - dnf list available gtksourceview4-devel > /dev/null 2>&1 - if [ $? -ne 0 ]; then - LOG_ERROR "yum源中未找到gtksourceview4-devel软件包" - exit 255 - fi - - # 安装gtksourceview4-devel软件包 - if [ $INSTALLED -eq 0 ]; then - LOG_INFO "安装gtksourceview4-devel软件包" - dnf install -y gtksourceview4-devel > /dev/null 2>&1 - CHECK_RESULT $? 0 0 "安装gtksourceview4-devel失败" - fi - - # 测试语法高亮功能 - LOG_INFO "测试语法高亮功能" - gtksourceview4-devel --version > /dev/null 2>&1 - CHECK_RESULT $? 0 0 "gtksourceview4-devel命令执行失败" - - # 清理环境 - if [ $INSTALLED -eq 0 ]; then - LOG_INFO "卸载gtksourceview4-devel软件包" - dnf remove -y gtksourceview4-devel > /dev/null 2>&1 - CHECK_RESULT $? 0 0 "卸载gtksourceview4-devel失败" - fi - - LOG_INFO "测试完成" - -} - -main "$@" \ No newline at end of file From 491414388fd699160327c4adbff3933adc860022 Mon Sep 17 00:00:00 2001 From: honghua Date: Fri, 17 Apr 2026 12:23:06 +0800 Subject: [PATCH 04/16] update testcase for testsuite texlive-mpcolornames-doc --- .../texlive-mpcolornames-doc.json | 31 ----- ...live-mpcolornames-doc_function_conflict.sh | 73 ------------ ...xlive-mpcolornames-doc_function_install.sh | 78 ------------- ...texlive-mpcolornames-doc_function_usage.sh | 79 ------------- ...exlive-mpcolornames-doc_function_verify.sh | 108 ------------------ ...test_texlive-mpcolornames-doc_reinstall.sh | 66 ----------- .../test_texlive-mpcolornames-doc_rollback.sh | 66 ----------- .../test_texlive-mpcolornames-doc_upgrade.sh | 66 ----------- 8 files changed, 567 deletions(-) delete mode 100644 testcases/function_test/pkg_test/texlive-split-p/texlive-mpcolornames-doc/test_texlive-mpcolornames-doc_function_conflict.sh delete mode 100644 testcases/function_test/pkg_test/texlive-split-p/texlive-mpcolornames-doc/test_texlive-mpcolornames-doc_function_install.sh delete mode 100644 testcases/function_test/pkg_test/texlive-split-p/texlive-mpcolornames-doc/test_texlive-mpcolornames-doc_function_usage.sh delete mode 100644 testcases/function_test/pkg_test/texlive-split-p/texlive-mpcolornames-doc/test_texlive-mpcolornames-doc_function_verify.sh delete mode 100644 testcases/function_test/pkg_test/texlive-split-p/texlive-mpcolornames-doc/test_texlive-mpcolornames-doc_reinstall.sh delete mode 100644 testcases/function_test/pkg_test/texlive-split-p/texlive-mpcolornames-doc/test_texlive-mpcolornames-doc_rollback.sh delete mode 100644 testcases/function_test/pkg_test/texlive-split-p/texlive-mpcolornames-doc/test_texlive-mpcolornames-doc_upgrade.sh diff --git a/suite2cases/function_test/pkg_test/texlive-split-p/texlive-mpcolornames-doc.json b/suite2cases/function_test/pkg_test/texlive-split-p/texlive-mpcolornames-doc.json index 6c7e75e58b3..f31190f57a7 100644 --- a/suite2cases/function_test/pkg_test/texlive-split-p/texlive-mpcolornames-doc.json +++ b/suite2cases/function_test/pkg_test/texlive-split-p/texlive-mpcolornames-doc.json @@ -7,11 +7,6 @@ "desc": "测试 texlive-mpcolornames-doc 软件包的卸载功能", "machine num": 1 }, - { - "name": "test_texlive-mpcolornames-doc_upgrade", - "desc": "测试 texlive-mpcolornames-doc 软件包的升级功能", - "machine num": 1 - }, { "name": "test_texlive-mpcolornames-doc_install", "desc": "测试 texlive-mpcolornames-doc 软件包的安装功能", @@ -21,32 +16,6 @@ "name": "test_texlive-mpcolornames-doc_downgrade", "desc": "测试 texlive-mpcolornames-doc 软件包的降级功能", "machine num": 1 - }, - { - "name": "test_texlive-mpcolornames-doc_rollback", - "desc": "测试 texlive-mpcolornames-doc 软件包的回滚功能", - "machine num": 1 - }, - { - "name": "test_texlive-mpcolornames-doc_reinstall", - "desc": "测试 texlive-mpcolornames-doc 软件包的重新安装功能", - "machine num": 1 - }, - { - "name": "test_texlive-mpcolornames-doc_function_install", - "desc": "测试 texlive-mpcolornames-doc 软件包的基本安装功能" - }, - { - "name": "test_texlive-mpcolornames-doc_function_verify", - "desc": "验证 texlive-mpcolornames-doc 软件包文件是否完整" - }, - { - "name": "test_texlive-mpcolornames-doc_function_usage", - "desc": "测试 texlive-mpcolornames-doc 文档内容的可访问性" - }, - { - "name": "test_texlive-mpcolornames-doc_function_conflict", - "desc": "测试 texlive-mpcolornames-doc 与其他包的安装冲突" } ] } \ No newline at end of file diff --git a/testcases/function_test/pkg_test/texlive-split-p/texlive-mpcolornames-doc/test_texlive-mpcolornames-doc_function_conflict.sh b/testcases/function_test/pkg_test/texlive-split-p/texlive-mpcolornames-doc/test_texlive-mpcolornames-doc_function_conflict.sh deleted file mode 100644 index 0e5ad22667f..00000000000 --- a/testcases/function_test/pkg_test/texlive-split-p/texlive-mpcolornames-doc/test_texlive-mpcolornames-doc_function_conflict.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-04 -# @License : Mulan PSL v2 -# @Desc : 测试 texlive-mpcolornames-doc 与其他包的安装冲突 -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - LOG_INFO "开始测试 texlive-mpcolornames-doc 与其他包的安装冲突" - - LOG_INFO "检查 texlive-mpcolornames-doc 是否已在 yum 源中" - dnf list available texlive-mpcolornames-doc > /dev/null 2>&1 - if [ $? -ne 0 ]; then - LOG_ERROR "yum 源中未找到 texlive-mpcolornames-doc 软件包" - exit 255 - fi - - LOG_INFO "检查当前系统是否已安装 texlive-mpcolornames-doc" - rpm -q texlive-mpcolornames-doc > /dev/null 2>&1 - if [ $? -eq 0 ]; then - LOG_INFO "texlive-mpcolornames-doc 已安装,标记为已安装状态" - ALREADY_INSTALLED=1 - else - LOG_INFO "texlive-mpcolornames-doc 未安装,标记为未安装状态" - ALREADY_INSTALLED=0 - fi - - if [ $ALREADY_INSTALLED -eq 0 ]; then - LOG_INFO "安装 texlive-mpcolornames-doc" - dnf install -y texlive-mpcolornames-doc - CHECK_RESULT $? 0 0 "安装 texlive-mpcolornames-doc 失败" - fi - - LOG_INFO "尝试安装可能冲突的包:texlive-collection-latexrecommended" - dnf install -y texlive-collection-latexrecommended > /tmp/install_conflict.log 2>&1 - if [ $? -ne 0 ]; then - LOG_INFO "检测到安装冲突,符合预期" - if grep -q "conflicts with" /tmp/install_conflict.log; then - LOG_INFO "冲突信息确认:texlive-mpcolornames-doc 与 texlive-collection-latexrecommended 存在冲突" - CHECK_RESULT $? 0 0 "未检测到预期的冲突信息" - else - LOG_ERROR "安装失败但未检测到明确的冲突信息" - exit 1 - fi - else - LOG_ERROR "未检测到安装冲突,不符合预期" - exit 1 - fi - - if [ $ALREADY_INSTALLED -eq 0 ]; then - LOG_INFO "清理测试环境:卸载 texlive-mpcolornames-doc" - dnf remove -y texlive-mpcolornames-doc - CHECK_RESULT $? 0 0 "卸载 texlive-mpcolornames-doc 失败" - fi - - LOG_INFO "测试完成,环境已恢复" -} - -main "$@" \ No newline at end of file diff --git a/testcases/function_test/pkg_test/texlive-split-p/texlive-mpcolornames-doc/test_texlive-mpcolornames-doc_function_install.sh b/testcases/function_test/pkg_test/texlive-split-p/texlive-mpcolornames-doc/test_texlive-mpcolornames-doc_function_install.sh deleted file mode 100644 index bae955082f4..00000000000 --- a/testcases/function_test/pkg_test/texlive-split-p/texlive-mpcolornames-doc/test_texlive-mpcolornames-doc_function_install.sh +++ /dev/null @@ -1,78 +0,0 @@ -#!/usr/bin/bash - -# Copyright (c) 2024 ISCAS .ALL rights reserved. -# This program is licensed under Mulan PSL v2. -# You can use it according to the terms and conditions of the Mulan PSL v2. -# http://license.coscl.org.cn/MulanPSL2 -# THIS PROGRAM IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, -# EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, -# MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. -# See the Mulan PSL v2 for more details. - -# ############################################# -# @Author : honghua -# @Contact : honghua@iscas.ac.cn -# @Date : 2026-03-04 -# @License : Mulan PSL v2 -# @Desc : 测试 texlive-mpcolornames-doc 软件包的基本安装功能 -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - # 检查软件包是否已安装 - LOG_INFO "检查 texlive-mpcolornames-doc 是否已安装" - rpm -q texlive-mpcolornames-doc - if [ $? -eq 0 ]; then - LOG_INFO "软件包 texlive-mpcolornames-doc 已安装" - already_installed=1 - else - LOG_INFO "软件包 texlive-mpcolornames-doc 未安装" - already_installed=0 - fi - - # 检查软件包是否在yum源中 - LOG_INFO "检查 yum 源中是否存在 texlive-mpcolornames-doc" - dnf list available texlive-mpcolornames-doc - if [ $? -ne 0 ]; then - LOG_ERROR "软件包 texlive-mpcolornames-doc 不在 yum 源中" - exit 255 - fi - - # 如果未安装,则安装软件包 - if [ $already_installed -eq 0 ]; then - LOG_INFO "安装 texlive-mpcolornames-doc" - dnf install -y texlive-mpcolornames-doc - CHECK_RESULT $? 0 0 "安装 texlive-mpcolornames-doc 失败" - - # 验证安装 - LOG_INFO "验证 texlive-mpcolornames-doc 是否安装成功" - rpm -q texlive-mpcolornames-doc - CHECK_RESULT $? 0 0 "验证 texlive-mpcolornames-doc 安装失败" - fi - - # 测试软件包的基本功能 - LOG_INFO "测试 texlive-mpcolornames-doc 的基本功能" - rpm -ql texlive-mpcolornames-doc | head -5 - CHECK_RESULT $? 0 0 "获取 texlive-mpcolornames-doc 文件列表失败" - - # 环境恢复 - if [ $already_installed -eq 0 ]; then - LOG_INFO "卸载 texlive-mpcolornames-doc" - dnf remove -y texlive-mpcolornames-doc - CHECK_RESULT $? 0 0 "卸载 texlive-mpcolornames-doc 失败" - - LOG_INFO "验证 texlive-mpcolornames-doc 是否卸载成功" - rpm -q texlive-mpcolornames-doc - if [ $? -eq 0 ]; then - LOG_ERROR "texlive-mpcolornames-doc 卸载失败" - exit 1 - fi - else - LOG_INFO "保持 texlive-mpcolornames-doc 的安装状态" - fi - - LOG_INFO "测试完成" -} - -main "$@" \ No newline at end of file diff --git a/testcases/function_test/pkg_test/texlive-split-p/texlive-mpcolornames-doc/test_texlive-mpcolornames-doc_function_usage.sh b/testcases/function_test/pkg_test/texlive-split-p/texlive-mpcolornames-doc/test_texlive-mpcolornames-doc_function_usage.sh deleted file mode 100644 index 03e3be6048c..00000000000 --- a/testcases/function_test/pkg_test/texlive-split-p/texlive-mpcolornames-doc/test_texlive-mpcolornames-doc_function_usage.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-04 -# @License : Mulan PSL v2 -# @Desc : 测试 texlive-mpcolornames-doc 文档内容的可访问性 -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - LOG_INFO "开始测试 texlive-mpcolornames-doc 文档内容的可访问性" - LOG_INFO "步骤1: 检查系统中是否已安装 texlive-mpcolornames-doc 软件包" - rpm -q texlive-mpcolornames-doc - if [ $? -eq 0 ]; then - LOG_INFO "系统中已安装 texlive-mpcolornames-doc 软件包" - installed=true - else - LOG_INFO "系统中未安装 texlive-mpcolornames-doc 软件包" - installed=false - fi - - LOG_INFO "步骤2: 检查 yum 源中是否存在 texlive-mpcolornames-doc 软件包" - dnf list available texlive-mpcolornames-doc - CHECK_RESULT $? 0 0 "yum 源中未找到 texlive-mpcolornames-doc 软件包" - if [ $? -ne 0 ]; then - LOG_ERROR "yum 源中未找到 texlive-mpcolornames-doc 软件包" - exit 255 - fi - - if [ "$installed" = false ]; then - LOG_INFO "步骤3: 安装 texlive-mpcolornames-doc 软件包" - dnf install -y texlive-mpcolornames-doc - CHECK_RESULT $? 0 0 "安装 texlive-mpcolornames-doc 软件包失败" - LOG_INFO "成功安装 texlive-mpcolornames-doc 软件包" - fi - - LOG_INFO "步骤4: 测试 texlive-mpcolornames-doc 文档内容的可访问性" - LOG_INFO "检查文档文件是否存在" - rpm -ql texlive-mpcolornames-doc | head -5 - CHECK_RESULT $? 0 0 "未找到 texlive-mpcolornames-doc 文档文件" - - LOG_INFO "尝试访问文档目录" - doc_path=$(rpm -ql texlive-mpcolornames-doc | head -1) - if [ -d "$doc_path" ]; then - LOG_INFO "文档目录存在: $doc_path" - ls -la "$doc_path" - CHECK_RESULT $? 0 0 "无法列出文档目录内容" - else - LOG_INFO "文档文件存在: $doc_path" - file "$doc_path" - CHECK_RESULT $? 0 0 "无法访问文档文件" - fi - - LOG_INFO "步骤5: 清理测试环境" - if [ "$installed" = false ]; then - LOG_INFO "卸载 texlive-mpcolornames-doc 软件包" - dnf remove -y texlive-mpcolornames-doc - CHECK_RESULT $? 0 0 "卸载 texlive-mpcolornames-doc 软件包失败" - LOG_INFO "成功卸载 texlive-mpcolornames-doc 软件包" - else - LOG_INFO "保持 texlive-mpcolornames-doc 软件包安装状态" - fi - - LOG_INFO "测试完成" -} - -main "$@" \ No newline at end of file diff --git a/testcases/function_test/pkg_test/texlive-split-p/texlive-mpcolornames-doc/test_texlive-mpcolornames-doc_function_verify.sh b/testcases/function_test/pkg_test/texlive-split-p/texlive-mpcolornames-doc/test_texlive-mpcolornames-doc_function_verify.sh deleted file mode 100644 index 9885ea7d1bb..00000000000 --- a/testcases/function_test/pkg_test/texlive-split-p/texlive-mpcolornames-doc/test_texlive-mpcolornames-doc_function_verify.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-03-04 -# @License : Mulan PSL v2 -# @Desc : 验证 texlive-mpcolornames-doc 软件包文件是否完整 -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - # 定义日志函数(虽然题目说不需要定义,但实际使用时需要定义) - LOG_INFO() { - echo "[INFO] $*" - } - - LOG_ERROR() { - echo "[ERROR] $*" >&2 - } - - # 检查软件包是否存在 - check_package_exists() { - local package_name="$1" - dnf list available "$package_name" &>/dev/null - return $? - } - - # 安装软件包 - 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 失败" - } - - # 验证文件完整性 - verify_files() { - local package_name="$1" - LOG_INFO "验证 $package_name 文件完整性" - rpm -V "$package_name" - CHECK_RESULT $? 0 0 "软件包 $package_name 文件不完整" - } - - # 主函数 - main() { - local package_name="texlive-mpcolornames-doc" - local installed=false - - # 步骤1:检查软件包是否在yum源中 - LOG_INFO "步骤1: 检查软件包 $package_name 是否在yum源中" - if ! check_package_exists "$package_name"; 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 已安装" - installed=true - else - LOG_INFO "软件包 $package_name 未安装" - installed=false - fi - - # 步骤3:如果未安装,则安装软件包 - if [ "$installed" = false ]; then - install_package "$package_name" - fi - - # 步骤4:验证软件包文件完整性 - verify_files "$package_name" - - # 步骤5:环境恢复 - LOG_INFO "步骤5: 环境恢复" - if [ "$installed" = false ]; then - uninstall_package "$package_name" - else - LOG_INFO "保持软件包 $package_name 安装状态" - fi - - LOG_INFO "测试完成" - } - - # 执行主函数 - main "$@" -} - -main "$@" \ No newline at end of file diff --git a/testcases/function_test/pkg_test/texlive-split-p/texlive-mpcolornames-doc/test_texlive-mpcolornames-doc_reinstall.sh b/testcases/function_test/pkg_test/texlive-split-p/texlive-mpcolornames-doc/test_texlive-mpcolornames-doc_reinstall.sh deleted file mode 100644 index 57471d459ef..00000000000 --- a/testcases/function_test/pkg_test/texlive-split-p/texlive-mpcolornames-doc/test_texlive-mpcolornames-doc_reinstall.sh +++ /dev/null @@ -1,66 +0,0 @@ -#!/usr/bin/bash - -# Copyright (c) 2024 ISCAS .ALL rights reserved. -# This program is licensed under Mulan PSL v2. -# You can use it according to the terms and conditions of the Mulan PSL v2. -# http://license.coscl.org.cn/MulanPSL2 -# THIS PROGRAM IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, -# EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, -# MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. -# See the Mulan PSL v2 for more details. - -# ############################################# -# @Author : honghua -# @Contact : honghua@iscas.ac.cn -# @Date : 2025-06-29 -# @License : Mulan PSL v2 -# @Desc : 测试 texlive-mpcolornames-doc 软件包的重新安装功能 -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - LOG_INFO "开始测试 texlive-mpcolornames-doc 软件包的重新安装功能" - - # 检查软件包是否存在于yum源中 - LOG_INFO "检查 texlive-mpcolornames-doc 是否存在于yum源中" - dnf list available texlive-mpcolornames-doc > /dev/null 2>&1 - if [ $? -ne 0 ]; then - LOG_ERROR "texlive-mpcolornames-doc 不存在于yum源中" - exit 255 - fi - - # 检查软件包是否已安装 - LOG_INFO "检查 texlive-mpcolornames-doc 是否已安装" - rpm -q texlive-mpcolornames-doc > /dev/null 2>&1 - if [ $? -eq 0 ]; then - LOG_INFO "texlive-mpcolornames-doc 已安装,保持安装状态" - INSTALLED=true - else - LOG_INFO "texlive-mpcolornames-doc 未安装,将进行安装测试" - INSTALLED=false - fi - - # 如果未安装,则进行安装测试 - if [ "$INSTALLED" = false ]; then - LOG_INFO "开始安装 texlive-mpcolornames-doc" - dnf install -y texlive-mpcolornames-doc > /dev/null 2>&1 - CHECK_RESULT $? 0 0 "安装 texlive-mpcolornames-doc 失败" - fi - - # 测试重新安装功能 - LOG_INFO "测试重新安装 texlive-mpcolornames-doc" - dnf reinstall -y texlive-mpcolornames-doc > /dev/null 2>&1 - CHECK_RESULT $? 0 0 "重新安装 texlive-mpcolornames-doc 失败" - - # 如果最初未安装,则卸载软件包 - if [ "$INSTALLED" = false ]; then - LOG_INFO "卸载 texlive-mpcolornames-doc" - dnf remove -y texlive-mpcolornames-doc > /dev/null 2>&1 - CHECK_RESULT $? 0 0 "卸载 texlive-mpcolornames-doc 失败" - fi - - LOG_INFO "测试完成,环境已恢复" -} - -main "$@" \ No newline at end of file diff --git a/testcases/function_test/pkg_test/texlive-split-p/texlive-mpcolornames-doc/test_texlive-mpcolornames-doc_rollback.sh b/testcases/function_test/pkg_test/texlive-split-p/texlive-mpcolornames-doc/test_texlive-mpcolornames-doc_rollback.sh deleted file mode 100644 index 2a39a8997a7..00000000000 --- a/testcases/function_test/pkg_test/texlive-split-p/texlive-mpcolornames-doc/test_texlive-mpcolornames-doc_rollback.sh +++ /dev/null @@ -1,66 +0,0 @@ -#!/usr/bin/bash - -# Copyright (c) 2024 ISCAS .ALL rights reserved. -# This program is licensed under Mulan PSL v2. -# You can use it according to the terms and conditions of the Mulan PSL v2. -# http://license.coscl.org.cn/MulanPSL2 -# THIS PROGRAM IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, -# EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, -# MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. -# See the Mulan PSL v2 for more details. - -# ############################################# -# @Author : honghua -# @Contact : honghua@iscas.ac.cn -# @Date : 2025-06-29 -# @License : Mulan PSL v2 -# @Desc : 测试 texlive-mpcolornames-doc 软件包的回滚功能 -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - - # 检查texlive-mpcolornames-doc软件包是否已安装 - LOG_INFO "检查texlive-mpcolornames-doc软件包是否已安装" - rpm -q texlive-mpcolornames-doc - if [ $? -eq 0 ]; then - LOG_INFO "texlive-mpcolornames-doc软件包已安装,脚本结束时将保持安装状态" - INSTALLED=true - else - LOG_INFO "texlive-mpcolornames-doc软件包未安装,将在测试步骤中安装" - INSTALLED=false - fi - - # 检查yum源中是否存在texlive-mpcolornames-doc软件包 - LOG_INFO "检查yum源中是否存在texlive-mpcolornames-doc软件包" - dnf list available texlive-mpcolornames-doc - if [ $? -ne 0 ]; then - LOG_ERROR "yum源中不存在texlive-mpcolornames-doc软件包" - exit 255 - fi - - # 安装texlive-mpcolornames-doc软件包 - if [ "$INSTALLED" = false ]; then - LOG_INFO "开始安装texlive-mpcolornames-doc软件包" - dnf install -y texlive-mpcolornames-doc - CHECK_RESULT $? 0 0 "安装texlive-mpcolornames-doc软件包失败" - fi - - # 测试回滚功能 - LOG_INFO "测试texlive-mpcolornames-doc软件包的回滚功能" - dnf history undo last -y - CHECK_RESULT $? 0 0 "回滚texlive-mpcolornames-doc软件包失败" - - # 清理环境 - if [ "$INSTALLED" = false ]; then - LOG_INFO "清理环境,卸载texlive-mpcolornames-doc软件包" - dnf remove -y texlive-mpcolornames-doc - CHECK_RESULT $? 0 0 "卸载texlive-mpcolornames-doc软件包失败" - fi - - LOG_INFO "测试脚本执行完毕" - -} - -main "$@" \ No newline at end of file diff --git a/testcases/function_test/pkg_test/texlive-split-p/texlive-mpcolornames-doc/test_texlive-mpcolornames-doc_upgrade.sh b/testcases/function_test/pkg_test/texlive-split-p/texlive-mpcolornames-doc/test_texlive-mpcolornames-doc_upgrade.sh deleted file mode 100644 index 7acbcd05378..00000000000 --- a/testcases/function_test/pkg_test/texlive-split-p/texlive-mpcolornames-doc/test_texlive-mpcolornames-doc_upgrade.sh +++ /dev/null @@ -1,66 +0,0 @@ -#!/usr/bin/bash - -# Copyright (c) 2024 ISCAS .ALL rights reserved. -# This program is licensed under Mulan PSL v2. -# You can use it according to the terms and conditions of the Mulan PSL v2. -# http://license.coscl.org.cn/MulanPSL2 -# THIS PROGRAM IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, -# EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, -# MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. -# See the Mulan PSL v2 for more details. - -# ############################################# -# @Author : honghua -# @Contact : honghua@iscas.ac.cn -# @Date : 2025-06-19 -# @License : Mulan PSL v2 -# @Desc : 测试 texlive-mpcolornames-doc 软件包的升级功能 -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - - # 检查texlive-mpcolornames-doc软件包是否已安装 - LOG_INFO "检查texlive-mpcolornames-doc软件包是否已安装" - rpm -q texlive-mpcolornames-doc - if [ $? -eq 0 ]; then - LOG_INFO "texlive-mpcolornames-doc软件包已安装,脚本结束后将保持安装状态" - INSTALLED=true - else - LOG_INFO "texlive-mpcolornames-doc软件包未安装,将在测试结束后卸载" - INSTALLED=false - fi - - # 检查yum源中是否存在texlive-mpcolornames-doc软件包 - LOG_INFO "检查yum源中是否存在texlive-mpcolornames-doc软件包" - dnf list available texlive-mpcolornames-doc &> /dev/null - if [ $? -ne 0 ]; then - LOG_ERROR "yum源中不存在texlive-mpcolornames-doc软件包" - exit 255 - fi - - # 安装texlive-mpcolornames-doc软件包 - LOG_INFO "安装texlive-mpcolornames-doc软件包" - dnf install -y texlive-mpcolornames-doc - CHECK_RESULT $? 0 0 "安装texlive-mpcolornames-doc软件包失败" - - # 检查升级功能 - LOG_INFO "测试texlive-mpcolornames-doc软件包的升级功能" - dnf upgrade -y texlive-mpcolornames-doc - CHECK_RESULT $? 0 0 "升级texlive-mpcolornames-doc软件包失败" - - # 清理环境:如果初始未安装,则卸载软件包 - if [ "$INSTALLED" = false ]; then - LOG_INFO "清理环境:卸载texlive-mpcolornames-doc软件包" - dnf remove -y texlive-mpcolornames-doc - CHECK_RESULT $? 0 0 "卸载texlive-mpcolornames-doc软件包失败" - else - LOG_INFO "保持环境:不卸载texlive-mpcolornames-doc软件包" - fi - - LOG_INFO "测试完成,环境已恢复" - -} - -main "$@" \ No newline at end of file From b3ce9f82900a3a03137230a9ae1ace0962b1e1a5 Mon Sep 17 00:00:00 2001 From: honghua Date: Fri, 17 Apr 2026 12:24:12 +0800 Subject: [PATCH 05/16] update testcase for testsuite texlive-docmute-doc --- .../texlive-split-g/texlive-docmute-doc.json | 12 --- ...xlive-docmute-doc_documentation_present.sh | 77 ------------------- ...est_texlive-docmute-doc_package_present.sh | 74 ------------------ .../test_texlive-docmute-doc_remove.sh | 64 --------------- 4 files changed, 227 deletions(-) delete mode 100644 testcases/function_test/pkg_test/texlive-split-g/texlive-docmute-doc/test_texlive-docmute-doc_documentation_present.sh delete mode 100644 testcases/function_test/pkg_test/texlive-split-g/texlive-docmute-doc/test_texlive-docmute-doc_package_present.sh delete mode 100644 testcases/function_test/pkg_test/texlive-split-g/texlive-docmute-doc/test_texlive-docmute-doc_remove.sh diff --git a/suite2cases/function_test/pkg_test/texlive-split-g/texlive-docmute-doc.json b/suite2cases/function_test/pkg_test/texlive-split-g/texlive-docmute-doc.json index a259e2737c5..01db15dec1d 100644 --- a/suite2cases/function_test/pkg_test/texlive-split-g/texlive-docmute-doc.json +++ b/suite2cases/function_test/pkg_test/texlive-split-g/texlive-docmute-doc.json @@ -5,18 +5,6 @@ { "name": "test_texlive-docmute-doc_install", "desc": "测试软件包是否可以通过包管理器成功安装。" - }, - { - "name": "test_texlive-docmute-doc_package_present", - "desc": "测试软件包文件(如.sty文件)是否存在于TeX Live系统中。" - }, - { - "name": "test_texlive-docmute-doc_documentation_present", - "desc": "测试软件包文档文件(如.pdf文件)是否存在于TeX Live文档目录中。" - }, - { - "name": "test_texlive-docmute-doc_remove", - "desc": "测试软件包是否可以通过包管理器成功卸载。" } ] } \ No newline at end of file diff --git a/testcases/function_test/pkg_test/texlive-split-g/texlive-docmute-doc/test_texlive-docmute-doc_documentation_present.sh b/testcases/function_test/pkg_test/texlive-split-g/texlive-docmute-doc/test_texlive-docmute-doc_documentation_present.sh deleted file mode 100644 index 09a383a9a79..00000000000 --- a/testcases/function_test/pkg_test/texlive-split-g/texlive-docmute-doc/test_texlive-docmute-doc_documentation_present.sh +++ /dev/null @@ -1,77 +0,0 @@ -#!/usr/bin/bash - -# Copyright (c) 2024 ISCAS .ALL rights reserved. -# This program is licensed under Mulan PSL v2. -# You can use it according to the terms and conditions of the Mulan PSL v2. -# http://license.coscl.org.cn/MulanPSL2 -# THIS PROGRAM IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, -# EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, -# MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. -# See the Mulan PSL v2 for more details. - -# ############################################# -# @Author : honghua -# @Contact : honghua@iscas.ac.cn -# @Date : 2026-03-28 -# @License : Mulan PSL v2 -# @Desc : 测试软件包文档文件(如.pdf文件)是否存在于TeX Live文档目录中。 -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - # 检查是否已经安装了texlive-docmute-doc软件包 - LOG_INFO "检查texlive-docmute-doc软件包是否已安装" - rpm -q texlive-docmute-doc - if [ $? -eq 0 ]; then - LOG_INFO "texlive-docmute-doc已安装,将保持安装状态" - INSTALLED=true - else - LOG_INFO "texlive-docmute-doc未安装,将在测试过程中安装" - INSTALLED=false - fi - - # 检查yum源中是否有texlive-docmute-doc软件包 - LOG_INFO "检查yum源中是否存在texlive-docmute-doc软件包" - dnf list available texlive-docmute-doc - if [ $? -ne 0 ]; then - LOG_ERROR "yum源中未找到texlive-docmute-doc软件包" - exit 255 - fi - - # 如果未安装,则安装软件包 - if [ "$INSTALLED" = false ]; then - LOG_INFO "安装texlive-docmute-doc软件包" - dnf install -y texlive-docmute-doc - CHECK_RESULT $? 0 0 "安装texlive-docmute-doc软件包失败" - fi - - # 测试软件包文档文件(如.pdf文件)是否存在于TeX Live文档目录中 - LOG_INFO "检查TeX Live文档目录中是否存在.pdf文件" - TEXLIVE_DOC_DIR="/usr/share/texlive-doc/texmf-dist/doc" - if [ -d "$TEXLIVE_DOC_DIR" ]; then - LOG_INFO "TeX Live文档目录存在:$TEXLIVE_DOC_DIR" - PDF_FILES=$(find "$TEXLIVE_DOC_DIR" -name "*.pdf" 2>/dev/null | wc -l) - if [ "$PDF_FILES" -gt 0 ]; then - LOG_INFO "TeX Live文档目录中找到 $PDF_FILES 个.pdf文件" - else - LOG_ERROR "TeX Live文档目录中未找到.pdf文件" - exit 1 - fi - else - LOG_ERROR "TeX Live文档目录不存在:$TEXLIVE_DOC_DIR" - exit 1 - fi - - # 环境恢复 - LOG_INFO "恢复测试环境" - if [ "$INSTALLED" = false ]; then - LOG_INFO "卸载texlive-docmute-doc软件包" - dnf remove -y texlive-docmute-doc - CHECK_RESULT $? 0 0 "卸载texlive-docmute-doc软件包失败" - fi - - LOG_INFO "测试完成" -} - -main "$@" \ No newline at end of file diff --git a/testcases/function_test/pkg_test/texlive-split-g/texlive-docmute-doc/test_texlive-docmute-doc_package_present.sh b/testcases/function_test/pkg_test/texlive-split-g/texlive-docmute-doc/test_texlive-docmute-doc_package_present.sh deleted file mode 100644 index d3701950320..00000000000 --- a/testcases/function_test/pkg_test/texlive-split-g/texlive-docmute-doc/test_texlive-docmute-doc_package_present.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-28 -# @License : Mulan PSL v2 -# @Desc : 测试软件包文件(如.sty文件)是否存在于TeX Live系统中。 -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - # 环境检查:检查是否已安装texlive-docmute-doc软件包 - LOG_INFO "开始检查是否已安装texlive-docmute-doc软件包" - rpm -q texlive-docmute-doc > /dev/null 2>&1 - if [ $? -eq 0 ]; then - LOG_INFO "检测到texlive-docmute-doc已安装,脚本结束时将保持安装状态" - ALREADY_INSTALLED=1 - else - LOG_INFO "texlive-docmute-doc未安装,将在测试过程中安装" - ALREADY_INSTALLED=0 - fi - - # 检查yum源中是否存在texlive-docmute-doc软件包 - LOG_INFO "检查yum源中是否存在texlive-docmute-doc软件包" - dnf list available texlive-docmute-doc > /dev/null 2>&1 - CHECK_RESULT $? 0 0 "yum源中未找到texlive-docmute-doc软件包" - if [ $? -ne 0 ]; then - LOG_ERROR "yum源中不存在texlive-docmute-doc软件包" - exit 255 - fi - - # 如果未安装,则安装texlive-docmute-doc软件包 - if [ ${ALREADY_INSTALLED} -eq 0 ]; then - LOG_INFO "开始安装texlive-docmute-doc软件包" - dnf install -y texlive-docmute-doc - CHECK_RESULT $? 0 0 "安装texlive-docmute-doc软件包失败" - LOG_INFO "texlive-docmute-doc软件包安装成功" - fi - - # 测试步骤:检查TeX Live系统中是否存在docmute.sty文件 - LOG_INFO "开始测试TeX Live系统中是否存在docmute.sty文件" - kpsewhich docmute.sty > /dev/null 2>&1 - CHECK_RESULT $? 0 0 "TeX Live系统中未找到docmute.sty文件" - if [ $? -eq 0 ]; then - LOG_INFO "测试通过:TeX Live系统中存在docmute.sty文件" - else - LOG_ERROR "测试失败:TeX Live系统中不存在docmute.sty文件" - fi - - # 环境清理:如果测试前未安装,则卸载软件包 - if [ ${ALREADY_INSTALLED} -eq 0 ]; then - LOG_INFO "清理环境:卸载texlive-docmute-doc软件包" - dnf remove -y texlive-docmute-doc - CHECK_RESULT $? 0 0 "卸载texlive-docmute-doc软件包失败" - LOG_INFO "texlive-docmute-doc软件包卸载成功" - else - LOG_INFO "测试前已安装texlive-docmute-doc,保持安装状态" - fi - - LOG_INFO "测试脚本执行完毕" -} - -main "$@" \ No newline at end of file diff --git a/testcases/function_test/pkg_test/texlive-split-g/texlive-docmute-doc/test_texlive-docmute-doc_remove.sh b/testcases/function_test/pkg_test/texlive-split-g/texlive-docmute-doc/test_texlive-docmute-doc_remove.sh deleted file mode 100644 index 5b2a1bc708f..00000000000 --- a/testcases/function_test/pkg_test/texlive-split-g/texlive-docmute-doc/test_texlive-docmute-doc_remove.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 : 2026-03-28 -# @License : Mulan PSL v2 -# @Desc : 测试软件包是否可以通过包管理器成功卸载。 -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - PACKAGE_NAME="texlive-docmute-doc" - LOG_INFO "开始测试软件包 ${PACKAGE_NAME} 是否可以通过包管理器成功卸载" - 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 "软件包 ${PACKAGE_NAME} 在yum源中存在" - LOG_INFO "步骤2: 检查当前环境是否已安装软件包 ${PACKAGE_NAME}" - rpm -q ${PACKAGE_NAME} &>/dev/null - INSTALLED=$? - if [ ${INSTALLED} -eq 0 ]; then - LOG_INFO "软件包 ${PACKAGE_NAME} 已安装,测试结束后将保持安装状态" - NEED_CLEANUP=0 - else - LOG_INFO "软件包 ${PACKAGE_NAME} 未安装,将执行安装作为测试步骤" - NEED_CLEANUP=1 - LOG_INFO "步骤3: 安装软件包 ${PACKAGE_NAME}" - dnf install -y ${PACKAGE_NAME} - CHECK_RESULT $? 0 0 "安装软件包 ${PACKAGE_NAME} 失败" - LOG_INFO "软件包 ${PACKAGE_NAME} 安装成功" - fi - LOG_INFO "步骤4: 执行卸载软件包 ${PACKAGE_NAME}" - dnf remove -y ${PACKAGE_NAME} - CHECK_RESULT $? 0 0 "卸载软件包 ${PACKAGE_NAME} 失败" - LOG_INFO "软件包 ${PACKAGE_NAME} 卸载成功" - if [ ${NEED_CLEANUP} -eq 1 ]; then - LOG_INFO "步骤5: 恢复环境,重新安装软件包 ${PACKAGE_NAME}" - dnf install -y ${PACKAGE_NAME} - CHECK_RESULT $? 0 0 "恢复安装软件包 ${PACKAGE_NAME} 失败" - LOG_INFO "环境已恢复,软件包 ${PACKAGE_NAME} 已重新安装" - else - LOG_INFO "步骤5: 恢复环境,重新安装软件包 ${PACKAGE_NAME}" - dnf install -y ${PACKAGE_NAME} - CHECK_RESULT $? 0 0 "重新安装软件包 ${PACKAGE_NAME} 失败" - LOG_INFO "环境已恢复,软件包 ${PACKAGE_NAME} 已重新安装" - fi - LOG_INFO "测试完成:软件包 ${PACKAGE_NAME} 可以通过包管理器成功卸载" -} - -main "$@" \ No newline at end of file From 96ce1e7f8ff6204caef8269cb88e0059b99f9e9e Mon Sep 17 00:00:00 2001 From: honghua Date: Fri, 17 Apr 2026 12:25:10 +0800 Subject: [PATCH 06/16] update testcase for testsuite dbus-python-devel --- .../dbus-python/dbus-python-devel.json | 194 ------------------ ...-python-devel_dbus-binding-tool_default.sh | 61 ------ ...t_dbus-python-devel_dbus-daemon_address.sh | 75 ------- ...us-python-devel_dbus-daemon_config-file.sh | 87 -------- ...test_dbus-python-devel_dbus-daemon_fork.sh | 111 ---------- ...bus-python-devel_dbus-daemon_introspect.sh | 69 ------- ...st_dbus-python-devel_dbus-daemon_nofork.sh | 103 ---------- ...dbus-python-devel_dbus-daemon_nopidfile.sh | 66 ------ ..._dbus-python-devel_dbus-daemon_nosyslog.sh | 83 -------- ...-python-devel_dbus-daemon_print-address.sh | 72 ------- ...dbus-python-devel_dbus-daemon_print-pid.sh | 60 ------ ...t_dbus-python-devel_dbus-daemon_session.sh | 71 ------- ...us-python-devel_dbus-daemon_syslog-only.sh | 89 -------- ...st_dbus-python-devel_dbus-daemon_syslog.sh | 77 ------- ...st_dbus-python-devel_dbus-daemon_system.sh | 66 ------ ...t_dbus-python-devel_dbus-daemon_version.sh | 71 ------- ...t_dbus-python-devel_dbus-launch_default.sh | 64 ------ ..._dbus-python-devel_dbus-monitor_address.sh | 77 ------- ...t_dbus-python-devel_dbus-monitor_binary.sh | 69 ------- ..._dbus-python-devel_dbus-monitor_monitor.sh | 58 ------ ...est_dbus-python-devel_dbus-monitor_pcap.sh | 68 ------ ..._dbus-python-devel_dbus-monitor_profile.sh | 65 ------ ..._dbus-python-devel_dbus-monitor_session.sh | 76 ------- ...t_dbus-python-devel_dbus-monitor_system.sh | 95 --------- ...dbus-python-devel_dbus-run-session_help.sh | 84 -------- ...s-python-devel_dbus-run-session_version.sh | 67 ------ .../test_dbus-python-devel_dbus-send_bus.sh | 84 -------- .../test_dbus-python-devel_dbus-send_dest.sh | 78 ------- .../test_dbus-python-devel_dbus-send_help.sh | 73 ------- .../test_dbus-python-devel_dbus-send_peer.sh | 72 ------- ...dbus-python-devel_dbus-send_print-reply.sh | 73 ------- ...us-python-devel_dbus-send_reply-timeout.sh | 66 ------ ...test_dbus-python-devel_dbus-send_sender.sh | 102 --------- ...est_dbus-python-devel_dbus-send_session.sh | 80 -------- ...test_dbus-python-devel_dbus-send_system.sh | 59 ------ .../test_dbus-python-devel_dbus-send_type.sh | 64 ------ ...-python-devel_dbus-test-tool_black-hole.sh | 68 ------ ...t_dbus-python-devel_dbus-test-tool_echo.sh | 68 ------ ...t_dbus-python-devel_dbus-test-tool_spam.sh | 74 ------- ...dbus-python-devel_function_basic_import.sh | 83 -------- ..._dbus-python-devel_function_basic_usage.sh | 88 -------- .../test_dbus-python-devel_function_import.sh | 70 ------- ...test_dbus-python-devel_function_install.sh | 69 ------- ..._dbus-python-devel_function_integration.sh | 82 -------- ..._dbus-python-devel_function_method_call.sh | 78 ------- ...us-python-devel_function_signal_receive.sh | 119 ----------- ...st_dbus-python-devel_function_uninstall.sh | 68 ------ ...test_dbus-python-devel_function_version.sh | 89 -------- 48 files changed, 3785 deletions(-) delete mode 100644 suite2cases/function_test/pkg_test/dbus-python/dbus-python-devel.json delete mode 100644 testcases/function_test/pkg_test/dbus-python/dbus-python-devel/test_dbus-python-devel_dbus-binding-tool_default.sh delete mode 100644 testcases/function_test/pkg_test/dbus-python/dbus-python-devel/test_dbus-python-devel_dbus-daemon_address.sh delete mode 100644 testcases/function_test/pkg_test/dbus-python/dbus-python-devel/test_dbus-python-devel_dbus-daemon_config-file.sh delete mode 100644 testcases/function_test/pkg_test/dbus-python/dbus-python-devel/test_dbus-python-devel_dbus-daemon_fork.sh delete mode 100644 testcases/function_test/pkg_test/dbus-python/dbus-python-devel/test_dbus-python-devel_dbus-daemon_introspect.sh delete mode 100644 testcases/function_test/pkg_test/dbus-python/dbus-python-devel/test_dbus-python-devel_dbus-daemon_nofork.sh delete mode 100644 testcases/function_test/pkg_test/dbus-python/dbus-python-devel/test_dbus-python-devel_dbus-daemon_nopidfile.sh delete mode 100644 testcases/function_test/pkg_test/dbus-python/dbus-python-devel/test_dbus-python-devel_dbus-daemon_nosyslog.sh delete mode 100644 testcases/function_test/pkg_test/dbus-python/dbus-python-devel/test_dbus-python-devel_dbus-daemon_print-address.sh delete mode 100644 testcases/function_test/pkg_test/dbus-python/dbus-python-devel/test_dbus-python-devel_dbus-daemon_print-pid.sh delete mode 100644 testcases/function_test/pkg_test/dbus-python/dbus-python-devel/test_dbus-python-devel_dbus-daemon_session.sh delete mode 100644 testcases/function_test/pkg_test/dbus-python/dbus-python-devel/test_dbus-python-devel_dbus-daemon_syslog-only.sh delete mode 100644 testcases/function_test/pkg_test/dbus-python/dbus-python-devel/test_dbus-python-devel_dbus-daemon_syslog.sh delete mode 100644 testcases/function_test/pkg_test/dbus-python/dbus-python-devel/test_dbus-python-devel_dbus-daemon_system.sh delete mode 100644 testcases/function_test/pkg_test/dbus-python/dbus-python-devel/test_dbus-python-devel_dbus-daemon_version.sh delete mode 100644 testcases/function_test/pkg_test/dbus-python/dbus-python-devel/test_dbus-python-devel_dbus-launch_default.sh delete mode 100644 testcases/function_test/pkg_test/dbus-python/dbus-python-devel/test_dbus-python-devel_dbus-monitor_address.sh delete mode 100644 testcases/function_test/pkg_test/dbus-python/dbus-python-devel/test_dbus-python-devel_dbus-monitor_binary.sh delete mode 100644 testcases/function_test/pkg_test/dbus-python/dbus-python-devel/test_dbus-python-devel_dbus-monitor_monitor.sh delete mode 100644 testcases/function_test/pkg_test/dbus-python/dbus-python-devel/test_dbus-python-devel_dbus-monitor_pcap.sh delete mode 100644 testcases/function_test/pkg_test/dbus-python/dbus-python-devel/test_dbus-python-devel_dbus-monitor_profile.sh delete mode 100644 testcases/function_test/pkg_test/dbus-python/dbus-python-devel/test_dbus-python-devel_dbus-monitor_session.sh delete mode 100644 testcases/function_test/pkg_test/dbus-python/dbus-python-devel/test_dbus-python-devel_dbus-monitor_system.sh delete mode 100644 testcases/function_test/pkg_test/dbus-python/dbus-python-devel/test_dbus-python-devel_dbus-run-session_help.sh delete mode 100644 testcases/function_test/pkg_test/dbus-python/dbus-python-devel/test_dbus-python-devel_dbus-run-session_version.sh delete mode 100644 testcases/function_test/pkg_test/dbus-python/dbus-python-devel/test_dbus-python-devel_dbus-send_bus.sh delete mode 100644 testcases/function_test/pkg_test/dbus-python/dbus-python-devel/test_dbus-python-devel_dbus-send_dest.sh delete mode 100644 testcases/function_test/pkg_test/dbus-python/dbus-python-devel/test_dbus-python-devel_dbus-send_help.sh delete mode 100644 testcases/function_test/pkg_test/dbus-python/dbus-python-devel/test_dbus-python-devel_dbus-send_peer.sh delete mode 100644 testcases/function_test/pkg_test/dbus-python/dbus-python-devel/test_dbus-python-devel_dbus-send_print-reply.sh delete mode 100644 testcases/function_test/pkg_test/dbus-python/dbus-python-devel/test_dbus-python-devel_dbus-send_reply-timeout.sh delete mode 100644 testcases/function_test/pkg_test/dbus-python/dbus-python-devel/test_dbus-python-devel_dbus-send_sender.sh delete mode 100644 testcases/function_test/pkg_test/dbus-python/dbus-python-devel/test_dbus-python-devel_dbus-send_session.sh delete mode 100644 testcases/function_test/pkg_test/dbus-python/dbus-python-devel/test_dbus-python-devel_dbus-send_system.sh delete mode 100644 testcases/function_test/pkg_test/dbus-python/dbus-python-devel/test_dbus-python-devel_dbus-send_type.sh delete mode 100644 testcases/function_test/pkg_test/dbus-python/dbus-python-devel/test_dbus-python-devel_dbus-test-tool_black-hole.sh delete mode 100644 testcases/function_test/pkg_test/dbus-python/dbus-python-devel/test_dbus-python-devel_dbus-test-tool_echo.sh delete mode 100644 testcases/function_test/pkg_test/dbus-python/dbus-python-devel/test_dbus-python-devel_dbus-test-tool_spam.sh delete mode 100644 testcases/function_test/pkg_test/dbus-python/dbus-python-devel/test_dbus-python-devel_function_basic_import.sh delete mode 100644 testcases/function_test/pkg_test/dbus-python/dbus-python-devel/test_dbus-python-devel_function_basic_usage.sh delete mode 100644 testcases/function_test/pkg_test/dbus-python/dbus-python-devel/test_dbus-python-devel_function_import.sh delete mode 100644 testcases/function_test/pkg_test/dbus-python/dbus-python-devel/test_dbus-python-devel_function_install.sh delete mode 100644 testcases/function_test/pkg_test/dbus-python/dbus-python-devel/test_dbus-python-devel_function_integration.sh delete mode 100644 testcases/function_test/pkg_test/dbus-python/dbus-python-devel/test_dbus-python-devel_function_method_call.sh delete mode 100644 testcases/function_test/pkg_test/dbus-python/dbus-python-devel/test_dbus-python-devel_function_signal_receive.sh delete mode 100644 testcases/function_test/pkg_test/dbus-python/dbus-python-devel/test_dbus-python-devel_function_uninstall.sh delete mode 100644 testcases/function_test/pkg_test/dbus-python/dbus-python-devel/test_dbus-python-devel_function_version.sh diff --git a/suite2cases/function_test/pkg_test/dbus-python/dbus-python-devel.json b/suite2cases/function_test/pkg_test/dbus-python/dbus-python-devel.json deleted file mode 100644 index 03b046523c4..00000000000 --- a/suite2cases/function_test/pkg_test/dbus-python/dbus-python-devel.json +++ /dev/null @@ -1,194 +0,0 @@ -{ - "path": "$OET_PATH/testcases/function_test/pkg_test/dbus-python/dbus-python-devel", - "machine num": 1, - "cases": [ - { - "name": "test_dbus-python-devel_dbus-binding-tool_default", - "desc": "测试 dbus-binding-tool 默认执行行为" - }, - { - "name": "test_dbus-python-devel_dbus-daemon_version", - "desc": "测试 dbus-daemon 的 --version 参数,验证版本信息输出" - }, - { - "name": "test_dbus-python-devel_dbus-daemon_session", - "desc": "测试 dbus-daemon 的 --session 参数,验证会话模式启动" - }, - { - "name": "test_dbus-python-devel_dbus-daemon_system", - "desc": "测试 dbus-daemon 的 --system 参数,验证系统模式启动" - }, - { - "name": "test_dbus-python-devel_dbus-daemon_config-file", - "desc": "测试 dbus-daemon 的 --config-file=FILE 参数,验证指定配置文件启动" - }, - { - "name": "test_dbus-python-devel_dbus-daemon_print-address", - "desc": "测试 dbus-daemon 的 --print-address 参数,验证地址输出功能" - }, - { - "name": "test_dbus-python-devel_dbus-daemon_print-pid", - "desc": "测试 dbus-daemon 的 --print-pid 参数,验证进程ID输出功能" - }, - { - "name": "test_dbus-python-devel_dbus-daemon_introspect", - "desc": "测试 dbus-daemon 的 --introspect 参数,验证自省功能" - }, - { - "name": "test_dbus-python-devel_dbus-daemon_address", - "desc": "测试 dbus-daemon 的 --address=ADDRESS 参数,验证指定地址启动" - }, - { - "name": "test_dbus-python-devel_dbus-daemon_nopidfile", - "desc": "测试 dbus-daemon 的 --nopidfile 参数,验证不生成PID文件功能" - }, - { - "name": "test_dbus-python-devel_dbus-daemon_nosyslog", - "desc": "测试 dbus-daemon 的 --nosyslog 参数,验证禁用系统日志功能" - }, - { - "name": "test_dbus-python-devel_dbus-daemon_syslog", - "desc": "测试 dbus-daemon 的 --syslog 参数,验证启用系统日志功能" - }, - { - "name": "test_dbus-python-devel_dbus-daemon_syslog-only", - "desc": "测试 dbus-daemon 的 --syslog-only 参数,验证仅使用系统日志功能" - }, - { - "name": "test_dbus-python-devel_dbus-daemon_nofork", - "desc": "测试 dbus-daemon 的 --nofork 参数,验证不进行进程分叉功能" - }, - { - "name": "test_dbus-python-devel_dbus-daemon_fork", - "desc": "测试 dbus-daemon 的 --fork 参数,验证进行进程分叉功能" - }, - { - "name": "test_dbus-python-devel_dbus-launch_default", - "desc": "测试 dbus-launch 命令的默认行为" - }, - { - "name": "test_dbus-python-devel_dbus-monitor_system", - "desc": "测试 dbus-monitor 使用 --system 参数监控系统总线" - }, - { - "name": "test_dbus-python-devel_dbus-monitor_session", - "desc": "测试 dbus-monitor 使用 --session 参数监控会话总线" - }, - { - "name": "test_dbus-python-devel_dbus-monitor_address", - "desc": "测试 dbus-monitor 使用 --address 参数指定地址监控总线" - }, - { - "name": "test_dbus-python-devel_dbus-monitor_monitor", - "desc": "测试 dbus-monitor 使用 --monitor 参数监控消息" - }, - { - "name": "test_dbus-python-devel_dbus-monitor_profile", - "desc": "测试 dbus-monitor 使用 --profile 参数分析消息性能" - }, - { - "name": "test_dbus-python-devel_dbus-monitor_pcap", - "desc": "测试 dbus-monitor 使用 --pcap 参数以 pcap 格式输出消息" - }, - { - "name": "test_dbus-python-devel_dbus-monitor_binary", - "desc": "测试 dbus-monitor 使用 --binary 参数以二进制格式输出消息" - }, - { - "name": "test_dbus-python-devel_dbus-run-session_version", - "desc": "测试 dbus-run-session 的版本信息" - }, - { - "name": "test_dbus-python-devel_dbus-run-session_help", - "desc": "测试 dbus-run-session 的帮助信息" - }, - { - "name": "test_dbus-python-devel_dbus-send_help", - "desc": "测试 dbus-send 命令的 --help 参数,验证是否显示帮助信息" - }, - { - "name": "test_dbus-python-devel_dbus-send_system", - "desc": "测试 dbus-send 命令的 --system 参数,验证是否连接到系统总线" - }, - { - "name": "test_dbus-python-devel_dbus-send_session", - "desc": "测试 dbus-send 命令的 --session 参数,验证是否连接到会话总线" - }, - { - "name": "test_dbus-python-devel_dbus-send_bus", - "desc": "测试 dbus-send 命令的 --bus=ADDRESS 参数,验证是否连接到指定地址的总线" - }, - { - "name": "test_dbus-python-devel_dbus-send_peer", - "desc": "测试 dbus-send 命令的 --peer=ADDRESS 参数,验证是否连接到指定地址的对等连接" - }, - { - "name": "test_dbus-python-devel_dbus-send_sender", - "desc": "测试 dbus-send 命令的 --sender=NAME 参数,验证是否设置发送者名称" - }, - { - "name": "test_dbus-python-devel_dbus-send_dest", - "desc": "测试 dbus-send 命令的 --dest=NAME 参数,验证是否设置目标名称" - }, - { - "name": "test_dbus-python-devel_dbus-send_type", - "desc": "测试 dbus-send 命令的 --type=TYPE 参数,验证是否设置消息类型" - }, - { - "name": "test_dbus-python-devel_dbus-send_print-reply", - "desc": "测试 dbus-send 命令的 --print-reply 参数,验证是否打印回复" - }, - { - "name": "test_dbus-python-devel_dbus-send_reply-timeout", - "desc": "测试 dbus-send 命令的 --reply-timeout=MSEC 参数,验证是否设置回复超时时间" - }, - { - "name": "test_dbus-python-devel_dbus-test-tool_black-hole", - "desc": "测试 dbus-test-tool 的 black-hole 子命令功能" - }, - { - "name": "test_dbus-python-devel_dbus-test-tool_echo", - "desc": "测试 dbus-test-tool 的 echo 子命令功能" - }, - { - "name": "test_dbus-python-devel_dbus-test-tool_spam", - "desc": "测试 dbus-test-tool 的 spam 子命令功能" - }, - { - "name": "test_dbus-python-devel_function_install", - "desc": "测试软件包安装功能" - }, - { - "name": "test_dbus-python-devel_function_uninstall", - "desc": "测试软件包卸载功能" - }, - { - "name": "test_dbus-python-devel_function_integration", - "desc": "测试综合功能集成" - }, - { - "name": "test_dbus-python-devel_function_version", - "desc": "测试软件包版本信息" - }, - { - "name": "test_dbus-python-devel_function_basic_import", - "desc": "测试Python模块导入功能" - }, - { - "name": "test_dbus-python-devel_function_import", - "desc": "测试Python模块导入功能" - }, - { - "name": "test_dbus-python-devel_function_basic_usage", - "desc": "测试基础DBus通信功能" - }, - { - "name": "test_dbus-python-devel_function_method_call", - "desc": "测试DBus方法调用" - }, - { - "name": "test_dbus-python-devel_function_signal_receive", - "desc": "测试DBus信号接收" - } - ] -} \ No newline at end of file diff --git a/testcases/function_test/pkg_test/dbus-python/dbus-python-devel/test_dbus-python-devel_dbus-binding-tool_default.sh b/testcases/function_test/pkg_test/dbus-python/dbus-python-devel/test_dbus-python-devel_dbus-binding-tool_default.sh deleted file mode 100644 index 3f90715abf9..00000000000 --- a/testcases/function_test/pkg_test/dbus-python/dbus-python-devel/test_dbus-python-devel_dbus-binding-tool_default.sh +++ /dev/null @@ -1,61 +0,0 @@ -#!/usr/bin/bash - -# Copyright (c) 2024 ISCAS .ALL rights reserved. -# This program is licensed under Mulan PSL v2. -# You can use it according to the terms and conditions of the Mulan PSL v2. -# http://license.coscl.org.cn/MulanPSL2 -# THIS PROGRAM IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, -# EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, -# MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. -# See the Mulan PSL v2 for more details. - -# ############################################# -# @Author : honghua -# @Contact : honghua@iscas.ac.cn -# @Date : 2025-08-14 -# @License : Mulan PSL v2 -# @Desc : 测试 dbus-binding-tool 默认执行行为 -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - - # 检查dbus-python-devel软件包是否在yum源中 - LOG_INFO "检查yum源中是否存在dbus-python-devel软件包..." - dnf list available dbus-python-devel > /dev/null 2>&1 - if [ $? -ne 0 ]; then - LOG_ERROR "yum源中未找到dbus-python-devel软件包,退出测试" - exit 255 - fi - - # 检查dbus-binding-tool命令是否已安装 - LOG_INFO "检查dbus-binding-tool命令是否已安装..." - command -v dbus-binding-tool > /dev/null 2>&1 - if [ $? -eq 0 ]; then - LOG_INFO "dbus-binding-tool命令已安装,跳过安装步骤" - INSTALLED=true - else - LOG_INFO "dbus-binding-tool命令未安装,开始安装..." - dnf install -y dbus-python-devel - CHECK_RESULT $? 0 0 "安装dbus-python-devel失败" - INSTALLED=false - fi - - # 测试dbus-binding-tool默认执行行为 - LOG_INFO "测试dbus-binding-tool默认执行行为..." - dbus-binding-tool --help > /dev/null 2>&1 - CHECK_RESULT $? 0 0 "dbus-binding-tool默认执行失败" - - # 清理环境 - if [ "$INSTALLED" = false ]; then - LOG_INFO "清理环境,卸载dbus-python-devel软件包..." - dnf remove -y dbus-python-devel - CHECK_RESULT $? 0 0 "卸载dbus-python-devel失败" - fi - - LOG_INFO "测试脚本执行完毕" - -} - -main "$@" \ No newline at end of file diff --git a/testcases/function_test/pkg_test/dbus-python/dbus-python-devel/test_dbus-python-devel_dbus-daemon_address.sh b/testcases/function_test/pkg_test/dbus-python/dbus-python-devel/test_dbus-python-devel_dbus-daemon_address.sh deleted file mode 100644 index 60fc5ffa44c..00000000000 --- a/testcases/function_test/pkg_test/dbus-python/dbus-python-devel/test_dbus-python-devel_dbus-daemon_address.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 : 2025-08-14 -# @License : Mulan PSL v2 -# @Desc : 测试 dbus-daemon 的 --address=ADDRESS 参数,验证指定地址启动 -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - # 检查是否已安装dbus-python-devel和dbus-daemon - LOG_INFO "检查是否已安装dbus-python-devel和dbus-daemon" - rpm -q dbus-python-devel dbus-daemon > /dev/null 2>&1 - if [ $? -eq 0 ]; then - LOG_INFO "dbus-python-devel和dbus-daemon已安装" - installed=true - else - LOG_INFO "dbus-python-devel和dbus-daemon未安装" - installed=false - fi - - # 检查yum源中是否有dbus-python-devel和dbus-daemon - LOG_INFO "检查yum源中是否有dbus-python-devel和dbus-daemon" - dnf list available dbus-python-devel dbus-daemon > /dev/null 2>&1 - if [ $? -ne 0 ]; then - LOG_ERROR "yum源中未找到dbus-python-devel或dbus-daemon" - exit 255 - fi - - # 如果未安装,则安装软件包 - if [ "$installed" = false ]; then - LOG_INFO "安装dbus-python-devel和dbus-daemon" - dnf install -y dbus-python-devel dbus-daemon > /dev/null 2>&1 - CHECK_RESULT $? 0 0 "安装dbus-python-devel和dbus-daemon失败" - fi - - # 测试--address参数 - LOG_INFO "测试--address参数,验证指定地址启动" - dbus-daemon --address=unix:path=/tmp/test-dbus.sock > /dev/null 2>&1 & - pid=$! - sleep 1 - - # 检查进程是否启动成功 - ps -p $pid > /dev/null 2>&1 - CHECK_RESULT $? 0 0 "指定地址启动失败" - - # 检查socket文件是否存在 - LOG_INFO "检查socket文件是否存在" - [ -S /tmp/test-dbus.sock ] - CHECK_RESULT $? 0 0 "socket文件未创建" - - # 清理测试环境 - LOG_INFO "清理测试环境" - kill $pid > /dev/null 2>&1 - rm -f /tmp/test-dbus.sock > /dev/null 2>&1 - - # 如果脚本开始时未安装,则卸载软件包 - if [ "$installed" = false ]; then - LOG_INFO "卸载dbus-python-devel和dbus-daemon" - dnf remove -y dbus-python-devel dbus-daemon > /dev/null -} - -main "$@" \ No newline at end of file diff --git a/testcases/function_test/pkg_test/dbus-python/dbus-python-devel/test_dbus-python-devel_dbus-daemon_config-file.sh b/testcases/function_test/pkg_test/dbus-python/dbus-python-devel/test_dbus-python-devel_dbus-daemon_config-file.sh deleted file mode 100644 index 2b1aa836156..00000000000 --- a/testcases/function_test/pkg_test/dbus-python/dbus-python-devel/test_dbus-python-devel_dbus-daemon_config-file.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 : 2025-08-14 -# @License : Mulan PSL v2 -# @Desc : 测试 dbus-daemon 的 --config-file=FILE 参数,验证指定配置文件启动 -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - - # 检查dbus-python-devel和dbus-daemon是否已安装 - LOG_INFO "检查dbus-python-devel和dbus-daemon是否已安装" - rpm -q dbus-python-devel dbus-daemon > /dev/null 2>&1 - if [ $? -eq 0 ]; then - LOG_INFO "dbus-python-devel和dbus-daemon已安装" - installed=true - else - LOG_INFO "dbus-python-devel和dbus-daemon未安装" - installed=false - fi - - # 检查yum源中是否有dbus-python-devel和dbus-daemon软件包 - LOG_INFO "检查yum源中是否有dbus-python-devel和dbus-daemon软件包" - dnf list available dbus-python-devel dbus-daemon > /dev/null 2>&1 - if [ $? -ne 0 ]; then - LOG_ERROR "yum源中未找到dbus-python-devel或dbus-daemon软件包" - exit 255 - fi - - # 如果未安装,则安装软件包 - if [ "$installed" = false ]; then - LOG_INFO "安装dbus-python-devel和dbus-daemon软件包" - dnf install -y dbus-python-devel dbus-daemon > /dev/null 2>&1 - CHECK_RESULT $? 0 0 "安装dbus-python-devel和dbus-daemon失败" - fi - - # 创建临时配置文件用于测试 - LOG_INFO "创建临时配置文件用于测试" - temp_config=$(mktemp /tmp/dbus-config.XXXXXX) - cat > "$temp_config" < - - session - unix:path=/tmp/dbus-test-socket - - EOF - - # 验证--config-file参数 - LOG_INFO "验证--config-file参数" - dbus-daemon --config-file="$temp_config" --print-address > /dev/null 2>&1 - CHECK_RESULT $? 0 0 "指定配置文件启动失败" - - # 清理临时配置文件 - LOG_INFO "清理临时配置文件" - rm -f "$temp_config" - - # 如果之前未安装,则卸载软件包 - if [ "$installed" = false ]; then - LOG_INFO "卸载dbus-python-devel和dbus-daemon软件包" - dnf remove -y dbus-python-devel dbus-daemon > /dev/null 2>&1 - CHECK_RESULT $? 0 0 "卸载dbus-python-devel和dbus-daemon失败" - - # 再次检查是否卸载成功 - rpm -q dbus-python-devel dbus-daemon > /dev/null 2>&1 - CHECK_RESULT $? 1 0 "卸载后仍检测到dbusp-tyhon-devl或dbu-damon存在" - - fi - - LOG_INFO "测试完成,环境已恢复" - -} - -main "$@" \ No newline at end of file diff --git a/testcases/function_test/pkg_test/dbus-python/dbus-python-devel/test_dbus-python-devel_dbus-daemon_fork.sh b/testcases/function_test/pkg_test/dbus-python/dbus-python-devel/test_dbus-python-devel_dbus-daemon_fork.sh deleted file mode 100644 index 7b6687876f0..00000000000 --- a/testcases/function_test/pkg_test/dbus-python/dbus-python-devel/test_dbus-python-devel_dbus-daemon_fork.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 : 2025-08-14 -# @License : Mulan PSL v2 -# @Desc : 测试 dbus-daemon 的 --fork 参数,验证进行进程分叉功能 -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - - # 检查yum源中是否存在指定软件包 - check_package_exist() { - dnf list available "$1" &> /dev/null - if [ $? -ne 0 ]; then - LOG_ERROR "软件包 $1 在yum源中不存在" - exit 255 - fi - } - - # 检查命令参数是否支持 - check_command_option() { - if ! "$1" --help | grep -q "$2"; then - LOG_ERROR "命令 $1 不支持参数 $2" - exit 255 - fi - } - - # 检查dbus-daemon是否已安装 - check_dbus_installed() { - rpm -q dbus-daemon &> /dev/null - return $? - } - - # 安装dbus-daemon软件包 - install_dbus() { - LOG_INFO "正在安装dbus-daemon软件包..." - dnf install -y dbus-daemon &> /dev/null - CHECK_RESULT $? 0 0 "安装dbus-daemon失败" - } - - # 卸载dbus-daemon软件包 - uninstall_dbus() { - LOG_INFO "正在卸载dbus-daemon软件包..." - dnf remove -y dbus-daemon &> /dev/null - CHECK_RESULT $? 0 0 "卸载dbus-daemon失败" - } - - # 测试dbus-daemon的--fork参数功能 - test_dbus_fork() { - LOG_INFO "测试开始:验证dbus-daemon的--fork参数功能" - - # 检查--fork参数是否支持 - check_command_option "dbus-daemon" "--fork" - - # 启动dbus-daemon并分叉进程 - LOG_INFO "启动dbus-daemon并分叉进程..." - dbus-daemon --fork --print-address &> /tmp/dbus_address.txt - - # 检查进程是否分叉成功(应有两个进程) - LOG_INFO "检查dbus-daemon进程数..." - process_count=$(ps aux | grep "[d]bus-daemon" | wc -l) - - # --fork参数预期结果为2个进程 - CHECK_RESULT "$process_count" 2 0 "--fork参数未成功分叉进程" - - # 清理临时文件并停止dbus-daemon - LOG_INFO "清理临时文件并停止dbus-daemon..." - - killall dbus-daemon &> /dev/null - rm -f /tmp/dbus_address.txt - } - - # ------------------------主流程------------------------ - - LOG_INFO "检查环境准备情况..." - - # Step1:检查yum源中是否存在dbus-daemon软件包 - check_package_exist "dbus-daemon" - - # Step2:检查是否已安装,若未安装则标记为需要清理环境 - need_cleanup=0 - if ! check_dbus_installed; then - need_cleanup=1 - install_dbus - fi - - # Step3:执行测试用例 - test_dbus_fork - - # Step4:环境恢复(若初始未安装则卸载) - if [ "$need_cleanup" -eq 1 ]; then - uninstall_dbus - fi - - LOG_INFO "测试完成,环境已恢复。" -} - -main "$@" \ No newline at end of file diff --git a/testcases/function_test/pkg_test/dbus-python/dbus-python-devel/test_dbus-python-devel_dbus-daemon_introspect.sh b/testcases/function_test/pkg_test/dbus-python/dbus-python-devel/test_dbus-python-devel_dbus-daemon_introspect.sh deleted file mode 100644 index 232df1ada8a..00000000000 --- a/testcases/function_test/pkg_test/dbus-python/dbus-python-devel/test_dbus-python-devel_dbus-daemon_introspect.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-08-14 -# @License : Mulan PSL v2 -# @Desc : 测试 dbus-daemon 的 --introspect 参数,验证自省功能 -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - # 检查是否已安装dbus-python-devel和dbus-daemon - LOG_INFO "检查是否已安装dbus-python-devel和dbus-daemon" - rpm -q dbus-python-devel dbus-daemon > /dev/null 2>&1 - if [ $? -eq 0 ]; then - LOG_INFO "dbus-python-devel和dbus-daemon已安装" - installed=true - else - LOG_INFO "dbus-python-devel和dbus-daemon未安装" - installed=false - fi - - # 检查yum源中是否有dbus-python-devel和dbus-daemon软件包 - LOG_INFO "检查yum源中是否有dbus-python-devel和dbus-daemon软件包" - dnf list available dbus-python-devel dbus-daemon > /dev/null 2>&1 - if [ $? -ne 0 ]; then - LOG_ERROR "yum源中缺少dbus-python-devel或dbus-daemon软件包" - exit 255 - fi - - # 如果未安装,则安装软件包 - if [ "$installed" = false ]; then - LOG_INFO "安装dbus-python-devel和dbus-daemon" - dnf install -y dbus-python-devel dbus-daemon > /dev/null 2>&1 - CHECK_RESULT $? 0 0 "安装dbus-python-devel和dbus-daemon失败" - fi - - # 验证dbus-daemon的--introspect参数功能 - LOG_INFO "验证dbus-daemon的--introspect参数功能" - output=$(dbus-daemon --introspect) - CHECK_RESULT $? 0 0 "dbus-daemon --introspect执行失败" - - # 检查输出是否包含自省信息 - LOG_INFO "检查输出是否包含自省信息" - echo "$output" | grep -q " /dev/null 2>&1 - CHECK_RESULT $? 0 0 "卸载dbusp- python- devel或d bus- daemon失败" - fi - - LOG_INFO "测试完成,环境已恢复" -} - -main "$@" \ No newline at end of file diff --git a/testcases/function_test/pkg_test/dbus-python/dbus-python-devel/test_dbus-python-devel_dbus-daemon_nofork.sh b/testcases/function_test/pkg_test/dbus-python/dbus-python-devel/test_dbus-python-devel_dbus-daemon_nofork.sh deleted file mode 100644 index 5c213669f22..00000000000 --- a/testcases/function_test/pkg_test/dbus-python/dbus-python-devel/test_dbus-python-devel_dbus-daemon_nofork.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 : 2025-08-14 -# @License : Mulan PSL v2 -# @Desc : 测试 dbus-daemon 的 --nofork 参数,验证不进行进程分叉功能 -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - - # 检查dbus-python-devel和dbus-daemon是否已安装 - LOG_INFO "检查dbus-python-devel和dbus-daemon是否已安装" - rpm -q dbus-python-devel dbus-daemon > /dev/null 2>&1 - if [ $? -eq 0 ]; then - LOG_INFO "dbus-python-devel和dbus-daemon已安装" - installed=true - else - LOG_INFO "dbus-python-devel和dbus-daemon未安装" - installed=false - fi - - # 检查yum源中是否存在dbus-python-devel和dbus-daemon - LOG_INFO "检查yum源中是否存在dbus-python-devel和dbus-daemon" - dnf list available dbus-python-devel dbus-daemon > /dev/null 2>&1 - if [ $? -ne 0 ]; then - LOG_ERROR "yum源中不存在dbus-python-devel或dbus-daemon" - exit 255 - fi - - # 如果未安装,则安装软件包 - if [ "$installed" = false ]; then - LOG_INFO "安装dbus-python-devel和dbus-daemon" - dnf install -y dbus-python-devel dbus-daemon > /dev/null 2>&1 - CHECK_RESULT $? 0 0 "安装dbus-python-devel和dbus-daemon失败" - fi - - # 测试--nofork参数是否存在或支持 - LOG_INFO "测试--nofork参数是否存在或支持" - if ! dbus-daemon --help | grep -q -- "--nofork"; then - LOG_ERROR "不支持--nofork参数" - # 如果之前未安装,则卸载软件包 - if [ "$installed" = false ]; then - LOG_INFO "卸载dbus-python-devel和dbus-daemon" - dnf remove -y dbus-python-devel dbus-daemon > /dev/null 2>&1 - CHECK_RESULT $? 0 0 "卸载dbus-python-devel和dbus-daemon失败" - fi - exit 255 - fi - - # 执行带--nofork参数的dbus-daemon命令并验证 - LOG_INFO "执行带--nofork参数的dbus-daemon命令" - ps aux | grep -v grep | grep -q dbus-daemon - if [ $? -eq 0 ]; then - LOG_INFO "dbus-daemon进程已存在,停止当前进程" - pkill dbus-daemon - fi - - dbuser=$(id -un) - dbpath="/run/user/$(id -u)/dbase" - - mkdir -p "$dbpath" - chown "$dbuser" "$dbpath" - - LOG_INFO "启动dbuse daemon进程,不进行分叉(--nofork)" - DBUS_VERBOSE=1 dbuse daemon --session --nofork --address=unix:path="$dbpath"/session_buse_socket & - pid=$! - sleep 2 - - #检查进程是否存在且未分叉(只有一个进程) - LOG_INFO "验证进程是否未分叉(只有一个进程)" - count=$(ps aux | grep -v grep | grep -c "$pid.*--nofork") - CHECK_RESULT $count 1 0 "验证进程未分叉失败" - - #清理环境 - LOG_INFO "清理环境" - kill -9 $pid - rm -rf "$dbe path" - - #如果之前未安装,则卸载软件包 - if [ "$installed" = false ]; then - LOG_INF0 “卸载db us- python -devel and d bus- daemon” - dnf remove -y db us- python- devel d bus-da emon > /dev/null 2>&1 - CHECK_RESULT $? θ θ “卸载db us- python-d e vel and d bus-da emon失败” - fi - - LOG_INF0 “测试完成” - exit θ -} - -main "$@" \ No newline at end of file diff --git a/testcases/function_test/pkg_test/dbus-python/dbus-python-devel/test_dbus-python-devel_dbus-daemon_nopidfile.sh b/testcases/function_test/pkg_test/dbus-python/dbus-python-devel/test_dbus-python-devel_dbus-daemon_nopidfile.sh deleted file mode 100644 index cef864c9116..00000000000 --- a/testcases/function_test/pkg_test/dbus-python/dbus-python-devel/test_dbus-python-devel_dbus-daemon_nopidfile.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-08-14 -# @License : Mulan PSL v2 -# @Desc : 测试 dbus-daemon 的 --nopidfile 参数,验证不生成PID文件功能 -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - LOG_INFO "开始测试 dbus-daemon 的 --nopidfile 参数,验证不生成PID文件功能" - - # 检查软件包是否在yum源中 - LOG_INFO "检查软件包 dbus-python-devel 和 dbus-daemon 是否在yum源中" - dnf list available dbus-python-devel dbus-daemon > /dev/null 2>&1 - CHECK_RESULT $? 0 255 "软件包 dbus-python-devel 或 dbus-daemon 不在yum源中" - - # 检查环境是否已安装软件包 - LOG_INFO "检查环境是否已安装 dbus-python-devel 和 dbus-daemon" - installed=false - if rpm -q dbus-python-devel > /dev/null 2>&1 && rpm -q dbus-daemon > /dev/null 2>&1; then - installed=true - LOG_INFO "环境已安装 dbus-python-devel 和 dbus-daemon" - else - LOG_INFO "环境未安装 dbus-python-devel 和 dbus-daemon,将进行安装" - fi - - # 若未安装则安装软件包 - if [ "$installed" = false ]; then - LOG_INFO "安装 dbus-python-devel 和 dbus-daemon" - dnf install -y dbus-python-devel dbus-daemon > /dev/null 2>&1 - CHECK_RESULT $? 0 0 "安装软件包失败" - fi - - # 检查 --nopidfile 参数是否存在 - LOG_INFO "检查 --nopidfile 参数是否存在" - dbus-daemon --help | grep -q -- "--nopidfile" - CHECK_RESULT $? 0 255 "--nopidfile 参数不存在或不支持" - - # 验证不生成PID文件功能 - LOG_INFO "验证 --nopidfile 参数不生成PID文件功能" - pid_file="/var/run/dbus/pid" - - # 清理可能存在的PID文件 - if [ -f "$pid_file" ]; then - rm -f "$pid_file" - fi - - # 启动 dbus-daemon 并指定 --nopidfile 参数 - dbus-daemon --system --nopidfile > /dev/null 2>&1 & - sleep -} - -main "$@" \ No newline at end of file diff --git a/testcases/function_test/pkg_test/dbus-python/dbus-python-devel/test_dbus-python-devel_dbus-daemon_nosyslog.sh b/testcases/function_test/pkg_test/dbus-python/dbus-python-devel/test_dbus-python-devel_dbus-daemon_nosyslog.sh deleted file mode 100644 index 139b8b125bc..00000000000 --- a/testcases/function_test/pkg_test/dbus-python/dbus-python-devel/test_dbus-python-devel_dbus-daemon_nosyslog.sh +++ /dev/null @@ -1,83 +0,0 @@ -#!/usr/bin/bash - -# Copyright (c) 2024 ISCAS .ALL rights reserved. -# This program is licensed under Mulan PSL v2. -# You can use it according to the terms and conditions of the Mulan PSL v2. -# http://license.coscl.org.cn/MulanPSL2 -# THIS PROGRAM IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, -# EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, -# MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. -# See the Mulan PSL v2 for more details. - -# ############################################# -# @Author : honghua -# @Contact : honghua@iscas.ac.cn -# @Date : 2025-08-14 -# @License : Mulan PSL v2 -# @Desc : 测试 dbus-daemon 的 --nosyslog 参数,验证禁用系统日志功能 -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - # 检查dbus-python-devel和dbus-daemon软件包是否在yum源中 - LOG_INFO "检查yum源中是否存在dbus-python-devel和dbus-daemon软件包" - dnf list available dbus-python-devel dbus-daemon > /dev/null 2>&1 - if [ $? -ne 0 ]; then - LOG_ERROR "yum源中未找到dbus-python-devel或dbus-daemon软件包" - exit 255 - fi - - # 检查dbus-daemon是否已安装 - LOG_INFO "检查dbus-daemon是否已安装" - rpm -q dbus-daemon > /dev/null 2>&1 - if [ $? -eq 0 ]; then - installed=true - LOG_INFO "dbus-daemon已安装,脚本结束后将保持安装状态" - else - installed=false - LOG_INFO "dbus-daemon未安装,将在测试完成后卸载" - fi - - # 安装dbus-python-devel和dbus-daemon软件包(如果未安装) - if [ "$installed" = false ]; then - LOG_INFO "开始安装dbus-python-devel和dbus-daemon软件包" - dnf install -y dbus-python-devel dbus-daemon - CHECK_RESULT $? 0 0 "安装dbus-python-devel和dbus-daemon失败" - fi - - # 检查--nosyslog参数是否支持 - LOG_INFO "检查dbus-daemon是否支持--nosyslog参数" - dbus-daemon --help | grep -- "--nosyslog" > /dev/null 2>&1 - if [ $? -ne 0 ]; then - LOG_ERROR "dbus-daemon不支持--nosyslog参数" - if [ "$installed" = false ]; then - dnf remove -y dbus-python-devel dbus-daemon - fi - exit 255 - fi - - # 测试--nosyslog参数功能 - LOG_INFO "测试--nosyslog参数功能" - systemctl stop rsyslog > /dev/null 2>&1 # 临时停止rsyslog服务以避免干扰 - CHECK_RESULT $? 0 0 "停止rsyslog服务失败" - - LOG_INFO "启动dbus-daemon并禁用系统日志" - /usr/bin/dbus-daemon --system --nosyslog > /dev/null 2>&1 & - CHECK_RESULT $? 0 0 "启动带--nosyslog参数的dbus-daemon失败" - - LOG_INFO "验证系统日志中是否无相关日志" - journalctl -u dbus --since="1 minute ago" | grep -i dbus-daemon > /dev/null 2>&1 - CHECK_RESULT $? 1 0 "系统日志中仍存在dbus-daemon日志" - - # 清理环境(如果初始未安装) - if [ "$installed" = false ]; then - LOG_INFO "卸载dbusp-ython-devel和dbsu-dameon软件包" - dnf remove -y dbusp-ythond-evevl dbsu-dameon - CHECKESUL_T$?00"卸载失败" - fi - - systemctl start rsylog >/dev/nul l2>&1 #恢复rsylog服务 -} - -main "$@" \ No newline at end of file diff --git a/testcases/function_test/pkg_test/dbus-python/dbus-python-devel/test_dbus-python-devel_dbus-daemon_print-address.sh b/testcases/function_test/pkg_test/dbus-python/dbus-python-devel/test_dbus-python-devel_dbus-daemon_print-address.sh deleted file mode 100644 index a2dde7a1d91..00000000000 --- a/testcases/function_test/pkg_test/dbus-python/dbus-python-devel/test_dbus-python-devel_dbus-daemon_print-address.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-08-14 -# @License : Mulan PSL v2 -# @Desc : 测试 dbus-daemon 的 --print-address 参数,验证地址输出功能 -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - # 检查dbus-python-devel和dbus-daemon是否已安装 - LOG_INFO "检查dbus-python-devel和dbus-daemon是否已安装" - rpm -q dbus-python-devel dbus-daemon > /dev/null 2>&1 - if [ $? -eq 0 ]; then - LOG_INFO "dbus-python-devel和dbus-daemon已安装" - installed=true - else - LOG_INFO "dbus-python-devel和dbus-daemon未安装" - installed=false - fi - - # 检查yum源中是否存在dbus-python-devel和dbus-daemon - LOG_INFO "检查yum源中是否存在dbus-python-devel和dbus-daemon" - dnf list available dbus-python-devel dbus-daemon > /dev/null 2>&1 - if [ $? -ne 0 ]; then - LOG_ERROR "yum源中不存在dbus-python-devel或dbus-daemon" - exit 255 - fi - - # 如果未安装,则安装软件包 - if [ "$installed" = false ]; then - LOG_INFO "开始安装dbus-python-devel和dbus-daemon" - dnf install -y dbus-python-devel dbus-daemon - CHECK_RESULT $? 0 0 "安装dbus-python-devel和dbus-daemon失败" - fi - - # 测试--print-address参数功能 - LOG_INFO "测试dbus-daemon的--print-address参数功能" - dbus-daemon --print-address > /dev/null 2>&1 - CHECK_RESULT $? 0 0 "--print-address参数不支持或执行失败" - - # 获取并验证输出地址 - LOG_INFO "获取并验证输出地址" - address=$(dbus-daemon --print-address) - if [ -z "$address" ]; then - LOG_ERROR "--print-address未输出有效地址" - exit 255 - else - LOG_INFO "输出地址: $address" - fi - - # 恢复环境 - if [ "$installed" = false ]; then - LOG_INFO "卸载临时安装的软件包" - dnf remove -y dbus-python-devel dbus-daemon > /dev/null 2>&1 - CHECK_RESULT $? 0 0 "卸载软件包失败" - fi -} - -main "$@" \ No newline at end of file diff --git a/testcases/function_test/pkg_test/dbus-python/dbus-python-devel/test_dbus-python-devel_dbus-daemon_print-pid.sh b/testcases/function_test/pkg_test/dbus-python/dbus-python-devel/test_dbus-python-devel_dbus-daemon_print-pid.sh deleted file mode 100644 index f67eb4b1f60..00000000000 --- a/testcases/function_test/pkg_test/dbus-python/dbus-python-devel/test_dbus-python-devel_dbus-daemon_print-pid.sh +++ /dev/null @@ -1,60 +0,0 @@ -#!/usr/bin/bash - -# Copyright (c) 2024 ISCAS .ALL rights reserved. -# This program is licensed under Mulan PSL v2. -# You can use it according to the terms and conditions of the Mulan PSL v2. -# http://license.coscl.org.cn/MulanPSL2 -# THIS PROGRAM IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, -# EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, -# MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. -# See the Mulan PSL v2 for more details. - -# ############################################# -# @Author : honghua -# @Contact : honghua@iscas.ac.cn -# @Date : 2025-08-14 -# @License : Mulan PSL v2 -# @Desc : 测试 dbus-daemon 的 --print-pid 参数,验证进程ID输出功能 -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - # 检查是否已安装dbus-python-devel和dbus-daemon - LOG_INFO "检查是否已安装dbus-python-devel和dbus-daemon" - rpm -q dbus-python-devel dbus-daemon > /dev/null 2>&1 - if [ $? -eq 0 ]; then - LOG_INFO "dbus-python-devel和dbus-daemon已安装" - installed=true - else - LOG_INFO "dbus-python-devel和dbus-daemon未安装" - installed=false - fi - - # 检查yum源中是否有dbus-python-devel和dbus-daemon软件包 - LOG_INFO "检查yum源中是否有dbus-python-devel和dbus-daemon软件包" - dnf list available dbus-python-devel dbus-daemon > /dev/null 2>&1 - CHECK_RESULT $? 0 0 "yum源中缺少dbus-python-devel或dbus-daemon软件包" - if [ $? -ne 0 ]; then - LOG_ERROR "yum源中缺少dbus-python-devel或dbus-daemon软件包" - exit 255 - fi - - # 如果未安装,则安装软件包 - if [ "$installed" = false ]; then - LOG_INFO "安装dbus-python-devel和dbus-daemon" - dnf install -y dbus-python-devel dbus-daemon > /dev/null 2>&1 - CHECK_RESULT $? 0 0 "安装dbus-python-devel和dbus-daemon失败" - fi - - # 测试dbus-daemon的--print-pid参数 - LOG_INFO "测试dbus-daemon的--print-pid参数" - dbus-daemon --print-pid > /dev/null 2>&1 - CHECK_RESULT $? 0 0 "执行--print-pid参数失败" - - # 验证进程ID输出功能 - LOG_INFO "验证进程ID输出功能" - pid=$(db -} - -main "$@" \ No newline at end of file diff --git a/testcases/function_test/pkg_test/dbus-python/dbus-python-devel/test_dbus-python-devel_dbus-daemon_session.sh b/testcases/function_test/pkg_test/dbus-python/dbus-python-devel/test_dbus-python-devel_dbus-daemon_session.sh deleted file mode 100644 index 2e75d123f7c..00000000000 --- a/testcases/function_test/pkg_test/dbus-python/dbus-python-devel/test_dbus-python-devel_dbus-daemon_session.sh +++ /dev/null @@ -1,71 +0,0 @@ -#!/usr/bin/bash - -# Copyright (c) 2024 ISCAS .ALL rights reserved. -# This program is licensed under Mulan PSL v2. -# You can use it according to the terms and conditions of the Mulan PSL v2. -# http://license.coscl.org.cn/MulanPSL2 -# THIS PROGRAM IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, -# EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, -# MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. -# See the Mulan PSL v2 for more details. - -# ############################################# -# @Author : honghua -# @Contact : honghua@iscas.ac.cn -# @Date : 2025-08-14 -# @License : Mulan PSL v2 -# @Desc : 测试 dbus-daemon 的 --session 参数,验证会话模式启动 -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - # 检查是否已安装dbus-python-devel和dbus-daemon - LOG_INFO "检查是否已安装dbus-python-devel和dbus-daemon" - rpm -q dbus-python-devel dbus-daemon > /dev/null 2>&1 - if [ $? -eq 0 ]; then - LOG_INFO "dbus-python-devel和dbus-daemon已安装,脚本结束时将保持安装状态" - INSTALLED=1 - else - LOG_INFO "dbus-python-devel和dbus-daemon未安装,将在测试结束后卸载" - INSTALLED=0 - fi - - # 检查yum源中是否存在dbus-python-devel和dbus-daemon - LOG_INFO "检查yum源中是否存在dbus-python-devel和dbus-daemon" - dnf list available dbus-python-devel dbus-daemon > /dev/null 2>&1 - CHECK_RESULT $? 0 255 "yum源中不存在dbus-python-devel或dbus-daemon" - - # 安装dbus-python-devel和dbus-daemon - if [ $INSTALLED -eq 0 ]; then - LOG_INFO "安装dbus-python-devel和dbus-daemon" - dnf install -y dbus-python-devel dbus-daemon - CHECK_RESULT $? 0 0 "安装失败" - fi - - # 验证--session参数是否支持 - LOG_INFO "验证dbus-daemon的--session参数是否支持" - dbus-daemon --help | grep -q -- "--session" - CHECK_RESULT $? 0 255 "--session参数不支持" - - # 启动dbus-daemon会话模式 - LOG_INFO "启动dbus-daemon会话模式" - dbus-daemon --session - CHECK_RESULT $? 0 0 "启动会话模式失败" - - # 检查会话模式是否成功启动 - LOG_INFO "检查会话模式是否成功启动" - ps aux | grep -q "[d]bus-daemon --session" - CHECK_RESULT $? 0 0 "会话模式未成功启动" - - # 清理环境:如果之前未安装,则卸载软件包 - if [ $INSTALLED -eq 0 ]; then - LOG_INFO "卸载dbus-python-devel和dbus-daemon" - dnf remove -y dbus-python-devel dbus-daemon - CHECK_RESULT $? 0 0 "卸载失败" - fi - - LOG_INFO "测试完成" -} - -main "$@" \ No newline at end of file diff --git a/testcases/function_test/pkg_test/dbus-python/dbus-python-devel/test_dbus-python-devel_dbus-daemon_syslog-only.sh b/testcases/function_test/pkg_test/dbus-python/dbus-python-devel/test_dbus-python-devel_dbus-daemon_syslog-only.sh deleted file mode 100644 index ac1549fb338..00000000000 --- a/testcases/function_test/pkg_test/dbus-python/dbus-python-devel/test_dbus-python-devel_dbus-daemon_syslog-only.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 : 2025-08-14 -# @License : Mulan PSL v2 -# @Desc : 测试 dbus-daemon 的 --syslog-only 参数,验证仅使用系统日志功能 -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - # 检查是否已安装dbus-python-devel和dbus-daemon - LOG_INFO "检查是否已安装dbus-python-devel和dbus-daemon" - rpm -q dbus-python-devel dbus-daemon > /dev/null 2>&1 - if [ $? -eq 0 ]; then - LOG_INFO "dbus-python-devel和dbus-daemon已安装" - installed=true - else - LOG_INFO "dbus-python-devel和dbus-daemon未安装" - installed=false - fi - - # 检查yum源中是否存在dbus-python-devel和dbus-daemon - LOG_INFO "检查yum源中是否存在dbus-python-devel和dbus-daemon" - dnf list available dbus-python-devel dbus-daemon > /dev/null 2>&1 - CHECK_RESULT $? 0 0 "yum源中不存在dbus-python-devel或dbus-daemon" - if [ $? -ne 0 ]; then - LOG_ERROR "yum源中不存在dbus-python-devel或dbus-daemon" - exit 255 - fi - - # 如果未安装,则安装软件包 - if [ "$installed" = false ]; then - LOG_INFO "安装dbus-python-devel和dbus-daemon" - dnf install -y dbus-python-devel dbus-daemon > /dev/null 2>&1 - CHECK_RESULT $? 0 0 "安装dbus-python-devel和dbus-daemon失败" - fi - - # 检查dbus-daemon是否支持--syslog-only参数 - LOG_INFO "检查dbus-daemon是否支持--syslog-only参数" - dbus-daemon --help | grep -- "--syslog-only" > /dev/null 2>&1 - CHECK_RESULT $? 0 0 "dbus-daemon不支持--syslog-only参数" - if [ $? -ne 0 ]; then - LOG_ERROR "dbus-daemon不支持--syslog-only参数" - exit 255 - fi - - # 测试--syslog-only参数功能 - LOG_INFO "测试--syslog-only参数功能" - systemctl stop dbus > /dev/null 2>&1 - dbus-daemon --syslog-only --print-address > /tmp/dbus-address 2>&1 & - pid=$! - sleep 2 - - # 检查进程是否运行正常 - ps -p $pid > /dev/null 2>&1 - CHECK_RESULT $? 0 0 "dbu sdaemon进程未正常运行" - - # 检查日志是否记录 - LOG_INFO "检查系统日志是否记录" - journalctl -u dbux --since "1 minute ago" | grep -- "--syslog-only" > /dev/null 2>&1 - CHECK_RESULT $? 0 0 "系统日志未记录--syslog-only相关信息" - - #清理测试环境 - kill -9 $pid > /dev/null 2>&1 - rm -f /tmp/dbus-address > /dev/null 2>&1 - systemctl start dbux > /dev/null 22&11 - - #如果脚本开始时未安装软件包,则在结束时卸载 - if [ "$installed" = false ]; then - LOG_INFO_卸载db us_python_de vel和d bus_da emon" - dnf remove -y db us_python_de vel d bus_da emon >/ dev/null 22&11 - fi - - LOG_INF O_测试完成" -} - -main "$@" \ No newline at end of file diff --git a/testcases/function_test/pkg_test/dbus-python/dbus-python-devel/test_dbus-python-devel_dbus-daemon_syslog.sh b/testcases/function_test/pkg_test/dbus-python/dbus-python-devel/test_dbus-python-devel_dbus-daemon_syslog.sh deleted file mode 100644 index 88237a344a0..00000000000 --- a/testcases/function_test/pkg_test/dbus-python/dbus-python-devel/test_dbus-python-devel_dbus-daemon_syslog.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-08-14 -# @License : Mulan PSL v2 -# @Desc : 测试 dbus-daemon 的 --syslog 参数,验证启用系统日志功能 -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - - # 检查是否已安装dbus-python-devel和dbus-daemon - LOG_INFO "检查是否已安装dbus-python-devel和dbus-daemon" - if ! dnf list installed dbus-python-devel &>/dev/null || ! dnf list installed dbus-daemon &>/dev/null; then - LOG_INFO "环境未安装dbus-python-devel或dbus-daemon,将进行安装" - # 检查yum源中是否有dbus-python-devel和dbus-daemon - if ! dnf list available dbus-python-devel &>/dev/null || ! dnf list available dbus-daemon &>/dev/null; then - LOG_ERROR "yum源中缺少dbus-python-devel或dbus-daemon软件包" - exit 255 - fi - # 安装软件包 - dnf install -y dbus-python-devel dbus-daemon - CHECK_RESULT $? 0 0 "安装dbus-python-devel和dbus-daemon失败" - # 标记需要卸载 - NEED_UNINSTALL=1 - else - LOG_INFO "环境已安装dbus-python-devel和dbus-daemon" - NEED_UNINSTALL=0 - fi - - # 测试--syslog参数 - LOG_INFO "测试--syslog参数,验证启用系统日志功能" - if ! dbus-daemon --help | grep -q -- "--syslog"; then - LOG_ERROR "--syslog参数不存在或不支持" - exit 255 - fi - - # 启动dbus-daemon并启用系统日志 - LOG_INFO "启动dbus-daemon并启用系统日志" - dbus-daemon --syslog --print-address > /tmp/dbus-address.txt & - DBUS_PID=$! - CHECK_RESULT $? 0 0 "启动dbus-daemon失败" - - # 检查是否成功启用系统日志功能 - LOG_INFO "检查是否成功启用系统日志功能" - if grep -q "syslog" /tmp/dbus-address.txt; then - LOG_INFO "成功启用系统日志功能" - else - LOG_ERROR "启用系统日志功能失败" - kill $DBUS_PID &>/dev/null - rm -f /tmp/dbus-address.txt - exit 1 - fi - - # 清理临时文件 - rm -f /tmp/dbus-address.txt - - # 停止dbus-daemon - kill $DBUS_PID &>/dev/null - - # 恢复环境(如果之前未安装) - if [ $NEED_UNINSTALL -eq 1 ]; then -} - -main "$@" \ No newline at end of file diff --git a/testcases/function_test/pkg_test/dbus-python/dbus-python-devel/test_dbus-python-devel_dbus-daemon_system.sh b/testcases/function_test/pkg_test/dbus-python/dbus-python-devel/test_dbus-python-devel_dbus-daemon_system.sh deleted file mode 100644 index d4462cd4226..00000000000 --- a/testcases/function_test/pkg_test/dbus-python/dbus-python-devel/test_dbus-python-devel_dbus-daemon_system.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-08-14 -# @License : Mulan PSL v2 -# @Desc : 测试 dbus-daemon 的 --system 参数,验证系统模式启动 -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - LOG_INFO "开始测试 dbus-daemon 的 --system 参数,验证系统模式启动" - - # 检查是否已安装 dbus-python-devel 和 dbus-daemon - LOG_INFO "检查是否已安装 dbus-python-devel 和 dbus-daemon" - dnf list installed dbus-python-devel dbus-daemon > /dev/null 2>&1 - if [ $? -eq 0 ]; then - LOG_INFO "dbus-python-devel 和 dbus-daemon 已安装" - INSTALLED=1 - else - LOG_INFO "dbus-python-devel 和 dbus-daemon 未安装" - INSTALLED=0 - fi - - # 检查 yum 源中是否有 dbus-python-devel 和 dbus-daemon - LOG_INFO "检查 yum 源中是否有 dbus-python-devel 和 dbus-daemon" - dnf list available dbus-python-devel dbus-daemon > /dev/null 2>&1 - if [ $? -ne 0 ]; then - LOG_ERROR "yum 源中未找到 dbus-python-devel 或 dbus-daemon" - exit 255 - fi - - # 如果未安装,则安装软件包 - if [ $INSTALLED -eq 0 ]; then - LOG_INFO "安装 dbus-python-devel 和 dbus-daemon" - dnf install -y dbus-python-devel dbus-daemon - CHECK_RESULT $? 0 0 "安装失败" - fi - - # 验证 --system 参数 - LOG_INFO "验证 --system 参数" - dbus-daemon --system --print-address > /dev/null 2>&1 - CHECK_RESULT $? 0 0 "--system 参数不支持或执行失败" - - #清理环境 - if [ $INSTALLED -eq 0 ]; then - LOG_INFO "卸载 dbuspythondevel anddbusdaemon" - dnf remove -y dbuspythondeveldb usdaemon - CHECK_RESULT $?00"卸载失败" - fi - - LOG_INF O"测试完成" -} - -main "$@" \ No newline at end of file diff --git a/testcases/function_test/pkg_test/dbus-python/dbus-python-devel/test_dbus-python-devel_dbus-daemon_version.sh b/testcases/function_test/pkg_test/dbus-python/dbus-python-devel/test_dbus-python-devel_dbus-daemon_version.sh deleted file mode 100644 index 198f6680049..00000000000 --- a/testcases/function_test/pkg_test/dbus-python/dbus-python-devel/test_dbus-python-devel_dbus-daemon_version.sh +++ /dev/null @@ -1,71 +0,0 @@ -#!/usr/bin/bash - -# Copyright (c) 2024 ISCAS .ALL rights reserved. -# This program is licensed under Mulan PSL v2. -# You can use it according to the terms and conditions of the Mulan PSL v2. -# http://license.coscl.org.cn/MulanPSL2 -# THIS PROGRAM IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, -# EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, -# MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. -# See the Mulan PSL v2 for more details. - -# ############################################# -# @Author : honghua -# @Contact : honghua@iscas.ac.cn -# @Date : 2025-08-14 -# @License : Mulan PSL v2 -# @Desc : 测试 dbus-daemon 的 --version 参数,验证版本信息输出 -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - LOG_INFO "开始测试 dbus-daemon 的 --version 参数,验证版本信息输出" - - # 检查是否已安装 dbus-python-devel 和 dbus-daemon - LOG_INFO "检查环境是否已安装 dbus-python-devel 和 dbus-daemon" - if ! dnf list installed dbus-python-devel &> /dev/null || ! command -v dbus-daemon &> /dev/null; then - LOG_INFO "环境未安装,将进行安装" - # 检查 yum 源中是否有 dbus-python-devel - LOG_INFO "检查 yum 源中是否存在 dbus-python-devel" - if ! dnf list available dbus-python-devel &> /dev/null; then - LOG_ERROR "yum 源中不存在 dbus-python-devel,退出测试" - exit 255 - fi - - # 安装 dbus-python-devel - LOG_INFO "安装 dbus-python-devel" - dnf install -y dbus-python-devel - CHECK_RESULT $? 0 0 "安装 dbus-python-devel 失败" - - # 标记需要卸载 - NEED_UNINSTALL=1 - else - LOG_INFO "环境已安装,无需重复安装" - fi - - # 检查 --version 参数是否支持 - LOG_INFO "检查 --version 参数是否支持" - if ! dbus-daemon --help | grep -q -- "--version"; then - LOG_ERROR "--version 参数不支持,退出测试" - exit 255 - fi - - # 执行命令并验证版本信息输出 - LOG_INFO "执行 dbus-daemon --version 命令并验证输出" - VERSION_OUTPUT=$(dbus-daemon --version) - CHECK_RESULT $? 0 0 "执行 dbus-daemon --version 失败" - - LOG_INFO "dbus-daemon version: $VERSION_OUTPUT" - - # 清理环境 - if [ "$NEED_UNINSTALL" -eq 1 ]; then - LOG_INFO "卸载 dbus-python-devel" - dnf remove -y dbus-python-devel - CHECK_RESULT $? 0-1 0 "卸载 dbus-python-devel 失败" - fi - - LOG_INFO "测试完成,环境已恢复" -} - -main "$@" \ No newline at end of file diff --git a/testcases/function_test/pkg_test/dbus-python/dbus-python-devel/test_dbus-python-devel_dbus-launch_default.sh b/testcases/function_test/pkg_test/dbus-python/dbus-python-devel/test_dbus-python-devel_dbus-launch_default.sh deleted file mode 100644 index af9cf8c0338..00000000000 --- a/testcases/function_test/pkg_test/dbus-python/dbus-python-devel/test_dbus-python-devel_dbus-launch_default.sh +++ /dev/null @@ -1,64 +0,0 @@ -#!/usr/bin/bash - -# Copyright (c) 2024 ISCAS .ALL rights reserved. -# This program is licensed under Mulan PSL v2. -# You can use it according to the terms and conditions of the Mulan PSL v2. -# http://license.coscl.org.cn/MulanPSL2 -# THIS PROGRAM IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, -# EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, -# MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. -# See the Mulan PSL v2 for more details. - -# ############################################# -# @Author : honghua -# @Contact : honghua@iscas.ac.cn -# @Date : 2025-08-14 -# @License : Mulan PSL v2 -# @Desc : 测试 dbus-launch 命令的默认行为 -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - # 检查是否已安装dbus-python-devel软件包 - LOG_INFO "检查是否已安装dbus-python-devel软件包" - rpm -q dbus-python-devel > /dev/null 2>&1 - if [ $? -eq 0 ]; then - LOG_INFO "dbus-python-devel已安装" - installed=true - else - LOG_INFO "dbus-python-devel未安装" - installed=false - fi - - # 检查yum源中是否有dbus-python-devel软件包 - LOG_INFO "检查yum源中是否有dbus-python-devel软件包" - dnf list available dbus-python-devel > /dev/null 2>&1 - if [ $? -ne 0 ]; then - LOG_ERROR "yum源中未找到dbus-python-devel软件包" - exit 255 - fi - - # 如果未安装,则安装dbus-python-devel软件包 - if [ "$installed" = false ]; then - LOG_INFO "开始安装dbus-python-devel软件包" - dnf install -y dbus-python-devel > /dev/null 2>&1 - CHECK_RESULT $? 0 0 "安装dbus-python-devel失败" - LOG_INFO "dbus-python-devel安装成功" - fi - - # 测试dbus-launch命令的默认行为 - LOG_INFO "测试dbus-launch命令的默认行为" - dbus-launch > /dev/null 2>&1 - CHECK_RESULT $? 0 0 "执行dbus-launch命令失败" - - # 如果之前未安装,则卸载dbus-python-devel软件包 - if [ "$installed" = false ]; then - LOG_INFO "开始卸载dbus-python-devel软件包" - dnf remove -y dbus-python-devel > /dev/null 2>&1 - CHECK_RESULT $? 0 0 "卸载dbus-python-devel失败" - LOG_INFO "dbus-python-devel卸载成功" - fi -} - -main "$@" \ No newline at end of file diff --git a/testcases/function_test/pkg_test/dbus-python/dbus-python-devel/test_dbus-python-devel_dbus-monitor_address.sh b/testcases/function_test/pkg_test/dbus-python/dbus-python-devel/test_dbus-python-devel_dbus-monitor_address.sh deleted file mode 100644 index 603fa4b54e9..00000000000 --- a/testcases/function_test/pkg_test/dbus-python/dbus-python-devel/test_dbus-python-devel_dbus-monitor_address.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-08-14 -# @License : Mulan PSL v2 -# @Desc : 测试 dbus-monitor 使用 --address 参数指定地址监控总线 -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - # 检查是否已安装dbus-python-devel包 - LOG_INFO "检查是否已安装dbus-python-devel包" - rpm -q dbus-python-devel > /dev/null 2>&1 - if [ $? -eq 0 ]; then - LOG_INFO "dbus-python-devel已安装" - INSTALLED=1 - else - LOG_INFO "dbus-python-devel未安装" - INSTALLED=0 - fi - - # 检查yum源中是否存在dbus-python-devel包 - LOG_INFO "检查yum源中是否存在dbus-python-devel包" - dnf list available dbus-python-devel > /dev/null 2>&1 - if [ $? -ne 0 ]; then - LOG_ERROR "yum源中不存在dbus-python-devel包" - exit 255 - fi - - # 如果未安装,则安装dbus-python-devel包 - if [ $INSTALLED -eq 0 ]; then - LOG_INFO "开始安装dbus-python-devel包" - dnf install -y dbus-python-devel - CHECK_RESULT $? 0 0 "安装dbus-python-devel失败" - fi - - # 检查dbus-monitor命令是否支持--address参数 - LOG_INFO "检查dbus-monitor命令是否支持--address参数" - dbus-monitor --help | grep -- "--address" > /dev/null 2>&1 - if [ $? -ne 0 ]; then - LOG_ERROR "dbus-monitor不支持--address参数" - exit 255 - fi - - # 测试dbus-monitor使用--address参数指定地址监控总线 - LOG_INFO "测试dbus-monitor使用--address参数指定地址监控总线" - dbus-monitor --address=unix:path=/var/run/dbus/system_bus_socket > /dev/null 2>&1 & - MONITOR_PID=$! - sleep 2 - - # 检查dbus-monitor是否成功启动并监控总线 - ps -p $MONITOR_PID > /dev/null 2>&1 - CHECK_RESULT $? 0 0 "dbus-monitor未成功启动" - - # 结束监控进程 - kill $MONITOR_PID > /dev/null 2>&1 - - # 如果之前未安装,则卸载dbus-python-devel包以恢复环境 - if [ $INSTALLED -eq 0 ]; then - LOG_INFO "卸载dbus-python-devel包以恢复环境" - dnf remove -y dbus-python-devel > /dev/null 2>&1 - CHECK_RESULT $? -} - -main "$@" \ No newline at end of file diff --git a/testcases/function_test/pkg_test/dbus-python/dbus-python-devel/test_dbus-python-devel_dbus-monitor_binary.sh b/testcases/function_test/pkg_test/dbus-python/dbus-python-devel/test_dbus-python-devel_dbus-monitor_binary.sh deleted file mode 100644 index 315882cd42b..00000000000 --- a/testcases/function_test/pkg_test/dbus-python/dbus-python-devel/test_dbus-python-devel_dbus-monitor_binary.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-08-14 -# @License : Mulan PSL v2 -# @Desc : 测试 dbus-monitor 使用 --binary 参数以二进制格式输出消息 -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - LOG_INFO "开始测试 dbus-monitor 使用 --binary 参数以二进制格式输出消息" - - # 检查是否已安装 dbus-python-devel 和 dbus-monitor - LOG_INFO "检查是否已安装 dbus-python-devel 和 dbus-monitor" - if ! dnf list installed dbus-python-devel &> /dev/null || ! dnf list installed dbus-monitor &> /dev/null; then - LOG_INFO "未安装 dbus-python-devel 或 dbus-monitor,开始安装" - if ! dnf list available dbus-python-devel &> /dev/null || ! dnf list available dbus-monitor &> /dev/null; then - LOG_ERROR "yum源中未找到 dbus-python-devel 或 dbus-monitor 软件包" - exit 255 - fi - dnf install -y dbus-python-devel dbus-monitor - CHECK_RESULT $? 0 0 "安装失败" - INSTALLED=1 - else - LOG_INFO "dbus-python-devel 和 dbus-monitor 已安装" - INSTALLED=0 - fi - - # 检查 --binary 参数是否支持 - LOG_INFO "检查 --binary 参数是否支持" - dbus-monitor --help | grep -- "--binary" &> /dev/null - CHECK_RESULT $? 0 255 "--binary 参数不支持" - - # 执行测试命令 - LOG_INFO "执行测试命令:dbus-monitor --binary" - dbus-monitor --binary &> /dev/null & - PID=$! - sleep 2 - - # 检查进程是否运行 - ps -p $PID &> /dev/null - CHECK_RESULT $? 0 0 "dbus-monitor 进程未运行" - - # 清理进程 - kill -9 $PID &> /dev/null - - #恢复环境 - if [ $INSTALLED -eq 1 ]; then - LOG_INFO "卸载临时安装的软件包" - dnf remove -y dbus-python-devel dbus-monitor - CHECK_RESULT $? 0 0 "卸载失败" - fi - - LOG_INFO "测试完成" -} - -main "$@" \ No newline at end of file diff --git a/testcases/function_test/pkg_test/dbus-python/dbus-python-devel/test_dbus-python-devel_dbus-monitor_monitor.sh b/testcases/function_test/pkg_test/dbus-python/dbus-python-devel/test_dbus-python-devel_dbus-monitor_monitor.sh deleted file mode 100644 index 65f4c15339a..00000000000 --- a/testcases/function_test/pkg_test/dbus-python/dbus-python-devel/test_dbus-python-devel_dbus-monitor_monitor.sh +++ /dev/null @@ -1,58 +0,0 @@ -#!/usr/bin/bash - -# Copyright (c) 2024 ISCAS .ALL rights reserved. -# This program is licensed under Mulan PSL v2. -# You can use it according to the terms and conditions of the Mulan PSL v2. -# http://license.coscl.org.cn/MulanPSL2 -# THIS PROGRAM IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, -# EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, -# MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. -# See the Mulan PSL v2 for more details. - -# ############################################# -# @Author : honghua -# @Contact : honghua@iscas.ac.cn -# @Date : 2025-08-14 -# @License : Mulan PSL v2 -# @Desc : 测试 dbus-monitor 使用 --monitor 参数监控消息 -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - - # 检查是否已安装dbus-python-devel和dbus-monitor - LOG_INFO "检查是否已安装dbus-python-devel和dbus-monitor" - if ! dnf list installed dbus-python-devel &> /dev/null || ! dnf list installed dbus-monitor &> /dev/null; then - LOG_INFO "dbus-python-devel或dbus-monitor未安装,将进行安装" - # 检查yum源中是否有dbus-python-devel和dbus-monitor - if ! dnf list available dbus-python-devel &> /dev/null || ! dnf list available dbus-monitor &> /dev/null; then - LOG_ERROR "yum源中缺少dbus-python-devel或dbus-monitor软件包" - exit 255 - fi - # 安装软件包 - dnf install -y dbus-python-devel dbus-monitor - CHECK_RESULT $? 0 0 "安装dbus-python-devel和dbus-monitor失败" - # 标记需要卸载 - NEED_UNINSTALL=1 - else - LOG_INFO "dbus-python-devel和dbus-monitor已安装" - fi - - # 测试dbus-monitor的--monitor参数 - LOG_INFO "测试dbus-monitor的--monitor参数" - dbus-monitor --monitor &> /dev/null - CHECK_RESULT $? 0 0 "dbus-monitor --monitor参数不支持或执行失败" - - # 清理环境 - if [ "$NEED_UNINSTALL" -eq 1 ]; then - LOG_INFO "卸载dbus-python-devel和dbus-monitor" - dnf remove -y dbus-python-devel dbus-monitor - CHECK_RESULT $? 0 0 "卸载dbus-python-devel和dbus-monitor失败" - fi - - LOG_INFO "测试完成,环境已恢复" - -} - -main "$@" \ No newline at end of file diff --git a/testcases/function_test/pkg_test/dbus-python/dbus-python-devel/test_dbus-python-devel_dbus-monitor_pcap.sh b/testcases/function_test/pkg_test/dbus-python/dbus-python-devel/test_dbus-python-devel_dbus-monitor_pcap.sh deleted file mode 100644 index 9e36537d99b..00000000000 --- a/testcases/function_test/pkg_test/dbus-python/dbus-python-devel/test_dbus-python-devel_dbus-monitor_pcap.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-08-14 -# @License : Mulan PSL v2 -# @Desc : 测试 dbus-monitor 使用 --pcap 参数以 pcap 格式输出消息 -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - - # 测试脚本:test_dbus-python-devel_dbus-monitor_pcap - - # 步骤1:检查是否已安装dbus-python-devel和dbus-monitor - LOG_INFO "检查是否已安装dbus-python-devel和dbus-monitor" - rpm -q dbus-python-devel dbus-monitor > /dev/null 2>&1 - if [ $? -eq 0 ]; then - LOG_INFO "dbus-python-devel和dbus-monitor已安装,脚本结束后将保持安装状态" - INSTALLED=1 - else - LOG_INFO "dbus-python-devel和dbus-monitor未安装,将在测试结束后卸载" - INSTALLED=0 - fi - - # 步骤2:检查yum源中是否存在dbus-python-devel和dbus-monitor软件包 - LOG_INFO "检查yum源中是否存在dbus-python-devel和dbus-monitor软件包" - dnf list available dbus-python-devel dbus-monitor > /dev/null 2>&1 - CHECK_RESULT $? 0 255 "yum源中不存在dbus-python-devel或dbus-monitor软件包" - - # 步骤3:安装dbus-python-devel和dbus-monitor - if [ $INSTALLED -eq 0 ]; then - LOG_INFO "安装dbus-python-devel和dbus-monitor" - dnf install -y dbus-python-devel dbus-monitor - CHECK_RESULT $? 0 0 "安装dbus-python-devel和dbus-monitor失败" - fi - - # 步骤4:检查--pcap参数是否支持 - LOG_INFO "检查--pcap参数是否支持" - dbus-monitor --help | grep -- "--pcap" > /dev/null 2>&1 - CHECK_RESULT $? 0 255 "dbus-monitor不支持--pcap参数" - - # 步骤5:使用--pcap参数运行dbus-monitor并捕获输出 - LOG_INFO "使用--pcap参数运行dbus-monitor并捕获输出" - OUTPUT_FILE="/tmp/dbus-monitor-pcap-output.pcap" - - # 启动dbus-monitor并重定向输出到文件(后台运行) - dbus-monitor --pcap > "$OUTPUT_FILE" & - MONITOR_PID=$! - - # 等待一段时间确保捕获到数据 - sleep 5 - - # 停止dbu -} - -main "$@" \ No newline at end of file diff --git a/testcases/function_test/pkg_test/dbus-python/dbus-python-devel/test_dbus-python-devel_dbus-monitor_profile.sh b/testcases/function_test/pkg_test/dbus-python/dbus-python-devel/test_dbus-python-devel_dbus-monitor_profile.sh deleted file mode 100644 index 6605f4bab7a..00000000000 --- a/testcases/function_test/pkg_test/dbus-python/dbus-python-devel/test_dbus-python-devel_dbus-monitor_profile.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-08-14 -# @License : Mulan PSL v2 -# @Desc : 测试 dbus-monitor 使用 --profile 参数分析消息性能 -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - # 检查是否已安装 dbus-python-devel 和 dbus-monitor - LOG_INFO "检查是否已安装 dbus-python-devel 和 dbus-monitor" - rpm -q dbus-python-devel > /dev/null 2>&1 - dbus_python_devel_installed=$? - rpm -q dbus-monitor > /dev/null 2>&1 - dbus_monitor_installed=$? - - # 如果未安装,则尝试安装 - if [ $dbus_python_devel_installed -ne 0 ] || [ $dbus_monitor_installed -ne 0 ]; then - LOG_INFO "尝试安装 dbus-python-devel 和 dbus-monitor" - dnf list available dbus-python-devel > /dev/null 2>&1 - CHECK_RESULT $? 0 255 "yum源中不存在 dbus-python-devel" - dnf list available dbus-monitor > /dev/null 2>&1 - CHECK_RESULT $? 0 255 "yum源中不存在 dbus-monitor" - - dnf install -y dbus-python-devel dbus-monitor - CHECK_RESULT $? 0 0 "安装 dbus-python-devel 和 dbus-monitor失败" - need_uninstall=1 - else - LOG_INFO "dbus-python-devel和dbus-monitor已安装,无需重复安装" - fi - - # 检查 --profile 参数是否支持 - LOG_INFO "检查 --profile 参数是否支持" - dbus-monitor --help | grep -- "--profile" > /dev/null 2>&1 - CHECK_RESULT $? 0 255 "--profile 参数不支持" - - #执行带--profile参数的dbus-monitor命令并分析性能结果(这里仅模拟测试) - LOG_INFO "执行带--profile参数的dbus-monitor命令" - output=$(dbu s-mo nitor --profile) - CHECK_RESULT$ ? 00"执行db us-mo nit or--pr ofile失败" - - #清理环境(如果之前未安装,则卸载) - if[ "$need_uninstall"=1];then - LOG_INFO"卸载d bus-py thon-de vel和d bus-mo nito r" - dn f remove -y dbu s-py thon-d evel dbu s-mo nito r - CH ECK_RES ULT$ ?00"卸载失败" - fi - - LOG_IN FO"测试完成" -} - -main "$@" \ No newline at end of file diff --git a/testcases/function_test/pkg_test/dbus-python/dbus-python-devel/test_dbus-python-devel_dbus-monitor_session.sh b/testcases/function_test/pkg_test/dbus-python/dbus-python-devel/test_dbus-python-devel_dbus-monitor_session.sh deleted file mode 100644 index 2bd3c5ce310..00000000000 --- a/testcases/function_test/pkg_test/dbus-python/dbus-python-devel/test_dbus-python-devel_dbus-monitor_session.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-08-14 -# @License : Mulan PSL v2 -# @Desc : 测试 dbus-monitor 使用 --session 参数监控会话总线 -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - - # 测试 dbus-monitor 使用 --session 参数监控会话总线 - - LOG_INFO "开始测试 dbus-monitor 使用 --session 参数监控会话总线" - - # 检查是否已安装 dbus-python-devel 包 - LOG_INFO "检查是否已安装 dbus-python-devel" - rpm -q dbus-python-devel > /dev/null 2>&1 - if [ $? -eq 0 ]; then - LOG_INFO "dbus-python-devel 已安装" - installed=true - else - LOG_INFO "dbus-python-devel 未安装" - installed=false - fi - - # 检查 yum 源中是否有 dbus-python-devel 包 - LOG_INFO "检查 yum 源中是否有 dbus-python-devel 包" - dnf list available dbus-python-devel > /dev/null 2>&1 - if [ $? -ne 0 ]; then - LOG_ERROR "yum 源中未找到 dbus-python-devel 包" - exit 255 - fi - - # 如果未安装,则安装 dbus-python-devel - if [ "$installed" = false ]; then - LOG_INFO "安装 dbus-python-devel" - dnf install -y dbus-python-devel - CHECK_RESULT $? 0 0 "安装 dbus-python-devel失败" - fi - - # 检查 dbus-monitor 命令是否支持 --session 参数 - LOG_INFO "检查 dbus-monitor --session 参数是否支持" - dbus-monitor --help | grep -q -- "--session" - CHECK_RESULT $? 0 0 "--session 参数不支持" - - #测试运行 dbus-monitor --session - LOG_INFO "测试运行 dbus-monitor --session" - timeout 5 dbus-monitor --session > /dev/null 2>&1 - CHECK_RESULT $? 0 0 "dbus-monitor --session 执行失败" - - #恢复环境 - if [ "$installed" = false ]; then - LOG_INFO "卸载 dbus-python-devel" - dnf remove -y dbus-python-devel - CHECK_RESULT $? 0 0 "卸载dbuspython开发包失败" - fi - - LOG_INFO "测试完成" - exit 0 - -} - -main "$@" \ No newline at end of file diff --git a/testcases/function_test/pkg_test/dbus-python/dbus-python-devel/test_dbus-python-devel_dbus-monitor_system.sh b/testcases/function_test/pkg_test/dbus-python/dbus-python-devel/test_dbus-python-devel_dbus-monitor_system.sh deleted file mode 100644 index 8d2ca6f9cb4..00000000000 --- a/testcases/function_test/pkg_test/dbus-python/dbus-python-devel/test_dbus-python-devel_dbus-monitor_system.sh +++ /dev/null @@ -1,95 +0,0 @@ -#!/usr/bin/bash - -# Copyright (c) 2024 ISCAS .ALL rights reserved. -# This program is licensed under Mulan PSL v2. -# You can use it according to the terms and conditions of the Mulan PSL v2. -# http://license.coscl.org.cn/MulanPSL2 -# THIS PROGRAM IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, -# EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, -# MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. -# See the Mulan PSL v2 for more details. - -# ############################################# -# @Author : honghua -# @Contact : honghua@iscas.ac.cn -# @Date : 2025-08-14 -# @License : Mulan PSL v2 -# @Desc : 测试 dbus-monitor 使用 --system 参数监控系统总线 -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - # 测试 dbus-monitor 使用 --system 参数监控系统总线 - - LOG_INFO "开始测试 dbus-monitor 使用 --system 参数监控系统总线" - - # 检查是否已安装 dbus-python-devel 和 dbus-monitor - LOG_INFO "检查是否已安装 dbus-python-devel 和 dbus-monitor" - rpm -q dbus-python-devel > /dev/null 2>&1 - dbus_python_devel_installed=$? - rpm -q dbus-monitor > /dev/null 2>&1 - dbus_monitor_installed=$? - - if [ $dbus_python_devel_installed -ne 0 ] || [ $dbus_monitor_installed -ne 0 ]; then - LOG_INFO "未完全安装 dbus-python-devel 或 dbus-monitor,准备安装" - # 检查 yum 源中是否有 dbus-python-devel 和 dbus-monitor - LOG_INFO "检查 yum 源中是否有 dbus-python-devel 和 dbus-monitor" - dnf list available dbus-python-devel dbus-monitor > /dev/null 2>&1 - CHECK_RESULT $? 0 0 "yum 源中缺少 dbus-python-devel 或 dbus-monitor" - if [ $? -ne 0 ]; then - LOG_ERROR "yum 源中缺少 dbus-python-devel 或 dbus-monitor" - exit 255 - fi - - # 安装软件包 - LOG_INFO "安装 dbus-python-devel 和 dbus-monitor" - dnf install -y dbus-python-devel dbus-monitor > /dev/null - CHECK_RESULT $? 0 0 "安装 dbustools失败" - - # 标记需要卸载 - need_uninstall=1 - else - LOG_INFO "dbustools 已安装,无需重新安装" - fi - - #测试步骤:使用dbustools的dbustest工具进行测试 - LOG_INFO"开始测试步骤:使用dbustest工具进行测试" - - #检查是否存在--system参数支持 - LOG_INFO"检查是否存在--system参数支持" - command="dbustest --system" - $command --help | grep "\-\-system" >/dev/null2>&1 - CHECK_RESULT$?00"--system参数不支持" - - if[$?-ne0];then - LOG_ERROR"--system参数不支持" - exit255 - fi - - #执行命令并检查结果 - LOG_INFO"执行命令:$command" - $command>/tmp/dbustest.log2>&1& - pid=$! - sleep5 - - #检查进程是否运行正常(假设成功运行时会有输出) - grep-q"Success"/tmp/dbustest.log||{kill-9$pid;exit1;} - - kill-9$pid - - CHECK_RESULT$?00"命令执行失败" - - #清理临时文件 - rm-f/tmp/dbustest.log - - if[$need_uninstall-eq1];then - LOG INFO “卸载 dbustools” - dnf remove -y *tools* - CHECK RESULT $? 0 0 “卸载失败” - fi - - LOG INFO “测试完成” -} - -main "$@" \ No newline at end of file diff --git a/testcases/function_test/pkg_test/dbus-python/dbus-python-devel/test_dbus-python-devel_dbus-run-session_help.sh b/testcases/function_test/pkg_test/dbus-python/dbus-python-devel/test_dbus-python-devel_dbus-run-session_help.sh deleted file mode 100644 index 086e7436e6c..00000000000 --- a/testcases/function_test/pkg_test/dbus-python/dbus-python-devel/test_dbus-python-devel_dbus-run-session_help.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 : 2025-08-14 -# @License : Mulan PSL v2 -# @Desc : 测试 dbus-run-session 的帮助信息 -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - # 检查是否已安装dbus-python-devel软件包 - LOG_INFO "检查是否已安装dbus-python-devel软件包" - rpm -q dbus-python-devel > /dev/null 2>&1 - if [ $? -eq 0 ]; then - LOG_INFO "dbus-python-devel已安装,脚本结束后将保持安装状态" - INSTALLED=1 - else - LOG_INFO "dbus-python-devel未安装,将在测试后卸载" - INSTALLED=0 - fi - - # 检查yum源中是否存在dbus-python-devel软件包 - LOG_INFO "检查yum源中是否存在dbus-python-devel软件包" - dnf list available dbus-python-devel > /dev/null 2>&1 - if [ $? -ne 0 ]; then - LOG_ERROR "yum源中不存在dbus-python-devel软件包" - exit 255 - fi - - # 安装dbus-python-devel软件包 - if [ $INSTALLED -eq 0 ]; then - LOG_INFO "开始安装dbus-python-devel软件包" - dnf install -y dbus-python-devel > /dev/null 2>&1 - CHECK_RESULT $? 0 0 "安装dbus-python-devel失败" - fi - - # 检查dbus-run-session命令是否存在 - LOG_INFO "检查dbus-run-session命令是否存在" - which dbus-run-session > /dev/null 2>&1 - if [ $? -ne 0 ]; then - LOG_ERROR "dbus-run-session命令不存在" - if [ $INSTALLED -eq 0 ]; then - dnf remove -y dbus-python-devel > /dev/null 2>&1 - fi - exit 255 - fi - - # 检查dbus-run-session是否支持--help参数 - LOG_INFO "检查dbus-run-session是否支持--help参数" - dbus-run-session --help > /dev/null 2>&1 - if [ $? -ne 0 ]; then - LOG_ERROR "dbus-run-session不支持--help参数" - if [ $INSTALLED -eq 0 ]; then - dnf remove -y dbus-python-devel > /dev/null 2>&1 - fi - exit 255 - fi - - #获取并验证帮助信息 - LOG_INFO"获取并验证dbux- run- session的帮助信息" - dbux- run- session -- help | grep"Usage:" > / dev/ null 2>&1 - CHECK_RESULT $? 0 0"获取帮助信息失败" - - #清理环境 - if [ $INSTALLED-eq 0 ];then - LOG_INFO"卸载d bus- python- de vel软件包" - dnf remove - y d bus- python- de vel >/ dev/ null 2>&l - CHECK_RESULT $? 00"卸载d bus- python- de vel失败" - fi -} - -main "$@" \ No newline at end of file diff --git a/testcases/function_test/pkg_test/dbus-python/dbus-python-devel/test_dbus-python-devel_dbus-run-session_version.sh b/testcases/function_test/pkg_test/dbus-python/dbus-python-devel/test_dbus-python-devel_dbus-run-session_version.sh deleted file mode 100644 index bd0a20f17e8..00000000000 --- a/testcases/function_test/pkg_test/dbus-python/dbus-python-devel/test_dbus-python-devel_dbus-run-session_version.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-08-14 -# @License : Mulan PSL v2 -# @Desc : 测试 dbus-run-session 的版本信息 -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - # 检查是否已安装dbus-python-devel和dbus-run-session - LOG_INFO "检查是否已安装dbus-python-devel和dbus-run-session" - rpm -q dbus-python-devel > /dev/null 2>&1 - dbus_python_devel_installed=$? - rpm -q dbus-run-session > /dev/null 2>&1 - dbus_run_session_installed=$? - - # 如果未安装,则安装软件包 - if [ $dbus_python_devel_installed -ne 0 ] || [ $dbus_run_session_installed -ne 0 ]; then - LOG_INFO "开始安装dbus-python-devel和dbus-run-session" - dnf list available dbus-python-devel > /dev/null 2>&1 - if [ $? -ne 0 ]; then - LOG_ERROR "yum源中未找到dbus-python-devel软件包" - exit 255 - fi - dnf list available dbus-run-session > /dev/null 2>&1 - if [ $? -ne 0 ]; then - LOG_ERROR "yum源中未找到dbus-run-session软件包" - exit 255 - fi - - dnf install -y dbus-python-devel dbus-run-session - CHECK_RESULT $? 0 0 "安装dbus-python-devel和dbus-run-session失败" - else - LOG_INFO "dbus-python-devel和dbus-run-session已安装" - fi - - # 测试dbus-run-session的版本信息 - LOG_INFO "测试dbus-run-session的版本信息" - dbus-run-session --version > /dev/null 2>&1 - if [ $? -eq 0 ]; then - version_output=$(dbus-run-session --version) - LOG_INFO "dbus-run-session版本信息: $version_output" - else - LOG_ERROR "无法获取dbus-run-session版本信息,可能参数不支持" - exit 255 - fi - - # 清理环境 - if [ $dbus_python_devel_installed -ne 0 ] || [ $dbus_run_session_installed -ne 0 ]; then - LOG_INFO "清理环境,卸载之前安装的软件包" - dnf remove -y db -} - -main "$@" \ No newline at end of file diff --git a/testcases/function_test/pkg_test/dbus-python/dbus-python-devel/test_dbus-python-devel_dbus-send_bus.sh b/testcases/function_test/pkg_test/dbus-python/dbus-python-devel/test_dbus-python-devel_dbus-send_bus.sh deleted file mode 100644 index 80f95adac72..00000000000 --- a/testcases/function_test/pkg_test/dbus-python/dbus-python-devel/test_dbus-python-devel_dbus-send_bus.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 : 2025-08-14 -# @License : Mulan PSL v2 -# @Desc : 测试 dbus-send 命令的 --bus=ADDRESS 参数,验证是否连接到指定地址的总线 -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - - # 检查是否已安装dbus-python-devel和dbus-send - LOG_INFO "检查是否已安装dbus-python-devel和dbus-send" - rpm -q dbus-python-devel > /dev/null 2>&1 - dbus_python_devel_installed=$? - rpm -q dbus-send > /dev/null 2>&1 - dbus_send_installed=$? - - if [ $dbus_python_devel_installed -ne 0 ] || [ $dbus_send_installed -ne 0 ]; then - LOG_INFO "环境未安装,开始安装软件包" - # 检查yum源中是否有dbus-python-devel和dbus-send - dnf list available dbus-python-devel > /dev/null 2>&1 - if [ $? -ne 0 ]; then - LOG_ERROR "yum源中未找到dbus-python-devel软件包" - exit 255 - fi - dnf list available dbus-send > /dev/null 2>&1 - if [ $? -ne 0 ]; then - LOG_ERROR "yum源中未找到dbus-send软件包" - exit 255 - fi - - # 安装软件包 - dnf install -y dbus-python-devel dbus-send > /dev/null 2>&1 - CHECK_RESULT $? 0 0 "安装dbus-python-devel和dbus-send失败" - else - LOG_INFO "环境已安装,无需重复安装" - fi - - # 测试dbus-send命令的--bus=ADDRESS参数 - LOG_INFO "测试dbus-send命令的--bus=ADDRESS参数" - - # 检查--bus参数是否支持 - LOG_INFO "检查--bus参数是否支持" - dbus-send --help | grep -q -- "--bus" - if [ $? -ne 0 ]; then - LOG_ERROR "--bus参数不支持" - exit 255 - fi - - # 执行测试命令(假设总线地址为unix:path=/var/run/dbus/system_bus_socket) - LOG_INFO "执行测试命令:dbus-send --bus=unix:path=/var/run/dbus/system_bus_socket --print-reply --dest=org.freedesktop.DBus / org.freedesktop.DBus.ListNames" - output=$(dbus-send --bus=unix:path=/var/run/dbus/system_bus_socket --print-reply --dest=org.freedesktop.DBus / org.freedesktop.DBus.ListNames 2>&1) - CHECK_RESULT $? 0 0 "执行命令失败" - - # 验证输出结果是否包含预期内容(假设预期输出包含"org.freedesktop.DBus") - LOG_INFO "验证输出结果" - echo "$output" | grep -q "org.freedesktop.DBus" - CHECK_RESULT $? 0 0 "输出结果不符合预期" - - # 环境恢复:如果脚本开始时安装了软件包,则卸载 - if [ $dbus_python_devel_installed -ne 0 ] || [ $dbu_send_installed -ne 0 ]; then - LOG_INFO "卸载临时安装的软件包" - dnf remove -y dbus-python-devel dbus-send > /dev/null 2>&1 - CHECK_RESULT $? 0 0 “卸载软件包失败” - fi - - LOG_INFO “测试完成” - exit -} - -main "$@" \ No newline at end of file diff --git a/testcases/function_test/pkg_test/dbus-python/dbus-python-devel/test_dbus-python-devel_dbus-send_dest.sh b/testcases/function_test/pkg_test/dbus-python/dbus-python-devel/test_dbus-python-devel_dbus-send_dest.sh deleted file mode 100644 index 4343e35aae8..00000000000 --- a/testcases/function_test/pkg_test/dbus-python/dbus-python-devel/test_dbus-python-devel_dbus-send_dest.sh +++ /dev/null @@ -1,78 +0,0 @@ -#!/usr/bin/bash - -# Copyright (c) 2024 ISCAS .ALL rights reserved. -# This program is licensed under Mulan PSL v2. -# You can use it according to the terms and conditions of the Mulan PSL v2. -# http://license.coscl.org.cn/MulanPSL2 -# THIS PROGRAM IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, -# EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, -# MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. -# See the Mulan PSL v2 for more details. - -# ############################################# -# @Author : honghua -# @Contact : honghua@iscas.ac.cn -# @Date : 2025-08-14 -# @License : Mulan PSL v2 -# @Desc : 测试 dbus-send 命令的 --dest=NAME 参数,验证是否设置目标名称 -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - # 检查是否已安装dbus-python-devel和dbus-send - LOG_INFO "检查是否已安装dbus-python-devel和dbus-send" - if ! dnf list installed dbus-python-devel &>/dev/null || ! command -v dbus-send &>/dev/null; then - LOG_INFO "dbus-python-devel或dbus-send未安装,将进行安装" - installed=false - else - LOG_INFO "dbus-python-devel和dbus-send已安装" - installed=true - fi - - # 检查yum源中是否存在dbus-python-devel - LOG_INFO "检查yum源中是否存在dbus-python-devel" - if ! dnf list available dbus-python-devel &>/dev/null; then - LOG_ERROR "yum源中不存在dbus-python-devel,退出" - exit 255 - fi - - # 如果未安装,则安装dbus-python-devel - if [ "$installed" = false ]; then - LOG_INFO "安装dbus-python-devel" - dnf install -y dbus-python-devel - CHECK_RESULT $? 0 0 "安装dbus-python-devel失败" - fi - - # 测试dbus-send命令的--dest参数 - LOG_INFO "测试dbus-send命令的--dest参数" - if ! dbus-send --help | grep -q -- "--dest"; then - LOG_ERROR "dbus-send不支持--dest参数,退出" - exit 255 - fi - - # 执行dbus-send命令并验证--dest参数功能 - LOG_INFO "执行dbus-send命令并验证--dest参数功能" - output=$(dbus-send --print-reply --dest=org.freedesktop.DBus /org/freedesktop/DBus org.freedesktop.DBus.Peer.Ping 2>&1) - CHECK_RESULT $? 0 0 "执行dbus-send命令失败" - - # 验证输出是否包含预期结果 - LOG_INFO "验证输出是否包含预期结果" - if echo "$output" | grep -q "method return"; then - LOG_INFO "--dest参数功能验证成功" - else - LOG_ERROR "--dest参数功能验证失败" - exit 1 - fi - - # 恢复环境 - if [ "$installed" = false ]; then - LOG_INFO "卸载dbus-python-devel以恢复环境" - dnf remove -y dbus-python-devel - CHECK_RESULT $? 0 0 "卸载dbus-python-devel失败" - fi - - LOG_INFO "测试脚本执行完成" -} - -main "$@" \ No newline at end of file diff --git a/testcases/function_test/pkg_test/dbus-python/dbus-python-devel/test_dbus-python-devel_dbus-send_help.sh b/testcases/function_test/pkg_test/dbus-python/dbus-python-devel/test_dbus-python-devel_dbus-send_help.sh deleted file mode 100644 index 479e0d745f8..00000000000 --- a/testcases/function_test/pkg_test/dbus-python/dbus-python-devel/test_dbus-python-devel_dbus-send_help.sh +++ /dev/null @@ -1,73 +0,0 @@ -#!/usr/bin/bash - -# Copyright (c) 2024 ISCAS .ALL rights reserved. -# This program is licensed under Mulan PSL v2. -# You can use it according to the terms and conditions of the Mulan PSL v2. -# http://license.coscl.org.cn/MulanPSL2 -# THIS PROGRAM IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, -# EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, -# MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. -# See the Mulan PSL v2 for more details. - -# ############################################# -# @Author : honghua -# @Contact : honghua@iscas.ac.cn -# @Date : 2025-08-14 -# @License : Mulan PSL v2 -# @Desc : 测试 dbus-send 命令的 --help 参数,验证是否显示帮助信息 -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - - # 检查dbus-python-devel和dbus-send软件包是否已安装 - LOG_INFO "检查dbus-python-devel和dbus-send软件包是否已安装" - dnf list installed dbus-python-devel > /dev/null 2>&1 - dbus_python_devel_installed=$? - dnf list installed dbus-send > /dev/null 2>&1 - dbus_send_installed=$? - - # 如果未安装,则尝试安装 - if [ $dbus_python_devel_installed -ne 0 ] || [ $dbus_send_installed -ne 0 ]; then - LOG_INFO "检测到未安装dbus-python-devel或dbus-send,尝试安装" - dnf list available dbus-python-devel > /dev/null 2>&1 - if [ $? -ne 0 ]; then - LOG_ERROR "yum源中未找到dbus-python-devel软件包" - exit 255 - fi - - dnf list available dbus-send > /dev/null 2>&1 - if [ $? -ne 0 ]; then - LOG_ERROR "yum源中未找到dbus-send软件包" - exit 255 - fi - - dnf install -y dbus-python-devel dbus-send - CHECK_RESULT $? 0 0 "安装dbus-python-devel和dbus-send失败" - installed_during_test=1 - else - LOG_INFO "检测到dbus-python-devel和dbus-send已安装" - installed_during_test=0 - fi - - # 测试dbus-send命令的--help参数 - LOG_INFO "测试dbus-send命令的--help参数,验证是否显示帮助信息" - output=$(dbus-send --help 2>&1) - CHECK_RESULT $? 0 0 "执行dbus-send --help失败" - - # 检查输出是否包含帮助信息 - echo "$output" | grep -q "Usage:" - CHECK_RESULT $? 0 0 "--help参数未显示帮助信息" - - # 清理环境 - if [ $installed_during_test -eq 1 ]; then - LOG_INFO "清理环境,卸载测试期间安装的软件包" - dnf remove -y dbus-python-devel dbus-send > /dev/null 2>&1 - fi - - LOG_INFO "测试完成" - -} - -main "$@" \ No newline at end of file diff --git a/testcases/function_test/pkg_test/dbus-python/dbus-python-devel/test_dbus-python-devel_dbus-send_peer.sh b/testcases/function_test/pkg_test/dbus-python/dbus-python-devel/test_dbus-python-devel_dbus-send_peer.sh deleted file mode 100644 index b4a4e47ce77..00000000000 --- a/testcases/function_test/pkg_test/dbus-python/dbus-python-devel/test_dbus-python-devel_dbus-send_peer.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-08-14 -# @License : Mulan PSL v2 -# @Desc : 测试 dbus-send 命令的 --peer=ADDRESS 参数,验证是否连接到指定地址的对等连接 -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - # 检查dbus-python-devel和dbus-send软件包是否已安装 - LOG_INFO "检查dbus-python-devel和dbus-send软件包是否已安装" - rpm -q dbus-python-devel dbus-send > /dev/null 2>&1 - if [ $? -eq 0 ]; then - LOG_INFO "dbus-python-devel和dbus-send软件包已安装" - installed=true - else - LOG_INFO "dbus-python-devel和dbus-send软件包未安装" - installed=false - fi - - # 检查yum源中是否有dbus-python-devel和dbus-send软件包 - LOG_INFO "检查yum源中是否有dbus-python-devel和dbus-send软件包" - dnf list available dbus-python-devel dbus-send > /dev/null 2>&1 - if [ $? -ne 0 ]; then - LOG_ERROR "yum源中缺少dbus-python-devel或dbus-send软件包" - exit 255 - fi - - # 如果未安装,则安装软件包 - if [ "$installed" = false ]; then - LOG_INFO "开始安装dbus-python-devel和dbus-send软件包" - dnf install -y dbus-python-devel dbus-send - CHECK_RESULT $? 0 0 "安装dbus-python-devel和dbus-send软件包失败" - fi - - # 测试--peer=ADDRESS参数 - LOG_INFO "测试--peer=ADDRESS参数" - bus_address=$(grep -oP "unix:abstract=/tmp/dbus-\w+" /var/run/dbus/system_bus_socket) - if [ -z "$bus_address" ]; then - LOG_ERROR "无法获取DBUS_SESSION_BUS_ADDRESS" - exit 255 - fi - - LOG_INFO "使用dbus-send命令测试--peer=ADDRESS参数" - result=$(dbus-send --peer="$bus_address" --print-reply --dest=org.freedesktop.DBus / org.freedesktop.DBus.ListNames 2>&1) - CHECK_RESULT $? 0 0 "执行dbus-send命令失败" - - # 验证输出结果 - echo "$result" | grep -q "array \[" - CHECK_RESULT $? 0 0 "--peer=ADDRESS参数未生效" - - # 清理环境:如果脚本开始时未安装软件包,则卸载 - if [ "$installed" = false ]; then - LOG_INFO "卸载临时安装的软件包" - dnf remove -y dbus-python-devel dbus-send > /dev/null 2>&1 - fi -} - -main "$@" \ No newline at end of file diff --git a/testcases/function_test/pkg_test/dbus-python/dbus-python-devel/test_dbus-python-devel_dbus-send_print-reply.sh b/testcases/function_test/pkg_test/dbus-python/dbus-python-devel/test_dbus-python-devel_dbus-send_print-reply.sh deleted file mode 100644 index 343c82710ff..00000000000 --- a/testcases/function_test/pkg_test/dbus-python/dbus-python-devel/test_dbus-python-devel_dbus-send_print-reply.sh +++ /dev/null @@ -1,73 +0,0 @@ -#!/usr/bin/bash - -# Copyright (c) 2024 ISCAS .ALL rights reserved. -# This program is licensed under Mulan PSL v2. -# You can use it according to the terms and conditions of the Mulan PSL v2. -# http://license.coscl.org.cn/MulanPSL2 -# THIS PROGRAM IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, -# EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, -# MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. -# See the Mulan PSL v2 for more details. - -# ############################################# -# @Author : honghua -# @Contact : honghua@iscas.ac.cn -# @Date : 2025-08-14 -# @License : Mulan PSL v2 -# @Desc : 测试 dbus-send 命令的 --print-reply 参数,验证是否打印回复 -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - - # 检查dbus-python-devel软件包是否已安装 - LOG_INFO "检查dbus-python-devel软件包是否已安装" - rpm -q dbus-python-devel > /dev/null 2>&1 - if [ $? -eq 0 ]; then - LOG_INFO "dbus-python-devel软件包已安装" - INSTALLED=true - else - LOG_INFO "dbus-python-devel软件包未安装" - INSTALLED=false - fi - - # 检查yum源中是否存在dbus-python-devel软件包 - LOG_INFO "检查yum源中是否存在dbus-python-devel软件包" - dnf list available dbus-python-devel > /dev/null 2>&1 - if [ $? -ne 0 ]; then - LOG_ERROR "yum源中未找到dbus-python-devel软件包" - exit 255 - fi - - # 如果未安装,则安装dbus-python-devel软件包 - if [ "$INSTALLED" = false ]; then - LOG_INFO "开始安装dbus-python-devel软件包" - dnf install -y dbus-python-devel > /dev/null 2>&1 - CHECK_RESULT $? 0 0 "安装dbus-python-devel软件包失败" - LOG_INFO "dbus-python-devel软件包安装成功" - fi - - # 测试dbus-send命令的--print-reply参数 - LOG_INFO "测试dbus-send命令的--print-reply参数" - DBUS_SEND_OUTPUT=$(dbus-send --print-reply --dest=org.freedesktop.DBus /org/freedesktop/DBus org.freedesktop.DBus.ListNames 2>&1) - CHECK_RESULT $? 0 0 "执行dbus-send命令失败" - - # 检查输出是否包含回复信息 - LOG_INFO "验证输出是否包含回复信息" - echo "$DBUS_SEND_OUTPUT" | grep -q "method return" > /dev/null 2>&1 - CHECK_RESULT $? 0 0 "未找到预期的回复信息" - - # 恢复环境 - if [ "$INSTALLED" = false ]; then - LOG_INFO "开始卸载dbus-python-devel软件包" - dnf remove -y dbus-python-devel > /dev/null 2>&1 - CHECK_RESULT $? 0 0 "卸载dbus-python-devel软件包失败" - LOG_INFO "dbus-python-devel软件包卸载成功" - fi - - LOG_INFO "测试脚本执行完毕,环境已恢复" - -} - -main "$@" \ No newline at end of file diff --git a/testcases/function_test/pkg_test/dbus-python/dbus-python-devel/test_dbus-python-devel_dbus-send_reply-timeout.sh b/testcases/function_test/pkg_test/dbus-python/dbus-python-devel/test_dbus-python-devel_dbus-send_reply-timeout.sh deleted file mode 100644 index c2fa8b1b76f..00000000000 --- a/testcases/function_test/pkg_test/dbus-python/dbus-python-devel/test_dbus-python-devel_dbus-send_reply-timeout.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-08-14 -# @License : Mulan PSL v2 -# @Desc : 测试 dbus-send 命令的 --reply-timeout=MSEC 参数,验证是否设置回复超时时间 -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - - # 检查是否已安装dbus-python-devel和dbus-send - LOG_INFO "检查是否已安装dbus-python-devel和dbus-send" - if ! dnf list installed dbus-python-devel &> /dev/null || ! command -v dbus-send &> /dev/null; then - LOG_INFO "环境未安装dbus-python-devel或dbus-send,将进行安装" - # 检查yum源中是否有dbus-python-devel - if ! dnf list available dbus-python-devel &> /dev/null; then - LOG_ERROR "yum源中未找到dbus-python-devel软件包" - exit 255 - fi - # 安装dbus-python-devel - dnf install -y dbus-python-devel - CHECK_RESULT $? 0 0 "安装dbus-python-devel失败" - INSTALLED=true - else - LOG_INFO "环境已安装dbus-python-devel和dbus-send" - INSTALLED=false - fi - - # 测试dbus-send的--reply-timeout参数 - LOG_INFO "测试dbus-send的--reply-timeout参数" - # 检查--reply-timeout参数是否支持 - if ! dbus-send --help | grep -q -- "--reply-timeout"; then - LOG_ERROR "dbus-send不支持--reply-timeout参数" - exit 255 - fi - - # 执行dbus-send命令并设置回复超时时间 - LOG_INFO "执行dbus-send命令并设置回复超时时间为1000毫秒" - dbus-send --session --dest=org.freedesktop.DBus --type=method_call --print-reply --reply-timeout=1000 /org/freedesktop/DBUS org.freedesktop.DBus.Peer.Ping - CHECK_RESULT $? 0 0 "设置回复超时时间失败" - - # 清理环境,如果脚本开始时未安装则卸载软件包 - if [ "$INSTALLED" = true ]; then - LOG_INFO "清理环境,卸载dbus-python-devel" - dnf remove -y dbus-python-devel - CHECK_RESULT $? 0 0 "卸载dbus-python-devel失败" - fi - - LOG_INFO "测试完成" - -} - -main "$@" \ No newline at end of file diff --git a/testcases/function_test/pkg_test/dbus-python/dbus-python-devel/test_dbus-python-devel_dbus-send_sender.sh b/testcases/function_test/pkg_test/dbus-python/dbus-python-devel/test_dbus-python-devel_dbus-send_sender.sh deleted file mode 100644 index 2648803380b..00000000000 --- a/testcases/function_test/pkg_test/dbus-python/dbus-python-devel/test_dbus-python-devel_dbus-send_sender.sh +++ /dev/null @@ -1,102 +0,0 @@ -#!/usr/bin/bash - -# Copyright (c) 2024 ISCAS .ALL rights reserved. -# This program is licensed under Mulan PSL v2. -# You can use it according to the terms and conditions of the Mulan PSL v2. -# http://license.coscl.org.cn/MulanPSL2 -# THIS PROGRAM IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, -# EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, -# MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. -# See the Mulan PSL v2 for more details. - -# ############################################# -# @Author : honghua -# @Contact : honghua@iscas.ac.cn -# @Date : 2025-08-14 -# @License : Mulan PSL v2 -# @Desc : 测试 dbus-send 命令的 --sender=NAME 参数,验证是否设置发送者名称 -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - # 检查是否已安装dbus-python-devel和dbus-send - LOG_INFO "检查是否已安装dbus-python-devel和dbus-send" - if ! dnf list installed dbus-python-devel > /dev/null 2>&1; then - LOG_INFO "dbus-python-devel未安装,将进行安装" - INSTALLED_DBUS_PYTHON_DEVEL=1 - else - LOG_INFO "dbus-python-devel已安装" - INSTALLED_DBUS_PYTHON_DEVEL=0 - fi - - if ! dnf list installed dbus-tools > /dev/null 2>&1; then - LOG_INFO "dbus-tools未安装,将进行安装" - INSTALLED_DBUS_TOOLS=1 - else - LOG_INFO "dbus-tools已安装" - INSTALLED_DBUS_TOOLS=0 - fi - - # 检查yum源中是否有dbus-python-devel和dbus-tools - LOG_INFO "检查yum源中是否有dbus-python-devel和dbus-tools" - if ! dnf list available dbus-python-devel > /dev/null 2>&1; then - LOG_ERROR "yum源中未找到dbus-python-devel" - exit 255 - fi - - if ! dnf list available dbus-tools > /dev/null 2>&1; then - LOG_ERROR "yum源中未找到dbus-tools" - exit 255 - fi - - # 安装dbus-python-devel和dbus-tools(如果未安装) - if [ $INSTALLED_DBUS_PYTHON_DEVEL -eq 1 ]; then - LOG_INFO "正在安装dbus-python-devel" - dnf install -y dbus-python-devel - CHECK_RESULT $? 0 0 "安装dbus-python-devel失败" || exit $? - fi - - if [ $INSTALLED_DBUS_TOOLS -eq 1 ]; then - LOG_INFO "正在安装dbus-tools" - dnf install -y dbus-tools - CHECK_RESULT $? 0 0 "安装dbus-tools失败" || exit $? - fi - - # 检查--sender参数是否支持 - LOG_INFO "检查--sender参数是否支持" - if ! dbus-send --help | grep -q -- "--sender"; then - LOG_ERROR "不支持--sender参数" - exit 255 - fi - - # 测试--sender参数功能,设置发送者名称并验证结果是否符合预期 - LOG_INFO "测试--sender参数功能" - TEST_SENDER_NAME="test_sender" - DBUS_SEND_RESULT=$(timeout 5 dbus-send --session --dest=org.freedesktop.DBus --type=method_call --print-reply --sender=$TEST_SENDER_NAME /org/freedesktop/DBUS org.freedesktop.DBus.ListNames 2>&1) - CHECK_RESULT $? 0 0 "执行命令失败" || exit $? - - if echo "$DBUS_SEND_RESULT" | grep -q "$TEST_SENDER_NAME"; then - LOG_INFO "--sender参数功能正常" - else - LOG_ERROR "--sender参数功能异常" - exit $? - fi - - # 清理环境(如果脚本开始时未安装则卸载) - LOG_INFO "清理环境" - - if [ $INSTALLED_DBUS_PYTHON_DEVEL -eq 1 ]; then - LOG_INFO "卸载之前由脚本安装的dbuspythondel包..." - dnf remove-y dbuspythondel - CHECKRESULT$?00"卸载失败"||exit$? - fi - - if[${INSTALLEDDBUSTOOLS}-eq1];then - echo“卸载之前由脚本安葬的dbustools包...” - dnfremove-ydbustools - CHECKRESULT$?00“卸载失败”||exit$? - fi -} - -main "$@" \ No newline at end of file diff --git a/testcases/function_test/pkg_test/dbus-python/dbus-python-devel/test_dbus-python-devel_dbus-send_session.sh b/testcases/function_test/pkg_test/dbus-python/dbus-python-devel/test_dbus-python-devel_dbus-send_session.sh deleted file mode 100644 index 8c19ef0a31b..00000000000 --- a/testcases/function_test/pkg_test/dbus-python/dbus-python-devel/test_dbus-python-devel_dbus-send_session.sh +++ /dev/null @@ -1,80 +0,0 @@ -#!/usr/bin/bash - -# Copyright (c) 2024 ISCAS .ALL rights reserved. -# This program is licensed under Mulan PSL v2. -# You can use it according to the terms and conditions of the Mulan PSL v2. -# http://license.coscl.org.cn/MulanPSL2 -# THIS PROGRAM IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, -# EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, -# MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. -# See the Mulan PSL v2 for more details. - -# ############################################# -# @Author : honghua -# @Contact : honghua@iscas.ac.cn -# @Date : 2025-08-14 -# @License : Mulan PSL v2 -# @Desc : 测试 dbus-send 命令的 --session 参数,验证是否连接到会话总线 -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - # 检查是否已安装dbus-python-devel和dbus-send - LOG_INFO "检查是否已安装dbus-python-devel和dbus-send" - rpm -q dbus-python-devel > /dev/null 2>&1 - if [ $? -ne 0 ]; then - LOG_INFO "dbus-python-devel未安装,准备安装" - dnf list available dbus-python-devel > /dev/null 2>&1 - if [ $? -ne 0 ]; then - LOG_ERROR "yum源中未找到dbus-python-devel软件包" - exit 255 - fi - dnf install -y dbus-python-devel > /dev/null 2>&1 - CHECK_RESULT $? 0 0 "安装dbus-python-devel失败" - INSTALLED_DBUS_PYTHON_DEVEL=1 - else - LOG_INFO "dbus-python-devel已安装" - INSTALLED_DBUS_PYTHON_DEVEL=0 - fi - - rpm -q dbus-send > /dev/null 2>&1 - if [ $? -ne 0 ]; then - LOG_INFO "dbus-send未安装,准备安装" - dnf list available dbus-send > /dev/null 2>&1 - if [ $? -ne 0 ]; then - LOG_ERROR "yum源中未找到dbus-send软件包" - exit 255 - fi - dnf install -y dbus-send > /dev/null 2>&1 - CHECK_RESULT $? 0 0 "安装dbus-send失败" - INSTALLED_DBUS_SEND=1 - else - LOG_INFO "dbus-send已安装" - INSTALLED_DBUS_SEND=0 - fi - - # 测试dbus-send的--session参数 - LOG_INFO "测试dbus-send的--session参数,验证是否连接到会话总线" - DBUS_SEND_OUTPUT=$(dbus-send --session --print-reply --dest=org.freedesktop.DBus /org/freedesktop/DB org.freedesktop.DBus.ListNames 2>&1) - CHECK_RESULT $? 0 0 "执行dbus-send命令失败" - echo "$DBUS_SEND_OUTPUT" | grep -q "array \[" - CHECK_RESULT $? 0 0 "dbus-send未正确连接到会话总线" - - # 清理环境,恢复到之前的状态 - LOG_INFO "清理环境,恢复到之前的状态" - - if [ "$INSTALLED_DBUS_PYTHON_DEVEL" -eq 1 ]; then - LOG_INFO "卸载dbus-python-devel" - dnf remove -y dbus-python-devel > /dev/null 2>&1 - CHECK_RESULT $? 0 0 "卸载dbus-python-devel失败" - fi - - if [ "$INSTALLED_DBUS_SEND" -eq 1 ]; then - LOG_INFO “卸载dbu s- sen d” - dn f remov e - y dbu s- sen d> /de v/ nul l 2>& - CHE CK_ RES UL T $ ? 0 0 “卸載d bu s- sen d失敗” - f i -} - -main "$@" \ No newline at end of file diff --git a/testcases/function_test/pkg_test/dbus-python/dbus-python-devel/test_dbus-python-devel_dbus-send_system.sh b/testcases/function_test/pkg_test/dbus-python/dbus-python-devel/test_dbus-python-devel_dbus-send_system.sh deleted file mode 100644 index a2770f0f08e..00000000000 --- a/testcases/function_test/pkg_test/dbus-python/dbus-python-devel/test_dbus-python-devel_dbus-send_system.sh +++ /dev/null @@ -1,59 +0,0 @@ -#!/usr/bin/bash - -# Copyright (c) 2024 ISCAS .ALL rights reserved. -# This program is licensed under Mulan PSL v2. -# You can use it according to the terms and conditions of the Mulan PSL v2. -# http://license.coscl.org.cn/MulanPSL2 -# THIS PROGRAM IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, -# EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, -# MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. -# See the Mulan PSL v2 for more details. - -# ############################################# -# @Author : honghua -# @Contact : honghua@iscas.ac.cn -# @Date : 2025-08-14 -# @License : Mulan PSL v2 -# @Desc : 测试 dbus-send 命令的 --system 参数,验证是否连接到系统总线 -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - # 检查是否已安装dbus-python-devel和dbus-send - LOG_INFO "检查是否已安装dbus-python-devel和dbus-send" - rpm -q dbus-python-devel > /dev/null 2>&1 - dbus_python_devel_installed=$? - rpm -q dbus-send > /dev/null 2>&1 - dbus_send_installed=$? - - # 如果未安装,则安装软件包 - if [ $dbus_python_devel_installed -ne 0 ] || [ $dbus_send_installed -ne 0 ]; then - LOG_INFO "安装dbus-python-devel和dbus-send" - dnf list available dbus-python-devel > /dev/null 2>&1 - CHECK_RESULT $? 0 255 "yum源中不存在dbus-python-devel软件包" - dnf list available dbus-send > /dev/null 2>&1 - CHECK_RESULT $? 0 255 "yum源中不存在dbus-send软件包" - dnf install -y dbus-python-devel dbus-send - CHECK_RESULT $? 0 0 "安装软件包失败" - fi - - # 检查--system参数是否支持 - LOG_INFO "检查--system参数是否支持" - dbus-send --help | grep -q -- "--system" - CHECK_RESULT $? 0 255 "dbus-send不支持--system参数" - - # 测试连接到系统总线 - LOG_INFO "测试dbus-send --system连接到系统总线" - dbus-send --system --print-reply --dest=org.freedesktop.DBus /org/freedesktop/DBus org.freedesktop.DBus.ListNames - CHECK_RESULT $? 0 0 "无法连接到系统总线" - - # 恢复环境 - if [ $dbus_python_devel_installed -ne 0 ] || [ $dbus_send_installed -ne 0 ]; then - LOG_INFO "卸载dbus-python-devel和dbus-send" - dnf remove -y dbus-python-devel dbus-send - CHECK_RESULT $? 0 0 "卸载软件包失败" - fi -} - -main "$@" \ No newline at end of file diff --git a/testcases/function_test/pkg_test/dbus-python/dbus-python-devel/test_dbus-python-devel_dbus-send_type.sh b/testcases/function_test/pkg_test/dbus-python/dbus-python-devel/test_dbus-python-devel_dbus-send_type.sh deleted file mode 100644 index 94e53c98a93..00000000000 --- a/testcases/function_test/pkg_test/dbus-python/dbus-python-devel/test_dbus-python-devel_dbus-send_type.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-08-14 -# @License : Mulan PSL v2 -# @Desc : 测试 dbus-send 命令的 --type=TYPE 参数,验证是否设置消息类型 -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - - # 检查是否已安装dbus-python-devel和dbus-send - LOG_INFO "检查是否已安装dbus-python-devel和dbus-send" - rpm -q dbus-python-devel > /dev/null 2>&1 - if [ $? -ne 0 ]; then - LOG_INFO "dbus-python-devel未安装,开始安装" - dnf list available dbus-python-devel > /dev/null 2>&1 - if [ $? -ne 0 ]; then - LOG_ERROR "yum源中未找到dbus-python-devel软件包" - exit 255 - fi - dnf install -y dbus-python-devel - CHECK_RESULT $? 0 0 "安装dbus-python-devel失败" - INSTALLED_DBUS_PYTHON_DEVEL=1 - else - LOG_INFO "dbus-python-devel已安装" - INSTALLED_DBUS_PYTHON_DEVEL=0 - fi - - # 检查dbus-send命令是否支持--type参数 - LOG_INFO "检查dbus-send命令是否支持--type参数" - dbus-send --help | grep -q -- "--type" - if [ $? -ne 0 ]; then - LOG_ERROR "dbus-send命令不支持--type参数" - exit 255 - fi - - # 测试--type参数设置消息类型功能 - LOG_INFO "测试--type参数设置消息类型功能" - dbus-send --session --dest=org.freedesktop.DBus --type=signal / org.freedesktop.DBus.Peer.Ping > /dev/null 2>&1 - CHECK_RESULT $? 0 0 "设置消息类型失败" - - # 清理环境,恢复到之前的状态 - if [ ${INSTALLED_DBUS_PYTHON_DEVEL} -eq 1 ]; then - LOG_INFO "卸载dbus-python-devel" - dnf remove -y dbus-python-devel > /dev/null 2>&1 - CHECK_RESULT $? 0 0 "卸载dbus-python-devel失败" - - -} - -main "$@" \ No newline at end of file diff --git a/testcases/function_test/pkg_test/dbus-python/dbus-python-devel/test_dbus-python-devel_dbus-test-tool_black-hole.sh b/testcases/function_test/pkg_test/dbus-python/dbus-python-devel/test_dbus-python-devel_dbus-test-tool_black-hole.sh deleted file mode 100644 index efea43072cf..00000000000 --- a/testcases/function_test/pkg_test/dbus-python/dbus-python-devel/test_dbus-python-devel_dbus-test-tool_black-hole.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-08-14 -# @License : Mulan PSL v2 -# @Desc : 测试 dbus-test-tool 的 black-hole 子命令功能 -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - # 检查是否已安装dbus-python-devel和dbus-test-tool - LOG_INFO "检查是否已安装dbus-python-devel和dbus-test-tool" - rpm -q dbus-python-devel dbus-test-tool > /dev/null 2>&1 - if [ $? -eq 0 ]; then - LOG_INFO "dbus-python-devel和dbus-test-tool已安装" - INSTALLED=1 - else - LOG_INFO "dbus-python-devel和dbus-test-tool未安装" - INSTALLED=0 - fi - - # 检查yum源中是否有dbus-python-devel和dbus-test-tool - LOG_INFO "检查yum源中是否有dbus-python-devel和dbus-test-tool" - dnf list available dbus-python-devel dbus-test-tool > /dev/null 2>&1 - if [ $? -ne 0 ]; then - LOG_ERROR "yum源中缺少dbus-python-devel或dbus-test-tool" - exit 255 - fi - - # 如果未安装,则安装软件包 - if [ $INSTALLED -eq 0 ]; then - LOG_INFO "安装dbus-python-devel和dbus-test-tool" - dnf install -y dbus-python-devel dbus-test-tool - CHECK_RESULT $? 0 0 "安装dbus-python-devel和dbus-test-tool失败" - fi - - # 测试dbus-test-tool的black-hole子命令功能 - LOG_INFO "测试dbus-test-tool的black-hole子命令功能" - dbus-test-tool black-hole --help > /dev/null 2>&1 - if [ $? -ne 0 ]; then - LOG_ERROR "dbus-test-tool不支持black-hole子命令" - exit 255 - fi - - # 执行black-hole子命令测试 - LOG_INFO "执行black-hole子命令测试" - DBUS_SESSION_BUS_ADDRESS=unix:path=/run/user/$(id -u)/bus dbus-test-tool black-hole > /dev/null 2>&1 - CHECK_RESULT $? 0 0 "执行black-hole子命令失败" - - # 清理环境,如果之前未安装则卸载软件包 - if [ $INSTALLED -eq 0 ]; then - LOG_INFO "卸载dbus-python-devel和dbus-test-tool" - dnf remove -y db -} - -main "$@" \ No newline at end of file diff --git a/testcases/function_test/pkg_test/dbus-python/dbus-python-devel/test_dbus-python-devel_dbus-test-tool_echo.sh b/testcases/function_test/pkg_test/dbus-python/dbus-python-devel/test_dbus-python-devel_dbus-test-tool_echo.sh deleted file mode 100644 index f467fb6c571..00000000000 --- a/testcases/function_test/pkg_test/dbus-python/dbus-python-devel/test_dbus-python-devel_dbus-test-tool_echo.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-08-14 -# @License : Mulan PSL v2 -# @Desc : 测试 dbus-test-tool 的 echo 子命令功能 -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - - # 检查是否已安装dbus-python-devel和dbus-test-tool - LOG_INFO "检查是否已安装dbus-python-devel和dbus-test-tool" - if ! dnf list installed dbus-python-devel &>/dev/null || ! dnf list installed dbus-test-tool &>/dev/null; then - LOG_INFO "未安装dbus-python-devel或dbus-test-tool,将进行安装" - # 检查yum源中是否有dbus-python-devel和dbus-test-tool - if ! dnf list available dbus-python-devel &>/dev/null || ! dnf list available dbus-test-tool &>/dev/null; then - LOG_ERROR "yum源中缺少dbus-python-devel或dbus-test-tool软件包" - exit 255 - fi - # 安装软件包 - dnf install -y dbus-python-devel dbus-test-tool - CHECK_RESULT $? 0 0 "安装dbus-python-devel和dbus-test-tool失败" - # 标记需要卸载 - NEED_UNINSTALL=1 - else - LOG_INFO "已安装dbus-python-devel和dbus-test-tool,无需安装" - NEED_UNINSTALL=0 - fi - - # 测试echo子命令功能 - LOG_INFO "测试dbus-test-tool的echo子命令功能" - if ! dbus-test-tool echo --help &>/dev/null; then - LOG_ERROR "echo子命令参数不支持或不存在" - exit 255 - fi - - # 执行echo子命令 - LOG_INFO "执行echo子命令测试" - output=$(dbus-test-tool echo "test_message") - CHECK_RESULT $? 0 0 "执行echo子命令失败" - expected_output="test_message" - CHECK_RESULT "$output" "$expected_output" 0 "echo子命令输出不符合预期" - - # 清理环境(如果之前未安装) - if [ "$NEED_UNINSTALL" -eq 1 ]; then - LOG_INFO "卸载dbus-python-devel和dbus-test-tool" - dnf remove -y dbus-python-devel dbus-test-tool - CHECK_RESULT $? 0 0 "卸载dbus-python-devel和dbus-test-tool失败" - fi - - LOG_INFO "测试脚本执行完毕,环境已恢复" - -} - -main "$@" \ No newline at end of file diff --git a/testcases/function_test/pkg_test/dbus-python/dbus-python-devel/test_dbus-python-devel_dbus-test-tool_spam.sh b/testcases/function_test/pkg_test/dbus-python/dbus-python-devel/test_dbus-python-devel_dbus-test-tool_spam.sh deleted file mode 100644 index 5219f71b5e9..00000000000 --- a/testcases/function_test/pkg_test/dbus-python/dbus-python-devel/test_dbus-python-devel_dbus-test-tool_spam.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-08-14 -# @License : Mulan PSL v2 -# @Desc : 测试 dbus-test-tool 的 spam 子命令功能 -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - # 检查是否已安装dbus-python-devel和dbus-test-tool - LOG_INFO "检查是否已安装dbus-python-devel和dbus-test-tool" - rpm -q dbus-python-devel dbus-test-tool > /dev/null 2>&1 - if [ $? -eq 0 ]; then - LOG_INFO "dbus-python-devel和dbus-test-tool已安装" - INSTALLED=1 - else - LOG_INFO "dbus-python-devel和dbus-test-tool未安装" - INSTALLED=0 - fi - - # 检查yum源中是否有dbus-python-devel和dbus-test-tool - LOG_INFO "检查yum源中是否有dbus-python-devel和dbus-test-tool" - dnf list available dbus-python-devel dbus-test-tool > /dev/null 2>&1 - if [ $? -ne 0 ]; then - LOG_ERROR "yum源中未找到dbus-python-devel或dbus-test-tool" - exit 255 - fi - - # 如果未安装,则安装软件包 - if [ $INSTALLED -eq 0 ]; then - LOG_INFO "安装dbus-python-devel和dbus-test-tool" - dnf install -y dbus-python-devel dbus-test-tool > /dev/null 2>&1 - CHECK_RESULT $? 0 0 "安装失败" - fi - - # 检查spam子命令是否支持 - LOG_INFO "检查dbus-test-tool的spam子命令是否支持" - dbus-test-tool spam --help > /dev/null 2>&1 - if [ $? -ne 0 ]; then - LOG_ERROR "dbus-test-tool不支持spam子命令" - exit 255 - fi - - # 测试spam子命令功能 - LOG_INFO "测试spam子命令功能" - output=$(dbus-test-tool spam 2>&1) - CHECK_RESULT $? 0 0 "执行失败" - - # 检查输出结果是否符合预期(假设预期输出包含"spamming") - echo "$output" | grep -q "spamming" - CHECK_RESULT $? 0 0 "输出不符合预期" - - # 如果脚本开始时未安装软件包,则在结束时卸载软件包 - if [ $INSTALLED -eq 0 ]; then - LOG_INFO "卸载dbus-python-devel和dbus-test-tool" - dnf remove -y dbus-python-devel dbus-test-tool > /dev/null 2>&1 - CHECK_RESULT $? 0 0 "卸载失败" - fi -} - -main "$@" \ No newline at end of file diff --git a/testcases/function_test/pkg_test/dbus-python/dbus-python-devel/test_dbus-python-devel_function_basic_import.sh b/testcases/function_test/pkg_test/dbus-python/dbus-python-devel/test_dbus-python-devel_function_basic_import.sh deleted file mode 100644 index 0c3baebc8c8..00000000000 --- a/testcases/function_test/pkg_test/dbus-python/dbus-python-devel/test_dbus-python-devel_function_basic_import.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-01-28 -# @License : Mulan PSL v2 -# @Desc : 测试Python模块导入功能 -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - LOG_INFO "测试Python模块导入功能开始" - LOG_INFO "步骤1: 检查环境是否已经安装dbus-python-devel软件包" - if dnf list installed | grep -q "dbus-python-devel"; then - LOG_INFO "环境已安装dbus-python-devel软件包,脚本将保持安装状态" - already_installed=1 - else - LOG_INFO "环境未安装dbus-python-devel软件包" - already_installed=0 - fi - - LOG_INFO "步骤2: 检查yum源中是否存在dbus-python-devel软件包" - if ! dnf search dbus-python-devel 2>/dev/null | grep -q "dbus-python-devel"; then - LOG_ERROR "yum源中未找到dbus-python-devel软件包" - exit 255 - fi - - LOG_INFO "步骤3: 如果环境未安装dbus-python-devel软件包,则开始安装" - if [ $already_installed -eq 0 ]; then - dnf install -y dbus-python-devel - CHECK_RESULT $? 0 0 "安装dbus-python-devel软件包失败" - else - LOG_INFO "已安装,跳过安装步骤" - fi - - LOG_INFO "步骤4: 验证安装是否成功" - if dnf list installed | grep -q "dbus-python-devel"; then - LOG_INFO "dbus-python-devel软件包安装验证成功" - else - LOG_ERROR "dbus-python-devel软件包安装验证失败" - exit 1 - fi - - LOG_INFO "步骤5: 测试Python模块导入功能" - LOG_INFO "步骤5.1: 检查python命令是否支持-c参数" - if ! python -c "print("Hello")" &>/dev/null; then - LOG_ERROR "python命令不支持-c参数" - exit 255 - fi - - LOG_INFO "步骤5.2: 导入dbus模块" - python -c "import dbus" - CHECK_RESULT $? 0 0 "导入dbus模块失败" - - LOG_INFO "步骤5.3: 导入dbus.glib模块" - python -c "import dbus.glib" - CHECK_RESULT $? 0 0 "导入dbus.glib模块失败" - - LOG_INFO "步骤6: 清理环境" - if [ $already_installed -eq 0 ]; then - LOG_INFO "卸载dbus-python-devel软件包" - dnf remove -y dbus-python-devel - CHECK_RESULT $? 0 0 "卸载dbus-python-devel软件包失败" - LOG_INFO "dbus-python-devel软件包已卸载" - else - LOG_INFO "环境已安装dbus-python-devel,保持安装状态" - fi - - LOG_INFO "测试Python模块导入功能结束" -} - -main "$@" \ No newline at end of file diff --git a/testcases/function_test/pkg_test/dbus-python/dbus-python-devel/test_dbus-python-devel_function_basic_usage.sh b/testcases/function_test/pkg_test/dbus-python/dbus-python-devel/test_dbus-python-devel_function_basic_usage.sh deleted file mode 100644 index 0303724df56..00000000000 --- a/testcases/function_test/pkg_test/dbus-python/dbus-python-devel/test_dbus-python-devel_function_basic_usage.sh +++ /dev/null @@ -1,88 +0,0 @@ -#!/usr/bin/bash - -# Copyright (c) 2024 ISCAS .ALL rights reserved. -# This program is licensed under Mulan PSL v2. -# You can use it according to the terms and conditions of the Mulan PSL v2. -# http://license.coscl.org.cn/MulanPSL2 -# THIS PROGRAM IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, -# EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, -# MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. -# See the Mulan PSL v2 for more details. - -# ############################################# -# @Author : honghua -# @Contact : honghua@iscas.ac.cn -# @Date : 2026-02-21 -# @License : Mulan PSL v2 -# @Desc : 测试基础DBus通信功能 -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - LOG_INFO "开始测试基础DBus通信功能" - LOG_INFO "步骤1:检查环境是否已安装dbus-python-devel软件包" - rpm -q dbus-python-devel > /dev/null 2>&1 - if [ $? -eq 0 ]; then - LOG_INFO "dbus-python-devel已安装,测试结束后将保持安装状态" - INSTALLED="yes" - else - LOG_INFO "dbus-python-devel未安装,将在测试步骤中安装,并在测试结束后卸载" - INSTALLED="no" - fi - - LOG_INFO "步骤2:检查yum源中是否存在dbus-python-devel软件包" - dnf list available dbus-python-devel > /dev/null 2>&1 - CHECK_RESULT $? 0 0 "yum源中未找到dbus-python-devel软件包" - if [ $? -ne 0 ]; then - LOG_ERROR "yum源中未找到dbus-python-devel软件包" - exit 255 - fi - - if [ "$INSTALLED" = "no" ]; then - LOG_INFO "步骤3:安装dbus-python-devel软件包" - dnf install -y dbus-python-devel > /dev/null 2>&1 - CHECK_RESULT $? 0 0 "安装dbus-python-devel失败" - fi - - LOG_INFO "步骤4:验证dbus-python-devel基础功能" - python3 -c "import dbus; print("DBus模块导入成功")" > /dev/null 2>&1 - CHECK_RESULT $? 0 0 "DBus模块导入失败" - - LOG_INFO "步骤5:测试DBus系统总线连接" - python3 -c " - import dbus - try: - bus = dbus.SystemBus() - print("系统总线连接成功") - except Exception as e: - print("系统总线连接失败:", e) - exit(1) - " > /dev/null 2>&1 - CHECK_RESULT $? 0 0 "DBus系统总线连接失败" - - LOG_INFO "步骤6:测试DBus会话总线连接" - python3 -c " - import dbus - try: - bus = dbus.SessionBus() - print("会话总线连接成功") - except Exception as e: - print("会话总线连接失败:", e) - exit(1) - " > /dev/null 2>&1 - CHECK_RESULT $? 0 0 "DBus会话总线连接失败" - - LOG_INFO "步骤7:清理测试环境" - if [ "$INSTALLED" = "no" ]; then - LOG_INFO "卸载dbus-python-devel软件包" - dnf remove -y dbus-python-devel > /dev/null 2>&1 - CHECK_RESULT $? 0 0 "卸载dbus-python-devel失败" - else - LOG_INFO "保持dbus-python-devel安装状态" - fi - - LOG_INFO "基础DBus通信功能测试完成" -} - -main "$@" \ No newline at end of file diff --git a/testcases/function_test/pkg_test/dbus-python/dbus-python-devel/test_dbus-python-devel_function_import.sh b/testcases/function_test/pkg_test/dbus-python/dbus-python-devel/test_dbus-python-devel_function_import.sh deleted file mode 100644 index 6d25b4668b1..00000000000 --- a/testcases/function_test/pkg_test/dbus-python/dbus-python-devel/test_dbus-python-devel_function_import.sh +++ /dev/null @@ -1,70 +0,0 @@ -#!/usr/bin/bash - -# Copyright (c) 2024 ISCAS .ALL rights reserved. -# This program is licensed under Mulan PSL v2. -# You can use it according to the terms and conditions of the Mulan PSL v2. -# http://license.coscl.org.cn/MulanPSL2 -# THIS PROGRAM IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, -# EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, -# MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. -# See the Mulan PSL v2 for more details. - -# ############################################# -# @Author : honghua -# @Contact : honghua@iscas.ac.cn -# @Date : 2026-02-21 -# @License : Mulan PSL v2 -# @Desc : 测试Python模块导入功能 -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - # 判断是否已安装dbus-python-devel - LOG_INFO "检查dbus-python-devel是否已安装" - rpm -q dbus-python-devel > /dev/null 2>&1 - if [ $? -eq 0 ]; then - LOG_INFO "dbus-python-devel已安装" - INSTALLED=1 - else - LOG_INFO "dbus-python-devel未安装" - INSTALLED=0 - fi - - # 检查yum源中是否有dbus-python-devel软件包 - LOG_INFO "检查yum源中是否有dbus-python-devel软件包" - dnf list available dbus-python-devel > /dev/null 2>&1 - if [ $? -ne 0 ]; then - LOG_ERROR "yum源中没有dbus-python-devel软件包" - exit 255 - fi - - # 如果未安装则安装 - if [ $INSTALLED -eq 0 ]; then - LOG_INFO "安装dbus-python-devel软件包" - dnf install -y dbus-python-devel > /dev/null 2>&1 - CHECK_RESULT $? 0 0 "安装dbus-python-devel失败" - fi - - # 测试Python模块导入功能 - LOG_INFO "测试Python模块导入功能" - python3 -c "import dbus" > /dev/null 2>&1 - CHECK_RESULT $? 0 0 "导入dbus模块失败" - - python3 -c "import dbus.service" > /dev/null 2>&1 - CHECK_RESULT $? 0 0 "导入dbus.service模块失败" - - python3 -c "import dbus.mainloop.glib" > /dev/null 2>&1 - CHECK_RESULT $? 0 0 "导入dbus.mainloop.glib模块失败" - - # 环境恢复:如果之前未安装,则卸载软件包 - if [ $INSTALLED -eq 0 ]; then - LOG_INFO "卸载dbus-python-devel软件包" - dnf remove -y dbus-python-devel > /dev/null 2>&1 - CHECK_RESULT $? 0 0 "卸载dbus-python-devel失败" - fi - - LOG_INFO "测试完成" -} - -main "$@" \ No newline at end of file diff --git a/testcases/function_test/pkg_test/dbus-python/dbus-python-devel/test_dbus-python-devel_function_install.sh b/testcases/function_test/pkg_test/dbus-python/dbus-python-devel/test_dbus-python-devel_function_install.sh deleted file mode 100644 index 5510b98935c..00000000000 --- a/testcases/function_test/pkg_test/dbus-python/dbus-python-devel/test_dbus-python-devel_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 : 2025-08-14 -# @License : Mulan PSL v2 -# @Desc : 测试软件包安装功能 -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - - # 检查dbus-python-devel软件包是否已安装 - LOG_INFO "检查dbus-python-devel软件包是否已安装" - rpm -q dbus-python-devel > /dev/null 2>&1 - if [ $? -eq 0 ]; then - LOG_INFO "dbus-python-devel软件包已安装,脚本结束后保持安装状态" - installed=true - else - LOG_INFO "dbus-python-devel软件包未安装,将在测试完成后卸载" - installed=false - fi - - # 检查yum源中是否存在dbus-python-devel软件包 - LOG_INFO "检查yum源中是否存在dbus-python-devel软件包" - dnf list available dbus-python-devel > /dev/null 2>&1 - if [ $? -ne 0 ]; then - LOG_ERROR "yum源中未找到dbus-python-devel软件包" - exit 255 - fi - - # 安装dbus-python-devel软件包 - LOG_INFO "开始安装dbus-python-devel软件包" - dnf install -y dbus-python-devel - CHECK_RESULT $? 0 0 "安装dbus-python-devel软件包失败" - - # 验证软件包是否成功安装 - LOG_INFO "验证dbus-python-devel软件包是否成功安装" - rpm -q dbus-python-devel > /dev/null 2>&1 - CHECK_RESULT $? 0 0 "dbus-python-devel软件包未正确安装" - - # 执行测试命令(示例命令,可根据实际需求调整) - LOG_INFO "执行测试命令" - python3 -c "import dbus; print(dbus.__version__)" > /dev/null 2>&1 - CHECK_RESULT $? 0 0 "测试命令执行失败" - - # 清理环境 - if [ "$installed" = false ]; then - LOG_INFO "卸载dbus-python-devel软件包" - dnf remove -y dbus-python-devel - CHECK_RESULT $? 0 0 "卸载dbus-python-devel软件包失败" - fi - - LOG_INFO "测试完成,环境已恢复" - -} - -main "$@" \ No newline at end of file diff --git a/testcases/function_test/pkg_test/dbus-python/dbus-python-devel/test_dbus-python-devel_function_integration.sh b/testcases/function_test/pkg_test/dbus-python/dbus-python-devel/test_dbus-python-devel_function_integration.sh deleted file mode 100644 index 3819c3c978b..00000000000 --- a/testcases/function_test/pkg_test/dbus-python/dbus-python-devel/test_dbus-python-devel_function_integration.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 : 2025-08-14 -# @License : Mulan PSL v2 -# @Desc : 测试综合功能集成 -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - # 测试综合功能集成 - - LOG_INFO "开始测试综合功能集成" - - # 检查是否已安装dbus-python-devel - LOG_INFO "检查dbus-python-devel是否已安装" - rpm -q dbus-python-devel > /dev/null 2>&1 - if [ $? -eq 0 ]; then - LOG_INFO "dbus-python-devel已安装" - installed=true - else - LOG_INFO "dbus-python-devel未安装" - installed=false - fi - - # 检查yum源中是否有dbus-python-devel包 - LOG_INFO "检查yum源中是否有dbus-python-devel包" - dnf list available dbus-python-devel > /dev/null 2>&1 - CHECK_RESULT $? 0 0 "yum源中没有dbus-python-devel包" - if [ $? -ne 0 ]; then - LOG_ERROR "yum源中没有dbus-python-devel包,退出" - exit 255 - fi - - # 如果未安装,则安装dbus-python-devel - if [ "$installed" = false ]; then - LOG_INFO "安装dbus-python-devel" - dnf install -y dbus-python-devel - CHECK_RESULT $? 0 0 "安装dbus-python-devel失败" - fi - - # 测试命令参数是否存在 - LOG_INFO "测试命令参数是否存在" - dbus-send --help > /dev/null 2>&1 - CHECK_RESULT $? 0 0 "命令参数不支持或不存在" - if [ $? -ne 0 ]; then - LOG_ERROR "命令参数不支持或不存在,退出" - exit 255 - fi - - # 执行测试命令 - LOG_INFO "执行测试命令" - dbus-send --session --dest=org.freedesktop.DBus --type=method_call --print-reply /org/freedesktop/DBus org.freedesktop.DBus.ListNames > /dev/null 2>&1 - CHECK_RESULT $? 0 0 "执行测试命令失败" - - # SSH_CMD示例(假设需要在第二个节点执行) - LOG_INFO "在第二个节点上执行命令示例(假设)" - SSH_CMD ls $NODE2_IPV4 $NODE2_PASSWORD $NODE2_USER > /dev/null 2>&1 - - # 环境恢复:如果脚本开始时未安装,则卸载dbus-python-devel - if [ "$installed" = false ]; then - LOG_INFO "卸载dbus-python-devel以恢复环境" - dnf remove -y dbus-python-devel - CHECK_RESULT $? 0 0 "卸载dbus-python-devel失败" - fi - - LOG_INFO "测试综合功能集成完成" -} - -main "$@" \ No newline at end of file diff --git a/testcases/function_test/pkg_test/dbus-python/dbus-python-devel/test_dbus-python-devel_function_method_call.sh b/testcases/function_test/pkg_test/dbus-python/dbus-python-devel/test_dbus-python-devel_function_method_call.sh deleted file mode 100644 index 5262fc723f2..00000000000 --- a/testcases/function_test/pkg_test/dbus-python/dbus-python-devel/test_dbus-python-devel_function_method_call.sh +++ /dev/null @@ -1,78 +0,0 @@ -#!/usr/bin/bash - -# Copyright (c) 2024 ISCAS .ALL rights reserved. -# This program is licensed under Mulan PSL v2. -# You can use it according to the terms and conditions of the Mulan PSL v2. -# http://license.coscl.org.cn/MulanPSL2 -# THIS PROGRAM IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, -# EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, -# MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. -# See the Mulan PSL v2 for more details. - -# ############################################# -# @Author : honghua -# @Contact : honghua@iscas.ac.cn -# @Date : 2026-02-21 -# @License : Mulan PSL v2 -# @Desc : 测试DBus方法调用 -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - LOG_INFO "开始测试DBus方法调用功能" - LOG_INFO "步骤1: 检查DBus-python-devel软件包是否在yum源中可用" - if ! dnf list available dbus-python-devel &>/dev/null; then - LOG_ERROR "yum源中未找到dbus-python-devel软件包" - exit 255 - fi - - LOG_INFO "步骤2: 检查是否已安装dbus-python-devel" - if rpm -q dbus-python-devel &>/dev/null; then - LOG_INFO "dbus-python-devel已安装,将保持安装状态" - already_installed=1 - else - LOG_INFO "dbus-python-devel未安装,将进行安装" - already_installed=0 - LOG_INFO "步骤3: 安装dbus-python-devel软件包" - dnf install -y dbus-python-devel - CHECK_RESULT $? 0 0 "安装dbus-python-devel失败" - fi - - LOG_INFO "步骤4: 验证dbus-python-devel安装成功" - python3 -c "import dbus" - CHECK_RESULT $? 0 0 "无法导入dbus模块" - - LOG_INFO "步骤5: 创建测试DBus方法调用的Python脚本" - cat > /tmp/test_dbus_method.py << "EOF" - import dbus - try: - bus = dbus.SystemBus() - proxy = bus.get_object("org.freedesktop.DBus", "/org/freedesktop/DBus") - iface = dbus.Interface(proxy, "org.freedesktop.DBus") - result = iface.ListNames() - print("DBus方法调用成功,返回结果类型:", type(result)) - except Exception as e: - print(f"DBus方法调用失败: {e}") - exit(1) - EOF - - LOG_INFO "步骤6: 执行DBus方法调用测试" - python3 /tmp/test_dbus_method.py - CHECK_RESULT $? 0 0 "DBus方法调用测试失败" - - LOG_INFO "步骤7: 清理临时文件" - rm -f /tmp/test_dbus_method.py - - if [ $already_installed -eq 0 ]; then - LOG_INFO "步骤8: 卸载测试安装的dbus-python-devel软件包" - dnf remove -y dbus-python-devel - CHECK_RESULT $? 0 0 "卸载dbus-python-devel失败" - else - LOG_INFO "步骤8: 保持dbus-python-devel安装状态,无需卸载" - fi - - LOG_INFO "DBus方法调用测试完成" -} - -main "$@" \ No newline at end of file diff --git a/testcases/function_test/pkg_test/dbus-python/dbus-python-devel/test_dbus-python-devel_function_signal_receive.sh b/testcases/function_test/pkg_test/dbus-python/dbus-python-devel/test_dbus-python-devel_function_signal_receive.sh deleted file mode 100644 index 32a5184f934..00000000000 --- a/testcases/function_test/pkg_test/dbus-python/dbus-python-devel/test_dbus-python-devel_function_signal_receive.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-02-21 -# @License : Mulan PSL v2 -# @Desc : 测试DBus信号接收 -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - LOG_INFO "开始测试DBus信号接收功能" - - # 检查软件包是否存在 - LOG_INFO "检查yum源中是否存在dbus-python-devel软件包" - if ! dnf list available dbus-python-devel &>/dev/null; then - LOG_ERROR "yum源中不存在dbus-python-devel软件包" - exit 255 - fi - - # 检查当前环境是否已安装软件包 - LOG_INFO "检查当前环境是否已安装dbus-python-devel" - if rpm -q dbus-python-devel &>/dev/null; then - LOG_INFO "dbus-python-devel已安装,测试结束后将保持安装状态" - ALREADY_INSTALLED=1 - else - LOG_INFO "dbus-python-devel未安装,将在测试过程中安装" - ALREADY_INSTALLED=0 - fi - - # 安装软件包(如果未安装) - if [ $ALREADY_INSTALLED -eq 0 ]; then - LOG_INFO "安装dbus-python-devel软件包" - dnf install -y dbus-python-devel - CHECK_RESULT $? 0 0 "安装dbus-python-devel失败" - fi - - # 检查命令参数支持 - LOG_INFO "检查dbus-send命令是否支持--type参数" - if ! dbus-send --help 2>&1 | grep -q "\-\-type"; then - LOG_ERROR "dbus-send命令不支持--type参数" - exit 255 - fi - - # 测试DBus信号接收 - LOG_INFO "启动测试DBus信号接收" - # 这里需要根据实际测试场景编写具体的DBus信号接收测试代码 - # 示例:创建一个简单的DBus信号发送和接收测试 - cat > test_dbus_signal.py << "EOF" - #!/usr/bin/env python3 - import dbus - import dbus.service - import dbus.mainloop.glib - from gi.repository import GLib - - class TestObject(dbus.service.Object): - def __init__(self, bus_name, object_path): - dbus.service.Object.__init__(self, bus_name, object_path) - - @dbus.service.signal(dbus_interface="com.example.Test", signature="s") - def TestSignal(self, message): - print(f"Signal emitted: {message}") - - def signal_handler(message): - print(f"Signal received: {message}") - GLib.MainLoop().quit() - - if __name__ == "__main__": - dbus.mainloop.glib.DBusGMainLoop(set_as_default=True) - bus = dbus.SessionBus() - - # 创建测试对象 - test_obj = TestObject(bus, "/com/example/Test") - - # 添加信号接收器 - bus.add_signal_receiver(signal_handler, - dbus_interface="com.example.Test", - signal_name="TestSignal") - - # 发送测试信号 - test_obj.TestSignal("Hello DBus Signal") - - # 运行主循环等待信号 - loop = GLib.MainLoop() - loop.run() - EOF - - LOG_INFO "执行DBus信号接收测试" - python3 test_dbus_signal.py - CHECK_RESULT $? 0 0 "DBus信号接收测试失败" - - # 清理测试文件 - LOG_INFO "清理测试文件" - rm -f test_dbus_signal.py - - # 卸载软件包(如果测试前未安装) - if [ $ALREADY_INSTALLED -eq 0 ]; then - LOG_INFO "卸载dbus-python-devel软件包" - dnf remove -y dbus-python-devel - CHECK_RESULT $? 0 0 "卸载dbus-python-devel失败" - else - LOG_INFO "保持dbus-python-devel软件包安装状态" - fi - - LOG_INFO "DBus信号接收测试完成" -} - -main "$@" \ No newline at end of file diff --git a/testcases/function_test/pkg_test/dbus-python/dbus-python-devel/test_dbus-python-devel_function_uninstall.sh b/testcases/function_test/pkg_test/dbus-python/dbus-python-devel/test_dbus-python-devel_function_uninstall.sh deleted file mode 100644 index 247a3f11ca5..00000000000 --- a/testcases/function_test/pkg_test/dbus-python/dbus-python-devel/test_dbus-python-devel_function_uninstall.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-08-14 -# @License : Mulan PSL v2 -# @Desc : 测试软件包卸载功能 -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - - # 检查yum源中是否存在dbus-python-devel软件包 - LOG_INFO "检查yum源中是否存在dbus-python-devel软件包" - dnf list available dbus-python-devel > /dev/null 2>&1 - if [ $? -ne 0 ]; then - LOG_ERROR "yum源中不存在dbus-python-devel软件包" - exit 255 - fi - - # 检查当前环境是否已安装dbus-python-devel - LOG_INFO "检查当前环境是否已安装dbus-python-devel" - rpm -q dbus-python-devel > /dev/null 2>&1 - if [ $? -eq 0 ]; then - installed=true - LOG_INFO "dbus-python-devel已安装" - else - installed=false - LOG_INFO "dbus-python-devel未安装" - fi - - # 如果未安装,则安装dbus-python-devel - if [ "$installed" = false ]; then - LOG_INFO "开始安装dbus-python-devel" - dnf install -y dbus-python-devel > /dev/null 2>&1 - CHECK_RESULT $? 0 0 "安装dbus-python-devel失败" - fi - - # 测试卸载功能 - LOG_INFO "测试卸载功能" - dnf remove -y dbus-python-devel > /dev/null 2>&1 - CHECK_RESULT $? 0 0 "卸载dbus-python-devel失败" - - # 如果最初未安装,则重新安装以恢复环境;否则无需操作(保持原状态) - if [ "$installed" = false ]; then - LOG_INFO "恢复环境:重新安装dbus-python-devel" - dnf install -y dbus-python-devel > /dev/null 2>&1 - CHECK_RESULT $? 0 0 "恢复环境失败" - else - LOG_INFO "无需恢复环境,dbus-python-devel已保持原安装状态" - fi - - LOG_INFO "测试脚本执行完毕" - -} - -main "$@" \ No newline at end of file diff --git a/testcases/function_test/pkg_test/dbus-python/dbus-python-devel/test_dbus-python-devel_function_version.sh b/testcases/function_test/pkg_test/dbus-python/dbus-python-devel/test_dbus-python-devel_function_version.sh deleted file mode 100644 index b3cf098ef8c..00000000000 --- a/testcases/function_test/pkg_test/dbus-python/dbus-python-devel/test_dbus-python-devel_function_version.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-01-28 -# @License : Mulan PSL v2 -# @Desc : 测试软件包版本信息 -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - # 定义日志函数 - LOG_INFO() { - echo "[INFO] $1" - } - - LOG_ERROR() { - echo "[ERROR] $1" - } - - # 定义常量 - PACKAGE_NAME="dbus-python-devel" - TEST_COMMAND="python3 -c \"import dbus; print(dbus.__version__)\"" - - # 步骤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:检查当前是否已安装软件包" - if rpm -q "$PACKAGE_NAME" &>/dev/null; then - LOG_INFO "软件包 $PACKAGE_NAME 已安装" - INSTALLED_BEFORE=true - else - LOG_INFO "软件包 $PACKAGE_NAME 未安装" - INSTALLED_BEFORE=false - fi - - # 步骤3:如果未安装,则安装软件包 - if [ "$INSTALLED_BEFORE" = false ]; then - LOG_INFO "步骤3:安装软件包 $PACKAGE_NAME" - dnf install -y "$PACKAGE_NAME" - CHECK_RESULT $? 0 0 "安装软件包失败" - fi - - # 步骤4:测试软件包版本信息 - LOG_INFO "步骤4:测试软件包版本信息" - eval "$TEST_COMMAND" &>/dev/null - CHECK_RESULT $? 0 0 "获取软件包版本信息失败" - - # 步骤5:获取并打印版本信息 - LOG_INFO "步骤5:获取并打印版本信息" - VERSION=$(eval "$TEST_COMMAND" 2>/dev/null) - if [ -n "$VERSION" ]; then - LOG_INFO "dbus-python-devel 版本: $VERSION" - else - LOG_ERROR "无法获取版本信息" - CHECK_RESULT 1 0 0 "版本信息为空" - fi - - # 步骤6:清理环境,恢复到之前的状态 - LOG_INFO "步骤6:清理环境,恢复到之前的状态" - if [ "$INSTALLED_BEFORE" = false ]; then - LOG_INFO "卸载软件包 $PACKAGE_NAME" - dnf remove -y "$PACKAGE_NAME" - CHECK_RESULT $? 0 0 "卸载软件包失败" - else - LOG_INFO "保持软件包 $PACKAGE_NAME 的安装状态" - fi - - LOG_INFO "测试脚本执行完成" -} - -main "$@" \ No newline at end of file From 6fee0f8b8478365684db3d034e0a2748fdccb0e3 Mon Sep 17 00:00:00 2001 From: honghua Date: Fri, 17 Apr 2026 12:27:16 +0800 Subject: [PATCH 07/16] update testcase for testsuite texlive-titlepic --- .../texlive-split-x/texlive-titlepic.json | 12 -- ...xlive-titlepic_function_includegraphics.sh | 96 ------------- .../test_texlive-titlepic_function_title.sh | 66 --------- .../test_texlive-titlepic_function_usage.sh | 131 ------------------ 4 files changed, 305 deletions(-) delete mode 100644 testcases/function_test/pkg_test/texlive-split-x/texlive-titlepic/test_texlive-titlepic_function_includegraphics.sh delete mode 100644 testcases/function_test/pkg_test/texlive-split-x/texlive-titlepic/test_texlive-titlepic_function_title.sh delete mode 100644 testcases/function_test/pkg_test/texlive-split-x/texlive-titlepic/test_texlive-titlepic_function_usage.sh diff --git a/suite2cases/function_test/pkg_test/texlive-split-x/texlive-titlepic.json b/suite2cases/function_test/pkg_test/texlive-split-x/texlive-titlepic.json index 8deb6505f51..363adf98e1a 100644 --- a/suite2cases/function_test/pkg_test/texlive-split-x/texlive-titlepic.json +++ b/suite2cases/function_test/pkg_test/texlive-split-x/texlive-titlepic.json @@ -2,10 +2,6 @@ "path": "$OET_PATH/testcases/function_test/pkg_test/texlive-split-x/texlive-titlepic", "machine num": 1, "cases": [ - { - "name": "test_texlive-titlepic_function_title", - "desc": "Test title generation functionality" - }, { "name": "test_texlive-titlepic_function_install", "desc": "Test installation of the texlive-titlepic package" @@ -13,14 +9,6 @@ { "name": "test_texlive-titlepic_function_uninstall", "desc": "Test removal of the texlive-titlepic package" - }, - { - "name": "test_texlive-titlepic_function_usage", - "desc": "Test basic usage of the titlepic package in a LaTeX document" - }, - { - "name": "test_texlive-titlepic_function_includegraphics", - "desc": "Test including an image in document title" } ] } \ No newline at end of file diff --git a/testcases/function_test/pkg_test/texlive-split-x/texlive-titlepic/test_texlive-titlepic_function_includegraphics.sh b/testcases/function_test/pkg_test/texlive-split-x/texlive-titlepic/test_texlive-titlepic_function_includegraphics.sh deleted file mode 100644 index 811993a1ae5..00000000000 --- a/testcases/function_test/pkg_test/texlive-split-x/texlive-titlepic/test_texlive-titlepic_function_includegraphics.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-11 -# @License : Mulan PSL v2 -# @Desc : Test including an image in document title -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - set -e - - LOG_INFO "开始测试:在文档标题中包含图片功能" - - LOG_INFO "步骤1:检查texlive-titlepic包是否在yum源中" - if ! dnf list available texlive-titlepic &>/dev/null; then - LOG_ERROR "texlive-titlepic包不在yum源中" - exit 255 - fi - - LOG_INFO "步骤2:检查系统是否已安装texlive-titlepic" - if rpm -q texlive-titlepic &>/dev/null; then - LOG_INFO "texlive-titlepic已安装,测试结束后将保持安装状态" - INSTALLED=true - else - LOG_INFO "texlive-titlepic未安装,将在测试过程中安装" - INSTALLED=false - fi - - LOG_INFO "步骤3:创建测试LaTeX文档" - TEST_DIR=$(mktemp -d) - cd "$TEST_DIR" - cat > test_titlepic.tex << "EOF" - \documentclass{article} - \usepackage{titlepic} - \title{Test Document} - \titlepic{\includegraphics[width=0.5\textwidth]{example-image}} - \author{Test Author} - \begin{document} - \maketitle - This is a test document. - \end{document} - EOF - - if [ "$INSTALLED" = "false" ]; then - LOG_INFO "步骤4:安装texlive-titlepic包" - dnf install -y texlive-titlepic - CHECK_RESULT $? 0 0 "安装texlive-titlepic失败" - fi - - LOG_INFO "步骤5:检查pdflatex命令是否可用" - if ! command -v pdflatex &>/dev/null; then - LOG_ERROR "pdflatex命令不存在" - exit 255 - fi - - LOG_INFO "步骤6:编译LaTeX文档" - pdflatex -interaction=nonstopmode test_titlepic.tex - CHECK_RESULT $? 0 0 "编译LaTeX文档失败" - - LOG_INFO "步骤7:验证PDF文件是否生成" - if [ -f test_titlepic.pdf ]; then - LOG_INFO "PDF文件生成成功" - file test_titlepic.pdf | grep -q "PDF document" - CHECK_RESULT $? 0 0 "生成的PDF文件格式不正确" - else - LOG_ERROR "PDF文件未生成" - exit 1 - fi - - LOG_INFO "步骤8:清理测试文件" - cd / - rm -rf "$TEST_DIR" - - if [ "$INSTALLED" = "false" ]; then - LOG_INFO "步骤9:卸载texlive-titlepic包" - dnf remove -y texlive-titlepic - CHECK_RESULT $? 0 0 "卸载texlive-titlepic失败" - fi - - LOG_INFO "测试完成:在文档标题中包含图片功能测试通过" -} - -main "$@" \ No newline at end of file diff --git a/testcases/function_test/pkg_test/texlive-split-x/texlive-titlepic/test_texlive-titlepic_function_title.sh b/testcases/function_test/pkg_test/texlive-split-x/texlive-titlepic/test_texlive-titlepic_function_title.sh deleted file mode 100644 index c3fe7442574..00000000000 --- a/testcases/function_test/pkg_test/texlive-split-x/texlive-titlepic/test_texlive-titlepic_function_title.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 title generation functionality -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - - # 检查环境是否已安装texlive-titlepic - LOG_INFO "检查是否已安装texlive-titlepic" - if dnf list installed texlive-titlepic &>/dev/null; then - LOG_INFO "texlive-titlepic已安装,脚本结束后将保持安装状态" - INSTALLED=true - else - LOG_INFO "texlive-titlepic未安装,将在测试后卸载" - INSTALLED=false - fi - - # 检查yum源中是否有texlive-titlepic软件包 - LOG_INFO "检查yum源中是否有texlive-titlepic软件包" - if ! dnf list available texlive-titlepic &>/dev/null; then - LOG_ERROR "yum源中未找到texlive-titlepic软件包" - exit 255 - fi - - # 安装texlive-titlepic(如果未安装) - if [ "$INSTALLED" = false ]; then - LOG_INFO "正在安装texlive-titlepic" - dnf install -y texlive-titlepic - CHECK_RESULT $? 0 0 "安装texlive-titlepic失败" - fi - - # 测试title生成功能 - LOG_INFO "测试title生成功能" - test_title="Test Title" - test_output=$(echo "$test_title" | title-generate) - CHECK_RESULT $? 0 0 "title生成功能测试失败" - LOG_INFO "生成的title: $test_output" - - # 清理环境(如果之前未安装) - if [ "$INSTALLED" = false ]; then - LOG_INFO "正在卸载texlive-titlepic" - dnf remove -y texlive-titlepic - CHECK_RESULT $? 0 0 "卸载texlive-titlepic失败" - fi - - LOG_INFO "测试脚本执行完毕,环境已恢复" - -} - -main "$@" \ No newline at end of file diff --git a/testcases/function_test/pkg_test/texlive-split-x/texlive-titlepic/test_texlive-titlepic_function_usage.sh b/testcases/function_test/pkg_test/texlive-split-x/texlive-titlepic/test_texlive-titlepic_function_usage.sh deleted file mode 100644 index 33bfca46e50..00000000000 --- a/testcases/function_test/pkg_test/texlive-split-x/texlive-titlepic/test_texlive-titlepic_function_usage.sh +++ /dev/null @@ -1,131 +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-11 -# @License : Mulan PSL v2 -# @Desc : Test basic usage of the titlepic package in a LaTeX document -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - # 定义颜色和日志函数(假设LOG_INFO和LOG_ERROR已定义,这里仅模拟) - LOG_INFO() { - echo "[INFO] $*" - } - LOG_ERROR() { - echo "[ERROR] $*" >&2 - } - - # 定义CHECK_RESULT函数(假设已定义,这里仅模拟) - CHECK_RESULT() { - local actual=$1 - local expect=$2 - local exit_code=$3 - local msg=$4 - if [ $actual -ne $expect ]; then - LOG_ERROR "$msg" - exit $exit_code - fi - } - - # 定义SSH_CMD函数(假设已定义,这里仅模拟) - SSH_CMD() { - local cmd=$1 - local node_ip=$2 - local node_password=$3 - local node_user=$4 - # 这里仅模拟执行,实际应根据SSH_CMD的实现来调用 - LOG_INFO "在节点 $node_ip 上执行命令: $cmd" - # 假设成功执行 - return 0 - } - - # 测试用例描述:Test basic usage of the titlepic package in a LaTeX document - LOG_INFO "开始测试:测试LaTeX文档中titlepic包的基本用法" - - # 步骤1:检查环境是否已安装texlive-titlepic包 - LOG_INFO "步骤1:检查环境是否已安装texlive-titlepic包" - if rpm -q texlive-titlepic &>/dev/null; then - LOG_INFO "texlive-titlepic包已安装,脚本结束时将保持安装状态" - INSTALLED_BEFORE=true - else - LOG_INFO "texlive-titlepic包未安装,将在测试步骤中安装" - INSTALLED_BEFORE=false - fi - - # 步骤2:检查yum源中是否有texlive-titlepic包 - LOG_INFO "步骤2:检查yum源中是否有texlive-titlepic包" - if ! dnf list available texlive-titlepic &>/dev/null; then - LOG_ERROR "yum源中未找到texlive-titlepic包" - exit 255 - fi - - # 步骤3:如果未安装,则安装texlive-titlepic包 - if [ "$INSTALLED_BEFORE" = "false" ]; then - LOG_INFO "步骤3:安装texlive-titlepic包" - dnf install -y texlive-titlepic - CHECK_RESULT $? 0 255 "安装texlive-titlepic包失败" - fi - - # 步骤4:创建一个简单的LaTeX文档测试titlepic包 - LOG_INFO "步骤4:创建一个简单的LaTeX文档测试titlepic包" - cat > test_titlepic.tex << "EOF" - \documentclass{article} - \usepackage{titlepic} - \title{Test Document} - \author{Test Author} - \titlepic{\includegraphics[width=0.5\textwidth]{example-image}} - \begin{document} - \maketitle - This is a test document for the titlepic package. - \end{document} - EOF - CHECK_RESULT $? 0 1 "创建LaTeX测试文件失败" - - # 步骤5:使用pdflatex编译LaTeX文档 - LOG_INFO "步骤5:使用pdflatex编译LaTeX文档" - if command -v pdflatex &>/dev/null; then - pdflatex -interaction=nonstopmode test_titlepic.tex - CHECK_RESULT $? 0 1 "编译LaTeX文档失败" - else - LOG_ERROR "未找到pdflatex命令,无法编译LaTeX文档" - exit 1 - fi - - # 步骤6:检查生成的PDF文件是否存在 - LOG_INFO "步骤6:检查生成的PDF文件是否存在" - if [ -f test_titlepic.pdf ]; then - LOG_INFO "PDF文件生成成功:test_titlepic.pdf" - else - LOG_ERROR "PDF文件未生成" - exit 1 - fi - - # 步骤7:清理测试文件 - LOG_INFO "步骤7:清理测试文件" - rm -f test_titlepic.tex test_titlepic.log test_titlepic.aux test_titlepic.pdf - CHECK_RESULT $? 0 1 "清理测试文件失败" - - # 步骤8:如果之前未安装,则卸载texlive-titlepic包 - if [ "$INSTALLED_BEFORE" = "false" ]; then - LOG_INFO "步骤8:卸载texlive-titlepic包" - dnf remove -y texlive-titlepic - CHECK_RESULT $? 0 1 "卸载texlive-titlepic包失败" - fi - - LOG_INFO "测试完成:LaTeX文档中titlepic包的基本用法测试通过" -} - -main "$@" \ No newline at end of file From 85e431d39eb225a79b2fba03f30c7cd1b80aea08 Mon Sep 17 00:00:00 2001 From: honghua Date: Fri, 17 Apr 2026 12:27:31 +0800 Subject: [PATCH 08/16] update testcase for testsuite texlive-datetime2-serbian --- .../texlive-datetime2-serbian.json | 16 ---- ...live-datetime2-serbian_function_datefmt.sh | 77 ---------------- ...e-datetime2-serbian_function_serbiancyr.sh | 81 ----------------- ...e-datetime2-serbian_function_serbianlat.sh | 91 ------------------- 4 files changed, 265 deletions(-) delete mode 100644 testcases/function_test/pkg_test/texlive-split-f/texlive-datetime2-serbian/test_texlive-datetime2-serbian_function_datefmt.sh delete mode 100644 testcases/function_test/pkg_test/texlive-split-f/texlive-datetime2-serbian/test_texlive-datetime2-serbian_function_serbiancyr.sh delete mode 100644 testcases/function_test/pkg_test/texlive-split-f/texlive-datetime2-serbian/test_texlive-datetime2-serbian_function_serbianlat.sh diff --git a/suite2cases/function_test/pkg_test/texlive-split-f/texlive-datetime2-serbian.json b/suite2cases/function_test/pkg_test/texlive-split-f/texlive-datetime2-serbian.json index 5cdb215c56a..993a1e77f8d 100644 --- a/suite2cases/function_test/pkg_test/texlive-split-f/texlive-datetime2-serbian.json +++ b/suite2cases/function_test/pkg_test/texlive-split-f/texlive-datetime2-serbian.json @@ -2,10 +2,6 @@ "path": "$OET_PATH/testcases/function_test/pkg_test/texlive-split-f/texlive-datetime2-serbian", "machine num": 1, "cases": [ - { - "name": "test_texlive-datetime2-serbian_function_datefmt", - "desc": "Test date formatting functionality" - }, { "name": "test_texlive-datetime2-serbian_function_install", "desc": "Test installation of the texlive-datetime2-serbian package" @@ -13,18 +9,6 @@ { "name": "test_texlive-datetime2-serbian_function_remove", "desc": "Test removal of the texlive-datetime2-serbian package" - }, - { - "name": "test_texlive-datetime2-serbian_function_checkinstalled", - "desc": "Test checking if the package is installed" - }, - { - "name": "test_texlive-datetime2-serbian_function_serbiancyr", - "desc": "Test Serbian Cyrillic date formatting" - }, - { - "name": "test_texlive-datetime2-serbian_function_serbianlat", - "desc": "Test Serbian Latin date formatting" } ] } \ No newline at end of file diff --git a/testcases/function_test/pkg_test/texlive-split-f/texlive-datetime2-serbian/test_texlive-datetime2-serbian_function_datefmt.sh b/testcases/function_test/pkg_test/texlive-split-f/texlive-datetime2-serbian/test_texlive-datetime2-serbian_function_datefmt.sh deleted file mode 100644 index fac3f8e3ed4..00000000000 --- a/testcases/function_test/pkg_test/texlive-split-f/texlive-datetime2-serbian/test_texlive-datetime2-serbian_function_datefmt.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 : Test date formatting functionality -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - - # 检查是否已安装texlive-datetime2-serbian软件包 - LOG_INFO "检查texlive-datetime2-serbian是否已安装" - if rpm -q texlive-datetime2-serbian &>/dev/null; then - LOG_INFO "texlive-datetime2-serbian已安装" - INSTALLED=true - else - LOG_INFO "texlive-datetime2-serbian未安装" - INSTALLED=false - fi - - # 检查yum源中是否存在texlive-datetime2-serbian软件包 - LOG_INFO "检查yum源中是否存在texlive-datetime2-serbian软件包" - if ! dnf list available texlive-datetime2-serbian &>/dev/null; then - LOG_ERROR "yum源中不存在texlive-datetime2-serbian软件包" - exit 255 - fi - - # 如果未安装,则安装软件包 - if [ "$INSTALLED" = false ]; then - LOG_INFO "开始安装texlive-datetime2-serbian软件包" - dnf install -y texlive-datetime2-serbian - CHECK_RESULT $? 0 0 "安装texlive-datetime2-serbian失败" - fi - - # 测试datefmt功能 - LOG_INFO "测试datefmt功能" - TEST_FILE="test_datefmt.tex" - cat > "$TEST_FILE" </dev/null - CHECK_RESULT $? 0 0 "datefmt功能测试失败" - - # 清理生成的临时文件 - LOG_INFO "清理临时文件" - rm -f "$TEST_FILE" test_datefmt.aux test_datefmt.log test_datefmt.pdf - - # 如果脚本开始时未安装,则卸载软件包以恢复环境 - if [ "$INSTALLED" = false ]; then - LOG_INFO "卸载texlive-datetime2-serbian软件包以恢复环境" - dnf remove -y texlive-datetime2-serbian &>/dev/null - CHECK_RESULT $? 0 0 "卸载texlive-datetime2-serbian失败" - fi - - LOG_INFO "测试完成,环境已恢复" - -} - -main "$@" \ No newline at end of file diff --git a/testcases/function_test/pkg_test/texlive-split-f/texlive-datetime2-serbian/test_texlive-datetime2-serbian_function_serbiancyr.sh b/testcases/function_test/pkg_test/texlive-split-f/texlive-datetime2-serbian/test_texlive-datetime2-serbian_function_serbiancyr.sh deleted file mode 100644 index 58e3a5d256d..00000000000 --- a/testcases/function_test/pkg_test/texlive-split-f/texlive-datetime2-serbian/test_texlive-datetime2-serbian_function_serbiancyr.sh +++ /dev/null @@ -1,81 +0,0 @@ -#!/usr/bin/bash - -# Copyright (c) 2024 ISCAS .ALL rights reserved. -# This program is licensed under Mulan PSL v2. -# You can use it according to the terms and conditions of the Mulan PSL v2. -# http://license.coscl.org.cn/MulanPSL2 -# THIS PROGRAM IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, -# EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, -# MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. -# See the Mulan PSL v2 for more details. - -# ############################################# -# @Author : honghua -# @Contact : honghua@iscas.ac.cn -# @Date : 2026-03-25 -# @License : Mulan PSL v2 -# @Desc : Test Serbian Cyrillic date formatting -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - set -e - - LOG_INFO "开始测试 Serbian Cyrillic 日期格式化功能" - - # 定义软件包名称 - PACKAGE_NAME="texlive-datetime2-serbian" - - LOG_INFO "步骤1: 检查yum源中是否存在软件包 $PACKAGE_NAME" - if ! dnf list available "$PACKAGE_NAME" &> /dev/null; then - LOG_ERROR "软件包 $PACKAGE_NAME 在yum源中不存在" - exit 255 - fi - - LOG_INFO "步骤2: 检查系统是否已安装 $PACKAGE_NAME" - if rpm -q "$PACKAGE_NAME" &> /dev/null; then - LOG_INFO "软件包 $PACKAGE_NAME 已安装,测试后将保持安装状态" - INSTALLED_BEFORE=true - else - LOG_INFO "软件包 $PACKAGE_NAME 未安装,将在测试过程中安装" - INSTALLED_BEFORE=false - fi - - # 如果未安装,则安装软件包 - if [ "$INSTALLED_BEFORE" = false ]; then - LOG_INFO "步骤3: 安装软件包 $PACKAGE_NAME" - dnf install -y "$PACKAGE_NAME" - CHECK_RESULT $? 0 0 "安装软件包 $PACKAGE_NAME 失败" - fi - - LOG_INFO "步骤4: 验证软件包安装成功" - rpm -q "$PACKAGE_NAME" - CHECK_RESULT $? 0 0 "验证软件包 $PACKAGE_NAME 安装失败" - - LOG_INFO "步骤5: 测试 Serbian Cyrillic 日期格式化功能" - # 这里假设有一个测试命令,例如使用latex或相关工具测试 - # 由于实际命令未知,这里使用一个模拟命令,实际应根据软件包文档替换 - TEST_COMMAND="echo "Testing Serbian Cyrillic date formatting"" - eval $TEST_COMMAND - CHECK_RESULT $? 0 0 "执行 Serbian Cyrillic 日期格式化测试失败" - - # 如果测试需要在第二个服务器上执行,使用SSH_CMD(这里仅为示例,实际应根据需求调整) - # LOG_INFO "步骤6: 在第二个服务器上测试" - # SSH_CMD "echo "Testing on second node"" $NODE2_IPV4 $NODE2_PASSWORD $NODE2_USER - # CHECK_RESULT $? 0 0 "在第二个服务器上执行测试失败" - - # 清理环境:如果之前未安装,则卸载软件包 - if [ "$INSTALLED_BEFORE" = false ]; then - LOG_INFO "步骤6: 卸载软件包 $PACKAGE_NAME" - dnf remove -y "$PACKAGE_NAME" - CHECK_RESULT $? 0 0 "卸载软件包 $PACKAGE_NAME 失败" - LOG_INFO "环境已恢复,软件包 $PACKAGE_NAME 已卸载" - else - LOG_INFO "环境已恢复,软件包 $PACKAGE_NAME 保持安装状态" - fi - - LOG_INFO "测试 Serbian Cyrillic 日期格式化功能完成" -} - -main "$@" \ No newline at end of file diff --git a/testcases/function_test/pkg_test/texlive-split-f/texlive-datetime2-serbian/test_texlive-datetime2-serbian_function_serbianlat.sh b/testcases/function_test/pkg_test/texlive-split-f/texlive-datetime2-serbian/test_texlive-datetime2-serbian_function_serbianlat.sh deleted file mode 100644 index 56a8811c855..00000000000 --- a/testcases/function_test/pkg_test/texlive-split-f/texlive-datetime2-serbian/test_texlive-datetime2-serbian_function_serbianlat.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-25 -# @License : Mulan PSL v2 -# @Desc : Test Serbian Latin date formatting -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - # 设置环境变量 - SCRIPT_NAME="test_texlive-datetime2-serbian_function_serbianlat" - PACKAGE_NAME="texlive-datetime2-serbian" - LOG_INFO "测试脚本开始:$SCRIPT_NAME" - - # 检查是否已安装软件包 - LOG_INFO "检查系统是否已安装 $PACKAGE_NAME" - rpm -q $PACKAGE_NAME >/dev/null 2>&1 - if [ $? -eq 0 ]; then - INSTALLED=true - LOG_INFO "$PACKAGE_NAME 已安装,测试完成后将保持安装状态" - else - INSTALLED=false - LOG_INFO "$PACKAGE_NAME 未安装,测试过程中将临时安装" - fi - - # 检查yum源中是否有该软件包 - LOG_INFO "检查yum源中是否存在 $PACKAGE_NAME" - dnf list available $PACKAGE_NAME >/dev/null 2>&1 - CHECK_RESULT $? 0 255 "yum源中未找到软件包 $PACKAGE_NAME" - - # 如果未安装,则安装软件包 - if [ "$INSTALLED" = "false" ]; then - LOG_INFO "安装软件包 $PACKAGE_NAME" - dnf install -y $PACKAGE_NAME - CHECK_RESULT $? 0 0 "安装 $PACKAGE_NAME 失败" - fi - - # 测试 Serbian Latin 日期格式化功能 - LOG_INFO "测试 Serbian Latin 日期格式化功能" - # 使用示例命令测试日期格式化 - # 假设 texlive-datetime2-serbian 提供了 serbianlat 命令或相关功能 - # 这里使用一个假设的命令来演示 - SAMPLE_COMMAND="date +"%d.%m.%Y."" - # 实际测试中应使用软件包提供的具体命令 - # 例如:serbianlat --format 或类似命令 - - # 检查命令是否存在(假设命令为 serbianlat) - COMMAND_TO_TEST="serbianlat" - if ! command -v $COMMAND_TO_TEST &>/dev/null; then - LOG_ERROR "命令 $COMMAND_TO_TEST 不存在或不支持" - exit 255 - fi - - # 执行测试命令 - LOG_INFO "执行测试命令:$COMMAND_TO_TEST" - $COMMAND_TO_TEST --help >/dev/null 2>&1 - CHECK_RESULT $? 0 0 "命令 $COMMAND_TO_TEST 执行失败" - - # 具体测试 Serbian Latin 日期格式化 - LOG_INFO "测试 Serbian Latin 日期格式化输出" - # 假设命令支持 --format 参数 - $COMMAND_TO_TEST --format="serbianlat" >/dev/null 2>&1 - CHECK_RESULT $? 0 0 "Serbian Latin 日期格式化功能异常" - - # 测试完成,清理环境 - LOG_INFO "测试完成,清理环境" - if [ "$INSTALLED" = "false" ]; then - LOG_INFO "卸载临时安装的软件包 $PACKAGE_NAME" - dnf remove -y $PACKAGE_NAME - CHECK_RESULT $? 0 0 "卸载 $PACKAGE_NAME 失败" - else - LOG_INFO "系统原有安装状态保持不变" - fi - - LOG_INFO "测试脚本结束:$SCRIPT_NAME" -} - -main "$@" \ No newline at end of file From 115577e8009b05bbeee832afe18c170de7c15401 Mon Sep 17 00:00:00 2001 From: honghua Date: Fri, 17 Apr 2026 12:28:46 +0800 Subject: [PATCH 09/16] update testcase for testsuite libXfixes-help --- .../pkg_test/libXfixes/libXfixes-help.json | 4 -- .../test_libXfixes-help_function_install.sh | 66 ------------------- 2 files changed, 70 deletions(-) delete mode 100644 testcases/function_test/pkg_test/libXfixes/libXfixes-help/test_libXfixes-help_function_install.sh diff --git a/suite2cases/function_test/pkg_test/libXfixes/libXfixes-help.json b/suite2cases/function_test/pkg_test/libXfixes/libXfixes-help.json index ac4ea931e16..6019847adf8 100644 --- a/suite2cases/function_test/pkg_test/libXfixes/libXfixes-help.json +++ b/suite2cases/function_test/pkg_test/libXfixes/libXfixes-help.json @@ -2,10 +2,6 @@ "path": "$OET_PATH/testcases/function_test/pkg_test/libXfixes/libXfixes-help", "machine num": 1, "cases": [ - { - "name": "test_libXfixes-help_function_install", - "desc": "测试通过包管理器(如apt、yum)成功安装libXfixes-help软件包" - }, { "name": "test_libXfixes-help_function_query", "desc": "测试查询已安装的libXfixes-help软件包版本信息" diff --git a/testcases/function_test/pkg_test/libXfixes/libXfixes-help/test_libXfixes-help_function_install.sh b/testcases/function_test/pkg_test/libXfixes/libXfixes-help/test_libXfixes-help_function_install.sh deleted file mode 100644 index 144de5674ec..00000000000 --- a/testcases/function_test/pkg_test/libXfixes/libXfixes-help/test_libXfixes-help_function_install.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 : 2026-03-08 -# @License : Mulan PSL v2 -# @Desc : 测试通过包管理器(如apt、yum)成功安装libXfixes-help软件包 -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - LOG_INFO "步骤1:检查libXfixes-help软件包是否在yum源中" - dnf list available libXfixes-help 2>/dev/null | grep -q libXfixes-help - if [ $? -ne 0 ]; then - LOG_ERROR "yum源中未找到libXfixes-help软件包" - exit 255 - fi - - LOG_INFO "步骤2:检查环境中是否已安装libXfixes-help软件包" - rpm -q libXfixes-help >/dev/null 2>&1 - if [ $? -eq 0 ]; then - LOG_INFO "环境中已安装libXfixes-help软件包,标记为已安装状态" - INSTALLED=true - else - LOG_INFO "环境中未安装libXfixes-help软件包,标记为未安装状态" - INSTALLED=false - fi - - LOG_INFO "步骤3:若未安装,则安装libXfixes-help软件包" - if [ "$INSTALLED" = false ]; then - dnf install -y libXfixes-help - CHECK_RESULT $? 0 0 "安装libXfixes-help软件包失败" - LOG_INFO "安装libXfixes-help软件包成功" - fi - - LOG_INFO "步骤4:验证libXfixes-help软件包功能" - # 这里假设libXfixes-help软件包安装后提供了一个可执行命令或库文件,例如通过man page验证 - # 根据实际软件包情况调整验证命令 - man -w libXfixes >/dev/null 2>&1 - CHECK_RESULT $? 0 0 "libXfixes-help软件包功能验证失败" - - LOG_INFO "步骤5:环境清理,若脚本开始时未安装,则卸载软件包" - if [ "$INSTALLED" = false ]; then - LOG_INFO "卸载libXfixes-help软件包" - dnf remove -y libXfixes-help - CHECK_RESULT $? 0 0 "卸载libXfixes-help软件包失败" - LOG_INFO "卸载libXfixes-help软件包成功" - else - LOG_INFO "脚本开始时软件包已安装,保持安装状态" - fi - - LOG_INFO "测试完成" -} - -main "$@" \ No newline at end of file From 488e07d2b357132853adeac3124070729c5b1d21 Mon Sep 17 00:00:00 2001 From: honghua Date: Fri, 17 Apr 2026 12:28:55 +0800 Subject: [PATCH 10/16] update testcase for testsuite hibernate4-osgi --- .../pkg_test/hibernate4/hibernate4-osgi.json | 4 -- .../test_hibernate4-osgi_function_query.sh | 71 ------------------- 2 files changed, 75 deletions(-) delete mode 100644 testcases/function_test/pkg_test/hibernate4/hibernate4-osgi/test_hibernate4-osgi_function_query.sh diff --git a/suite2cases/function_test/pkg_test/hibernate4/hibernate4-osgi.json b/suite2cases/function_test/pkg_test/hibernate4/hibernate4-osgi.json index b7447e2b75c..eba3ac01f57 100644 --- a/suite2cases/function_test/pkg_test/hibernate4/hibernate4-osgi.json +++ b/suite2cases/function_test/pkg_test/hibernate4/hibernate4-osgi.json @@ -6,10 +6,6 @@ "name": "test_hibernate4-osgi_install_package", "desc": "测试软件包 hibernate4-osgi 的安装功能", "machine num": 1 - }, - { - "name": "test_hibernate4-osgi_function_query", - "desc": "测试软件包 hibernate4-osgi 的查询功能" } ] } \ No newline at end of file diff --git a/testcases/function_test/pkg_test/hibernate4/hibernate4-osgi/test_hibernate4-osgi_function_query.sh b/testcases/function_test/pkg_test/hibernate4/hibernate4-osgi/test_hibernate4-osgi_function_query.sh deleted file mode 100644 index f70dfb9bd05..00000000000 --- a/testcases/function_test/pkg_test/hibernate4/hibernate4-osgi/test_hibernate4-osgi_function_query.sh +++ /dev/null @@ -1,71 +0,0 @@ -#!/usr/bin/bash - -# Copyright (c) 2024 ISCAS .ALL rights reserved. -# This program is licensed under Mulan PSL v2. -# You can use it according to the terms and conditions of the Mulan PSL v2. -# http://license.coscl.org.cn/MulanPSL2 -# THIS PROGRAM IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, -# EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, -# MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. -# See the Mulan PSL v2 for more details. - -# ############################################# -# @Author : honghua -# @Contact : honghua@iscas.ac.cn -# @Date : 2025-12-12 -# @License : Mulan PSL v2 -# @Desc : 测试软件包 hibernate4-osgi 的查询功能 -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - LOG_INFO "开始测试 hibernate4-osgi 的查询功能" - - # 检查是否已安装 hibernate4-osgi - LOG_INFO "检查是否已安装 hibernate4-osgi" - if dnf list installed hibernate4-osgi &>/dev/null; then - LOG_INFO "hibernate4-osgi 已安装,脚本结束时将保持安装状态" - installed=true - else - LOG_INFO "hibernate4-osgi 未安装,将在测试后卸载" - installed=false - fi - - # 检查 yum 源中是否有 hibernate4-osgi 软件包 - LOG_INFO "检查 yum 源中是否有 hibernate4-osgi" - if ! dnf list available hibernate4-osgi &>/dev/null; then - LOG_ERROR "yum 源中未找到 hibernate4-osgi 软件包" - exit 255 - fi - - # 如果未安装,则安装 hibernate4-osgi - if [ "$installed" = false ]; then - LOG_INFO "正在安装 hibernate4-osgi" - dnf install -y hibernate4-osgi - CHECK_RESULT $? 0 0 "安装 hibernate4-osgi 失败" - fi - - # 测试查询功能 - LOG_INFO "测试 hibernate4-osgi 的查询功能" - query_output=$(hibernate4-osgi query) - CHECK_RESULT $? 0 0 "hibernate4-osgi query 命令执行失败" - - # 验证查询结果是否符合预期 - LOG_INFO "验证查询结果是否符合预期" - if [[ "$query_output" != *"expected_output"* ]]; then - LOG_ERROR "查询结果不符合预期" - exit 1 - fi - - # 如果最初未安装,则在测试完成后卸载 hibernate4-osgi - if [ "$installed" = false ]; then - LOG_INFO "正在卸载 hibernate4-osgi" - dnf remove -y hibernate4-osgi - CHECK_RESULT $? 0 0 "卸载 hibernate4-osgi 失败" - fi - - LOG_INFO "hibernate4-osgi 查询功能测试完成" -} - -main "$@" \ No newline at end of file From e967fa948faa6d8eec60d41f94c4f7823d687a61 Mon Sep 17 00:00:00 2001 From: honghua Date: Fri, 17 Apr 2026 12:31:57 +0800 Subject: [PATCH 11/16] update testcase for testsuite texlive-dyntree-doc --- .../texlive-split-g/texlive-dyntree-doc.json | 16 ---- ...exlive-dyntree-doc_function_doc_content.sh | 86 ------------------- ..._texlive-dyntree-doc_function_doc_exist.sh | 57 ------------ ...texlive-dyntree-doc_function_list_files.sh | 62 ------------- ..._texlive-dyntree-doc_function_uninstall.sh | 82 ------------------ 5 files changed, 303 deletions(-) delete mode 100644 testcases/function_test/pkg_test/texlive-split-g/texlive-dyntree-doc/test_texlive-dyntree-doc_function_doc_content.sh delete mode 100644 testcases/function_test/pkg_test/texlive-split-g/texlive-dyntree-doc/test_texlive-dyntree-doc_function_doc_exist.sh delete mode 100644 testcases/function_test/pkg_test/texlive-split-g/texlive-dyntree-doc/test_texlive-dyntree-doc_function_list_files.sh delete mode 100644 testcases/function_test/pkg_test/texlive-split-g/texlive-dyntree-doc/test_texlive-dyntree-doc_function_uninstall.sh diff --git a/suite2cases/function_test/pkg_test/texlive-split-g/texlive-dyntree-doc.json b/suite2cases/function_test/pkg_test/texlive-split-g/texlive-dyntree-doc.json index f28eb9b7bb8..e2576990047 100644 --- a/suite2cases/function_test/pkg_test/texlive-split-g/texlive-dyntree-doc.json +++ b/suite2cases/function_test/pkg_test/texlive-split-g/texlive-dyntree-doc.json @@ -5,22 +5,6 @@ { "name": "test_texlive-dyntree-doc_function_install", "desc": "Verify package installation" - }, - { - "name": "test_texlive-dyntree-doc_function_uninstall", - "desc": "Verify package removal" - }, - { - "name": "test_texlive-dyntree-doc_function_doc_exist", - "desc": "Check documentation files existence" - }, - { - "name": "test_texlive-dyntree-doc_function_doc_content", - "desc": "Validate key documentation content" - }, - { - "name": "test_texlive-dyntree-doc_function_list_files", - "desc": "List installed package files" } ] } \ No newline at end of file diff --git a/testcases/function_test/pkg_test/texlive-split-g/texlive-dyntree-doc/test_texlive-dyntree-doc_function_doc_content.sh b/testcases/function_test/pkg_test/texlive-split-g/texlive-dyntree-doc/test_texlive-dyntree-doc_function_doc_content.sh deleted file mode 100644 index d903c277b2c..00000000000 --- a/testcases/function_test/pkg_test/texlive-split-g/texlive-dyntree-doc/test_texlive-dyntree-doc_function_doc_content.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-03 -# @License : Mulan PSL v2 -# @Desc : Validate key documentation content -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - # 环境准备:检查是否已安装texlive-dyntree-doc - LOG_INFO "检查是否已安装texlive-dyntree-doc软件包" - rpm -q texlive-dyntree-doc > /dev/null 2>&1 - if [ $? -eq 0 ]; then - LOG_INFO "texlive-dyntree-doc已安装,测试结束后将保持安装状态" - INSTALLED=true - else - LOG_INFO "texlive-dyntree-doc未安装,测试将执行安装步骤并在结束后卸载" - INSTALLED=false - fi - - # 步骤1:检查yum源中是否存在texlive-dyntree-doc软件包 - LOG_INFO "检查yum源中是否存在texlive-dyntree-doc软件包" - dnf list available texlive-dyntree-doc > /dev/null 2>&1 - if [ $? -ne 0 ]; then - LOG_ERROR "yum源中未找到texlive-dyntree-doc软件包" - exit 255 - fi - - # 步骤2:如果未安装则安装软件包 - if [ "$INSTALLED" = false ]; then - LOG_INFO "开始安装texlive-dyntree-doc软件包" - dnf install -y texlive-dyntree-doc > /dev/null 2>&1 - CHECK_RESULT $? 0 0 "安装texlive-dyntree-doc软件包失败" - LOG_INFO "texlive-dyntree-doc软件包安装成功" - fi - - # 步骤3:验证关键文档内容 - LOG_INFO "验证关键文档内容" - # 假设关键文档位于/usr/share/doc/texlive-dyntree-doc/目录下 - DOC_DIR="/usr/share/doc/texlive-dyntree-doc/" - if [ -d "$DOC_DIR" ]; then - LOG_INFO "文档目录存在,检查关键文档文件" - # 检查是否存在README或相关文档 - if [ -f "$DOC_DIR/README" ] || [ -f "$DOC_DIR/README.txt" ] || [ -f "$DOC_DIR/index.html" ]; then - LOG_INFO "关键文档文件存在" - # 检查文档内容是否包含关键信息,例如"dyntree"关键字 - grep -r "dyntree" "$DOC_DIR" > /dev/null 2>&1 - CHECK_RESULT $? 0 0 "文档内容中未找到关键信息"dyntree"" - LOG_INFO "文档内容验证成功,包含关键信息" - else - LOG_ERROR "关键文档文件不存在" - CHECK_RESULT 1 0 1 "关键文档文件缺失" - fi - else - LOG_ERROR "文档目录不存在" - CHECK_RESULT 1 0 1 "文档目录缺失" - fi - - # 步骤4:环境恢复 - LOG_INFO "开始环境恢复" - if [ "$INSTALLED" = false ]; then - LOG_INFO "卸载texlive-dyntree-doc软件包" - dnf remove -y texlive-dyntree-doc > /dev/null 2>&1 - CHECK_RESULT $? 0 0 "卸载texlive-dyntree-doc软件包失败" - LOG_INFO "texlive-dyntree-doc软件包卸载成功" - else - LOG_INFO "保持texlive-dyntree-doc软件包安装状态" - fi - - LOG_INFO "测试脚本执行完成" -} - -main "$@" \ No newline at end of file diff --git a/testcases/function_test/pkg_test/texlive-split-g/texlive-dyntree-doc/test_texlive-dyntree-doc_function_doc_exist.sh b/testcases/function_test/pkg_test/texlive-split-g/texlive-dyntree-doc/test_texlive-dyntree-doc_function_doc_exist.sh deleted file mode 100644 index c2c07bcff46..00000000000 --- a/testcases/function_test/pkg_test/texlive-split-g/texlive-dyntree-doc/test_texlive-dyntree-doc_function_doc_exist.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 : 2026-03-03 -# @License : Mulan PSL v2 -# @Desc : Check documentation files existence -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - LOG_INFO "开始测试:检查文档文件是否存在" - LOG_INFO "步骤1:检查texlive-dyntree-doc软件包是否在yum源中" - if ! dnf list available texlive-dyntree-doc &>/dev/null; then - LOG_ERROR "yum源中未找到texlive-dyntree-doc软件包" - exit 255 - fi - - LOG_INFO "步骤2:检查当前环境是否已安装texlive-dyntree-doc" - if rpm -q texlive-dyntree-doc &>/dev/null; then - LOG_INFO "texlive-dyntree-doc已安装,跳过安装步骤" - INSTALLED=true - else - LOG_INFO "texlive-dyntree-doc未安装,开始安装" - dnf install -y texlive-dyntree-doc - CHECK_RESULT $? 0 0 "安装texlive-dyntree-doc失败" - INSTALLED=false - fi - - LOG_INFO "步骤3:检查文档文件是否存在" - rpm -ql texlive-dyntree-doc | grep -E "\.(pdf|html|txt|md)$" > /dev/null - CHECK_RESULT $? 0 0 "文档文件不存在" - - LOG_INFO "步骤4:环境恢复" - if [ "$INSTALLED" = "false" ]; then - LOG_INFO "卸载texlive-dyntree-doc软件包" - dnf remove -y texlive-dyntree-doc - CHECK_RESULT $? 0 0 "卸载texlive-dyntree-doc失败" - else - LOG_INFO "保持texlive-dyntree-doc安装状态" - fi - - LOG_INFO "测试完成:文档文件存在性检查通过" -} - -main "$@" \ No newline at end of file diff --git a/testcases/function_test/pkg_test/texlive-split-g/texlive-dyntree-doc/test_texlive-dyntree-doc_function_list_files.sh b/testcases/function_test/pkg_test/texlive-split-g/texlive-dyntree-doc/test_texlive-dyntree-doc_function_list_files.sh deleted file mode 100644 index 8a0058f28d1..00000000000 --- a/testcases/function_test/pkg_test/texlive-split-g/texlive-dyntree-doc/test_texlive-dyntree-doc_function_list_files.sh +++ /dev/null @@ -1,62 +0,0 @@ -#!/usr/bin/bash - -# Copyright (c) 2024 ISCAS .ALL rights reserved. -# This program is licensed under Mulan PSL v2. -# You can use it according to the terms and conditions of the Mulan PSL v2. -# http://license.coscl.org.cn/MulanPSL2 -# THIS PROGRAM IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, -# EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, -# MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. -# See the Mulan PSL v2 for more details. - -# ############################################# -# @Author : honghua -# @Contact : honghua@iscas.ac.cn -# @Date : 2026-03-03 -# @License : Mulan PSL v2 -# @Desc : List installed package files -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - # 检查是否已安装texlive-dyntree-doc软件包 - LOG_INFO "检查texlive-dyntree-doc软件包是否已安装" - if dnf list installed texlive-dyntree-doc &>/dev/null; then - LOG_INFO "texlive-dyntree-doc已安装,脚本结束后将保持安装状态" - already_installed=true - else - LOG_INFO "texlive-dyntree-doc未安装,将在测试过程中安装" - already_installed=false - fi - - # 检查yum源中是否有该软件包 - LOG_INFO "检查yum源中是否有texlive-dyntree-doc软件包" - if ! dnf list available texlive-dyntree-doc &>/dev/null; then - LOG_ERROR "yum源中未找到texlive-dyntree-doc软件包" - exit 255 - fi - - # 如果未安装,则安装软件包 - if [ "$already_installed" = false ]; then - LOG_INFO "安装texlive-dyntree-doc软件包" - dnf install -y texlive-dyntree-doc - CHECK_RESULT $? 0 0 "安装texlive-dyntree-doc失败" - fi - - # 测试列出已安装包文件功能 - LOG_INFO "测试列出texlive-dyntree-doc已安装文件" - rpm -ql texlive-dyntree-doc - CHECK_RESULT $? 0 0 "列出texlive-dyntree-doc文件失败" - - # 清理环境:如果测试前未安装,则卸载软件包 - if [ "$already_installed" = false ]; then - LOG_INFO "卸载texlive-dyntree-doc软件包" - dnf remove -y texlive-dyntree-doc - CHECK_RESULT $? 0 0 "卸载texlive-dyntree-doc失败" - fi - - LOG_INFO "测试完成,环境已恢复" -} - -main "$@" \ No newline at end of file diff --git a/testcases/function_test/pkg_test/texlive-split-g/texlive-dyntree-doc/test_texlive-dyntree-doc_function_uninstall.sh b/testcases/function_test/pkg_test/texlive-split-g/texlive-dyntree-doc/test_texlive-dyntree-doc_function_uninstall.sh deleted file mode 100644 index 8672d790421..00000000000 --- a/testcases/function_test/pkg_test/texlive-split-g/texlive-dyntree-doc/test_texlive-dyntree-doc_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-03 -# @License : Mulan PSL v2 -# @Desc : Verify package removal -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - # 检查是否已经安装了texlive-dyntree-doc - LOG_INFO "检查texlive-dyntree-doc是否已安装..." - rpm -q texlive-dyntree-doc - if [ $? -eq 0 ]; then - LOG_INFO "texlive-dyntree-doc已经安装,脚本结束时将保持安装状态。" - INSTALLED_BEFORE=true - else - LOG_INFO "texlive-dyntree-doc未安装,将在测试步骤中安装。" - INSTALLED_BEFORE=false - fi - - # 检查yum源中是否存在texlive-dyntree-doc软件包 - LOG_INFO "检查yum源中是否存在texlive-dyntree-doc软件包..." - dnf list available texlive-dyntree-doc &>/dev/null - if [ $? -ne 0 ]; then - LOG_ERROR "yum源中未找到texlive-dyntree-doc软件包。" - exit 255 - fi - - # 如果之前未安装,则安装软件包 - if [ "$INSTALLED_BEFORE" = "false" ]; then - LOG_INFO "安装texlive-dyntree-doc软件包..." - dnf install -y texlive-dyntree-doc - CHECK_RESULT $? 0 0 "安装texlive-dyntree-doc失败。" - fi - - # 验证软件包已安装 - LOG_INFO "验证texlive-dyntree-doc已安装..." - rpm -q texlive-dyntree-doc - CHECK_RESULT $? 0 0 "texlive-dyntree-doc未正确安装。" - - # 执行卸载操作 - LOG_INFO "卸载texlive-dyntree-doc软件包..." - dnf remove -y texlive-dyntree-doc - CHECK_RESULT $? 0 0 "卸载texlive-dyntree-doc失败。" - - # 验证软件包已卸载 - LOG_INFO "验证texlive-dyntree-doc已卸载..." - rpm -q texlive-dyntree-doc - if [ $? -eq 0 ]; then - LOG_ERROR "texlive-dyntree-doc卸载后仍然存在。" - exit 1 - else - LOG_INFO "texlive-dyntree-doc已成功卸载。" - fi - - # 环境恢复:如果之前未安装,则重新安装以恢复环境;如果之前已安装,则保持卸载状态 - if [ "$INSTALLED_BEFORE" = "true" ]; then - LOG_INFO "重新安装texlive-dyntree-doc以恢复环境..." - dnf install -y texlive-dyntree-doc - CHECK_RESULT $? 0 0 "重新安装texlive-dyntree-doc失败。" - LOG_INFO "环境已恢复到初始安装状态。" - else - LOG_INFO "环境已恢复到初始未安装状态。" - fi - - LOG_INFO "测试完成。" -} - -main "$@" \ No newline at end of file From 4080b8432ee9ab43f35cde061ec89e3738d5651a Mon Sep 17 00:00:00 2001 From: honghua Date: Fri, 17 Apr 2026 12:32:44 +0800 Subject: [PATCH 12/16] update testcase for testsuite texlive-textcase --- .../texlive-split-w/texlive-textcase.json | 10 --- ...test_texlive-textcase_function_caseconv.sh | 64 ------------------- 2 files changed, 74 deletions(-) delete mode 100644 suite2cases/function_test/pkg_test/texlive-split-w/texlive-textcase.json delete mode 100644 testcases/function_test/pkg_test/texlive-split-w/texlive-textcase/test_texlive-textcase_function_caseconv.sh diff --git a/suite2cases/function_test/pkg_test/texlive-split-w/texlive-textcase.json b/suite2cases/function_test/pkg_test/texlive-split-w/texlive-textcase.json deleted file mode 100644 index 4fcec03a61a..00000000000 --- a/suite2cases/function_test/pkg_test/texlive-split-w/texlive-textcase.json +++ /dev/null @@ -1,10 +0,0 @@ -{ - "path": "$OET_PATH/testcases/function_test/pkg_test/texlive-split-w/texlive-textcase", - "machine num": 1, - "cases": [ - { - "name": "test_texlive-textcase_function_caseconv", - "desc": "Test case conversion functionality" - } - ] -} \ No newline at end of file diff --git a/testcases/function_test/pkg_test/texlive-split-w/texlive-textcase/test_texlive-textcase_function_caseconv.sh b/testcases/function_test/pkg_test/texlive-split-w/texlive-textcase/test_texlive-textcase_function_caseconv.sh deleted file mode 100644 index 2913af9cc8c..00000000000 --- a/testcases/function_test/pkg_test/texlive-split-w/texlive-textcase/test_texlive-textcase_function_caseconv.sh +++ /dev/null @@ -1,64 +0,0 @@ -#!/usr/bin/bash - -# Copyright (c) 2024 ISCAS .ALL rights reserved. -# This program is licensed under Mulan PSL v2. -# You can use it according to the terms and conditions of the Mulan PSL v2. -# http://license.coscl.org.cn/MulanPSL2 -# THIS PROGRAM IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, -# EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, -# MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. -# See the Mulan PSL v2 for more details. - -# ############################################# -# @Author : honghua -# @Contact : honghua@iscas.ac.cn -# @Date : 2025-11-26 -# @License : Mulan PSL v2 -# @Desc : Test case conversion functionality -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - LOG_INFO "开始测试: Test case conversion functionality" - - # 检查是否已安装texlive-textcase - LOG_INFO "检查texlive-textcase是否已安装" - if dnf list installed texlive-textcase &>/dev/null; then - LOG_INFO "texlive-textcase已安装,脚本结束时将保持安装状态" - INSTALLED=true - else - LOG_INFO "texlive-textcase未安装,将在测试结束后卸载" - INSTALLED=false - fi - - # 检查yum源中是否有texlive-textcase - LOG_INFO "检查yum源中是否有texlive-textcase" - if ! dnf list available texlive-textcase &>/dev/null; then - LOG_ERROR "yum源中未找到texlive-textcase软件包" - exit 255 - fi - - # 如果未安装,则安装texlive-textcase - if [ "$INSTALLED" = false ]; then - LOG_INFO "开始安装texlive-textcase" - dnf install -y texlive-textcase - CHECK_RESULT $? 0 0 "安装texlive-textcase失败" - fi - - # 测试大小写转换功能 - LOG_INFO "测试大小写转换功能" - echo "hello world" | texlua $(kpsewhich --progname=caseconv caseconv.lua) upper - CHECK_RESULT $? 0 0 "大小写转换功能测试失败" - - # 清理环境 - if [ "$INSTALLED" = false ]; then - LOG_INFO "卸载texlive-textcase" - dnf remove -y texlive-textcase - CHECK_RESULT $? 0 0 "卸载texlive-textcase失败" - fi - - LOG_INFO "测试完成: Test case conversion functionality" -} - -main "$@" \ No newline at end of file From a477be270ca6b63f5499833d547363c7e098facb Mon Sep 17 00:00:00 2001 From: honghua Date: Fri, 17 Apr 2026 12:36:13 +0800 Subject: [PATCH 13/16] update testcase for testsuite texlive-libgreek-doc --- .../texlive-split-n/texlive-libgreek-doc.json | 12 --- ...texlive-libgreek-doc_function_listfiles.sh | 75 ---------------- ...texlive-libgreek-doc_function_uninstall.sh | 82 ------------------ ...t_texlive-libgreek-doc_function_viewdoc.sh | 85 ------------------- 4 files changed, 254 deletions(-) delete mode 100644 testcases/function_test/pkg_test/texlive-split-n/texlive-libgreek-doc/test_texlive-libgreek-doc_function_listfiles.sh delete mode 100644 testcases/function_test/pkg_test/texlive-split-n/texlive-libgreek-doc/test_texlive-libgreek-doc_function_uninstall.sh delete mode 100644 testcases/function_test/pkg_test/texlive-split-n/texlive-libgreek-doc/test_texlive-libgreek-doc_function_viewdoc.sh diff --git a/suite2cases/function_test/pkg_test/texlive-split-n/texlive-libgreek-doc.json b/suite2cases/function_test/pkg_test/texlive-split-n/texlive-libgreek-doc.json index 42644eeb866..06285a206bf 100644 --- a/suite2cases/function_test/pkg_test/texlive-split-n/texlive-libgreek-doc.json +++ b/suite2cases/function_test/pkg_test/texlive-split-n/texlive-libgreek-doc.json @@ -6,21 +6,9 @@ "name": "test_texlive-libgreek-doc_function_install", "desc": "Test package installation" }, - { - "name": "test_texlive-libgreek-doc_function_uninstall", - "desc": "Test package removal" - }, { "name": "test_texlive-libgreek-doc_function_verify", "desc": "Verify package is installed" - }, - { - "name": "test_texlive-libgreek-doc_function_listfiles", - "desc": "List package documentation files" - }, - { - "name": "test_texlive-libgreek-doc_function_viewdoc", - "desc": "Check documentation accessibility" } ] } \ No newline at end of file diff --git a/testcases/function_test/pkg_test/texlive-split-n/texlive-libgreek-doc/test_texlive-libgreek-doc_function_listfiles.sh b/testcases/function_test/pkg_test/texlive-split-n/texlive-libgreek-doc/test_texlive-libgreek-doc_function_listfiles.sh deleted file mode 100644 index 9abb9301d2a..00000000000 --- a/testcases/function_test/pkg_test/texlive-split-n/texlive-libgreek-doc/test_texlive-libgreek-doc_function_listfiles.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-02 -# @License : Mulan PSL v2 -# @Desc : List package documentation files -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - set -e - - LOG_INFO "开始测试:List package documentation files" - - # 检查软件包是否在yum源中 - LOG_INFO "检查软件包 texlive-libgreek-doc 是否在yum源中" - if ! dnf list available texlive-libgreek-doc &>/dev/null; then - LOG_ERROR "软件包 texlive-libgreek-doc 不在yum源中" - exit 255 - fi - - # 检查是否已安装 - LOG_INFO "检查软件包 texlive-libgreek-doc 是否已安装" - if rpm -q texlive-libgreek-doc &>/dev/null; then - LOG_INFO "软件包已安装,测试结束后保持安装状态" - INSTALLED_BEFORE=true - else - LOG_INFO "软件包未安装,将在测试过程中安装" - INSTALLED_BEFORE=false - fi - - # 如果未安装,则安装软件包 - if [ "$INSTALLED_BEFORE" = false ]; then - LOG_INFO "安装软件包 texlive-libgreek-doc" - dnf install -y texlive-libgreek-doc - CHECK_RESULT $? 0 0 "安装软件包失败" - fi - - # 检查rpm命令的-qd参数是否存在 - LOG_INFO "检查rpm命令的-qd参数是否支持" - if ! rpm --help | grep -q "\-qd"; then - LOG_ERROR "rpm命令不支持-qd参数" - exit 255 - fi - - # 列出软件包文档文件 - LOG_INFO "列出软件包 texlive-libgreek-doc 的文档文件" - rpm -qd texlive-libgreek-doc - CHECK_RESULT $? 0 0 "列出文档文件失败" - - # 恢复环境 - if [ "$INSTALLED_BEFORE" = false ]; then - LOG_INFO "卸载软件包 texlive-libgreek-doc" - dnf remove -y texlive-libgreek-doc - CHECK_RESULT $? 0 0 "卸载软件包失败" - else - LOG_INFO "测试前已安装,保持软件包安装状态" - fi - - LOG_INFO "测试完成:List package documentation files" -} - -main "$@" \ No newline at end of file diff --git a/testcases/function_test/pkg_test/texlive-split-n/texlive-libgreek-doc/test_texlive-libgreek-doc_function_uninstall.sh b/testcases/function_test/pkg_test/texlive-split-n/texlive-libgreek-doc/test_texlive-libgreek-doc_function_uninstall.sh deleted file mode 100644 index bd402854747..00000000000 --- a/testcases/function_test/pkg_test/texlive-split-n/texlive-libgreek-doc/test_texlive-libgreek-doc_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-02 -# @License : Mulan PSL v2 -# @Desc : Test package removal -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - # 定义软件包名称 - PACKAGE_NAME="texlive-libgreek-doc" - - # 步骤1: 检查当前环境是否已安装软件包 - LOG_INFO "步骤1: 检查当前环境是否已安装软件包" - rpm -q $PACKAGE_NAME - if [ $? -eq 0 ]; then - LOG_INFO "软件包已安装,标记为已安装状态" - INSTALLED=true - else - LOG_INFO "软件包未安装,标记为未安装状态" - INSTALLED=false - fi - - # 步骤2: 检查yum源中是否存在该软件包 - LOG_INFO "步骤2: 检查yum源中是否存在软件包 $PACKAGE_NAME" - dnf list available $PACKAGE_NAME &> /dev/null - CHECK_RESULT $? 0 255 "软件包 $PACKAGE_NAME 在yum源中不存在" - - # 步骤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: 验证软件包 $PACKAGE_NAME 已正确安装" - rpm -q $PACKAGE_NAME - CHECK_RESULT $? 0 0 "软件包 $PACKAGE_NAME 未正确安装" - - # 步骤5: 执行卸载操作 - LOG_INFO "步骤5: 卸载软件包 $PACKAGE_NAME" - dnf remove -y $PACKAGE_NAME - CHECK_RESULT $? 0 0 "卸载软件包 $PACKAGE_NAME 失败" - - # 步骤6: 验证软件包已卸载 - LOG_INFO "步骤6: 验证软件包 $PACKAGE_NAME 已卸载" - rpm -q $PACKAGE_NAME - if [ $? -eq 0 ]; then - LOG_ERROR "软件包 $PACKAGE_NAME 卸载失败" - exit 1 - else - LOG_INFO "软件包 $PACKAGE_NAME 已成功卸载" - fi - - # 步骤7: 环境恢复 - LOG_INFO "步骤7: 环境恢复" - if [ "$INSTALLED" = "true" ]; then - LOG_INFO "恢复原始安装状态:重新安装软件包 $PACKAGE_NAME" - dnf install -y $PACKAGE_NAME - CHECK_RESULT $? 0 0 "重新安装软件包 $PACKAGE_NAME 失败" - else - LOG_INFO "原始状态为未安装,无需额外操作" - fi - - LOG_INFO "测试完成" -} - -main "$@" \ No newline at end of file diff --git a/testcases/function_test/pkg_test/texlive-split-n/texlive-libgreek-doc/test_texlive-libgreek-doc_function_viewdoc.sh b/testcases/function_test/pkg_test/texlive-split-n/texlive-libgreek-doc/test_texlive-libgreek-doc_function_viewdoc.sh deleted file mode 100644 index a0232086548..00000000000 --- a/testcases/function_test/pkg_test/texlive-split-n/texlive-libgreek-doc/test_texlive-libgreek-doc_function_viewdoc.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 : 2026-03-02 -# @License : Mulan PSL v2 -# @Desc : Check documentation accessibility -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - PACKAGE_NAME="texlive-libgreek-doc" - LOG_INFO "开始测试:检查texlive-libgreek-doc文档可访问性" - - LOG_INFO "步骤1:检查软件包是否在yum源中可用" - dnf list available $PACKAGE_NAME >/dev/null 2>&1 - if [ $? -ne 0 ]; then - LOG_ERROR "软件包 $PACKAGE_NAME 在yum源中不可用" - exit 255 - fi - - LOG_INFO "步骤2:检查系统是否已安装该软件包" - rpm -q $PACKAGE_NAME >/dev/null 2>&1 - if [ $? -eq 0 ]; then - INSTALLED="true" - LOG_INFO "软件包 $PACKAGE_NAME 已安装,测试完成后保持安装状态" - else - INSTALLED="false" - LOG_INFO "软件包 $PACKAGE_NAME 未安装,将在测试前安装" - fi - - if [ "$INSTALLED" = "false" ]; then - LOG_INFO "步骤3:安装软件包 $PACKAGE_NAME" - dnf install -y $PACKAGE_NAME - CHECK_RESULT $? 0 0 "安装软件包失败" - fi - - LOG_INFO "步骤4:检查viewdoc命令是否可用" - command -v viewdoc >/dev/null 2>&1 - CHECK_RESULT $? 0 0 "viewdoc命令不存在" - - LOG_INFO "步骤5:检查viewdoc命令支持的参数" - viewdoc --help >/dev/null 2>&1 - CHECK_RESULT $? 0 0 "viewdoc命令不支持--help参数" - - LOG_INFO "步骤6:测试查看libgreek文档" - viewdoc libgreek >/dev/null 2>&1 - CHECK_RESULT $? 0 0 "无法访问libgreek文档" - - LOG_INFO "步骤7:测试查看libgreek文档的指定章节" - viewdoc libgreek "Introduction" >/dev/null 2>&1 - CHECK_RESULT $? 0 0 "无法访问libgreek文档的Introduction章节" - - LOG_INFO "步骤8:测试查看不存在的文档" - viewdoc nonexistent-doc 2>&1 | grep -q "not found" - CHECK_RESULT $? 0 0 "查看不存在文档时未返回预期错误" - - LOG_INFO "步骤9:测试查看不存在的章节" - viewdoc libgreek "NonexistentChapter" 2>&1 | grep -q "not found" - CHECK_RESULT $? 0 0 "查看不存在章节时未返回预期错误" - - if [ "$INSTALLED" = "false" ]; then - LOG_INFO "步骤10:卸载测试安装的软件包" - dnf remove -y $PACKAGE_NAME - CHECK_RESULT $? 0 0 "卸载软件包失败" - LOG_INFO "环境已恢复到测试前状态" - else - LOG_INFO "步骤10:保持软件包安装状态" - fi - - LOG_INFO "测试完成:texlive-libgreek-doc文档可访问性测试通过" -} - -main "$@" \ No newline at end of file From 32fdb647799660522543b7c76353c5d32398fff5 Mon Sep 17 00:00:00 2001 From: honghua Date: Fri, 17 Apr 2026 12:39:59 +0800 Subject: [PATCH 14/16] update testcase for testsuite qt6-qtpdf-examples --- .../qt6-qtwebengine/qt6-qtpdf-examples.json | 12 -- ...st_qt6-qtpdf-examples_function_examples.sh | 88 ----------- ...t_qt6-qtpdf-examples_function_uninstall.sh | 99 ------------ ...test_qt6-qtpdf-examples_function_viewer.sh | 148 ------------------ 4 files changed, 347 deletions(-) delete mode 100644 testcases/function_test/pkg_test/qt6-qtwebengine/qt6-qtpdf-examples/test_qt6-qtpdf-examples_function_examples.sh delete mode 100644 testcases/function_test/pkg_test/qt6-qtwebengine/qt6-qtpdf-examples/test_qt6-qtpdf-examples_function_uninstall.sh delete mode 100644 testcases/function_test/pkg_test/qt6-qtwebengine/qt6-qtpdf-examples/test_qt6-qtpdf-examples_function_viewer.sh diff --git a/suite2cases/function_test/pkg_test/qt6-qtwebengine/qt6-qtpdf-examples.json b/suite2cases/function_test/pkg_test/qt6-qtwebengine/qt6-qtpdf-examples.json index 2ee0be8e850..4212ca4df4e 100644 --- a/suite2cases/function_test/pkg_test/qt6-qtwebengine/qt6-qtpdf-examples.json +++ b/suite2cases/function_test/pkg_test/qt6-qtwebengine/qt6-qtpdf-examples.json @@ -6,21 +6,9 @@ "name": "test_qt6-qtpdf-examples_function_install", "desc": "测试软件包qt6-qtpdf-examples的安装功能是否正常。" }, - { - "name": "test_qt6-qtpdf-examples_function_uninstall", - "desc": "测试软件包qt6-qtpdf-examples的卸载功能是否正常,确保卸载后相关文件被移除。" - }, { "name": "test_qt6-qtpdf-examples_function_check", "desc": "检查qt6-qtpdf-examples软件包是否已正确安装到系统中。" - }, - { - "name": "test_qt6-qtpdf-examples_function_examples", - "desc": "验证软件包安装后,其包含的示例程序(如PDF查看器示例)能否被找到并可执行。" - }, - { - "name": "test_qt6-qtpdf-examples_function_viewer", - "desc": "测试软件包提供的PDF查看器示例程序的基本功能,如打开和渲染PDF文件。" } ] } \ No newline at end of file diff --git a/testcases/function_test/pkg_test/qt6-qtwebengine/qt6-qtpdf-examples/test_qt6-qtpdf-examples_function_examples.sh b/testcases/function_test/pkg_test/qt6-qtwebengine/qt6-qtpdf-examples/test_qt6-qtpdf-examples_function_examples.sh deleted file mode 100644 index 648dd015a7d..00000000000 --- a/testcases/function_test/pkg_test/qt6-qtwebengine/qt6-qtpdf-examples/test_qt6-qtpdf-examples_function_examples.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-21 -# @License : Mulan PSL v2 -# @Desc : 验证软件包安装后,其包含的示例程序(如PDF查看器示例)能否被找到并可执行。 -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - LOG_INFO "开始测试:验证qt6-qtpdf-examples软件包安装后示例程序能否被找到并可执行" - - # 定义软件包名称 - PACKAGE_NAME="qt6-qtpdf-examples" - - # 步骤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" - if rpm -q $PACKAGE_NAME &>/dev/null; then - INSTALLED="true" - LOG_INFO "软件包 $PACKAGE_NAME 已安装,将保持安装状态" - else - INSTALLED="false" - LOG_INFO "软件包 $PACKAGE_NAME 未安装,将进行安装" - 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:查找软件包 $PACKAGE_NAME 包含的示例程序文件" - EXAMPLE_FILES=$(rpm -ql $PACKAGE_NAME | grep -E "\.(exe|bin|sh)$" | head -5) - if [ -z "$EXAMPLE_FILES" ]; then - LOG_ERROR "未找到软件包 $PACKAGE_NAME 的示例程序文件" - exit 255 - fi - LOG_INFO "找到示例程序文件:" - echo "$EXAMPLE_FILES" - - # 步骤5:测试示例程序是否可执行 - LOG_INFO "步骤5:测试示例程序是否可执行" - for file in $EXAMPLE_FILES; do - if [ -x "$file" ]; then - LOG_INFO "文件 $file 可执行" - # 尝试执行示例程序(通常示例程序可能需要图形环境,这里仅检查可执行权限) - # 如果需要实际执行,可以添加执行命令,但考虑到可能依赖图形环境,这里仅检查权限 - else - LOG_ERROR "文件 $file 不可执行" - exit 255 - fi - done - - # 步骤6:清理环境(如果测试前未安装,则卸载软件包) - if [ "$INSTALLED" = "false" ]; then - LOG_INFO "步骤6:卸载软件包 $PACKAGE_NAME" - dnf remove -y $PACKAGE_NAME - CHECK_RESULT $? 0 0 "卸载软件包 $PACKAGE_NAME 失败" - else - LOG_INFO "步骤6:测试前软件包已安装,保持安装状态" - fi - - LOG_INFO "测试完成:软件包 $PACKAGE_NAME 的示例程序可被找到并可执行" -} - -main "$@" \ No newline at end of file diff --git a/testcases/function_test/pkg_test/qt6-qtwebengine/qt6-qtpdf-examples/test_qt6-qtpdf-examples_function_uninstall.sh b/testcases/function_test/pkg_test/qt6-qtwebengine/qt6-qtpdf-examples/test_qt6-qtpdf-examples_function_uninstall.sh deleted file mode 100644 index 0b7c78ab6ec..00000000000 --- a/testcases/function_test/pkg_test/qt6-qtwebengine/qt6-qtpdf-examples/test_qt6-qtpdf-examples_function_uninstall.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-02-21 -# @License : Mulan PSL v2 -# @Desc : 测试软件包qt6-qtpdf-examples的卸载功能是否正常,确保卸载后相关文件被移除。 -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - set -e - - LOG_INFO "开始测试qt6-qtpdf-examples卸载功能" - - LOG_INFO "步骤1: 检查yum源中是否存在qt6-qtpdf-examples软件包" - dnf list available qt6-qtpdf-examples > /dev/null 2>&1 - if [ $? -ne 0 ]; then - LOG_ERROR "yum源中未找到qt6-qtpdf-examples软件包" - exit 255 - fi - - LOG_INFO "步骤2: 检查系统是否已安装qt6-qtpdf-examples" - rpm -q qt6-qtpdf-examples > /dev/null 2>&1 - if [ $? -eq 0 ]; then - already_installed=true - LOG_INFO "检测到系统已安装qt6-qtpdf-examples,测试后将保持安装状态" - else - already_installed=false - LOG_INFO "系统未安装qt6-qtpdf-examples,将先安装再测试卸载功能" - fi - - if [ "$already_installed" = "false" ]; then - LOG_INFO "步骤3: 安装qt6-qtpdf-examples软件包" - dnf install -y qt6-qtpdf-examples - CHECK_RESULT $? 0 0 "安装qt6-qtpdf-examples失败" - fi - - LOG_INFO "步骤4: 验证qt6-qtpdf-examples安装成功" - rpm -q qt6-qtpdf-examples > /dev/null 2>&1 - CHECK_RESULT $? 0 0 "验证qt6-qtpdf-examples安装状态失败" - - LOG_INFO "步骤5: 获取qt6-qtpdf-examples安装的文件列表" - installed_files=$(rpm -ql qt6-qtpdf-examples) - if [ $? -ne 0 ]; then - LOG_ERROR "获取qt6-qtpdf-examples文件列表失败" - exit 255 - fi - - LOG_INFO "步骤6: 卸载qt6-qtpdf-examples软件包" - dnf remove -y qt6-qtpdf-examples - CHECK_RESULT $? 0 0 "卸载qt6-qtpdf-examples失败" - - LOG_INFO "步骤7: 验证qt6-qtpdf-examples已卸载" - rpm -q qt6-qtpdf-examples > /dev/null 2>&1 - if [ $? -eq 0 ]; then - LOG_ERROR "qt6-qtpdf-examples卸载后仍可查询到" - exit 1 - fi - LOG_INFO "qt6-qtpdf-examples已成功卸载" - - LOG_INFO "步骤8: 检查相关文件是否被移除" - for file in $installed_files; do - if [ -e "$file" ]; then - LOG_ERROR "文件 $file 在卸载后仍然存在" - file_removal_failed=true - fi - done - - if [ "$file_removal_failed" = "true" ]; then - LOG_ERROR "卸载后仍有文件残留" - exit 1 - fi - LOG_INFO "所有相关文件均已成功移除" - - LOG_INFO "步骤9: 环境恢复" - if [ "$already_installed" = "true" ]; then - LOG_INFO "恢复原始安装状态:重新安装qt6-qtpdf-examples" - dnf install -y qt6-qtpdf-examples - CHECK_RESULT $? 0 0 "重新安装qt6-qtpdf-examples失败" - else - LOG_INFO "原始状态为未安装,无需额外恢复" - fi - - LOG_INFO "测试完成:qt6-qtpdf-examples卸载功能正常" -} - -main "$@" \ No newline at end of file diff --git a/testcases/function_test/pkg_test/qt6-qtwebengine/qt6-qtpdf-examples/test_qt6-qtpdf-examples_function_viewer.sh b/testcases/function_test/pkg_test/qt6-qtwebengine/qt6-qtpdf-examples/test_qt6-qtpdf-examples_function_viewer.sh deleted file mode 100644 index 76903d77b66..00000000000 --- a/testcases/function_test/pkg_test/qt6-qtwebengine/qt6-qtpdf-examples/test_qt6-qtpdf-examples_function_viewer.sh +++ /dev/null @@ -1,148 +0,0 @@ -#!/usr/bin/bash - -# Copyright (c) 2024 ISCAS .ALL rights reserved. -# This program is licensed under Mulan PSL v2. -# You can use it according to the terms and conditions of the Mulan PSL v2. -# http://license.coscl.org.cn/MulanPSL2 -# THIS PROGRAM IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, -# EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, -# MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. -# See the Mulan PSL v2 for more details. - -# ############################################# -# @Author : honghua -# @Contact : honghua@iscas.ac.cn -# @Date : 2026-02-21 -# @License : Mulan PSL v2 -# @Desc : 测试软件包提供的PDF查看器示例程序的基本功能,如打开和渲染PDF文件。 -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - # 检查是否已安装qt6-qtpdf-examples软件包 - LOG_INFO "检查qt6-qtpdf-examples软件包是否已安装" - rpm -q qt6-qtpdf-examples > /dev/null 2>&1 - if [ $? -eq 0 ]; then - LOG_INFO "qt6-qtpdf-examples软件包已安装,脚本结束时将保持安装状态" - INSTALLED_BEFORE="true" - else - LOG_INFO "qt6-qtpdf-examples软件包未安装,将在测试过程中安装" - INSTALLED_BEFORE="false" - fi - - # 检查yum源中是否有qt6-qtpdf-examples软件包 - LOG_INFO "检查yum源中是否存在qt6-qtpdf-examples软件包" - dnf list available qt6-qtpdf-examples > /dev/null 2>&1 - if [ $? -ne 0 ]; then - LOG_ERROR "yum源中未找到qt6-qtpdf-examples软件包" - exit 255 - fi - - # 如果未安装,则安装qt6-qtpdf-examples软件包 - if [ "${INSTALLED_BEFORE}" = "false" ]; then - LOG_INFO "安装qt6-qtpdf-examples软件包" - dnf install -y qt6-qtpdf-examples - CHECK_RESULT $? 0 0 "安装qt6-qtpdf-examples软件包失败" - fi - - # 查找PDF查看器示例程序的可执行文件 - LOG_INFO "查找PDF查看器示例程序的可执行文件" - VIEWER_EXEC=$(find /usr -name "*pdfviewer*" -type f -executable 2>/dev/null | head -1) - if [ -z "${VIEWER_EXEC}" ]; then - LOG_ERROR "未找到PDF查看器示例程序的可执行文件" - if [ "${INSTALLED_BEFORE}" = "false" ]; then - LOG_INFO "卸载qt6-qtpdf-examples软件包" - dnf remove -y qt6-qtpdf-examples - fi - exit 255 - fi - LOG_INFO "找到PDF查看器示例程序:${VIEWER_EXEC}" - - # 检查PDF查看器示例程序是否支持基本参数 - LOG_INFO "检查PDF查看器示例程序是否支持基本参数" - ${VIEWER_EXEC} --help > /dev/null 2>&1 - if [ $? -ne 0 ]; then - LOG_ERROR "PDF查看器示例程序不支持--help参数" - if [ "${INSTALLED_BEFORE}" = "false" ]; then - LOG_INFO "卸载qt6-qtpdf-examples软件包" - dnf remove -y qt6-qtpdf-examples - fi - exit 255 - fi - - # 创建一个简单的PDF测试文件 - LOG_INFO "创建PDF测试文件" - TEST_PDF="/tmp/test.pdf" - cat > /tmp/test.tex << "EOF" - \documentclass{article} - \begin{document} - This is a test PDF file. - \end{document} - EOF - pdflatex -output-directory=/tmp /tmp/test.tex > /dev/null 2>&1 - if [ ! -f "${TEST_PDF}" ]; then - LOG_INFO "pdflatex不可用,使用另一种方法创建PDF测试文件" - echo "%PDF-1.4" > ${TEST_PDF} - echo "1 0 obj" >> ${TEST_PDF} - echo "<>" >> ${TEST_PDF} - echo "endobj" >> ${TEST_PDF} - echo "2 0 obj" >> ${TEST_PDF} - echo "<>" >> ${TEST_PDF} - echo "endobj" >> ${TEST_PDF} - echo "3 0 obj" >> ${TEST_PDF} - echo "<>" >> ${TEST_PDF} - echo "endobj" >> ${TEST_PDF} - echo "4 0 obj" >> ${TEST_PDF} - echo "<>stream" >> ${TEST_PDF} - echo "BT /F1 12 Tf 72 720 Td (Test PDF) Tj ET" >> ${TEST_PDF} - echo "endstream" >> ${TEST_PDF} - echo "endobj" >> ${TEST_PDF} - echo "xref" >> ${TEST_PDF} - echo "0 5" >> ${TEST_PDF} - echo "0000000000 65535 f" >> ${TEST_PDF} - echo "0000000010 00000 n" >> ${TEST_PDF} - echo "0000000053 00000 n" >> ${TEST_PDF} - echo "0000000102 00000 n" >> ${TEST_PDF} - echo "0000000179 00000 n" >> ${TEST_PDF} - echo "trailer" >> ${TEST_PDF} - echo "<>" >> ${TEST_PDF} - echo "startxref" >> ${TEST_PDF} - echo "263" >> ${TEST_PDF} - echo "%%EOF" >> ${TEST_PDF} - fi - - # 测试PDF查看器示例程序打开PDF文件 - LOG_INFO "测试PDF查看器示例程序打开PDF文件" - timeout 5s ${VIEWER_EXEC} ${TEST_PDF} > /dev/null 2>&1 & - VIEWER_PID=$! - sleep 2 - if ps -p ${VIEWER_PID} > /dev/null 2>&1; then - LOG_INFO "PDF查看器示例程序成功启动并打开PDF文件" - kill ${VIEWER_PID} 2>/dev/null - wait ${VIEWER_PID} 2>/dev/null - else - LOG_ERROR "PDF查看器示例程序未能成功启动" - rm -f ${TEST_PDF} /tmp/test.* - if [ "${INSTALLED_BEFORE}" = "false" ]; then - LOG_INFO "卸载qt6-qtpdf-examples软件包" - dnf remove -y qt6-qtpdf-examples - fi - exit 1 - fi - - # 清理测试文件 - LOG_INFO "清理测试文件" - rm -f ${TEST_PDF} /tmp/test.* - - # 如果测试前未安装,则卸载软件包 - if [ "${INSTALLED_BEFORE}" = "false" ]; then - LOG_INFO "卸载qt6-qtpdf-examples软件包" - dnf remove -y qt6-qtpdf-examples - CHECK_RESULT $? 0 0 "卸载qt6-qtpdf-examples软件包失败" - fi - - LOG_INFO "PDF查看器示例程序基本功能测试完成" -} - -main "$@" \ No newline at end of file From 26177dfc3c8cc56262c7bf9cf78ee7b3a2655f72 Mon Sep 17 00:00:00 2001 From: honghua Date: Fri, 17 Apr 2026 12:43:30 +0800 Subject: [PATCH 15/16] update testcase for testsuite python-flask-session-help --- .../python-flask-session-help.json | 30 --- ...n-flask-session-help_function_basic_use.sh | 219 ------------------ ...thon-flask-session-help_function_config.sh | 82 ------- ...thon-flask-session-help_function_import.sh | 125 ---------- ...python-flask-session-help_function_init.sh | 66 ------ ...hon-flask-session-help_function_install.sh | 99 -------- ...n-flask-session-help_function_uninstall.sh | 78 ------- 7 files changed, 699 deletions(-) delete mode 100644 suite2cases/function_test/pkg_test/python-flask-session/python-flask-session-help.json delete mode 100644 testcases/function_test/pkg_test/python-flask-session/python-flask-session-help/test_python-flask-session-help_function_basic_use.sh delete mode 100644 testcases/function_test/pkg_test/python-flask-session/python-flask-session-help/test_python-flask-session-help_function_config.sh delete mode 100644 testcases/function_test/pkg_test/python-flask-session/python-flask-session-help/test_python-flask-session-help_function_import.sh delete mode 100644 testcases/function_test/pkg_test/python-flask-session/python-flask-session-help/test_python-flask-session-help_function_init.sh delete mode 100644 testcases/function_test/pkg_test/python-flask-session/python-flask-session-help/test_python-flask-session-help_function_install.sh delete mode 100644 testcases/function_test/pkg_test/python-flask-session/python-flask-session-help/test_python-flask-session-help_function_uninstall.sh diff --git a/suite2cases/function_test/pkg_test/python-flask-session/python-flask-session-help.json b/suite2cases/function_test/pkg_test/python-flask-session/python-flask-session-help.json deleted file mode 100644 index 60d11f0f501..00000000000 --- a/suite2cases/function_test/pkg_test/python-flask-session/python-flask-session-help.json +++ /dev/null @@ -1,30 +0,0 @@ -{ - "path": "$OET_PATH/testcases/function_test/pkg_test/python-flask-session/python-flask-session-help", - "machine num": 1, - "cases": [ - { - "name": "test_python-flask-session-help_function_init", - "desc": "Test session initialization" - }, - { - "name": "test_python-flask-session-help_function_install", - "desc": "Test package installation" - }, - { - "name": "test_python-flask-session-help_function_import", - "desc": "Test module import and version" - }, - { - "name": "test_python-flask-session-help_function_basic_use", - "desc": "Test basic session usage" - }, - { - "name": "test_python-flask-session-help_function_config", - "desc": "Test session configuration options" - }, - { - "name": "test_python-flask-session-help_function_uninstall", - "desc": "Test package uninstallation" - } - ] -} \ No newline at end of file diff --git a/testcases/function_test/pkg_test/python-flask-session/python-flask-session-help/test_python-flask-session-help_function_basic_use.sh b/testcases/function_test/pkg_test/python-flask-session/python-flask-session-help/test_python-flask-session-help_function_basic_use.sh deleted file mode 100644 index 4e74ae7935e..00000000000 --- a/testcases/function_test/pkg_test/python-flask-session/python-flask-session-help/test_python-flask-session-help_function_basic_use.sh +++ /dev/null @@ -1,219 +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 basic session usage -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - # 测试脚本:test_python-flask-session-help_function_basic_use - # 测试用例描述:Test basic session usage - - # 定义颜色输出 - LOG_INFO() { - echo -e "\033[32m[INFO]\033[0m $1" - } - - LOG_ERROR() { - echo -e "\033[31m[ERROR]\033[0m $1" - } - - # 检查软件包是否在yum源中 - check_package_in_repo() { - local package_name=$1 - LOG_INFO "检查软件包 $package_name 是否在yum源中" - dnf list available $package_name 2>/dev/null | grep -q $package_name - if [ $? -ne 0 ]; then - LOG_ERROR "软件包 $package_name 不在yum源中" - exit 255 - fi - LOG_INFO "软件包 $package_name 在yum源中" - } - - # 检查命令参数是否支持 - check_command_option() { - local cmd=$1 - local option=$2 - LOG_INFO "检查命令 $cmd 是否支持参数 $option" - $cmd --help 2>&1 | grep -q -- $option - if [ $? -ne 0 ]; then - LOG_ERROR "命令 $cmd 不支持参数 $option" - exit 255 - fi - LOG_INFO "命令 $cmd 支持参数 $option" - } - - # 检查是否已安装 - check_installed() { - LOG_INFO "检查python3-flask-session-help-function是否已安装" - rpm -q python3-flask-session-help-function >/dev/null 2>&1 - return $? - } - - # 安装软件包 - 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 失败" - } - - # 测试基本session使用 - test_basic_session_usage() { - LOG_INFO "开始测试基本session使用功能" - - # 创建测试Python脚本 - cat > /tmp/test_flask_session.py << "EOF" - from flask import Flask, session - from flask_session import Session - import os - - app = Flask(__name__) - app.config["SECRET_KEY"] = "test_secret_key" - app.config["SESSION_TYPE"] = "filesystem" - app.config["SESSION_FILE_DIR"] = "/tmp/flask_session" - - Session(app) - - @app.route("/set") - def set_session(): - session["test_key"] = "test_value" - return "Session set" - - @app.route("/get") - def get_session(): - return session.get("test_key", "Not found") - - @app.route("/clear") - def clear_session(): - session.clear() - return "Session cleared" - - if __name__ == "__main__": - os.makedirs("/tmp/flask_session", exist_ok=True) - app.run(debug=False) - EOF - - LOG_INFO "启动Flask应用进行session测试" - python3 /tmp/test_flask_session.py & - FLASK_PID=$! - sleep 2 - - # 测试设置session - LOG_INFO "测试设置session" - curl -s http://localhost:5000/set - CHECK_RESULT $? 0 0 "设置session失败" - - # 测试获取session - LOG_INFO "测试获取session" - result=$(curl -s http://localhost:5000/get) - if [ "$result" == "test_value" ]; then - LOG_INFO "获取session成功: $result" - else - LOG_ERROR "获取session失败,期望"test_value",实际得到: $result" - kill $FLASK_PID 2>/dev/null - return 1 - fi - - # 测试清除session - LOG_INFO "测试清除session" - curl -s http://localhost:5000/clear - CHECK_RESULT $? 0 0 "清除session失败" - - # 验证session已清除 - LOG_INFO "验证session已清除" - result=$(curl -s http://localhost:5000/get) - if [ "$result" == "Not found" ]; then - LOG_INFO "session清除验证成功" - else - LOG_ERROR "session清除验证失败" - kill $FLASK_PID 2>/dev/null - return 1 - fi - - kill $FLASK_PID 2>/dev/null - rm -f /tmp/test_flask_session.py - rm -rf /tmp/flask_session - - LOG_INFO "基本session使用测试完成" - return 0 - } - - # 主函数 - main() { - LOG_INFO "开始执行测试脚本:test_python-flask-session-help_function_basic_use" - - # 检查软件包是否在yum源中 - check_package_in_repo python3-flask-session-help-function - - # 检查dnf命令是否支持-y参数 - check_command_option dnf "-y" - - # 检查是否已安装 - check_installed - already_installed=$? - - if [ $already_installed -eq 0 ]; then - LOG_INFO "检测到python3-flask-session-help-function已安装,测试后保持安装状态" - need_uninstall=false - else - LOG_INFO "python3-flask-session-help-function未安装,将在测试前安装" - need_uninstall=true - install_package python3-flask-session-help-function - fi - - # 执行测试 - test_basic_session_usage - test_result=$? - - # 环境恢复 - LOG_INFO "开始环境恢复" - - if [ "$need_uninstall" = true ] && [ $test_result -eq 0 ]; then - uninstall_package python3-flask-session-help-function - else - LOG_INFO "保持软件包安装状态" - fi - - # 清理临时文件 - rm -f /tmp/test_flask_session.py 2>/dev/null - rm -rf /tmp/flask_session 2>/dev/null - - LOG_INFO "测试脚本执行完成" - - if [ $test_result -eq 0 ]; then - LOG_INFO "测试通过" - exit 0 - else - LOG_ERROR "测试失败" - exit 1 - fi - } - - # 执行主函数 - main "$@" -} - -main "$@" \ No newline at end of file diff --git a/testcases/function_test/pkg_test/python-flask-session/python-flask-session-help/test_python-flask-session-help_function_config.sh b/testcases/function_test/pkg_test/python-flask-session/python-flask-session-help/test_python-flask-session-help_function_config.sh deleted file mode 100644 index 5ae400256c3..00000000000 --- a/testcases/function_test/pkg_test/python-flask-session/python-flask-session-help/test_python-flask-session-help_function_config.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 session configuration options -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - LOG_INFO "开始测试:Test session configuration options" - - # 检查yum源中是否存在python3-flask-session软件包 - LOG_INFO "步骤1:检查yum源中是否存在python3-flask-session软件包" - dnf list available python3-flask-session &>/dev/null - if [ $? -ne 0 ]; then - LOG_ERROR "yum源中未找到python3-flask-session软件包" - exit 255 - fi - - # 检查是否已安装python3-flask-session - LOG_INFO "步骤2:检查是否已安装python3-flask-session" - rpm -q python3-flask-session &>/dev/null - if [ $? -eq 0 ]; then - LOG_INFO "python3-flask-session已安装,标记为已存在" - INSTALLED="yes" - else - LOG_INFO "python3-flask-session未安装,标记为未存在" - INSTALLED="no" - fi - - # 如果未安装,则进行安装 - if [ "$INSTALLED" == "no" ]; then - LOG_INFO "步骤3:安装python3-flask-session软件包" - dnf install -y python3-flask-session - CHECK_RESULT $? 0 0 "安装python3-flask-session失败" - fi - - # 测试session配置选项 - LOG_INFO "步骤4:测试session配置选项" - # 这里假设有一个测试命令,例如检查某个配置选项是否存在 - # 例如:检查是否支持SESSION_TYPE配置 - # 如果参数不存在或不支持,则退出码为255 - # 假设测试命令为:test_session_config --check SESSION_TYPE - # 如果命令失败,则退出 - test_session_config --check SESSION_TYPE - if [ $? -ne 0 ]; then - LOG_ERROR "测试session配置选项失败,参数不支持或不存在" - exit 255 - fi - - # 执行其他测试命令,例如设置session配置 - LOG_INFO "步骤5:执行其他session配置测试" - # 假设测试命令为:test_session_config --set SESSION_TYPE filesystem - test_session_config --set SESSION_TYPE filesystem - CHECK_RESULT $? 0 0 "设置session配置失败" - - # 清理环境:如果之前未安装,则卸载软件包 - if [ "$INSTALLED" == "no" ]; then - LOG_INFO "步骤6:卸载python3-flask-session软件包" - dnf remove -y python3-flask-session - CHECK_RESULT $? 0 0 "卸载python3-flask-session失败" - else - LOG_INFO "步骤6:保持python3-flask-session安装状态" - fi - - LOG_INFO "测试完成:Test session configuration options" -} - -main "$@" \ No newline at end of file diff --git a/testcases/function_test/pkg_test/python-flask-session/python-flask-session-help/test_python-flask-session-help_function_import.sh b/testcases/function_test/pkg_test/python-flask-session/python-flask-session-help/test_python-flask-session-help_function_import.sh deleted file mode 100644 index 8552526d66f..00000000000 --- a/testcases/function_test/pkg_test/python-flask-session/python-flask-session-help/test_python-flask-session-help_function_import.sh +++ /dev/null @@ -1,125 +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 module import and version -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - # 定义颜色输出 - LOG_INFO() { - echo -e "\033[32m[INFO]\033[0m $*" - } - LOG_ERROR() { - echo -e "\033[31m[ERROR]\033[0m $*" - } - - # 检查yum源中是否存在指定的软件包 - check_package_exist() { - local package_name=$1 - LOG_INFO "检查yum源中是否存在软件包: $package_name" - dnf list available "$package_name" &>/dev/null - if [ $? -ne 0 ]; then - LOG_ERROR "yum源中不存在软件包: $package_name" - exit 255 - fi - LOG_INFO "yum源中存在软件包: $package_name" - } - - # 检查命令参数是否存在 - check_command_param() { - local 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" - } - - # 检查软件包是否已安装 - check_package_installed() { - local package_name=$1 - LOG_INFO "检查软件包 $package_name 是否已安装" - rpm -q "$package_name" &>/dev/null - return $? - } - - # 安装软件包 - 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 失败" - } - - # 测试模块导入和版本 - test_module_import_and_version() { - LOG_INFO "测试模块导入和版本" - python3 -c "import flask; import flask_session; print("flask version:", flask.__version__); print("flask-session version:", flask_session.__version__)" - CHECK_RESULT $? 0 0 "导入模块或获取版本信息失败" - } - - # 主函数 - main() { - LOG_INFO "开始测试: Test module import and version" - - # 定义需要测试的软件包 - PACKAGE_NAME="python3-flask-session" - - # 检查yum源中是否存在该软件包 - check_package_exist "$PACKAGE_NAME" - - # 检查软件包是否已安装 - check_package_installed "$PACKAGE_NAME" - local installed=$? - - # 如果未安装,则安装软件包 - if [ $installed -ne 0 ]; then - install_package "$PACKAGE_NAME" - else - LOG_INFO "软件包 $PACKAGE_NAME 已安装,跳过安装步骤" - fi - - # 测试模块导入和版本 - test_module_import_and_version - - # 如果之前未安装,则卸载软件包 - if [ $installed -ne 0 ]; then - uninstall_package "$PACKAGE_NAME" - else - LOG_INFO "保持软件包 $PACKAGE_NAME 的安装状态" - fi - - LOG_INFO "测试完成" - } - - # 执行主函数 - main -} - -main "$@" \ No newline at end of file diff --git a/testcases/function_test/pkg_test/python-flask-session/python-flask-session-help/test_python-flask-session-help_function_init.sh b/testcases/function_test/pkg_test/python-flask-session/python-flask-session-help/test_python-flask-session-help_function_init.sh deleted file mode 100644 index 8d2883659fd..00000000000 --- a/testcases/function_test/pkg_test/python-flask-session/python-flask-session-help/test_python-flask-session-help_function_init.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-08 -# @License : Mulan PSL v2 -# @Desc : Test session initialization -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - LOG_INFO "开始测试:Test session initialization" - - # 检查yum源中是否存在python3-flask-session-helper包 - LOG_INFO "检查yum源中是否存在python3-flask-session-helper包" - dnf list available python3-flask-session-helper > /dev/null 2>&1 - if [ $? -ne 0 ]; then - LOG_ERROR "yum源中不存在python3-flask-session-helper包" - exit 255 - fi - - # 检查是否已安装python3-flask-session-helper - LOG_INFO "检查是否已安装python3-flask-session-helper" - rpm -q python3-flask-session-helper > /dev/null 2>&1 - if [ $? -eq 0 ]; then - LOG_INFO "python3-flask-session-helper已安装,测试结束后保持安装状态" - installed=true - else - LOG_INFO "python3-flask-session-helper未安装,测试结束后将卸载" - installed=false - fi - - # 如果未安装,则安装 - if [ "$installed" = false ]; then - LOG_INFO "安装python3-flask-session-helper" - dnf install -y python3-flask-session-helper - CHECK_RESULT $? 0 0 "安装python3-flask-session-helper失败" - fi - - # 测试session初始化功能 - LOG_INFO "测试session初始化功能" - flask-session-helper init --help > /dev/null 2>&1 - CHECK_RESULT $? 0 0 "flask-session-helper init命令不支持或参数错误" - - # 清理环境:如果测试前未安装,则卸载 - if [ "$installed" = false ]; then - LOG_INFO "卸载python3-flask-session-helper" - dnf remove -y python3-flask-session-helper - CHECK_RESULT $? 0 0 "卸载python3-flask-session-helper失败" - fi - - LOG_INFO "测试完成:Test session initialization" -} - -main "$@" \ No newline at end of file diff --git a/testcases/function_test/pkg_test/python-flask-session/python-flask-session-help/test_python-flask-session-help_function_install.sh b/testcases/function_test/pkg_test/python-flask-session/python-flask-session-help/test_python-flask-session-help_function_install.sh deleted file mode 100644 index 64c6bce734c..00000000000 --- a/testcases/function_test/pkg_test/python-flask-session/python-flask-session-help/test_python-flask-session-help_function_install.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-21 -# @License : Mulan PSL v2 -# @Desc : Test package installation -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - # 定义颜色输出(可选,但LOG_INFO/LOG_ERROR通常已定义,这里假设未定义,根据要求直接使用) - # 但根据第7条要求,LOG_INFO和LOG_ERROR直接使用,所以这里不定义 - - # 定义软件包名称 - PACKAGE_NAME="python-flask-session-help_function" - - # 检查软件包是否已在yum源中 - LOG_INFO "检查yum源中是否存在软件包: $PACKAGE_NAME" - dnf list available $PACKAGE_NAME &>/dev/null - if [ $? -ne 0 ]; then - LOG_ERROR "软件包 $PACKAGE_NAME 在yum源中不存在" - exit 255 - fi - - # 检查当前环境是否已安装该软件包 - LOG_INFO "检查当前环境是否已安装软件包: $PACKAGE_NAME" - rpm -q $PACKAGE_NAME &>/dev/null - if [ $? -eq 0 ]; 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 "开始安装软件包: $PACKAGE_NAME" - dnf install -y $PACKAGE_NAME - CHECK_RESULT $? 0 0 "安装软件包 $PACKAGE_NAME 失败" - LOG_INFO "软件包 $PACKAGE_NAME 安装成功" - fi - - # 测试步骤:验证软件包安装后基本功能(这里以查询包信息为例) - LOG_INFO "验证软件包安装后基本功能" - rpm -qi $PACKAGE_NAME &>/dev/null - CHECK_RESULT $? 0 0 "查询软件包 $PACKAGE_NAME 信息失败" - - # 测试步骤:尝试执行软件包提供的某个命令(假设软件包安装后会有某个命令) - # 这里以假设命令"flask-session-help"为例,实际应根据软件包真实命令调整 - COMMAND_NAME="flask-session-help" - LOG_INFO "检查软件包命令是否存在: $COMMAND_NAME" - type $COMMAND_NAME &>/dev/null - if [ $? -ne 0 ]; then - LOG_ERROR "命令 $COMMAND_NAME 不存在或不支持" - exit 255 - fi - - # 执行命令(假设命令支持--version参数) - LOG_INFO "执行命令 $COMMAND_NAME --version" - $COMMAND_NAME --version &>/dev/null - CHECK_RESULT $? 0 0 "执行命令 $COMMAND_NAME --version 失败" - - # 如果需要多个服务器测试,这里示例在第二个服务器上执行命令 - # 注意:根据第9条要求,使用SSH_CMD方法 - # 假设需要检查第二个服务器上是否安装了该软件包 - # 注意:这里假设变量NODE2_IPV4, NODE2_PASSWORD, NODE2_USER已定义 - # 如果不需要多服务器测试,可以注释掉以下部分 - LOG_INFO "在第二个服务器上检查软件包是否安装" - SSH_CMD "rpm -q $PACKAGE_NAME" $NODE2_IPV4 $NODE2_PASSWORD $NODE2_USER - # 注意:这里不检查结果,因为第二个服务器可能未安装,这取决于测试需求 - # 如果需要检查,可以添加CHECK_RESULT - - # 环境清理:如果脚本开始时未安装,则卸载软件包 - if [ $ALREADY_INSTALLED -eq 0 ]; then - LOG_INFO "清理环境:卸载软件包 $PACKAGE_NAME" - dnf remove -y $PACKAGE_NAME - CHECK_RESULT $? 0 0 "卸载软件包 $PACKAGE_NAME 失败" - LOG_INFO "软件包 $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/python-flask-session/python-flask-session-help/test_python-flask-session-help_function_uninstall.sh b/testcases/function_test/pkg_test/python-flask-session/python-flask-session-help/test_python-flask-session-help_function_uninstall.sh deleted file mode 100644 index 3a40d4d1deb..00000000000 --- a/testcases/function_test/pkg_test/python-flask-session/python-flask-session-help/test_python-flask-session-help_function_uninstall.sh +++ /dev/null @@ -1,78 +0,0 @@ -#!/usr/bin/bash - -# Copyright (c) 2024 ISCAS .ALL rights reserved. -# This program is licensed under Mulan PSL v2. -# You can use it according to the terms and conditions of the Mulan PSL v2. -# http://license.coscl.org.cn/MulanPSL2 -# THIS PROGRAM IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, -# EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, -# MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. -# See the Mulan PSL v2 for more details. - -# ############################################# -# @Author : honghua -# @Contact : honghua@iscas.ac.cn -# @Date : 2026-03-21 -# @License : Mulan PSL v2 -# @Desc : Test package uninstallation -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - LOG_INFO "开始测试: Test package uninstallation" - - # 定义软件包名称 - PACKAGE_NAME="python-flask-session-help-function" - - # 检查yum源中是否存在该软件包 - LOG_INFO "检查yum源中是否存在软件包: $PACKAGE_NAME" - if ! dnf list available "$PACKAGE_NAME" &>/dev/null; then - LOG_ERROR "软件包 $PACKAGE_NAME 在yum源中不存在" - exit 255 - fi - - # 检查是否已经安装 - LOG_INFO "检查软件包 $PACKAGE_NAME 是否已安装" - if dnf list installed "$PACKAGE_NAME" &>/dev/null; then - LOG_INFO "软件包 $PACKAGE_NAME 已安装,测试结束后将保持安装状态" - ALREADY_INSTALLED=true - else - LOG_INFO "软件包 $PACKAGE_NAME 未安装,将在测试结束后卸载" - ALREADY_INSTALLED=false - fi - - # 如果未安装,则安装软件包作为测试步骤 - if [ "$ALREADY_INSTALLED" = false ]; then - LOG_INFO "安装软件包: $PACKAGE_NAME" - dnf install -y "$PACKAGE_NAME" - CHECK_RESULT $? 0 0 "安装软件包 $PACKAGE_NAME 失败" - fi - - # 执行卸载测试 - LOG_INFO "执行卸载测试: 卸载软件包 $PACKAGE_NAME" - dnf remove -y "$PACKAGE_NAME" - CHECK_RESULT $? 0 0 "卸载软件包 $PACKAGE_NAME 失败" - - # 验证卸载结果 - LOG_INFO "验证软件包 $PACKAGE_NAME 是否已卸载" - if dnf list installed "$PACKAGE_NAME" &>/dev/null; then - LOG_ERROR "软件包 $PACKAGE_NAME 卸载失败" - exit 1 - else - LOG_INFO "软件包 $PACKAGE_NAME 卸载成功" - fi - - # 环境恢复:如果之前未安装,则重新安装以恢复环境 - if [ "$ALREADY_INSTALLED" = false ]; then - LOG_INFO "恢复环境:重新安装软件包 $PACKAGE_NAME" - dnf install -y "$PACKAGE_NAME" - CHECK_RESULT $? 0 0 "恢复环境时安装软件包 $PACKAGE_NAME 失败" - else - LOG_INFO "环境恢复:软件包 $PACKAGE_NAME 保持安装状态" - fi - - LOG_INFO "测试完成: Test package uninstallation" -} - -main "$@" \ No newline at end of file From 2e0afab4997313db746ea68c637fadfb03212a94 Mon Sep 17 00:00:00 2001 From: honghua Date: Fri, 17 Apr 2026 12:44:58 +0800 Subject: [PATCH 16/16] update testcase for testsuite qt5-qdbusviewer --- .../pkg_test/qt5-qttools/qt5-qdbusviewer.json | 26 ------- .../test_qt5-qdbusviewer_function_dbuscall.sh | 69 ----------------- ...test_qt5-qdbusviewer_function_dbusintro.sh | 65 ---------------- .../test_qt5-qdbusviewer_function_dbuslist.sh | 60 --------------- .../test_qt5-qdbusviewer_function_dbusprop.sh | 71 ----------------- .../test_qt5-qdbusviewer_qdbusviewer-qt5.sh | 76 ------------------- 6 files changed, 367 deletions(-) delete mode 100644 suite2cases/function_test/pkg_test/qt5-qttools/qt5-qdbusviewer.json delete mode 100644 testcases/function_test/pkg_test/qt5-qttools/qt5-qdbusviewer/test_qt5-qdbusviewer_function_dbuscall.sh delete mode 100644 testcases/function_test/pkg_test/qt5-qttools/qt5-qdbusviewer/test_qt5-qdbusviewer_function_dbusintro.sh delete mode 100644 testcases/function_test/pkg_test/qt5-qttools/qt5-qdbusviewer/test_qt5-qdbusviewer_function_dbuslist.sh delete mode 100644 testcases/function_test/pkg_test/qt5-qttools/qt5-qdbusviewer/test_qt5-qdbusviewer_function_dbusprop.sh delete mode 100644 testcases/function_test/pkg_test/qt5-qttools/qt5-qdbusviewer/test_qt5-qdbusviewer_qdbusviewer-qt5.sh diff --git a/suite2cases/function_test/pkg_test/qt5-qttools/qt5-qdbusviewer.json b/suite2cases/function_test/pkg_test/qt5-qttools/qt5-qdbusviewer.json deleted file mode 100644 index f8d0e872701..00000000000 --- a/suite2cases/function_test/pkg_test/qt5-qttools/qt5-qdbusviewer.json +++ /dev/null @@ -1,26 +0,0 @@ -{ - "path": "$OET_PATH/testcases/function_test/pkg_test/qt5-qttools/qt5-qdbusviewer", - "machine num": 1, - "cases": [ - { - "name": "test_qt5-qdbusviewer_qdbusviewer-qt5", - "desc": "测试 qdbusviewer-qt5 命令的基本功能" - }, - { - "name": "test_qt5-qdbusviewer_function_dbuslist", - "desc": "测试列出DBus服务功能" - }, - { - "name": "test_qt5-qdbusviewer_function_dbusintro", - "desc": "测试DBus接口自省功能" - }, - { - "name": "test_qt5-qdbusviewer_function_dbuscall", - "desc": "测试DBus方法调用功能" - }, - { - "name": "test_qt5-qdbusviewer_function_dbusprop", - "desc": "测试DBus属性读写功能" - } - ] -} \ No newline at end of file diff --git a/testcases/function_test/pkg_test/qt5-qttools/qt5-qdbusviewer/test_qt5-qdbusviewer_function_dbuscall.sh b/testcases/function_test/pkg_test/qt5-qttools/qt5-qdbusviewer/test_qt5-qdbusviewer_function_dbuscall.sh deleted file mode 100644 index 2f66c7cf58f..00000000000 --- a/testcases/function_test/pkg_test/qt5-qttools/qt5-qdbusviewer/test_qt5-qdbusviewer_function_dbuscall.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-03 -# @License : Mulan PSL v2 -# @Desc : 测试DBus方法调用功能 -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - - # 检查qt5-qdbusviewer是否已安装 - LOG_INFO "检查qt5-qdbusviewer是否已安装" - if rpm -q qt5-qdbusviewer >/dev/null 2>&1; then - LOG_INFO "qt5-qdbusviewer已安装,脚本结束后将保持安装状态" - INSTALLED=true - else - LOG_INFO "qt5-qdbusviewer未安装,将在测试结束后卸载" - INSTALLED=false - fi - - # 检查yum源中是否有qt5-qdbusviewer软件包 - LOG_INFO "检查yum源中是否有qt5-qdbusviewer软件包" - if ! dnf list available qt5-qdbusviewer >/dev/null 2>&1; then - LOG_ERROR "yum源中未找到qt5-qdbusviewer软件包" - exit 255 - fi - - # 如果未安装,则安装qt5-qdbusviewer - if [ "$INSTALLED" = false ]; then - LOG_INFO "安装qt5-qdbusviewer" - dnf install -y qt5-qdbusviewer - CHECK_RESULT $? 0 0 "安装qt5-qdbusviewer失败" - fi - - # 测试DBus方法调用功能 - LOG_INFO "测试DBus方法调用功能" - qdbusviewer --help >/dev/null 2>&1 - CHECK_RESULT $? 0 0 "qdbusviewer命令不支持或参数错误" - - # 执行DBus方法调用测试命令(示例命令,实际需根据需求调整) - LOG_INFO "执行DBus方法调用测试" - qdbus org.freedesktop.DBus /org/freedesktop/DBus org.freedesktop.DBus.ListNames >/dev/null 2>&1 - CHECK_RESULT $? 0 0 "DBus方法调用失败" - - # 清理环境:如果脚本开始时未安装,则卸载qt5-qdbusviewer - if [ "$INSTALLED" = false ]; then - LOG_INFO "卸载qt5-qdbusviewer" - dnf remove -y qt5-qdbusviewer - CHECK_RESULT $? 0 0 "卸载qt5-qdbusviewer失败" - fi - - LOG_INFO "测试完成,环境已恢复" - -} - -main "$@" \ No newline at end of file diff --git a/testcases/function_test/pkg_test/qt5-qttools/qt5-qdbusviewer/test_qt5-qdbusviewer_function_dbusintro.sh b/testcases/function_test/pkg_test/qt5-qttools/qt5-qdbusviewer/test_qt5-qdbusviewer_function_dbusintro.sh deleted file mode 100644 index 2b26798739e..00000000000 --- a/testcases/function_test/pkg_test/qt5-qttools/qt5-qdbusviewer/test_qt5-qdbusviewer_function_dbusintro.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 : 测试DBus接口自省功能 -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - # 测试DBus接口自省功能 - - LOG_INFO "开始测试DBus接口自省功能" - - # 检查是否已安装qt5-qdbusviewer - if ! dnf list installed qt5-qdbusviewer &>/dev/null; then - LOG_INFO "qt5-qdbusviewer未安装,开始安装" - # 检查yum源中是否有qt5-qdbusviewer - if ! dnf list available qt5-qdbusviewer &>/dev/null; then - LOG_ERROR "yum源中未找到qt5-qdbusviewer软件包" - exit 255 - fi - # 安装qt5-qdbusviewer - dnf install -y qt5-qdbusviewer - CHECK_RESULT $? 0 0 "安装qt5-qdbusviewer失败" - else - LOG_INFO "qt5-qdbusviewer已安装,跳过安装步骤" - fi - - # 检查qdbusviewer命令是否存在 - if ! command -v qdbusviewer &>/dev/null; then - LOG_ERROR "qdbusviewer命令不存在" - exit 255 - fi - - # 测试DBus接口自省功能 - LOG_INFO "测试DBus接口自省功能" - qdbusviewer --introspect org.freedesktop.DBus /org/freedesktop/DBus - CHECK_RESULT $? 0 0 "DBus接口自省功能测试失败" - - # 清理环境 - if ! dnf list installed qt5-qdbusviewer &>/dev/null; then - LOG_INFO "清理环境:卸载qt5-qdbusviewer" - dnf remove -y qt5-qdbusviewer - CHECK_RESULT $? 0 0 "卸载qt5-qdbusviewer失败" - else - LOG_INFO "环境保持安装状态,无需清理" - fi - - LOG_INFO "测试DBus接口自省功能完成" -} - -main "$@" \ No newline at end of file diff --git a/testcases/function_test/pkg_test/qt5-qttools/qt5-qdbusviewer/test_qt5-qdbusviewer_function_dbuslist.sh b/testcases/function_test/pkg_test/qt5-qttools/qt5-qdbusviewer/test_qt5-qdbusviewer_function_dbuslist.sh deleted file mode 100644 index 841e94023aa..00000000000 --- a/testcases/function_test/pkg_test/qt5-qttools/qt5-qdbusviewer/test_qt5-qdbusviewer_function_dbuslist.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-03 -# @License : Mulan PSL v2 -# @Desc : 测试列出DBus服务功能 -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - # 测试脚本:test_qt5-qdbusviewer_function_dbuslist - - # 步骤1:检查是否已安装qt5-qdbusviewer - LOG_INFO "检查是否已安装qt5-qdbusviewer" - if ! dnf list installed qt5-qdbusviewer &>/dev/null; then - LOG_INFO "qt5-qdbusviewer未安装,准备安装" - # 步骤2:检查yum源中是否有qt5-qdbusviewer - LOG_INFO "检查yum源中是否有qt5-qdbusviewer" - if ! dnf list available qt5-qdbusviewer &>/dev/null; then - LOG_ERROR "yum源中未找到qt5-qdbusviewer软件包" - exit 255 - fi - # 步骤3:安装qt5-qdbusviewer - LOG_INFO "安装qt5-qdbusviewer" - dnf install -y qt5-qdbusviewer - CHECK_RESULT $? 0 0 "安装qt5-qdbusviewer失败" - # 标记为需要卸载 - NEED_UNINSTALL=1 - else - LOG_INFO "qt5-qdbusviewer已安装,无需重复安装" - fi - - # 步骤4:测试列出DBus服务功能 - LOG_INFO "测试列出DBus服务功能" - qdbusviewer --list-services &>/dev/null - CHECK_RESULT $? 0 0 "列出DBus服务功能失败" - - # 步骤5:清理环境(如果之前未安装) - if [[ $NEED_UNINSTALL -eq 1 ]]; then - LOG_INFO "卸载qt5-qdbusviewer" - dnf remove -y qt5-qdbusviewer - CHECK_RESULT $? 0 0 "卸载qt5-qdbusviewer失败" - fi - - LOG_INFO "测试脚本执行完成" -} - -main "$@" \ No newline at end of file diff --git a/testcases/function_test/pkg_test/qt5-qttools/qt5-qdbusviewer/test_qt5-qdbusviewer_function_dbusprop.sh b/testcases/function_test/pkg_test/qt5-qttools/qt5-qdbusviewer/test_qt5-qdbusviewer_function_dbusprop.sh deleted file mode 100644 index 9fef86ed6ea..00000000000 --- a/testcases/function_test/pkg_test/qt5-qttools/qt5-qdbusviewer/test_qt5-qdbusviewer_function_dbusprop.sh +++ /dev/null @@ -1,71 +0,0 @@ -#!/usr/bin/bash - -# Copyright (c) 2024 ISCAS .ALL rights reserved. -# This program is licensed under Mulan PSL v2. -# You can use it according to the terms and conditions of the Mulan PSL v2. -# http://license.coscl.org.cn/MulanPSL2 -# THIS PROGRAM IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, -# EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, -# MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. -# See the Mulan PSL v2 for more details. - -# ############################################# -# @Author : honghua -# @Contact : honghua@iscas.ac.cn -# @Date : 2025-12-03 -# @License : Mulan PSL v2 -# @Desc : 测试DBus属性读写功能 -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - - # 检查yum源中是否存在qt5-qdbusviewer软件包 - LOG_INFO "检查yum源中是否存在qt5-qdbusviewer软件包" - dnf list available qt5-qdbusviewer &>/dev/null - if [ $? -ne 0 ]; then - LOG_ERROR "yum源中未找到qt5-qdbusviewer软件包" - exit 255 - fi - - # 检查是否已安装qt5-qdbusviewer - LOG_INFO "检查是否已安装qt5-qdbusviewer" - rpm -q qt5-qdbusviewer &>/dev/null - if [ $? -eq 0 ]; then - installed=true - LOG_INFO "qt5-qdbusviewer已安装,脚本结束后将保持安装状态" - else - installed=false - LOG_INFO "qt5-qdbusviewer未安装,将在测试完成后卸载" - fi - - # 若未安装,则安装qt5-qdbusviewer - if ! $installed; then - LOG_INFO "正在安装qt5-qdbusviewer" - dnf install -y qt5-qdbusviewer &>/dev/null - CHECK_RESULT $? 0 0 "安装qt5-qdbusviewer失败" - fi - - # 测试DBus属性读写功能 - LOG_INFO "测试DBus属性读写功能" - qdbusviewer --help &>/dev/null - CHECK_RESULT $? 0 0 "qdbusviewer命令不支持或参数错误" - - # 执行DBus属性读写测试(示例命令,具体根据实际需求调整) - LOG_INFO "执行DBus属性读写测试" - qdbusviewer --test-property &>/dev/null - CHECK_RESULT $? 0 0 "DBus属性读写测试失败" - - # 清理环境 - if ! $installed; then - LOG_INFO "正在卸载qt5-qdbusviewer" - dnf remove -y qt5-qdbusviewer &>/dev/null - CHECK_RESULT $? 0 0 "卸载qt5-qdbusviewer失败" - fi - - LOG_INFO "测试完成,环境已恢复" - -} - -main "$@" \ No newline at end of file diff --git a/testcases/function_test/pkg_test/qt5-qttools/qt5-qdbusviewer/test_qt5-qdbusviewer_qdbusviewer-qt5.sh b/testcases/function_test/pkg_test/qt5-qttools/qt5-qdbusviewer/test_qt5-qdbusviewer_qdbusviewer-qt5.sh deleted file mode 100644 index c992099bad1..00000000000 --- a/testcases/function_test/pkg_test/qt5-qttools/qt5-qdbusviewer/test_qt5-qdbusviewer_qdbusviewer-qt5.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-03 -# @License : Mulan PSL v2 -# @Desc : 测试 qdbusviewer-qt5 命令的基本功能 -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - LOG_INFO "开始测试 qdbusviewer-qt5 命令的基本功能" - - # 检查软件包是否已安装 - LOG_INFO "检查 qdbusviewer-qt5 是否已安装" - if ! rpm -q qt5-qdbusviewer &>/dev/null; then - LOG_INFO "qdbusviewer-qt5 未安装,准备安装" - # 检查 yum 源中是否有该软件包 - LOG_INFO "检查 yum 源中是否有 qt5-qdbusviewer" - if ! dnf list available qt5-qdbusviewer &>/dev/null; then - LOG_ERROR "yum 源中没有 qt5-qdbusviewer 软件包" - exit 255 - fi - # 安装软件包 - LOG_INFO "安装 qt5-qdbusviewer" - dnf install -y qt5-qdbusviewer - CHECK_RESULT $? 0 0 "安装 qt5-qdbusviewer 失败" - # 标记需要卸载 - NEED_UNINSTALL=1 - else - LOG_INFO "qdbusviewer-qt5 已安装" - fi - - # 测试 qdbusviewer-qt5 命令基本功能 - LOG_INFO "测试 qdbusviewer-qt5 --help" - qdbusviewer-qt5 --help &>/dev/null - CHECK_RESULT $? 0 0 "qdbusviewer-qt5 --help 执行失败" - - LOG_INFO "测试 qdbusviewer-qt5 --version" - qdbusviewer-qt5 --version &>/dev/null - CHECK_RESULT $? 0 0 "qdbusviewer-qt5 --version 执行失败" - - # 测试不支持的参数 - LOG_INFO "测试不支持的参数" - qdbusviewer-qt5 --invalid-arg &>/dev/null - if [ $? -ne 255 ]; then - LOG_ERROR "不支持的参数未返回退出码 255" - exit 255 - fi - - # SSH_CMD示例(如果需要) - # LOG_INFO "在第二个节点上执行命令" - # SSH_CMD ls $NODE2_IPV4 $NODE2_PASSWORD $NODE2_USER - - # 清理环境(如果之前安装了软件包) - if [ "$NEED_UNINSTALL" == "1" ]; then - LOG_INFO "卸载 qt5-qdbusviewer" - dnf remove -y qt5-qdbusviewer - CHECK_RESULT $? 0 0 "卸载 qt5-qdbusviewer失败" - fi - - LOG_INFO "测试 qtdbusviewer-qt5命令基本功能完成" -} - -main "$@" \ No newline at end of file