From 16d122b1fafa6b9ca542cc3e8f5748dc143ff10b Mon Sep 17 00:00:00 2001 From: honghua Date: Thu, 16 Apr 2026 23:02:17 +0800 Subject: [PATCH 01/13] update testcase for testsuite proxytoys-parent --- .../pkg_test/proxytoys/proxytoys-parent.json | 30 ------ ...t_proxytoys-parent_function_basic_usage.sh | 74 ------------- .../test_proxytoys-parent_function_config.sh | 75 ------------- .../test_proxytoys-parent_function_help.sh | 84 --------------- .../test_proxytoys-parent_function_install.sh | 64 ----------- ...est_proxytoys-parent_function_uninstall.sh | 100 ------------------ .../test_proxytoys-parent_function_version.sh | 70 ------------ 7 files changed, 497 deletions(-) delete mode 100644 suite2cases/function_test/pkg_test/proxytoys/proxytoys-parent.json delete mode 100644 testcases/function_test/pkg_test/proxytoys/proxytoys-parent/test_proxytoys-parent_function_basic_usage.sh delete mode 100644 testcases/function_test/pkg_test/proxytoys/proxytoys-parent/test_proxytoys-parent_function_config.sh delete mode 100644 testcases/function_test/pkg_test/proxytoys/proxytoys-parent/test_proxytoys-parent_function_help.sh delete mode 100644 testcases/function_test/pkg_test/proxytoys/proxytoys-parent/test_proxytoys-parent_function_install.sh delete mode 100644 testcases/function_test/pkg_test/proxytoys/proxytoys-parent/test_proxytoys-parent_function_uninstall.sh delete mode 100644 testcases/function_test/pkg_test/proxytoys/proxytoys-parent/test_proxytoys-parent_function_version.sh diff --git a/suite2cases/function_test/pkg_test/proxytoys/proxytoys-parent.json b/suite2cases/function_test/pkg_test/proxytoys/proxytoys-parent.json deleted file mode 100644 index 40ac5f2e354..00000000000 --- a/suite2cases/function_test/pkg_test/proxytoys/proxytoys-parent.json +++ /dev/null @@ -1,30 +0,0 @@ -{ - "path": "$OET_PATH/testcases/function_test/pkg_test/proxytoys/proxytoys-parent", - "machine num": 1, - "cases": [ - { - "name": "test_proxytoys-parent_function_install", - "desc": "Test the installation of proxytoys-parent package" - }, - { - "name": "test_proxytoys-parent_function_config", - "desc": "Test the configuration of proxytoys-parent package" - }, - { - "name": "test_proxytoys-parent_function_uninstall", - "desc": "Test the uninstallation of proxytoys-parent package" - }, - { - "name": "test_proxytoys-parent_function_version", - "desc": "Test checking the version of proxytoys-parent package" - }, - { - "name": "test_proxytoys-parent_function_help", - "desc": "Test the help or usage information of proxytoys-parent" - }, - { - "name": "test_proxytoys-parent_function_basic_usage", - "desc": "Test the basic usage of proxytoys-parent package" - } - ] -} \ No newline at end of file diff --git a/testcases/function_test/pkg_test/proxytoys/proxytoys-parent/test_proxytoys-parent_function_basic_usage.sh b/testcases/function_test/pkg_test/proxytoys/proxytoys-parent/test_proxytoys-parent_function_basic_usage.sh deleted file mode 100644 index fef1b324ae3..00000000000 --- a/testcases/function_test/pkg_test/proxytoys/proxytoys-parent/test_proxytoys-parent_function_basic_usage.sh +++ /dev/null @@ -1,74 +0,0 @@ -#!/usr/bin/bash - -# Copyright (c) 2024 ISCAS .ALL rights reserved. -# This program is licensed under Mulan PSL v2. -# You can use it according to the terms and conditions of the Mulan PSL v2. -# http://license.coscl.org.cn/MulanPSL2 -# THIS PROGRAM IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, -# EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, -# MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. -# See the Mulan PSL v2 for more details. - -# ############################################# -# @Author : honghua -# @Contact : honghua@iscas.ac.cn -# @Date : 2026-02-27 -# @License : Mulan PSL v2 -# @Desc : Test the basic usage of proxytoys-parent package -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - LOG_INFO "开始测试proxytoys-parent软件包的基本使用" - LOG_INFO "检查环境是否已安装proxytoys-parent软件包" - if rpm -q proxytoys-parent &>/dev/null; then - LOG_INFO "proxytoys-parent已安装,将保持安装状态" - INSTALLED=true - else - LOG_INFO "proxytoys-parent未安装,将在测试中安装" - INSTALLED=false - fi - LOG_INFO "检查yum源中是否有proxytoys-parent软件包" - if ! dnf list available proxytoys-parent &>/dev/null; then - LOG_ERROR "yum源中未找到proxytoys-parent软件包" - exit 255 - fi - if [ "$INSTALLED" = "false" ]; then - LOG_INFO "安装proxytoys-parent软件包" - dnf install -y proxytoys-parent - CHECK_RESULT $? 0 0 "安装proxytoys-parent失败" - fi - LOG_INFO "测试proxytoys-parent的基本命令功能" - proxytoys-parent --help - CHECK_RESULT $? 0 0 "proxytoys-parent --help命令执行失败" - LOG_INFO "验证proxytoys-parent版本信息" - proxytoys-parent --version - CHECK_RESULT $? 0 0 "proxytoys-parent --version命令执行失败" - LOG_INFO "检查proxytoys-parent的配置文件" - if [ -f /etc/proxytoys-parent.conf ]; then - LOG_INFO "配置文件存在,检查其内容" - cat /etc/proxytoys-parent.conf | grep -q "example" - CHECK_RESULT $? 0 0 "配置文件中未找到example配置项" - else - LOG_INFO "配置文件不存在,跳过配置检查" - fi - LOG_INFO "测试proxytoys-parent服务状态" - systemctl status proxytoys-parent --no-pager - CHECK_RESULT $? 0 0 "proxytoys-parent服务状态检查失败" - LOG_INFO "执行proxytoys-parent示例命令" - proxytoys-parent example-command - CHECK_RESULT $? 0 0 "proxytoys-parent示例命令执行失败" - if [ "$INSTALLED" = "false" ]; then - LOG_INFO "卸载proxytoys-parent软件包" - dnf remove -y proxytoys-parent - CHECK_RESULT $? 0 0 "卸载proxytoys-parent失败" - LOG_INFO "清理proxytoys-parent残留配置文件" - rm -f /etc/proxytoys-parent.conf - else - LOG_INFO "保持proxytoys-parent安装状态" - fi - LOG_INFO "测试完成,环境已恢复" -} - -main "$@" \ No newline at end of file diff --git a/testcases/function_test/pkg_test/proxytoys/proxytoys-parent/test_proxytoys-parent_function_config.sh b/testcases/function_test/pkg_test/proxytoys/proxytoys-parent/test_proxytoys-parent_function_config.sh deleted file mode 100644 index 15c4543a208..00000000000 --- a/testcases/function_test/pkg_test/proxytoys/proxytoys-parent/test_proxytoys-parent_function_config.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-12-08 -# @License : Mulan PSL v2 -# @Desc : Test the configuration of proxytoys-parent package -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - LOG_INFO "开始测试proxytoys-parent包的配置" - - # 检查是否已安装proxytoys-parent包 - LOG_INFO "检查proxytoys-parent包是否已安装" - if dnf list installed | grep -q "proxytoys-parent"; then - LOG_INFO "proxytoys-parent包已安装,测试结束后将保持安装状态" - installed=true - else - LOG_INFO "proxytoys-parent包未安装,测试结束后将卸载" - installed=false - fi - - # 检查yum源中是否存在proxytoys-parent包 - LOG_INFO "检查yum源中是否存在proxytoys-parent包" - if ! dnf list available | grep -q "proxytoys-parent"; then - LOG_ERROR "yum源中未找到proxytoys-parent包" - exit 255 - fi - - # 安装proxytoys-parent包 - if [ "$installed" = false ]; then - LOG_INFO "正在安装proxytoys-parent包" - dnf install -y proxytoys-parent - CHECK_RESULT $? 0 0 "安装proxytoys-parent包失败" - fi - - # 测试配置功能 - LOG_INFO "测试proxytoys-parent包的配置功能" - # 假设有一个配置命令需要测试,这里用占位符代替 - config_command="proxytoy-config --check" - $config_command > /dev/null 2>&1 - CHECK_RESULT $? 0 0 "执行配置命令失败" - - # 检查参数是否存在或不支持 - LOG_INFO "检查不支持的参数" - invalid_command="proxytoy-config --invalid-param" - $invalid_command > /dev/null 2>&1 - if [ $? -ne 255 ]; then - LOG_ERROR "不支持的参数未正确退出" - exit 255 - fi - - # 清理环境:如果之前未安装则卸载 - if [ "$installed" = false ]; then - LOG_INFO "卸载proxytoys-parent包" - dnf remove -y proxytoys-parent - CHECK_RESULT $? 0 0 "卸载proxytoys-parent包失败" - fi - - LOG_INFO "proxytoys-parent包配置测试完成" -} - -main "$@" \ No newline at end of file diff --git a/testcases/function_test/pkg_test/proxytoys/proxytoys-parent/test_proxytoys-parent_function_help.sh b/testcases/function_test/pkg_test/proxytoys/proxytoys-parent/test_proxytoys-parent_function_help.sh deleted file mode 100644 index 9b9510611d5..00000000000 --- a/testcases/function_test/pkg_test/proxytoys/proxytoys-parent/test_proxytoys-parent_function_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 : 2026-02-27 -# @License : Mulan PSL v2 -# @Desc : Test the help or usage information of proxytoys-parent -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - LOG_INFO "开始测试proxytoys-parent的帮助信息" - LOG_INFO "检查proxytoys-parent软件包是否在yum源中" - dnf list available proxytoys-parent 2>/dev/null | grep -q proxytoys-parent - if [ $? -ne 0 ]; then - LOG_ERROR "yum源中未找到proxytoys-parent软件包" - exit 255 - fi - - LOG_INFO "检查是否已安装proxytoys-parent" - rpm -q proxytoys-parent >/dev/null 2>&1 - INSTALLED=$? - if [ $INSTALLED -eq 0 ]; then - LOG_INFO "proxytoys-parent已安装,测试完成后将保持安装状态" - NEED_UNINSTALL=0 - else - LOG_INFO "proxytoys-parent未安装,将进行安装" - NEED_UNINSTALL=1 - LOG_INFO "安装proxytoys-parent软件包" - dnf install -y proxytoys-parent - CHECK_RESULT $? 0 0 "安装proxytoys-parent失败" - fi - - LOG_INFO "测试proxytoys-parent的帮助信息" - proxytoys-parent --help >/dev/null 2>&1 - if [ $? -eq 255 ]; then - LOG_ERROR "proxytoys-parent不支持--help参数" - if [ $NEED_UNINSTALL -eq 1 ]; then - LOG_INFO "清理环境,卸载proxytoys-parent" - dnf remove -y proxytoys-parent - fi - exit 255 - fi - - LOG_INFO "检查proxytoys-parent --help命令执行结果" - proxytoys-parent --help | grep -q "Usage:" 2>/dev/null - CHECK_RESULT $? 0 0 "proxytoys-parent --help未显示正确的帮助信息" - - LOG_INFO "测试proxytoys-parent的usage信息" - proxytoys-parent -h >/dev/null 2>&1 - if [ $? -eq 255 ]; then - LOG_ERROR "proxytoys-parent不支持-h参数" - if [ $NEED_UNINSTALL -eq 1 ]; then - LOG_INFO "清理环境,卸载proxytoys-parent" - dnf remove -y proxytoys-parent - fi - exit 255 - fi - - LOG_INFO "检查proxytoys-parent -h命令执行结果" - proxytoys-parent -h | grep -q "Usage:" 2>/dev/null - CHECK_RESULT $? 0 0 "proxytoys-parent -h未显示正确的帮助信息" - - if [ $NEED_UNINSTALL -eq 1 ]; then - LOG_INFO "清理环境,卸载proxytoys-parent" - dnf remove -y proxytoys-parent - CHECK_RESULT $? 0 0 "卸载proxytoys-parent失败" - fi - - LOG_INFO "测试完成,环境已恢复" -} - -main "$@" \ No newline at end of file diff --git a/testcases/function_test/pkg_test/proxytoys/proxytoys-parent/test_proxytoys-parent_function_install.sh b/testcases/function_test/pkg_test/proxytoys/proxytoys-parent/test_proxytoys-parent_function_install.sh deleted file mode 100644 index cd1fdcd6e15..00000000000 --- a/testcases/function_test/pkg_test/proxytoys/proxytoys-parent/test_proxytoys-parent_function_install.sh +++ /dev/null @@ -1,64 +0,0 @@ -#!/usr/bin/bash - -# Copyright (c) 2024 ISCAS .ALL rights reserved. -# This program is licensed under Mulan PSL v2. -# You can use it according to the terms and conditions of the Mulan PSL v2. -# http://license.coscl.org.cn/MulanPSL2 -# THIS PROGRAM IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, -# EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, -# MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. -# See the Mulan PSL v2 for more details. - -# ############################################# -# @Author : honghua -# @Contact : honghua@iscas.ac.cn -# @Date : 2025-10-21 -# @License : Mulan PSL v2 -# @Desc : Test the installation of proxytoys-parent package -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - # 检查是否已安装proxytoys-parent软件包 - LOG_INFO "检查是否已安装proxytoys-parent软件包" - rpm -q proxytoys-parent > /dev/null 2>&1 - if [ $? -eq 0 ]; then - LOG_INFO "proxytoys-parent已安装,脚本结束时将保持安装状态" - INSTALLED=true - else - LOG_INFO "proxytoys-parent未安装,将在测试后卸载" - INSTALLED=false - fi - - # 检查yum源中是否有proxytoys-parent软件包 - LOG_INFO "检查yum源中是否有proxytoys-parent软件包" - dnf list available proxytoys-parent > /dev/null 2>&1 - CHECK_RESULT $? 0 255 "yum源中未找到proxytoys-parent软件包" - - # 安装proxytoys-parent软件包 - LOG_INFO "安装proxytoys-parent软件包" - dnf install -y proxytoys-parent > /dev/null 2>&1 - CHECK_RESULT $? 0 0 "安装proxytoys-parent软件包失败" - - # 验证安装是否成功 - LOG_INFO "验证proxytoys-parent是否安装成功" - rpm -q proxytoys-parent > /dev/null 2>&1 - CHECK_RESULT $? 0 0 "proxytoys-parent安装验证失败" - - # 执行proxytoys-parent相关命令测试功能(假设命令为proxytest) - LOG_INFO "执行proxytoys-parent功能测试" - proxytest --help > /dev/null 2>&1 - CHECK_RESULT $? 0 255 "proxytest命令参数不支持或不存在" - - # 清理环境:如果初始未安装则卸载软件包 - if [ "$INSTALLED" = false ]; then - LOG_INFO "清理环境:卸载proxytoys-parent软件包" - dnf remove -y proxytoys-parent > /dev/null 2>&1 - CHECK_RESULT $? 0 0 "卸载proxytoys-parent软件包失败" - fi - - LOG_INFO "测试完成,环境已恢复" -} - -main "$@" \ No newline at end of file diff --git a/testcases/function_test/pkg_test/proxytoys/proxytoys-parent/test_proxytoys-parent_function_uninstall.sh b/testcases/function_test/pkg_test/proxytoys/proxytoys-parent/test_proxytoys-parent_function_uninstall.sh deleted file mode 100644 index efcd84cf1f4..00000000000 --- a/testcases/function_test/pkg_test/proxytoys/proxytoys-parent/test_proxytoys-parent_function_uninstall.sh +++ /dev/null @@ -1,100 +0,0 @@ -#!/usr/bin/bash - -# Copyright (c) 2024 ISCAS .ALL rights reserved. -# This program is licensed under Mulan PSL v2. -# You can use it according to the terms and conditions of the Mulan PSL v2. -# http://license.coscl.org.cn/MulanPSL2 -# THIS PROGRAM IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, -# EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, -# MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. -# See the Mulan PSL v2 for more details. - -# ############################################# -# @Author : honghua -# @Contact : honghua@iscas.ac.cn -# @Date : 2026-02-26 -# @License : Mulan PSL v2 -# @Desc : Test the uninstallation of proxytoys-parent package -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - # 判断是否已经安装proxytoys-parent软件包 - LOG_INFO "检查proxytoys-parent软件包是否已安装" - rpm -q proxytoys-parent > /dev/null 2>&1 - if [ $? -eq 0 ]; then - LOG_INFO "proxytoys-parent软件包已安装,测试结束后将保持安装状态" - ALREADY_INSTALLED=1 - else - LOG_INFO "proxytoys-parent软件包未安装,将在测试前安装" - ALREADY_INSTALLED=0 - fi - - # 检查yum源中是否有proxytoys-parent软件包 - LOG_INFO "检查yum源中是否存在proxytoys-parent软件包" - dnf list available proxytoys-parent > /dev/null 2>&1 - CHECK_RESULT $? 0 0 "yum源中不存在proxytoys-parent软件包" - if [ $? -ne 0 ]; then - LOG_ERROR "yum源中不存在proxytoys-parent软件包" - exit 255 - fi - - # 如果未安装,则安装软件包 - if [ $ALREADY_INSTALLED -eq 0 ]; then - LOG_INFO "开始安装proxytoys-parent软件包" - dnf install -y proxytoys-parent - CHECK_RESULT $? 0 0 "安装proxytoys-parent软件包失败" - if [ $? -ne 0 ]; then - LOG_ERROR "安装proxytoys-parent软件包失败" - exit 1 - fi - LOG_INFO "proxytoys-parent软件包安装成功" - fi - - # 验证软件包已安装 - LOG_INFO "验证proxytoys-parent软件包已正确安装" - rpm -q proxytoys-parent > /dev/null 2>&1 - CHECK_RESULT $? 0 0 "proxytoys-parent软件包未正确安装" - if [ $? -ne 0 ]; then - LOG_ERROR "proxytoys-parent软件包未正确安装" - exit 1 - fi - LOG_INFO "proxytoys-parent软件包已正确安装" - - # 测试卸载proxytoys-parent软件包 - LOG_INFO "开始测试卸载proxytoys-parent软件包" - dnf remove -y proxytoys-parent - CHECK_RESULT $? 0 0 "卸载proxytoys-parent软件包失败" - if [ $? -ne 0 ]; then - LOG_ERROR "卸载proxytoys-parent软件包失败" - exit 1 - fi - LOG_INFO "proxytoys-parent软件包卸载成功" - - # 验证软件包已卸载 - LOG_INFO "验证proxytoys-parent软件包已正确卸载" - rpm -q proxytoys-parent > /dev/null 2>&1 - CHECK_RESULT $? 1 0 "proxytoys-parent软件包未正确卸载" - if [ $? -ne 0 ]; then - LOG_ERROR "proxytoys-parent软件包未正确卸载" - exit 1 - fi - LOG_INFO "proxytoys-parent软件包已正确卸载" - - # 环境恢复:如果最初未安装,则保持未安装状态;如果最初已安装,则重新安装 - if [ $ALREADY_INSTALLED -eq 1 ]; then - LOG_INFO "恢复环境:重新安装proxytoys-parent软件包" - dnf install -y proxytoys-parent - CHECK_RESULT $? 0 0 "重新安装proxytoys-parent软件包失败" - if [ $? -ne 0 ]; then - LOG_ERROR "重新安装proxytoys-parent软件包失败" - exit 1 - fi - LOG_INFO "proxytoys-parent软件包重新安装成功" - fi - - LOG_INFO "proxytoys-parent软件包卸载测试完成" -} - -main "$@" \ No newline at end of file diff --git a/testcases/function_test/pkg_test/proxytoys/proxytoys-parent/test_proxytoys-parent_function_version.sh b/testcases/function_test/pkg_test/proxytoys/proxytoys-parent/test_proxytoys-parent_function_version.sh deleted file mode 100644 index 418e00843ad..00000000000 --- a/testcases/function_test/pkg_test/proxytoys/proxytoys-parent/test_proxytoys-parent_function_version.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-27 -# @License : Mulan PSL v2 -# @Desc : Test checking the version of proxytoys-parent package -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - pkg_name="proxytoys-parent" - version_cmd="--version" - - LOG_INFO "1. 检查软件包是否存在于yum源中" - dnf list available "$pkg_name" &> /dev/null - if [ $? -ne 0 ]; then - LOG_ERROR "yum源中未找到软件包: $pkg_name" - exit 255 - fi - - LOG_INFO "2. 检查当前环境中是否已安装该软件包" - dnf list installed "$pkg_name" &> /dev/null - already_installed=$? - - if [ $already_installed -ne 0 ]; then - LOG_INFO "3. 软件包未安装,开始安装" - dnf install -y "$pkg_name" - CHECK_RESULT $? 0 0 "安装软件包失败" - need_cleanup=1 - else - LOG_INFO "3. 软件包已安装,跳过安装步骤" - need_cleanup=0 - fi - - LOG_INFO "4. 检查指定命令参数是否存在或不支持" - which "$pkg_name" &> /dev/null - if [ $? -ne 0 ]; then - LOG_ERROR "命令 $pkg_name 不存在" - exit 255 - fi - - LOG_INFO "5. 执行命令检查版本" - "$pkg_name" "$version_cmd" - CHECK_RESULT $? 0 0 "执行版本命令失败" - - LOG_INFO "6. 清理环境" - if [ $need_cleanup -eq 1 ]; then - LOG_INFO "6.1 卸载之前安装的软件包" - dnf remove -y "$pkg_name" - CHECK_RESULT $? 0 0 "卸载软件包失败" - else - LOG_INFO "6.1 软件包为预安装状态,无需卸载" - fi - - LOG_INFO "测试完成" -} - -main "$@" \ No newline at end of file From b67c0fa74a67b2f0db45b1980036296b427f8279 Mon Sep 17 00:00:00 2001 From: honghua Date: Thu, 16 Apr 2026 23:05:29 +0800 Subject: [PATCH 02/13] update testcase for testsuite texlive-gender-doc --- .../texlive-split-j/texlive-gender-doc.json | 30 ---- .../test_texlive-gender-doc_function_basic.sh | 70 -------- .../test_texlive-gender-doc_function_check.sh | 119 -------------- ...st_texlive-gender-doc_function_doc_read.sh | 155 ------------------ ...est_texlive-gender-doc_function_install.sh | 80 --------- ...test_texlive-gender-doc_function_remove.sh | 79 --------- ...est_texlive-gender-doc_function_version.sh | 78 --------- 7 files changed, 611 deletions(-) delete mode 100644 suite2cases/function_test/pkg_test/texlive-split-j/texlive-gender-doc.json delete mode 100644 testcases/function_test/pkg_test/texlive-split-j/texlive-gender-doc/test_texlive-gender-doc_function_basic.sh delete mode 100644 testcases/function_test/pkg_test/texlive-split-j/texlive-gender-doc/test_texlive-gender-doc_function_check.sh delete mode 100644 testcases/function_test/pkg_test/texlive-split-j/texlive-gender-doc/test_texlive-gender-doc_function_doc_read.sh delete mode 100644 testcases/function_test/pkg_test/texlive-split-j/texlive-gender-doc/test_texlive-gender-doc_function_install.sh delete mode 100644 testcases/function_test/pkg_test/texlive-split-j/texlive-gender-doc/test_texlive-gender-doc_function_remove.sh delete mode 100644 testcases/function_test/pkg_test/texlive-split-j/texlive-gender-doc/test_texlive-gender-doc_function_version.sh diff --git a/suite2cases/function_test/pkg_test/texlive-split-j/texlive-gender-doc.json b/suite2cases/function_test/pkg_test/texlive-split-j/texlive-gender-doc.json deleted file mode 100644 index 5d59521c51a..00000000000 --- a/suite2cases/function_test/pkg_test/texlive-split-j/texlive-gender-doc.json +++ /dev/null @@ -1,30 +0,0 @@ -{ - "path": "$OET_PATH/testcases/function_test/pkg_test/texlive-split-j/texlive-gender-doc", - "machine num": 1, - "cases": [ - { - "name": "test_texlive-gender-doc_function_basic", - "desc": "Verify basic functionality of texlive-gender-doc" - }, - { - "name": "test_texlive-gender-doc_function_install", - "desc": "Verify the texlive-gender-doc package can be installed successfully." - }, - { - "name": "test_texlive-gender-doc_function_remove", - "desc": "Verify the texlive-gender-doc package can be cleanly uninstalled." - }, - { - "name": "test_texlive-gender-doc_function_check", - "desc": "Verify the texlive-gender-doc package is correctly installed and available." - }, - { - "name": "test_texlive-gender-doc_function_doc_read", - "desc": "Verify the documentation files of texlive-gender-doc are accessible and readable." - }, - { - "name": "test_texlive-gender-doc_function_version", - "desc": "Verify the version information of the installed texlive-gender-doc package." - } - ] -} \ No newline at end of file diff --git a/testcases/function_test/pkg_test/texlive-split-j/texlive-gender-doc/test_texlive-gender-doc_function_basic.sh b/testcases/function_test/pkg_test/texlive-split-j/texlive-gender-doc/test_texlive-gender-doc_function_basic.sh deleted file mode 100644 index 634ee435b5f..00000000000 --- a/testcases/function_test/pkg_test/texlive-split-j/texlive-gender-doc/test_texlive-gender-doc_function_basic.sh +++ /dev/null @@ -1,70 +0,0 @@ -#!/usr/bin/bash - -# Copyright (c) 2024 ISCAS .ALL rights reserved. -# This program is licensed under Mulan PSL v2. -# You can use it according to the terms and conditions of the Mulan PSL v2. -# http://license.coscl.org.cn/MulanPSL2 -# THIS PROGRAM IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, -# EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, -# MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. -# See the Mulan PSL v2 for more details. - -# ############################################# -# @Author : honghua -# @Contact : honghua@iscas.ac.cn -# @Date : 2025-11-26 -# @License : Mulan PSL v2 -# @Desc : Verify basic functionality of texlive-gender-doc -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - LOG_INFO "开始测试:验证 texlive-gender-doc 的基本功能" - - # 检查环境是否已安装 texlive-gender-doc - LOG_INFO "检查 texlive-gender-doc 是否已安装" - if dnf list installed texlive-gender-doc &>/dev/null; then - LOG_INFO "texlive-gender-doc 已安装,测试结束后将保持安装状态" - INSTALLED=true - else - LOG_INFO "texlive-gender-doc 未安装,测试结束后将卸载" - INSTALLED=false - fi - - # 检查 yum 源中是否有 texlive-gender-doc - LOG_INFO "检查 yum 源中是否有 texlive-gender-doc" - if ! dnf list available texlive-gender-doc &>/dev/null; then - LOG_ERROR "yum 源中未找到 texlive-gender-doc" - exit 255 - fi - - # 如果未安装,则安装 texlive-gender-doc - if [ "$INSTALLED" = false ]; then - LOG_INFO "开始安装 texlive-gender-doc" - dnf install -y texlive-gender-doc - CHECK_RESULT $? 0 0 "安装 texlive-gender-doc 失败" - fi - - # 验证基本功能 - LOG_INFO "验证 texlive-gender-doc 的基本功能" - # 假设 texlive-gender-doc 提供了一个命令 genderdoc-test,这里模拟测试其是否存在并运行 - if ! command -v genderdoc-test &>/dev/null; then - LOG_ERROR "命令 genderdoc-test 不存在或不支持" - exit 255 - fi - - genderdoc-test --version - CHECK_RESULT $? 0 0 "运行 genderdoc-test --version 失败" - - # 清理环境:如果测试前未安装,则卸载 texlive-gender-doc - if [ "$INSTALLED" = false ]; then - LOG_INFO "卸载 texlive-gender-doc" - dnf remove -y texlive-gender-doc - CHECK_RESULT $? 0 0 "卸载 texlive-gender-doc 失败" - fi - - LOG_INFO "测试完成:texlive-gender-doc 的基本功能验证通过" -} - -main "$@" \ No newline at end of file diff --git a/testcases/function_test/pkg_test/texlive-split-j/texlive-gender-doc/test_texlive-gender-doc_function_check.sh b/testcases/function_test/pkg_test/texlive-split-j/texlive-gender-doc/test_texlive-gender-doc_function_check.sh deleted file mode 100644 index 0d7769ecb83..00000000000 --- a/testcases/function_test/pkg_test/texlive-split-j/texlive-gender-doc/test_texlive-gender-doc_function_check.sh +++ /dev/null @@ -1,119 +0,0 @@ -#!/usr/bin/bash - -# Copyright (c) 2024 ISCAS .ALL rights reserved. -# This program is licensed under Mulan PSL v2. -# You can use it according to the terms and conditions of the Mulan PSL v2. -# http://license.coscl.org.cn/MulanPSL2 -# THIS PROGRAM IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, -# EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, -# MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. -# See the Mulan PSL v2 for more details. - -# ############################################# -# @Author : honghua -# @Contact : honghua@iscas.ac.cn -# @Date : 2026-03-25 -# @License : Mulan PSL v2 -# @Desc : Verify the texlive-gender-doc package is correctly installed and available. -# ############################################ - -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 - if [ $? -ne 0 ]; then - LOG_ERROR "软件包 $package_name 在yum源中不存在" - exit 255 - fi - LOG_INFO "软件包 $package_name 在yum源中存在" - } - - # 检查命令参数 - check_command_param() { - local cmd="$1" - local param="$2" - $cmd --help 2>&1 | grep -q -- "$param" - if [ $? -ne 0 ]; then - LOG_ERROR "命令 $cmd 不支持参数 $param" - exit 255 - fi - LOG_INFO "命令 $cmd 支持参数 $param" - } - - # 检查是否已安装软件包 - check_installed() { - local package_name="$1" - rpm -q "$package_name" &>/dev/null - if [ $? -eq 0 ]; then - LOG_INFO "软件包 $package_name 已安装" - return 0 - else - LOG_INFO "软件包 $package_name 未安装" - return 1 - fi - } - - # 主测试函数 - main() { - local package_name="texlive-gender-doc" - local was_installed=false - - LOG_INFO "步骤1: 检查软件包 $package_name 是否已安装" - if check_installed "$package_name"; then - was_installed=true - else - LOG_INFO "步骤2: 检查软件包 $package_name 在yum源中是否存在" - check_package_exists "$package_name" - - LOG_INFO "步骤3: 安装软件包 $package_name" - dnf install -y "$package_name" - CHECK_RESULT $? 0 0 "安装软件包 $package_name 失败" - fi - - LOG_INFO "步骤4: 验证软件包 $package_name 是否正确安装" - rpm -q "$package_name" - CHECK_RESULT $? 0 0 "软件包 $package_name 未正确安装" - - LOG_INFO "步骤5: 检查 texdoc 命令是否可用" - which texdoc - CHECK_RESULT $? 0 0 "texdoc 命令未找到" - - LOG_INFO "步骤6: 检查 texdoc 命令的 --help 参数是否支持" - check_command_param "texdoc" "--help" - - LOG_INFO "步骤7: 使用 texdoc 查询 gender 文档" - texdoc gender 2>&1 | grep -q "gender" - CHECK_RESULT $? 0 0 "texdoc gender 命令执行失败" - - LOG_INFO "步骤8: 清理环境" - if [ "$was_installed" = false ]; then - LOG_INFO "步骤9: 卸载软件包 $package_name" - dnf remove -y "$package_name" - CHECK_RESULT $? 0 0 "卸载软件包 $package_name 失败" - - LOG_INFO "步骤10: 验证软件包 $package_name 已卸载" - rpm -q "$package_name" - CHECK_RESULT $? 1 0 "软件包 $package_name 未成功卸载" - else - LOG_INFO "步骤9: 软件包 $package_name 在测试前已安装,保持安装状态" - fi - - LOG_INFO "测试完成: Verify the texlive-gender-doc package is correctly installed and available." - } - - # 执行主函数 - main -} - -main "$@" \ No newline at end of file diff --git a/testcases/function_test/pkg_test/texlive-split-j/texlive-gender-doc/test_texlive-gender-doc_function_doc_read.sh b/testcases/function_test/pkg_test/texlive-split-j/texlive-gender-doc/test_texlive-gender-doc_function_doc_read.sh deleted file mode 100644 index 978739eec29..00000000000 --- a/testcases/function_test/pkg_test/texlive-split-j/texlive-gender-doc/test_texlive-gender-doc_function_doc_read.sh +++ /dev/null @@ -1,155 +0,0 @@ -#!/usr/bin/bash - -# Copyright (c) 2024 ISCAS .ALL rights reserved. -# This program is licensed under Mulan PSL v2. -# You can use it according to the terms and conditions of the Mulan PSL v2. -# http://license.coscl.org.cn/MulanPSL2 -# THIS PROGRAM IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, -# EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-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 : Verify the documentation files of texlive-gender-doc are accessible and readable. -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - # 检查texlive-gender-doc文档文件是否可访问和可读的测试脚本 - - LOG_INFO "开始测试texlive-gender-doc文档文件的可访问性和可读性" - - # 定义软件包名称 - PACKAGE_NAME="texlive-gender-doc" - - # 步骤1: 检查软件包是否已在yum源中 - LOG_INFO "步骤1: 检查$PACKAGE_NAME是否在yum源中可用" - dnf list available $PACKAGE_NAME > /dev/null 2>&1 - if [ $? -ne 0 ]; then - LOG_ERROR "$PACKAGE_NAME在yum源中不可用" - exit 255 - fi - LOG_INFO "$PACKAGE_NAME在yum源中可用" - - # 步骤2: 检查软件包是否已安装 - LOG_INFO "步骤2: 检查$PACKAGE_NAME是否已安装" - rpm -q $PACKAGE_NAME > /dev/null 2>&1 - PACKAGE_INSTALLED=$? - - # 步骤3: 如果未安装,则安装软件包 - if [ $PACKAGE_INSTALLED -ne 0 ]; then - LOG_INFO "步骤3: 安装$PACKAGE_NAME软件包" - dnf install -y $PACKAGE_NAME - CHECK_RESULT $? 0 0 "安装$PACKAGE_NAME失败" - LOG_INFO "$PACKAGE_NAME安装成功" - else - LOG_INFO "$PACKAGE_NAME已安装,跳过安装步骤" - fi - - # 步骤4: 获取软件包安装的文件列表 - LOG_INFO "步骤4: 获取$PACKAGE_NAME安装的文档文件列表" - DOC_FILES=$(rpm -ql $PACKAGE_NAME | grep -E "\.(pdf|txt|md|html|tex|sty|cls)$" | head -20) - if [ -z "$DOC_FILES" ]; then - LOG_INFO "未找到典型的文档文件,尝试查找其他文件类型" - DOC_FILES=$(rpm -ql $PACKAGE_NAME | grep -E "/doc/" | head -20) - fi - - if [ -z "$DOC_FILES" ]; then - LOG_ERROR "未找到$PACKAGE_NAME的文档文件" - # 如果是在测试过程中安装的,需要卸载 - if [ $PACKAGE_INSTALLED -ne 0 ]; then - LOG_INFO "清理环境: 卸载$PACKAGE_NAME" - dnf remove -y $PACKAGE_NAME - fi - exit 1 - fi - - LOG_INFO "找到以下文档文件进行测试:" - echo "$DOC_FILES" | while read file; do - LOG_INFO " - $file" - done - - # 步骤5: 测试文档文件的可访问性 - LOG_INFO "步骤5: 测试文档文件的可访问性" - FAILED_FILES=0 - TOTAL_FILES=0 - - for file in $DOC_FILES; do - TOTAL_FILES=$((TOTAL_FILES + 1)) - - # 检查文件是否存在 - if [ ! -e "$file" ]; then - LOG_ERROR "文件不存在: $file" - FAILED_FILES=$((FAILED_FILES + 1)) - continue - fi - - # 检查文件是否可读 - if [ ! -r "$file" ]; then - LOG_ERROR "文件不可读: $file" - FAILED_FILES=$((FAILED_FILES + 1)) - continue - fi - - # 检查文件大小 - FILE_SIZE=$(stat -c%s "$file" 2>/dev/null || echo "0") - if [ "$FILE_SIZE" -eq 0 ]; then - LOG_ERROR "文件大小为0: $file" - FAILED_FILES=$((FAILED_FILES + 1)) - continue - fi - - # 尝试读取文件内容(前几行) - if file "$file" | grep -q "text"; then - head -5 "$file" > /dev/null 2>&1 - if [ $? -ne 0 ]; then - LOG_ERROR "无法读取文件内容: $file" - FAILED_FILES=$((FAILED_FILES + 1)) - else - LOG_INFO "文件可访问且可读: $file (大小: ${FILE_SIZE}字节)" - fi - else - # 对于非文本文件,至少检查是否可以访问 - ls -la "$file" > /dev/null 2>&1 - if [ $? -eq 0 ]; then - LOG_INFO "文件可访问: $file (大小: ${FILE_SIZE}字节,类型: $(file -b "$file" | cut -c1-50))" - else - LOG_ERROR "无法访问文件: $file" - FAILED_FILES=$((FAILED_FILES + 1)) - fi - fi - done - - # 步骤6: 检查测试结果 - LOG_INFO "步骤6: 检查文档文件测试结果" - if [ $TOTAL_FILES -eq 0 ]; then - LOG_ERROR "未找到任何文档文件进行测试" - CHECK_RESULT 1 0 0 "未找到文档文件" - elif [ $FAILED_FILES -eq 0 ]; then - LOG_INFO "所有文档文件($TOTAL_FILES个)均可访问且可读" - CHECK_RESULT 0 0 0 "文档文件测试失败" - else - LOG_ERROR "$FAILED_FILES/$TOTAL_FILES个文档文件无法访问或不可读" - CHECK_RESULT 1 0 0 "部分文档文件无法访问或不可读" - fi - - # 步骤7: 清理环境 - LOG_INFO "步骤7: 清理测试环境" - if [ $PACKAGE_INSTALLED -ne 0 ]; then - LOG_INFO "卸载测试安装的$PACKAGE_NAME软件包" - dnf remove -y $PACKAGE_NAME - CHECK_RESULT $? 0 0 "卸载$PACKAGE_NAME失败" - LOG_INFO "环境已恢复到测试前状态" - else - LOG_INFO "$PACKAGE_NAME在测试前已安装,保持安装状态" - fi - - LOG_INFO "texlive-gender-doc文档文件可访问性和可读性测试完成" -} - -main "$@" \ No newline at end of file diff --git a/testcases/function_test/pkg_test/texlive-split-j/texlive-gender-doc/test_texlive-gender-doc_function_install.sh b/testcases/function_test/pkg_test/texlive-split-j/texlive-gender-doc/test_texlive-gender-doc_function_install.sh deleted file mode 100644 index 4d7c5f4139c..00000000000 --- a/testcases/function_test/pkg_test/texlive-split-j/texlive-gender-doc/test_texlive-gender-doc_function_install.sh +++ /dev/null @@ -1,80 +0,0 @@ -#!/usr/bin/bash - -# Copyright (c) 2024 ISCAS .ALL rights reserved. -# This program is licensed under Mulan PSL v2. -# You can use it according to the terms and conditions of the Mulan PSL v2. -# http://license.coscl.org.cn/MulanPSL2 -# THIS PROGRAM IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, -# EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, -# MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. -# See the Mulan PSL v2 for more details. - -# ############################################# -# @Author : honghua -# @Contact : honghua@iscas.ac.cn -# @Date : 2026-03-25 -# @License : Mulan PSL v2 -# @Desc : Verify the texlive-gender-doc package can be installed successfully. -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - # 检查texlive-gender-doc包是否存在 - LOG_INFO "检查texlive-gender-doc包是否在yum源中" - dnf list available texlive-gender-doc >/dev/null 2>&1 - if [ $? -ne 0 ]; then - LOG_ERROR "texlive-gender-doc包不在yum源中" - exit 255 - fi - CHECK_RESULT $? 0 0 "检查texlive-gender-doc包是否在yum源中失败" - - # 检查是否已安装 - LOG_INFO "检查texlive-gender-doc包是否已安装" - rpm -q texlive-gender-doc >/dev/null 2>&1 - already_installed=$? - - if [ $already_installed -eq 0 ]; then - LOG_INFO "texlive-gender-doc包已安装,测试后保持安装状态" - installed_for_test=0 - else - LOG_INFO "texlive-gender-doc包未安装,执行安装测试" - installed_for_test=1 - fi - - # 执行安装测试 - if [ $installed_for_test -eq 1 ]; then - LOG_INFO "安装texlive-gender-doc包" - dnf install -y texlive-gender-doc - CHECK_RESULT $? 0 0 "安装texlive-gender-doc包失败" - - LOG_INFO "验证texlive-gender-doc包安装成功" - rpm -q texlive-gender-doc >/dev/null 2>&1 - CHECK_RESULT $? 0 0 "texlive-gender-doc包未正确安装" - fi - - # 验证包的基本功能 - LOG_INFO "验证texlive-gender-doc包文件是否存在" - rpm -ql texlive-gender-doc | head -5 >/dev/null 2>&1 - CHECK_RESULT $? 0 0 "texlive-gender-doc包文件列表获取失败" - - # 清理环境 - if [ $installed_for_test -eq 1 ]; then - LOG_INFO "卸载测试安装的texlive-gender-doc包" - dnf remove -y texlive-gender-doc - CHECK_RESULT $? 0 0 "卸载texlive-gender-doc包失败" - - LOG_INFO "验证texlive-gender-doc包已卸载" - rpm -q texlive-gender-doc >/dev/null 2>&1 - if [ $? -eq 0 ]; then - LOG_ERROR "texlive-gender-doc包卸载失败" - exit 1 - fi - else - LOG_INFO "保持texlive-gender-doc包安装状态,不执行卸载" - fi - - LOG_INFO "texlive-gender-doc包安装测试完成" -} - -main "$@" \ No newline at end of file diff --git a/testcases/function_test/pkg_test/texlive-split-j/texlive-gender-doc/test_texlive-gender-doc_function_remove.sh b/testcases/function_test/pkg_test/texlive-split-j/texlive-gender-doc/test_texlive-gender-doc_function_remove.sh deleted file mode 100644 index 159c5d4a318..00000000000 --- a/testcases/function_test/pkg_test/texlive-split-j/texlive-gender-doc/test_texlive-gender-doc_function_remove.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-25 -# @License : Mulan PSL v2 -# @Desc : Verify the texlive-gender-doc package can be cleanly uninstalled. -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - set -e - - LOG_INFO "开始测试:验证 texlive-gender-doc 包可以被干净地卸载" - - LOG_INFO "步骤1:检查 yum 源中是否存在 texlive-gender-doc 软件包" - if ! dnf list available texlive-gender-doc &>/dev/null; then - LOG_ERROR "yum 源中未找到 texlive-gender-doc 软件包" - exit 255 - fi - LOG_INFO "yum 源中存在 texlive-gender-doc 软件包" - - LOG_INFO "步骤2:检查当前环境是否已安装 texlive-gender-doc" - if rpm -q texlive-gender-doc &>/dev/null; then - LOG_INFO "检测到 texlive-gender-doc 已安装,标记为已安装状态" - ALREADY_INSTALLED=1 - else - LOG_INFO "当前环境未安装 texlive-gender-doc,将在测试过程中安装" - ALREADY_INSTALLED=0 - fi - - if [ ${ALREADY_INSTALLED} -eq 0 ]; then - LOG_INFO "步骤3:安装 texlive-gender-doc 软件包" - dnf install -y texlive-gender-doc - CHECK_RESULT $? 0 0 "安装 texlive-gender-doc 失败" - LOG_INFO "安装 texlive-gender-doc 成功" - fi - - LOG_INFO "步骤4:验证 texlive-gender-doc 包文件存在性" - rpm -ql texlive-gender-doc > /dev/null - CHECK_RESULT $? 0 0 "texlive-gender-doc 包文件列表查询失败" - - LOG_INFO "步骤5:执行卸载 texlive-gender-doc 软件包" - dnf remove -y texlive-gender-doc - CHECK_RESULT $? 0 0 "卸载 texlive-gender-doc 失败" - LOG_INFO "卸载 texlive-gender-doc 成功" - - LOG_INFO "步骤6:验证 texlive-gender-doc 已被完全卸载" - if rpm -q texlive-gender-doc &>/dev/null; then - LOG_ERROR "卸载后仍检测到 texlive-gender-doc 软件包残留" - exit 1 - fi - LOG_INFO "验证通过,texlive-gender-doc 已被完全卸载" - - LOG_INFO "步骤7:环境恢复" - if [ ${ALREADY_INSTALLED} -eq 1 ]; then - LOG_INFO "恢复原始安装状态:重新安装 texlive-gender-doc" - dnf install -y texlive-gender-doc - CHECK_RESULT $? 0 0 "重新安装 texlive-gender-doc 失败" - LOG_INFO "环境已恢复到初始安装状态" - else - LOG_INFO "原始环境未安装,无需恢复" - fi - - LOG_INFO "测试完成:texlive-gender-doc 包可以被干净地卸载" -} - -main "$@" \ No newline at end of file diff --git a/testcases/function_test/pkg_test/texlive-split-j/texlive-gender-doc/test_texlive-gender-doc_function_version.sh b/testcases/function_test/pkg_test/texlive-split-j/texlive-gender-doc/test_texlive-gender-doc_function_version.sh deleted file mode 100644 index 9d9102dc2d2..00000000000 --- a/testcases/function_test/pkg_test/texlive-split-j/texlive-gender-doc/test_texlive-gender-doc_function_version.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-25 -# @License : Mulan PSL v2 -# @Desc : Verify the version information of the installed texlive-gender-doc package. -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - # 定义颜色输出 - LOG_INFO() { - echo -e "\033[32m[INFO]\033[0m $1" - } - - LOG_ERROR() { - echo -e "\033[31m[ERROR]\033[0m $1" - } - - # 定义软件包名称 - PACKAGE_NAME="texlive-gender-doc" - - # 步骤1:检查软件包是否已在yum源中 - LOG_INFO "检查软件包 ${PACKAGE_NAME} 是否在yum源中..." - dnf list available "${PACKAGE_NAME}" &>/dev/null - if [ $? -ne 0 ]; then - LOG_ERROR "软件包 ${PACKAGE_NAME} 不在yum源中,退出测试" - exit 255 - fi - - # 步骤2:检查当前是否已安装软件包 - LOG_INFO "检查软件包 ${PACKAGE_NAME} 是否已安装..." - dnf list installed "${PACKAGE_NAME}" &>/dev/null - if [ $? -eq 0 ]; then - LOG_INFO "软件包 ${PACKAGE_NAME} 已安装,脚本结束后将保持安装状态" - INSTALLED_BEFORE=true - else - LOG_INFO "软件包 ${PACKAGE_NAME} 未安装,将在测试步骤中安装" - INSTALLED_BEFORE=false - fi - - # 步骤3:如果未安装,则安装软件包 - if [ "${INSTALLED_BEFORE}" = "false" ]; then - LOG_INFO "安装软件包 ${PACKAGE_NAME}..." - dnf install -y "${PACKAGE_NAME}" - CHECK_RESULT $? 0 0 "安装软件包 ${PACKAGE_NAME} 失败" - fi - - # 步骤4:验证软件包的版本信息 - LOG_INFO "验证已安装软件包 ${PACKAGE_NAME} 的版本信息..." - rpm -q "${PACKAGE_NAME}" - CHECK_RESULT $? 0 0 "获取软件包 ${PACKAGE_NAME} 版本信息失败" - - # 步骤5:如果之前未安装,则在测试结束后卸载软件包 - if [ "${INSTALLED_BEFORE}" = "false" ]; then - LOG_INFO "卸载软件包 ${PACKAGE_NAME}..." - dnf remove -y "${PACKAGE_NAME}" - CHECK_RESULT $? 0 0 "卸载软件包 ${PACKAGE_NAME} 失败" - else - LOG_INFO "软件包 ${PACKAGE_NAME} 在脚本执行前已安装,保持安装状态" - fi - - LOG_INFO "测试完成,环境已恢复" -} - -main "$@" \ No newline at end of file From 4b434efb1b1ae0d38fa7a524ef1efa2c9e73bebc Mon Sep 17 00:00:00 2001 From: honghua Date: Thu, 16 Apr 2026 23:07:20 +0800 Subject: [PATCH 03/13] update testcase for testsuite texlive-biblatex-subseries --- .../texlive-biblatex-subseries.json | 10 -- ...texlive-biblatex-subseries_function_bib.sh | 93 ------------------- 2 files changed, 103 deletions(-) delete mode 100644 suite2cases/function_test/pkg_test/texlive-split-c/texlive-biblatex-subseries.json delete mode 100644 testcases/function_test/pkg_test/texlive-split-c/texlive-biblatex-subseries/test_texlive-biblatex-subseries_function_bib.sh diff --git a/suite2cases/function_test/pkg_test/texlive-split-c/texlive-biblatex-subseries.json b/suite2cases/function_test/pkg_test/texlive-split-c/texlive-biblatex-subseries.json deleted file mode 100644 index 203e98eb87b..00000000000 --- a/suite2cases/function_test/pkg_test/texlive-split-c/texlive-biblatex-subseries.json +++ /dev/null @@ -1,10 +0,0 @@ -{ - "path": "$OET_PATH/testcases/function_test/pkg_test/texlive-split-c/texlive-biblatex-subseries", - "machine num": 1, - "cases": [ - { - "name": "test_texlive-biblatex-subseries_function_bib", - "desc": "Test bibliography generation" - } - ] -} \ No newline at end of file diff --git a/testcases/function_test/pkg_test/texlive-split-c/texlive-biblatex-subseries/test_texlive-biblatex-subseries_function_bib.sh b/testcases/function_test/pkg_test/texlive-split-c/texlive-biblatex-subseries/test_texlive-biblatex-subseries_function_bib.sh deleted file mode 100644 index 49ebbea3d2a..00000000000 --- a/testcases/function_test/pkg_test/texlive-split-c/texlive-biblatex-subseries/test_texlive-biblatex-subseries_function_bib.sh +++ /dev/null @@ -1,93 +0,0 @@ -#!/usr/bin/bash - -# Copyright (c) 2024 ISCAS .ALL rights reserved. -# This program is licensed under Mulan PSL v2. -# You can use it according to the terms and conditions of the Mulan PSL v2. -# http://license.coscl.org.cn/MulanPSL2 -# THIS PROGRAM IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, -# EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, -# MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. -# See the Mulan PSL v2 for more details. - -# ############################################# -# @Author : honghua -# @Contact : honghua@iscas.ac.cn -# @Date : 2025-11-26 -# @License : Mulan PSL v2 -# @Desc : Test bibliography generation -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - # 测试脚本:test_texlive-biblatex-subseries_function_bib - - LOG_INFO "开始测试:Test bibliography generation" - - # 检查是否已安装texlive-biblatex-subseries - LOG_INFO "检查texlive-biblatex-subseries是否已安装" - dnf list installed texlive-biblatex-subseries > /dev/null 2>&1 - if [ $? -eq 0 ]; then - LOG_INFO "texlive-biblatex-subseries已安装,测试完成后将保持安装状态" - INSTALLED=true - else - LOG_INFO "texlive-biblatex-subseries未安装,将在测试完成后卸载" - INSTALLED=false - fi - - # 检查yum源中是否有texlive-biblatex-subseries - LOG_INFO "检查yum源中是否有texlive-biblatex-subseries" - dnf list available texlive-biblatex-subseries > /dev/null 2>&1 - if [ $? -ne 0 ]; then - LOG_ERROR "yum源中未找到texlive-biblatex-subseries软件包" - exit 255 - fi - - # 安装texlive-biblatex-subseries - if [ "$INSTALLED" = false ]; then - LOG_INFO "安装texlive-biblatex-subseries" - dnf install -y texlive-biblatex-subseries - CHECK_RESULT $? 0 0 "安装texlive-biblatex-subseries失败" - fi - - # 测试bibliography生成功能 - LOG_INFO "测试bibliography生成功能" - pdflatex --help | grep -q -- --biblatex - if [ $? -ne 0 ]; then - LOG_ERROR "pdflatex不支持--biblatex参数" - exit 255 - fi - - # 创建测试文件 - LOG_INFO "创建测试文件test_bib.tex" - cat > test_bib.tex < test.bib < Date: Thu, 16 Apr 2026 23:07:30 +0800 Subject: [PATCH 04/13] update testcase for testsuite texlive-easy --- .../texlive-split-h/texlive-easy.json | 8 -- .../test_texlive-easy_function_basic_usage.sh | 114 ------------------ .../test_texlive-easy_function_install.sh | 78 ------------ 3 files changed, 200 deletions(-) delete mode 100644 testcases/function_test/pkg_test/texlive-split-h/texlive-easy/test_texlive-easy_function_basic_usage.sh delete mode 100644 testcases/function_test/pkg_test/texlive-split-h/texlive-easy/test_texlive-easy_function_install.sh diff --git a/suite2cases/function_test/pkg_test/texlive-split-h/texlive-easy.json b/suite2cases/function_test/pkg_test/texlive-split-h/texlive-easy.json index cbec016e298..173be3c22f5 100644 --- a/suite2cases/function_test/pkg_test/texlive-split-h/texlive-easy.json +++ b/suite2cases/function_test/pkg_test/texlive-split-h/texlive-easy.json @@ -7,18 +7,10 @@ "desc": "测试 texlive-easy 软件包的安装功能,验证安装过程是否成功。", "machine num": 1 }, - { - "name": "test_texlive-easy_function_install", - "desc": "测试 texlive-easy 软件包的安装功能,验证能否成功安装到系统中。" - }, { "name": "test_texlive-easy_function_uninstall", "desc": "测试 texlive-easy 软件包的卸载功能,验证能否完全移除且不影响系统。" }, - { - "name": "test_texlive-easy_function_basic_usage", - "desc": "测试 texlive-easy 软件包的基本用法,验证其核心命令能否正常执行并生成预期输出。" - }, { "name": "test_texlive-easy_function_check_installed", "desc": "测试检查 texlive-easy 软件包是否已正确安装的功能,验证系统能正确识别其安装状态。" diff --git a/testcases/function_test/pkg_test/texlive-split-h/texlive-easy/test_texlive-easy_function_basic_usage.sh b/testcases/function_test/pkg_test/texlive-split-h/texlive-easy/test_texlive-easy_function_basic_usage.sh deleted file mode 100644 index fe56d6f1e92..00000000000 --- a/testcases/function_test/pkg_test/texlive-split-h/texlive-easy/test_texlive-easy_function_basic_usage.sh +++ /dev/null @@ -1,114 +0,0 @@ -#!/usr/bin/bash - -# Copyright (c) 2024 ISCAS .ALL rights reserved. -# This program is licensed under Mulan PSL v2. -# You can use it according to the terms and conditions of the Mulan PSL v2. -# http://license.coscl.org.cn/MulanPSL2 -# THIS PROGRAM IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, -# EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, -# MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. -# See the Mulan PSL v2 for more details. - -# ############################################# -# @Author : honghua -# @Contact : honghua@iscas.ac.cn -# @Date : 2026-03-26 -# @License : Mulan PSL v2 -# @Desc : 测试 texlive-easy 软件包的基本用法,验证其核心命令能否正常执行并生成预期输出。 -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - # 测试 texlive-easy 软件包的基本用法 - LOG_INFO "开始测试 texlive-easy 软件包的基本功能" - - # 检查是否已安装 texlive-easy - LOG_INFO "步骤1:检查 texlive-easy 是否已安装" - if rpm -q texlive-easy &> /dev/null; then - LOG_INFO "texlive-easy 已安装,测试结束后将保持安装状态" - ALREADY_INSTALLED=true - else - LOG_INFO "texlive-easy 未安装,将在测试前安装,测试后卸载" - ALREADY_INSTALLED=false - fi - - # 检查 yum 源中是否有 texlive-easy - LOG_INFO "步骤2:检查 yum 源中是否有 texlive-easy 软件包" - if ! dnf list available texlive-easy &> /dev/null; then - LOG_ERROR "yum 源中未找到 texlive-easy 软件包" - exit 255 - fi - - # 如果未安装,则安装 texlive-easy - if [ "$ALREADY_INSTALLED" = false ]; then - LOG_INFO "步骤3:安装 texlive-easy 软件包" - dnf install -y texlive-easy - CHECK_RESULT $? 0 0 "安装 texlive-easy 失败" - fi - - # 测试 texlive-easy 的基本命令 - LOG_INFO "步骤4:测试 texlive-easy 的基本命令" - - # 检查 texlive-easy 命令是否存在 - LOG_INFO "步骤4.1:检查 texlive-easy 命令是否存在" - if ! command -v texlive-easy &> /dev/null; then - LOG_ERROR "texlive-easy 命令不存在" - if [ "$ALREADY_INSTALLED" = false ]; then - dnf remove -y texlive-easy - fi - exit 255 - fi - - # 测试 texlive-easy 的版本命令 - LOG_INFO "步骤4.2:测试 texlive-easy 版本命令" - texlive-easy --version - CHECK_RESULT $? 0 0 "texlive-easy 版本命令执行失败" - - # 测试 texlive-easy 的帮助命令 - LOG_INFO "步骤4.3:测试 texlive-easy 帮助命令" - texlive-easy --help - CHECK_RESULT $? 0 0 "texlive-easy 帮助命令执行失败" - - # 测试 texlive-easy 生成基本文档 - LOG_INFO "步骤4.4:测试 texlive-easy 生成基本文档" - TEST_FILE="test_document.tex" - texlive-easy generate --type=article --output="$TEST_FILE" - CHECK_RESULT $? 0 0 "texlive-easy 生成文档失败" - - # 检查生成的文档是否存在 - if [ -f "$TEST_FILE" ]; then - LOG_INFO "成功生成测试文档: $TEST_FILE" - # 检查文档内容是否包含 LaTeX 基本结构 - if grep -q "documentclass" "$TEST_FILE" && grep -q "begin{document}" "$TEST_FILE"; then - LOG_INFO "生成的文档包含正确的 LaTeX 结构" - else - LOG_ERROR "生成的文档缺少必要的 LaTeX 结构" - CHECK_RESULT 1 0 0 "文档结构检查失败" - fi - else - LOG_ERROR "未找到生成的测试文档" - CHECK_RESULT 1 0 0 "文档生成检查失败" - fi - - # 清理测试文件 - LOG_INFO "步骤5:清理测试文件" - if [ -f "$TEST_FILE" ]; then - rm -f "$TEST_FILE" - LOG_INFO "已删除测试文件: $TEST_FILE" - fi - - # 如果测试前未安装,则卸载 texlive-easy - if [ "$ALREADY_INSTALLED" = false ]; then - LOG_INFO "步骤6:卸载 texlive-easy 软件包" - dnf remove -y texlive-easy - CHECK_RESULT $? 0 0 "卸载 texlive-easy 失败" - LOG_INFO "已卸载 texlive-easy 软件包" - else - LOG_INFO "步骤6:保持 texlive-easy 安装状态" - fi - - LOG_INFO "texlive-easy 基本功能测试完成" -} - -main "$@" \ No newline at end of file diff --git a/testcases/function_test/pkg_test/texlive-split-h/texlive-easy/test_texlive-easy_function_install.sh b/testcases/function_test/pkg_test/texlive-split-h/texlive-easy/test_texlive-easy_function_install.sh deleted file mode 100644 index ae1bdeabbbf..00000000000 --- a/testcases/function_test/pkg_test/texlive-split-h/texlive-easy/test_texlive-easy_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-26 -# @License : Mulan PSL v2 -# @Desc : 测试 texlive-easy 软件包的安装功能,验证能否成功安装到系统中。 -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - set -e - - LOG_INFO "开始测试 texlive-easy 软件包的安装功能" - - LOG_INFO "检查 yum 源中是否存在 texlive-easy 软件包" - dnf list available texlive-easy &>/dev/null - if [ $? -ne 0 ]; then - LOG_ERROR "yum 源中未找到 texlive-easy 软件包" - exit 255 - fi - - LOG_INFO "检查系统是否已安装 texlive-easy" - dnf list installed texlive-easy &>/dev/null - if [ $? -eq 0 ]; then - LOG_INFO "系统已安装 texlive-easy,测试结束后将保持安装状态" - INSTALLED_BEFORE_TEST=true - else - LOG_INFO "系统未安装 texlive-easy,将执行安装测试" - INSTALLED_BEFORE_TEST=false - fi - - if [ "$INSTALLED_BEFORE_TEST" = "false" ]; then - LOG_INFO "步骤 1: 安装 texlive-easy 软件包" - dnf install -y texlive-easy - CHECK_RESULT $? 0 0 "安装 texlive-easy 失败" - LOG_INFO "texlive-easy 安装成功" - fi - - LOG_INFO "步骤 2: 验证 texlive-easy 是否成功安装" - rpm -q texlive-easy &>/dev/null - CHECK_RESULT $? 0 0 "验证 texlive-easy 安装状态失败" - LOG_INFO "texlive-easy 软件包已正确安装到系统中" - - LOG_INFO "步骤 3: 验证 texlive-easy 的基本功能" - if command -v tex &>/dev/null; then - LOG_INFO "找到 tex 命令,进行简单版本检查" - tex --version &>/dev/null - CHECK_RESULT $? 0 0 "tex 命令执行失败" - LOG_INFO "tex 命令基本功能正常" - else - LOG_INFO "未找到 tex 命令,这可能是一个元软件包或依赖包集合" - fi - - if [ "$INSTALLED_BEFORE_TEST" = "false" ]; then - LOG_INFO "清理环境:卸载测试安装的 texlive-easy 软件包" - dnf remove -y texlive-easy - CHECK_RESULT $? 0 0 "卸载 texlive-easy 失败" - LOG_INFO "texlive-easy 卸载成功,环境已恢复" - else - LOG_INFO "测试前已安装 texlive-easy,保持安装状态,无需卸载" - fi - - LOG_INFO "测试完成:texlive-easy 软件包的安装功能验证通过" -} - -main "$@" \ No newline at end of file From 826217dcb2c282a74f1f06ea19cb1dc20018f86c Mon Sep 17 00:00:00 2001 From: honghua Date: Thu, 16 Apr 2026 23:08:14 +0800 Subject: [PATCH 05/13] update testcase for testsuite jboss-integration-javadoc --- .../jboss-integration-javadoc.json | 4 - ...boss-integration-javadoc_function_usage.sh | 117 ------------------ 2 files changed, 121 deletions(-) delete mode 100644 testcases/function_test/pkg_test/jboss-integration/jboss-integration-javadoc/test_jboss-integration-javadoc_function_usage.sh diff --git a/suite2cases/function_test/pkg_test/jboss-integration/jboss-integration-javadoc.json b/suite2cases/function_test/pkg_test/jboss-integration/jboss-integration-javadoc.json index 72fba16be83..f95e581db7c 100644 --- a/suite2cases/function_test/pkg_test/jboss-integration/jboss-integration-javadoc.json +++ b/suite2cases/function_test/pkg_test/jboss-integration/jboss-integration-javadoc.json @@ -10,10 +10,6 @@ "name": "test_jboss-integration-javadoc_function_verify", "desc": "测试验证jboss-integration-javadoc软件包是否已正确安装" }, - { - "name": "test_jboss-integration-javadoc_function_usage", - "desc": "测试jboss-integration-javadoc提供的Javadoc文档的可用性" - }, { "name": "test_jboss-integration-javadoc_function_uninstall", "desc": "测试软件包jboss-integration-javadoc的卸载功能" diff --git a/testcases/function_test/pkg_test/jboss-integration/jboss-integration-javadoc/test_jboss-integration-javadoc_function_usage.sh b/testcases/function_test/pkg_test/jboss-integration/jboss-integration-javadoc/test_jboss-integration-javadoc_function_usage.sh deleted file mode 100644 index 2b13b8ca3ac..00000000000 --- a/testcases/function_test/pkg_test/jboss-integration/jboss-integration-javadoc/test_jboss-integration-javadoc_function_usage.sh +++ /dev/null @@ -1,117 +0,0 @@ -#!/usr/bin/bash - -# Copyright (c) 2024 ISCAS .ALL rights reserved. -# This program is licensed under Mulan PSL v2. -# You can use it according to the terms and conditions of the Mulan PSL v2. -# http://license.coscl.org.cn/MulanPSL2 -# THIS PROGRAM IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, -# EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, -# MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. -# See the Mulan PSL v2 for more details. - -# ############################################# -# @Author : honghua -# @Contact : honghua@iscas.ac.cn -# @Date : 2026-03-27 -# @License : Mulan PSL v2 -# @Desc : 测试jboss-integration-javadoc提供的Javadoc文档的可用性 -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - # 检查是否已安装 jboss-integration-javadoc 软件包 - LOG_INFO "检查 jboss-integration-javadoc 软件包是否已安装" - rpm -q jboss-integration-javadoc > /dev/null 2>&1 - if [ $? -eq 0 ]; then - LOG_INFO "jboss-integration-javadoc 软件包已安装" - INSTALLED=1 - else - LOG_INFO "jboss-integration-javadoc 软件包未安装" - INSTALLED=0 - fi - - # 检查 yum 源中是否有 jboss-integration-javadoc 软件包 - LOG_INFO "检查 yum 源中是否存在 jboss-integration-javadoc 软件包" - dnf list available jboss-integration-javadoc > /dev/null 2>&1 - if [ $? -ne 0 ]; then - LOG_ERROR "yum 源中未找到 jboss-integration-javadoc 软件包" - exit 255 - fi - - # 如果未安装,则安装软件包 - if [ $INSTALLED -eq 0 ]; then - LOG_INFO "开始安装 jboss-integration-javadoc 软件包" - dnf install -y jboss-integration-javadoc - CHECK_RESULT $? 0 0 "安装 jboss-integration-javadoc 软件包失败" - LOG_INFO "jboss-integration-javadoc 软件包安装成功" - fi - - # 检查 jboss-integration-javadoc 提供的 javadoc 命令 - LOG_INFO "检查 javadoc 命令是否可用" - which javadoc > /dev/null 2>&1 - CHECK_RESULT $? 0 0 "javadoc 命令未找到" - - # 测试 javadoc 命令的基本参数 - LOG_INFO "测试 javadoc 命令的 -version 参数" - javadoc -version > /dev/null 2>&1 - CHECK_RESULT $? 0 0 "javadoc -version 参数测试失败" - - LOG_INFO "测试 javadoc 命令的 -help 参数" - javadoc -help > /dev/null 2>&1 - CHECK_RESULT $? 0 0 "javadoc -help 参数测试失败" - - # 检查是否存在不支持的参数 - LOG_INFO "检查 javadoc 命令是否支持不存在的参数 -nonexistent" - javadoc -nonexistent > /dev/null 2>&1 - if [ $? -ne 255 ] && [ $? -ne 1 ]; then - LOG_ERROR "javadoc 命令错误处理不支持参数" - exit 255 - fi - - # 测试生成简单的 Javadoc 文档 - LOG_INFO "创建测试 Java 文件" - mkdir -p /tmp/javadoc_test - cat > /tmp/javadoc_test/Test.java << "EOF" - /** - * 测试类 - */ - public class Test { - /** - * 测试方法 - */ - public void testMethod() {} - } - EOF - - LOG_INFO "使用 javadoc 生成测试文档" - javadoc -d /tmp/javadoc_test/output -private /tmp/javadoc_test/Test.java > /tmp/javadoc_test/javadoc.log 2>&1 - CHECK_RESULT $? 0 0 "生成 Javadoc 文档失败" - - # 检查生成的文档 - LOG_INFO "检查生成的 Javadoc 文档" - if [ -f "/tmp/javadoc_test/output/index.html" ]; then - LOG_INFO "Javadoc 文档生成成功" - else - LOG_ERROR "Javadoc 文档生成失败" - exit 1 - fi - - # 清理测试文件 - LOG_INFO "清理测试文件" - rm -rf /tmp/javadoc_test - - # 如果脚本开始时未安装,则在结束时卸载软件包 - if [ $INSTALLED -eq 0 ]; then - LOG_INFO "卸载 jboss-integration-javadoc 软件包" - dnf remove -y jboss-integration-javadoc - CHECK_RESULT $? 0 0 "卸载 jboss-integration-javadoc 软件包失败" - LOG_INFO "jboss-integration-javadoc 软件包卸载成功" - else - LOG_INFO "保持 jboss-integration-javadoc 软件包安装状态" - fi - - LOG_INFO "测试 jboss-integration-javadoc 提供的 Javadoc 文档可用性完成" -} - -main "$@" \ No newline at end of file From 1dedf268d45b32d0d2dad3c212e125bcb37ce18f Mon Sep 17 00:00:00 2001 From: honghua Date: Thu, 16 Apr 2026 23:09:27 +0800 Subject: [PATCH 06/13] update testcase for testsuite greatsql-server --- .../pkg_test/greatsql/greatsql-server.json | 332 ------------------ .../test_greatsql-server_comp_err__c.sh | 79 ----- .../test_greatsql-server_comp_err__e.sh | 78 ---- .../test_greatsql-server_comp_err__upper_c.sh | 68 ---- .../test_greatsql-server_comp_err__upper_d.sh | 79 ----- .../test_greatsql-server_comp_err__upper_h.sh | 64 ---- .../test_greatsql-server_comp_err__upper_n.sh | 81 ----- .../test_greatsql-server_comp_err__upper_o.sh | 77 ---- ...test_greatsql-server_function_basic_lib.sh | 72 ---- .../test_greatsql-server_ibd2sdi__c_crc32.sh | 65 ---- .../test_greatsql-server_ibd2sdi__c_innodb.sh | 74 ---- .../test_greatsql-server_ibd2sdi__c_none.sh | 75 ---- ...est_greatsql-server_ibd2sdi__d_filename.sh | 83 ----- .../test_greatsql-server_ibd2sdi__h.sh | 68 ---- .../test_greatsql-server_ibd2sdi__i_num_1.sh | 69 ---- .../test_greatsql-server_ibd2sdi__n.sh | 87 ----- .../test_greatsql-server_ibd2sdi__s.sh | 75 ---- .../test_greatsql-server_ibd2sdi__t_num_1.sh | 71 ---- .../test_greatsql-server_ibd2sdifilename.sh | 68 ---- ...t_greatsql-server_innochecksum__a_num_3.sh | 69 ---- .../test_greatsql-server_innochecksum__c.sh | 88 ----- .../test_greatsql-server_innochecksum__n.sh | 79 ----- ...t_greatsql-server_innochecksum__p_num_5.sh | 67 ---- ...tsql-server_innochecksum__upper_c_crc32.sh | 77 ---- ...t_greatsql-server_innochecksum__upper_s.sh | 85 ----- ...t_greatsql-server_innochecksum__upper_v.sh | 69 ---- .../test_greatsql-server_innochecksum__v.sh | 66 ---- ...t_greatsql-server_innochecksum__w_crc32.sh | 84 ----- ...tsql-server_lz4_decompress_input_output.sh | 95 ----- ...st_greatsql-server_my_print_defaults__c.sh | 72 ---- ...st_greatsql-server_my_print_defaults__e.sh | 78 ---- ...st_greatsql-server_my_print_defaults__g.sh | 70 ---- ...st_greatsql-server_my_print_defaults__l.sh | 71 ---- ...st_greatsql-server_my_print_defaults__n.sh | 71 ---- ...st_greatsql-server_my_print_defaults__s.sh | 73 ---- ...atsql-server_my_print_defaults__upper_v.sh | 73 ---- ...st_greatsql-server_my_print_defaults__v.sh | 74 ---- .../test_greatsql-server_myisam_ftdump_c.sh | 72 ---- .../test_greatsql-server_myisam_ftdump_d.sh | 77 ---- .../test_greatsql-server_myisam_ftdump_h.sh | 66 ---- .../test_greatsql-server_myisam_ftdump_s.sh | 75 ---- .../test_greatsql-server_myisam_ftdump_v.sh | 58 --- .../test_greatsql-server_myisamlog_p.sh | 78 ---- ...tsql-server_mysql_secure_installation_h.sh | 63 ---- ...tsql-server_mysql_secure_installation_p.sh | 62 ---- ...tsql-server_mysql_secure_installation_u.sh | 60 ---- ...atsql-server_mysql_server_upper_version.sh | 70 ---- ..._greatsql-server_mysql_ssl_rsa_setup__d.sh | 85 ----- ...reatsql-server_mysql_ssl_rsa_setup__uid.sh | 88 ----- ...sql-server_mysql_ssl_rsa_setup__upper_v.sh | 70 ---- ..._greatsql-server_mysql_ssl_rsa_setup__v.sh | 83 ----- ...tsql-server_mysql_tzinfo_to_sql_upper_v.sh | 64 ---- ...t_greatsql-server_mysql_tzinfo_to_sql_v.sh | 75 ---- ...eatsql-server_mysqld_pre_systemd_status.sh | 69 ---- ...atsql-server_mysqld_pre_systemd_upper_v.sh | 73 ---- ...atsql-server_mysqld_safe_core_file_size.sh | 73 ---- ...eatsql-server_mysqld_safe_defaults_file.sh | 93 ----- .../test_greatsql-server_mysqld_safe_ledir.sh | 71 ---- ..._greatsql-server_mysqld_safe_malloc_lib.sh | 82 ----- ...test_greatsql-server_mysqld_safe_mysqld.sh | 73 ---- ...greatsql-server_mysqld_safe_no_defaults.sh | 64 ---- ...sql-server_mysqld_safe_open_files_limit.sh | 75 ---- ...st_greatsql-server_mysqld_safe_timezone.sh | 76 ---- ...ql-server_mysqldecompress_file-type_lz4.sh | 78 ---- ...st_greatsql-server_mysqldecompress_help.sh | 60 ---- ...est_greatsql-server_mysqldumpslow_num_1.sh | 79 ----- ...t_greatsql-server_mysqldumpslow_upper_v.sh | 64 ---- .../test_greatsql-server_mysqldumpslow_v.sh | 67 ---- .../test_greatsql-server_perror_info.sh | 64 ---- .../test_greatsql-server_perror_silent.sh | 62 ---- .../test_greatsql-server_perror_upper_v.sh | 82 ----- .../test_greatsql-server_perror_verbose.sh | 72 ---- ...eatsql-server_ps_mysqld_helper__upper_v.sh | 64 ---- ...sql-server_zlib_decompress_input_output.sh | 86 ----- ...sql-server_zstd_decompress_input_output.sh | 79 ----- 75 files changed, 5778 deletions(-) delete mode 100644 testcases/function_test/pkg_test/greatsql/greatsql-server/test_greatsql-server_comp_err__c.sh delete mode 100644 testcases/function_test/pkg_test/greatsql/greatsql-server/test_greatsql-server_comp_err__e.sh delete mode 100644 testcases/function_test/pkg_test/greatsql/greatsql-server/test_greatsql-server_comp_err__upper_c.sh delete mode 100644 testcases/function_test/pkg_test/greatsql/greatsql-server/test_greatsql-server_comp_err__upper_d.sh delete mode 100644 testcases/function_test/pkg_test/greatsql/greatsql-server/test_greatsql-server_comp_err__upper_h.sh delete mode 100644 testcases/function_test/pkg_test/greatsql/greatsql-server/test_greatsql-server_comp_err__upper_n.sh delete mode 100644 testcases/function_test/pkg_test/greatsql/greatsql-server/test_greatsql-server_comp_err__upper_o.sh delete mode 100644 testcases/function_test/pkg_test/greatsql/greatsql-server/test_greatsql-server_function_basic_lib.sh delete mode 100644 testcases/function_test/pkg_test/greatsql/greatsql-server/test_greatsql-server_ibd2sdi__c_crc32.sh delete mode 100644 testcases/function_test/pkg_test/greatsql/greatsql-server/test_greatsql-server_ibd2sdi__c_innodb.sh delete mode 100644 testcases/function_test/pkg_test/greatsql/greatsql-server/test_greatsql-server_ibd2sdi__c_none.sh delete mode 100644 testcases/function_test/pkg_test/greatsql/greatsql-server/test_greatsql-server_ibd2sdi__d_filename.sh delete mode 100644 testcases/function_test/pkg_test/greatsql/greatsql-server/test_greatsql-server_ibd2sdi__h.sh delete mode 100644 testcases/function_test/pkg_test/greatsql/greatsql-server/test_greatsql-server_ibd2sdi__i_num_1.sh delete mode 100644 testcases/function_test/pkg_test/greatsql/greatsql-server/test_greatsql-server_ibd2sdi__n.sh delete mode 100644 testcases/function_test/pkg_test/greatsql/greatsql-server/test_greatsql-server_ibd2sdi__s.sh delete mode 100644 testcases/function_test/pkg_test/greatsql/greatsql-server/test_greatsql-server_ibd2sdi__t_num_1.sh delete mode 100644 testcases/function_test/pkg_test/greatsql/greatsql-server/test_greatsql-server_ibd2sdifilename.sh delete mode 100644 testcases/function_test/pkg_test/greatsql/greatsql-server/test_greatsql-server_innochecksum__a_num_3.sh delete mode 100644 testcases/function_test/pkg_test/greatsql/greatsql-server/test_greatsql-server_innochecksum__c.sh delete mode 100644 testcases/function_test/pkg_test/greatsql/greatsql-server/test_greatsql-server_innochecksum__n.sh delete mode 100644 testcases/function_test/pkg_test/greatsql/greatsql-server/test_greatsql-server_innochecksum__p_num_5.sh delete mode 100644 testcases/function_test/pkg_test/greatsql/greatsql-server/test_greatsql-server_innochecksum__upper_c_crc32.sh delete mode 100644 testcases/function_test/pkg_test/greatsql/greatsql-server/test_greatsql-server_innochecksum__upper_s.sh delete mode 100644 testcases/function_test/pkg_test/greatsql/greatsql-server/test_greatsql-server_innochecksum__upper_v.sh delete mode 100644 testcases/function_test/pkg_test/greatsql/greatsql-server/test_greatsql-server_innochecksum__v.sh delete mode 100644 testcases/function_test/pkg_test/greatsql/greatsql-server/test_greatsql-server_innochecksum__w_crc32.sh delete mode 100644 testcases/function_test/pkg_test/greatsql/greatsql-server/test_greatsql-server_lz4_decompress_input_output.sh delete mode 100644 testcases/function_test/pkg_test/greatsql/greatsql-server/test_greatsql-server_my_print_defaults__c.sh delete mode 100644 testcases/function_test/pkg_test/greatsql/greatsql-server/test_greatsql-server_my_print_defaults__e.sh delete mode 100644 testcases/function_test/pkg_test/greatsql/greatsql-server/test_greatsql-server_my_print_defaults__g.sh delete mode 100644 testcases/function_test/pkg_test/greatsql/greatsql-server/test_greatsql-server_my_print_defaults__l.sh delete mode 100644 testcases/function_test/pkg_test/greatsql/greatsql-server/test_greatsql-server_my_print_defaults__n.sh delete mode 100644 testcases/function_test/pkg_test/greatsql/greatsql-server/test_greatsql-server_my_print_defaults__s.sh delete mode 100644 testcases/function_test/pkg_test/greatsql/greatsql-server/test_greatsql-server_my_print_defaults__upper_v.sh delete mode 100644 testcases/function_test/pkg_test/greatsql/greatsql-server/test_greatsql-server_my_print_defaults__v.sh delete mode 100644 testcases/function_test/pkg_test/greatsql/greatsql-server/test_greatsql-server_myisam_ftdump_c.sh delete mode 100644 testcases/function_test/pkg_test/greatsql/greatsql-server/test_greatsql-server_myisam_ftdump_d.sh delete mode 100644 testcases/function_test/pkg_test/greatsql/greatsql-server/test_greatsql-server_myisam_ftdump_h.sh delete mode 100644 testcases/function_test/pkg_test/greatsql/greatsql-server/test_greatsql-server_myisam_ftdump_s.sh delete mode 100644 testcases/function_test/pkg_test/greatsql/greatsql-server/test_greatsql-server_myisam_ftdump_v.sh delete mode 100644 testcases/function_test/pkg_test/greatsql/greatsql-server/test_greatsql-server_myisamlog_p.sh delete mode 100644 testcases/function_test/pkg_test/greatsql/greatsql-server/test_greatsql-server_mysql_secure_installation_h.sh delete mode 100644 testcases/function_test/pkg_test/greatsql/greatsql-server/test_greatsql-server_mysql_secure_installation_p.sh delete mode 100644 testcases/function_test/pkg_test/greatsql/greatsql-server/test_greatsql-server_mysql_secure_installation_u.sh delete mode 100644 testcases/function_test/pkg_test/greatsql/greatsql-server/test_greatsql-server_mysql_server_upper_version.sh delete mode 100644 testcases/function_test/pkg_test/greatsql/greatsql-server/test_greatsql-server_mysql_ssl_rsa_setup__d.sh delete mode 100644 testcases/function_test/pkg_test/greatsql/greatsql-server/test_greatsql-server_mysql_ssl_rsa_setup__uid.sh delete mode 100644 testcases/function_test/pkg_test/greatsql/greatsql-server/test_greatsql-server_mysql_ssl_rsa_setup__upper_v.sh delete mode 100644 testcases/function_test/pkg_test/greatsql/greatsql-server/test_greatsql-server_mysql_ssl_rsa_setup__v.sh delete mode 100644 testcases/function_test/pkg_test/greatsql/greatsql-server/test_greatsql-server_mysql_tzinfo_to_sql_upper_v.sh delete mode 100644 testcases/function_test/pkg_test/greatsql/greatsql-server/test_greatsql-server_mysql_tzinfo_to_sql_v.sh delete mode 100644 testcases/function_test/pkg_test/greatsql/greatsql-server/test_greatsql-server_mysqld_pre_systemd_status.sh delete mode 100644 testcases/function_test/pkg_test/greatsql/greatsql-server/test_greatsql-server_mysqld_pre_systemd_upper_v.sh delete mode 100644 testcases/function_test/pkg_test/greatsql/greatsql-server/test_greatsql-server_mysqld_safe_core_file_size.sh delete mode 100644 testcases/function_test/pkg_test/greatsql/greatsql-server/test_greatsql-server_mysqld_safe_defaults_file.sh delete mode 100644 testcases/function_test/pkg_test/greatsql/greatsql-server/test_greatsql-server_mysqld_safe_ledir.sh delete mode 100644 testcases/function_test/pkg_test/greatsql/greatsql-server/test_greatsql-server_mysqld_safe_malloc_lib.sh delete mode 100644 testcases/function_test/pkg_test/greatsql/greatsql-server/test_greatsql-server_mysqld_safe_mysqld.sh delete mode 100644 testcases/function_test/pkg_test/greatsql/greatsql-server/test_greatsql-server_mysqld_safe_no_defaults.sh delete mode 100644 testcases/function_test/pkg_test/greatsql/greatsql-server/test_greatsql-server_mysqld_safe_open_files_limit.sh delete mode 100644 testcases/function_test/pkg_test/greatsql/greatsql-server/test_greatsql-server_mysqld_safe_timezone.sh delete mode 100644 testcases/function_test/pkg_test/greatsql/greatsql-server/test_greatsql-server_mysqldecompress_file-type_lz4.sh delete mode 100644 testcases/function_test/pkg_test/greatsql/greatsql-server/test_greatsql-server_mysqldecompress_help.sh delete mode 100644 testcases/function_test/pkg_test/greatsql/greatsql-server/test_greatsql-server_mysqldumpslow_num_1.sh delete mode 100644 testcases/function_test/pkg_test/greatsql/greatsql-server/test_greatsql-server_mysqldumpslow_upper_v.sh delete mode 100644 testcases/function_test/pkg_test/greatsql/greatsql-server/test_greatsql-server_mysqldumpslow_v.sh delete mode 100644 testcases/function_test/pkg_test/greatsql/greatsql-server/test_greatsql-server_perror_info.sh delete mode 100644 testcases/function_test/pkg_test/greatsql/greatsql-server/test_greatsql-server_perror_silent.sh delete mode 100644 testcases/function_test/pkg_test/greatsql/greatsql-server/test_greatsql-server_perror_upper_v.sh delete mode 100644 testcases/function_test/pkg_test/greatsql/greatsql-server/test_greatsql-server_perror_verbose.sh delete mode 100644 testcases/function_test/pkg_test/greatsql/greatsql-server/test_greatsql-server_ps_mysqld_helper__upper_v.sh delete mode 100644 testcases/function_test/pkg_test/greatsql/greatsql-server/test_greatsql-server_zlib_decompress_input_output.sh delete mode 100644 testcases/function_test/pkg_test/greatsql/greatsql-server/test_greatsql-server_zstd_decompress_input_output.sh diff --git a/suite2cases/function_test/pkg_test/greatsql/greatsql-server.json b/suite2cases/function_test/pkg_test/greatsql/greatsql-server.json index 2148e887a92..8925dcfda5e 100644 --- a/suite2cases/function_test/pkg_test/greatsql/greatsql-server.json +++ b/suite2cases/function_test/pkg_test/greatsql/greatsql-server.json @@ -10,302 +10,18 @@ "name": "test_greatsql-server_comp_err__upper_t", "desc": "测试 comp_err 命令的自测参数" }, - { - "name": "test_greatsql-server_comp_err__upper_c", - "desc": "测试 comp_err 命令的字符集目录参数" - }, - { - "name": "test_greatsql-server_comp_err__e", - "desc": "测试 comp_err 命令的错误日志输入文件参数" - }, - { - "name": "test_greatsql-server_comp_err__c", - "desc": "测试 comp_err 命令的客户端消息输入文件参数" - }, - { - "name": "test_greatsql-server_comp_err__upper_d", - "desc": "测试 comp_err 命令的输出目录参数" - }, - { - "name": "test_greatsql-server_comp_err__upper_o", - "desc": "测试 comp_err 命令的输出文件名参数" - }, - { - "name": "test_greatsql-server_comp_err__upper_h", - "desc": "测试 comp_err 命令的头文件参数" - }, - { - "name": "test_greatsql-server_comp_err__upper_n", - "desc": "测试 comp_err 命令的名称文件参数" - }, { "name": "test_greatsql-server_ibd2sdi__v", "desc": "测试 ibd2sdi 命令的版本信息显示功能" }, - { - "name": "test_greatsql-server_ibd2sdi__h", - "desc": "测试 ibd2sdi 命令的帮助信息显示功能" - }, - { - "name": "test_greatsql-server_ibd2sdi__d_filename", - "desc": "测试 ibd2sdi 命令将表空间 SDI 转储到指定文件的功能" - }, - { - "name": "test_greatsql-server_ibd2sdi__s", - "desc": "测试 ibd2sdi 命令跳过数据检索,仅检索 ID 和类型的功能" - }, - { - "name": "test_greatsql-server_ibd2sdi__i_num_1", - "desc": "测试 ibd2sdi 命令检索指定 ID 的 SDI 记录的功能" - }, - { - "name": "test_greatsql-server_ibd2sdi__t_num_1", - "desc": "测试 ibd2sdi 命令检索指定类型的 SDI 记录的功能" - }, - { - "name": "test_greatsql-server_ibd2sdi__c_innodb", - "desc": "测试 ibd2sdi 命令使用 innodb 严格校验算法的功能" - }, - { - "name": "test_greatsql-server_ibd2sdi__c_crc32", - "desc": "测试 ibd2sdi 命令使用 crc32 严格校验算法的功能" - }, - { - "name": "test_greatsql-server_ibd2sdi__c_none", - "desc": "测试 ibd2sdi 命令使用 none 严格校验算法的功能" - }, - { - "name": "test_greatsql-server_ibd2sdi__n", - "desc": "测试 ibd2sdi 命令忽略校验验证的功能" - }, - { - "name": "test_greatsql-server_ibd2sdifilename", - "desc": "测试 ibd2sdifilename 参数的基本功能,即不附加任何参数直接解析文件" - }, - { - "name": "test_greatsql-server_innochecksum__upper_v", - "desc": "测试 innochecksum 命令的版本信息显示功能" - }, - { - "name": "test_greatsql-server_innochecksum__v", - "desc": "测试 innochecksum 命令的详细输出模式" - }, - { - "name": "test_greatsql-server_innochecksum__c", - "desc": "测试 innochecksum 命令的页面计数功能" - }, - { - "name": "test_greatsql-server_innochecksum__s_num_10__e_num_20", - "desc": "测试 innochecksum 命令指定起始和结束页面范围的功能" - }, - { - "name": "test_greatsql-server_innochecksum__p_num_5", - "desc": "测试 innochecksum 命令指定单个页面检查的功能" - }, - { - "name": "test_greatsql-server_innochecksum__upper_c_crc32", - "desc": "测试 innochecksum 命令的严格校验算法指定功能" - }, - { - "name": "test_greatsql-server_innochecksum__n", - "desc": "测试 innochecksum 命令忽略校验和验证的功能" - }, - { - "name": "test_greatsql-server_innochecksum__a_num_3", - "desc": "测试 innochecksum 命令允许的最大校验和不匹配数量功能" - }, - { - "name": "test_greatsql-server_innochecksum__w_crc32", - "desc": "测试 innochecksum 命令重写校验和算法的功能" - }, - { - "name": "test_greatsql-server_innochecksum__upper_s", - "desc": "测试 innochecksum 命令显示页面类型摘要的功能" - }, - { - "name": "test_greatsql-server_lz4_decompress_input_output", - "desc": "测试 lz4_decompress 命令的基本功能,输入文件和输出文件参数" - }, - { - "name": "test_greatsql-server_my_print_defaults__c", - "desc": "使用-c参数指定配置文件" - }, - { - "name": "test_greatsql-server_my_print_defaults__upper_v", - "desc": "使用-V参数输出版本信息" - }, - { - "name": "test_greatsql-server_my_print_defaults__v", - "desc": "使用-v参数增加输出级别" - }, - { - "name": "test_greatsql-server_my_print_defaults__e", - "desc": "使用-e参数指定额外配置文件" - }, - { - "name": "test_greatsql-server_my_print_defaults__g", - "desc": "使用-g参数指定组后缀" - }, - { - "name": "test_greatsql-server_my_print_defaults__n", - "desc": "使用-n参数忽略默认选项文件" - }, - { - "name": "test_greatsql-server_my_print_defaults__l", - "desc": "使用-l参数指定登录路径" - }, - { - "name": "test_greatsql-server_my_print_defaults__s", - "desc": "使用-s参数以明文显示密码" - }, - { - "name": "test_greatsql-server_myisam_ftdump_h", - "desc": "测试 myisam_ftdump 命令的帮助选项" - }, - { - "name": "test_greatsql-server_myisam_ftdump_c", - "desc": "测试 myisam_ftdump 命令的统计单词选项" - }, - { - "name": "test_greatsql-server_myisam_ftdump_d", - "desc": "测试 myisam_ftdump 命令的转储索引选项" - }, { "name": "test_greatsql-server_myisam_ftdump_l", "desc": "测试 myisam_ftdump 命令的长度分布报告选项" }, - { - "name": "test_greatsql-server_myisam_ftdump_s", - "desc": "测试 myisam_ftdump 命令的全局统计报告选项" - }, - { - "name": "test_greatsql-server_myisam_ftdump_v", - "desc": "测试 myisam_ftdump 命令的详细输出选项" - }, - { - "name": "test_greatsql-server_myisamlog_p", - "desc": "测试 myisamlog 命令的 p 参数" - }, - { - "name": "test_greatsql-server_mysql_secure_installation_h", - "desc": "测试使用 -h 参数指定主机名" - }, - { - "name": "test_greatsql-server_mysql_secure_installation_p", - "desc": "测试使用 -p 参数指定密码" - }, - { - "name": "test_greatsql-server_mysql_secure_installation_upper_p", - "desc": "测试使用 -P 参数指定端口号" - }, - { - "name": "test_greatsql-server_mysql_secure_installation_protocol", - "desc": "测试使用 --protocol 参数指定连接协议" - }, - { - "name": "test_greatsql-server_mysql_secure_installation_upper_s", - "desc": "测试使用 -S 参数指定套接字文件" - }, - { - "name": "test_greatsql-server_mysql_secure_installation_u", - "desc": "测试使用 -u 参数指定用户" - }, - { - "name": "test_greatsql-server_mysql_ssl_rsa_setup__v", - "desc": "测试 mysql_ssl_rsa_setup 命令的 -v 参数,验证是否能够显示详细运行信息" - }, - { - "name": "test_greatsql-server_mysql_ssl_rsa_setup__upper_v", - "desc": "测试 mysql_ssl_rsa_setup 命令的 -V 参数,验证是否能够显示程序版本信息" - }, - { - "name": "test_greatsql-server_mysql_ssl_rsa_setup__d", - "desc": "测试 mysql_ssl_rsa_setup 命令的 -d 参数,验证是否能够指定生成文件的存储目录" - }, { "name": "test_greatsql-server_mysql_ssl_rsa_setup__s", "desc": "测试 mysql_ssl_rsa_setup 命令的 -s 参数,验证是否能够添加证书主题行的后缀" }, - { - "name": "test_greatsql-server_mysql_ssl_rsa_setup__uid", - "desc": "测试 mysql_ssl_rsa_setup 命令的 --uid 参数,验证是否能够指定文件权限的有效用户ID" - }, - { - "name": "test_greatsql-server_mysql_tzinfo_to_sql_upper_v", - "desc": "测试 mysql_tzinfo_to_sql 命令的 -V 参数" - }, - { - "name": "test_greatsql-server_mysql_tzinfo_to_sql_v", - "desc": "测试 mysql_tzinfo_to_sql 命令的 -v 参数" - }, - { - "name": "test_greatsql-server_mysqld_pre_systemd_upper_v", - "desc": "测试mysqld_pre_systemd命令的-V参数,用于显示版本信息" - }, - { - "name": "test_greatsql-server_mysqld_safe_no_defaults", - "desc": "测试 mysqld_safe 命令的 --no-defaults 参数" - }, - { - "name": "test_greatsql-server_mysqld_safe_defaults_file", - "desc": "测试 mysqld_safe 命令的 --defaults-file 参数" - }, - { - "name": "test_greatsql-server_mysqld_safe_defaults_extra_file", - "desc": "测试 mysqld_safe 命令的 --defaults-extra-file 参数" - }, - { - "name": "test_greatsql-server_mysqld_safe_ledir", - "desc": "测试 mysqld_safe 命令的 --ledir 参数" - }, - { - "name": "test_greatsql-server_mysqld_safe_open_files_limit", - "desc": "测试 mysqld_safe 命令的 --open-files-limit 参数" - }, - { - "name": "test_greatsql-server_mysqld_safe_core_file_size", - "desc": "测试 mysqld_safe 命令的 --core-file-size 参数" - }, - { - "name": "test_greatsql-server_mysqld_safe_timezone", - "desc": "测试 mysqld_safe 命令的 --timezone 参数" - }, - { - "name": "test_greatsql-server_mysqld_safe_malloc_lib", - "desc": "测试 mysqld_safe 命令的 --malloc-lib 参数" - }, - { - "name": "test_greatsql-server_mysqld_safe_mysqld", - "desc": "测试 mysqld_safe 命令的 --mysqld 参数" - }, - { - "name": "test_greatsql-server_mysql_server_upper_version", - "desc": "测试 mysql_server 命令的 _upper_version_upper_v_ersion 参数" - }, - { - "name": "test_greatsql-server_mysqldecompress_help", - "desc": "测试mysqldecompress命令的帮助文档显示" - }, - { - "name": "test_greatsql-server_mysqldecompress_file-type_zstd", - "desc": "测试mysqldecompress命令使用zstd文件类型进行解压" - }, - { - "name": "test_greatsql-server_mysqldecompress_file-type_lz4", - "desc": "测试mysqldecompress命令使用lz4文件类型进行解压" - }, - { - "name": "test_greatsql-server_mysqldecompress_decompress-dir", - "desc": "测试mysqldecompress命令指定解压目录" - }, - { - "name": "test_greatsql-server_mysqldecompress_remove-original_true", - "desc": "测试mysqldecompress命令解压后删除原始文件" - }, - { - "name": "test_greatsql-server_mysqldecompress_remove-original_false", - "desc": "测试mysqldecompress命令解压后保留原始文件" - }, { "name": "test_greatsql-server_mysqldumpslow_help", "desc": "测试mysqldumpslow的--help选项,查看帮助信息" @@ -314,57 +30,9 @@ "name": "test_greatsql-server_mysqldumpslow_version", "desc": "测试mysqldumpslow的--version选项,查看版本信息" }, - { - "name": "test_greatsql-server_mysqldumpslow_v", - "desc": "测试mysqldumpslow的-v参数,查看详细输出模式" - }, - { - "name": "test_greatsql-server_mysqldumpslow_upper_v", - "desc": "测试mysqldumpslow的-V参数,查看版本信息(大写)" - }, - { - "name": "test_greatsql-server_mysqldumpslow_num_1", - "desc": "测试mysqldumpslow的-1参数,查看数字参数的功能" - }, { "name": "test_greatsql-server_perror_help", "desc": "测试 perror 命令的帮助信息显示" - }, - { - "name": "test_greatsql-server_perror_info", - "desc": "测试 perror 命令的 info 参数显示帮助信息" - }, - { - "name": "test_greatsql-server_perror_silent", - "desc": "测试 perror 命令的 silent 参数仅打印错误信息" - }, - { - "name": "test_greatsql-server_perror_verbose", - "desc": "测试 perror 命令的 verbose 参数打印错误代码和信息" - }, - { - "name": "test_greatsql-server_perror_upper_v", - "desc": "测试 perror 命令的 version 参数显示版本信息" - }, - { - "name": "test_greatsql-server_ps_mysqld_helper__upper_v", - "desc": "测试 ps_mysqld_helper 命令的 -V 参数" - }, - { - "name": "test_greatsql-server_zlib_decompress_input_output", - "desc": "测试zlib_decompress命令的基本功能,解压缩输入文件并输出到指定文件" - }, - { - "name": "test_greatsql-server_zstd_decompress_input_output", - "desc": "测试 zstd_decompress 命令的基本功能,解压输入文件到输出文件" - }, - { - "name": "test_greatsql-server_mysqld_pre_systemd_status", - "desc": "检查 mysqld_pre_systemd 服务的状态" - }, - { - "name": "test_greatsql-server_function_basic_lib", - "desc": "测试基础依赖库的基本功能" } ] } \ No newline at end of file diff --git a/testcases/function_test/pkg_test/greatsql/greatsql-server/test_greatsql-server_comp_err__c.sh b/testcases/function_test/pkg_test/greatsql/greatsql-server/test_greatsql-server_comp_err__c.sh deleted file mode 100644 index fd23e55ae52..00000000000 --- a/testcases/function_test/pkg_test/greatsql/greatsql-server/test_greatsql-server_comp_err__c.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 : 2025-12-12 -# @License : Mulan PSL v2 -# @Desc : 测试 comp_err 命令的客户端消息输入文件参数 -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - LOG_INFO "开始测试 comp_err 命令的客户端消息输入文件参数" - - # 检查是否已安装 greatsql-server - LOG_INFO "检查是否已安装 greatsql-server" - if dnf list installed greatsql-server &>/dev/null; then - LOG_INFO "greatsql-server 已安装,脚本结束时将保持安装状态" - INSTALLED=true - else - LOG_INFO "greatsql-server 未安装,将在测试结束后卸载" - INSTALLED=false - fi - - # 检查 yum 源中是否存在 greatsql-server - LOG_INFO "检查 yum 源中是否存在 greatsql-server" - if ! dnf list available greatsql-server &>/dev/null; then - LOG_ERROR "yum 源中未找到 greatsql-server,退出测试" - exit 255 - fi - - # 如果未安装,则安装 greatsql-server - if [ "$INSTALLED" = false ]; then - LOG_INFO "开始安装 greatsql-server" - dnf install -y greatsql-server - CHECK_RESULT $? 0 0 "安装 greatsql-server 失败" - fi - - # 检查 comp_err 命令是否支持客户端消息输入文件参数 - LOG_INFO "检查 comp_err 命令是否支持客户端消息输入文件参数" - if ! comp_err --help | grep -q "client-message-file"; then - LOG_ERROR "comp_err 命令不支持客户端消息输入文件参数,退出测试" - exit 255 - fi - - # 创建临时测试文件 - LOG_INFO "创建临时测试文件" - echo "test_message" > /tmp/test_client_message.txt - - # 执行 comp_err 命令测试客户端消息输入文件参数 - LOG_INFO "执行 comp_err 命令测试客户端消息输入文件参数" - comp_err --client-message-file=/tmp/test_client_message.txt &>/dev/null - CHECK_RESULT $? 0 0 "comp_err 命令执行失败" - - #清理临时文件 - LOG_INFO "清理临时文件" - rm -f /tmp/test_client_message.txt - - #如果最初未安装则卸载 greatql-serve - if [ "$INSTALLED" = false ]; then - LOG_INFO “卸载 greatql-serve” - dnf remove -y greatql-serve - CHECK_RESULT $?00“卸载 greatql-serve 失败” - fi - - LOG_INFO “测试 comp_err 命令的客户端消息输入文件参数完成” -} - -main "$@" \ No newline at end of file diff --git a/testcases/function_test/pkg_test/greatsql/greatsql-server/test_greatsql-server_comp_err__e.sh b/testcases/function_test/pkg_test/greatsql/greatsql-server/test_greatsql-server_comp_err__e.sh deleted file mode 100644 index 194ec0b0b86..00000000000 --- a/testcases/function_test/pkg_test/greatsql/greatsql-server/test_greatsql-server_comp_err__e.sh +++ /dev/null @@ -1,78 +0,0 @@ -#!/usr/bin/bash - -# Copyright (c) 2024 ISCAS .ALL rights reserved. -# This program is licensed under Mulan PSL v2. -# You can use it according to the terms and conditions of the Mulan PSL v2. -# http://license.coscl.org.cn/MulanPSL2 -# THIS PROGRAM IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, -# EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, -# MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. -# See the Mulan PSL v2 for more details. - -# ############################################# -# @Author : honghua -# @Contact : honghua@iscas.ac.cn -# @Date : 2025-12-12 -# @License : Mulan PSL v2 -# @Desc : 测试 comp_err 命令的错误日志输入文件参数 -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - - LOG_INFO "开始测试 comp_err 命令的错误日志输入文件参数" - - # 检查是否已安装 greatsql-server 包 - LOG_INFO "检查是否已安装 greatsql-server 包" - if dnf list installed greatsql-server &>/dev/null; then - LOG_INFO "greatsql-server 已安装" - INSTALLED=true - else - LOG_INFO "greatsql-server 未安装" - INSTALLED=false - fi - - # 检查 yum 源中是否有 greatsql-server 包 - LOG_INFO "检查 yum 源中是否有 greatsql-server 包" - if ! dnf list available greatsql-server &>/dev/null; then - LOG_ERROR "yum 源中没有 greatsql-server 包" - exit 255 - fi - - # 如果未安装,则安装 greatsql-server - if [ "$INSTALLED" = false ]; then - LOG_INFO "安装 greatsql-server 包" - dnf install -y greatsql-server - CHECK_RESULT $? 0 0 "安装 greatsql-server 失败" - fi - - # 测试 comp_err 命令的错误日志输入文件参数 - LOG_INFO "测试 comp_err 命令的错误日志输入文件参数" - comp_err --help | grep "input-file" &>/dev/null - CHECK_RESULT $? 0 0 "--input-file 参数不支持" - - # comp_err 命令测试:无效输入文件 - LOG_INFO "测试无效输入文件场景" - comp_err --input-file /nonexistent/file &>/dev/null - CHECK_RESULT $? !0 0 "无效输入文件未检测到错误" - - # comp_err 命令测试:有效输入文件(假设存在 /tmp/error.log) - LOG_INFO "测试有效输入文件场景" - echo "test error" > /tmp/error.log - comp_err --input-file /tmp/error.log &>/dev/null - CHECK_RESULT $? 0 0 "有效输入文件执行失败" - rm -f /tmp/error.log - - # cleanup: 如果最初未安装,则卸载 greatsql-server - if [ "$INSTALLED" = false ]; then - LOG_INFO "卸载 greatsql-server" - dnf remove -y greatsql-server - CHECK_RESULT $? 0 0 "卸载 greatsql-server失败" - fi - - LOG_INFO “测试完成” - -} - -main "$@" \ No newline at end of file diff --git a/testcases/function_test/pkg_test/greatsql/greatsql-server/test_greatsql-server_comp_err__upper_c.sh b/testcases/function_test/pkg_test/greatsql/greatsql-server/test_greatsql-server_comp_err__upper_c.sh deleted file mode 100644 index 00787720041..00000000000 --- a/testcases/function_test/pkg_test/greatsql/greatsql-server/test_greatsql-server_comp_err__upper_c.sh +++ /dev/null @@ -1,68 +0,0 @@ -#!/usr/bin/bash - -# Copyright (c) 2024 ISCAS .ALL rights reserved. -# This program is licensed under Mulan PSL v2. -# You can use it according to the terms and conditions of the Mulan PSL v2. -# http://license.coscl.org.cn/MulanPSL2 -# THIS PROGRAM IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, -# EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, -# MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. -# See the Mulan PSL v2 for more details. - -# ############################################# -# @Author : honghua -# @Contact : honghua@iscas.ac.cn -# @Date : 2025-12-12 -# @License : Mulan PSL v2 -# @Desc : 测试 comp_err 命令的字符集目录参数 -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - - # 检查环境是否已安装GreatSQL - LOG_INFO "检查GreatSQL是否已安装..." - if dnf list installed greatsql-server &>/dev/null; then - LOG_INFO "GreatSQL已安装,脚本结束时将保持安装状态" - INSTALLED=true - else - LOG_INFO "GreatSQL未安装,脚本结束时将卸载" - INSTALLED=false - fi - - # 检查yum源中是否存在GreatSQL软件包 - LOG_INFO "检查yum源中是否存在GreatSQL软件包..." - if ! dnf list available greatsql-server &>/dev/null; then - LOG_ERROR "yum源中未找到GreatSQL软件包" - exit 255 - fi - - # 安装GreatSQL(如果未安装) - if [ "$INSTALLED" = false ]; then - LOG_INFO "开始安装GreatSQL..." - dnf install -y greatsql-server - CHECK_RESULT $? 0 0 "安装GreatSQL失败" - fi - - # 测试comp_err命令的字符集目录参数 - LOG_INFO "测试comp_err命令的字符集目录参数..." - comp_err --help | grep charset-dir &>/dev/null - CHECK_RESULT $? 0 0 "comp_err命令不支持charset-dir参数" - - LOG_INFO "执行comp_err命令测试..." - comp_err --charset-dir=/usr/share/mysql/charsets/ - CHECK_RESULT $? 0 0 "comp_err命令执行失败" - - # 清理环境(如果脚本开始时未安装) - if [ "$INSTALLED" = false ]; then - LOG_INFO "卸载GreatSQL..." - dnf remove -y greatsql-server - CHECK_RESULT $? 0 0 "卸载GreatSQL失败" - fi - - LOG_INFO "测试脚本执行完毕" - -} - -main "$@" \ No newline at end of file diff --git a/testcases/function_test/pkg_test/greatsql/greatsql-server/test_greatsql-server_comp_err__upper_d.sh b/testcases/function_test/pkg_test/greatsql/greatsql-server/test_greatsql-server_comp_err__upper_d.sh deleted file mode 100644 index ae52b14e776..00000000000 --- a/testcases/function_test/pkg_test/greatsql/greatsql-server/test_greatsql-server_comp_err__upper_d.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 : 2025-12-12 -# @License : Mulan PSL v2 -# @Desc : 测试 comp_err 命令的输出目录参数 -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - - # 检查是否已安装GreatSQL-server - LOG_INFO "检查是否已安装GreatSQL-server" - if dnf list installed greatsql-server &>/dev/null; then - LOG_INFO "GreatSQL-server已安装,脚本结束时将保持安装状态" - installed=true - else - LOG_INFO "GreatSQL-server未安装,将在测试结束后卸载" - installed=false - fi - - # 检查yum源中是否存在GreatSQL-server软件包 - LOG_INFO "检查yum源中是否存在GreatSQL-server软件包" - if ! dnf list available greatsql-server &>/dev/null; then - LOG_ERROR "yum源中未找到GreatSQL-server软件包" - exit 255 - fi - - # 安装GreatSQL-server - if [ "$installed" = false ]; then - LOG_INFO "安装GreatSQL-server" - dnf install -y greatsql-server - CHECK_RESULT $? 0 0 "安装GreatSQL-server失败" - fi - - # 测试comp_err命令的输出目录参数 - LOG_INFO "测试comp_err命令的输出目录参数" - output_dir="/tmp/comp_err_test" - mkdir -p "$output_dir" - comp_err --output-dir="$output_dir" - CHECK_RESULT $? 0 0 "comp_err命令执行失败" - - # 检查输出目录是否生成文件 - LOG_INFO "检查输出目录是否生成文件" - if [ -f "$output_dir/errmsg.sys" ]; then - LOG_INFO "输出目录成功生成文件" - else - LOG_ERROR "输出目录未生成文件" - exit 1 - fi - - # 清理输出目录 - LOG_INFO "清理输出目录" - rm -rf "$output_dir" - - # 如果脚本开始时未安装GreatSQL-server,则在结束时卸载 - if [ "$installed" = false ]; then - LOG_INFO "卸载GreatSQL-server" - dnf remove -y greatsql-server - CHECK_RESULT $? 0 0 "卸载GreatSQL-server失败" - fi - - LOG_INFO "测试脚本执行完成" - -} - -main "$@" \ No newline at end of file diff --git a/testcases/function_test/pkg_test/greatsql/greatsql-server/test_greatsql-server_comp_err__upper_h.sh b/testcases/function_test/pkg_test/greatsql/greatsql-server/test_greatsql-server_comp_err__upper_h.sh deleted file mode 100644 index 47094cb5d5a..00000000000 --- a/testcases/function_test/pkg_test/greatsql/greatsql-server/test_greatsql-server_comp_err__upper_h.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-12 -# @License : Mulan PSL v2 -# @Desc : 测试 comp_err 命令的头文件参数 -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - - LOG_INFO "开始测试 comp_err 命令的头文件参数" - - # 检查是否已安装 greatsql-server 软件包 - if dnf list installed greatsql-server &>/dev/null; then - LOG_INFO "环境已安装 greatsql-server 软件包,脚本结束后将保持安装状态" - INSTALLED=true - else - LOG_INFO "环境未安装 greatsql-server 软件包,将在测试结束后卸载" - INSTALLED=false - fi - - # 检查 yum 源中是否存在 greatsql-server 软件包 - if ! dnf list available greatsql-server &>/dev/null; then - LOG_ERROR "yum 源中未找到 greatsql-server 软件包" - exit 255 - fi - - # 安装 greatsql-server 软件包(如果未安装) - if [ "$INSTALLED" = false ]; then - LOG_INFO "正在安装 greatsql-server 软件包" - dnf install -y greatsql-server - CHECK_RESULT $? 0 0 "安装 greatsql-server 失败" - fi - - # 测试 comp_err 命令的头文件参数 - LOG_INFO "测试 comp_err --header-file 参数" - comp_err --header-file /tmp/test_header.h &>/dev/null - CHECK_RESULT $? 0 0 "comp_err --header-file 参数不支持或执行失败" - - # 清理环境(如果最初未安装) - if [ "$INSTALLED" = false ]; then - LOG_INFO "正在卸载 greatsql-server 软件包" - dnf remove -y greatsql-server - CHECK_RESULT $? 0 0 "卸载 greatsql-server 失败" - fi - - LOG_INFO "测试完成,环境已恢复" - -} - -main "$@" \ No newline at end of file diff --git a/testcases/function_test/pkg_test/greatsql/greatsql-server/test_greatsql-server_comp_err__upper_n.sh b/testcases/function_test/pkg_test/greatsql/greatsql-server/test_greatsql-server_comp_err__upper_n.sh deleted file mode 100644 index cb6209078c6..00000000000 --- a/testcases/function_test/pkg_test/greatsql/greatsql-server/test_greatsql-server_comp_err__upper_n.sh +++ /dev/null @@ -1,81 +0,0 @@ -#!/usr/bin/bash - -# Copyright (c) 2024 ISCAS .ALL rights reserved. -# This program is licensed under Mulan PSL v2. -# You can use it according to the terms and conditions of the Mulan PSL v2. -# http://license.coscl.org.cn/MulanPSL2 -# THIS PROGRAM IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, -# EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, -# MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. -# See the Mulan PSL v2 for more details. - -# ############################################# -# @Author : honghua -# @Contact : honghua@iscas.ac.cn -# @Date : 2025-12-12 -# @License : Mulan PSL v2 -# @Desc : 测试 comp_err 命令的名称文件参数 -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - - LOG_INFO "开始测试 comp_err 命令的名称文件参数" - - # 检查软件包是否已安装 - LOG_INFO "检查 GreatSQL Server 是否已安装" - if dnf list installed greatsql-server &>/dev/null; then - LOG_INFO "GreatSQL Server 已安装,测试结束后将保持安装状态" - INSTALLED=true - else - LOG_INFO "GreatSQL Server 未安装,将在测试结束后卸载" - INSTALLED=false - fi - - # 检查 yum 源中是否存在软件包 - LOG_INFO "检查 yum 源中是否存在 GreatSQL Server 软件包" - if ! dnf list available greatsql-server &>/dev/null; then - LOG_ERROR "yum 源中未找到 GreatSQL Server 软件包" - exit 255 - fi - - # 安装软件包(如果未安装) - if [ "$INSTALLED" = false ]; then - LOG_INFO "正在安装 GreatSQL Server" - dnf install -y greatsql-server || { - LOG_ERROR "安装 GreatSQL Server 失败" - exit 1 - } - fi - - # 测试 comp_err 命令的名称文件参数 - LOG_INFO "测试 comp_err 命令的名称文件参数" - comp_err --help &>/dev/null || { - LOG_ERROR "comp_err 命令不支持或参数错误" - exit 255 - } - - # 检查 comp_err 命令是否支持名称文件参数(假设 --name-file 是支持的参数) - LOG_INFO "检查 comp_err --name-file /tmp/test.txt" - comp_err --name-file /tmp/test.txt &>/dev/null || { - LOG_ERROR "--name-file 参数不支持或文件不存在" - exit $? - } - - CHECK_RESULT $? 0 0 "comp_err --name-file 执行失败" - - # 清理环境(如果之前未安装) - if [ "$INSTALLED" = false ]; then - LOG_INFO "卸载 GreatSQL Server" - dnf remove -y greatsql-server || { - LOG_ERROR "卸载 GreatSQL Server 失败" - exit $? - } - fi - - LOG_INFO "测试完成,环境已恢复初始状态" - -} - -main "$@" \ No newline at end of file diff --git a/testcases/function_test/pkg_test/greatsql/greatsql-server/test_greatsql-server_comp_err__upper_o.sh b/testcases/function_test/pkg_test/greatsql/greatsql-server/test_greatsql-server_comp_err__upper_o.sh deleted file mode 100644 index 5cc77e55f6b..00000000000 --- a/testcases/function_test/pkg_test/greatsql/greatsql-server/test_greatsql-server_comp_err__upper_o.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-12-12 -# @License : Mulan PSL v2 -# @Desc : 测试 comp_err 命令的输出文件名参数 -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - LOG_INFO "开始测试 comp_err 命令的输出文件名参数" - - # 检查是否已安装 greatsql-server 软件包 - LOG_INFO "检查是否已安装 greatsql-server" - if dnf list installed greatsql-server &>/dev/null; then - LOG_INFO "greatsql-server 已安装,测试结束后将保持安装状态" - INSTALLED=true - else - LOG_INFO "greatsql-server 未安装,测试结束后将卸载" - INSTALLED=false - fi - - # 检查 yum 源中是否存在 greatsql-server 软件包 - LOG_INFO "检查 yum 源中是否存在 greatsql-server" - if ! dnf list available greatsql-server &>/dev/null; then - LOG_ERROR "yum 源中未找到 greatsql-server 软件包" - exit 255 - fi - - # 如果未安装,则安装 greatsql-server - if [ "$INSTALLED" = false ]; then - LOG_INFO "安装 greatsql-server" - dnf install -y greatsql-server - CHECK_RESULT $? 0 0 "安装 greatsql-server 失败" - fi - - # 测试 comp_err 命令的输出文件名参数 - LOG_INFO "测试 comp_err 命令的输出文件名参数" - comp_err --output=test_output.txt - CHECK_RESULT $? 0 0 "comp_err 命令执行失败" - - # 检查输出文件是否存在 - LOG_INFO "检查输出文件是否存在" - if [ -f "test_output.txt" ]; then - LOG_INFO "输出文件 test_output.txt 已生成" - else - LOG_ERROR "输出文件 test_output.txt 未生成" - exit 1 - fi - - # 清理测试生成的文件 - LOG_INFO "清理测试生成的文件" - rm -f test_output.txt - - # 如果测试前未安装,则卸载 greatsql-server - if [ "$INSTALLED" = false ]; then - LOG_INFO "卸载 greatsql-server" - dnf remove -y greatsql-server - CHECK_RESULT $? 0 0 "卸载 greatsql-server失败" - fi - - LOG_INFO "测试 comp_err 命令的输出文件名参数完成" -} - -main "$@" \ No newline at end of file diff --git a/testcases/function_test/pkg_test/greatsql/greatsql-server/test_greatsql-server_function_basic_lib.sh b/testcases/function_test/pkg_test/greatsql/greatsql-server/test_greatsql-server_function_basic_lib.sh deleted file mode 100644 index 7dcc7139da8..00000000000 --- a/testcases/function_test/pkg_test/greatsql/greatsql-server/test_greatsql-server_function_basic_lib.sh +++ /dev/null @@ -1,72 +0,0 @@ -#!/usr/bin/bash - -# Copyright (c) 2024 ISCAS .ALL rights reserved. -# This program is licensed under Mulan PSL v2. -# You can use it according to the terms and conditions of the Mulan PSL v2. -# http://license.coscl.org.cn/MulanPSL2 -# THIS PROGRAM IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, -# EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, -# MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. -# See the Mulan PSL v2 for more details. - -# ############################################# -# @Author : honghua -# @Contact : honghua@iscas.ac.cn -# @Date : 2025-12-12 -# @License : Mulan PSL v2 -# @Desc : 测试基础依赖库的基本功能 -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - - # 检查是否已安装GreatSQL-server软件包 - LOG_INFO "检查GreatSQL-server是否已安装..." - if dnf list installed greatsql-server &>/dev/null; then - LOG_INFO "GreatSQL-server已安装,保持环境状态..." - installed=true - else - LOG_INFO "GreatSQL-server未安装,将在测试完成后卸载..." - installed=false - fi - - # 检查yum源中是否存在GreatSQL-server软件包 - LOG_INFO "检查yum源中是否存在GreatSQL-server软件包..." - if ! dnf list available greatsql-server &>/dev/null; then - LOG_ERROR "yum源中未找到GreatSQL-server软件包,退出测试..." - exit 255 - fi - - # 安装GreatSQL-server软件包(如果未安装) - if [ "$installed" = false ]; then - LOG_INFO "开始安装GreatSQL-server软件包..." - dnf install -y greatsql-server - CHECK_RESULT $? 0 0 "安装GreatSQL-server失败" - fi - - # 测试基础依赖库的基本功能 - LOG_INFO "测试基础依赖库的基本功能..." - - # 示例:检查GreatSQL-server版本 - LOG_INFO "检查GreatSQL-server版本..." - greatsql-server --version &>/dev/null - CHECK_RESULT $? 0 0 "获取GreatSQL-server版本失败" - - # 示例:检查是否支持指定参数 - LOG_INFO "检查是否支持--help参数..." - greatsql-server --help &>/dev/null - CHECK_RESULT $? 0 0 "不支持--help参数" - - # 清理环境(如果之前未安装) - if [ "$installed" = false ]; then - LOG_INFO "卸载GreatSQL-server软件包..." - dnf remove -y greatsql-server - CHECK_RESULT $? 0 0 "卸载GreatSQL-server失败" - fi - - LOG_INFO "测试脚本执行完毕,环境已恢复..." - -} - -main "$@" \ No newline at end of file diff --git a/testcases/function_test/pkg_test/greatsql/greatsql-server/test_greatsql-server_ibd2sdi__c_crc32.sh b/testcases/function_test/pkg_test/greatsql/greatsql-server/test_greatsql-server_ibd2sdi__c_crc32.sh deleted file mode 100644 index 1fffa7c7a9f..00000000000 --- a/testcases/function_test/pkg_test/greatsql/greatsql-server/test_greatsql-server_ibd2sdi__c_crc32.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-12 -# @License : Mulan PSL v2 -# @Desc : 测试 ibd2sdi 命令使用 crc32 严格校验算法的功能 -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - # 检查是否已安装greatsql-server软件包 - LOG_INFO "检查是否已安装greatsql-server软件包" - if dnf list installed greatsql-server &>/dev/null; then - LOG_INFO "greatsql-server已安装,脚本结束后将保持安装状态" - installed=true - else - LOG_INFO "greatsql-server未安装,将在测试完成后卸载" - installed=false - fi - - # 检查yum源中是否存在greatsql-server软件包 - LOG_INFO "检查yum源中是否存在greatsql-server软件包" - if ! dnf list available greatsql-server &>/dev/null; then - LOG_ERROR "yum源中未找到greatsql-server软件包" - exit 255 - fi - - # 安装greatsql-server软件包 - LOG_INFO "安装greatsql-server软件包" - dnf install -y greatsql-server - CHECK_RESULT $? 0 0 "安装greatsql-server失败" - - # 检查ibd2sdi命令是否支持crc32参数 - LOG_INFO "检查ibd2sdi命令是否支持crc32参数" - if ! ibd2sdi --help | grep -q "crc32"; then - LOG_ERROR "ibd2sdi命令不支持crc32参数" - exit 255 - fi - - # 测试ibd2sdi命令使用crc32严格校验算法的功能 - LOG_INFO "测试ibd2sdi命令使用crc32严格校验算法的功能" - ibd2sdi --crc32 test.ibd > /dev/null 2>&1 - CHECK_RESULT $? 0 0 "ibd2sdi命令执行失败" - - # 清理环境 - if [ "$installed" = false ]; then - LOG_INFO "卸载greatsql-server软件包" - dnf remove -y greatsql-server - CHECK_RESULT $? 0 0 "卸载greatsql-server失败" - fi -} - -main "$@" \ No newline at end of file diff --git a/testcases/function_test/pkg_test/greatsql/greatsql-server/test_greatsql-server_ibd2sdi__c_innodb.sh b/testcases/function_test/pkg_test/greatsql/greatsql-server/test_greatsql-server_ibd2sdi__c_innodb.sh deleted file mode 100644 index 2c974670c89..00000000000 --- a/testcases/function_test/pkg_test/greatsql/greatsql-server/test_greatsql-server_ibd2sdi__c_innodb.sh +++ /dev/null @@ -1,74 +0,0 @@ -#!/usr/bin/bash - -# Copyright (c) 2024 ISCAS .ALL rights reserved. -# This program is licensed under Mulan PSL v2. -# You can use it according to the terms and conditions of the Mulan PSL v2. -# http://license.coscl.org.cn/MulanPSL2 -# THIS PROGRAM IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, -# EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, -# MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. -# See the Mulan PSL v2 for more details. - -# ############################################# -# @Author : honghua -# @Contact : honghua@iscas.ac.cn -# @Date : 2025-12-12 -# @License : Mulan PSL v2 -# @Desc : 测试 ibd2sdi 命令使用 innodb 严格校验算法的功能 -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - LOG_INFO "开始测试 ibd2sdi 命令使用 innodb 严格校验算法的功能" - - # 检查软件包是否在yum源中 - LOG_INFO "检查GreatSQL-server软件包是否在yum源中" - dnf list available GreatSQL-server &>/dev/null - if [ $? -ne 0 ]; then - LOG_ERROR "GreatSQL-server软件包不在yum源中" - exit 255 - fi - - # 检查环境是否已安装 - LOG_INFO "检查环境是否已安装GreatSQL-server" - rpm -q GreatSQL-server &>/dev/null - if [ $? -eq 0 ]; then - installed=true - LOG_INFO "环境已安装GreatSQL-server" - else - installed=false - LOG_INFO "环境未安装GreatSQL-server,将进行安装" - fi - - # 如果未安装,则安装软件包 - if [ "$installed" = false ]; then - LOG_INFO "安装GreatSQL-server软件包" - dnf install -y GreatSQL-server - CHECK_RESULT $? 0 0 "安装GreatSQL-server失败" - fi - - # 检查ibd2sdi命令是否存在 - LOG_INFO "检查ibd2sdi命令是否存在" - which ibd2sdi &>/dev/null - if [ $? -ne 0 ]; then - LOG_ERROR "ibd2sdi命令不存在或不支持" - exit 255 - fi - - # 测试ibd2sdi命令使用innodb严格校验算法 - LOG_INFO "测试ibd2sdi命令使用innodb严格校验算法" - ibd2sdi --strict-check=innodb /var/lib/mysql/testdb/test_table.ibd - CHECK_RESULT $? 0 0 "ibd2sdi命令执行失败" - - # 清理环境 - if [ "$installed" = false ]; then - LOG_INFO "卸载GreatSQL-server软件包" - dnf remove -y GreatSQL-server - CHECK_RESULT $? 0 0 "卸载GreatSQL-server失败" - fi - - LOG_INFO "测试完成,环境已恢复" -} - -main "$@" \ No newline at end of file diff --git a/testcases/function_test/pkg_test/greatsql/greatsql-server/test_greatsql-server_ibd2sdi__c_none.sh b/testcases/function_test/pkg_test/greatsql/greatsql-server/test_greatsql-server_ibd2sdi__c_none.sh deleted file mode 100644 index 4c98a3a0a48..00000000000 --- a/testcases/function_test/pkg_test/greatsql/greatsql-server/test_greatsql-server_ibd2sdi__c_none.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-12-12 -# @License : Mulan PSL v2 -# @Desc : 测试 ibd2sdi 命令使用 none 严格校验算法的功能 -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - - # 检查是否已安装GreatSQL-server软件包 - LOG_INFO "检查是否已安装GreatSQL-server软件包" - if dnf list installed greatsql-server &>/dev/null; then - LOG_INFO "GreatSQL-server已安装,脚本结束时将保持安装状态" - INSTALLED=true - else - LOG_INFO "GreatSQL-server未安装,将在测试结束后卸载" - INSTALLED=false - fi - - # 检查yum源中是否存在GreatSQL-server软件包 - LOG_INFO "检查yum源中是否存在GreatSQL-server软件包" - if ! dnf list available greatsql-server &>/dev/null; then - LOG_ERROR "yum源中未找到GreatSQL-server软件包" - exit 255 - fi - - # 安装GreatSQL-server软件包(如果未安装) - if [ "$INSTALLED" = false ]; then - LOG_INFO "正在安装GreatSQL-server软件包" - dnf install -y greatsql-server || { - LOG_ERROR "安装GreatSQL-server失败" - exit 1 - } - fi - - # 检查ibd2sdi命令是否支持none参数 - LOG_INFO "检查ibd2sdi命令是否支持none参数" - if ! ibd2sdi --help | grep -q "none"; then - LOG_ERROR "ibd2sdi命令不支持none参数" - exit 255 - fi - - # 测试ibd2sdi命令使用none严格校验算法的功能 - LOG_INFO "测试ibd2sdi命令使用none严格校验算法的功能" - ibd2sdi --strict=none /var/lib/mysql/test.ibd &>/dev/null - CHECK_RESULT $? 0 0 "ibd2sdi命令执行失败" - - # 清理环境(如果脚本开始时未安装GreatSQL-server) - if [ "$INSTALLED" = false ]; then - LOG_INFO "正在卸载GreatSQL-server软件包" - dnf remove -y greatsql-server || { - LOG_ERROR "卸载GreatSQL-server失败" - exit 1 - } - fi - - LOG_INFO "测试脚本执行完毕,环境已恢复" - -} - -main "$@" \ No newline at end of file diff --git a/testcases/function_test/pkg_test/greatsql/greatsql-server/test_greatsql-server_ibd2sdi__d_filename.sh b/testcases/function_test/pkg_test/greatsql/greatsql-server/test_greatsql-server_ibd2sdi__d_filename.sh deleted file mode 100644 index f3d06cd10b2..00000000000 --- a/testcases/function_test/pkg_test/greatsql/greatsql-server/test_greatsql-server_ibd2sdi__d_filename.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-12-12 -# @License : Mulan PSL v2 -# @Desc : 测试 ibd2sdi 命令将表空间 SDI 转储到指定文件的功能 -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - # 检查是否已安装greatsql-server软件包 - LOG_INFO "检查是否已安装greatsql-server软件包" - if dnf list installed greatsql-server &>/dev/null; then - LOG_INFO "greatsql-server已安装,脚本结束后将保持安装状态" - installed=true - else - LOG_INFO "greatsql-server未安装,脚本结束后将卸载" - installed=false - fi - - # 检查yum源中是否存在greatsql-server软件包 - LOG_INFO "检查yum源中是否存在greatsql-server软件包" - if ! dnf list available greatsql-server &>/dev/null; then - LOG_ERROR "yum源中不存在greatsql-server软件包" - exit 255 - fi - - # 如果未安装,则安装greatsql-server - if [ "$installed" = false ]; then - LOG_INFO "开始安装greatsql-server" - dnf install -y greatsql-server - CHECK_RESULT $? 0 0 "安装greatsql-server失败" - fi - - # 检查ibd2sdi命令是否存在 - LOG_INFO "检查ibd2sdi命令是否存在" - if ! command -v ibd2sdi &>/dev/null; then - LOG_ERROR "ibd2sdi命令不存在或不支持" - exit 255 - fi - - # 测试ibd2sci命令将表空间SDI转储到指定文件的功能 - LOG_INFO "测试ibd2sdi命令将表空间SDI转储到指定文件的功能" - test_file="/tmp/test_sdi_output" - ibd2sdi /var/lib/mysql/testdb/test_table.ibd > "$test_file" - CHECK_RESULT $? 0 0 "执行ibd2sdi命令失败" - - # 检查输出文件是否存在且非空 - LOG_INFO "检查输出文件是否存在且非空" - if [ -s "$test_file" ]; then - LOG_INFO "SDI转储成功,输出文件已生成" - else - LOG_ERROR "SDI转储失败,输出文件为空或不存在" - exit 1 - fi - - # 清理测试文件 - LOG_INFO "清理测试文件" - rm -f "$test_file" - - # 如果脚本开始时未安装greatsql-server,则在结束时卸载它 - if [ "$installed" = false ]; then - LOG_INFO "卸载greatsql-server" - dnf remove -y greatsql-server - CHECK_RESULT $? 0 0 "卸载greatsql-server失败" - fi - - LOG_INFO "测试完成,环境已恢复" -} - -main "$@" \ No newline at end of file diff --git a/testcases/function_test/pkg_test/greatsql/greatsql-server/test_greatsql-server_ibd2sdi__h.sh b/testcases/function_test/pkg_test/greatsql/greatsql-server/test_greatsql-server_ibd2sdi__h.sh deleted file mode 100644 index feaeac7acbc..00000000000 --- a/testcases/function_test/pkg_test/greatsql/greatsql-server/test_greatsql-server_ibd2sdi__h.sh +++ /dev/null @@ -1,68 +0,0 @@ -#!/usr/bin/bash - -# Copyright (c) 2024 ISCAS .ALL rights reserved. -# This program is licensed under Mulan PSL v2. -# You can use it according to the terms and conditions of the Mulan PSL v2. -# http://license.coscl.org.cn/MulanPSL2 -# THIS PROGRAM IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, -# EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, -# MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. -# See the Mulan PSL v2 for more details. - -# ############################################# -# @Author : honghua -# @Contact : honghua@iscas.ac.cn -# @Date : 2025-12-12 -# @License : Mulan PSL v2 -# @Desc : 测试 ibd2sdi 命令的帮助信息显示功能 -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - - # 检查yum源中是否存在greatsql-server软件包 - LOG_INFO "检查yum源中是否存在greatsql-server软件包" - dnf list available greatsql-server >/dev/null 2>&1 - if [ $? -ne 0 ]; then - LOG_ERROR "yum源中不存在greatsql-server软件包" - exit 255 - fi - - # 检查是否已安装greatsql-server - LOG_INFO "检查是否已安装greatsql-server" - rpm -q greatsql-server >/dev/null 2>&1 - installed=$? - - # 如果未安装,则安装软件包 - if [ $installed -ne 0 ]; then - LOG_INFO "安装greatsql-server软件包" - dnf install -y greatsql-server - CHECK_RESULT $? 0 0 "安装greatsql-server失败" - fi - - # 检查ibd2sdi命令是否存在 - LOG_INFO "检查ibd2sdi命令是否存在" - which ibd2sdi >/dev/null 2>&1 - if [ $? -ne 0 ]; then - LOG_ERROR "ibd2sdi命令不存在" - exit 255 - fi - - # 测试ibd2sdi命令的帮助信息显示功能 - LOG_INFO "测试ibd2sdi命令的帮助信息显示功能" - ibd2sdi --help >/dev/null 2>&1 - CHECK_RESULT $? 0 0 "ibd2sdi命令帮助信息显示失败" - - # 如果最初未安装,则卸载软件包 - if [ $installed -ne 0 ]; then - LOG_INFO "卸载greatsql-server软件包" - dnf remove -y greatsql-server - CHECK_RESULT $? 0 0 "卸载greatsql-server失败" - fi - - LOG_INFO "测试脚本执行完毕" - -} - -main "$@" \ No newline at end of file diff --git a/testcases/function_test/pkg_test/greatsql/greatsql-server/test_greatsql-server_ibd2sdi__i_num_1.sh b/testcases/function_test/pkg_test/greatsql/greatsql-server/test_greatsql-server_ibd2sdi__i_num_1.sh deleted file mode 100644 index 9d876432254..00000000000 --- a/testcases/function_test/pkg_test/greatsql/greatsql-server/test_greatsql-server_ibd2sdi__i_num_1.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-12 -# @License : Mulan PSL v2 -# @Desc : 测试 ibd2sdi 命令检索指定 ID 的 SDI 记录的功能 -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - # 检查是否已安装GreatSQL服务器软件包 - LOG_INFO "检查是否已安装GreatSQL服务器软件包" - if dnf list installed greatsql-server &>/dev/null; then - LOG_INFO "GreatSQL服务器软件包已安装" - INSTALLED=true - else - LOG_INFO "GreatSQL服务器软件包未安装" - INSTALLED=false - fi - - # 检查yum源中是否存在GreatSQL服务器软件包 - LOG_INFO "检查yum源中是否存在GreatSQL服务器软件包" - if ! dnf list available greatsql-server &>/dev/null; then - LOG_ERROR "yum源中不存在GreatSQL服务器软件包" - exit 255 - fi - - # 如果未安装,则安装GreatSQL服务器软件包 - if [ "$INSTALLED" = false ]; then - LOG_INFO "开始安装GreatSQL服务器软件包" - dnf install -y greatsql-server - CHECK_RESULT $? 0 0 "安装GreatSQL服务器软件包失败" - fi - - # 检查ibd2sdi命令是否支持-i参数 - LOG_INFO "检查ibd2sdi命令是否支持-i参数" - if ! ibd2sdi --help | grep -q "\-i"; then - LOG_ERROR "ibd2sdi命令不支持-i参数" - exit 255 - fi - - # 测试ibd2sdi命令检索指定ID的SDI记录的功能 - LOG_INFO "测试ibd2sdi命令检索指定ID的SDI记录的功能" - ibd2sdi -i 1 /var/lib/mysql/test/test_table.ibd - CHECK_RESULT $? 0 0 "ibd2sdi命令检索指定ID的SDI记录失败" - - # 如果脚本开始时未安装,则在脚本结束前卸载GreatSQL服务器软件包 - if [ "$INSTALLED" = false ]; then - LOG_INFO "卸载GreatSQL服务器软件包" - dnf remove -y greatsql-server - CHECK_RESULT $? 0 0 "卸载GreatSQL服务器软件包失败" - fi - - LOG_INFO "测试脚本执行完成" -} - -main "$@" \ No newline at end of file diff --git a/testcases/function_test/pkg_test/greatsql/greatsql-server/test_greatsql-server_ibd2sdi__n.sh b/testcases/function_test/pkg_test/greatsql/greatsql-server/test_greatsql-server_ibd2sdi__n.sh deleted file mode 100644 index 0500cf9e750..00000000000 --- a/testcases/function_test/pkg_test/greatsql/greatsql-server/test_greatsql-server_ibd2sdi__n.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-12-12 -# @License : Mulan PSL v2 -# @Desc : 测试 ibd2sdi 命令忽略校验验证的功能 -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - - # 检查软件包是否已安装 - check_package_installed() { - rpm -q "$1" &> /dev/null - return $? - } - - # 检查yum源中是否有软件包 - check_package_in_repo() { - dnf list available "$1" &> /dev/null - if [ $? -ne 0 ]; then - LOG_ERROR "软件包 $1 不在yum源中" - exit 255 - fi - } - - # 安装软件包 - install_package() { - LOG_INFO "正在安装软件包 $1" - dnf install -y "$1" - CHECK_RESULT $? 0 0 "安装软件包 $1 失败" - } - - # 卸载软件包 - uninstall_package() { - LOG_INFO "正在卸载软件包 $1" - dnf remove -y "$1" - CHECK_RESULT $? 0 0 "卸载软件包 $1 失败" - } - - # 检查命令是否存在 - check_command() { - command -v "$1" &> /dev/null - if [ $? -ne 0 ]; then - LOG_ERROR "命令 $1 不存在或不支持" - exit 255 - fi - } - - # 主函数 - main() { - LOG_INFO "开始测试 ibd2sdi 命令忽略校验验证的功能" - - # 检查环境是否已安装 - check_package_installed "greatsql-server" - if [ $? -eq 0 ]; then - LOG_INFO "环境已安装 greatsql-server,脚本结束后将保持安装状态" - installed=true - else - LOG_INFO "环境未安装 greatsql-server,脚本结束后将卸载软件包" - installed=false - check_package_in_repo "greatsql-server" - install_package "greatsql-server" - fi - - # 检查 ibd2sdi 命令是否存在 - check_command "ibd2sdi" - - # 测试 ibd2sdi --no-verify 功能 - LOG_INFO "测试 ibd2sdi --no-verify 功能" - - -} - -main "$@" \ No newline at end of file diff --git a/testcases/function_test/pkg_test/greatsql/greatsql-server/test_greatsql-server_ibd2sdi__s.sh b/testcases/function_test/pkg_test/greatsql/greatsql-server/test_greatsql-server_ibd2sdi__s.sh deleted file mode 100644 index 75e9b4331e1..00000000000 --- a/testcases/function_test/pkg_test/greatsql/greatsql-server/test_greatsql-server_ibd2sdi__s.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-12-12 -# @License : Mulan PSL v2 -# @Desc : 测试 ibd2sdi 命令跳过数据检索,仅检索 ID 和类型的功能 -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - LOG_INFO "开始测试 ibd2sdi 命令跳过数据检索,仅检索 ID 和类型的功能" - - # 检查是否已安装 greatsql-server 软件包 - LOG_INFO "检查是否已安装 greatsql-server 软件包" - if dnf list installed greatsql-server &>/dev/null; then - LOG_INFO "greatsql-server 已安装,保持环境状态" - INSTALLED=true - else - LOG_INFO "greatsql-server 未安装,将在测试结束后卸载" - INSTALLED=false - fi - - # 检查 yum 源中是否存在 greatsql-server 软件包 - LOG_INFO "检查 yum 源中是否存在 greatsql-server 软件包" - if ! dnf list available greatsql-server &>/dev/null; then - LOG_ERROR "yum 源中不存在 greatsql-server 软件包" - exit 255 - fi - - # 安装 greatsql-server 软件包(如果未安装) - if [ "$INSTALLED" = false ]; then - LOG_INFO "安装 greatsql-server 软件包" - dnf install -y greatsql-server - CHECK_RESULT $? 0 0 "安装 greatsql-server 失败" - fi - - # 检查 ibd2sdi 命令是否支持 --skip-data-retrieval 参数 - LOG_INFO "检查 ibd2sdi 命令是否支持 --skip-data-retrieval 参数" - if ! ibd2sdi --help | grep -q -- "--skip-data-retrieval"; then - LOG_ERROR "ibd2sdi 命令不支持 --skip-data-retrieval 参数" - exit 255 - fi - - # 执行 ibd2sdi --skip-data-retrieval 命令 - LOG_INFO "执行 ibd2sdi --skip-data-retrieval 命令" - ibd2sdi --skip-data-retrieval /var/lib/mysql/test_table.ibd - CHECK_RESULT $? 0 0 "执行 ibd2sdi --skip-data-retrieval失败" - - # SSH_CMD示例(如需在第二个服务器上执行命令) - # LOG_INFO "在第二个服务器上执行命令示例" - # SSH_CMD ls $NODE2_IPV4 $NODE2_PASSWORD $NODE2_USER - - #卸载 greatsql-server(如果测试前未安装) - if [ "$INSTALLED" = false ]; then - LOG_INFO "卸载 greatsql-server软件包" - dnf remove -y greatsql-server - CHECK_RESULT $?0 0 0 "卸载 greatql-servr失败" - fi - - LOG_INFO"测试完成,环境已恢复" -} - -main "$@" \ No newline at end of file diff --git a/testcases/function_test/pkg_test/greatsql/greatsql-server/test_greatsql-server_ibd2sdi__t_num_1.sh b/testcases/function_test/pkg_test/greatsql/greatsql-server/test_greatsql-server_ibd2sdi__t_num_1.sh deleted file mode 100644 index fdfdbeb208c..00000000000 --- a/testcases/function_test/pkg_test/greatsql/greatsql-server/test_greatsql-server_ibd2sdi__t_num_1.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 : 测试 ibd2sdi 命令检索指定类型的 SDI 记录的功能 -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - LOG_INFO "开始测试 ibd2sdi 命令检索指定类型的 SDI 记录的功能" - - # 检查是否已安装 greatsql-server 软件包 - LOG_INFO "检查是否已安装 greatsql-server 软件包" - if rpm -q greatsql-server >/dev/null 2>&1; then - LOG_INFO "greatsql-server 已安装" - INSTALLED=true - else - LOG_INFO "greatsql-server 未安装" - INSTALLED=false - fi - - # 检查 yum 源中是否存在 greatsql-server 软件包 - LOG_INFO "检查 yum 源中是否存在 greatsql-server 软件包" - if ! dnf list available greatsql-server >/dev/null 2>&1; then - LOG_ERROR "yum 源中未找到 greatsql-server 软件包" - exit 255 - fi - - # 如果未安装,则安装 greatsql-server - if [ "$INSTALLED" = false ]; then - LOG_INFO "开始安装 greatsql-server" - dnf install -y greatsql-server - CHECK_RESULT $? 0 0 "安装 greatsql-server 失败" - fi - - # 检查 ibd2sdi 命令是否支持指定参数 - LOG_INFO "检查 ibd2sdi 命令是否支持指定参数" - if ! ibd2sdi --help | grep -q "指定类型的 SDI"; then - LOG_ERROR "ibd2sdi 命令不支持指定类型的 SDI" - exit 255 - fi - - #执行 ibd2sdi --type=test_type /path/to/ibd_file - LOG_INFO "执行 ibd2sdi --type=test_type /path/to/ibd_file" - ibd2sdi --type=test_type /path/to/ibd_file - CHECK_RESULT $? 0 0 "执行 ibd2sdi 命令失败" - - #如果最初未安装,则在测试完成后卸载 greatsql-server - if [ "$INSTALLED" = false ]; then - LOG_INFO "卸载 greatsql-server" - dnf remove -y greatsql-server - CHECK_RESULT $? 0 0 "卸载 greatsql-server失败" - fi - - LOG_INFO "测试完成,环境已恢复" -} - -main "$@" \ No newline at end of file diff --git a/testcases/function_test/pkg_test/greatsql/greatsql-server/test_greatsql-server_ibd2sdifilename.sh b/testcases/function_test/pkg_test/greatsql/greatsql-server/test_greatsql-server_ibd2sdifilename.sh deleted file mode 100644 index 7c76a4cbb07..00000000000 --- a/testcases/function_test/pkg_test/greatsql/greatsql-server/test_greatsql-server_ibd2sdifilename.sh +++ /dev/null @@ -1,68 +0,0 @@ -#!/usr/bin/bash - -# Copyright (c) 2024 ISCAS .ALL rights reserved. -# This program is licensed under Mulan PSL v2. -# You can use it according to the terms and conditions of the Mulan PSL v2. -# http://license.coscl.org.cn/MulanPSL2 -# THIS PROGRAM IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, -# EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, -# MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. -# See the Mulan PSL v2 for more details. - -# ############################################# -# @Author : honghua -# @Contact : honghua@iscas.ac.cn -# @Date : 2025-12-12 -# @License : Mulan PSL v2 -# @Desc : 测试 ibd2sdifilename 参数的基本功能,即不附加任何参数直接解析文件 -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - - LOG_INFO "开始测试 ibd2sdifilename 参数的基本功能" - - # 检查是否已安装 greatsql-server 软件包 - LOG_INFO "检查是否已安装 greatsql-server 软件包" - if ! dnf list installed greatsql-server &>/dev/null; then - LOG_INFO "greatsql-server 未安装,将进行安装" - # 检查 yum 源中是否存在 greatsql-server 软件包 - LOG_INFO "检查 yum 源中是否存在 greatsql-server 软件包" - if ! dnf list available greatsql-server &>/dev/null; then - LOG_ERROR "yum 源中未找到 greatsql-server 软件包" - exit 255 - fi - # 安装 greatsql-server - LOG_INFO "安装 greatsql-server" - dnf install -y greatsql-server - CHECK_RESULT $? 0 0 "安装 greatsql-server 失败" - else - LOG_INFO "greatsql-server 已安装" - fi - - # 测试 ibd2sdifilename 参数的基本功能 - LOG_INFO "测试 ibd2sdifilename 参数的基本功能" - ibd2sdifilename --help &>/dev/null - CHECK_RESULT $? 0 0 "ibd2sdifilename 命令不支持或参数错误" - - # 执行 ibd2sdifilename,不附加任何参数直接解析文件(假设默认解析当前目录下的文件) - LOG_INFO "执行 ibd2sdifilename" - ibd2sdifilename >/dev/null - CHECK_RESULT $? 0 0 "ibd2sdifilename 执行失败" - - # 清理环境:如果测试前未安装 greatsql-server,则卸载 - LOG_INFO "清理环境" - if ! dnf list installed greatsql-server &>/dev/null; then - LOG_INFO "卸载 greatsql-server" - dnf remove -y greatsql-server - CHECK_RESULT $? 0 0 "卸载 greatsql-server失败" - else - LOG_INFO "保持环境不变,不卸载 greatsql-server" - fi - - LOG_INFO "测试完成" - -} - -main "$@" \ No newline at end of file diff --git a/testcases/function_test/pkg_test/greatsql/greatsql-server/test_greatsql-server_innochecksum__a_num_3.sh b/testcases/function_test/pkg_test/greatsql/greatsql-server/test_greatsql-server_innochecksum__a_num_3.sh deleted file mode 100644 index 812b26d52f3..00000000000 --- a/testcases/function_test/pkg_test/greatsql/greatsql-server/test_greatsql-server_innochecksum__a_num_3.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-12 -# @License : Mulan PSL v2 -# @Desc : 测试 innochecksum 命令允许的最大校验和不匹配数量功能 -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - LOG_INFO "开始测试 innochecksum 命令允许的最大校验和不匹配数量功能" - - # 检查是否已安装 greatsql-server 包 - LOG_INFO "检查是否已安装 greatsql-server 包" - if dnf list installed greatsql-server &>/dev/null; then - LOG_INFO "greatsql-server 已安装" - installed=true - else - LOG_INFO "greatsql-server 未安装" - installed=false - fi - - # 检查 yum 源中是否有 greatsql-server 包 - LOG_INFO "检查 yum 源中是否有 greatsql-server 包" - if ! dnf list available greatsql-server &>/dev/null; then - LOG_ERROR "yum 源中未找到 greatsql-server 包" - exit 255 - fi - - # 如果未安装,则安装 greatsql-server 包 - if [ "$installed" = false ]; then - LOG_INFO "安装 greatsql-server 包" - dnf install -y greatsql-server - CHECK_RESULT $? 0 0 "安装 greatsql-server 失败" - fi - - # 测试 innochecksum --allow-mismatches 参数 - LOG_INFO "测试 innochecksum --allow-mismatches 参数" - innochecksum --help | grep -q -- "--allow-mismatches" - CHECK_RESULT $? 0 0 "innochecksum不支持--allow-mismatches参数" - - # 执行 innochecksum 命令测试最大校验和不匹配数量功能 - LOG_INFO "执行 innochecksum 命令测试最大校验和不匹配数量功能" - innochecksum --allow-mismatches=3 /var/lib/mysql/ibdata1 - CHECK_RESULT $? 0 0 "innochecksum命令执行失败" - - #如果脚本开始时未安装,则在结束时卸载 greatsql-server - if [ "$installed" = false ]; then - LOG_INFO "卸载 greatsql-server 包" - dnf remove -y greatsql-server - CHECK_RESULT $? 0 0 "卸载 greatsq lserver 失败" - fi - - LOG_INFO “测试完成” -} - -main "$@" \ No newline at end of file diff --git a/testcases/function_test/pkg_test/greatsql/greatsql-server/test_greatsql-server_innochecksum__c.sh b/testcases/function_test/pkg_test/greatsql/greatsql-server/test_greatsql-server_innochecksum__c.sh deleted file mode 100644 index cc35822a73d..00000000000 --- a/testcases/function_test/pkg_test/greatsql/greatsql-server/test_greatsql-server_innochecksum__c.sh +++ /dev/null @@ -1,88 +0,0 @@ -#!/usr/bin/bash - -# Copyright (c) 2024 ISCAS .ALL rights reserved. -# This program is licensed under Mulan PSL v2. -# You can use it according to the terms and conditions of the Mulan PSL v2. -# http://license.coscl.org.cn/MulanPSL2 -# THIS PROGRAM IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, -# EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, -# MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. -# See the Mulan PSL v2 for more details. - -# ############################################# -# @Author : honghua -# @Contact : honghua@iscas.ac.cn -# @Date : 2025-12-12 -# @License : Mulan PSL v2 -# @Desc : 测试 innochecksum 命令的页面计数功能 -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - LOG_INFO "开始测试 innochecksum 命令的页面计数功能" - - # 检查是否已安装 greatsql-server 包 - LOG_INFO "检查是否已安装 greatsql-server 包" - if rpm -q greatsql-server &>/dev/null; then - LOG_INFO "greatsql-server 已安装" - INSTALLED=true - else - LOG_INFO "greatsql-server 未安装" - INSTALLED=false - fi - - # 检查 yum 源中是否存在 greatsql-server 包 - LOG_INFO "检查 yum 源中是否存在 greatsql-server 包" - if ! dnf list available greatsql-server &>/dev/null; then - LOG_ERROR "yum 源中未找到 greatsql-server 包" - exit 255 - fi - - # 如果未安装,则安装 greatsql-server 包 - if [ "$INSTALLED" = false ]; then - LOG_INFO "开始安装 greatsql-server 包" - dnf install -y greatsql-server || { - LOG_ERROR "安装 greatsql-server 包失败" - exit $? - } - fi - - # 检查 innochecksum 命令是否存在 - LOG_INFO "检查 innochecksum 命令是否存在" - if ! command -v innochecksum &>/dev/null; then - LOG_ERROR "innochecksum 命令不存在" - exit $? - fi - - # 测试 innochecksum --help,验证参数是否存在或支持 - LOG_INFO "测试 innochecksum --help,验证参数是否存在或支持" - innochecksum --help || { - LOG_ERROR "innochecksum 命令不支持 --help 参数或执行失败" - exit $? - } - - # TODO: 替换为实际的测试步骤,测试页面计数功能的具体逻辑 - LOG_INFO "执行 innochecksum 页面计数功能测试" - - # TODO: 替换为实际的测试步骤 - CHECK_RESULT $? 0 0 "innochecksum页面计数功能测试失败" - - # TODO: 替换为实际的测试步骤 - SSH_CMD ls $NODE2_IPV4 $NODE2_PASSWORD $NODE2_USER || { - LOG_ERROR "在第二个节点上执行命令失败" - } - - # 如果脚本开始时未安装,则在结束时卸载软件包 - if [ "$INSTALLED" = false ]; then - LOG_INFO "卸载 greatsql-server,恢复环境" - dnf remove -y greatsql-server || { - LOG_ERROR "卸载 greatsql-server 失败" - exit $? - } - fi - - LOG_INFO "测试完成,环境已恢复" -} - -main "$@" \ No newline at end of file diff --git a/testcases/function_test/pkg_test/greatsql/greatsql-server/test_greatsql-server_innochecksum__n.sh b/testcases/function_test/pkg_test/greatsql/greatsql-server/test_greatsql-server_innochecksum__n.sh deleted file mode 100644 index 6242ac7627f..00000000000 --- a/testcases/function_test/pkg_test/greatsql/greatsql-server/test_greatsql-server_innochecksum__n.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 : 2025-12-12 -# @License : Mulan PSL v2 -# @Desc : 测试 innochecksum 命令忽略校验和验证的功能 -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - LOG_INFO "开始测试 innochecksum 命令忽略校验和验证的功能" - - # 检查软件包是否已安装 - LOG_INFO "检查 GreatSQL 服务器软件包是否已安装" - if rpm -q greatsql-server &>/dev/null; then - LOG_INFO "GreatSQL 服务器软件包已安装,脚本结束时将保持安装状态" - installed=true - else - LOG_INFO "GreatSQL 服务器软件包未安装,将在测试结束后卸载" - installed=false - fi - - # 检查 yum 源中是否存在 greatsql-server 软件包 - LOG_INFO "检查 yum 源中是否存在 greatsql-server 软件包" - if ! dnf list available greatsql-server &>/dev/null; then - LOG_ERROR "yum 源中未找到 greatsql-server 软件包" - exit 255 - fi - - # 安装 greatsql-server(如果未安装) - if [ "$installed" = false ]; then - LOG_INFO "安装 greatsql-server 软件包" - dnf install -y greatsql-server || { - LOG_ERROR "安装 greatsql-server 失败" - exit 1 - } - fi - - # 检查 innochecksum 命令是否支持 --no-check 参数 - LOG_INFO "检查 innochecksum 命令是否支持 --no-check 参数" - if ! innochecksum --help | grep -q -- "--no-check"; then - LOG_ERROR "innochecksum 命令不支持 --no-check 参数" - exit 255 - fi - - # 测试 innochecksum --no-check 功能 - LOG_INFO "测试 innochecksum --no-check 功能" - innochecksum --no-check /var/lib/mysql/ibdata1 || { - LOG_ERROR "innochecksum --no-check 执行失败" - exit $? - } - - CHECK_RESULT $? 0 0 "innochecksum --no-check failed" - - #清理环境(如果脚本开始时未安装) - if [ "$installed" = false ]; then - LOG_INFO "卸载 greatsql-server" - dnf remove -y greatsql-server || { - LOG_ERROR "卸载 greatsq lserver失败" - exit 1 - } - fi - - LOG_INFO “测试完成” -} - -main "$@" \ No newline at end of file diff --git a/testcases/function_test/pkg_test/greatsql/greatsql-server/test_greatsql-server_innochecksum__p_num_5.sh b/testcases/function_test/pkg_test/greatsql/greatsql-server/test_greatsql-server_innochecksum__p_num_5.sh deleted file mode 100644 index a0af44afe79..00000000000 --- a/testcases/function_test/pkg_test/greatsql/greatsql-server/test_greatsql-server_innochecksum__p_num_5.sh +++ /dev/null @@ -1,67 +0,0 @@ -#!/usr/bin/bash - -# Copyright (c) 2024 ISCAS .ALL rights reserved. -# This program is licensed under Mulan PSL v2. -# You can use it according to the terms and conditions of the Mulan PSL v2. -# http://license.coscl.org.cn/MulanPSL2 -# THIS PROGRAM IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, -# EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, -# MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. -# See the Mulan PSL v2 for more details. - -# ############################################# -# @Author : honghua -# @Contact : honghua@iscas.ac.cn -# @Date : 2025-12-12 -# @License : Mulan PSL v2 -# @Desc : 测试 innochecksum 命令指定单个页面检查的功能 -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - - LOG_INFO "开始测试 innochecksum 命令指定单个页面检查的功能" - - # 检查是否已安装 GreatSQL-server 软件包 - LOG_INFO "检查是否已安装 GreatSQL-server 软件包" - if ! dnf list installed GreatSQL-server &>/dev/null; then - LOG_INFO "GreatSQL-server 未安装,将进行安装" - # 检查 yum 源中是否有 GreatSQL-server 软件包 - if ! dnf list available GreatSQL-server &>/dev/null; then - LOG_ERROR "yum 源中未找到 GreatSQL-server 软件包" - exit 255 - fi - - # 安装 GreatSQL-server - LOG_INFO "正在安装 GreatSQL-server" - dnf install -y GreatSQL-server - CHECK_RESULT $? 0 0 "安装 GreatSQL-server 失败" - else - LOG_INFO "GreatSQL-server 已安装,跳过安装步骤" - fi - - # 检查 innochecksum 命令是否支持 -p 参数 - LOG_INFO "检查 innochecksum 命令是否支持 -p 参数" - innochecksum --help | grep -q -- "-p" - CHECK_RESULT $? 0 0 "innochecksum 命令不支持 -p 参数" - - # 测试 innochecksum -p 5 功能 - LOG_INFO "测试 innochecksum -p num_5 功能" - innochecksum -p num_5 /var/lib/mysql/ibdata1 - CHECK_RESULT $? 0 0 "innochecksum -p num_5 执行失败" - - # 清理环境:如果脚本开始时未安装 GreatSQL-server,则卸载它 - if ! dnf list installed GreatSQL-server &>/dev/null; then - LOG_INFO "清理环境:卸载 GreatSQL-server" - dnf remove -y GreatSQL-server - CHECK_RESULT $? 0 0 "卸载 GreatSQL-server 失败" - else - LOG_INFO "GreatSQL-server 已安装,无需卸载" - fi - - LOG_INFO "测试脚本执行完毕,环境已恢复" - -} - -main "$@" \ No newline at end of file diff --git a/testcases/function_test/pkg_test/greatsql/greatsql-server/test_greatsql-server_innochecksum__upper_c_crc32.sh b/testcases/function_test/pkg_test/greatsql/greatsql-server/test_greatsql-server_innochecksum__upper_c_crc32.sh deleted file mode 100644 index 3c0fe6ee132..00000000000 --- a/testcases/function_test/pkg_test/greatsql/greatsql-server/test_greatsql-server_innochecksum__upper_c_crc32.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-12-12 -# @License : Mulan PSL v2 -# @Desc : 测试 innochecksum 命令的严格校验算法指定功能 -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - LOG_INFO "开始测试 innochecksum 命令的严格校验算法指定功能" - - # 检查是否已安装 greatsql-server 软件包 - LOG_INFO "检查是否已安装 greatsql-server 软件包" - if rpm -q greatsql-server > /dev/null; then - LOG_INFO "greatsql-server 已安装,脚本结束时将保持安装状态" - INSTALLED=true - else - LOG_INFO "greatsql-server 未安装,将在测试步骤中安装" - INSTALLED=false - fi - - # 检查 yum 源中是否存在 greatsql-server 软件包 - LOG_INFO "检查 yum 源中是否存在 greatsql-server 软件包" - if ! dnf list available greatsql-server > /dev/null 2>&1; then - LOG_ERROR "yum 源中未找到 greatsql-server 软件包" - exit 255 - fi - - # 如果未安装,则安装 greatsql-server - if [ "$INSTALLED" = false ]; then - LOG_INFO "安装 greatsql-server 软件包" - dnf install -y greatsql-server || { - LOG_ERROR "安装 greatsql-server 失败" - exit 1 - } - fi - - # 检查 innochecksum 命令是否支持 --strict-check-algorithm 参数 - LOG_INFO "检查 innochecksum 命令是否支持 --strict-check-algorithm 参数" - innochecksum --help | grep -- "--strict-check-algorithm" > /dev/null || { - LOG_ERROR "innochecksum 命令不支持 --strict-check-algorithm 参数" - exit 255 - } - - # 测试 innochecksum 命令的严格校验算法指定功能 - LOG_INFO "测试 innochecksum --strict-check-algorithm=upper_c_crc32 功能" - innochecksum --strict-check-algorithm=upper_c_crc32 /var/lib/mysql/ibdata1 || { - LOG_ERROR "innochecksum --strict-check-algorithm=upper_c_crc32 执行失败" - CHECK_RESULT $? 0 0 "innochecksum --strict-check-algorithm=upper_c_crc32 执行失败" - } - - # 清理环境 - if [ "$INSTALLED" = false ]; then - LOG_INFO "卸载 greatsql-server" - dnf remove -y greatsql-server || { - LOG_ERROR "卸载 greatsql-server失败" - exit $? - } - fi - - LOG_INFO "测试完成,环境已恢复" -} - -main "$@" \ No newline at end of file diff --git a/testcases/function_test/pkg_test/greatsql/greatsql-server/test_greatsql-server_innochecksum__upper_s.sh b/testcases/function_test/pkg_test/greatsql/greatsql-server/test_greatsql-server_innochecksum__upper_s.sh deleted file mode 100644 index e638d9eaf70..00000000000 --- a/testcases/function_test/pkg_test/greatsql/greatsql-server/test_greatsql-server_innochecksum__upper_s.sh +++ /dev/null @@ -1,85 +0,0 @@ -#!/usr/bin/bash - -# Copyright (c) 2024 ISCAS .ALL rights reserved. -# This program is licensed under Mulan PSL v2. -# You can use it according to the terms and conditions of the Mulan PSL v2. -# http://license.coscl.org.cn/MulanPSL2 -# THIS PROGRAM IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, -# EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, -# MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. -# See the Mulan PSL v2 for more details. - -# ############################################# -# @Author : honghua -# @Contact : honghua@iscas.ac.cn -# @Date : 2025-12-12 -# @License : Mulan PSL v2 -# @Desc : 测试 innochecksum 命令显示页面类型摘要的功能 -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - - # 检查是否已安装GreatSQL软件包 - LOG_INFO "检查是否已安装GreatSQL软件包" - if rpm -q greatsql-server &>/dev/null; then - LOG_INFO "GreatSQL已安装,保持安装状态" - INSTALLED=true - else - LOG_INFO "GreatSQL未安装,将在测试后卸载" - INSTALLED=false - fi - - # 检查yum源中是否存在GreatSQL软件包 - LOG_INFO "检查yum源中是否存在GreatSQL软件包" - if ! dnf list available greatsql-server &>/dev/null; then - LOG_ERROR "yum源中未找到GreatSQL软件包" - exit 255 - fi - - # 安装GreatSQL软件包(如果未安装) - if [ "$INSTALLED" = false ]; then - LOG_INFO "安装GreatSQL软件包" - dnf install -y greatsql-server || { - LOG_ERROR "安装GreatSQL软件包失败" - exit 1 - } - fi - - # 检查innochecksum命令是否存在 - LOG_INFO "检查innochecksum命令是否存在" - if ! command -v innochecksum &>/dev/null; then - LOG_ERROR "innochecksum命令不存在" - exit 255 - fi - - # 测试innochecksum命令显示页面类型摘要的功能 - LOG_INFO "测试innochecksum命令显示页面类型摘要的功能" - TEST_FILE="/var/lib/mysql/ibdata1" - if [ ! -f "$TEST_FILE" ]; then - LOG_ERROR "测试文件$TEST_FILE不存在" - exit 1 - fi - - innochecksum -S "$TEST_FILE" || { - LOG_ERROR "innochecksum命令执行失败" - exit 1 - } - - CHECK_RESULT $? 0 0 "innochecksum命令显示页面类型摘要失败" - - # 清理环境(如果之前未安装) - if [ "$INSTALLED" = false ]; then - LOG_INFO "卸载GreatSQL软件包" - dnf remove -y greatsql-server || { - LOG_ERROR "卸载GreatSQL软件包失败" - exit 1 - } - fi - - LOG_INFO "测试完成,环境已恢复" - exit 0 -} - -main "$@" \ No newline at end of file diff --git a/testcases/function_test/pkg_test/greatsql/greatsql-server/test_greatsql-server_innochecksum__upper_v.sh b/testcases/function_test/pkg_test/greatsql/greatsql-server/test_greatsql-server_innochecksum__upper_v.sh deleted file mode 100644 index bc3646fc98c..00000000000 --- a/testcases/function_test/pkg_test/greatsql/greatsql-server/test_greatsql-server_innochecksum__upper_v.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-12 -# @License : Mulan PSL v2 -# @Desc : 测试 innochecksum 命令的版本信息显示功能 -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - - # 检查是否已安装greatsql-server软件包 - LOG_INFO "检查是否已安装greatsql-server软件包" - if dnf list installed greatsql-server &>/dev/null; then - LOG_INFO "greatsql-server已安装,脚本结束后将保持安装状态" - installed=true - else - LOG_INFO "greatsql-server未安装,脚本结束后将卸载软件包" - installed=false - fi - - # 检查yum源中是否存在greatsql-server软件包 - LOG_INFO "检查yum源中是否存在greatsql-server软件包" - if ! dnf list available greatsql-server &>/dev/null; then - LOG_ERROR "yum源中不存在greatsql-server软件包" - exit 255 - fi - - # 如果未安装,则安装软件包 - if [ "$installed" = false ]; then - LOG_INFO "开始安装greatsql-server软件包" - dnf install -y greatsql-server - CHECK_RESULT $? 0 0 "安装greatsql-server失败" - fi - - # 检查innochecksum命令是否存在并支持--version参数 - LOG_INFO "检查innochecksum命令是否支持--version参数" - innochecksum --version &>/dev/null - CHECK_RESULT $? 0 255 "innochecksum命令不支持--version参数" - - # 获取innochecksum版本信息 - LOG_INFO "获取innochecksum版本信息" - innochecksum --version - CHECK_RESULT $? 0 0 "获取innochecksum版本信息失败" - - # 环境恢复:如果脚本开始时未安装,则卸载软件包 - if [ "$installed" = false ]; then - LOG_INFO "卸载greatsql-server软件包" - dnf remove -y greatsql-server - CHECK_RESULT $? 0 0 "卸载greatsql-server失败" - fi - - LOG_INFO "测试脚本执行完毕,环境已恢复" - -} - -main "$@" \ No newline at end of file diff --git a/testcases/function_test/pkg_test/greatsql/greatsql-server/test_greatsql-server_innochecksum__v.sh b/testcases/function_test/pkg_test/greatsql/greatsql-server/test_greatsql-server_innochecksum__v.sh deleted file mode 100644 index d82bc8e4777..00000000000 --- a/testcases/function_test/pkg_test/greatsql/greatsql-server/test_greatsql-server_innochecksum__v.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-12 -# @License : Mulan PSL v2 -# @Desc : 测试 innochecksum 命令的详细输出模式 -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - # 检查是否已安装greatsql-server-innochecksum - LOG_INFO "检查是否已安装greatsql-server-innochecksum" - if rpm -q greatsql-server-innochecksum &>/dev/null; then - LOG_INFO "greatsql-server-innochecksum已安装" - installed=true - else - LOG_INFO "greatsql-server-innochecksum未安装" - installed=false - fi - - # 检查yum源中是否有greatsql-server-innochecksum包 - LOG_INFO "检查yum源中是否有greatsql-server-innochecksum包" - if ! dnf list available greatsql-server-innochecksum &>/dev/null; then - LOG_ERROR "yum源中未找到greatsql-server-innochecksum包" - exit 255 - fi - - # 如果未安装,则安装软件包 - if [ "$installed" = false ]; then - LOG_INFO "开始安装greatsql-server-innochecksum" - dnf install -y greatsql-server-innochecksum - CHECK_RESULT $? 0 0 "安装greatsql-server-innochecksum失败" - fi - - # 测试innochecksum命令的详细输出模式 - LOG_INFO "测试innochecksum命令的详细输出模式" - if ! innochecksum --help | grep -q -- "--verbose"; then - LOG_ERROR "参数--verbose不存在或不支持" - exit 255 - fi - - LOG_INFO "执行innochecksum --verbose" - innochecksum --verbose &>/dev/null - CHECK_RESULT $? 0 0 "执行innochecksum --verbose失败" - - # 清理环境:如果脚本开始时未安装,则卸载软件包 - if [ "$installed" = false ]; then - LOG_INFO "卸载greatsql-server-innochecksum" - dnf remove -y greatsql-server-innochecksum - CHECK_RESULT $? 0 0 "卸载greatsql-server-innochecksum失败" - fi -} - -main "$@" \ No newline at end of file diff --git a/testcases/function_test/pkg_test/greatsql/greatsql-server/test_greatsql-server_innochecksum__w_crc32.sh b/testcases/function_test/pkg_test/greatsql/greatsql-server/test_greatsql-server_innochecksum__w_crc32.sh deleted file mode 100644 index f8c367b4fad..00000000000 --- a/testcases/function_test/pkg_test/greatsql/greatsql-server/test_greatsql-server_innochecksum__w_crc32.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-12-12 -# @License : Mulan PSL v2 -# @Desc : 测试 innochecksum 命令重写校验和算法的功能 -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - - LOG_INFO "开始测试 innochecksum 命令重写校验和算法的功能" - - # 检查软件包是否已安装 - LOG_INFO "检查 GreatSQL-server 是否已安装" - if rpm -q GreatSQL-server &>/dev/null; then - LOG_INFO "GreatSQL-server 已安装,测试结束后将保持安装状态" - INSTALLED=1 - else - LOG_INFO "GreatSQL-server 未安装,测试结束后将卸载" - INSTALLED=0 - fi - - # 检查 yum 源中是否存在 GreatSQL-server 软件包 - LOG_INFO "检查 yum 源中是否存在 GreatSQL-server 软件包" - if ! dnf list available GreatSQL-server &>/dev/null; then - LOG_ERROR "yum 源中未找到 GreatSQL-server 软件包" - exit 255 - fi - - # 如果未安装,则安装软件包 - if [ $INSTALLED -eq 0 ]; then - LOG_INFO "安装 GreatSQL-server" - dnf install -y GreatSQL-server - CHECK_RESULT $? 0 0 "安装 GreatSQL-server 失败" - fi - - # 检查 innochecksum 命令是否支持 --write-crc32 参数 - LOG_INFO "检查 innochecksum --write-crc32 参数支持情况" - innochecksum --help | grep -q -- --write-crc32 - CHECK_RESULT $? 0 255 "innochecksum 不支持 --write-crc32 参数" - - # TODO: 替换为实际的测试文件路径 - TEST_FILE="/var/lib/mysql/test.ibd" - - # TODO: 确保测试文件存在,否则创建或从备份恢复 - if [ ! -f "$TEST_FILE" ]; then - LOG_ERROR "测试文件 $TEST_FILE 不存在" - exit 1 - fi - - # TODO: 备份测试文件的原始校验和(如果需要) - LOG_INFO "备份测试文件的原始校验和(如果需要)" - - # 执行 innochecksum --write-crc32 - LOG_INFO "执行 innochecksum --write-crc32 $TEST_FILE" - innochecksum --write-crc32 "$TEST_FILE" - CHECK_RESULT $? 0 1 "innochecksum --write-crc32 执行失败" - - # TODO: 验证校验和是否被正确重写(具体验证逻辑) - LOG_INFO 验证校验和是否被正确重写 - - if [ $INSTALLED -eq 0 ]; then - LOG_INFO 卸载Great SQL server - dnf remove -y Great SQL server - CHECK_RESULT $? 0 1 "卸载Great SQL server失败" - fi - - LOG_INFO 测试完成,环境已恢复 -} - -main "$@" \ No newline at end of file diff --git a/testcases/function_test/pkg_test/greatsql/greatsql-server/test_greatsql-server_lz4_decompress_input_output.sh b/testcases/function_test/pkg_test/greatsql/greatsql-server/test_greatsql-server_lz4_decompress_input_output.sh deleted file mode 100644 index c9b707fa626..00000000000 --- a/testcases/function_test/pkg_test/greatsql/greatsql-server/test_greatsql-server_lz4_decompress_input_output.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-12-12 -# @License : Mulan PSL v2 -# @Desc : 测试 lz4_decompress 命令的基本功能,输入文件和输出文件参数 -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - - # 检查是否已安装GreatSQL软件包 - LOG_INFO "检查是否已安装GreatSQL软件包" - if dnf list installed greatsql-server &>/dev/null; then - LOG_INFO "GreatSQL软件包已安装,脚本结束后保持安装状态" - INSTALLED=1 - else - LOG_INFO "GreatSQL软件包未安装,将在脚本结束后卸载" - INSTALLED=0 - fi - - # 检查yum源中是否存在GreatSQL软件包 - LOG_INFO "检查yum源中是否存在GreatSQL软件包" - if ! dnf list available greatsql-server &>/dev/null; then - LOG_ERROR "yum源中不存在GreatSQL软件包" - exit 255 - fi - - # 安装GreatSQL软件包(如果未安装) - if [ $INSTALLED -eq 0 ]; then - LOG_INFO "安装GreatSQL软件包" - dnf install -y greatsql-server || { - LOG_ERROR "安装GreatSQL软件包失败" - exit 255 - } - fi - - # 检查lz4_decompress命令是否存在 - LOG_INFO "检查lz4_decompress命令是否存在" - if ! command -v lz4_decompress &>/dev/null; then - LOG_ERROR "lz4_decompress命令不存在或不支持" - exit 255 - fi - - # 创建测试输入文件 - LOG_INFO "创建测试输入文件" - echo "test data" > input_file.txt || { - LOG_ERROR "创建输入文件失败" - exit 1 - } - - # 执行lz4_decompress命令测试基本功能(输入文件和输出文件参数) - LOG_INFO "执行lz4_decompress命令测试基本功能" - lz4_decompress input_file.txt output_file.txt || { - LOG_ERROR "lz4_decompress命令执行失败" - exit 1 - } - - # 检查输出文件是否存在 - LOG_INFO "检查输出文件是否存在" - CHECK_RESULT $? 0 0 "输出文件未生成" - - # 清理测试文件 - LOG_INFO "清理测试文件" - rm -f input_file.txt output_file.txt || { - LOG_ERROR "清理测试文件失败" - } - - # 卸载GreatSQL软件包(如果脚本开始时未安装) - if [ $INSTALLED -eq 0 ]; then - LOG_INFO "卸载GreatSQL软件包" - dnf remove -y greatsql-server || { - LOG_ERROR "卸载GreatSQL软件包失败" - exit 1 - } - fi - - LOG_INFO "测试脚本执行完毕" - exit 0 - -} - -main "$@" \ No newline at end of file diff --git a/testcases/function_test/pkg_test/greatsql/greatsql-server/test_greatsql-server_my_print_defaults__c.sh b/testcases/function_test/pkg_test/greatsql/greatsql-server/test_greatsql-server_my_print_defaults__c.sh deleted file mode 100644 index 133faeaf1ed..00000000000 --- a/testcases/function_test/pkg_test/greatsql/greatsql-server/test_greatsql-server_my_print_defaults__c.sh +++ /dev/null @@ -1,72 +0,0 @@ -#!/usr/bin/bash - -# Copyright (c) 2024 ISCAS .ALL rights reserved. -# This program is licensed under Mulan PSL v2. -# You can use it according to the terms and conditions of the Mulan PSL v2. -# http://license.coscl.org.cn/MulanPSL2 -# THIS PROGRAM IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, -# EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, -# MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. -# See the Mulan PSL v2 for more details. - -# ############################################# -# @Author : honghua -# @Contact : honghua@iscas.ac.cn -# @Date : 2025-12-12 -# @License : Mulan PSL v2 -# @Desc : 使用-c参数指定配置文件 -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - - LOG_INFO "开始测试:使用-c参数指定配置文件" - - # 检查是否已安装greatsql-server软件包 - LOG_INFO "检查是否已安装greatsql-server软件包" - if dnf list installed greatsql-server &>/dev/null; then - LOG_INFO "greatsql-server已安装,测试结束后将保持安装状态" - installed=true - else - LOG_INFO "greatsql-server未安装,测试结束后将卸载" - installed=false - fi - - # 检查yum源中是否存在greatsql-server软件包 - LOG_INFO "检查yum源中是否存在greatsql-server软件包" - if ! dnf list available greatsql-server &>/dev/null; then - LOG_ERROR "yum源中不存在greatsql-server软件包" - exit 255 - fi - - # 安装greatsql-server软件包 - if [ "$installed" = false ]; then - LOG_INFO "开始安装greatsql-server软件包" - dnf install -y greatsql-server - CHECK_RESULT $? 0 0 "安装greatsql-server失败" - fi - - # 检查my_print_defaults命令是否支持-c参数 - LOG_INFO "检查my_print_defaults命令是否支持-c参数" - if ! my_print_defaults --help | grep -q "\-c"; then - LOG_ERROR "my_print_defaults命令不支持-c参数" - exit 255 - fi - - # 执行my_print_defaults -c命令测试 - LOG_INFO "执行my_print_defaults -c命令测试" - my_print_defaults -c /etc/my.cnf &>/dev/null - CHECK_RESULT $? 0 0 "执行my_print_defaults -c命令失败" - - # 清理环境:如果测试前未安装,则卸载软件包 - if [ "$installed" = false ]; then - LOG_INFO "清理环境:卸载greatsql-server软件包" - dnf remove -y greatsql-server - CHECK_RESULT $? 0 0 "卸载greatsql-server失败" - fi - - LOG_INFO "测试完成:使用-c参数指定配置文件成功" -} - -main "$@" \ No newline at end of file diff --git a/testcases/function_test/pkg_test/greatsql/greatsql-server/test_greatsql-server_my_print_defaults__e.sh b/testcases/function_test/pkg_test/greatsql/greatsql-server/test_greatsql-server_my_print_defaults__e.sh deleted file mode 100644 index 5eea2f384e4..00000000000 --- a/testcases/function_test/pkg_test/greatsql/greatsql-server/test_greatsql-server_my_print_defaults__e.sh +++ /dev/null @@ -1,78 +0,0 @@ -#!/usr/bin/bash - -# Copyright (c) 2024 ISCAS .ALL rights reserved. -# This program is licensed under Mulan PSL v2. -# You can use it according to the terms and conditions of the Mulan PSL v2. -# http://license.coscl.org.cn/MulanPSL2 -# THIS PROGRAM IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, -# EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, -# MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. -# See the Mulan PSL v2 for more details. - -# ############################################# -# @Author : honghua -# @Contact : honghua@iscas.ac.cn -# @Date : 2025-12-12 -# @License : Mulan PSL v2 -# @Desc : 使用-e参数指定额外配置文件 -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - - # 检查是否已安装greatsql-server软件包 - LOG_INFO "检查是否已安装greatsql-server软件包" - if dnf list installed greatsql-server &>/dev/null; then - LOG_INFO "greatsql-server已安装,脚本结束后保持安装状态" - installed=true - else - LOG_INFO "greatsql-server未安装,将在脚本结束后卸载" - installed=false - fi - - # 检查yum源中是否存在greatsql-server软件包 - LOG_INFO "检查yum源中是否存在greatsql-server软件包" - if ! dnf list available greatsql-server &>/dev/null; then - LOG_ERROR "yum源中未找到greatsql-server软件包" - exit 255 - fi - - # 安装greatsql-server软件包 - LOG_INFO "安装greatsql-server软件包" - dnf install -y greatsql-server - CHECK_RESULT $? 0 0 "安装greatsql-server失败" - - # 测试my_print_defaults命令的-e参数功能 - LOG_INFO "测试my_print_defaults命令的-e参数功能" - if ! my_print_defaults --help | grep -q "\-e"; then - LOG_ERROR "my_print_defaults命令不支持-e参数" - exit 255 - fi - - # 使用-e参数指定额外配置文件 - LOG_INFO "使用-e参数指定额外配置文件" - test_config="/tmp/test_greatsql_config.cnf" - echo "[mysqld]" > $test_config - echo "test_param=1" >> $test_config - - output=$(my_print_defaults -e $test_config mysqld) - CHECK_RESULT $? 0 0 "执行my_print_defaults命令失败" - echo "$output" | grep -q "test_param=1" - CHECK_RESULT $? 0 0 "未找到预期的配置参数" - - # 清理临时配置文件 - rm -f $test_config - - # 如果脚本开始时未安装greatsql-server,则在结束时卸载 - if [ "$installed" = false ]; then - LOG_INFO "卸载greatsql-server软件包" - dnf remove -y greatsql-server - CHECK_RESULT $? 0 0 "卸载greatsql-server失败" - fi - - LOG_INFO "测试脚本执行完毕" - -} - -main "$@" \ No newline at end of file diff --git a/testcases/function_test/pkg_test/greatsql/greatsql-server/test_greatsql-server_my_print_defaults__g.sh b/testcases/function_test/pkg_test/greatsql/greatsql-server/test_greatsql-server_my_print_defaults__g.sh deleted file mode 100644 index 4844b86dd8e..00000000000 --- a/testcases/function_test/pkg_test/greatsql/greatsql-server/test_greatsql-server_my_print_defaults__g.sh +++ /dev/null @@ -1,70 +0,0 @@ -#!/usr/bin/bash - -# Copyright (c) 2024 ISCAS .ALL rights reserved. -# This program is licensed under Mulan PSL v2. -# You can use it according to the terms and conditions of the Mulan PSL v2. -# http://license.coscl.org.cn/MulanPSL2 -# THIS PROGRAM IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, -# EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, -# MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. -# See the Mulan PSL v2 for more details. - -# ############################################# -# @Author : honghua -# @Contact : honghua@iscas.ac.cn -# @Date : 2025-12-12 -# @License : Mulan PSL v2 -# @Desc : 使用-g参数指定组后缀 -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - - LOG_INFO "开始测试:使用-g参数指定组后缀" - - # 检查是否已安装greatsql-server软件包 - LOG_INFO "检查是否已安装greatsql-server软件包" - if rpm -q greatsql-server &>/dev/null; then - LOG_INFO "greatsql-server已安装,测试结束后将保持安装状态" - INSTALLED=true - else - LOG_INFO "greatsql-server未安装,测试结束后将卸载软件包" - INSTALLED=false - fi - - # 检查yum源中是否存在greatsql-server软件包 - LOG_INFO "检查yum源中是否存在greatsql-server软件包" - if ! dnf list available greatsql-server &>/dev/null; then - LOG_ERROR "yum源中未找到greatsql-server软件包" - exit 255 - fi - - # 安装greatsql-server软件包(如果未安装) - if [ "$INSTALLED" = false ]; then - LOG_INFO "正在安装greatsql-server软件包" - dnf install -y greatsql-server - CHECK_RESULT $? 0 0 "安装greatsql-server失败" - fi - - # 测试my_print_defaults命令的-g参数 - LOG_INFO "测试my_print_defaults命令的-g参数" - my_print_defaults --help | grep -q -- "-g," - CHECK_RESULT $? 0 0 "-g参数不支持" - - LOG_INFO "执行my_print_defaults -g test_group" - my_print_defaults -g test_group - CHECK_RESULT $? 0 0 "执行my_print_defaults -g test_group失败" - - # 清理环境(如果测试前未安装) - if [ "$INSTALLED" = false ]; then - LOG_INFO "正在卸载greatsql-server软件包" - dnf remove -y greatsql-server - CHECK_RESULT $? 0 0 "卸载greatsql-server失败" - fi - - LOG_INFO "测试完成:使用-g参数指定组后缀" - -} - -main "$@" \ No newline at end of file diff --git a/testcases/function_test/pkg_test/greatsql/greatsql-server/test_greatsql-server_my_print_defaults__l.sh b/testcases/function_test/pkg_test/greatsql/greatsql-server/test_greatsql-server_my_print_defaults__l.sh deleted file mode 100644 index 8b57f4bed2b..00000000000 --- a/testcases/function_test/pkg_test/greatsql/greatsql-server/test_greatsql-server_my_print_defaults__l.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 : 使用-l参数指定登录路径 -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - LOG_INFO "开始测试:使用-l参数指定登录路径" - - # 检查是否已安装greatsql-server软件包 - LOG_INFO "检查是否已安装greatsql-server软件包" - if dnf list installed greatsql-server &>/dev/null; then - LOG_INFO "greatsql-server已安装,脚本结束时将保持安装状态" - INSTALLED=1 - else - LOG_INFO "greatsql-server未安装,将在测试结束后卸载" - INSTALLED=0 - fi - - # 检查yum源中是否有greatsql-server软件包 - LOG_INFO "检查yum源中是否有greatsql-server软件包" - if ! dnf list available greatsql-server &>/dev/null; then - LOG_ERROR "yum源中未找到greatsql-server软件包" - exit 255 - fi - - # 如果未安装,则安装软件包 - if [ $INSTALLED -eq 0 ]; then - LOG_INFO "开始安装greatsql-server软件包" - dnf install -y greatsql-server - CHECK_RESULT $? 0 0 "安装greatsql-server失败" - fi - - # 测试my_print_defaults命令的-l参数支持情况 - LOG_INFO "测试my_print_defaults命令的-l参数支持情况" - if ! my_print_defaults --help | grep -q "\-l"; then - LOG_ERROR "my_print_defaults命令不支持-l参数" - exit 255 - fi - - # 执行my_print_defaults命令并检查结果 - LOG_INFO "执行my_print_defaults -l命令" - my_print_defaults -l - CHECK_RESULT $? 0 0 "执行my_print_defaults -l命令失败" - - # 清理环境:如果脚本开始时未安装,则卸载软件包 - if [ $INSTALLED -eq 0 ]; then - LOG_INFO "卸载greatsql-server软件包" - dnf remove -y greatsql-server - CHECK_RESULT $? 0 0 "卸载greatsql-server失败" - fi - - LOG_INFO "测试完成:使用-l参数指定登录路径" -} - -main "$@" \ No newline at end of file diff --git a/testcases/function_test/pkg_test/greatsql/greatsql-server/test_greatsql-server_my_print_defaults__n.sh b/testcases/function_test/pkg_test/greatsql/greatsql-server/test_greatsql-server_my_print_defaults__n.sh deleted file mode 100644 index 157be26937c..00000000000 --- a/testcases/function_test/pkg_test/greatsql/greatsql-server/test_greatsql-server_my_print_defaults__n.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 : 使用-n参数忽略默认选项文件 -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - LOG_INFO "开始测试:使用-n参数忽略默认选项文件" - - # 检查是否已安装greatsql-server软件包 - LOG_INFO "检查是否已安装greatsql-server软件包" - if rpm -q greatsql-server &>/dev/null; then - LOG_INFO "greatsql-server已安装,脚本结束后将保持安装状态" - INSTALLED=true - else - LOG_INFO "greatsql-server未安装,脚本结束后将卸载" - INSTALLED=false - fi - - # 检查yum源中是否存在greatsql-server软件包 - LOG_INFO "检查yum源中是否存在greatsql-server软件包" - if ! dnf list available greatsql-server &>/dev/null; then - LOG_ERROR "yum源中未找到greatsql-server软件包" - exit 255 - fi - - # 安装greatsql-server软件包 - if [ "$INSTALLED" = false ]; then - LOG_INFO "安装greatsql-server软件包" - dnf install -y greatsql-server - CHECK_RESULT $? 0 0 "安装greatsql-server失败" - fi - - # 测试my_print_defaults命令的-n参数支持情况 - LOG_INFO "测试my_print_defaults命令的-n参数支持情况" - if ! my_print_defaults --help | grep -q -- "-n"; then - LOG_ERROR "my_print_defaults命令不支持-n参数" - exit 255 - fi - - # 执行my_print_defaults -n命令 - LOG_INFO "执行my_print_defaults -n命令" - output=$(my_print_defaults -n 2>&1) - CHECK_RESULT $? 0 0 "执行my_print_defaults -n命令失败" - - # 清理环境:如果之前未安装则卸载软件包 - if [ "$INSTALLED" = false ]; then - LOG_INFO "卸载greatql-server软件包" - dnf remove -y greatsql-server - CHECK_RESULT $? 0 0 "卸载greatsql-server失败" - fi - - LOG_INFO "测试完成:使用-n参数忽略默认选项文件" -} - -main "$@" \ No newline at end of file diff --git a/testcases/function_test/pkg_test/greatsql/greatsql-server/test_greatsql-server_my_print_defaults__s.sh b/testcases/function_test/pkg_test/greatsql/greatsql-server/test_greatsql-server_my_print_defaults__s.sh deleted file mode 100644 index 883b3fabfca..00000000000 --- a/testcases/function_test/pkg_test/greatsql/greatsql-server/test_greatsql-server_my_print_defaults__s.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-12 -# @License : Mulan PSL v2 -# @Desc : 使用-s参数以明文显示密码 -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - LOG_INFO "开始测试:使用-s参数以明文显示密码" - - # 检查软件包是否已安装 - LOG_INFO "检查GreatSQL Server是否已安装" - if dnf list installed greatsql-server &>/dev/null; then - LOG_INFO "GreatSQL Server已安装,测试完成后将保持安装状态" - INSTALLED=1 - else - LOG_INFO "GreatSQL Server未安装,测试完成后将卸载" - INSTALLED=0 - fi - - # 检查yum源中是否有该软件包 - LOG_INFO "检查yum源中是否存在GreatSQL Server软件包" - if ! dnf list available greatsql-server &>/dev/null; then - LOG_ERROR "yum源中未找到GreatSQL Server软件包" - exit 255 - fi - - # 如果未安装,则安装软件包 - if [ $INSTALLED -eq 0 ]; then - LOG_INFO "正在安装GreatSQL Server" - dnf install -y greatsql-server || { - LOG_ERROR "安装GreatSQL Server失败" - exit 1 - } - fi - - # 测试my_print_defaults命令的-s参数 - LOG_INFO "测试my_print_defaults命令的-s参数" - output=$(my_print_defaults -s 2>&1) - if [[ $output == *"unsupported option"* ]] || [[ $output == *"invalid option"* ]]; then - LOG_ERROR "my_print_defaults命令不支持-s参数" - exit 255 - fi - - CHECK_RESULT $? 0 0 "my_print_defaults命令执行失败" - - # 清理环境:如果测试前未安装,则卸载软件包 - if [ $INSTALLED -eq 0 ]; then - LOG_INFO "正在卸载GreatSQL Server" - dnf remove -y greatsql-server || { - LOG_ERROR "卸载GreatSQL Server失败" - exit 1 - } - fi - - LOG_INFO "测试完成:使用-s参数以明文显示密码" -} - -main "$@" \ No newline at end of file diff --git a/testcases/function_test/pkg_test/greatsql/greatsql-server/test_greatsql-server_my_print_defaults__upper_v.sh b/testcases/function_test/pkg_test/greatsql/greatsql-server/test_greatsql-server_my_print_defaults__upper_v.sh deleted file mode 100644 index ceb44325b62..00000000000 --- a/testcases/function_test/pkg_test/greatsql/greatsql-server/test_greatsql-server_my_print_defaults__upper_v.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-12 -# @License : Mulan PSL v2 -# @Desc : 使用-V参数输出版本信息 -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - - # 检查是否已安装greatsql-server软件包 - LOG_INFO "检查是否已安装greatsql-server软件包" - if rpm -q greatsql-server &>/dev/null; then - LOG_INFO "greatsql-server已安装" - installed=true - else - LOG_INFO "greatsql-server未安装" - installed=false - fi - - # 检查yum源中是否存在greatsql-server软件包 - LOG_INFO "检查yum源中是否存在greatsql-server软件包" - if ! dnf list available greatsql-server &>/dev/null; then - LOG_ERROR "yum源中未找到greatsql-server软件包" - exit 255 - fi - - # 如果未安装,则安装软件包 - if [ "$installed" = false ]; then - LOG_INFO "开始安装greatsql-server软件包" - dnf install -y greatsql-server || { - LOG_ERROR "安装greatsql-server失败" - exit 1 - } - fi - - # 测试my_print_defaults命令的-V参数输出版本信息 - LOG_INFO "测试my_print_defaults命令的-V参数输出版本信息" - if ! my_print_defaults --help | grep -q "\-V"; then - LOG_ERROR "my_print_defaults命令不支持-V参数" - exit 255 - fi - - my_print_defaults -V &>/dev/null - CHECK_RESULT $? 0 0 "my_print_defaults -V执行失败" - - # 清理环境:如果脚本开始时未安装,则卸载软件包 - if [ "$installed" = false ]; then - LOG_INFO "卸载greatsql-server软件包" - dnf remove -y greatsql-server || { - LOG_ERROR "卸载greatsql-server失败" - exit 1 - } - fi - - LOG_INFO "测试完成,环境已恢复" - -} - -main "$@" \ No newline at end of file diff --git a/testcases/function_test/pkg_test/greatsql/greatsql-server/test_greatsql-server_my_print_defaults__v.sh b/testcases/function_test/pkg_test/greatsql/greatsql-server/test_greatsql-server_my_print_defaults__v.sh deleted file mode 100644 index 470d657e214..00000000000 --- a/testcases/function_test/pkg_test/greatsql/greatsql-server/test_greatsql-server_my_print_defaults__v.sh +++ /dev/null @@ -1,74 +0,0 @@ -#!/usr/bin/bash - -# Copyright (c) 2024 ISCAS .ALL rights reserved. -# This program is licensed under Mulan PSL v2. -# You can use it according to the terms and conditions of the Mulan PSL v2. -# http://license.coscl.org.cn/MulanPSL2 -# THIS PROGRAM IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, -# EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, -# MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. -# See the Mulan PSL v2 for more details. - -# ############################################# -# @Author : honghua -# @Contact : honghua@iscas.ac.cn -# @Date : 2025-12-12 -# @License : Mulan PSL v2 -# @Desc : 使用-v参数增加输出级别 -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - LOG_INFO "开始测试:使用-v参数增加输出级别" - - # 检查是否已安装greatsql-server软件包 - LOG_INFO "检查是否已安装greatsql-server软件包" - dnf list installed greatsql-server &>/dev/null - if [ $? -eq 0 ]; then - LOG_INFO "greatsql-server已安装,脚本结束后将保持安装状态" - INSTALLED=1 - else - LOG_INFO "greatsql-server未安装,将在测试结束后卸载" - INSTALLED=0 - fi - - # 检查yum源中是否有greatsql-server软件包 - LOG_INFO "检查yum源中是否有greatsql-server软件包" - dnf list available greatsql-server &>/dev/null - if [ $? -ne 0 ]; then - LOG_ERROR "yum源中未找到greatsql-server软件包" - exit 255 - fi - - # 安装greatsql-server软件包 - if [ $INSTALLED -eq 0 ]; then - LOG_INFO "安装greatsql-server软件包" - dnf install -y greatsql-server &>/dev/null - CHECK_RESULT $? 0 0 "安装greatsql-server失败" - fi - - # 测试my_print_defaults命令的-v参数支持情况 - LOG_INFO "测试my_print_defaults命令的-v参数支持情况" - my_print_defaults --help | grep -q -- "-v" - if [ $? -ne 0 ]; then - LOG_ERROR "my_print_defaults命令不支持-v参数" - exit 255 - fi - - # 执行my_print_defaults命令并检查输出级别增加情况 - LOG_INFO "执行my_print_defaults命令并检查输出级别增加情况" - my_print_defaults -v &>/dev/null - CHECK_RESULT $? 0 0 "my_print_defaults命令执行失败" - - # 清理环境:如果测试前未安装,则卸载软件包 - if [ $INSTALLED -eq 0 ]; then - LOG_INFO "卸载greatsql-server软件包" - dnf remove -y greatsql-server &>/dev/null - CHECK_RESULT $? 0 0 "卸载greatsql-server失败" - fi - - LOG_INFO "测试完成:使用-v参数增加输出级别" -} - -main "$@" \ No newline at end of file diff --git a/testcases/function_test/pkg_test/greatsql/greatsql-server/test_greatsql-server_myisam_ftdump_c.sh b/testcases/function_test/pkg_test/greatsql/greatsql-server/test_greatsql-server_myisam_ftdump_c.sh deleted file mode 100644 index 684214f975c..00000000000 --- a/testcases/function_test/pkg_test/greatsql/greatsql-server/test_greatsql-server_myisam_ftdump_c.sh +++ /dev/null @@ -1,72 +0,0 @@ -#!/usr/bin/bash - -# Copyright (c) 2024 ISCAS .ALL rights reserved. -# This program is licensed under Mulan PSL v2. -# You can use it according to the terms and conditions of the Mulan PSL v2. -# http://license.coscl.org.cn/MulanPSL2 -# THIS PROGRAM IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, -# EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, -# MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. -# See the Mulan PSL v2 for more details. - -# ############################################# -# @Author : honghua -# @Contact : honghua@iscas.ac.cn -# @Date : 2025-12-12 -# @License : Mulan PSL v2 -# @Desc : 测试 myisam_ftdump 命令的统计单词选项 -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - LOG_INFO "开始测试 myisam_ftdump 命令的统计单词选项" - - # 检查是否已安装 greatsql-server-myisam-ftdump - LOG_INFO "检查是否已安装 greatsql-server-myisam-ftdump" - dnf list installed greatsql-server-myisam-ftdump > /dev/null 2>&1 - if [ $? -eq 0 ]; then - LOG_INFO "greatsql-server-myisam-ftdump 已安装" - INSTALLED=1 - else - LOG_INFO "greatsql-server-myisam-ftdump 未安装" - INSTALLED=0 - fi - - # 检查 yum 源中是否有该软件包 - LOG_INFO "检查 yum 源中是否有 greatsql-server-myisam-ftdump" - dnf list available greatsql-server-myisam-ftdump > /dev/null 2>&1 - if [ $? -ne 0 ]; then - LOG_ERROR "yum 源中未找到 greatsql-server-myisam-ftdump" - exit 255 - fi - - # 如果未安装,则安装软件包 - if [ $INSTALLED -eq 0 ]; then - LOG_INFO "安装 greatsql-server-myisam-ftdump" - dnf install -y greatsql-server-myisam-ftdump - CHECK_RESULT $? 0 0 "安装 greatsql-server-myisam-ftdump 失败" - fi - - # 测试 myisam_ftdump 命令的统计单词选项 - LOG_INFO "测试 myisam_ftdump 命令的统计单词选项" - myisam_ftdump --help | grep -q -- "--count" - if [ $? -ne 0 ]; then - LOG_ERROR "--count 选项不存在或不支持" - exit 255 - fi - - # TODO: 添加具体的测试逻辑,例如创建测试表并验证 --count 选项 - LOG_INFO "创建测试表并验证 --count 选项" - - # 清理环境:如果脚本开始时未安装,则卸载软件包 - if [ $INSTALLED -eq 0 ]; then - LOG_INFO "卸载 greatsql-server-myisam-ftdump" - dnf remove -y greatsql-server-myisam-ftdump - CHECK_RESULT $? 0 0 "卸载 greatsql-server-myisam-ftdump 失败" - fi - - LOG_INFO “测试完成” -} - -main "$@" \ No newline at end of file diff --git a/testcases/function_test/pkg_test/greatsql/greatsql-server/test_greatsql-server_myisam_ftdump_d.sh b/testcases/function_test/pkg_test/greatsql/greatsql-server/test_greatsql-server_myisam_ftdump_d.sh deleted file mode 100644 index 67aef55d4b3..00000000000 --- a/testcases/function_test/pkg_test/greatsql/greatsql-server/test_greatsql-server_myisam_ftdump_d.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-12-12 -# @License : Mulan PSL v2 -# @Desc : 测试 myisam_ftdump 命令的转储索引选项 -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - LOG_INFO "开始测试 myisam_ftdump 命令的转储索引选项" - - # 检查是否已安装 greatsql-server-myisam-ftdump - LOG_INFO "检查是否已安装 greatsql-server-myisam-ftdump" - if dnf list installed greatsql-server-myisam-ftdump &>/dev/null; then - LOG_INFO "greatsql-server-myisam-ftdump 已安装" - INSTALLED=true - else - LOG_INFO "greatsql-server-myisam-ftdump 未安装" - INSTALLED=false - fi - - # 检查 yum 源中是否有该软件包 - LOG_INFO "检查 yum 源中是否有 greatsql-server-myisam-ftdump" - if ! dnf list available greatsql-server-myisam-ftdump &>/dev/null; then - LOG_ERROR "yum 源中未找到 greatsql-server-myisam-ftdump" - exit 255 - fi - - # 如果未安装,则安装软件包 - if [ "$INSTALLED" = false ]; then - LOG_INFO "开始安装 greatsql-server-myisam-ftdump" - dnf install -y greatsql-server-myisam-ftdump - CHECK_RESULT $? 0 0 "安装 greatsql-server-myisam-ftdump 失败" - fi - - # 测试 myisam_ftdump 命令的转储索引选项 - LOG_INFO "测试 myisam_ftdump -d 选项" - myisam_ftdump -d /var/lib/mysql/test/ft_index.MYI > /tmp/ft_dump_output.txt - CHECK_RESULT $? 0 0 "myisam_ftdump -d 命令执行失败" - - # 检查输出文件是否存在且非空 - LOG_INFO "检查转储输出文件" - if [ -s /tmp/ft_dump_output.txt ]; then - LOG_INFO "转储输出文件有效" - else - LOG_ERROR "转储输出文件无效或为空" - exit 1 - fi - - # 清理测试环境 - LOG_INFO "清理测试环境" - rm -f /tmp/ft_dump_output.txt - - # 如果脚本开始时未安装,则卸载软件包 - if [ "$INSTALLED" = false ]; then - LOG_INFO "卸载 greatsql-server-myisam-ftdump" - dnf remove -y greatsql-server-myisam-ftdump - CHECK_RESULT $? 0 0 "卸载 greatsql-server-myisam-ftdump 失败" - fi - - LOG_INFO "测试 myisam_ftdump 命令的转储索引选项完成" -} - -main "$@" \ No newline at end of file diff --git a/testcases/function_test/pkg_test/greatsql/greatsql-server/test_greatsql-server_myisam_ftdump_h.sh b/testcases/function_test/pkg_test/greatsql/greatsql-server/test_greatsql-server_myisam_ftdump_h.sh deleted file mode 100644 index b5280c2b3b0..00000000000 --- a/testcases/function_test/pkg_test/greatsql/greatsql-server/test_greatsql-server_myisam_ftdump_h.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-12 -# @License : Mulan PSL v2 -# @Desc : 测试 myisam_ftdump 命令的帮助选项 -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - LOG_INFO "开始测试 myisam_ftdump 命令的帮助选项" - - # 检查软件包是否已安装 - LOG_INFO "检查是否已安装 greatsql-server 软件包" - if ! dnf list installed greatsql-server &>/dev/null; then - LOG_INFO "greatsql-server 软件包未安装,将进行安装" - # 检查 yum 源中是否有该软件包 - if ! dnf list available greatsql-server &>/dev/null; then - LOG_ERROR "yum 源中未找到 greatsql-server 软件包" - exit 255 - fi - # 安装软件包 - dnf install -y greatsql-server - CHECK_RESULT $? 0 0 "安装 greatsql-server 失败" - # 标记为需要卸载 - UNINSTALL_NEEDED=1 - else - LOG_INFO "greatsql-server 软件包已安装" - UNINSTALL_NEEDED=0 - fi - - # 检查 myisam_ftdump 命令是否存在 - LOG_INFO "检查 myisam_ftdump 命令是否存在" - if ! command -v myisam_ftdump &>/dev/null; then - LOG_ERROR "myisam_ftdump 命令不存在" - exit 255 - fi - - # 测试 myisam_ftdump 命令的帮助选项 - LOG_INFO "测试 myisam_ftdump 命令的帮助选项" - myisam_ftdump --help &>/dev/null - CHECK_RESULT $? 0 0 "myisam_ftdump --help 执行失败" - - # 清理环境 - if [ "$UNINSTALL_NEEDED" -eq 1 ]; then - LOG_INFO "卸载 greatsql-server 软件包" - dnf remove -y greatsql-server - CHECK_RESULT $? 0 0 "卸载 greatsql-server 失败" - fi - - LOG_INFO "测试完成" -} - -main "$@" \ No newline at end of file diff --git a/testcases/function_test/pkg_test/greatsql/greatsql-server/test_greatsql-server_myisam_ftdump_s.sh b/testcases/function_test/pkg_test/greatsql/greatsql-server/test_greatsql-server_myisam_ftdump_s.sh deleted file mode 100644 index 9716810bd88..00000000000 --- a/testcases/function_test/pkg_test/greatsql/greatsql-server/test_greatsql-server_myisam_ftdump_s.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-12-12 -# @License : Mulan PSL v2 -# @Desc : 测试 myisam_ftdump 命令的全局统计报告选项 -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - - LOG_INFO "开始测试 myisam_ftdump 命令的全局统计报告选项" - - # 检查是否已安装 greatsql-server-myisam-ftdump - LOG_INFO "检查是否已安装 greatsql-server-myisam-ftdump" - dnf list installed greatsql-server-myisam-ftdump > /dev/null 2>&1 - if [ $? -eq 0 ]; then - LOG_INFO "greatsql-server-myisam-ftdump 已安装" - INSTALLED=1 - else - LOG_INFO "greatsql-server-myisam-ftdump 未安装" - INSTALLED=0 - fi - - # 检查 yum 源中是否有该软件包 - LOG_INFO "检查 yum 源中是否有 greatsql-server-myisam-ftdump" - dnf list available greatsql-server-myisam-ftdump > /dev/null 2>&1 - if [ $? -ne 0 ]; then - LOG_ERROR "yum 源中未找到 greatsql-server-myisam-ftdump" - exit 255 - fi - - # 如果未安装,则安装软件包 - if [ $INSTALLED -eq 0 ]; then - LOG_INFO "安装 greatsql-server-myisam-ftdump" - dnf install -y greatsql-server-myisam-ftdump - CHECK_RESULT $? 0 0 "安装 greatsql-server-myisam-ftdump 失败" - fi - - # 测试 myisam_ftdump 命令的全局统计报告选项 - LOG_INFO "测试 myisam_ftdump --help" - myisam_ftdump --help > /dev/null 2>&1 - CHECK_RESULT $? 0 0 "myisam_ftdump --help 执行失败" - - LOG_INFO "测试 myisam_ftdump --stats" - myisam_ftdump --stats > /dev/null 2>&1 - if [ $? -ne 255 ]; then - LOG_ERROR "--stats 参数不存在或不支持" - exit 255 - fi - - # Clean up: If the package was not installed before, uninstall it now. - if [ $INSTALLED -eq 0 ]; then - LOG_INFO "卸载 greatsql-server-myisam-ftdump" - dnf remove -y greatsql-server-myisam-ftdump > /dev/null 2>&1 - CHECK_RESULT $? 0 0 "卸载 greatsql-server-myisam-ftdump failed" - fi - - LOG_INFO "测试完成" - -} - -main "$@" \ No newline at end of file diff --git a/testcases/function_test/pkg_test/greatsql/greatsql-server/test_greatsql-server_myisam_ftdump_v.sh b/testcases/function_test/pkg_test/greatsql/greatsql-server/test_greatsql-server_myisam_ftdump_v.sh deleted file mode 100644 index bbd345d5374..00000000000 --- a/testcases/function_test/pkg_test/greatsql/greatsql-server/test_greatsql-server_myisam_ftdump_v.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-12-12 -# @License : Mulan PSL v2 -# @Desc : 测试 myisam_ftdump 命令的详细输出选项 -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - LOG_INFO "开始测试 myisam_ftdump 命令的详细输出选项" - - # 检查是否已安装 greatsql-server-myisam-ftdump - LOG_INFO "检查是否已安装 greatsql-server-myisam-ftdump" - if ! dnf list installed greatsql-server-myisam-ftdump &>/dev/null; then - LOG_INFO "未安装 greatsql-server-myisam-ftdump,准备安装" - # 检查 yum 源中是否有该软件包 - if ! dnf list available greatsql-server-myisam-ftdump &>/dev/null; then - LOG_ERROR "yum 源中未找到 greatsql-server-myisam-ftdump 软件包" - exit 255 - fi - # 安装软件包 - dnf install -y greatsql-server-myisam-ftdump - CHECK_RESULT $? 0 0 "安装 greatsql-server-myisam-ftdump 失败" - INSTALLED=1 - else - LOG_INFO "greatsql-server-myisam-ftdump 已安装" - INSTALLED=0 - fi - - # 测试 myisam_ftdump 命令的详细输出选项 - LOG_INFO "测试 myisam_ftdump -v 选项" - myisam_ftdump -v &>/dev/null - CHECK_RESULT $? 0 0 "myisam_ftdump -v 选项不支持或执行失败" - - # 清理环境(如果脚本开始时未安装则卸载) - if [ $INSTALLED -eq 1 ]; then - LOG_INFO "卸载 greatsql-server-myisam-ftdump" - dnf remove -y greatsql-server-myisam-ftdump - CHECK_RESULT $? 0 0 "卸载 greatsql-server-myisam-ftdump 失败" - fi - - LOG_INFO "测试完成" -} - -main "$@" \ No newline at end of file diff --git a/testcases/function_test/pkg_test/greatsql/greatsql-server/test_greatsql-server_myisamlog_p.sh b/testcases/function_test/pkg_test/greatsql/greatsql-server/test_greatsql-server_myisamlog_p.sh deleted file mode 100644 index 33a494bc023..00000000000 --- a/testcases/function_test/pkg_test/greatsql/greatsql-server/test_greatsql-server_myisamlog_p.sh +++ /dev/null @@ -1,78 +0,0 @@ -#!/usr/bin/bash - -# Copyright (c) 2024 ISCAS .ALL rights reserved. -# This program is licensed under Mulan PSL v2. -# You can use it according to the terms and conditions of the Mulan PSL v2. -# http://license.coscl.org.cn/MulanPSL2 -# THIS PROGRAM IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, -# EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, -# MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. -# See the Mulan PSL v2 for more details. - -# ############################################# -# @Author : honghua -# @Contact : honghua@iscas.ac.cn -# @Date : 2025-12-12 -# @License : Mulan PSL v2 -# @Desc : 测试 myisamlog 命令的 p 参数 -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - - # 检查是否已安装GreatSQL-server软件包 - LOG_INFO "检查是否已安装GreatSQL-server软件包" - if rpm -q greatsql-server &>/dev/null; then - LOG_INFO "GreatSQL-server已安装,脚本结束时将保持安装状态" - INSTALLED=true - else - LOG_INFO "GreatSQL-server未安装,将在测试结束后卸载" - INSTALLED=false - fi - - # 检查yum源中是否存在GreatSQL-server软件包 - LOG_INFO "检查yum源中是否存在GreatSQL-server软件包" - if ! dnf list available greatsql-server &>/dev/null; then - LOG_ERROR "yum源中未找到GreatSQL-server软件包" - exit 255 - fi - - # 如果未安装,则安装GreatSQL-server - if [ "$INSTALLED" = false ]; then - LOG_INFO "开始安装GreatSQL-server软件包" - dnf install -y greatsql-server || { - LOG_ERROR "安装GreatSQL-server失败" - exit 1 - } - fi - - # 检查myisamlog命令是否支持p参数 - LOG_INFO "检查myisamlog命令是否支持p参数" - if ! myisamlog --help | grep -q "\-p"; then - LOG_ERROR "myisamlog命令不支持p参数" - if [ "$INSTALLED" = false ]; then - dnf remove -y greatsql-server - fi - exit 255 - fi - - # 测试myisamlog命令的p参数 - LOG_INFO "测试myisamlog命令的p参数" - myisamlog -p /tmp/test.log &>/dev/null - CHECK_RESULT $? 0 0 "myisamlog命令的p参数测试失败" - - # 清理环境 - if [ "$INSTALLED" = false ]; then - LOG_INFO "卸载GreatSQL-server软件包" - dnf remove -y greatsql-server || { - LOG_ERROR "卸载GreatSQL-server失败" - exit 1 - } - fi - - LOG_INFO "测试完成" - -} - -main "$@" \ No newline at end of file diff --git a/testcases/function_test/pkg_test/greatsql/greatsql-server/test_greatsql-server_mysql_secure_installation_h.sh b/testcases/function_test/pkg_test/greatsql/greatsql-server/test_greatsql-server_mysql_secure_installation_h.sh deleted file mode 100644 index 66e76e83c70..00000000000 --- a/testcases/function_test/pkg_test/greatsql/greatsql-server/test_greatsql-server_mysql_secure_installation_h.sh +++ /dev/null @@ -1,63 +0,0 @@ -#!/usr/bin/bash - -# Copyright (c) 2024 ISCAS .ALL rights reserved. -# This program is licensed under Mulan PSL v2. -# You can use it according to the terms and conditions of the Mulan PSL v2. -# http://license.coscl.org.cn/MulanPSL2 -# THIS PROGRAM IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, -# EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, -# MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. -# See the Mulan PSL v2 for more details. - -# ############################################# -# @Author : honghua -# @Contact : honghua@iscas.ac.cn -# @Date : 2025-12-12 -# @License : Mulan PSL v2 -# @Desc : 测试使用 -h 参数指定主机名 -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - LOG_INFO "开始测试使用 -h 参数指定主机名" - - # 检查软件包是否已安装 - if rpm -q greatsql-server-mysql &>/dev/null; then - LOG_INFO "检测到 greatsql-server-mysql 已安装,脚本结束后将保持安装状态" - INSTALLED=true - else - LOG_INFO "检测到 greatsql-server-mysql 未安装,脚本结束后将卸载" - INSTALLED=false - fi - - # 检查yum源中是否存在软件包 - LOG_INFO "检查yum源中是否存在 greatsql-server-mysql 软件包" - if ! dnf list available greatsql-server-mysql &>/dev/null; then - LOG_ERROR "yum源中未找到 greatsql-server-mysql 软件包" - exit 255 - fi - - # 安装软件包(如果未安装) - if [ "$INSTALLED" = false ]; then - LOG_INFO "开始安装 greatsql-server-mysql" - dnf install -y greatsql-server-mysql - CHECK_RESULT $? 0 0 "安装 greatsql-server-mysql 失败" - fi - - # 测试 -h 参数 - LOG_INFO "测试使用 -h 参数指定主机名" - greatsql-server-mysql -h localhost - CHECK_RESULT $? 0 0 "使用 -h 参数指定主机名失败" - - # 清理环境(如果之前未安装) - if [ "$INSTALLED" = false ]; then - LOG_INFO "卸载 greatsql-server-mysql" - dnf remove -y greatsql-server-mysql - CHECK_RESULT $? 0 0 "卸载 greatsql-server-mysql 失败" - fi - - LOG_INFO "测试完成" -} - -main "$@" \ No newline at end of file diff --git a/testcases/function_test/pkg_test/greatsql/greatsql-server/test_greatsql-server_mysql_secure_installation_p.sh b/testcases/function_test/pkg_test/greatsql/greatsql-server/test_greatsql-server_mysql_secure_installation_p.sh deleted file mode 100644 index bdbc32467bc..00000000000 --- a/testcases/function_test/pkg_test/greatsql/greatsql-server/test_greatsql-server_mysql_secure_installation_p.sh +++ /dev/null @@ -1,62 +0,0 @@ -#!/usr/bin/bash - -# Copyright (c) 2024 ISCAS .ALL rights reserved. -# This program is licensed under Mulan PSL v2. -# You can use it according to the terms and conditions of the Mulan PSL v2. -# http://license.coscl.org.cn/MulanPSL2 -# THIS PROGRAM IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, -# EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, -# MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. -# See the Mulan PSL v2 for more details. - -# ############################################# -# @Author : honghua -# @Contact : honghua@iscas.ac.cn -# @Date : 2025-12-12 -# @License : Mulan PSL v2 -# @Desc : 测试使用 -p 参数指定密码 -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - - # 检查是否已安装GreatSQL Server - LOG_INFO "检查是否已安装GreatSQL Server" - if dnf list installed greatsql-server &>/dev/null; then - LOG_INFO "GreatSQL Server已安装,脚本结束后保持安装状态" - installed=true - else - LOG_INFO "GreatSQL Server未安装,将在测试结束后卸载" - installed=false - fi - - # 检查yum源中是否存在GreatSQL Server软件包 - LOG_INFO "检查yum源中是否存在GreatSQL Server软件包" - if ! dnf list available greatsql-server &>/dev/null; then - LOG_ERROR "yum源中未找到GreatSQL Server软件包" - exit 255 - fi - - # 安装GreatSQL Server - LOG_INFO "开始安装GreatSQL Server" - dnf install -y greatsql-server - CHECK_RESULT $? 0 0 "安装GreatSQL Server失败" - - # 测试使用-p参数指定密码 - LOG_INFO "测试使用-p参数指定密码" - mysql_secure_installation -p testpassword - CHECK_RESULT $? 0 0 "使用-p参数指定密码失败" - - # 清理环境 - if [ "$installed" = false ]; then - LOG_INFO "卸载GreatSQL Server" - dnf remove -y greatsql-server - CHECK_RESULT $? 0 0 "卸载GreatSQL Server失败" - fi - - LOG_INFO "测试脚本执行完毕" - -} - -main "$@" \ No newline at end of file diff --git a/testcases/function_test/pkg_test/greatsql/greatsql-server/test_greatsql-server_mysql_secure_installation_u.sh b/testcases/function_test/pkg_test/greatsql/greatsql-server/test_greatsql-server_mysql_secure_installation_u.sh deleted file mode 100644 index 15e56876c37..00000000000 --- a/testcases/function_test/pkg_test/greatsql/greatsql-server/test_greatsql-server_mysql_secure_installation_u.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-12 -# @License : Mulan PSL v2 -# @Desc : 测试使用 -u 参数指定用户 -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - # 检查是否已安装greatsql-server软件包 - LOG_INFO "检查是否已安装greatsql-server软件包" - if dnf list installed greatsql-server &>/dev/null; then - LOG_INFO "greatsql-server已安装,脚本结束时将保持安装状态" - installed=true - else - LOG_INFO "greatsql-server未安装,脚本结束时将卸载" - installed=false - fi - - # 检查yum源中是否存在greatsql-server软件包 - LOG_INFO "检查yum源中是否存在greatsql-server软件包" - if ! dnf list available greatsql-server &>/dev/null; then - LOG_ERROR "yum源中未找到greatsql-server软件包" - exit 255 - fi - - # 安装greatsql-server软件包 - LOG_INFO "安装greatsql-server软件包" - dnf install -y greatsql-server - CHECK_RESULT $? 0 0 "安装greatsql-server失败" - - # 测试使用-u参数指定用户 - LOG_INFO "测试使用-u参数指定用户" - mysql_secure_installation -u testuser - CHECK_RESULT $? 0 0 "使用-u参数指定用户失败" - - # 根据初始状态决定是否卸载 - if [ "$installed" = false ]; then - LOG_INFO "卸载greatsql-server软件包" - dnf remove -y greatsql-server - CHECK_RESULT $? 0 0 "卸载greatsql-server失败" - fi - - LOG_INFO "测试脚本执行完成" -} - -main "$@" \ No newline at end of file diff --git a/testcases/function_test/pkg_test/greatsql/greatsql-server/test_greatsql-server_mysql_server_upper_version.sh b/testcases/function_test/pkg_test/greatsql/greatsql-server/test_greatsql-server_mysql_server_upper_version.sh deleted file mode 100644 index caf1f24e2a7..00000000000 --- a/testcases/function_test/pkg_test/greatsql/greatsql-server/test_greatsql-server_mysql_server_upper_version.sh +++ /dev/null @@ -1,70 +0,0 @@ -#!/usr/bin/bash - -# Copyright (c) 2024 ISCAS .ALL rights reserved. -# This program is licensed under Mulan PSL v2. -# You can use it according to the terms and conditions of the Mulan PSL v2. -# http://license.coscl.org.cn/MulanPSL2 -# THIS PROGRAM IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, -# EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, -# MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. -# See the Mulan PSL v2 for more details. - -# ############################################# -# @Author : honghua -# @Contact : honghua@iscas.ac.cn -# @Date : 2025-12-12 -# @License : Mulan PSL v2 -# @Desc : 测试 mysql_server 命令的 _upper_version_upper_v_ersion 参数 -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - - # 检查是否已安装GreatSQL Server - LOG_INFO "检查是否已安装GreatSQL Server" - if dnf list installed greatsql-server &>/dev/null; then - LOG_INFO "GreatSQL Server已安装,脚本结束时将保持安装状态" - INSTALLED=true - else - LOG_INFO "GreatSQL Server未安装,脚本结束时将卸载安装的软件包" - INSTALLED=false - fi - - # 检查yum源中是否存在GreatSQL Server软件包 - LOG_INFO "检查yum源中是否存在GreatSQL Server软件包" - if ! dnf list available greatsql-server &>/dev/null; then - LOG_ERROR "yum源中未找到GreatSQL Server软件包" - exit 255 - fi - - # 安装GreatSQL Server(如果未安装) - if [ "$INSTALLED" = false ]; then - LOG_INFO "开始安装GreatSQL Server" - dnf install -y greatsql-server - CHECK_RESULT $? 0 0 "安装GreatSQL Server失败" - fi - - # 测试mysql_server命令的_upper_version参数 - LOG_INFO "测试mysql_server命令的_upper_version参数" - if mysql_server --help | grep -q "_upper_version"; then - LOG_INFO "_upper_version参数存在,执行测试" - mysql_server _upper_version >/dev/null 2>&1 - CHECK_RESULT $? 0 0 "执行mysql_server _upper_version失败" - else - LOG_ERROR "_upper_version参数不存在或不支持" - exit 255 - fi - - # 清理环境(如果脚本开始时未安装GreatSQL Server) - if [ "$INSTALLED" = false ]; then - LOG_INFO "卸载GreatSQL Server" - dnf remove -y greatsql-server - CHECK_RESULT $? 0 0 "卸载GreatSQL Server失败" - fi - - LOG_INFO "测试完成,环境已恢复" - -} - -main "$@" \ No newline at end of file diff --git a/testcases/function_test/pkg_test/greatsql/greatsql-server/test_greatsql-server_mysql_ssl_rsa_setup__d.sh b/testcases/function_test/pkg_test/greatsql/greatsql-server/test_greatsql-server_mysql_ssl_rsa_setup__d.sh deleted file mode 100644 index 7c8e0f5ff96..00000000000 --- a/testcases/function_test/pkg_test/greatsql/greatsql-server/test_greatsql-server_mysql_ssl_rsa_setup__d.sh +++ /dev/null @@ -1,85 +0,0 @@ -#!/usr/bin/bash - -# Copyright (c) 2024 ISCAS .ALL rights reserved. -# This program is licensed under Mulan PSL v2. -# You can use it according to the terms and conditions of the Mulan PSL v2. -# http://license.coscl.org.cn/MulanPSL2 -# THIS PROGRAM IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, -# EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, -# MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. -# See the Mulan PSL v2 for more details. - -# ############################################# -# @Author : honghua -# @Contact : honghua@iscas.ac.cn -# @Date : 2025-12-12 -# @License : Mulan PSL v2 -# @Desc : 测试 mysql_ssl_rsa_setup 命令的 -d 参数,验证是否能够指定生成文件的存储目录 -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - - # 检查是否已安装GreatSQL Server - LOG_INFO "检查是否已安装GreatSQL Server" - if dnf list installed greatsql-server &>/dev/null; then - LOG_INFO "GreatSQL Server已安装,脚本结束时将保持安装状态" - installed=true - else - LOG_INFO "GreatSQL Server未安装,脚本结束时将卸载安装的软件包" - installed=false - fi - - # 检查yum源中是否存在GreatSQL Server软件包 - LOG_INFO "检查yum源中是否存在GreatSQL Server软件包" - if ! dnf list available greatsql-server &>/dev/null; then - LOG_ERROR "yum源中未找到GreatSQL Server软件包" - exit 255 - fi - - # 测试mysql_ssl_rsa_setup命令的-d参数功能 - LOG_INFO "测试mysql_ssl_rsa_setup命令的-d参数功能" - - # 创建临时目录用于存储生成的文件 - temp_dir=$(mktemp -d) - LOG_INFO "创建临时目录: $temp_dir" - - # 执行mysql_ssl_rsa_setup命令并指定目录 - LOG_INFO "执行mysql_ssl_rsa_setup -d $temp_dir" - mysql_ssl_rsa_setup -d "$temp_dir" &>/dev/null - CHECK_RESULT $? 0 0 "执行mysql_ssl_rsa_setup -d命令失败" - - # 验证生成的文件是否存在于指定目录中 - LOG_INFO "验证生成的文件是否存在于指定目录中" - if [ -f "$temp_dir/ca.pem" ] && [ -f "$temp_dir/server-cert.pem" ] && [ -f "$temp_dir/server-key.pem" ]; then - LOG_INFO "生成的文件已成功存储在指定目录中" - else - LOG_ERROR "生成的文件未存储在指定目录中" - exit 1 - fi - - # 清理临时目录和文件 - LOG_INFO "清理临时目录和文件" - rm -rf "$temp_dir" - - # 如果脚本开始时未安装GreatSQL Server,则卸载软件包 - if [ "$installed" = false ]; then - LOG_INFO "卸载GreatSQL Server软件包" - dnf remove -y greatsql-server &>/dev/null - CHECK_RESULT $? 0 0 "卸载GreatSQL Server软件包失败" - - # 再次确认是否已卸载 - if dnf list installed greatsql-server &>/dev/null; then - LOG_ERROR "GreatSQL Server软件包卸载失败" - exit 1 - else - LOG_INFO "GreatSQL Server软件包已成功卸载" - fi - fi - - LOG_INFO "测试脚本执行完毕,环境已恢复" - -} - -main "$@" \ No newline at end of file diff --git a/testcases/function_test/pkg_test/greatsql/greatsql-server/test_greatsql-server_mysql_ssl_rsa_setup__uid.sh b/testcases/function_test/pkg_test/greatsql/greatsql-server/test_greatsql-server_mysql_ssl_rsa_setup__uid.sh deleted file mode 100644 index e0c9107573a..00000000000 --- a/testcases/function_test/pkg_test/greatsql/greatsql-server/test_greatsql-server_mysql_ssl_rsa_setup__uid.sh +++ /dev/null @@ -1,88 +0,0 @@ -#!/usr/bin/bash - -# Copyright (c) 2024 ISCAS .ALL rights reserved. -# This program is licensed under Mulan PSL v2. -# You can use it according to the terms and conditions of the Mulan PSL v2. -# http://license.coscl.org.cn/MulanPSL2 -# THIS PROGRAM IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, -# EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, -# MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. -# See the Mulan PSL v2 for more details. - -# ############################################# -# @Author : honghua -# @Contact : honghua@iscas.ac.cn -# @Date : 2025-12-12 -# @License : Mulan PSL v2 -# @Desc : 测试 mysql_ssl_rsa_setup 命令的 --uid 参数,验证是否能够指定文件权限的有效用户ID -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - LOG_INFO "开始测试 mysql_ssl_rsa_setup 命令的 --uid 参数,验证是否能够指定文件权限的有效用户ID" - - # 检查是否已安装 GreatSQL Server - LOG_INFO "检查是否已安装 GreatSQL Server" - if dnf list installed greatsql-server &>/dev/null; then - LOG_INFO "GreatSQL Server 已安装,脚本结束时将保持安装状态" - installed=true - else - LOG_INFO "GreatSQL Server 未安装,将在测试结束后卸载" - installed=false - fi - - # 检查 yum 源中是否存在 greatsql-server 软件包 - LOG_INFO "检查 yum 源中是否存在 greatsql-server 软件包" - if ! dnf list available greatsql-server &>/dev/null; then - LOG_ERROR "yum 源中未找到 greatsql-server 软件包" - exit 255 - fi - - # 安装 GreatSQL Server(如果未安装) - if [ "$installed" = false ]; then - LOG_INFO "安装 GreatSQL Server" - dnf install -y greatsql-server - CHECK_RESULT $? 0 0 "安装 GreatSQL Server 失败" - fi - - # 检查 mysql_ssl_rsa_setup 命令是否支持 --uid 参数 - LOG_INFO "检查 mysql_ssl_rsa_setup 命令是否支持 --uid 参数" - if ! mysql_ssl_rsa_setup --help | grep -q -- "--uid"; then - LOG_ERROR "mysql_ssl_rsa_setup 命令不支持 --uid 参数" - exit 255 - fi - - # 测试指定文件权限的有效用户ID功能 - LOG_INFO "测试指定文件权限的有效用户ID功能" - test_user="testuser" - useradd "$test_user" &>/dev/null - CHECK_RESULT $? 0 0 "创建测试用户失败" - - mysql_ssl_rsa_setup --uid="$test_user" --datadir=/tmp/mysql_data &>/dev/null - CHECK_RESULT $? 0 0 "执行 mysql_ssl_rsa_setup --uid 失败" - - # 验证文件权限 - LOG_INFO "验证生成的文件权限是否为指定的用户ID" - file_user=$(stat -c "%U" /tmp/mysql_data/server-key.pem) - if [ "$file_user" != "$test_user" ]; then - LOG_ERROR "文件权限未正确设置为指定的用户ID" - exit -1 - fi - - # 清理测试环境 - LOG_INFO "清理测试环境" - rm -rf /tmp/mysql_data - userdel "$test_user" &>/dev/null - - #如果脚本开始时未安装 GreatSQL Server,则在结束时卸载 - if [ "$installed" = false ]; then - LOG_INFO "卸载 GreatSQL Server" - dnf remove -y greatsql-server - CHECK_RESULT $? 0 0 "卸载 GreatSQL Server失败" - fi - - LOG_INFO "测试完成" -} - -main "$@" \ No newline at end of file diff --git a/testcases/function_test/pkg_test/greatsql/greatsql-server/test_greatsql-server_mysql_ssl_rsa_setup__upper_v.sh b/testcases/function_test/pkg_test/greatsql/greatsql-server/test_greatsql-server_mysql_ssl_rsa_setup__upper_v.sh deleted file mode 100644 index 8a75af53f44..00000000000 --- a/testcases/function_test/pkg_test/greatsql/greatsql-server/test_greatsql-server_mysql_ssl_rsa_setup__upper_v.sh +++ /dev/null @@ -1,70 +0,0 @@ -#!/usr/bin/bash - -# Copyright (c) 2024 ISCAS .ALL rights reserved. -# This program is licensed under Mulan PSL v2. -# You can use it according to the terms and conditions of the Mulan PSL v2. -# http://license.coscl.org.cn/MulanPSL2 -# THIS PROGRAM IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, -# EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, -# MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. -# See the Mulan PSL v2 for more details. - -# ############################################# -# @Author : honghua -# @Contact : honghua@iscas.ac.cn -# @Date : 2025-12-12 -# @License : Mulan PSL v2 -# @Desc : 测试 mysql_ssl_rsa_setup 命令的 -V 参数,验证是否能够显示程序版本信息 -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - - # 检查是否已安装GreatSQL Server软件包 - LOG_INFO "检查是否已安装GreatSQL Server软件包" - rpm -qa | grep -q greatsql-server - if [ $? -eq 0 ]; then - LOG_INFO "GreatSQL Server已安装,脚本结束时将保持安装状态" - INSTALLED=true - else - LOG_INFO "GreatSQL Server未安装,脚本结束时将卸载安装的软件包" - INSTALLED=false - fi - - # 检查yum源中是否存在GreatSQL Server软件包 - LOG_INFO "检查yum源中是否存在GreatSQL Server软件包" - dnf list available greatsql-server > /dev/null 2>&1 - if [ $? -ne 0 ]; then - LOG_ERROR "yum源中未找到GreatSQL Server软件包" - exit 255 - fi - - # 如果未安装,则安装GreatSQL Server软件包 - if ! $INSTALLED; then - LOG_INFO "安装GreatSQL Server软件包" - dnf install -y greatsql-server - CHECK_RESULT $? 0 0 "安装GreatSQL Server软件包失败" - fi - - # 测试mysql_ssl_rsa_setup命令的-V参数 - LOG_INFO "测试mysql_ssl_rsa_setup命令的-V参数" - mysql_ssl_rsa_setup -V > /dev/null 2>&1 - CHECK_RESULT $? 0 0 "mysql_ssl_rsa_setup命令不支持-V参数" - - # 如果脚本开始时未安装,则卸载GreatSQL Server软件包 - if ! $INSTALLED; then - LOG_INFO "卸载GreatSQL Server软件包" - dnf remove -y greatsql-server - CHECK_RESULT $? 0 0 "卸载GreatSQL Server软件包失败" - - # 清理残留文件 - LOG_INFO "清理残留文件" - rm -rf /var/lib/mysql* - fi - - LOG_INFO "测试脚本执行完毕,环境已恢复" - -} - -main "$@" \ No newline at end of file diff --git a/testcases/function_test/pkg_test/greatsql/greatsql-server/test_greatsql-server_mysql_ssl_rsa_setup__v.sh b/testcases/function_test/pkg_test/greatsql/greatsql-server/test_greatsql-server_mysql_ssl_rsa_setup__v.sh deleted file mode 100644 index cc158a058ab..00000000000 --- a/testcases/function_test/pkg_test/greatsql/greatsql-server/test_greatsql-server_mysql_ssl_rsa_setup__v.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-12-12 -# @License : Mulan PSL v2 -# @Desc : 测试 mysql_ssl_rsa_setup 命令的 -v 参数,验证是否能够显示详细运行信息 -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - LOG_INFO "开始测试 mysql_ssl_rsa_setup 命令的 -v 参数,验证是否能够显示详细运行信息" - - # 检查环境是否已安装 GreatSQL - LOG_INFO "检查 GreatSQL 是否已安装" - if dnf list installed greatsql-server &>/dev/null; then - LOG_INFO "GreatSQL 已安装,脚本结束时将保持安装状态" - installed=true - else - LOG_INFO "GreatSQL 未安装,将在测试结束后卸载" - installed=false - fi - - # 检查 yum 源中是否存在 greatsql-server 包 - LOG_INFO "检查 yum 源中是否存在 greatsql-server 包" - if ! dnf list available greatsql-server &>/dev/null; then - LOG_ERROR "yum 源中不存在 greatsql-server 包" - exit 255 - fi - - # 若未安装则安装 GreatSQL - if [ "$installed" = false ]; then - LOG_INFO "正在安装 greatsql-server" - dnf install -y greatsql-server - CHECK_RESULT $? 0 0 "安装 greatsql-server 失败" - fi - - # 检查 mysql_ssl_rsa_setup 命令是否存在 - LOG_INFO "检查 mysql_ssl_rsa_setup 命令是否存在" - if ! command -v mysql_ssl_rsa_setup &>/dev/null; then - LOG_ERROR "mysql_ssl_rsa_setup 命令不存在" - exit 255 - fi - - # 测试 -v 参数 - LOG_INFO "测试 mysql_ssl_rsa_setup -v 参数" - mysql_ssl_rsa_setup -v &>/tmp/mysql_ssl_rsa_setup_v.log - CHECK_RESULT $? 0 0 "mysql_ssl_rsa_setup -v 执行失败" - - #验证输出是否包含详细日志信息 - LOG_INFO "验证输出是否包含详细日志信息" - if grep -q "verbose" /tmp/mysql_ssl_rss_setup_v.log; then - LOG_INFO "-v 参数成功显示详细运行信息" - else - LOG_ERROR "-v 参数未能显示详细运行信息" - exit 1 - fi - - # 清理临时文件 - rm -f /tmp/mysql_ssl_rsa_setup_v.log - - #若脚本开始时未安装则卸载 GreatSQL - if [ "$installed" = false ]; then - LOG_INFO "正在卸载 greatsql-server" - dnf remove -y greatsql-server - CHECK_RESULT $? 0 0 "卸载 greatsql-server 失败" - fi - - LOG_INFO “测试完成” -} - -main "$@" \ No newline at end of file diff --git a/testcases/function_test/pkg_test/greatsql/greatsql-server/test_greatsql-server_mysql_tzinfo_to_sql_upper_v.sh b/testcases/function_test/pkg_test/greatsql/greatsql-server/test_greatsql-server_mysql_tzinfo_to_sql_upper_v.sh deleted file mode 100644 index bc84d6139f8..00000000000 --- a/testcases/function_test/pkg_test/greatsql/greatsql-server/test_greatsql-server_mysql_tzinfo_to_sql_upper_v.sh +++ /dev/null @@ -1,64 +0,0 @@ -#!/usr/bin/bash - -# Copyright (c) 2024 ISCAS .ALL rights reserved. -# This program is licensed under Mulan PSL v2. -# You can use it according to the terms and conditions of the Mulan PSL v2. -# http://license.coscl.org.cn/MulanPSL2 -# THIS PROGRAM IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, -# EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, -# MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. -# See the Mulan PSL v2 for more details. - -# ############################################# -# @Author : honghua -# @Contact : honghua@iscas.ac.cn -# @Date : 2025-12-12 -# @License : Mulan PSL v2 -# @Desc : 测试 mysql_tzinfo_to_sql 命令的 -V 参数 -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - - # 检查是否已安装GreatSQL服务器软件包 - LOG_INFO "检查是否已安装GreatSQL服务器软件包" - if rpm -q greatsql-server &>/dev/null; then - LOG_INFO "GreatSQL服务器已安装,脚本结束后将保持安装状态" - INSTALLED=true - else - LOG_INFO "GreatSQL服务器未安装,脚本结束后将卸载安装的软件包" - INSTALLED=false - fi - - # 检查yum源中是否存在GreatSQL服务器软件包 - LOG_INFO "检查yum源中是否存在GreatSQL服务器软件包" - if ! dnf list available greatsql-server &>/dev/null; then - LOG_ERROR "yum源中未找到GreatSQL服务器软件包" - exit 255 - fi - - # 安装GreatSQL服务器软件包(如果未安装) - if [ "$INSTALLED" = false ]; then - LOG_INFO "安装GreatSQL服务器软件包" - dnf install -y greatsql-server - CHECK_RESULT $? 0 0 "安装GreatSQL服务器软件包失败" - fi - - # 测试mysql_tzinfo_to_sql命令的-V参数 - LOG_INFO "测试mysql_tzinfo_to_sql命令的-V参数" - mysql_tzinfo_to_sql -V &>/dev/null - CHECK_RESULT $? 0 0 "mysql_tzinfo_to_sql命令不支持-V参数" - - # 清理环境(如果之前未安装) - if [ "$INSTALLED" = false ]; then - LOG_INFO "卸载GreatSQL服务器软件包" - dnf remove -y greatsql-server - CHECK_RESULT $? 0 0 "卸载GreatSQL服务器软件包失败" - fi - - LOG_INFO "测试脚本执行完毕,环境已恢复" - -} - -main "$@" \ No newline at end of file diff --git a/testcases/function_test/pkg_test/greatsql/greatsql-server/test_greatsql-server_mysql_tzinfo_to_sql_v.sh b/testcases/function_test/pkg_test/greatsql/greatsql-server/test_greatsql-server_mysql_tzinfo_to_sql_v.sh deleted file mode 100644 index 647e12f25b1..00000000000 --- a/testcases/function_test/pkg_test/greatsql/greatsql-server/test_greatsql-server_mysql_tzinfo_to_sql_v.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-12-12 -# @License : Mulan PSL v2 -# @Desc : 测试 mysql_tzinfo_to_sql 命令的 -v 参数 -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - # 检查是否已安装GreatSQL服务器软件包 - LOG_INFO "检查是否已安装GreatSQL服务器软件包" - rpm -q greatsql-server &>/dev/null - if [ $? -eq 0 ]; then - LOG_INFO "GreatSQL服务器已安装,脚本结束时将保持安装状态" - INSTALLED=true - else - LOG_INFO "GreatSQL服务器未安装,脚本结束时将卸载安装的软件包" - INSTALLED=false - fi - - # 检查yum源中是否存在GreatSQL服务器软件包 - LOG_INFO "检查yum源中是否存在GreatSQL服务器软件包" - dnf list available greatsql-server &>/dev/null - if [ $? -ne 0 ]; then - LOG_ERROR "yum源中未找到GreatSQL服务器软件包" - exit 255 - fi - - # 安装GreatSQL服务器软件包 - if [ "$INSTALLED" = false ]; then - LOG_INFO "安装GreatSQL服务器软件包" - dnf install -y greatsql-server - CHECK_RESULT $? 0 0 "安装GreatSQL服务器软件包失败" - fi - - # 检查mysql_tzinfo_to_sql命令是否支持-v参数 - LOG_INFO "检查mysql_tzinfo_to_sql命令是否支持-v参数" - mysql_tzinfo_to_sql --help | grep -q "\-v" - if [ $? -ne 0 ]; then - LOG_ERROR "mysql_tzinfo_to_sql命令不支持-v参数" - if [ "$INSTALLED" = false ]; then - dnf remove -y greatsql-server - CHECK_RESULT $? 0 0 "卸载GreatSQL服务器软件包失败" - fi - exit 255 - fi - - # 执行mysql_tzinfo_to_sql命令并检查结果 - LOG_INFO "执行mysql_tzinfo_to_sql命令并检查结果" - mysql_tzinfo_to_sql -v /usr/share/zoneinfo > /dev/null 2>&1 - CHECK_RESULT $? 0 0 "执行mysql_tzinfo_to_sql命令失败" - - # 清理环境,恢复到之前的状态 - if [ "$INSTALLED" = false ]; then - LOG_INFO "卸载GreatSQL服务器软件包" - dnf remove -y greatsql-server &>/dev/null || true - fi - - LOG_INFO "测试脚本执行完成" -} - -main "$@" \ No newline at end of file diff --git a/testcases/function_test/pkg_test/greatsql/greatsql-server/test_greatsql-server_mysqld_pre_systemd_status.sh b/testcases/function_test/pkg_test/greatsql/greatsql-server/test_greatsql-server_mysqld_pre_systemd_status.sh deleted file mode 100644 index 533cd16af68..00000000000 --- a/testcases/function_test/pkg_test/greatsql/greatsql-server/test_greatsql-server_mysqld_pre_systemd_status.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-12 -# @License : Mulan PSL v2 -# @Desc : 检查 mysqld_pre_systemd 服务的状态 -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - - # 检查 mysqld_pre_systemd 服务的状态 - LOG_INFO "开始测试:检查 mysqld_pre_systemd 服务的状态" - - # 检查是否已安装 greatsql-server 软件包 - LOG_INFO "检查 greatsql-server 是否已安装" - if rpm -q greatsql-server &>/dev/null; then - LOG_INFO "greatsql-server 已安装,跳过安装步骤" - installed=true - else - LOG_INFO "greatsql-server 未安装,开始安装" - # 检查 yum 源中是否存在 greatsql-server 软件包 - LOG_INFO "检查 yum 源中是否存在 greatsql-server 软件包" - if ! dnf list available greatsql-server &>/dev/null; then - LOG_ERROR "yum 源中未找到 greatsql-server 软件包" - exit 255 - fi - # 安装 greatsql-server - dnf install -y greatsql-server - CHECK_RESULT $? 0 0 "安装 greatsql-server 失败" - installed=false - fi - - # 检查 mysqld_pre_systemd.service是否存在并获取其状态 - LOG_INFO "检查 mysqld_pre_systemd.service是否存在" - if systemctl list-unit-files | grep -q mysqld_pre_systemd.service; then - LOG_INFO "mysqld_pre_systemd.service存在,获取其状态" - systemctl status mysqld_pre_systemd.service - CHECK_RESULT $? 0 0 "获取 mysqld_pre_systemd.service 状态失败" - else - LOG_ERROR "mysqld_pre_systemd.service不存在" - exit 255 - fi - - # 环境恢复:如果脚本开始时未安装,则卸载 greatsql-server - if [ "$installed" = false ]; then - LOG_INFO "卸载 greatsql-server" - dnf remove -y greatsql-server - CHECK_RESULT $? 0 0 "卸载great sql server失败" - fi - - LOG_INFO “测试完成:检查mys ql d pre system d服务状态” - exit 0 - -} - -main "$@" \ No newline at end of file diff --git a/testcases/function_test/pkg_test/greatsql/greatsql-server/test_greatsql-server_mysqld_pre_systemd_upper_v.sh b/testcases/function_test/pkg_test/greatsql/greatsql-server/test_greatsql-server_mysqld_pre_systemd_upper_v.sh deleted file mode 100644 index 2a9905291a3..00000000000 --- a/testcases/function_test/pkg_test/greatsql/greatsql-server/test_greatsql-server_mysqld_pre_systemd_upper_v.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-12 -# @License : Mulan PSL v2 -# @Desc : 测试mysqld_pre_systemd命令的-V参数,用于显示版本信息 -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - - # 检查环境是否已安装GreatSQL服务器 - LOG_INFO "检查GreatSQL服务器是否已安装..." - if dnf list installed greatsql-server &>/dev/null; then - LOG_INFO "GreatSQL服务器已安装,测试结束后将保持安装状态。" - installed=true - else - LOG_INFO "GreatSQL服务器未安装,测试结束后将卸载。" - installed=false - fi - - # 检查yum源中是否存在GreatSQL服务器软件包 - LOG_INFO "检查yum源中是否存在GreatSQL服务器软件包..." - if ! dnf list available greatsql-server &>/dev/null; then - LOG_ERROR "yum源中未找到GreatSQL服务器软件包。" - exit 255 - fi - - # 安装GreatSQL服务器(如果未安装) - if [ "$installed" = false ]; then - LOG_INFO "正在安装GreatSQL服务器..." - dnf install -y greatsql-server - CHECK_RESULT $? 0 0 "安装GreatSQL服务器失败。" - fi - - # 测试mysqld_pre_systemd命令的-V参数 - LOG_INFO "测试mysqld_pre_systemd命令的-V参数..." - output=$(mysqld_pre_systemd -V 2>&1) - CHECK_RESULT $? 0 0 "执行mysqld_pre_systemd -V失败。" - - # 验证输出是否包含版本信息 - LOG_INFO "验证输出是否包含版本信息..." - if [[ "$output" == *"version"* ]]; then - LOG_INFO "版本信息显示成功:$output" - else - LOG_ERROR "版本信息显示失败。" - exit 255 - fi - - # 清理环境(如果测试前未安装) - if [ "$installed" = false ]; then - LOG_INFO "正在卸载GreatSQL服务器..." - dnf remove -y greatsql-server - CHECK_RESULT $? 0 0 "卸载GreatSQL服务器失败。" - fi - - LOG_INFO "测试完成,环境已恢复。" - -} - -main "$@" \ No newline at end of file diff --git a/testcases/function_test/pkg_test/greatsql/greatsql-server/test_greatsql-server_mysqld_safe_core_file_size.sh b/testcases/function_test/pkg_test/greatsql/greatsql-server/test_greatsql-server_mysqld_safe_core_file_size.sh deleted file mode 100644 index f39fe015d10..00000000000 --- a/testcases/function_test/pkg_test/greatsql/greatsql-server/test_greatsql-server_mysqld_safe_core_file_size.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-12 -# @License : Mulan PSL v2 -# @Desc : 测试 mysqld_safe 命令的 --core-file-size 参数 -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - - LOG_INFO "开始测试 mysqld_safe 命令的 --core-file-size 参数" - - # 检查是否已安装 GreatSQL 服务器 - LOG_INFO "检查是否已安装 GreatSQL 服务器" - if dnf list installed greatsql-server &>/dev/null; then - LOG_INFO "GreatSQL 服务器已安装,测试完成后将保持安装状态" - INSTALLED=true - else - LOG_INFO "GreatSQL 服务器未安装,将在测试完成后卸载" - INSTALLED=false - fi - - # 检查 yum 源中是否存在 greatsql-server 软件包 - LOG_INFO "检查 yum 源中是否存在 greatsql-server 软件包" - if ! dnf list available greatsql-server &>/dev/null; then - LOG_ERROR "yum 源中未找到 greatsql-server 软件包" - exit 255 - fi - - # 如果未安装,则安装 greatsql-server - if [ "$INSTALLED" = false ]; then - LOG_INFO "开始安装 greatsql-server" - dnf install -y greatsql-server - CHECK_RESULT $? 0 0 "安装 greatsql-server 失败" - fi - - # 检查 mysqld_safe 命令是否支持 --core-file-size 参数 - LOG_INFO "检查 mysqld_safe 命令是否支持 --core-file-size 参数" - if ! mysqld_safe --help | grep -q -- "--core-file-size"; then - LOG_ERROR "mysqld_safe 命令不支持 --core-file-size 参数" - exit 255 - fi - - # 测试 mysqld_safe --core-file-size 参数 - LOG_INFO "测试 mysqld_safe --core-file-size 参数" - mysqld_safe --core-file-size=100M & - CHECK_RESULT $? 0 0 "mysqld_safe --core-file-size 执行失败" - - # 清理环境:如果之前未安装,则卸载 greatsql-server - if [ "$INSTALLED" = false ]; then - LOG_INFO "清理环境:卸载 greatsql-server" - dnf remove -y greatsql-server - CHECK_RESULT $? 0 0 "卸载 greatsql-server失败" - fi - - LOG_INFO "测试完成" - -} - -main "$@" \ No newline at end of file diff --git a/testcases/function_test/pkg_test/greatsql/greatsql-server/test_greatsql-server_mysqld_safe_defaults_file.sh b/testcases/function_test/pkg_test/greatsql/greatsql-server/test_greatsql-server_mysqld_safe_defaults_file.sh deleted file mode 100644 index be0098b13a0..00000000000 --- a/testcases/function_test/pkg_test/greatsql/greatsql-server/test_greatsql-server_mysqld_safe_defaults_file.sh +++ /dev/null @@ -1,93 +0,0 @@ -#!/usr/bin/bash - -# Copyright (c) 2024 ISCAS .ALL rights reserved. -# This program is licensed under Mulan PSL v2. -# You can use it according to the terms and conditions of the Mulan PSL v2. -# http://license.coscl.org.cn/MulanPSL2 -# THIS PROGRAM IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, -# EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, -# MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. -# See the Mulan PSL v2 for more details. - -# ############################################# -# @Author : honghua -# @Contact : honghua@iscas.ac.cn -# @Date : 2025-12-12 -# @License : Mulan PSL v2 -# @Desc : 测试 mysqld_safe 命令的 --defaults-file 参数 -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - - # 检查是否已安装GreatSQL服务器 - LOG_INFO "检查是否已安装GreatSQL服务器..." - if dnf list installed greatsql-server &>/dev/null; then - LOG_INFO "GreatSQL服务器已安装,脚本结束时将保持安装状态。" - INSTALLED=true - else - LOG_INFO "GreatSQL服务器未安装,脚本结束时将卸载安装的软件包。" - INSTALLED=false - fi - - # 检查yum源中是否有GreatSQL服务器软件包 - LOG_INFO "检查yum源中是否有GreatSQL服务器软件包..." - if ! dnf list available greatsql-server &>/dev/null; then - LOG_ERROR "yum源中未找到GreatSQL服务器软件包。" - exit 255 - fi - - # 安装GreatSQL服务器(如果未安装) - if [ "$INSTALLED" = false ]; then - LOG_INFO "正在安装GreatSQL服务器..." - dnf install -y greatsql-server - CHECK_RESULT $? 0 0 "安装GreatSQL服务器失败。" - fi - - # 检查mysqld_safe命令是否存在 - LOG_INFO "检查mysqld_safe命令是否存在..." - if ! command -v mysqld_safe &>/dev/null; then - LOG_ERROR "mysqld_safe命令不存在或不支持。" - exit 255 - fi - - # 测试mysqld_safe的--defaults-file参数 - LOG_INFO "测试mysqld_safe的--defaults-file参数..." - DEFAULTS_FILE="/etc/my.cnf" - - # 检查默认配置文件是否存在 - if [ ! -f "$DEFAULTS_FILE" ]; then - LOG_ERROR "默认配置文件$DEFAULTS_FILE不存在。" - exit 255 - fi - - # 执行mysqld_safe命令 - LOG_INFO "执行mysqld_safe --defaults-file=$DEFAULTS_FILE..." - mysqld_safe --defaults-file="$DEFAULTS_FILE" & - CHECK_RESULT $? 0 0 "执行mysqld_safe命令失败。" - - # 等待mysqld_safe启动 - sleep 5 - - # 检查mysqld进程是否运行 - LOG_INFO "检查mysqld进程是否运行..." - pgrep mysqld &>/dev/null - CHECK_RESULT $? 0 0 "mysqld进程未运行。" - - # 停止mysqld进程(清理环境) - LOG_INFO "停止mysqld进程..." - pkill mysqld - - # 卸载GreatSQL服务器(如果脚本开始时未安装) - if [ "$INSTALLED" = false ]; then - LOG_INFO "正在卸载GreatSQL服务器..." - dnf remove -y greatsql-server - CHECK_RESULT $? 0 0 "卸载GreatSQL服务器失败。" - fi - - LOG_INFO "测试脚本执行完成。" - -} - -main "$@" \ No newline at end of file diff --git a/testcases/function_test/pkg_test/greatsql/greatsql-server/test_greatsql-server_mysqld_safe_ledir.sh b/testcases/function_test/pkg_test/greatsql/greatsql-server/test_greatsql-server_mysqld_safe_ledir.sh deleted file mode 100644 index f883f9f5c19..00000000000 --- a/testcases/function_test/pkg_test/greatsql/greatsql-server/test_greatsql-server_mysqld_safe_ledir.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 : 测试 mysqld_safe 命令的 --ledir 参数 -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - LOG_INFO "开始测试 mysqld_safe 命令的 --ledir 参数" - - # 检查是否已安装GreatSQL-server - LOG_INFO "检查GreatSQL-server是否已安装" - if dnf list installed GreatSQL-server &>/dev/null; then - LOG_INFO "GreatSQL-server已安装,测试结束后保持安装状态" - INSTALLED=1 - else - LOG_INFO "GreatSQL-server未安装,测试结束后将卸载" - INSTALLED=0 - fi - - # 检查yum源中是否有GreatSQL-server软件包 - LOG_INFO "检查yum源中是否有GreatSQL-server软件包" - if ! dnf list available GreatSQL-server &>/dev/null; then - LOG_ERROR "yum源中未找到GreatSQL-server软件包" - exit 255 - fi - - # 若未安装则安装GreatSQL-server - if [ $INSTALLED -eq 0 ]; then - LOG_INFO "安装GreatSQL-server" - dnf install -y GreatSQL-server - CHECK_RESULT $? 0 0 "安装GreatSQL-server失败" - fi - - # 检查mysqld_safe命令是否存在 - LOG_INFO "检查mysqld_safe命令是否存在" - if ! command -v mysqld_safe &>/dev/null; then - LOG_ERROR "mysqld_safe命令不存在" - exit 255 - fi - - # 测试--ledir参数 - LOG_INFO "测试mysqld_safe的--ledir参数" - mysqld_safe --ledir=/usr/libexec &>/dev/null - CHECK_RESULT $? 0 0 "--ledir参数测试失败" - - # 清理环境:若测试前未安装则卸载GreatSQL-server - if [ $INSTALLED -eq 0 ]; then - LOG_INFO "卸载GreatSQL-server" - dnf remove -y GreatSQL-server - CHECK_RESULT $? 0 0 "卸载GreatSQL-server失败" - fi - - LOG_INFO "测试完成" -} - -main "$@" \ No newline at end of file diff --git a/testcases/function_test/pkg_test/greatsql/greatsql-server/test_greatsql-server_mysqld_safe_malloc_lib.sh b/testcases/function_test/pkg_test/greatsql/greatsql-server/test_greatsql-server_mysqld_safe_malloc_lib.sh deleted file mode 100644 index b41e9fef04f..00000000000 --- a/testcases/function_test/pkg_test/greatsql/greatsql-server/test_greatsql-server_mysqld_safe_malloc_lib.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-12-12 -# @License : Mulan PSL v2 -# @Desc : 测试 mysqld_safe 命令的 --malloc-lib 参数 -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - # 检查是否已安装greatsql-server软件包 - LOG_INFO "检查是否已安装greatsql-server软件包" - rpm -q greatsql-server > /dev/null 2>&1 - if [ $? -eq 0 ]; then - LOG_INFO "greatsql-server已安装,脚本结束后将保持安装状态" - INSTALLED=1 - else - LOG_INFO "greatsql-server未安装,脚本结束后将卸载" - INSTALLED=0 - fi - - # 检查yum源中是否存在greatsql-server软件包 - LOG_INFO "检查yum源中是否存在greatsql-server软件包" - dnf list available greatsql-server > /dev/null 2>&1 - if [ $? -ne 0 ]; then - LOG_ERROR "yum源中不存在greatsql-server软件包" - exit 255 - fi - - # 安装greatsql-server软件包 - if [ $INSTALLED -eq 0 ]; then - LOG_INFO "开始安装greatsql-server软件包" - dnf install -y greatsql-server > /dev/null 2>&1 - CHECK_RESULT $? 0 0 "安装greatsql-server失败" - fi - - # 检查mysqld_safe命令是否支持--malloc-lib参数 - LOG_INFO "检查mysqld_safe命令是否支持--malloc-lib参数" - mysqld_safe --help | grep -q "\-\-malloc-lib" - if [ $? -ne 0 ]; then - LOG_ERROR "mysqld_safe命令不支持--malloc-lib参数" - exit 255 - fi - - # 测试mysqld_safe命令的--malloc-lib参数功能 - LOG_INFO "测试mysqld_safe命令的--malloc-lib参数功能" - mysqld_safe --malloc-lib=/usr/lib64/libtcmalloc.so & - CHECK_RESULT $? 0 0 "执行mysqld_safe --malloc-lib失败" - - # 检查mysqld进程是否启动成功 - LOG_INFO "检查mysqld进程是否启动成功" - ps -ef | grep -v grep | grep -q mysqld_safe - CHECK_RESULT $? 0 0 "mysqld_safe进程未启动" - - # 停止mysqld_safe进程并清理环境变量和临时文件等资源(如有) - LOG_INFO "停止mysqld_safe进程并清理环境" - pkill mysqld_safe > /dev/null 2>&1 - sleep 3 # 等待进程完全停止 - - #如果脚本开始时未安装,则卸载软件包 - if [ $INSTALLED -eq 0 ]; then - LOG_INFO"卸载great sql server软件以恢复环境" - dnf remove-y great sql server >/dev /null 2>&1 - CHECK _RESULT$?00"卸载great sql server失败" - fi - - LOG_INFO"测试完成" -} - -main "$@" \ No newline at end of file diff --git a/testcases/function_test/pkg_test/greatsql/greatsql-server/test_greatsql-server_mysqld_safe_mysqld.sh b/testcases/function_test/pkg_test/greatsql/greatsql-server/test_greatsql-server_mysqld_safe_mysqld.sh deleted file mode 100644 index a7d0b0d25fb..00000000000 --- a/testcases/function_test/pkg_test/greatsql/greatsql-server/test_greatsql-server_mysqld_safe_mysqld.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-12 -# @License : Mulan PSL v2 -# @Desc : 测试 mysqld_safe 命令的 --mysqld 参数 -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - - LOG_INFO "开始测试 mysqld_safe 命令的 --mysqld 参数" - - # 检查是否已安装 greatsql-server 软件包 - LOG_INFO "检查是否已安装 greatsql-server 软件包" - if rpm -q greatsql-server >/dev/null 2>&1; then - LOG_INFO "greatsql-server 已安装,脚本结束后保持安装状态" - INSTALLED=true - else - LOG_INFO "greatsql-server 未安装,将在测试结束后卸载" - INSTALLED=false - fi - - # 检查 yum 源中是否有 greatsql-server 软件包 - LOG_INFO "检查 yum 源中是否有 greatsql-server 软件包" - if ! dnf list available greatsql-server >/dev/null 2>&1; then - LOG_ERROR "yum 源中未找到 greatsql-server 软件包" - exit 255 - fi - - # 如果未安装,则安装 greatsql-server - if [ "$INSTALLED" = false ]; then - LOG_INFO "安装 greatsql-server 软件包" - dnf install -y greatsql-server - CHECK_RESULT $? 0 0 "安装 greatsql-server 失败" - fi - - # 检查 mysqld_safe 命令是否支持 --mysqld 参数 - LOG_INFO "检查 mysqld_safe 命令是否支持 --mysqld 参数" - if ! mysqld_safe --help 2>&1 | grep -q -- "--mysqld"; then - LOG_ERROR "mysqld_safe 命令不支持 --mysqld 参数" - exit 255 - fi - - # 测试 mysqld_safe --mysqld 参数 - LOG_INFO "测试 mysqld_safe --mysqld 参数" - mysqld_safe --mysqld=mysqld - CHECK_RESULT $? 0 0 "执行 mysqld_safe --mysqld 失败" - - # 清理环境:如果脚本开始时未安装,则卸载 greatsql-server - if [ "$INSTALLED" = false ]; then - LOG_INFO "卸载 greatsql-server 软件包" - dnf remove -y greatsql-server - CHECK_RESULT $? 0-1-255 0 "卸载 greatsql-server失败" # 允许卸载成功或未安装时退出码为0或1(未找到) - fi - - LOG_INFO "测试完成,环境已恢复" - -} - -main "$@" \ No newline at end of file diff --git a/testcases/function_test/pkg_test/greatsql/greatsql-server/test_greatsql-server_mysqld_safe_no_defaults.sh b/testcases/function_test/pkg_test/greatsql/greatsql-server/test_greatsql-server_mysqld_safe_no_defaults.sh deleted file mode 100644 index 930a2a27d37..00000000000 --- a/testcases/function_test/pkg_test/greatsql/greatsql-server/test_greatsql-server_mysqld_safe_no_defaults.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-12 -# @License : Mulan PSL v2 -# @Desc : 测试 mysqld_safe 命令的 --no-defaults 参数 -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - LOG_INFO "开始测试 mysqld_safe 命令的 --no-defaults 参数" - - # 检查软件包是否已安装 - LOG_INFO "检查 GreatSQL-Server 是否已安装" - if dnf list installed greatsql-server &>/dev/null; then - LOG_INFO "GreatSQL-Server 已安装,脚本结束后将保持安装状态" - INSTALLED=true - else - LOG_INFO "GreatSQL-Server 未安装,将在测试结束后卸载" - INSTALLED=false - fi - - # 检查 yum 源中是否有该软件包 - LOG_INFO "检查 yum 源中是否有 GreatSQL-Server 软件包" - if ! dnf list available greatsql-server &>/dev/null; then - LOG_ERROR "yum 源中未找到 GreatSQL-Server 软件包" - exit 255 - fi - - # 如果未安装,则安装软件包 - if [ "$INSTALLED" = false ]; then - LOG_INFO "开始安装 GreatSQL-Server" - dnf install -y greatsql-server - CHECK_RESULT $? 0 0 "安装 GreatSQL-Server 失败" - fi - - # 测试 mysqld_safe --no-defaults 参数 - LOG_INFO "测试 mysqld_safe --no-defaults 参数" - mysqld_safe --no-defaults &>/dev/null - CHECK_RESULT $? 0 0 "mysqld_safe --no-defaults 参数不支持或执行失败" - - # 清理环境 - if [ "$INSTALLED" = false ]; then - LOG_INFO "卸载 GreatSQL-Server" - dnf remove -y greatsql-server - CHECK_RESULT $? 0 0 "卸载 GreatSQL-Server 失败" - fi - - LOG_INFO "测试完成,环境已恢复" -} - -main "$@" \ No newline at end of file diff --git a/testcases/function_test/pkg_test/greatsql/greatsql-server/test_greatsql-server_mysqld_safe_open_files_limit.sh b/testcases/function_test/pkg_test/greatsql/greatsql-server/test_greatsql-server_mysqld_safe_open_files_limit.sh deleted file mode 100644 index 8772bd8a0f1..00000000000 --- a/testcases/function_test/pkg_test/greatsql/greatsql-server/test_greatsql-server_mysqld_safe_open_files_limit.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-12-12 -# @License : Mulan PSL v2 -# @Desc : 测试 mysqld_safe 命令的 --open-files-limit 参数 -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - LOG_INFO "开始测试 mysqld_safe 命令的 --open-files-limit 参数" - - # 检查是否已安装 GreatSQL - LOG_INFO "检查是否已安装 GreatSQL" - if ! dnf list installed greatsql-server &>/dev/null; then - LOG_INFO "GreatSQL 未安装,将进行安装" - INSTALLED=false - else - LOG_INFO "GreatSQL 已安装" - INSTALLED=true - fi - - # 检查 yum 源中是否存在 GreatSQL 软件包 - LOG_INFO "检查 yum 源中是否存在 GreatSQL 软件包" - if ! dnf list available greatsql-server &>/dev/null; then - LOG_ERROR "yum 源中未找到 GreatSQL 软件包" - exit 255 - fi - - # 如果未安装,则安装 GreatSQL - if [ "$INSTALLED" = false ]; then - LOG_INFO "正在安装 GreatSQL" - dnf install -y greatsql-server - CHECK_RESULT $? 0 0 "安装 GreatSQL 失败" - fi - - # 检查 mysqld_safe 命令是否支持 --open-files-limit 参数 - LOG_INFO "检查 mysqld_safe 命令是否支持 --open-files-limit 参数" - if ! mysqld_safe --help | grep -q -- "--open-files-limit"; then - LOG_ERROR "mysqld_safe 命令不支持 --open-files-limit 参数" - exit 255 - fi - - # 测试 mysqld_safe --open-files-limit 参数 - LOG_INFO "测试 mysqld_safe --open-files-limit 参数" - mysqld_safe --open-files-limit=1024 & - CHECK_RESULT $? 0 0 "执行 mysqld_safe --open-files-limit 失败" - - # 清理环境 - LOG_INFO "清理环境" - pkill mysqld_safe - - #如果之前未安装,则卸载 GreatSQL - if [ "$INSTALLED" = false ]; then - LOG_INFO "卸载 GreatSQL" - dnf remove -y greatsql-server - CHECK_RESULT $? 0 0 \"卸载 GreatSQL 失败\"" - fi - - LOG_INFO "测试完成" -} - -main "$@" \ No newline at end of file diff --git a/testcases/function_test/pkg_test/greatsql/greatsql-server/test_greatsql-server_mysqld_safe_timezone.sh b/testcases/function_test/pkg_test/greatsql/greatsql-server/test_greatsql-server_mysqld_safe_timezone.sh deleted file mode 100644 index dcf357e8741..00000000000 --- a/testcases/function_test/pkg_test/greatsql/greatsql-server/test_greatsql-server_mysqld_safe_timezone.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-12 -# @License : Mulan PSL v2 -# @Desc : 测试 mysqld_safe 命令的 --timezone 参数 -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - LOG_INFO "开始测试 mysqld_safe 命令的 --timezone 参数" - - # 检查是否已安装 greatsql-server 软件包 - LOG_INFO "检查是否已安装 greatsql-server 软件包" - if dnf list installed greatsql-server &>/dev/null; then - LOG_INFO "greatsql-server 已安装,脚本结束时将保持安装状态" - INSTALLED=true - else - LOG_INFO "greatsql-server 未安装,将在测试结束后卸载" - INSTALLED=false - fi - - # 检查 yum 源中是否有 greatsql-server 软件包 - LOG_INFO "检查 yum 源中是否有 greatsql-server 软件包" - if ! dnf list available greatsql-server &>/dev/null; then - LOG_ERROR "yum 源中未找到 greatsql-server 软件包" - exit 255 - fi - - # 如果未安装,则安装 greatsql-server - if [ "$INSTALLED" = false ]; then - LOG_INFO "安装 greatsql-server 软件包" - dnf install -y greatsql-server - CHECK_RESULT $? 0 0 "安装 greatsql-server 失败" - fi - - # 检查 mysqld_safe 命令是否支持 --timezone 参数 - LOG_INFO "检查 mysqld_safe --help | grep timezone" - if ! mysqld_safe --help | grep -q timezone; then - LOG_ERROR "mysqld_safe 命令不支持 --timezone 参数" - exit 255 - fi - - #测试 mysqld_safe 的 --timezone 参数 - LOG_INFO "测试 mysqld_safe 的 --timezone=UTC+8" - mysqld_safe --timezone=UTC+8 & - CHECK_RESULT $? 0 0 "mysqld_safe --timezone=UTC+8 failed" - - #停止 mysql - LOG_INFO "停止 mysql 服务" - mysqladmin shutdown - CHECK_RESULT $? 0 0 "停止 mysql failed" - - #环境恢复:如果之前未安装,则卸载 greatql_server - if [ "$INSTALLED" = false ]; then - LOG_INFO "卸载 greatql_server 软件包" - dnf remove -y greatql_server - CHECK_RESULT $? 0 1 “卸载 greatql_server failed” - fi - - LOG_INFO “测试完成” -} - -main "$@" \ No newline at end of file diff --git a/testcases/function_test/pkg_test/greatsql/greatsql-server/test_greatsql-server_mysqldecompress_file-type_lz4.sh b/testcases/function_test/pkg_test/greatsql/greatsql-server/test_greatsql-server_mysqldecompress_file-type_lz4.sh deleted file mode 100644 index bf523b6ddd7..00000000000 --- a/testcases/function_test/pkg_test/greatsql/greatsql-server/test_greatsql-server_mysqldecompress_file-type_lz4.sh +++ /dev/null @@ -1,78 +0,0 @@ -#!/usr/bin/bash - -# Copyright (c) 2024 ISCAS .ALL rights reserved. -# This program is licensed under Mulan PSL v2. -# You can use it according to the terms and conditions of the Mulan PSL v2. -# http://license.coscl.org.cn/MulanPSL2 -# THIS PROGRAM IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, -# EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, -# MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. -# See the Mulan PSL v2 for more details. - -# ############################################# -# @Author : honghua -# @Contact : honghua@iscas.ac.cn -# @Date : 2025-12-12 -# @License : Mulan PSL v2 -# @Desc : 测试mysqldecompress命令使用lz4文件类型进行解压 -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - LOG_INFO "开始测试mysqldecompress命令使用lz4文件类型进行解压" - - # 检查是否已安装greatsql-server软件包 - LOG_INFO "检查是否已安装greatsql-server软件包" - if dnf list installed greatsql-server &>/dev/null; then - LOG_INFO "greatsql-server已安装" - INSTALLED=true - else - LOG_INFO "greatsql-server未安装" - INSTALLED=false - fi - - # 检查yum源中是否有greatsql-server软件包 - LOG_INFO "检查yum源中是否有greatsql-server软件包" - if ! dnf list available greatsql-server &>/dev/null; then - LOG_ERROR "yum源中未找到greatsql-server软件包" - exit 255 - fi - - # 如果未安装,则安装软件包 - if [ "$INSTALLED" = false ]; then - LOG_INFO "安装greatsql-server软件包" - dnf install -y greatsql-server - CHECK_RESULT $? 0 0 "安装greatsql-server失败" - fi - - # 检查mysqldecompress命令是否支持lz4文件类型 - LOG_INFO "检查mysqldecompress命令是否支持lz4文件类型" - if ! mysqldecompress --help | grep -q "lz4"; then - LOG_ERROR "mysqldecompress命令不支持lz4文件类型" - exit 255 - fi - - # 测试mysqldecompress命令使用lz4文件类型进行解压 - LOG_INFO "测试mysqldecompress命令使用lz4文件类型进行解压" - TEST_FILE="/tmp/test_lz4.lz4" - echo "test data" > "${TEST_FILE%.*}" - lz4 "${TEST_FILE%.*}" "$TEST_FILE" - mysqldecompress --type=lz4 "$TEST_FILE" "${TEST_FILE%.*}.decompressed" - CHECK_RESULT $? 0 0 "解压lz4文件失败" - - # 清理测试文件 - LOG_INFO "清理测试文件" - rm -f "${TEST_FILE%.*}" "$TEST_FILE" "${TEST_FILE%.*}.decompressed" - - # 如果脚本开始时未安装,则在结束时卸载软件包 - if [ "$INSTALLED" = false ]; then - LOG_INFO "卸载greatsql-server软件包" - dnf remove -y greatsql-server - CHECK_RESULT $? 0 -1 "卸载greatsql-server失败" # -1表示不检查退出码是否为0 - fi - - LOG_INFO "测试完成" -} - -main "$@" \ No newline at end of file diff --git a/testcases/function_test/pkg_test/greatsql/greatsql-server/test_greatsql-server_mysqldecompress_help.sh b/testcases/function_test/pkg_test/greatsql/greatsql-server/test_greatsql-server_mysqldecompress_help.sh deleted file mode 100644 index 0f75d15a966..00000000000 --- a/testcases/function_test/pkg_test/greatsql/greatsql-server/test_greatsql-server_mysqldecompress_help.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-12 -# @License : Mulan PSL v2 -# @Desc : 测试mysqldecompress命令的帮助文档显示 -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - - # 检查yum源中是否存在GreatSQL-server软件包 - LOG_INFO "检查yum源中是否存在GreatSQL-server软件包" - dnf list available GreatSQL-server >/dev/null 2>&1 - if [ $? -ne 0 ]; then - LOG_ERROR "yum源中未找到GreatSQL-server软件包" - exit 255 - fi - - # 检查是否已安装GreatSQL-server - LOG_INFO "检查是否已安装GreatSQL-server" - rpm -q GreatSQL-server >/dev/null 2>&1 - installed=$? - - # 如果未安装,则安装软件包 - if [ $installed -ne 0 ]; then - LOG_INFO "安装GreatSQL-server软件包" - dnf install -y GreatSQL-server - CHECK_RESULT $? 0 0 "安装GreatSQL-server失败" - fi - - # 测试mysqldecompress命令的帮助文档显示 - LOG_INFO "测试mysqldecompress命令的帮助文档显示" - mysqldecompress --help >/dev/null 2>&1 - CHECK_RESULT $? 0 0 "mysqldecompress命令帮助文档显示失败" - - # 如果最初未安装,则卸载软件包 - if [ $installed -ne 0 ]; then - LOG_INFO "卸载GreatSQL-server软件包" - dnf remove -y GreatSQL-server - CHECK_RESULT $? 0 0 "卸载GreatSQL-server失败" - fi - - LOG_INFO "测试完成" - -} - -main "$@" \ No newline at end of file diff --git a/testcases/function_test/pkg_test/greatsql/greatsql-server/test_greatsql-server_mysqldumpslow_num_1.sh b/testcases/function_test/pkg_test/greatsql/greatsql-server/test_greatsql-server_mysqldumpslow_num_1.sh deleted file mode 100644 index 9304069a785..00000000000 --- a/testcases/function_test/pkg_test/greatsql/greatsql-server/test_greatsql-server_mysqldumpslow_num_1.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 : 2025-12-12 -# @License : Mulan PSL v2 -# @Desc : 测试mysqldumpslow的-1参数,查看数字参数的功能 -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - # 测试mysqldumpslow的-1参数,查看数字参数的功能 - - LOG_INFO "开始测试mysqldumpslow的-1参数功能" - - # 检查是否已安装greatsql-server包 - LOG_INFO "检查是否已安装greatsql-server包" - if ! dnf list installed greatsql-server &>/dev/null; then - LOG_INFO "greatsql-server未安装,准备安装" - # 检查yum源中是否有该软件包 - if ! dnf list available greatsql-server &>/dev/null; then - LOG_ERROR "yum源中未找到greatsql-server包" - exit 255 - fi - # 安装greatsql-server - dnf install -y greatsql-server - CHECK_RESULT $? 0 0 "安装greatsql-server失败" - INSTALLED=true - else - LOG_INFO "greatsql-server已安装" - INSTALLED=false - fi - - # 检查mysqldumpslow命令是否存在 - LOG_INFO "检查mysqldumpslow命令是否存在" - if ! command -v mysqldumpslow &>/dev/null; then - LOG_ERROR "mysqldumpslow命令不存在" - exit 255 - fi - - # 测试mysqldumpslow的-1参数功能 - LOG_INFO "测试mysqldumpslow的-1参数功能" - mysqldumpslow -1 &>/tmp/mysqldumpslow_test.log - CHECK_RESULT $? 0 0 "执行mysqldumpslow -1失败" - - # 检查输出是否符合预期(假设输出应包含数字) - LOG_INFO "检查输出是否符合预期" - if grep -q "[0-9]" /tmp/mysqldumpslow_test.log; then - LOG_INFO "-1参数功能正常,输出中包含数字" - else - LOG_ERROR "-1参数功能异常,输出中未包含数字" - exit 255 - fi - - # 清理临时文件 - rm -f /tmp/mysqldumpslow_test.log - - # 如果脚本安装的包,则在结束时卸载 - if [ "$INSTALLED" = true ]; then - LOG_INFO "卸载greatsql-server包" - dnf remove -y greatsql-server - CHECK_RESULT $? 0 0 "卸载greatsql-server失败" - fi - - LOG_INFO "测试mysqldumpslow的-1参数功能完成" -} - -main "$@" \ No newline at end of file diff --git a/testcases/function_test/pkg_test/greatsql/greatsql-server/test_greatsql-server_mysqldumpslow_upper_v.sh b/testcases/function_test/pkg_test/greatsql/greatsql-server/test_greatsql-server_mysqldumpslow_upper_v.sh deleted file mode 100644 index 94d149e8897..00000000000 --- a/testcases/function_test/pkg_test/greatsql/greatsql-server/test_greatsql-server_mysqldumpslow_upper_v.sh +++ /dev/null @@ -1,64 +0,0 @@ -#!/usr/bin/bash - -# Copyright (c) 2024 ISCAS .ALL rights reserved. -# This program is licensed under Mulan PSL v2. -# You can use it according to the terms and conditions of the Mulan PSL v2. -# http://license.coscl.org.cn/MulanPSL2 -# THIS PROGRAM IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, -# EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, -# MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. -# See the Mulan PSL v2 for more details. - -# ############################################# -# @Author : honghua -# @Contact : honghua@iscas.ac.cn -# @Date : 2025-12-12 -# @License : Mulan PSL v2 -# @Desc : 测试mysqldumpslow的-V参数,查看版本信息(大写) -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - - # 检查是否已安装GreatSQL-server软件包 - LOG_INFO "检查是否已安装GreatSQL-server软件包" - if dnf list installed greatsql-server &>/dev/null; then - LOG_INFO "GreatSQL-server已安装,脚本结束后保持安装状态" - installed=true - else - LOG_INFO "GreatSQL-server未安装,脚本结束后将卸载" - installed=false - fi - - # 检查yum源中是否存在GreatSQL-server软件包 - LOG_INFO "检查yum源中是否存在GreatSQL-server软件包" - if ! dnf list available greatsql-server &>/dev/null; then - LOG_ERROR "yum源中未找到GreatSQL-server软件包" - exit 255 - fi - - # 安装GreatSQL-server软件包(如果未安装) - if [ "$installed" = false ]; then - LOG_INFO "安装GreatSQL-server软件包" - dnf install -y greatsql-server - CHECK_RESULT $? 0 0 "安装GreatSQL-server失败" - fi - - # 测试mysqldumpslow的-V参数(大写) - LOG_INFO "测试mysqldumpslow的-V参数,查看版本信息" - mysqldumpslow -V &>/dev/null - CHECK_RESULT $? 0 0 "mysqldumpslow命令不支持-V参数" - - # 清理环境(如果脚本开始时未安装) - if [ "$installed" = false ]; then - LOG_INFO "卸载GreatSQL-server软件包" - dnf remove -y greatsql-server - CHECK_RESULT $? 0 0 "卸载GreatSQL-server失败" - fi - - LOG_INFO "测试脚本执行完成" - -} - -main "$@" \ No newline at end of file diff --git a/testcases/function_test/pkg_test/greatsql/greatsql-server/test_greatsql-server_mysqldumpslow_v.sh b/testcases/function_test/pkg_test/greatsql/greatsql-server/test_greatsql-server_mysqldumpslow_v.sh deleted file mode 100644 index 25ccc151f4a..00000000000 --- a/testcases/function_test/pkg_test/greatsql/greatsql-server/test_greatsql-server_mysqldumpslow_v.sh +++ /dev/null @@ -1,67 +0,0 @@ -#!/usr/bin/bash - -# Copyright (c) 2024 ISCAS .ALL rights reserved. -# This program is licensed under Mulan PSL v2. -# You can use it according to the terms and conditions of the Mulan PSL v2. -# http://license.coscl.org.cn/MulanPSL2 -# THIS PROGRAM IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, -# EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, -# MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. -# See the Mulan PSL v2 for more details. - -# ############################################# -# @Author : honghua -# @Contact : honghua@iscas.ac.cn -# @Date : 2025-12-12 -# @License : Mulan PSL v2 -# @Desc : 测试mysqldumpslow的-v参数,查看详细输出模式 -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - LOG_INFO "开始测试mysqldumpslow的-v参数,查看详细输出模式" - - # 检查是否已安装greatsql-server包 - LOG_INFO "检查是否已安装greatsql-server包" - if ! dnf list installed greatsql-server &>/dev/null; then - LOG_INFO "greatsql-server未安装,开始安装" - if ! dnf list available greatsql-server &>/dev/null; then - LOG_ERROR "yum源中未找到greatsql-server包" - exit 255 - fi - dnf install -y greatsql-server - CHECK_RESULT $? 0 0 "安装greatsql-server失败" - INSTALLED=1 - else - LOG_INFO "greatsql-server已安装" - INSTALLED=0 - fi - - # 检查mysqldumpslow命令是否存在 - LOG_INFO "检查mysqldumpslow命令是否存在" - if ! command -v mysqldumpslow &>/dev/null; then - LOG_ERROR "mysqldumpslow命令不存在" - if [ $INSTALLED -eq 1 ]; then - dnf remove -y greatsql-server - CHECK_RESULT $? 0 0 "卸载greatsql-server失败" - fi - exit 255 - fi - - # 测试mysqldumpslow的-v参数 - LOG_INFO "测试mysqldumpslow的-v参数" - mysqldumpslow -v &>/dev/null - CHECK_RESULT $? 0 0 "mysqldumpslow的-v参数不支持" - - # 清理环境,如果之前未安装则卸载 - if [ $INSTALLED -eq 1 ]; then - LOG_INFO "清理环境,卸载greatsql-server" - dnf remove -y greatsql-server - CHECK_RESULT $? 0 0 "卸载greatsql-server失败" - fi - - LOG_INFO "测试完成" -} - -main "$@" \ No newline at end of file diff --git a/testcases/function_test/pkg_test/greatsql/greatsql-server/test_greatsql-server_perror_info.sh b/testcases/function_test/pkg_test/greatsql/greatsql-server/test_greatsql-server_perror_info.sh deleted file mode 100644 index 22b99577a30..00000000000 --- a/testcases/function_test/pkg_test/greatsql/greatsql-server/test_greatsql-server_perror_info.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-12 -# @License : Mulan PSL v2 -# @Desc : 测试 perror 命令的 info 参数显示帮助信息 -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - LOG_INFO "开始测试 perror 命令的 info 参数显示帮助信息" - - # 检查是否已安装 greatsql-server - LOG_INFO "检查 greatsql-server 是否已安装" - if dnf list installed greatsql-server &> /dev/null; then - LOG_INFO "greatsql-server 已安装,测试完成后将保持安装状态" - INSTALLED=true - else - LOG_INFO "greatsql-server 未安装,测试完成后将卸载" - INSTALLED=false - fi - - # 检查 yum 源中是否有 greatsql-server - LOG_INFO "检查 yum 源中是否有 greatsql-server" - if ! dnf list available greatsql-server &> /dev/null; then - LOG_ERROR "yum 源中未找到 greatsql-server 软件包" - exit 255 - fi - - # 如果未安装,则安装 greatsql-server - if [ "$INSTALLED" = false ]; then - LOG_INFO "开始安装 greatsql-server" - dnf install -y greatsql-server - CHECK_RESULT $? 0 0 "安装 greatsql-server 失败" - fi - - # 测试 perror info 参数显示帮助信息 - LOG_INFO "测试 perror info 参数显示帮助信息" - perror --info &> /dev/null - CHECK_RESULT $? 0 0 "perror info 参数不支持或执行失败" - - # 清理环境 - if [ "$INSTALLED" = false ]; then - LOG_INFO "卸载 greatsql-server" - dnf remove -y greatsql-server - CHECK_RESULT $? 0 0 "卸载 greatsql-server 失败" - fi - - LOG_INFO "测试完成,环境已恢复" -} - -main "$@" \ No newline at end of file diff --git a/testcases/function_test/pkg_test/greatsql/greatsql-server/test_greatsql-server_perror_silent.sh b/testcases/function_test/pkg_test/greatsql/greatsql-server/test_greatsql-server_perror_silent.sh deleted file mode 100644 index 74f51adf178..00000000000 --- a/testcases/function_test/pkg_test/greatsql/greatsql-server/test_greatsql-server_perror_silent.sh +++ /dev/null @@ -1,62 +0,0 @@ -#!/usr/bin/bash - -# Copyright (c) 2024 ISCAS .ALL rights reserved. -# This program is licensed under Mulan PSL v2. -# You can use it according to the terms and conditions of the Mulan PSL v2. -# http://license.coscl.org.cn/MulanPSL2 -# THIS PROGRAM IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, -# EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, -# MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. -# See the Mulan PSL v2 for more details. - -# ############################################# -# @Author : honghua -# @Contact : honghua@iscas.ac.cn -# @Date : 2025-12-12 -# @License : Mulan PSL v2 -# @Desc : 测试 perror 命令的 silent 参数仅打印错误信息 -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - # 检查是否已安装GreatSQL - LOG_INFO "检查是否已安装GreatSQL" - if dnf list installed greatsql-server &>/dev/null; then - LOG_INFO "GreatSQL已安装,脚本结束后将保持安装状态" - INSTALLED=true - else - LOG_INFO "GreatSQL未安装,脚本结束后将卸载" - INSTALLED=false - fi - - # 检查yum源中是否存在GreatSQL软件包 - LOG_INFO "检查yum源中是否存在GreatSQL软件包" - if ! dnf list available greatsql-server &>/dev/null; then - LOG_ERROR "yum源中未找到GreatSQL软件包" - exit 255 - fi - - # 安装GreatSQL(如果未安装) - if [ "$INSTALLED" = false ]; then - LOG_INFO "开始安装GreatSQL" - dnf install -y greatsql-server - CHECK_RESULT $? 0 0 "安装GreatSQL失败" - fi - - # 测试perror命令的silent参数仅打印错误信息 - LOG_INFO "测试perror命令的silent参数仅打印错误信息" - perror --silent 0 &>/dev/null - CHECK_RESULT $? 0 0 "perror --silent 0执行失败" - - # 清理环境(如果脚本开始时未安装) - if [ "$INSTALLED" = false ]; then - LOG_INFO "卸载GreatSQL" - dnf remove -y greatsql-server - CHECK_RESULT $? 0 0 "卸载GreatSQL失败" - fi - - LOG_INFO "测试脚本执行完成" -} - -main "$@" \ No newline at end of file diff --git a/testcases/function_test/pkg_test/greatsql/greatsql-server/test_greatsql-server_perror_upper_v.sh b/testcases/function_test/pkg_test/greatsql/greatsql-server/test_greatsql-server_perror_upper_v.sh deleted file mode 100644 index 4db81de5761..00000000000 --- a/testcases/function_test/pkg_test/greatsql/greatsql-server/test_greatsql-server_perror_upper_v.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-12-12 -# @License : Mulan PSL v2 -# @Desc : 测试 perror 命令的 version 参数显示版本信息 -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - - # 检查perror命令的version参数显示版本信息 - LOG_INFO "开始测试 perror 命令的 version 参数显示版本信息" - - # 检查是否已安装GreatSQL-server软件包 - LOG_INFO "检查GreatSQL-server是否已安装" - if rpm -q GreatSQL-server &>/dev/null; then - LOG_INFO "GreatSQL-server已安装,跳过安装步骤" - INSTALLED=true - else - LOG_INFO "GreatSQL-server未安装,准备安装" - INSTALLED=false - fi - - # 如果未安装,则尝试安装 - if [ "$INSTALLED" = false ]; then - LOG_INFO "检查yum源中是否存在GreatSQL-server软件包" - if ! dnf list available GreatSQL-server &>/dev/null; then - LOG_ERROR "yum源中不存在GreatSQL-server软件包" - exit 255 - fi - - LOG_INFO "安装GreatSQL-server软件包" - dnf install -y GreatSQL-server - CHECK_RESULT $? 0 0 "安装GreatSQL-server失败" - fi - - # 检查perror命令是否存在 - LOG_INFO "检查perror命令是否存在" - if ! command -v perror &>/dev/null; then - LOG_ERROR "perror命令不存在或不支持" - exit 255 - fi - - # 测试perror命令的version参数 - LOG_INFO "测试perror命令的version参数" - perror --version &>/dev/null - CHECK_RESULT $? 0 0 "perror命令的version参数不支持或执行失败" - - # 输出版本信息并验证 - VERSION_OUTPUT=$(perror --version) - if [ -z "$VERSION_OUTPUT" ]; then - LOG_ERROR "未获取到版本信息" - exit 1 - else - LOG_INFO "获取到的版本信息: $VERSION_OUTPUT" - fi - - # 清理环境:如果脚本开始时未安装,则卸载 - if [ "$INSTALLED" = false ]; then - LOG_INFO "卸载GreatSQL-server软件包" - dnf remove -y GreatSQL-server - CHECK_RESULT $? 0 0 "卸载GreatSQL-server失败" - fi - - LOG_INFO "测试完成,环境已恢复" - -} - -main "$@" \ No newline at end of file diff --git a/testcases/function_test/pkg_test/greatsql/greatsql-server/test_greatsql-server_perror_verbose.sh b/testcases/function_test/pkg_test/greatsql/greatsql-server/test_greatsql-server_perror_verbose.sh deleted file mode 100644 index 052974bf7eb..00000000000 --- a/testcases/function_test/pkg_test/greatsql/greatsql-server/test_greatsql-server_perror_verbose.sh +++ /dev/null @@ -1,72 +0,0 @@ -#!/usr/bin/bash - -# Copyright (c) 2024 ISCAS .ALL rights reserved. -# This program is licensed under Mulan PSL v2. -# You can use it according to the terms and conditions of the Mulan PSL v2. -# http://license.coscl.org.cn/MulanPSL2 -# THIS PROGRAM IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, -# EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, -# MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. -# See the Mulan PSL v2 for more details. - -# ############################################# -# @Author : honghua -# @Contact : honghua@iscas.ac.cn -# @Date : 2025-12-12 -# @License : Mulan PSL v2 -# @Desc : 测试 perror 命令的 verbose 参数打印错误代码和信息 -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - LOG_INFO "开始测试 perror 命令的 verbose 参数打印错误代码和信息" - - # 检查是否已安装 greatsql-server - LOG_INFO "检查是否已安装 greatsql-server" - if dnf list installed greatsql-server &>/dev/null; then - LOG_INFO "greatsql-server 已安装" - INSTALLED=true - else - LOG_INFO "greatsql-server 未安装" - INSTALLED=false - fi - - # 检查 yum 源中是否有 greatsql-server 软件包 - LOG_INFO "检查 yum 源中是否有 greatsql-server 软件包" - if ! dnf list available greatsql-server &>/dev/null; then - LOG_ERROR "yum 源中未找到 greatsql-server 软件包" - exit 255 - fi - - # 如果未安装,则安装 greatsql-server - if [ "$INSTALLED" = false ]; then - LOG_INFO "开始安装 greatsql-server" - dnf install -y greatsql-server - CHECK_RESULT $? 0 0 "安装 greatsql-server 失败" - fi - - # 测试 perror --verbose 命令 - LOG_INFO "测试 perror --verbose 命令" - perror --verbose 0 &>/dev/null - CHECK_RESULT $? 0 0 "perror --verbose 命令执行失败" - - # 测试 perror --verbose 命令参数不存在的情况 - LOG_INFO "测试 perror --verbose 命令参数不存在的情况" - perror --invalid-param &>/dev/null - if [ $? -ne 255 ]; then - LOG_ERROR "perror 命令不支持无效参数时应退出码为 255" - exit 255 - fi - - #恢复环境 - if [ "$INSTALLED" = false ]; then - LOG_INFO "卸载 greatsql-server" - dnf remove -y greatsql-server - CHECK_RESULT $? 0 0 "卸载 greatsql-server失败" - fi - - LOG_INFO "测试完成" -} - -main "$@" \ No newline at end of file diff --git a/testcases/function_test/pkg_test/greatsql/greatsql-server/test_greatsql-server_ps_mysqld_helper__upper_v.sh b/testcases/function_test/pkg_test/greatsql/greatsql-server/test_greatsql-server_ps_mysqld_helper__upper_v.sh deleted file mode 100644 index 4a476e55f76..00000000000 --- a/testcases/function_test/pkg_test/greatsql/greatsql-server/test_greatsql-server_ps_mysqld_helper__upper_v.sh +++ /dev/null @@ -1,64 +0,0 @@ -#!/usr/bin/bash - -# Copyright (c) 2024 ISCAS .ALL rights reserved. -# This program is licensed under Mulan PSL v2. -# You can use it according to the terms and conditions of the Mulan PSL v2. -# http://license.coscl.org.cn/MulanPSL2 -# THIS PROGRAM IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, -# EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, -# MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. -# See the Mulan PSL v2 for more details. - -# ############################################# -# @Author : honghua -# @Contact : honghua@iscas.ac.cn -# @Date : 2025-12-12 -# @License : Mulan PSL v2 -# @Desc : 测试 ps_mysqld_helper 命令的 -V 参数 -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - LOG_INFO "开始测试 ps_mysqld_helper 命令的 -V 参数" - - # 检查是否已安装软件包 - LOG_INFO "检查是否已安装 greatsql-server-ps_mysqld_helper 软件包" - if rpm -q greatsql-server-ps_mysqld_helper &>/dev/null; then - LOG_INFO "软件包已安装,脚本结束后将保持安装状态" - INSTALLED=true - else - LOG_INFO "软件包未安装,脚本结束后将卸载软件包" - INSTALLED=false - fi - - # 检查 yum 源中是否存在软件包 - LOG_INFO "检查 yum 源中是否存在 greatsql-server-ps_mysqld_helper 软件包" - if ! dnf list available greatsql-server-ps_mysqld_helper &>/dev/null; then - LOG_ERROR "yum 源中未找到 greatsql-server-ps_mysqld_helper 软件包" - exit 255 - fi - - # 安装软件包(如果未安装) - if [ "$INSTALLED" = false ]; then - LOG_INFO "安装 greatsql-server-ps_mysqld_helper 软件包" - dnf install -y greatsql-server-ps_mysqld_helper - CHECK_RESULT $? 0 0 "安装 greatsql-server-ps_mysqld_helper 软件包失败" - fi - - # 测试 ps_mysqld_helper 命令的 -V 参数 - LOG_INFO "测试 ps_mysqld_helper 命令的 -V 参数" - ps_mysqld_helper -V - CHECK_RESULT $? 0 0 "ps_mysqld_helper 命令的 -V 参数测试失败" - - # 清理环境(如果脚本安装的软件包) - if [ "$INSTALLED" = false ]; then - LOG_INFO "卸载 greatsql-server-ps_mysqld_helper 软件包" - dnf remove -y greatsql-server-ps_mysqld_helper - CHECK_RESULT $? 0 0 "卸载 greatsql-server-ps_mysqld_helper 软件包失败" - fi - - LOG_INFO "测试完成" -} - -main "$@" \ No newline at end of file diff --git a/testcases/function_test/pkg_test/greatsql/greatsql-server/test_greatsql-server_zlib_decompress_input_output.sh b/testcases/function_test/pkg_test/greatsql/greatsql-server/test_greatsql-server_zlib_decompress_input_output.sh deleted file mode 100644 index 21fb3b4e25f..00000000000 --- a/testcases/function_test/pkg_test/greatsql/greatsql-server/test_greatsql-server_zlib_decompress_input_output.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 : 2025-12-12 -# @License : Mulan PSL v2 -# @Desc : 测试zlib_decompress命令的基本功能,解压缩输入文件并输出到指定文件 -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - - # 检查是否已安装GreatSQL-server软件包 - LOG_INFO "检查GreatSQL-server软件包是否已安装" - rpm -q greatsql-server > /dev/null 2>&1 - if [ $? -eq 0 ]; then - LOG_INFO "GreatSQL-server软件包已安装,脚本结束后将保持安装状态" - installed=true - else - LOG_INFO "GreatSQL-server软件包未安装,将在测试结束后卸载" - installed=false - fi - - # 检查yum源中是否存在GreatSQL-server软件包 - LOG_INFO "检查yum源中是否存在GreatSQL-server软件包" - dnf list available greatsql-server > /dev/null 2>&1 - if [ $? -ne 0 ]; then - LOG_ERROR "yum源中未找到GreatSQL-server软件包,退出码255" - exit 255 - fi - - # 若未安装则安装GreatSQL-server软件包 - if [ "$installed" = false ]; then - LOG_INFO "安装GreatSQL-server软件包" - dnf install -y greatsql-server - CHECK_RESULT $? 0 0 "安装GreatSQL-server软件包失败" - fi - - # 创建测试用的压缩文件 - LOG_INFO "创建测试用的压缩文件test_input.gz" - echo "This is a test file for zlib_decompress" > test_input - gzip test_input - - # 执行zlib_decompress命令解压文件 - LOG_INFO "执行zlib_decompress命令解压文件test_input.gz到test_output" - zlib_decompress test_input.gz test_output - CHECK_RESULT $? 0 0 "zlib_decompress命令执行失败" - - # 检查解压后的文件内容是否符合预期 - LOG_INFO "检查解压后的文件内容是否符合预期" - expected_content="This is a test file for zlib_decompress" - actual_content=$(cat test_output) - if [ "$actual_content" = "$expected_content" ]; then - LOG_INFO "解压后的文件内容符合预期" - else - LOG_ERROR "解压后的文件内容不符合预期,退出码1" - exit 1 - fi - - # 清理测试生成的文件 - LOG_INFO "清理测试生成的文件" - rm -f test_input.gz test_output test_input - - # 若脚本开始时未安装GreatSQL-server则卸载 - if [ "$installed" = false ]; then - LOG_INFO "卸载GreatSQL-server软件包" - dnf remove -y greatsql-server - CHECK_RESULT $? 0 0 "卸载GreatSQL-server软件包失败" - fi - - LOG_INFO "测试脚本执行完毕,环境已恢复" - -} - -main "$@" \ No newline at end of file diff --git a/testcases/function_test/pkg_test/greatsql/greatsql-server/test_greatsql-server_zstd_decompress_input_output.sh b/testcases/function_test/pkg_test/greatsql/greatsql-server/test_greatsql-server_zstd_decompress_input_output.sh deleted file mode 100644 index 68b75c14bf4..00000000000 --- a/testcases/function_test/pkg_test/greatsql/greatsql-server/test_greatsql-server_zstd_decompress_input_output.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 : 2025-12-12 -# @License : Mulan PSL v2 -# @Desc : 测试 zstd_decompress 命令的基本功能,解压输入文件到输出文件 -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - LOG_INFO "开始测试 zstd_decompress 命令的基本功能,解压输入文件到输出文件" - - # 检查是否已安装软件包 - LOG_INFO "检查是否已安装 greatsql-server-zstd 软件包" - if dnf list installed greatsql-server-zstd &>/dev/null; then - LOG_INFO "greatsql-server-zstd 已安装" - installed=true - else - LOG_INFO "greatsql-server-zstd 未安装" - installed=false - fi - - # 检查 yum 源中是否存在软件包 - LOG_INFO "检查 yum 源中是否存在 greatsql-server-zstd 软件包" - if ! dnf list available greatsql-server-zstd &>/dev/null; then - LOG_ERROR "yum 源中未找到 greatsql-server-zstd 软件包" - exit 255 - fi - - # 如果未安装,则安装软件包 - if [ "$installed" = false ]; then - LOG_INFO "开始安装 greatsql-server-zstd" - dnf install -y greatsql-server-zstd - CHECK_RESULT $? 0 0 "安装 greatsql-server-zstd 失败" - fi - - # 准备测试文件 - LOG_INFO "准备测试文件" - echo "test data" > input.txt - zstd input.txt -o input.zst - CHECK_RESULT $? 0 0 "压缩输入文件失败" - - # 测试 zstd_decompress 命令 - LOG_INFO "测试 zstd_decompress 命令解压输入文件到输出文件" - zstd_decompress input.zst output.txt - CHECK_RESULT $? 0 0 "解压文件失败" - - # 验证解压结果 - LOG_INFO "验证解压结果" - cmp input.txt output.txt - CHECK_RESULT $? 0 0 "解压后的文件内容与原始文件不一致" - - # 清理测试文件 - LOG_INFO "清理测试文件" - rm -f input.txt input.zst output.txt - - # 如果脚本开始时未安装,则卸载软件包 - if [ "$installed" = false ]; then - LOG_INFO "卸载 greatsql-server-zstd" - dnf remove -y greatsql-server-zstd - CHECK_RESULT $? 0 0 "卸载 greatsql-server-zstd 失败" - fi - - LOG_INFO “测试完成” -} - -main "$@" \ No newline at end of file From 3e719f7361853a16c3fb1518bf5a185938192b2d Mon Sep 17 00:00:00 2001 From: honghua Date: Thu, 16 Apr 2026 23:10:26 +0800 Subject: [PATCH 07/13] update testcase for testsuite apache-commons-jci-groovy --- .../apache-commons-jci-groovy.json | 4 -- ...apache-commons-jci-groovy_function_load.sh | 70 ------------------- 2 files changed, 74 deletions(-) delete mode 100644 testcases/function_test/pkg_test/apache-commons-jci/apache-commons-jci-groovy/test_apache-commons-jci-groovy_function_load.sh diff --git a/suite2cases/function_test/pkg_test/apache-commons-jci/apache-commons-jci-groovy.json b/suite2cases/function_test/pkg_test/apache-commons-jci/apache-commons-jci-groovy.json index 9866ad7fd56..5d669e811fd 100644 --- a/suite2cases/function_test/pkg_test/apache-commons-jci/apache-commons-jci-groovy.json +++ b/suite2cases/function_test/pkg_test/apache-commons-jci/apache-commons-jci-groovy.json @@ -6,10 +6,6 @@ "name": "test_apache-commons-jci-groovy_install", "desc": "测试软件包 apache-commons-jci-groovy 的安装功能,验证是否能够正确安装到系统中。", "machine num": 1 - }, - { - "name": "test_apache-commons-jci-groovy_function_load", - "desc": "测试软件包 apache-commons-jci-groovy 的加载功能,验证是否能够正确加载 Groovy 脚本。" } ] } \ No newline at end of file diff --git a/testcases/function_test/pkg_test/apache-commons-jci/apache-commons-jci-groovy/test_apache-commons-jci-groovy_function_load.sh b/testcases/function_test/pkg_test/apache-commons-jci/apache-commons-jci-groovy/test_apache-commons-jci-groovy_function_load.sh deleted file mode 100644 index b7b398aca47..00000000000 --- a/testcases/function_test/pkg_test/apache-commons-jci/apache-commons-jci-groovy/test_apache-commons-jci-groovy_function_load.sh +++ /dev/null @@ -1,70 +0,0 @@ -#!/usr/bin/bash - -# Copyright (c) 2024 ISCAS .ALL rights reserved. -# This program is licensed under Mulan PSL v2. -# You can use it according to the terms and conditions of the Mulan PSL v2. -# http://license.coscl.org.cn/MulanPSL2 -# THIS PROGRAM IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, -# EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, -# MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. -# See the Mulan PSL v2 for more details. - -# ############################################# -# @Author : honghua -# @Contact : honghua@iscas.ac.cn -# @Date : 2025-12-05 -# @License : Mulan PSL v2 -# @Desc : 测试软件包 apache-commons-jci-groovy 的加载功能,验证是否能够正确加载 Groovy 脚本。 -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - LOG_INFO "开始测试软件包 apache-commons-jci-groovy 的加载功能,验证是否能够正确加载 Groovy 脚本。" - - LOG_INFO "步骤1:检查 yum 源中是否存在 apache-commons-jci-groovy 软件包" - dnf list available apache-commons-jci-groovy > /dev/null 2>&1 - if [ $? -ne 0 ]; then - LOG_ERROR "yum 源中未找到 apache-commons-jci-groovy 软件包" - exit 255 - fi - - LOG_INFO "步骤2:检查当前环境中是否已安装 apache-commons-jci-groovy" - rpm -q apache-commons-jci-groovy > /dev/null 2>&1 - if [ $? -eq 0 ]; then - LOG_INFO "环境已安装 apache-commons-jci-groovy,脚本结束后将保持安装状态" - INSTALLED=true - else - LOG_INFO "环境未安装 apache-commons-jci-groovy,将在测试后卸载" - INSTALLED=false - fi - - if [ "$INSTALLED" = false ]; then - LOG_INFO "步骤3:安装 apache-commons-jci-groovy 软件包" - dnf install -y apache-commons-jci-groovy - CHECK_RESULT $? 0 0 "安装 apache-commons-jci-groovy 失败" - fi - - LOG_INFO "步骤4:验证 Groovy 脚本加载功能" - groovy_script="test.groovy" - cat > "$groovy_script" << "EOF" - println "Hello, Groovy!" - EOF - - LOG_INFO "执行 Groovy 脚本" - groovy "$groovy_script" - CHECK_RESULT $? 0 0 "Groovy 脚本加载失败" - - LOG_INFO "步骤5:清理临时文件" - rm -f "$groovy_script" - - if [ "$INSTALLED" = false ]; then - LOG_INFO "步骤6:卸载 apache-commons-jci-groovy 软件包" - dnf remove -y apache-commons-jci-groovy - CHECK_RESULT $? 0 0 "卸载 apache-commons-jci-groovy 失败" - fi - - LOG_INFO "测试完成,环境已恢复" -} - -main "$@" \ No newline at end of file From 475a9926ceeccb697961f66dfbc04450b40953eb Mon Sep 17 00:00:00 2001 From: honghua Date: Thu, 16 Apr 2026 23:11:07 +0800 Subject: [PATCH 08/13] update testcase for testsuite ocaml-fileutils-devel --- .../ocaml-fileutils-devel.json | 12 --- ..._ocaml-fileutils-devel_function_dirlist.sh | 85 ------------------ ...ocaml-fileutils-devel_function_pathhand.sh | 69 -------------- ...st_ocaml-fileutils-devel_function_perms.sh | 90 ------------------- 4 files changed, 256 deletions(-) delete mode 100644 testcases/function_test/pkg_test/ocaml-fileutils/ocaml-fileutils-devel/test_ocaml-fileutils-devel_function_dirlist.sh delete mode 100644 testcases/function_test/pkg_test/ocaml-fileutils/ocaml-fileutils-devel/test_ocaml-fileutils-devel_function_pathhand.sh delete mode 100644 testcases/function_test/pkg_test/ocaml-fileutils/ocaml-fileutils-devel/test_ocaml-fileutils-devel_function_perms.sh diff --git a/suite2cases/function_test/pkg_test/ocaml-fileutils/ocaml-fileutils-devel.json b/suite2cases/function_test/pkg_test/ocaml-fileutils/ocaml-fileutils-devel.json index db25e4a5f06..391a968a5be 100644 --- a/suite2cases/function_test/pkg_test/ocaml-fileutils/ocaml-fileutils-devel.json +++ b/suite2cases/function_test/pkg_test/ocaml-fileutils/ocaml-fileutils-devel.json @@ -6,18 +6,6 @@ "name": "test_ocaml-fileutils-devel_function_fileops", "desc": "Test basic file operations" }, - { - "name": "test_ocaml-fileutils-devel_function_dirlist", - "desc": "Test directory listing" - }, - { - "name": "test_ocaml-fileutils-devel_function_perms", - "desc": "Test file permissions" - }, - { - "name": "test_ocaml-fileutils-devel_function_pathhand", - "desc": "Test path handling" - }, { "name": "test_ocaml-fileutils-devel_function_filecopy", "desc": "Test file copying" diff --git a/testcases/function_test/pkg_test/ocaml-fileutils/ocaml-fileutils-devel/test_ocaml-fileutils-devel_function_dirlist.sh b/testcases/function_test/pkg_test/ocaml-fileutils/ocaml-fileutils-devel/test_ocaml-fileutils-devel_function_dirlist.sh deleted file mode 100644 index 4019c2c2fa1..00000000000 --- a/testcases/function_test/pkg_test/ocaml-fileutils/ocaml-fileutils-devel/test_ocaml-fileutils-devel_function_dirlist.sh +++ /dev/null @@ -1,85 +0,0 @@ -#!/usr/bin/bash - -# Copyright (c) 2024 ISCAS .ALL rights reserved. -# This program is licensed under Mulan PSL v2. -# You can use it according to the terms and conditions of the Mulan PSL v2. -# http://license.coscl.org.cn/MulanPSL2 -# THIS PROGRAM IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, -# EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, -# MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. -# See the Mulan PSL v2 for more details. - -# ############################################# -# @Author : honghua -# @Contact : honghua@iscas.ac.cn -# @Date : 2025-11-30 -# @License : Mulan PSL v2 -# @Desc : Test directory listing -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - - # 检查软件包是否已安装 - if rpm -q ocaml-fileutils-devel >/dev/null 2>&1; then - LOG_INFO "环境已安装ocaml-fileutils-devel软件包,脚本结束后将保持安装状态" - INSTALLED=true - else - LOG_INFO "环境未安装ocaml-fileutils-devel软件包,脚本结束后将卸载软件包" - INSTALLED=false - fi - - # 检查yum源中是否存在该软件包 - LOG_INFO "检查yum源中是否存在ocaml-fileutils-devel软件包" - if ! dnf list available ocaml-fileutils-devel >/dev/null 2>&1; then - LOG_ERROR "yum源中未找到ocaml-fileutils-devel软件包" - exit 255 - fi - - # 安装软件包(如果未安装) - if [ "$INSTALLED" = false ]; then - LOG_INFO "开始安装ocaml-fileutils-devel软件包" - dnf install -y ocaml-fileutils-devel - CHECK_RESULT $? 0 0 "安装ocaml-fileutils-devel软件包失败" - fi - - # 测试目录列表功能 - LOG_INFO "测试目录列表功能" - TEST_DIR="/tmp/test_dir" - mkdir -p "$TEST_DIR" - CHECK_RESULT $? 0 0 "创建测试目录失败" - - touch "$TEST_DIR/file1" "$TEST_DIR/file2" - CHECK_RESULT $? 0 0 "创建测试文件失败" - - # 执行目录列表命令并验证结果 - LOG_INFO "执行目录列表命令并验证结果" - ls_output=$(ls "$TEST_DIR") - CHECK_RESULT $? 0 0 "执行目录列表命令失败" - - expected_output="file1 file2" - if [ "$ls_output" != "$expected_output" ]; then - LOG_ERROR "目录列表输出不符合预期" - exit 1 - else - LOG_INFO "目录列表输出符合预期:$ls_output" - fi - - # 清理测试目录 - LOG_INFO "清理测试目录" - rm -rf "$TEST_DIR" - CHECK_RESULT $? 0 0 "清理测试目录失败" - - # 卸载软件包(如果脚本开始时未安装) - if [ "$INSTALLED" = false ]; then - LOG_INFO "卸载ocaml-fileutils-devel软件包" - dnf remove -y ocaml-fileutils-devel >/dev/null 2>&1 - CHECK_RESULT $? 0 0 "卸载ocaml-fileutils-devel软件包失败" - fi - - LOG_INFO "测试脚本执行完毕,环境已恢复" - -} - -main "$@" \ No newline at end of file diff --git a/testcases/function_test/pkg_test/ocaml-fileutils/ocaml-fileutils-devel/test_ocaml-fileutils-devel_function_pathhand.sh b/testcases/function_test/pkg_test/ocaml-fileutils/ocaml-fileutils-devel/test_ocaml-fileutils-devel_function_pathhand.sh deleted file mode 100644 index bbbdd317697..00000000000 --- a/testcases/function_test/pkg_test/ocaml-fileutils/ocaml-fileutils-devel/test_ocaml-fileutils-devel_function_pathhand.sh +++ /dev/null @@ -1,69 +0,0 @@ -#!/usr/bin/bash - -# Copyright (c) 2024 ISCAS .ALL rights reserved. -# This program is licensed under Mulan PSL v2. -# You can use it according to the terms and conditions of the Mulan PSL v2. -# http://license.coscl.org.cn/MulanPSL2 -# THIS PROGRAM IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, -# EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, -# MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. -# See the Mulan PSL v2 for more details. - -# ############################################# -# @Author : honghua -# @Contact : honghua@iscas.ac.cn -# @Date : 2025-11-30 -# @License : Mulan PSL v2 -# @Desc : Test path handling -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - - # 检查软件包是否已安装 - if rpm -q ocaml-fileutils-devel >/dev/null 2>&1; then - LOG_INFO "环境已安装 ocaml-fileutils-devel 软件包,脚本结束后将保持安装状态" - INSTALLED=true - else - LOG_INFO "环境未安装 ocaml-fileutils-devel 软件包,脚本结束后将卸载该软件包" - INSTALLED=false - fi - - # 检查 yum 源中是否存在 ocaml-fileutils-devel 软件包 - LOG_INFO "检查 yum 源中是否存在 ocaml-fileutils-devel 软件包" - if ! dnf list available ocaml-fileutils-devel >/dev/null 2>&1; then - LOG_ERROR "yum 源中未找到 ocaml-fileutils-devel 软件包" - exit 255 - fi - - # 安装 ocaml-fileutils-devel 软件包 - if [ "$INSTALLED" = false ]; then - LOG_INFO "安装 ocaml-fileutils-devel 软件包" - dnf install -y ocaml-fileutils-devel - CHECK_RESULT $? 0 0 "安装 ocaml-fileutils-devel 软件包失败" - fi - - # 测试 path handling 功能 - LOG_INFO "测试 path handling 功能" - TEST_COMMAND="ocaml-fileutils-pathhand --test" - if ! command -v ocaml-fileutils-pathhand >/dev/null 2>&1; then - LOG_ERROR "命令 ocaml-fileutils-pathhand 不存在或不支持" - exit 255 - fi - - $TEST_COMMAND - CHECK_RESULT $? 0 0 "测试 path handling 功能失败" - - # 清理环境 - if [ "$INSTALLED" = false ]; then - LOG_INFO "卸载 ocaml-fileutils-devel 软件包" - dnf remove -y ocaml-fileutils-devel - CHECK_RESULT $? 0 0 "卸载 ocaml-fileutils-devel 软件包失败" - fi - - LOG_INFO "测试脚本执行完毕" - -} - -main "$@" \ No newline at end of file diff --git a/testcases/function_test/pkg_test/ocaml-fileutils/ocaml-fileutils-devel/test_ocaml-fileutils-devel_function_perms.sh b/testcases/function_test/pkg_test/ocaml-fileutils/ocaml-fileutils-devel/test_ocaml-fileutils-devel_function_perms.sh deleted file mode 100644 index e259372ad1f..00000000000 --- a/testcases/function_test/pkg_test/ocaml-fileutils/ocaml-fileutils-devel/test_ocaml-fileutils-devel_function_perms.sh +++ /dev/null @@ -1,90 +0,0 @@ -#!/usr/bin/bash - -# Copyright (c) 2024 ISCAS .ALL rights reserved. -# This program is licensed under Mulan PSL v2. -# You can use it according to the terms and conditions of the Mulan PSL v2. -# http://license.coscl.org.cn/MulanPSL2 -# THIS PROGRAM IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, -# EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, -# MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. -# See the Mulan PSL v2 for more details. - -# ############################################# -# @Author : honghua -# @Contact : honghua@iscas.ac.cn -# @Date : 2025-11-30 -# @License : Mulan PSL v2 -# @Desc : Test file permissions -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - # 测试脚本:test_ocaml-fileutils-devel_function_perms - # 测试用例描述:Test file permissions - - # 检查软件包是否存在于yum源中 - check_package_in_repo() { - dnf list available | grep -q "$1" - if [ $? -ne 0 ]; then - LOG_ERROR "软件包 $1 不存在于yum源中" - exit 255 - fi - } - - # 检查命令参数是否有效 - check_command_args() { - if [ -z "$1" ]; then - LOG_ERROR "命令参数不存在或不支持" - exit 255 - fi - } - - # 检查环境是否已安装软件包 - check_installed() { - rpm -q "$1" > /dev/null 2>&1 - return $? - } - - LOG_INFO "开始测试:Test file permissions" - - # 步骤1:检查软件包是否存在于yum源中 - LOG_INFO "步骤1:检查软件包 ocaml-fileutils-devel 是否存在于yum源中" - check_package_in_repo "ocaml-fileutils-devel" - - # 步骤2:检查环境是否已安装软件包 - LOG_INFO "步骤2:检查环境是否已安装软件包 ocaml-fileutils-devel" - if check_installed "ocaml-fileutils-devel"; then - LOG_INFO "软件包 ocaml-fileutils-devel 已安装,脚本结束时保持安装状态" - installed=true - else - LOG_INFO "软件包 ocaml-fileutils-devel 未安装,将在脚本结束前卸载" - installed=false - fi - - # 步骤3:安装软件包(如果未安装) - if [ "$installed" = false ]; then - LOG_INFO "步骤3:安装软件包 ocaml-fileutils-devel" - dnf install -y ocaml-fileutils-devel > /dev/null 2>&1 - CHECK_RESULT $? 0 0 "安装软件包 ocaml-fileutils-devel 失败" - fi - - # 步骤4:测试文件权限功能(示例命令) - LOG_INFO "步骤4:测试文件权限功能" - - # (假设有一个命令可以测试文件权限,这里用示例) - test_command="ls -l /usr/lib/ocaml/fileutils" - $test_command > /dev/null 2>&1 - CHECK_RESULT $? 0 0 "测试文件权限功能失败" - - # 步骤5:清理环境(如果之前未安装) - if [ "$installed" = false ]; then - LOG_INFO "步骤5:卸载软件包 ocaml-fileutils-devel" - dnf remove -y ocaml-fileutils-devel > /dev/null 2>&1 - CHECK_RESULT $? 0 0 "卸载软件包 ocaml-fileutils-devel 失败" - fi - - LOG_INFO "测试完成:Test file permissions" -} - -main "$@" \ No newline at end of file From 087a10ecac87d6cf584537e74ba159789bb8a7ba Mon Sep 17 00:00:00 2001 From: honghua Date: Thu, 16 Apr 2026 23:11:46 +0800 Subject: [PATCH 09/13] update testcase for testsuite texlive-fullwidth --- .../texlive-split-i/texlive-fullwidth.json | 10 --- ...test_texlive-fullwidth_function_install.sh | 64 ------------------- 2 files changed, 74 deletions(-) delete mode 100644 suite2cases/function_test/pkg_test/texlive-split-i/texlive-fullwidth.json delete mode 100644 testcases/function_test/pkg_test/texlive-split-i/texlive-fullwidth/test_texlive-fullwidth_function_install.sh diff --git a/suite2cases/function_test/pkg_test/texlive-split-i/texlive-fullwidth.json b/suite2cases/function_test/pkg_test/texlive-split-i/texlive-fullwidth.json deleted file mode 100644 index 53477cfff87..00000000000 --- a/suite2cases/function_test/pkg_test/texlive-split-i/texlive-fullwidth.json +++ /dev/null @@ -1,10 +0,0 @@ -{ - "path": "$OET_PATH/testcases/function_test/pkg_test/texlive-split-i/texlive-fullwidth", - "machine num": 1, - "cases": [ - { - "name": "test_texlive-fullwidth_function_install", - "desc": "Test installation of texlive-fullwidth package" - } - ] -} \ No newline at end of file diff --git a/testcases/function_test/pkg_test/texlive-split-i/texlive-fullwidth/test_texlive-fullwidth_function_install.sh b/testcases/function_test/pkg_test/texlive-split-i/texlive-fullwidth/test_texlive-fullwidth_function_install.sh deleted file mode 100644 index ad0c7c57fb3..00000000000 --- a/testcases/function_test/pkg_test/texlive-split-i/texlive-fullwidth/test_texlive-fullwidth_function_install.sh +++ /dev/null @@ -1,64 +0,0 @@ -#!/usr/bin/bash - -# Copyright (c) 2024 ISCAS .ALL rights reserved. -# This program is licensed under Mulan PSL v2. -# You can use it according to the terms and conditions of the Mulan PSL v2. -# http://license.coscl.org.cn/MulanPSL2 -# THIS PROGRAM IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, -# EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, -# MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. -# See the Mulan PSL v2 for more details. - -# ############################################# -# @Author : honghua -# @Contact : honghua@iscas.ac.cn -# @Date : 2025-09-30 -# @License : Mulan PSL v2 -# @Desc : Test installation of texlive-fullwidth package -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - # 检查texlive-fullwidth软件包是否已安装 - LOG_INFO "检查texlive-fullwidth软件包是否已安装" - rpm -q texlive-fullwidth > /dev/null 2>&1 - if [ $? -eq 0 ]; then - LOG_INFO "texlive-fullwidth软件包已安装,脚本结束后保持安装状态" - INSTALLED=1 - else - LOG_INFO "texlive-fullwidth软件包未安装,将在脚本结束后卸载" - INSTALLED=0 - fi - - # 检查yum源中是否有texlive-fullwidth软件包 - LOG_INFO "检查yum源中是否有texlive-fullwidth软件包" - dnf list available texlive-fullwidth > /dev/null 2>&1 - CHECK_RESULT $? 0 255 "yum源中不存在texlive-fullwidth软件包" - - # 安装texlive-fullwidth软件包 - LOG_INFO "安装texlive-fullwidth软件包" - dnf install -y texlive-fullwidth - CHECK_RESULT $? 0 0 "安装texlive-fullwidth软件包失败" - - # 验证texlive-fullwidth软件包是否安装成功 - LOG_INFO "验证texlive-fullwidth软件包是否安装成功" - rpm -q texlive-fullwidth > /dev/null 2>&1 - CHECK_RESULT $? 0 0 "texlive-fullwidth软件包未正确安装" - - # 如果脚本开始时未安装,则在结束时卸载 - if [ $INSTALLED -eq 0 ]; then - LOG_INFO "卸载texlive-fullwidth软件包" - dnf remove -y texlive-fullwidth - CHECK_RESULT $? 0 0 "卸载texlive-fullwidth软件包失败" - - # 验证texlive-fullwidth软件包是否已卸载 - LOG_INFO "验证texlive-fullwidth软件包是否已卸载" - rpm -q texlive-full-width > /dev/null 2>&1 - CHECK_RESULT $? 1 0 "texlive-fullwidth软件包未正确卸载" - fi - - LOG_INFO "测试完成,环境已恢复" -} - -main "$@" \ No newline at end of file From 7f3ee63dde686a34d6e96217ddfd8016f20716be Mon Sep 17 00:00:00 2001 From: honghua Date: Thu, 16 Apr 2026 23:11:55 +0800 Subject: [PATCH 10/13] update testcase for testsuite kbd-legacy --- .../pkg_test/kbd/kbd-legacy.json | 20 ----- ...est_kbd-legacy_function_install_package.sh | 80 ----------------- .../test_kbd-legacy_function_list_keymaps.sh | 72 --------------- .../test_kbd-legacy_function_set_keymap.sh | 79 ---------------- ...t_kbd-legacy_function_uninstall_package.sh | 90 ------------------- ...st_kbd-legacy_function_verify_installed.sh | 80 ----------------- 6 files changed, 421 deletions(-) delete mode 100644 testcases/function_test/pkg_test/kbd/kbd-legacy/test_kbd-legacy_function_install_package.sh delete mode 100644 testcases/function_test/pkg_test/kbd/kbd-legacy/test_kbd-legacy_function_list_keymaps.sh delete mode 100644 testcases/function_test/pkg_test/kbd/kbd-legacy/test_kbd-legacy_function_set_keymap.sh delete mode 100644 testcases/function_test/pkg_test/kbd/kbd-legacy/test_kbd-legacy_function_uninstall_package.sh delete mode 100644 testcases/function_test/pkg_test/kbd/kbd-legacy/test_kbd-legacy_function_verify_installed.sh diff --git a/suite2cases/function_test/pkg_test/kbd/kbd-legacy.json b/suite2cases/function_test/pkg_test/kbd/kbd-legacy.json index 947b11e8a07..0877d2a77f9 100644 --- a/suite2cases/function_test/pkg_test/kbd/kbd-legacy.json +++ b/suite2cases/function_test/pkg_test/kbd/kbd-legacy.json @@ -5,26 +5,6 @@ { "name": "test_kbd-legacy_function_load_keymap", "desc": "测试使用loadkeys命令加载一个由kbd-legacy提供的基本键盘映射表(如us)" - }, - { - "name": "test_kbd-legacy_function_install_package", - "desc": "测试通过包管理器(如yum/dnf/apt)成功安装kbd-legacy软件包" - }, - { - "name": "test_kbd-legacy_function_verify_installed", - "desc": "测试检查kbd-legacy软件包是否已正确安装" - }, - { - "name": "test_kbd-legacy_function_uninstall_package", - "desc": "测试通过包管理器(如yum/dnf/apt)成功卸载kbd-legacy软件包" - }, - { - "name": "test_kbd-legacy_function_list_keymaps", - "desc": "测试使用localectl list-keymaps命令列出可用键盘映射" - }, - { - "name": "test_kbd-legacy_function_set_keymap", - "desc": "测试使用localectl set-keymap命令设置系统键盘映射" } ] } \ No newline at end of file diff --git a/testcases/function_test/pkg_test/kbd/kbd-legacy/test_kbd-legacy_function_install_package.sh b/testcases/function_test/pkg_test/kbd/kbd-legacy/test_kbd-legacy_function_install_package.sh deleted file mode 100644 index 9aa1e11953f..00000000000 --- a/testcases/function_test/pkg_test/kbd/kbd-legacy/test_kbd-legacy_function_install_package.sh +++ /dev/null @@ -1,80 +0,0 @@ -#!/usr/bin/bash - -# Copyright (c) 2024 ISCAS .ALL rights reserved. -# This program is licensed under Mulan PSL v2. -# You can use it according to the terms and conditions of the Mulan PSL v2. -# http://license.coscl.org.cn/MulanPSL2 -# THIS PROGRAM IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, -# EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, -# MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. -# See the Mulan PSL v2 for more details. - -# ############################################# -# @Author : honghua -# @Contact : honghua@iscas.ac.cn -# @Date : 2026-03-27 -# @License : Mulan PSL v2 -# @Desc : 测试通过包管理器(如yum/dnf/apt)成功安装kbd-legacy软件包 -# ############################################ - -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 $*" - } - - # 定义包名和命令 - PACKAGE_NAME="kbd-legacy" - INSTALL_CMD="dnf install -y" - REMOVE_CMD="dnf remove -y" - CHECK_CMD="dnf list available" - - # 检查yum源中是否存在软件包 - LOG_INFO "检查yum源中是否存在软件包: $PACKAGE_NAME" - if ! $CHECK_CMD $PACKAGE_NAME &>/dev/null; then - LOG_ERROR "yum源中不存在软件包: $PACKAGE_NAME" - exit 255 - fi - - # 检查是否已经安装 - LOG_INFO "检查是否已经安装: $PACKAGE_NAME" - if rpm -q $PACKAGE_NAME &>/dev/null; then - LOG_INFO "软件包已经安装,无需再次安装" - INSTALLED=true - else - LOG_INFO "软件包未安装,开始安装" - INSTALLED=false - fi - - # 执行安装(如果未安装) - if [ "$INSTALLED" = false ]; then - LOG_INFO "执行安装命令: $INSTALL_CMD $PACKAGE_NAME" - $INSTALL_CMD $PACKAGE_NAME - CHECK_RESULT $? 0 0 "安装软件包失败" - LOG_INFO "软件包安装成功" - fi - - # 验证软件包是否安装成功 - LOG_INFO "验证软件包是否安装成功" - rpm -q $PACKAGE_NAME - CHECK_RESULT $? 0 0 "验证软件包安装失败" - - # 清理环境(如果之前未安装) - if [ "$INSTALLED" = false ]; then - LOG_INFO "清理环境,卸载软件包: $PACKAGE_NAME" - $REMOVE_CMD $PACKAGE_NAME - CHECK_RESULT $? 0 0 "卸载软件包失败" - LOG_INFO "软件包卸载成功" - else - LOG_INFO "保持软件包安装状态" - fi - - LOG_INFO "测试脚本执行完毕" -} - -main "$@" \ No newline at end of file diff --git a/testcases/function_test/pkg_test/kbd/kbd-legacy/test_kbd-legacy_function_list_keymaps.sh b/testcases/function_test/pkg_test/kbd/kbd-legacy/test_kbd-legacy_function_list_keymaps.sh deleted file mode 100644 index 71934c6971f..00000000000 --- a/testcases/function_test/pkg_test/kbd/kbd-legacy/test_kbd-legacy_function_list_keymaps.sh +++ /dev/null @@ -1,72 +0,0 @@ -#!/usr/bin/bash - -# Copyright (c) 2024 ISCAS .ALL rights reserved. -# This program is licensed under Mulan PSL v2. -# You can use it according to the terms and conditions of the Mulan PSL v2. -# http://license.coscl.org.cn/MulanPSL2 -# THIS PROGRAM IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, -# EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, -# MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. -# See the Mulan PSL v2 for more details. - -# ############################################# -# @Author : honghua -# @Contact : honghua@iscas.ac.cn -# @Date : 2026-03-27 -# @License : Mulan PSL v2 -# @Desc : 测试使用localectl list-keymaps命令列出可用键盘映射 -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - set -e - - LOG_INFO "1. 检查是否已安装kbd-legacy软件包" - if rpm -q kbd-legacy &>/dev/null; then - LOG_INFO "kbd-legacy已安装,标记为已安装状态" - INSTALLED=1 - else - LOG_INFO "kbd-legacy未安装,标记为未安装状态" - INSTALLED=0 - fi - - LOG_INFO "2. 检查yum源中是否有kbd-legacy软件包" - if ! dnf list available kbd-legacy &>/dev/null; then - LOG_ERROR "yum源中未找到kbd-legacy软件包" - exit 255 - fi - - if [ $INSTALLED -eq 0 ]; then - LOG_INFO "3. 安装kbd-legacy软件包" - dnf install -y kbd-legacy - CHECK_RESULT $? 0 0 "安装kbd-legacy失败" - fi - - LOG_INFO "4. 检查localectl命令是否存在" - if ! command -v localectl &>/dev/null; then - LOG_ERROR "localectl命令不存在" - exit 255 - fi - - LOG_INFO "5. 检查localectl是否支持list-keymaps参数" - if ! localectl --help | grep -q "list-keymaps"; then - LOG_ERROR "localectl不支持list-keymaps参数" - exit 255 - fi - - LOG_INFO "6. 执行localectl list-keymaps命令列出可用键盘映射" - localectl list-keymaps - CHECK_RESULT $? 0 0 "执行localectl list-keymaps命令失败" - - LOG_INFO "7. 清理环境" - if [ $INSTALLED -eq 0 ]; then - LOG_INFO "卸载kbd-legacy软件包" - dnf remove -y kbd-legacy - CHECK_RESULT $? 0 0 "卸载kbd-legacy失败" - else - LOG_INFO "保持kbd-legacy安装状态不变" - fi -} - -main "$@" \ No newline at end of file diff --git a/testcases/function_test/pkg_test/kbd/kbd-legacy/test_kbd-legacy_function_set_keymap.sh b/testcases/function_test/pkg_test/kbd/kbd-legacy/test_kbd-legacy_function_set_keymap.sh deleted file mode 100644 index 234d40a74c1..00000000000 --- a/testcases/function_test/pkg_test/kbd/kbd-legacy/test_kbd-legacy_function_set_keymap.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-27 -# @License : Mulan PSL v2 -# @Desc : 测试使用localectl set-keymap命令设置系统键盘映射 -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - # 判断环境是否已安装kbd-legacy软件包 - LOG_INFO "检查kbd-legacy软件包是否已安装" - rpm -q kbd-legacy - if [ $? -eq 0 ]; then - LOG_INFO "kbd-legacy软件包已安装,标记为已安装状态" - INSTALLED_FLAG=1 - else - LOG_INFO "kbd-legacy软件包未安装,标记为未安装状态" - INSTALLED_FLAG=0 - fi - - # 检查yum源中是否有kbd-legacy软件包 - LOG_INFO "检查yum源中是否有kbd-legacy软件包" - dnf list available kbd-legacy &> /dev/null - if [ $? -ne 0 ]; then - LOG_ERROR "yum源中未找到kbd-legacy软件包" - exit 255 - fi - - # 如果未安装,则安装kbd-legacy软件包 - if [ ${INSTALLED_FLAG} -eq 0 ]; then - LOG_INFO "安装kbd-legacy软件包" - dnf install -y kbd-legacy - CHECK_RESULT $? 0 0 "安装kbd-legacy软件包失败" - fi - - # 测试localectl set-keymap命令设置系统键盘映射 - LOG_INFO "测试localectl set-keymap命令设置系统键盘映射" - localectl set-keymap us - CHECK_RESULT $? 0 0 "设置键盘映射为us失败" - - # 验证键盘映射设置是否生效 - LOG_INFO "验证键盘映射设置是否生效" - localectl status | grep -q "Keymap: us" - CHECK_RESULT $? 0 0 "键盘映射设置未生效" - - # 测试设置不存在的键盘映射 - LOG_INFO "测试设置不存在的键盘映射" - localectl set-keymap nonexistent-keymap 2>&1 | grep -q "Failed to set keymap" - CHECK_RESULT $? 0 0 "设置不存在的键盘映射未按预期失败" - - # 恢复原始键盘映射(假设原始为us) - LOG_INFO "恢复原始键盘映射" - localectl set-keymap us - CHECK_RESULT $? 0 0 "恢复键盘映射失败" - - # 清理环境:如果脚本开始前未安装,则卸载kbd-legacy软件包 - if [ ${INSTALLED_FLAG} -eq 0 ]; then - LOG_INFO "卸载kbd-legacy软件包" - dnf remove -y kbd-legacy - CHECK_RESULT $? 0 0 "卸载kbd-legacy软件包失败" - fi - - LOG_INFO "测试完成,环境已恢复" -} - -main "$@" \ No newline at end of file diff --git a/testcases/function_test/pkg_test/kbd/kbd-legacy/test_kbd-legacy_function_uninstall_package.sh b/testcases/function_test/pkg_test/kbd/kbd-legacy/test_kbd-legacy_function_uninstall_package.sh deleted file mode 100644 index ba8cca2377f..00000000000 --- a/testcases/function_test/pkg_test/kbd/kbd-legacy/test_kbd-legacy_function_uninstall_package.sh +++ /dev/null @@ -1,90 +0,0 @@ -#!/usr/bin/bash - -# Copyright (c) 2024 ISCAS .ALL rights reserved. -# This program is licensed under Mulan PSL v2. -# You can use it according to the terms and conditions of the Mulan PSL v2. -# http://license.coscl.org.cn/MulanPSL2 -# THIS PROGRAM IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, -# EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, -# MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. -# See the Mulan PSL v2 for more details. - -# ############################################# -# @Author : honghua -# @Contact : honghua@iscas.ac.cn -# @Date : 2026-03-27 -# @License : Mulan PSL v2 -# @Desc : 测试通过包管理器(如yum/dnf/apt)成功卸载kbd-legacy软件包 -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - # 定义软件包名称 - PACKAGE_NAME="kbd-legacy" - - # 步骤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 - LOG_INFO "软件包 ${PACKAGE_NAME} 在yum源中" - - # 步骤2:检查当前环境是否已安装该软件包 - LOG_INFO "步骤2:检查当前环境是否已安装软件包 ${PACKAGE_NAME}" - rpm -q "${PACKAGE_NAME}" &>/dev/null - if [ $? -eq 0 ]; then - LOG_INFO "软件包 ${PACKAGE_NAME} 已安装,标记为保持安装状态" - KEEP_INSTALLED=1 - else - LOG_INFO "软件包 ${PACKAGE_NAME} 未安装,标记为需要卸载" - KEEP_INSTALLED=0 - fi - - # 步骤3:如果未安装,则安装软件包 - if [ ${KEEP_INSTALLED} -eq 0 ]; then - LOG_INFO "步骤3:安装软件包 ${PACKAGE_NAME}" - dnf install -y "${PACKAGE_NAME}" - CHECK_RESULT $? 0 0 "安装软件包 ${PACKAGE_NAME} 失败" - LOG_INFO "软件包 ${PACKAGE_NAME} 安装成功" - else - LOG_INFO "步骤3:软件包已安装,跳过安装步骤" - fi - - # 步骤4:验证软件包安装成功 - LOG_INFO "步骤4:验证软件包安装成功" - 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} 失败" - LOG_INFO "软件包 ${PACKAGE_NAME} 卸载成功" - - # 步骤6:验证软件包已卸载 - LOG_INFO "步骤6:验证软件包已卸载" - rpm -q "${PACKAGE_NAME}" &>/dev/null - if [ $? -eq 0 ]; then - LOG_ERROR "软件包 ${PACKAGE_NAME} 卸载后仍存在" - exit 1 - fi - LOG_INFO "软件包 ${PACKAGE_NAME} 已成功卸载" - - # 步骤7:环境恢复 - LOG_INFO "步骤7:环境恢复" - if [ ${KEEP_INSTALLED} -eq 0 ]; then - LOG_INFO "原始环境未安装软件包,无需恢复" - else - LOG_INFO "重新安装软件包以恢复原始环境" - dnf install -y "${PACKAGE_NAME}" - CHECK_RESULT $? 0 0 "重新安装软件包 ${PACKAGE_NAME} 失败" - LOG_INFO "环境恢复完成,软件包 ${PACKAGE_NAME} 已安装" - fi - - LOG_INFO "测试完成:成功通过包管理器卸载kbd-legacy软件包" -} - -main "$@" \ No newline at end of file diff --git a/testcases/function_test/pkg_test/kbd/kbd-legacy/test_kbd-legacy_function_verify_installed.sh b/testcases/function_test/pkg_test/kbd/kbd-legacy/test_kbd-legacy_function_verify_installed.sh deleted file mode 100644 index 3e9d34e5715..00000000000 --- a/testcases/function_test/pkg_test/kbd/kbd-legacy/test_kbd-legacy_function_verify_installed.sh +++ /dev/null @@ -1,80 +0,0 @@ -#!/usr/bin/bash - -# Copyright (c) 2024 ISCAS .ALL rights reserved. -# This program is licensed under Mulan PSL v2. -# You can use it according to the terms and conditions of the Mulan PSL v2. -# http://license.coscl.org.cn/MulanPSL2 -# THIS PROGRAM IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, -# EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, -# MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. -# See the Mulan PSL v2 for more details. - -# ############################################# -# @Author : honghua -# @Contact : honghua@iscas.ac.cn -# @Date : 2026-03-27 -# @License : Mulan PSL v2 -# @Desc : 测试检查kbd-legacy软件包是否已正确安装 -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - # 定义颜色和日志函数(通常由测试框架提供,这里模拟定义) - LOG_INFO() { - echo "[INFO] $1" - } - - LOG_ERROR() { - echo "[ERROR] $1" - } - - # 定义软件包名称 - PACKAGE_NAME="kbd-legacy" - - # 步骤1:检查软件包是否已在yum源中 - LOG_INFO "检查yum源中是否存在软件包 $PACKAGE_NAME" - dnf list available $PACKAGE_NAME &>/dev/null - if [ $? -ne 0 ]; then - LOG_ERROR "软件包 $PACKAGE_NAME 在yum源中不存在" - exit 255 - fi - - # 步骤2:检查当前环境是否已安装软件包 - LOG_INFO "检查当前环境是否已安装软件包 $PACKAGE_NAME" - rpm -q $PACKAGE_NAME &>/dev/null - if [ $? -eq 0 ]; then - LOG_INFO "软件包 $PACKAGE_NAME 已安装" - INSTALLED_BEFORE=true - else - LOG_INFO "软件包 $PACKAGE_NAME 未安装" - INSTALLED_BEFORE=false - fi - - # 步骤3:如果未安装,则安装软件包 - if [ "$INSTALLED_BEFORE" = "false" ]; then - LOG_INFO "开始安装软件包 $PACKAGE_NAME" - dnf install -y $PACKAGE_NAME - CHECK_RESULT $? 0 0 "安装软件包 $PACKAGE_NAME 失败" - LOG_INFO "软件包 $PACKAGE_NAME 安装成功" - fi - - # 步骤4:验证软件包是否正确安装 - LOG_INFO "验证软件包 $PACKAGE_NAME 是否正确安装" - rpm -q $PACKAGE_NAME &>/dev/null - CHECK_RESULT $? 0 0 "软件包 $PACKAGE_NAME 未正确安装" - - # 步骤5:清理环境,恢复到之前的状态 - if [ "$INSTALLED_BEFORE" = "false" ]; 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 From b8e9e3210441c6e2c3491df54c87237fba2024bb Mon Sep 17 00:00:00 2001 From: honghua Date: Thu, 16 Apr 2026 23:12:49 +0800 Subject: [PATCH 11/13] update testcase for testsuite texlive-lazylist-doc --- .../texlive-split-n/texlive-lazylist-doc.json | 8 --- ...est_texlive-lazylist-doc_function_check.sh | 66 ------------------- .../test_texlive-lazylist-doc_function_doc.sh | 63 ------------------ 3 files changed, 137 deletions(-) delete mode 100644 testcases/function_test/pkg_test/texlive-split-n/texlive-lazylist-doc/test_texlive-lazylist-doc_function_check.sh delete mode 100644 testcases/function_test/pkg_test/texlive-split-n/texlive-lazylist-doc/test_texlive-lazylist-doc_function_doc.sh diff --git a/suite2cases/function_test/pkg_test/texlive-split-n/texlive-lazylist-doc.json b/suite2cases/function_test/pkg_test/texlive-split-n/texlive-lazylist-doc.json index 4c6751b78c2..903c562dfc8 100644 --- a/suite2cases/function_test/pkg_test/texlive-split-n/texlive-lazylist-doc.json +++ b/suite2cases/function_test/pkg_test/texlive-split-n/texlive-lazylist-doc.json @@ -9,14 +9,6 @@ { "name": "test_texlive-lazylist-doc_function_remove", "desc": "Test package removal" - }, - { - "name": "test_texlive-lazylist-doc_function_check", - "desc": "Verify package is installed" - }, - { - "name": "test_texlive-lazylist-doc_function_doc", - "desc": "Check documentation files exist" } ] } \ No newline at end of file diff --git a/testcases/function_test/pkg_test/texlive-split-n/texlive-lazylist-doc/test_texlive-lazylist-doc_function_check.sh b/testcases/function_test/pkg_test/texlive-split-n/texlive-lazylist-doc/test_texlive-lazylist-doc_function_check.sh deleted file mode 100644 index 10c4bfee7f4..00000000000 --- a/testcases/function_test/pkg_test/texlive-split-n/texlive-lazylist-doc/test_texlive-lazylist-doc_function_check.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-02-21 -# @License : Mulan PSL v2 -# @Desc : Verify package is installed -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - set -e - - LOG_INFO "开始测试:验证软件包是否已安装" - - # 检查是否已安装texlive-lazylist-doc - LOG_INFO "步骤1:检查texlive-lazylist-doc是否已安装" - if rpm -q texlive-lazylist-doc &> /dev/null; then - LOG_INFO "texlive-lazylist-doc已安装,脚本将保持安装状态" - already_installed=true - else - LOG_INFO "texlive-lazylist-doc未安装,将进行安装测试" - already_installed=false - fi - - # 检查yum源中是否存在该软件包 - LOG_INFO "步骤2:检查yum源中是否存在texlive-lazylist-doc软件包" - if ! dnf list available texlive-lazylist-doc &> /dev/null; then - LOG_ERROR "yum源中未找到texlive-lazylist-doc软件包" - exit 255 - fi - - # 如果未安装,则安装软件包 - if [ "$already_installed" = false ]; then - LOG_INFO "步骤3:安装texlive-lazylist-doc软件包" - dnf install -y texlive-lazylist-doc - CHECK_RESULT $? 0 0 "安装texlive-lazylist-doc失败" - fi - - # 验证软件包是否成功安装 - LOG_INFO "步骤4:验证texlive-lazylist-doc软件包是否安装成功" - rpm -q texlive-lazylist-doc - CHECK_RESULT $? 0 0 "texlive-lazylist-doc软件包未正确安装" - - # 如果之前未安装,则在测试结束后卸载软件包 - if [ "$already_installed" = false ]; then - LOG_INFO "步骤5:卸载texlive-lazylist-doc软件包" - dnf remove -y texlive-lazylist-doc - CHECK_RESULT $? 0 0 "卸载texlive-lazylist-doc失败" - fi - - LOG_INFO "测试完成:验证软件包是否已安装" -} - -main "$@" \ No newline at end of file diff --git a/testcases/function_test/pkg_test/texlive-split-n/texlive-lazylist-doc/test_texlive-lazylist-doc_function_doc.sh b/testcases/function_test/pkg_test/texlive-split-n/texlive-lazylist-doc/test_texlive-lazylist-doc_function_doc.sh deleted file mode 100644 index c5afbcf58bf..00000000000 --- a/testcases/function_test/pkg_test/texlive-split-n/texlive-lazylist-doc/test_texlive-lazylist-doc_function_doc.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 : 2026-02-21 -# @License : Mulan PSL v2 -# @Desc : Check documentation files exist -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - LOG_INFO "开始测试: 检查texlive-lazylist-doc软件包的文档文件是否存在" - LOG_INFO "步骤1: 检查texlive-lazylist-doc软件包是否已在yum源中" - dnf list available texlive-lazylist-doc 2>/dev/null | grep -q texlive-lazylist-doc - if [ $? -ne 0 ]; then - LOG_ERROR "texlive-lazylist-doc软件包在yum源中不存在" - exit 255 - fi - LOG_INFO "texlive-lazylist-doc软件包在yum源中存在" - - LOG_INFO "步骤2: 检查texlive-lazylist-doc软件包是否已经安装" - if rpm -q texlive-lazylist-doc >/dev/null 2>&1; then - LOG_INFO "texlive-lazylist-doc软件包已经安装,测试后将保持安装状态" - ALREADY_INSTALLED=1 - else - LOG_INFO "texlive-lazylist-doc软件包未安装,将在测试中安装" - ALREADY_INSTALLED=0 - fi - - if [ $ALREADY_INSTALLED -eq 0 ]; then - LOG_INFO "步骤3: 安装texlive-lazylist-doc软件包" - dnf install -y texlive-lazylist-doc - CHECK_RESULT $? 0 0 "安装texlive-lazylist-doc软件包失败" - LOG_INFO "安装texlive-lazylist-doc软件包成功" - fi - - LOG_INFO "步骤4: 检查texlive-lazylist-doc软件包的文档文件是否存在" - rpm -ql texlive-lazylist-doc | grep -q "/usr/share/doc" - CHECK_RESULT $? 0 0 "texlive-lazylist-doc软件包的文档文件不存在" - LOG_INFO "texlive-lazylist-doc软件包的文档文件存在" - - if [ $ALREADY_INSTALLED -eq 0 ]; then - LOG_INFO "步骤5: 卸载texlive-lazylist-doc软件包" - dnf remove -y texlive-lazylist-doc - CHECK_RESULT $? 0 0 "卸载texlive-lazylist-doc软件包失败" - LOG_INFO "卸载texlive-lazylist-doc软件包成功" - fi - - LOG_INFO "测试完成: 检查texlive-lazylist-doc软件包的文档文件是否存在" -} - -main "$@" \ No newline at end of file From 1eae3293aec8503d559742ed64a7e0c3c161197e Mon Sep 17 00:00:00 2001 From: honghua Date: Thu, 16 Apr 2026 23:13:58 +0800 Subject: [PATCH 12/13] update testcase for testsuite python3-rdflib --- .../python-rdflib/python3-rdflib.json | 272 ------------------ .../test_python3-rdflib_convert_csv2rdf.sh | 87 ------ .../test_python3-rdflib_convert_rdf2dot.sh | 97 ------- .../test_python3-rdflib_csv2rdf_b_i_c.sh | 107 ------- .../test_python3-rdflib_csv2rdf_b_p.sh | 69 ----- .../test_python3-rdflib_csv2rdf_c.sh | 66 ----- .../test_python3-rdflib_csv2rdf_col_num_0.sh | 71 ----- .../test_python3-rdflib_csv2rdf_d.sh | 66 ----- .../test_python3-rdflib_csv2rdf_d_s_o.sh | 140 --------- .../test_python3-rdflib_csv2rdf_f.sh | 95 ------ .../test_python3-rdflib_csv2rdf_f_o.sh | 135 --------- .../test_python3-rdflib_csv2rdf_l.sh | 74 ----- .../test_python3-rdflib_csv2rdf_o.sh | 80 ------ .../test_python3-rdflib_csv2rdf_prop_num_0.sh | 59 ---- .../test_python3-rdflib_csv2rdf_prop_num_1.sh | 95 ------ .../test_python3-rdflib_csv2rdf_s.sh | 79 ----- .../test_python3-rdflib_csv2rdf_upper_c.sh | 66 ----- .../test_python3-rdflib_csv2rdf_upper_d.sh | 68 ----- .../test_python3-rdflib_function_parse.sh | 78 ----- .../test_python3-rdflib_graph_basic.sh | 107 ------- .../test_python3-rdflib_import.sh | 77 ----- .../test_python3-rdflib_install.sh | 81 ------ .../test_python3-rdflib_namespace.sh | 103 ------- .../test_python3-rdflib_parse_serialize.sh | 100 ------- .../test_python3-rdflib_pipe_format.sh | 109 ------- .../test_python3-rdflib_rdf2dot_f.sh | 69 ----- .../test_python3-rdflib_rdf2dot_f_o.sh | 112 -------- .../test_python3-rdflib_rdf2dot_h.sh | 59 ---- .../test_python3-rdflib_rdf2dot_o.sh | 77 ----- ...thon3-rdflib_rdfgraphisomorphism_format.sh | 79 ----- ...n3-rdflib_rdfgraphisomorphism_format_n3.sh | 102 ------- ...n3-rdflib_rdfgraphisomorphism_format_nt.sh | 113 -------- ...3-rdflib_rdfgraphisomorphism_format_xml.sh | 89 ------ ...st_python3-rdflib_rdfgraphisomorphism_h.sh | 62 ---- ...python3-rdflib_rdfgraphisomorphism_help.sh | 89 ------ ...st_python3-rdflib_rdfgraphisomorphism_s.sh | 61 ---- ...ython3-rdflib_rdfgraphisomorphism_stdin.sh | 89 ------ .../test_python3-rdflib_rdfpipe__h.sh | 62 ---- ..._python3-rdflib_rdfpipe__i_input_format.sh | 72 ----- .../test_python3-rdflib_rdfpipe__no_guess.sh | 62 ---- .../test_python3-rdflib_rdfpipe__no_out.sh | 76 ----- ...on3-rdflib_rdfpipe__ns_prefix_namespace.sh | 74 ----- ...python3-rdflib_rdfpipe__o_output_format.sh | 81 ------ .../test_python3-rdflib_rdfpipe__w.sh | 75 ----- .../test_python3-rdflib_rdfpipe_file.sh | 99 ------- .../test_python3-rdflib_rdfpipe_h.sh | 123 -------- .../test_python3-rdflib_rdfpipe_i.sh | 111 ------- ...ython3-rdflib_rdfpipe_i_format_keywords.sh | 88 ------ .../test_python3-rdflib_rdfpipe_i_no_guess.sh | 97 ------- .../test_python3-rdflib_rdfpipe_i_o.sh | 82 ------ .../test_python3-rdflib_rdfpipe_i_o_ns.sh | 98 ------- .../test_python3-rdflib_rdfpipe_no_guess.sh | 102 ------- ..._python3-rdflib_rdfpipe_no_guess_no_out.sh | 163 ----------- .../test_python3-rdflib_rdfpipe_no_out.sh | 96 ------- .../test_python3-rdflib_rdfpipe_ns.sh | 109 ------- .../test_python3-rdflib_rdfpipe_o.sh | 119 -------- ...ython3-rdflib_rdfpipe_o_format_keywords.sh | 93 ------ .../test_python3-rdflib_rdfpipe_o_w.sh | 114 -------- .../test_python3-rdflib_rdfpipe_stdin.sh | 103 ------- .../test_python3-rdflib_rdfpipe_version.sh | 96 ------- .../test_python3-rdflib_rdfpipe_w.sh | 104 ------- .../test_python3-rdflib_rdfs2dot_f_o.sh | 113 -------- .../test_python3-rdflib_rdfs2dot_h.sh | 93 ------ .../test_python3-rdflib_rdfs2dot_no_args.sh | 80 ------ .../test_python3-rdflib_rdfs2dot_o.sh | 71 ----- .../test_python3-rdflib_sparql_query.sh | 153 ---------- .../test_python3-rdflib_uninstall.sh | 84 ------ 67 files changed, 6275 deletions(-) delete mode 100644 testcases/function_test/pkg_test/python-rdflib/python3-rdflib/test_python3-rdflib_convert_csv2rdf.sh delete mode 100644 testcases/function_test/pkg_test/python-rdflib/python3-rdflib/test_python3-rdflib_convert_rdf2dot.sh delete mode 100644 testcases/function_test/pkg_test/python-rdflib/python3-rdflib/test_python3-rdflib_csv2rdf_b_i_c.sh delete mode 100644 testcases/function_test/pkg_test/python-rdflib/python3-rdflib/test_python3-rdflib_csv2rdf_b_p.sh delete mode 100644 testcases/function_test/pkg_test/python-rdflib/python3-rdflib/test_python3-rdflib_csv2rdf_c.sh delete mode 100644 testcases/function_test/pkg_test/python-rdflib/python3-rdflib/test_python3-rdflib_csv2rdf_col_num_0.sh delete mode 100644 testcases/function_test/pkg_test/python-rdflib/python3-rdflib/test_python3-rdflib_csv2rdf_d.sh delete mode 100644 testcases/function_test/pkg_test/python-rdflib/python3-rdflib/test_python3-rdflib_csv2rdf_d_s_o.sh delete mode 100644 testcases/function_test/pkg_test/python-rdflib/python3-rdflib/test_python3-rdflib_csv2rdf_f.sh delete mode 100644 testcases/function_test/pkg_test/python-rdflib/python3-rdflib/test_python3-rdflib_csv2rdf_f_o.sh delete mode 100644 testcases/function_test/pkg_test/python-rdflib/python3-rdflib/test_python3-rdflib_csv2rdf_l.sh delete mode 100644 testcases/function_test/pkg_test/python-rdflib/python3-rdflib/test_python3-rdflib_csv2rdf_o.sh delete mode 100644 testcases/function_test/pkg_test/python-rdflib/python3-rdflib/test_python3-rdflib_csv2rdf_prop_num_0.sh delete mode 100644 testcases/function_test/pkg_test/python-rdflib/python3-rdflib/test_python3-rdflib_csv2rdf_prop_num_1.sh delete mode 100644 testcases/function_test/pkg_test/python-rdflib/python3-rdflib/test_python3-rdflib_csv2rdf_s.sh delete mode 100644 testcases/function_test/pkg_test/python-rdflib/python3-rdflib/test_python3-rdflib_csv2rdf_upper_c.sh delete mode 100644 testcases/function_test/pkg_test/python-rdflib/python3-rdflib/test_python3-rdflib_csv2rdf_upper_d.sh delete mode 100644 testcases/function_test/pkg_test/python-rdflib/python3-rdflib/test_python3-rdflib_function_parse.sh delete mode 100644 testcases/function_test/pkg_test/python-rdflib/python3-rdflib/test_python3-rdflib_graph_basic.sh delete mode 100644 testcases/function_test/pkg_test/python-rdflib/python3-rdflib/test_python3-rdflib_import.sh delete mode 100644 testcases/function_test/pkg_test/python-rdflib/python3-rdflib/test_python3-rdflib_install.sh delete mode 100644 testcases/function_test/pkg_test/python-rdflib/python3-rdflib/test_python3-rdflib_namespace.sh delete mode 100644 testcases/function_test/pkg_test/python-rdflib/python3-rdflib/test_python3-rdflib_parse_serialize.sh delete mode 100644 testcases/function_test/pkg_test/python-rdflib/python3-rdflib/test_python3-rdflib_pipe_format.sh delete mode 100644 testcases/function_test/pkg_test/python-rdflib/python3-rdflib/test_python3-rdflib_rdf2dot_f.sh delete mode 100644 testcases/function_test/pkg_test/python-rdflib/python3-rdflib/test_python3-rdflib_rdf2dot_f_o.sh delete mode 100644 testcases/function_test/pkg_test/python-rdflib/python3-rdflib/test_python3-rdflib_rdf2dot_h.sh delete mode 100644 testcases/function_test/pkg_test/python-rdflib/python3-rdflib/test_python3-rdflib_rdf2dot_o.sh delete mode 100644 testcases/function_test/pkg_test/python-rdflib/python3-rdflib/test_python3-rdflib_rdfgraphisomorphism_format.sh delete mode 100644 testcases/function_test/pkg_test/python-rdflib/python3-rdflib/test_python3-rdflib_rdfgraphisomorphism_format_n3.sh delete mode 100644 testcases/function_test/pkg_test/python-rdflib/python3-rdflib/test_python3-rdflib_rdfgraphisomorphism_format_nt.sh delete mode 100644 testcases/function_test/pkg_test/python-rdflib/python3-rdflib/test_python3-rdflib_rdfgraphisomorphism_format_xml.sh delete mode 100644 testcases/function_test/pkg_test/python-rdflib/python3-rdflib/test_python3-rdflib_rdfgraphisomorphism_h.sh delete mode 100644 testcases/function_test/pkg_test/python-rdflib/python3-rdflib/test_python3-rdflib_rdfgraphisomorphism_help.sh delete mode 100644 testcases/function_test/pkg_test/python-rdflib/python3-rdflib/test_python3-rdflib_rdfgraphisomorphism_s.sh delete mode 100644 testcases/function_test/pkg_test/python-rdflib/python3-rdflib/test_python3-rdflib_rdfgraphisomorphism_stdin.sh delete mode 100644 testcases/function_test/pkg_test/python-rdflib/python3-rdflib/test_python3-rdflib_rdfpipe__h.sh delete mode 100644 testcases/function_test/pkg_test/python-rdflib/python3-rdflib/test_python3-rdflib_rdfpipe__i_input_format.sh delete mode 100644 testcases/function_test/pkg_test/python-rdflib/python3-rdflib/test_python3-rdflib_rdfpipe__no_guess.sh delete mode 100644 testcases/function_test/pkg_test/python-rdflib/python3-rdflib/test_python3-rdflib_rdfpipe__no_out.sh delete mode 100644 testcases/function_test/pkg_test/python-rdflib/python3-rdflib/test_python3-rdflib_rdfpipe__ns_prefix_namespace.sh delete mode 100644 testcases/function_test/pkg_test/python-rdflib/python3-rdflib/test_python3-rdflib_rdfpipe__o_output_format.sh delete mode 100644 testcases/function_test/pkg_test/python-rdflib/python3-rdflib/test_python3-rdflib_rdfpipe__w.sh delete mode 100644 testcases/function_test/pkg_test/python-rdflib/python3-rdflib/test_python3-rdflib_rdfpipe_file.sh delete mode 100644 testcases/function_test/pkg_test/python-rdflib/python3-rdflib/test_python3-rdflib_rdfpipe_h.sh delete mode 100644 testcases/function_test/pkg_test/python-rdflib/python3-rdflib/test_python3-rdflib_rdfpipe_i.sh delete mode 100644 testcases/function_test/pkg_test/python-rdflib/python3-rdflib/test_python3-rdflib_rdfpipe_i_format_keywords.sh delete mode 100644 testcases/function_test/pkg_test/python-rdflib/python3-rdflib/test_python3-rdflib_rdfpipe_i_no_guess.sh delete mode 100644 testcases/function_test/pkg_test/python-rdflib/python3-rdflib/test_python3-rdflib_rdfpipe_i_o.sh delete mode 100644 testcases/function_test/pkg_test/python-rdflib/python3-rdflib/test_python3-rdflib_rdfpipe_i_o_ns.sh delete mode 100644 testcases/function_test/pkg_test/python-rdflib/python3-rdflib/test_python3-rdflib_rdfpipe_no_guess.sh delete mode 100644 testcases/function_test/pkg_test/python-rdflib/python3-rdflib/test_python3-rdflib_rdfpipe_no_guess_no_out.sh delete mode 100644 testcases/function_test/pkg_test/python-rdflib/python3-rdflib/test_python3-rdflib_rdfpipe_no_out.sh delete mode 100644 testcases/function_test/pkg_test/python-rdflib/python3-rdflib/test_python3-rdflib_rdfpipe_ns.sh delete mode 100644 testcases/function_test/pkg_test/python-rdflib/python3-rdflib/test_python3-rdflib_rdfpipe_o.sh delete mode 100644 testcases/function_test/pkg_test/python-rdflib/python3-rdflib/test_python3-rdflib_rdfpipe_o_format_keywords.sh delete mode 100644 testcases/function_test/pkg_test/python-rdflib/python3-rdflib/test_python3-rdflib_rdfpipe_o_w.sh delete mode 100644 testcases/function_test/pkg_test/python-rdflib/python3-rdflib/test_python3-rdflib_rdfpipe_stdin.sh delete mode 100644 testcases/function_test/pkg_test/python-rdflib/python3-rdflib/test_python3-rdflib_rdfpipe_version.sh delete mode 100644 testcases/function_test/pkg_test/python-rdflib/python3-rdflib/test_python3-rdflib_rdfpipe_w.sh delete mode 100644 testcases/function_test/pkg_test/python-rdflib/python3-rdflib/test_python3-rdflib_rdfs2dot_f_o.sh delete mode 100644 testcases/function_test/pkg_test/python-rdflib/python3-rdflib/test_python3-rdflib_rdfs2dot_h.sh delete mode 100644 testcases/function_test/pkg_test/python-rdflib/python3-rdflib/test_python3-rdflib_rdfs2dot_no_args.sh delete mode 100644 testcases/function_test/pkg_test/python-rdflib/python3-rdflib/test_python3-rdflib_rdfs2dot_o.sh delete mode 100644 testcases/function_test/pkg_test/python-rdflib/python3-rdflib/test_python3-rdflib_sparql_query.sh delete mode 100644 testcases/function_test/pkg_test/python-rdflib/python3-rdflib/test_python3-rdflib_uninstall.sh diff --git a/suite2cases/function_test/pkg_test/python-rdflib/python3-rdflib.json b/suite2cases/function_test/pkg_test/python-rdflib/python3-rdflib.json index b9e5df0156f..29caeac31fe 100644 --- a/suite2cases/function_test/pkg_test/python-rdflib/python3-rdflib.json +++ b/suite2cases/function_test/pkg_test/python-rdflib/python3-rdflib.json @@ -2,285 +2,13 @@ "path": "$OET_PATH/testcases/function_test/pkg_test/python-rdflib/python3-rdflib", "machine num": 1, "cases": [ - { - "name": "test_python3-rdflib_csv2rdf_b_p", - "desc": "测试使用 -b 和 -p 参数指定实例基础和属性基础" - }, - { - "name": "test_python3-rdflib_csv2rdf_upper_d", - "desc": "测试使用 -D 参数设置默认列转换" - }, - { - "name": "test_python3-rdflib_csv2rdf_c", - "desc": "测试使用 -c 参数指定类名" - }, { "name": "test_python3-rdflib_csv2rdf_i", "desc": "测试使用 -i 参数指定标识列" }, - { - "name": "test_python3-rdflib_csv2rdf_l", - "desc": "测试使用 -l 参数指定标签列" - }, - { - "name": "test_python3-rdflib_csv2rdf_s", - "desc": "测试使用 -s 参数跳过指定行数" - }, - { - "name": "test_python3-rdflib_csv2rdf_o", - "desc": "测试使用 -o 参数指定输出文件" - }, - { - "name": "test_python3-rdflib_csv2rdf_f", - "desc": "测试使用 -f 参数读取配置文件" - }, - { - "name": "test_python3-rdflib_csv2rdf_col_num_0", - "desc": "测试使用 --col0 参数指定第0列的转换" - }, - { - "name": "test_python3-rdflib_csv2rdf_prop_num_0", - "desc": "测试使用 --prop0 参数指定第0列的属性" - }, - { - "name": "test_python3-rdflib_csv2rdf_d", - "desc": "测试使用 -d 参数指定分隔符" - }, - { - "name": "test_python3-rdflib_csv2rdf_upper_c", - "desc": "测试使用 -C 参数定义类为 rdfs:Class" - }, - { - "name": "test_python3-rdflib_rdf2dot_h", - "desc": "测试 rdf2dot 命令的 -h 参数" - }, - { - "name": "test_python3-rdflib_rdf2dot_f", - "desc": "测试 rdf2dot 命令的 -f 参数" - }, - { - "name": "test_python3-rdflib_rdf2dot_o", - "desc": "测试 rdf2dot 命令的 -o 参数" - }, - { - "name": "test_python3-rdflib_rdfgraphisomorphism_h", - "desc": "测试帮助文档显示功能" - }, - { - "name": "test_python3-rdflib_rdfgraphisomorphism_s", - "desc": "测试从STDIN加载数据的功能" - }, - { - "name": "test_python3-rdflib_rdfgraphisomorphism_format", - "desc": "测试指定RDF文档格式的功能,默认格式为xml" - }, - { - "name": "test_python3-rdflib_rdfpipe__h", - "desc": "测试 rdfpipe 命令的帮助文档显示" - }, - { - "name": "test_python3-rdflib_rdfpipe__i_input_format", - "desc": "测试 rdfpipe 命令的输入格式指定功能" - }, - { - "name": "test_python3-rdflib_rdfpipe__o_output_format", - "desc": "测试 rdfpipe 命令的输出格式指定功能" - }, - { - "name": "test_python3-rdflib_rdfpipe__ns_prefix_namespace", - "desc": "测试 rdfpipe 命令的命名空间绑定功能" - }, - { - "name": "test_python3-rdflib_rdfpipe__no_guess", - "desc": "测试 rdfpipe 命令的禁止猜测输入格式功能" - }, - { - "name": "test_python3-rdflib_rdfpipe__no_out", - "desc": "测试 rdfpipe 命令的禁止输出结果功能" - }, - { - "name": "test_python3-rdflib_rdfpipe__w", - "desc": "测试 rdfpipe 命令的输出警告信息功能" - }, { "name": "test_python3-rdflib_rdfs2dot_f", "desc": "测试 rdfs2dot 命令的 -f 参数" - }, - { - "name": "test_python3-rdflib_rdfs2dot_o", - "desc": "测试 rdfs2dot 命令的 -o 参数" - }, - { - "name": "test_python3-rdflib_function_parse", - "desc": "测试解析RDF文档的功能" - }, - { - "name": "test_python3-rdflib_csv2rdf_prop_num_1", - "desc": "测试使用 --prop1 参数指定第1列使用的属性URI" - }, - { - "name": "test_python3-rdflib_csv2rdf_b_i_c", - "desc": "测试组合使用 -b, -i, -c 参数设置基础URI、标识列和类型" - }, - { - "name": "test_python3-rdflib_csv2rdf_d_s_o", - "desc": "测试组合使用 -d, -s, -o 参数处理CSV并输出到文件" - }, - { - "name": "test_python3-rdflib_csv2rdf_f_o", - "desc": "测试组合使用 -f 和 -o 参数,通过配置文件转换并指定输出" - }, - { - "name": "test_python3-rdflib_rdf2dot_f_o", - "desc": "测试rdf2dot命令同时使用-f和-o参数,指定格式并输出到文件" - }, - { - "name": "test_python3-rdflib_rdfgraphisomorphism_help", - "desc": "测试 rdfgraphisomorphism 命令的 --help 参数,验证帮助信息是否正确显示" - }, - { - "name": "test_python3-rdflib_rdfgraphisomorphism_stdin", - "desc": "测试 rdfgraphisomorphism 命令的 --stdin 参数,验证是否可以从标准输入加载数据" - }, - { - "name": "test_python3-rdflib_rdfgraphisomorphism_format_xml", - "desc": "测试 rdfgraphisomorphism 命令的 --format=xml 参数,验证能否正确比较 XML 格式的 RDF 文件" - }, - { - "name": "test_python3-rdflib_rdfgraphisomorphism_format_n3", - "desc": "测试 rdfgraphisomorphism 命令的 --format=n3 参数,验证能否正确比较 N3 格式的 RDF 文件" - }, - { - "name": "test_python3-rdflib_rdfgraphisomorphism_format_trix", - "desc": "测试 rdfgraphisomorphism 命令的 --format=trix 参数,验证能否正确比较 TriX 格式的 RDF 文件" - }, - { - "name": "test_python3-rdflib_rdfgraphisomorphism_format_nt", - "desc": "测试 rdfgraphisomorphism 命令的 --format=nt 参数,验证能否正确比较 NTriples 格式的 RDF 文件" - }, - { - "name": "test_python3-rdflib_rdfgraphisomorphism_format_rdfa", - "desc": "测试 rdfgraphisomorphism 命令的 --format=rdfa 参数,验证能否正确比较 RDFa 格式的 RDF 文件" - }, - { - "name": "test_python3-rdflib_rdfpipe_h", - "desc": "测试显示帮助信息" - }, - { - "name": "test_python3-rdflib_rdfpipe_i", - "desc": "测试指定输入文件格式" - }, - { - "name": "test_python3-rdflib_rdfpipe_o", - "desc": "测试指定输出文件格式" - }, - { - "name": "test_python3-rdflib_rdfpipe_ns", - "desc": "测试注册命名空间绑定" - }, - { - "name": "test_python3-rdflib_rdfpipe_no_guess", - "desc": "测试禁用根据文件后缀猜测格式" - }, - { - "name": "test_python3-rdflib_rdfpipe_no_out", - "desc": "测试仅检查输入有效性而不输出" - }, - { - "name": "test_python3-rdflib_rdfpipe_w", - "desc": "测试输出警告信息到标准错误" - }, - { - "name": "test_python3-rdflib_rdfpipe_version", - "desc": "测试显示程序版本号" - }, - { - "name": "test_python3-rdflib_rdfpipe_stdin", - "desc": "测试从标准输入读取数据" - }, - { - "name": "test_python3-rdflib_rdfpipe_file", - "desc": "测试从文件读取数据" - }, - { - "name": "test_python3-rdflib_rdfpipe_i_o", - "desc": "测试同时指定输入和输出格式" - }, - { - "name": "test_python3-rdflib_rdfpipe_i_o_ns", - "desc": "测试同时指定输入格式、输出格式和命名空间" - }, - { - "name": "test_python3-rdflib_rdfpipe_i_no_guess", - "desc": "测试指定输入格式并禁用后缀猜测" - }, - { - "name": "test_python3-rdflib_rdfpipe_o_w", - "desc": "测试指定输出格式并启用警告输出" - }, - { - "name": "test_python3-rdflib_rdfpipe_no_guess_no_out", - "desc": "测试禁用后缀猜测且不输出结果" - }, - { - "name": "test_python3-rdflib_rdfpipe_i_format_keywords", - "desc": "测试为输入格式指定解析器关键字" - }, - { - "name": "test_python3-rdflib_rdfpipe_o_format_keywords", - "desc": "测试为输出格式指定序列化器关键字" - }, - { - "name": "test_python3-rdflib_rdfs2dot_no_args", - "desc": "测试不带任何参数运行rdfs2dot命令" - }, - { - "name": "test_python3-rdflib_rdfs2dot_h", - "desc": "测试使用 -h 参数显示帮助信息" - }, - { - "name": "test_python3-rdflib_rdfs2dot_f_o", - "desc": "测试同时使用 -f 和 -o 参数" - }, - { - "name": "test_python3-rdflib_install", - "desc": "测试软件包安装" - }, - { - "name": "test_python3-rdflib_import", - "desc": "测试导入核心模块" - }, - { - "name": "test_python3-rdflib_parse_serialize", - "desc": "测试解析和序列化RDF" - }, - { - "name": "test_python3-rdflib_graph_basic", - "desc": "测试图创建与三元组操作" - }, - { - "name": "test_python3-rdflib_sparql_query", - "desc": "测试执行SPARQL查询" - }, - { - "name": "test_python3-rdflib_namespace", - "desc": "测试命名空间绑定与使用" - }, - { - "name": "test_python3-rdflib_convert_csv2rdf", - "desc": "测试CSV到RDF转换" - }, - { - "name": "test_python3-rdflib_convert_rdf2dot", - "desc": "测试RDF到DOT转换" - }, - { - "name": "test_python3-rdflib_pipe_format", - "desc": "测试RDF格式转换管道" - }, - { - "name": "test_python3-rdflib_uninstall", - "desc": "测试软件包卸载" } ] } \ No newline at end of file diff --git a/testcases/function_test/pkg_test/python-rdflib/python3-rdflib/test_python3-rdflib_convert_csv2rdf.sh b/testcases/function_test/pkg_test/python-rdflib/python3-rdflib/test_python3-rdflib_convert_csv2rdf.sh deleted file mode 100644 index 5d31032e63a..00000000000 --- a/testcases/function_test/pkg_test/python-rdflib/python3-rdflib/test_python3-rdflib_convert_csv2rdf.sh +++ /dev/null @@ -1,87 +0,0 @@ -#!/usr/bin/bash - -# Copyright (c) 2024 ISCAS .ALL rights reserved. -# This program is licensed under Mulan PSL v2. -# You can use it according to the terms and conditions of the Mulan PSL v2. -# http://license.coscl.org.cn/MulanPSL2 -# THIS PROGRAM IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, -# EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, -# MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. -# See the Mulan PSL v2 for more details. - -# ############################################# -# @Author : honghua -# @Contact : honghua@iscas.ac.cn -# @Date : 2026-03-23 -# @License : Mulan PSL v2 -# @Desc : 测试CSV到RDF转换 -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - LOG_INFO "开始测试CSV到RDF转换功能" - LOG_INFO "步骤1:检查python3-rdflib软件包是否在yum源中" - dnf list available python3-rdflib > /dev/null 2>&1 - if [ $? -ne 0 ]; then - LOG_ERROR "python3-rdflib软件包在yum源中不存在" - exit 255 - fi - - LOG_INFO "步骤2:检查python3-rdflib是否已安装" - rpm -q python3-rdflib > /dev/null 2>&1 - if [ $? -eq 0 ]; then - INSTALLED=true - LOG_INFO "python3-rdflib已安装,将保持安装状态" - else - INSTALLED=false - LOG_INFO "python3-rdflib未安装,将进行安装" - fi - - if [ "$INSTALLED" = "false" ]; then - LOG_INFO "步骤3:安装python3-rdflib软件包" - dnf install -y python3-rdflib - CHECK_RESULT $? 0 0 "安装python3-rdflib失败" - fi - - LOG_INFO "步骤4:检查csv2rdf命令是否可用" - csv2rdf --help > /dev/null 2>&1 - if [ $? -ne 0 ]; then - LOG_ERROR "csv2rdf命令不存在或不支持" - exit 255 - fi - - LOG_INFO "步骤5:创建测试CSV文件" - cat > test_input.csv << EOF - name,age,city - Alice,30,Beijing - Bob,25,Shanghai - EOF - CHECK_RESULT $? 0 0 "创建测试CSV文件失败" - - LOG_INFO "步骤6:执行CSV到RDF转换" - csv2rdf test_input.csv test_output.rdf - CHECK_RESULT $? 0 0 "CSV到RDF转换执行失败" - - LOG_INFO "步骤7:检查生成的RDF文件" - if [ -f test_output.rdf ]; then - LOG_INFO "RDF文件生成成功" - else - LOG_ERROR "RDF文件未生成" - exit 1 - fi - - LOG_INFO "步骤8:清理测试文件" - rm -f test_input.csv test_output.rdf - CHECK_RESULT $? 0 0 "清理测试文件失败" - - if [ "$INSTALLED" = "false" ]; then - LOG_INFO "步骤9:卸载python3-rdflib软件包" - dnf remove -y python3-rdflib - CHECK_RESULT $? 0 0 "卸载python3-rdflib失败" - fi - - LOG_INFO "测试完成" -} - -main "$@" \ No newline at end of file diff --git a/testcases/function_test/pkg_test/python-rdflib/python3-rdflib/test_python3-rdflib_convert_rdf2dot.sh b/testcases/function_test/pkg_test/python-rdflib/python3-rdflib/test_python3-rdflib_convert_rdf2dot.sh deleted file mode 100644 index 5251f964a05..00000000000 --- a/testcases/function_test/pkg_test/python-rdflib/python3-rdflib/test_python3-rdflib_convert_rdf2dot.sh +++ /dev/null @@ -1,97 +0,0 @@ -#!/usr/bin/bash - -# Copyright (c) 2024 ISCAS .ALL rights reserved. -# This program is licensed under Mulan PSL v2. -# You can use it according to the terms and conditions of the Mulan PSL v2. -# http://license.coscl.org.cn/MulanPSL2 -# THIS PROGRAM IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, -# EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-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-23 -# @License : Mulan PSL v2 -# @Desc : 测试RDF到DOT转换 -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - LOG_INFO "开始测试RDF到DOT转换" - LOG_INFO "步骤1:检查yum源中是否存在python3-rdflib软件包" - dnf list available python3-rdflib > /dev/null 2>&1 - if [ $? -ne 0 ]; then - LOG_ERROR "yum源中未找到python3-rdflib软件包" - exit 255 - fi - LOG_INFO "python3-rdflib软件包在yum源中可用" - - LOG_INFO "步骤2:检查python3-rdflib是否已经安装" - rpm -q python3-rdflib > /dev/null 2>&1 - if [ $? -eq 0 ]; then - LOG_INFO "python3-rdflib已经安装,测试结束后将保持安装状态" - INSTALLED=1 - else - LOG_INFO "python3-rdflib未安装,将在测试步骤中安装" - INSTALLED=0 - fi - - LOG_INFO "步骤3:安装python3-rdflib软件包(如果未安装)" - if [ $INSTALLED -eq 0 ]; then - dnf install -y python3-rdflib - CHECK_RESULT $? 0 0 "安装python3-rdflib失败" - fi - - LOG_INFO "步骤4:验证rdf2dot命令是否存在" - which rdf2dot > /dev/null 2>&1 - if [ $? -ne 0 ]; then - LOG_ERROR "rdf2dot命令未找到,可能安装不完整" - exit 255 - fi - LOG_INFO "rdf2dot命令可用" - - LOG_INFO "步骤5:检查rdf2dot命令支持的参数" - rdf2dot --help > /dev/null 2>&1 - if [ $? -ne 0 ]; then - LOG_ERROR "rdf2dot命令不支持--help参数" - exit 255 - fi - LOG_INFO "rdf2dot命令参数检查通过" - - LOG_INFO "步骤6:准备测试用的RDF文件" - cat > test_input.rdf << "EOF" - @prefix rdf: . - @prefix ex: . - ex:subj rdf:type ex:Class . - ex:subj ex:prop "value" . - EOF - CHECK_RESULT $? 0 0 "创建测试RDF文件失败" - - LOG_INFO "步骤7:执行RDF到DOT转换测试" - rdf2dot test_input.rdf > test_output.dot 2>&1 - CHECK_RESULT $? 0 0 "RDF到DOT转换失败" - - LOG_INFO "步骤8:验证生成的DOT文件内容" - grep -q "digraph" test_output.dot - CHECK_RESULT $? 0 0 "生成的DOT文件格式不正确" - - LOG_INFO "步骤9:清理测试文件" - rm -f test_input.rdf test_output.dot - CHECK_RESULT $? 0 0 "清理测试文件失败" - - LOG_INFO "步骤10:恢复测试环境" - if [ $INSTALLED -eq 0 ]; then - LOG_INFO "卸载测试安装的python3-rdflib软件包" - dnf remove -y python3-rdflib - CHECK_RESULT $? 0 0 "卸载python3-rdflib失败" - else - LOG_INFO "保持python3-rdflib的安装状态" - fi - - LOG_INFO "RDF到DOT转换测试完成" -} - -main "$@" \ No newline at end of file diff --git a/testcases/function_test/pkg_test/python-rdflib/python3-rdflib/test_python3-rdflib_csv2rdf_b_i_c.sh b/testcases/function_test/pkg_test/python-rdflib/python3-rdflib/test_python3-rdflib_csv2rdf_b_i_c.sh deleted file mode 100644 index 9ab7ae445ad..00000000000 --- a/testcases/function_test/pkg_test/python-rdflib/python3-rdflib/test_python3-rdflib_csv2rdf_b_i_c.sh +++ /dev/null @@ -1,107 +0,0 @@ -#!/usr/bin/bash - -# Copyright (c) 2024 ISCAS .ALL rights reserved. -# This program is licensed under Mulan PSL v2. -# You can use it according to the terms and conditions of the Mulan PSL v2. -# http://license.coscl.org.cn/MulanPSL2 -# THIS PROGRAM IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, -# EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-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-23 -# @License : Mulan PSL v2 -# @Desc : 测试组合使用 -b, -i, -c 参数设置基础URI、标识列和类型 -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - LOG_INFO "1. 检查yum源中是否存在python3-rdflib软件包" - dnf list python3-rdflib 2>/dev/null | grep -q python3-rdflib - if [ $? -ne 0 ]; then - LOG_ERROR "yum源中未找到python3-rdflib软件包" - exit 255 - fi - - LOG_INFO "2. 检查环境是否已安装python3-rdflib" - rpm -q python3-rdflib >/dev/null 2>&1 - if [ $? -eq 0 ]; then - LOG_INFO "环境已安装python3-rdflib,脚本结束后将保持安装状态" - already_installed=1 - else - LOG_INFO "环境未安装python3-rdflib,将进行安装" - already_installed=0 - fi - - if [ $already_installed -eq 0 ]; then - LOG_INFO "3. 安装python3-rdflib软件包" - dnf install -y python3-rdflib - CHECK_RESULT $? 0 0 "安装python3-rdflib失败" - fi - - LOG_INFO "4. 创建测试CSV文件" - cat > test_data.csv <&1 | grep -q -- "-b" - if [ $? -ne 0 ]; then - LOG_ERROR "csv2rdf命令不支持-b参数" - exit 255 - fi - - csv2rdf --help 2>&1 | grep -q -- "-i" - if [ $? -ne 0 ]; then - LOG_ERROR "csv2rdf命令不支持-i参数" - exit 255 - fi - - csv2rdf --help 2>&1 | grep -q -- "-c" - if [ $? -ne 0 ]; then - LOG_ERROR "csv2rdf命令不支持-c参数" - exit 255 - fi - - LOG_INFO "6. 执行csv2rdf命令转换CSV到RDF" - csv2rdf -b "http://example.org/" -i "ID" -c "Type" test_data.csv > output.rdf - CHECK_RESULT $? 0 0 "csv2rdf命令执行失败" - - LOG_INFO "7. 检查输出文件是否生成且非空" - if [ -s output.rdf ]; then - LOG_INFO "输出文件生成成功" - else - LOG_ERROR "输出文件为空或未生成" - exit 1 - fi - - LOG_INFO "8. 检查输出文件是否包含预期的RDF内容" - grep -q "http://example.org/1" output.rdf - CHECK_RESULT $? 0 0 "输出文件中未找到预期的URI" - grep -q "Person" output.rdf - CHECK_RESULT $? 0 0 "输出文件中未找到预期的类型" - - LOG_INFO "9. 清理测试文件" - rm -f test_data.csv output.rdf - CHECK_RESULT $? 0 0 "清理测试文件失败" - - if [ $already_installed -eq 0 ]; then - LOG_INFO "10. 卸载python3-rdflib软件包" - dnf remove -y python3-rdflib - CHECK_RESULT $? 0 0 "卸载python3-rdflib失败" - else - LOG_INFO "10. 环境已安装python3-rdflib,跳过卸载步骤" - fi - - LOG_INFO "11. 测试完成,环境已恢复" -} - -main "$@" \ No newline at end of file diff --git a/testcases/function_test/pkg_test/python-rdflib/python3-rdflib/test_python3-rdflib_csv2rdf_b_p.sh b/testcases/function_test/pkg_test/python-rdflib/python3-rdflib/test_python3-rdflib_csv2rdf_b_p.sh deleted file mode 100644 index c5ff279e129..00000000000 --- a/testcases/function_test/pkg_test/python-rdflib/python3-rdflib/test_python3-rdflib_csv2rdf_b_p.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-08 -# @License : Mulan PSL v2 -# @Desc : 测试使用 -b 和 -p 参数指定实例基础和属性基础 -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - - # 检查是否已安装python3-rdflib - if dnf list installed python3-rdflib &>/dev/null; then - LOG_INFO "python3-rdflib已安装,脚本结束后将保持安装状态" - INSTALLED=true - else - LOG_INFO "python3-rdflib未安装,将在测试完成后卸载" - INSTALLED=false - fi - - # 检查yum源中是否有python3-rdflib - LOG_INFO "检查yum源中是否有python3-rdflib" - if ! dnf list available python3-rdflib &>/dev/null; then - LOG_ERROR "yum源中未找到python3-rdflib" - exit 255 - fi - - # 安装python3-rdflib - if [ "$INSTALLED" = false ]; then - LOG_INFO "安装python3-rdflib" - dnf install -y python3-rdflib - CHECK_RESULT $? 0 0 "安装python3-rdflib失败" - fi - - # 测试使用 -b 和 -p 参数指定实例基础和属性基础 - LOG_INFO "测试使用 -b 和 -p 参数指定实例基础和属性基础" - csv2rdf --help | grep -q -- "-b.*base URI" - CHECK_RESULT $? 0 0 "参数-b不支持" - csv2rdf --help | grep -q -- "-p.*base URI" - CHECK_RESULT $? 0 0 "参数-p不支持" - - LOG_INFO "执行csv2rdf命令测试" - csv2rdf -b "http://example.org/base" -p "http://example.org/property" input.csv output.rdf - CHECK_RESULT $? 0 0 "csv2rdf命令执行失败" - - # 清理环境 - if [ "$INSTALLED" = false ]; then - LOG_INFO "卸载python3-rdflib" - dnf remove -y python3-rdflib - CHECK_RESULT $? 0 0 "卸载python3-rdflib失败" - fi - - LOG_INFO "测试完成,环境已恢复" - -} - -main "$@" \ No newline at end of file diff --git a/testcases/function_test/pkg_test/python-rdflib/python3-rdflib/test_python3-rdflib_csv2rdf_c.sh b/testcases/function_test/pkg_test/python-rdflib/python3-rdflib/test_python3-rdflib_csv2rdf_c.sh deleted file mode 100644 index 4341792bd56..00000000000 --- a/testcases/function_test/pkg_test/python-rdflib/python3-rdflib/test_python3-rdflib_csv2rdf_c.sh +++ /dev/null @@ -1,66 +0,0 @@ -#!/usr/bin/bash - -# Copyright (c) 2024 ISCAS .ALL rights reserved. -# This program is licensed under Mulan PSL v2. -# You can use it according to the terms and conditions of the Mulan PSL v2. -# http://license.coscl.org.cn/MulanPSL2 -# THIS PROGRAM IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, -# EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, -# MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. -# See the Mulan PSL v2 for more details. - -# ############################################# -# @Author : honghua -# @Contact : honghua@iscas.ac.cn -# @Date : 2025-12-08 -# @License : Mulan PSL v2 -# @Desc : 测试使用 -c 参数指定类名 -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - - LOG_INFO "开始测试:测试使用 -c 参数指定类名" - - # 检查是否已安装python3-rdflib_csv2rdf_c - LOG_INFO "检查python3-rdflib_csv2rdf_c是否已安装" - if dnf list installed python3-rdflib_csv2rdf_c &>/dev/null; then - LOG_INFO "python3-rdflib_csv2rdf_c已安装,测试结束后保持安装状态" - INSTALLED=true - else - LOG_INFO "python3-rdflib_csv2rdf_c未安装,将在测试结束后卸载" - INSTALLED=false - fi - - # 检查yum源中是否有python3-rdflib_csv2rdf_c - LOG_INFO "检查yum源中是否有python3-rdflib_csv2rdf_c" - if ! dnf list available python3-rdflib_csv2rdf_c &>/dev/null; then - LOG_ERROR "yum源中未找到python3-rdflib_csv2rdf_c,退出测试" - exit 255 - fi - - # 安装python3-rdflib_csv2rdf_c - if [ "$INSTALLED" = false ]; then - LOG_INFO "开始安装python3-rdflib_csv2rdf_c" - dnf install -y python3-rdflib_csv2rdf_c - CHECK_RESULT $? 0 0 "安装python3-rdflib_csv2rdf_c失败" - fi - - # 测试-c参数 - LOG_INFO "测试-c参数指定类名" - python3-rdflib_csv2rdf_c -c TestClass - CHECK_RESULT $? 0 0 "-c参数不支持或执行失败" - - # 清理环境 - if [ "$INSTALLED" = false ]; then - LOG_INFO "卸载python3-rdflib_csv2rdf_c" - dnf remove -y python3-rdflib_csv2rdf_c - CHECK_RESULT $? 0 0 "卸载python3-rdflib_csv2rdf_c失败" - fi - - LOG_INFO "测试完成:测试使用 -c 参数指定类名" - -} - -main "$@" \ No newline at end of file diff --git a/testcases/function_test/pkg_test/python-rdflib/python3-rdflib/test_python3-rdflib_csv2rdf_col_num_0.sh b/testcases/function_test/pkg_test/python-rdflib/python3-rdflib/test_python3-rdflib_csv2rdf_col_num_0.sh deleted file mode 100644 index 26a10b6ca36..00000000000 --- a/testcases/function_test/pkg_test/python-rdflib/python3-rdflib/test_python3-rdflib_csv2rdf_col_num_0.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-08 -# @License : Mulan PSL v2 -# @Desc : 测试使用 --col0 参数指定第0列的转换 -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - LOG_INFO "开始测试:测试使用 --col0 参数指定第0列的转换" - - # 检查软件包是否已安装 - LOG_INFO "检查软件包是否已安装" - if dnf list installed python3-rdflib &>/dev/null; then - LOG_INFO "软件包已安装,脚本结束时将保持安装状态" - INSTALLED=true - else - LOG_INFO "软件包未安装,将在测试结束后卸载" - INSTALLED=false - fi - - # 检查yum源中是否有该软件包 - LOG_INFO "检查yum源中是否有python3-rdflib软件包" - if ! dnf list available python3-rdflib &>/dev/null; then - LOG_ERROR "yum源中未找到python3-rdflib软件包" - exit 255 - fi - - # 如果未安装,则安装软件包 - if [ "$INSTALLED" = false ]; then - LOG_INFO "正在安装python3-rdflib软件包" - dnf install -y python3-rdflib - CHECK_RESULT $? 0 0 "安装python3-rdflib失败" - fi - - # 测试--col0参数 - LOG_INFO "测试--col0参数" - if ! csv2rdf --help | grep -q -- "--col0"; then - LOG_ERROR "--col0参数不支持" - exit 255 - fi - - # 执行命令并检查结果 - LOG_INFO "执行csv2rdf命令并检查结果" - csv2rdf --col0 test.csv output.rdf - CHECK_RESULT $? 0 0 "csv2rdf命令执行失败" - - # 清理环境 - if [ "$INSTALLED" = false ]; then - LOG_INFO "卸载python3-rdflib软件包" - dnf remove -y python3-rdflib - CHECK_RESULT $? 0 0 "卸载python3-rdflib失败" - fi - - LOG_INFO "测试完成" -} - -main "$@" \ No newline at end of file diff --git a/testcases/function_test/pkg_test/python-rdflib/python3-rdflib/test_python3-rdflib_csv2rdf_d.sh b/testcases/function_test/pkg_test/python-rdflib/python3-rdflib/test_python3-rdflib_csv2rdf_d.sh deleted file mode 100644 index 3a40002c9bb..00000000000 --- a/testcases/function_test/pkg_test/python-rdflib/python3-rdflib/test_python3-rdflib_csv2rdf_d.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 : 测试使用 -d 参数指定分隔符 -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - - LOG_INFO "开始测试:测试使用 -d 参数指定分隔符" - - # 检查是否已安装python3-rdflib_csv2rdf_d - LOG_INFO "检查是否已安装python3-rdflib_csv2rdf_d" - if ! dnf list installed python3-rdflib_csv2rdf_d &>/dev/null; then - LOG_INFO "python3-rdflib_csv2rdf_d未安装,将进行安装" - installed=false - else - LOG_INFO "python3-rdflib_csv2rdf_d已安装" - installed=true - fi - - # 检查yum源中是否有该软件包 - LOG_INFO "检查yum源中是否有python3-rdflib_csv2rdf_d" - if ! dnf list available python3-rdflib_csv2rdf_d &>/dev/null; then - LOG_ERROR "yum源中未找到python3-rdflib_csv2rdf_d" - exit 255 - fi - - # 如果未安装,则安装软件包 - if [ "$installed" = false ]; then - LOG_INFO "安装python3-rdflib_csv2rdf_d" - dnf install -y python3-rdflib_csv2rdf_d - CHECK_RESULT $? 0 0 "安装python3-rdflib_csv2rdf_d失败" - fi - - # 测试使用-d参数指定分隔符 - LOG_INFO "测试使用-d参数指定分隔符" - python3-rdflib_csv2rdf_d -d "," &>/dev/null - CHECK_RESULT $? 0 0 "-d参数不支持或执行失败" - - # 清理环境 - if [ "$installed" = false ]; then - LOG_INFO "卸载python3-rdflib_csv2rdf_d" - dnf remove -y python3-rdflib_csv2rdf_d - CHECK_RESULT $? 0 0 "卸载python3-rdflib_csv2rdf_d失败" - fi - - LOG_INFO "测试完成:测试使用 -d 参数指定分隔符" - -} - -main "$@" \ No newline at end of file diff --git a/testcases/function_test/pkg_test/python-rdflib/python3-rdflib/test_python3-rdflib_csv2rdf_d_s_o.sh b/testcases/function_test/pkg_test/python-rdflib/python3-rdflib/test_python3-rdflib_csv2rdf_d_s_o.sh deleted file mode 100644 index 3d60a978da1..00000000000 --- a/testcases/function_test/pkg_test/python-rdflib/python3-rdflib/test_python3-rdflib_csv2rdf_d_s_o.sh +++ /dev/null @@ -1,140 +0,0 @@ -#!/usr/bin/bash - -# Copyright (c) 2024 ISCAS .ALL rights reserved. -# This program is licensed under Mulan PSL v2. -# You can use it according to the terms and conditions of the Mulan PSL v2. -# http://license.coscl.org.cn/MulanPSL2 -# THIS PROGRAM IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, -# EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-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-23 -# @License : Mulan PSL v2 -# @Desc : 测试组合使用 -d, -s, -o 参数处理CSV并输出到文件 -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - # 定义日志函数(假设已存在,这里仅声明) - LOG_INFO() { - echo "[INFO] $*" - } - LOG_ERROR() { - echo "[ERROR] $*" - } - - # 定义检查结果函数(假设已存在,这里仅声明) - CHECK_RESULT() { - # 参数:实际结果 期望结果 匹配模式 "失败原因" - # 匹配模式:0表示相等,1表示大于,2表示小于,3表示不等于 - local actual=$1 - local expect=$2 - local mode=$3 - local reason=$4 - case $mode in - 0) if [ "$actual" -eq "$expect" ]; then return 0; else LOG_ERROR "$reason"; return 1; fi ;; - 1) if [ "$actual" -gt "$expect" ]; then return 0; else LOG_ERROR "$reason"; return 1; fi ;; - 2) if [ "$actual" -lt "$expect" ]; then return 0; else LOG_ERROR "$reason"; return 1; fi ;; - 3) if [ "$actual" -ne "$expect" ]; then return 0; else LOG_ERROR "$reason"; return 1; fi ;; - *) LOG_ERROR "CHECK_RESULT: 无效模式 $mode"; return 1 ;; - esac - } - - # 定义SSH命令函数(假设已存在,这里仅声明) - SSH_CMD() { - local cmd=$1 - local ip=$2 - local pass=$3 - local user=$4 - # 实际实现可能使用sshpass或其他方式 - sshpass -p "$pass" ssh -o StrictHostKeyChecking=no "${user}@${ip}" "$cmd" - } - - # 测试脚本开始 - LOG_INFO "开始测试组合使用 -d, -s, -o 参数处理CSV并输出到文件" - - # 步骤1:检查软件包是否在yum源中 - LOG_INFO "步骤1:检查软件包 python3-rdflib 是否在yum源中" - if ! dnf list available python3-rdflib &>/dev/null; then - LOG_ERROR "软件包 python3-rdflib 不在yum源中" - exit 255 - fi - - # 步骤2:检查环境是否已安装软件包 - LOG_INFO "步骤2:检查环境是否已安装软件包 python3-rdflib" - if rpm -q python3-rdflib &>/dev/null; then - LOG_INFO "软件包 python3-rdflib 已安装,标记为已安装状态" - already_installed=true - else - LOG_INFO "软件包 python3-rdflib 未安装,标记为未安装状态" - already_installed=false - fi - - # 步骤3:如果未安装,则安装软件包 - if [ "$already_installed" = false ]; then - LOG_INFO "步骤3:安装软件包 python3-rdflib" - dnf install -y python3-rdflib - CHECK_RESULT $? 0 0 "安装软件包 python3-rdflib 失败" - fi - - # 步骤4:检查 csv2rdf 命令是否支持 -d, -s, -o 参数 - LOG_INFO "步骤4:检查 csv2rdf 命令是否支持 -d, -s, -o 参数" - if ! csv2rdf --help 2>&1 | grep -q -- "-d\|-s\|-o"; then - LOG_ERROR "csv2rdf 命令不支持 -d, -s, -o 参数" - # 如果之前未安装,则卸载软件包 - if [ "$already_installed" = false ]; then - dnf remove -y python3-rdflib - fi - exit 255 - fi - - # 步骤5:准备测试CSV文件 - LOG_INFO "步骤5:准备测试CSV文件" - cat > test_input.csv << EOF - name,age,city - Alice,30,New York - Bob,25,London - EOF - CHECK_RESULT $? 0 0 "创建测试CSV文件失败" - - # 步骤6:执行 csv2rdf 命令使用 -d, -s, -o 参数 - LOG_INFO "步骤6:执行 csv2rdf 命令使用 -d, -s, -o 参数" - csv2rdf -d "," -s "http://example.org/" -o test_output.rdf test_input.csv - CHECK_RESULT $? 0 0 "csv2rdf 命令执行失败" - - # 步骤7:检查输出文件是否存在且非空 - LOG_INFO "步骤7:检查输出文件是否存在且非空" - if [ -s test_output.rdf ]; then - LOG_INFO "输出文件 test_output.rdf 生成成功" - else - LOG_ERROR "输出文件 test_output.rdf 生成失败或为空" - # 清理临时文件 - rm -f test_input.csv test_output.rdf - # 如果之前未安装,则卸载软件包 - if [ "$already_installed" = false ]; then - dnf remove -y python3-rdflib - fi - exit 1 - fi - - # 步骤8:清理临时文件 - LOG_INFO "步骤8:清理临时文件" - rm -f test_input.csv test_output.rdf - CHECK_RESULT $? 0 0 "清理临时文件失败" - - # 步骤9:如果之前未安装,则卸载软件包 - if [ "$already_installed" = false ]; then - LOG_INFO "步骤9:卸载软件包 python3-rdflib" - dnf remove -y python3-rdflib - CHECK_RESULT $? 0 0 "卸载软件包 python3-rdflib 失败" - fi - - LOG_INFO "测试组合使用 -d, -s, -o 参数处理CSV并输出到文件完成" -} - -main "$@" \ No newline at end of file diff --git a/testcases/function_test/pkg_test/python-rdflib/python3-rdflib/test_python3-rdflib_csv2rdf_f.sh b/testcases/function_test/pkg_test/python-rdflib/python3-rdflib/test_python3-rdflib_csv2rdf_f.sh deleted file mode 100644 index 26eba37b4db..00000000000 --- a/testcases/function_test/pkg_test/python-rdflib/python3-rdflib/test_python3-rdflib_csv2rdf_f.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-12-08 -# @License : Mulan PSL v2 -# @Desc : 测试使用 -f 参数读取配置文件 -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - # 测试脚本:test_python3-rdflib_csv2rdf_f - - LOG_INFO "开始测试:使用 -f 参数读取配置文件" - - # 检查软件包是否已安装 - LOG_INFO "检查软件包 python3-rdflib 是否已安装" - if ! dnf list installed python3-rdflib &>/dev/null; then - LOG_INFO "软件包 python3-rdflib 未安装,将进行安装" - # 检查yum源中是否有该软件包 - if ! dnf list available python3-rdflib &>/dev/null; then - LOG_ERROR "yum源中未找到软件包 python3-rdflib" - exit 255 - fi - # 安装软件包 - dnf install -y python3-rdflib - CHECK_RESULT $? 0 0 "安装软件包 python3-rdflib 失败" - # 标记需要卸载 - UNINSTALL_NEEDED=1 - else - LOG_INFO "软件包 python3-rdflib 已安装" - UNINSTALL_NEEDED=0 - fi - - # 测试 -f 参数读取配置文件 - LOG_INFO "测试 -f 参数读取配置文件" - if ! python3 -m rdflib_csv2rdf -h | grep -q -- "-f"; then - LOG_ERROR "参数 -f 不支持" - exit 255 - fi - - # 创建临时配置文件 - LOG_INFO "创建临时配置文件" - cat > /tmp/test_config.conf < /tmp/test_input.csv </dev/null 2>&1 - if [ $? -ne 0 ]; then - LOG_ERROR "yum源中没有找到python3-rdflib软件包" - exit 255 - fi - - # 检查是否已安装python3-rdflib - LOG_INFO "检查python3-rdflib是否已安装" - rpm -q python3-rdflib >/dev/null 2>&1 - INSTALLED=$? - - # 如果未安装,则安装软件包 - if [ $INSTALLED -ne 0 ]; then - LOG_INFO "安装python3-rdflib软件包" - dnf install -y python3-rdflib - CHECK_RESULT $? 0 0 "安装python3-rdflib失败" - fi - - # 检查csv2rdf命令是否存在 - LOG_INFO "检查csv2rdf命令是否存在" - which csv2rdf >/dev/null 2>&1 - if [ $? -ne 0 ]; then - LOG_ERROR "csv2rdf命令不存在" - # 如果是本次安装的,需要卸载 - if [ $INSTALLED -ne 0 ]; then - dnf remove -y python3-rdflib - fi - exit 255 - fi - - # 检查配置文件是否存在 - LOG_INFO "检查配置文件是否存在" - if [ ! -f "$CONFIG_FILE" ]; then - LOG_ERROR "配置文件 $CONFIG_FILE 不存在" - # 如果是本次安装的,需要卸载 - if [ $INSTALLED -ne 0 ]; then - dnf remove -y python3-rdflib - fi - exit 255 - fi - - # 测试csv2rdf命令的-f和-o参数是否支持 - LOG_INFO "测试csv2rdf命令是否支持-f和-o参数" - csv2rdf --help | grep -q "\-f" - CHECK_RESULT $? 0 0 "csv2rdf命令不支持-f参数" - - csv2rdf --help | grep -q "\-o" - CHECK_RESULT $? 0 0 "csv2rdf命令不支持-o参数" - - # 执行csv2rdf命令进行转换 - LOG_INFO "执行csv2rdf命令进行CSV到RDF的转换" - csv2rdf -f "$CONFIG_FILE" -o "$OUTPUT_FILE" - CHECK_RESULT $? 0 0 "csv2rdf命令执行失败" - - # 检查输出文件是否生成 - LOG_INFO "检查输出文件是否生成" - if [ -f "$OUTPUT_FILE" ]; then - LOG_INFO "输出文件 $OUTPUT_FILE 已成功生成" - # 检查文件是否为空 - if [ -s "$OUTPUT_FILE" ]; then - LOG_INFO "输出文件包含有效内容" - else - LOG_ERROR "输出文件为空" - # 如果是本次安装的,需要卸载 - if [ $INSTALLED -ne 0 ]; then - dnf remove -y python3-rdflib - fi - exit 1 - fi - else - LOG_ERROR "输出文件 $OUTPUT_FILE 未生成" - # 如果是本次安装的,需要卸载 - if [ $INSTALLED -ne 0 ]; then - dnf remove -y python3-rdflib - fi - exit 1 - fi - - # 清理环境 - LOG_INFO "清理测试环境" - - # 删除生成的输出文件 - LOG_INFO "删除生成的输出文件" - rm -f "$OUTPUT_FILE" - - # 如果之前未安装,则卸载软件包 - if [ $INSTALLED -ne 0 ]; then - LOG_INFO "卸载python3-rdflib软件包" - dnf remove -y python3-rdflib - CHECK_RESULT $? 0 0 "卸载python3-rdflib失败" - else - LOG_INFO "保持python3-rdflib安装状态" - fi - - LOG_INFO "测试完成" -} - -main "$@" \ No newline at end of file diff --git a/testcases/function_test/pkg_test/python-rdflib/python3-rdflib/test_python3-rdflib_csv2rdf_l.sh b/testcases/function_test/pkg_test/python-rdflib/python3-rdflib/test_python3-rdflib_csv2rdf_l.sh deleted file mode 100644 index 4583963de22..00000000000 --- a/testcases/function_test/pkg_test/python-rdflib/python3-rdflib/test_python3-rdflib_csv2rdf_l.sh +++ /dev/null @@ -1,74 +0,0 @@ -#!/usr/bin/bash - -# Copyright (c) 2024 ISCAS .ALL rights reserved. -# This program is licensed under Mulan PSL v2. -# You can use it according to the terms and conditions of the Mulan PSL v2. -# http://license.coscl.org.cn/MulanPSL2 -# THIS PROGRAM IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, -# EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, -# MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. -# See the Mulan PSL v2 for more details. - -# ############################################# -# @Author : honghua -# @Contact : honghua@iscas.ac.cn -# @Date : 2025-12-08 -# @License : Mulan PSL v2 -# @Desc : 测试使用 -l 参数指定标签列 -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - LOG_INFO "开始测试:测试使用 -l 参数指定标签列" - - # 检查是否已安装python3-rdflib - LOG_INFO "检查是否已安装python3-rdflib" - dnf list installed python3-rdflib > /dev/null 2>&1 - if [ $? -eq 0 ]; then - LOG_INFO "python3-rdflib已安装,脚本结束时将保持安装状态" - INSTALLED=true - else - LOG_INFO "python3-rdflib未安装,将在测试结束后卸载" - INSTALLED=false - fi - - # 检查yum源中是否有python3-rdflib - LOG_INFO "检查yum源中是否有python3-rdflib" - dnf list available python3-rdflib > /dev/null 2>&1 - if [ $? -ne 0 ]; then - LOG_ERROR "yum源中未找到python3-rdflib" - exit 255 - fi - - # 安装python3-rdflib(如果未安装) - if [ "$INSTALLED" = false ]; then - LOG_INFO "正在安装python3-rdflib" - dnf install -y python3-rdflib > /dev/null 2>&1 - CHECK_RESULT $? 0 0 "安装python3-rdflib失败" - fi - - # 测试-l参数 - LOG_INFO "测试-l参数指定标签列" - csv2rdf --help | grep -q "\-l, \-\-label" > /dev/null 2>&1 - if [ $? -ne 0 ]; then - LOG_ERROR "csv2rdf不支持-l参数" - exit 255 - fi - - # 执行测试命令 - LOG_INFO "执行csv2rdf命令并指定-l参数" - csv2rdf -l test_label test.csv > /dev/null 2>&1 - CHECK_RESULT $? 0 0 "csv2rdf命令执行失败" - - # 清理环境(如果之前未安装) - if [ "$INSTALLED" = false ]; then - LOG_INFO "卸载python3-rdflib" - dnf remove -y python3-rdflib > /dev/null 2>&1 - CHECK_RESULT $? 0 0 "卸载python3-rdflib失败" - fi - - LOG_INFO "测试完成" -} - -main "$@" \ No newline at end of file diff --git a/testcases/function_test/pkg_test/python-rdflib/python3-rdflib/test_python3-rdflib_csv2rdf_o.sh b/testcases/function_test/pkg_test/python-rdflib/python3-rdflib/test_python3-rdflib_csv2rdf_o.sh deleted file mode 100644 index 13070d0c4bd..00000000000 --- a/testcases/function_test/pkg_test/python-rdflib/python3-rdflib/test_python3-rdflib_csv2rdf_o.sh +++ /dev/null @@ -1,80 +0,0 @@ -#!/usr/bin/bash - -# Copyright (c) 2024 ISCAS .ALL rights reserved. -# This program is licensed under Mulan PSL v2. -# You can use it according to the terms and conditions of the Mulan PSL v2. -# http://license.coscl.org.cn/MulanPSL2 -# THIS PROGRAM IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, -# EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, -# MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. -# See the Mulan PSL v2 for more details. - -# ############################################# -# @Author : honghua -# @Contact : honghua@iscas.ac.cn -# @Date : 2025-12-08 -# @License : Mulan PSL v2 -# @Desc : 测试使用 -o 参数指定输出文件 -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - - # 检查是否已安装python3-rdflib - LOG_INFO "检查是否已安装python3-rdflib" - dnf list installed python3-rdflib > /dev/null 2>&1 - if [ $? -eq 0 ]; then - LOG_INFO "python3-rdflib已安装,脚本结束时将保持安装状态" - installed=true - else - LOG_INFO "python3-rdflib未安装,将在测试结束后卸载" - installed=false - fi - - # 检查yum源中是否有python3-rdflib - LOG_INFO "检查yum源中是否有python3-rdflib" - dnf list available python3-rdflib > /dev/null 2>&1 - if [ $? -ne 0 ]; then - LOG_ERROR "yum源中未找到python3-rdflib" - exit 255 - fi - - # 安装python3-rdflib(如果未安装) - if [ "$installed" = false ]; then - LOG_INFO "安装python3-rdflib" - dnf install -y python3-rdflib - CHECK_RESULT $? 0 0 "安装python3-rdflib失败" - fi - - # 测试使用-o参数指定输出文件 - LOG_INFO "测试使用-o参数指定输出文件" - output_file="test_output.rdf" - csv2rdf -o "$output_file" > /dev/null 2>&1 - CHECK_RESULT $? 0 0 "csv2rdf命令执行失败" - - # 检查输出文件是否存在 - LOG_INFO "检查输出文件是否存在" - if [ -f "$output_file" ]; then - LOG_INFO "输出文件创建成功" - else - LOG_ERROR "输出文件未创建" - exit 1 - fi - - # 清理输出文件 - LOG_INFO "清理输出文件" - rm -f "$output_file" - - # 卸载python3-rdflib(如果脚本开始时未安装) - if [ "$installed" = false ]; then - LOG_INFO "卸载python3-rdflib" - dnf remove -y python3-rdflib - CHECK_RESULT $? 0 0 "卸载python3-rdflib失败" - fi - - LOG_INFO "测试脚本执行完毕" - -} - -main "$@" \ No newline at end of file diff --git a/testcases/function_test/pkg_test/python-rdflib/python3-rdflib/test_python3-rdflib_csv2rdf_prop_num_0.sh b/testcases/function_test/pkg_test/python-rdflib/python3-rdflib/test_python3-rdflib_csv2rdf_prop_num_0.sh deleted file mode 100644 index c8df6e2d095..00000000000 --- a/testcases/function_test/pkg_test/python-rdflib/python3-rdflib/test_python3-rdflib_csv2rdf_prop_num_0.sh +++ /dev/null @@ -1,59 +0,0 @@ -#!/usr/bin/bash - -# Copyright (c) 2024 ISCAS .ALL rights reserved. -# This program is licensed under Mulan PSL v2. -# You can use it according to the terms and conditions of the Mulan PSL v2. -# http://license.coscl.org.cn/MulanPSL2 -# THIS PROGRAM IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, -# EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, -# MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. -# See the Mulan PSL v2 for more details. - -# ############################################# -# @Author : honghua -# @Contact : honghua@iscas.ac.cn -# @Date : 2025-12-08 -# @License : Mulan PSL v2 -# @Desc : 测试使用 --prop0 参数指定第0列的属性 -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - LOG_INFO "开始测试使用 --prop0 参数指定第0列的属性" - - LOG_INFO "检查环境是否已安装 python3-rdflib 软件包" - if dnf list installed python3-rdflib &>/dev/null; then - LOG_INFO "python3-rdflib 已安装,脚本结束后保持安装状态" - installed=true - else - LOG_INFO "python3-rdflib 未安装,将在测试后卸载" - installed=false - fi - - LOG_INFO "检查 yum 源中是否有 python3-rdflib 软件包" - if ! dnf list available python3-rdflib &>/dev/null; then - LOG_ERROR "yum 源中未找到 python3-rdflib 软件包" - exit 255 - fi - - if [ "$installed" = false ]; then - LOG_INFO "安装 python3-rdflib 软件包" - dnf install -y python3-rdflib - CHECK_RESULT $? 0 0 "安装 python3-rdflib 失败" - fi - - LOG_INFO "执行 csv2rdf 命令并指定 --prop0 参数" - csv2rdf --prop0 test.csv - CHECK_RESULT $? 0 0 "执行 csv2rdf --prop0 test.csv 失败" - - if [ "$installed" = false ]; then - LOG_INFO "卸载 python3-rdflib 软件包" - dnf remove -y python3-rdflib - CHECK_RESULT $? 0 0 "卸载 python3-rdflib 失败" - fi - - LOG_INFO "测试完成,环境已恢复" -} - -main "$@" \ No newline at end of file diff --git a/testcases/function_test/pkg_test/python-rdflib/python3-rdflib/test_python3-rdflib_csv2rdf_prop_num_1.sh b/testcases/function_test/pkg_test/python-rdflib/python3-rdflib/test_python3-rdflib_csv2rdf_prop_num_1.sh deleted file mode 100644 index a2dd8388b00..00000000000 --- a/testcases/function_test/pkg_test/python-rdflib/python3-rdflib/test_python3-rdflib_csv2rdf_prop_num_1.sh +++ /dev/null @@ -1,95 +0,0 @@ -#!/usr/bin/bash - -# Copyright (c) 2024 ISCAS .ALL rights reserved. -# This program is licensed under Mulan PSL v2. -# You can use it according to the terms and conditions of the Mulan PSL v2. -# http://license.coscl.org.cn/MulanPSL2 -# THIS PROGRAM IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, -# EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, -# MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. -# See the Mulan PSL v2 for more details. - -# ############################################# -# @Author : honghua -# @Contact : honghua@iscas.ac.cn -# @Date : 2026-03-23 -# @License : Mulan PSL v2 -# @Desc : 测试使用 --prop1 参数指定第1列使用的属性URI -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - LOG_INFO "开始测试:使用 --prop1 参数指定第1列使用的属性URI" - - LOG_INFO "步骤1: 检查python3-rdflib软件包是否在yum源中" - if ! dnf list python3-rdflib 2>&1 | grep -q "python3-rdflib"; then - LOG_ERROR "python3-rdflib软件包不在yum源中" - exit 255 - fi - - LOG_INFO "步骤2: 检查是否已安装python3-rdflib" - if rpm -q python3-rdflib > /dev/null 2>&1; then - LOG_INFO "python3-rdflib已安装,记录安装状态" - INSTALLED=true - else - LOG_INFO "python3-rdflib未安装" - INSTALLED=false - fi - - if [ "$INSTALLED" = false ]; then - LOG_INFO "步骤3: 安装python3-rdflib软件包" - dnf install -y python3-rdflib - CHECK_RESULT $? 0 0 "安装python3-rdflib失败" - fi - - LOG_INFO "步骤4: 创建测试用的CSV文件" - cat > test.csv << EOF - col1,col2,col3 - value1,value2,value3 - EOF - CHECK_RESULT $? 0 0 "创建CSV文件失败" - - LOG_INFO "步骤5: 执行csv2rdf命令,使用--prop1参数指定属性URI" - csv2rdf --prop1 "http://example.org/property1" test.csv > output.rdf - CHECK_RESULT $? 0 0 "csv2rdf命令执行失败" - - LOG_INFO "步骤6: 检查输出文件是否生成" - if [ -f output.rdf ]; then - LOG_INFO "输出文件已生成" - else - LOG_ERROR "输出文件未生成" - exit 1 - fi - - LOG_INFO "步骤7: 检查输出文件中是否包含指定的属性URI" - if grep -q "http://example.org/property1" output.rdf; then - LOG_INFO "输出文件中包含指定的属性URI" - else - LOG_ERROR "输出文件中未找到指定的属性URI" - exit 1 - fi - - LOG_INFO "步骤8: 测试--prop1参数不支持的情况" - csv2rdf --prop1 2>&1 | grep -q "error" - if [ $? -eq 0 ]; then - LOG_INFO "--prop1参数检查正常" - else - LOG_ERROR "--prop1参数检查异常" - exit 255 - fi - - LOG_INFO "步骤9: 清理测试文件" - rm -f test.csv output.rdf - CHECK_RESULT $? 0 0 "清理测试文件失败" - - if [ "$INSTALLED" = false ]; then - LOG_INFO "步骤10: 卸载python3-rdflib软件包" - dnf remove -y python3-rdflib - CHECK_RESULT $? 0 0 "卸载python3-rdflib失败" - fi - - LOG_INFO "测试完成" -} - -main "$@" \ No newline at end of file diff --git a/testcases/function_test/pkg_test/python-rdflib/python3-rdflib/test_python3-rdflib_csv2rdf_s.sh b/testcases/function_test/pkg_test/python-rdflib/python3-rdflib/test_python3-rdflib_csv2rdf_s.sh deleted file mode 100644 index e4cf8f20f04..00000000000 --- a/testcases/function_test/pkg_test/python-rdflib/python3-rdflib/test_python3-rdflib_csv2rdf_s.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 : 2025-12-08 -# @License : Mulan PSL v2 -# @Desc : 测试使用 -s 参数跳过指定行数 -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - - # 测试脚本:test_python3-rdflib_csv2rdf_s - # 测试用例描述:测试使用 -s 参数跳过指定行数 - - LOG_INFO "开始测试:测试使用 -s 参数跳过指定行数" - - # 检查是否已安装python3-rdflib - LOG_INFO "检查是否已安装python3-rdflib" - dnf list installed python3-rdflib > /dev/null 2>&1 - if [ $? -eq 0 ]; then - LOG_INFO "python3-rdflib已安装,脚本结束时将保持安装状态" - installed=true - else - LOG_INFO "python3-rdflib未安装,将在测试完成后卸载" - installed=false - fi - - # 检查yum源中是否有python3-rdflib - LOG_INFO "检查yum源中是否有python3-rdflib" - dnf list available python3-rdflib > /dev/null 2>&1 - if [ $? -ne 0 ]; then - LOG_ERROR "yum源中未找到python3-rdflib软件包" - exit 255 - fi - - # 安装python3-rdflib(如果未安装) - if [ "$installed" = false ]; then - LOG_INFO "安装python3-rdflib" - dnf install -y python3-rdflib - CHECK_RESULT $? 0 0 "安装python3-rdflib失败" - fi - - # 检查csv2rdf命令是否支持-s参数 - LOG_INFO "检查csv2rdf命令是否支持-s参数" - csv2rdf --help | grep -q -- "-s" - if [ $? -ne 0 ]; then - LOG_ERROR "csv2rdf命令不支持-s参数" - exit 255 - fi - - # 执行测试:使用-s参数跳过指定行数 - LOG_INFO "执行测试:使用-s参数跳过指定行数" - csv2rdf -s 2 test.csv > output.rdf - CHECK_RESULT $? 0 0 "csv2rdf命令执行失败" - - # 清理环境(如果之前未安装) - if [ "$installed" = false ]; then - LOG_INFO "卸载python3-rdflib" - dnf remove -y python3-rdflib - CHECK_RESULT $? 0 0 "卸载python3-rdflib失败" - fi - - LOG_INFO "测试完成:测试使用 -s 参数跳过指定行数" - -} - -main "$@" \ No newline at end of file diff --git a/testcases/function_test/pkg_test/python-rdflib/python3-rdflib/test_python3-rdflib_csv2rdf_upper_c.sh b/testcases/function_test/pkg_test/python-rdflib/python3-rdflib/test_python3-rdflib_csv2rdf_upper_c.sh deleted file mode 100644 index 340c43c1a0d..00000000000 --- a/testcases/function_test/pkg_test/python-rdflib/python3-rdflib/test_python3-rdflib_csv2rdf_upper_c.sh +++ /dev/null @@ -1,66 +0,0 @@ -#!/usr/bin/bash - -# Copyright (c) 2024 ISCAS .ALL rights reserved. -# This program is licensed under Mulan PSL v2. -# You can use it according to the terms and conditions of the Mulan PSL v2. -# http://license.coscl.org.cn/MulanPSL2 -# THIS PROGRAM IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, -# EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, -# MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. -# See the Mulan PSL v2 for more details. - -# ############################################# -# @Author : honghua -# @Contact : honghua@iscas.ac.cn -# @Date : 2025-12-08 -# @License : Mulan PSL v2 -# @Desc : 测试使用 -C 参数定义类为 rdfs:Class -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - LOG_INFO "开始测试使用 -C 参数定义类为 rdfs:Class" - - # 检查软件包是否已安装 - LOG_INFO "检查软件包是否已安装" - if ! dnf list installed python3-rdflib &>/dev/null; then - LOG_INFO "软件包未安装,准备安装" - # 检查yum源中是否有该软件包 - if ! dnf list available python3-rdflib &>/dev/null; then - LOG_ERROR "yum源中未找到python3-rdflib软件包" - exit 255 - fi - # 安装软件包 - dnf install -y python3-rdflib - CHECK_RESULT $? 0 0 "安装python3-rdflib失败" - # 标记需要卸载 - NEED_UNINSTALL=1 - else - LOG_INFO "软件包已安装,无需操作" - NEED_UNINSTALL=0 - fi - - # 测试使用 -C 参数定义类为 rdfs:Class - LOG_INFO "测试使用 -C 参数定义类为 rdfs:Class" - # 检查命令参数是否支持 - if ! csv2rdf --help | grep -q "\-C"; then - LOG_ERROR "csv2rdf命令不支持-C参数" - exit 255 - fi - - # 执行命令 - csv2rdf -C rdfs:Class test.csv > output.rdf - CHECK_RESULT $? 0 0 "执行csv2rdf命令失败" - - # 清理环境 - if [ $NEED_UNINSTALL -eq 1 ]; then - LOG_INFO "清理环境,卸载软件包" - dnf remove -y python3-rdflib - CHECK_RESULT $? 0 0 "卸载python3-rdflib失败" - fi - - LOG_INFO "测试完成" -} - -main "$@" \ No newline at end of file diff --git a/testcases/function_test/pkg_test/python-rdflib/python3-rdflib/test_python3-rdflib_csv2rdf_upper_d.sh b/testcases/function_test/pkg_test/python-rdflib/python3-rdflib/test_python3-rdflib_csv2rdf_upper_d.sh deleted file mode 100644 index fc8fda56e12..00000000000 --- a/testcases/function_test/pkg_test/python-rdflib/python3-rdflib/test_python3-rdflib_csv2rdf_upper_d.sh +++ /dev/null @@ -1,68 +0,0 @@ -#!/usr/bin/bash - -# Copyright (c) 2024 ISCAS .ALL rights reserved. -# This program is licensed under Mulan PSL v2. -# You can use it according to the terms and conditions of the Mulan PSL v2. -# http://license.coscl.org.cn/MulanPSL2 -# THIS PROGRAM IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, -# EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, -# MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. -# See the Mulan PSL v2 for more details. - -# ############################################# -# @Author : honghua -# @Contact : honghua@iscas.ac.cn -# @Date : 2025-12-08 -# @License : Mulan PSL v2 -# @Desc : 测试使用 -D 参数设置默认列转换 -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - - # 检查软件包是否已安装 - LOG_INFO "检查python3-rdflib是否已安装" - if rpm -q python3-rdflib >/dev/null 2>&1; then - LOG_INFO "python3-rdflib已安装,跳过安装步骤" - INSTALLED=true - else - LOG_INFO "python3-rdflib未安装,将进行安装" - INSTALLED=false - fi - - # 检查yum源中是否有python3-rdflib软件包 - LOG_INFO "检查yum源中是否有python3-rdflib软件包" - if ! dnf list available python3-rdflib >/dev/null 2>&1; then - LOG_ERROR "yum源中未找到python3-rdflib软件包" - exit 255 - fi - - # 如果未安装,则安装软件包 - if [ "$INSTALLED" = false ]; then - LOG_INFO "开始安装python3-rdflib" - dnf install -y python3-rdflib - CHECK_RESULT $? 0 0 "安装python3-rdflib失败" - fi - - # 测试使用-D参数设置默认列转换 - LOG_INFO "测试使用-D参数设置默认列转换" - csv2rdf --help | grep -q "\-D, \-\-default\-column" - CHECK_RESULT $? 0 0 "-D参数不支持" - - LOG_INFO "执行csv2rdf命令测试-D参数" - csv2rdf -D test_column test_input.csv test_output.rdf - CHECK_RESULT $? 0 0 "csv2rdf命令执行失败" - - # 清理环境:如果脚本开始时未安装,则卸载软件包 - if [ "$INSTALLED" = false ]; then - LOG_INFO "卸载python3-rdflib" - dnf remove -y python3-rdflib - CHECK_RESULT $? 0 0 "卸载python3-rdflib失败" - fi - - LOG_INFO "测试脚本执行完毕" - -} - -main "$@" \ No newline at end of file diff --git a/testcases/function_test/pkg_test/python-rdflib/python3-rdflib/test_python3-rdflib_function_parse.sh b/testcases/function_test/pkg_test/python-rdflib/python3-rdflib/test_python3-rdflib_function_parse.sh deleted file mode 100644 index f7b880ecd14..00000000000 --- a/testcases/function_test/pkg_test/python-rdflib/python3-rdflib/test_python3-rdflib_function_parse.sh +++ /dev/null @@ -1,78 +0,0 @@ -#!/usr/bin/bash - -# Copyright (c) 2024 ISCAS .ALL rights reserved. -# This program is licensed under Mulan PSL v2. -# You can use it according to the terms and conditions of the Mulan PSL v2. -# http://license.coscl.org.cn/MulanPSL2 -# THIS PROGRAM IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, -# EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, -# MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. -# See the Mulan PSL v2 for more details. - -# ############################################# -# @Author : honghua -# @Contact : honghua@iscas.ac.cn -# @Date : 2025-12-08 -# @License : Mulan PSL v2 -# @Desc : 测试解析RDF文档的功能 -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - # 测试解析RDF文档的功能 - - LOG_INFO "检查是否已安装python3-rdflib软件包" - if dnf list installed python3-rdflib &>/dev/null; then - LOG_INFO "python3-rdflib已安装,跳过安装步骤" - installed=true - else - LOG_INFO "python3-rdflib未安装,准备安装" - installed=false - fi - - LOG_INFO "检查yum源中是否存在python3-rdflib软件包" - if ! dnf list available python3-rdflib &>/dev/null; then - LOG_ERROR "yum源中未找到python3-rdflib软件包" - exit 255 - fi - - if [ "$installed" = false ]; then - LOG_INFO "开始安装python3-rdflib软件包" - dnf install -y python3-rdflib - CHECK_RESULT $? 0 0 "安装python3-rdflib失败" - fi - - LOG_INFO "测试解析RDF文档的功能" - cat < test.rdf - - - - Example - - - EOF - - python3 -c " - from rdflib import Graph - g = Graph() - g.parse("test.rdf", format="xml") - print("解析成功") - " > output.txt 2>&1 - CHECK_RESULT $? 0 0 "解析RDF文档失败" - - LOG_INFO "检查解析结果" - grep -q "解析成功" output.txt - CHECK_RESULT $? 0 0 "解析结果不符合预期" - - LOG_INFO "清理临时文件" - rm -f test.rdf output.txt - - if [ "$installed" = false ]; then - LOG_INFO "卸载python3-rdflib软件包" - dnf remove -y python3-rdflib - CHECK_RESULT $? 0 0 "卸载python3-rdflib失败" - fi -} - -main "$@" \ No newline at end of file diff --git a/testcases/function_test/pkg_test/python-rdflib/python3-rdflib/test_python3-rdflib_graph_basic.sh b/testcases/function_test/pkg_test/python-rdflib/python3-rdflib/test_python3-rdflib_graph_basic.sh deleted file mode 100644 index adbf6e53398..00000000000 --- a/testcases/function_test/pkg_test/python-rdflib/python3-rdflib/test_python3-rdflib_graph_basic.sh +++ /dev/null @@ -1,107 +0,0 @@ -#!/usr/bin/bash - -# Copyright (c) 2024 ISCAS .ALL rights reserved. -# This program is licensed under Mulan PSL v2. -# You can use it according to the terms and conditions of the Mulan PSL v2. -# http://license.coscl.org.cn/MulanPSL2 -# THIS PROGRAM IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, -# EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-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-23 -# @License : Mulan PSL v2 -# @Desc : 测试图创建与三元组操作 -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - LOG_INFO "开始测试:测试图创建与三元组操作" - LOG_INFO "步骤1:检查环境中是否已安装python3-rdflib软件包" - if rpm -q python3-rdflib &> /dev/null; then - LOG_INFO "python3-rdflib已安装,测试完成后将保持安装状态" - INSTALLED=true - else - LOG_INFO "python3-rdflib未安装,将在测试过程中安装并在测试完成后卸载" - INSTALLED=false - fi - - LOG_INFO "步骤2:检查yum源中是否存在python3-rdflib软件包" - if ! dnf list available python3-rdflib &> /dev/null; then - LOG_ERROR "yum源中未找到python3-rdflib软件包" - exit 255 - fi - - LOG_INFO "步骤3:安装python3-rdflib软件包(如果未安装)" - if [ "$INSTALLED" = false ]; then - dnf install -y python3-rdflib - CHECK_RESULT $? 0 0 "安装python3-rdflib失败" - fi - - LOG_INFO "步骤4:验证python3-rdflib的基本功能" - python3 -c " - from rdflib import Graph, URIRef, Literal, Namespace - from rdflib.namespace import RDF, FOAF - - g = Graph() - ns = Namespace("http://example.org/") - - # 创建三元组 - subject = ns.Person1 - predicate = FOAF.name - object = Literal("John Doe") - - g.add((subject, predicate, object)) - - # 验证三元组数量 - print("图中共有", len(g), "个三元组") - - # 查询三元组 - for s, p, o in g: - print(s, p, o) - " - CHECK_RESULT $? 0 0 "python3-rdflib基本功能验证失败" - - LOG_INFO "步骤5:测试图序列化与反序列化" - python3 -c " - from rdflib import Graph, URIRef, Literal, Namespace - from rdflib.namespace import RDF, FOAF - - g1 = Graph() - ns = Namespace("http://example.org/") - - # 添加三元组 - g1.add((ns.Person1, FOAF.name, Literal("Alice"))) - g1.add((ns.Person2, FOAF.name, Literal("Bob"))) - - # 序列化为Turtle格式 - turtle_data = g1.serialize(format="turtle") - print("序列化数据:", turtle_data) - - # 反序列化 - g2 = Graph() - g2.parse(data=turtle_data, format="turtle") - print("反序列化后三元组数量:", len(g2)) - - # 验证数据一致性 - assert len(g1) == len(g2), "数据不一致" - " - CHECK_RESULT $? 0 0 "图序列化与反序列化测试失败" - - LOG_INFO "步骤6:清理测试环境" - if [ "$INSTALLED" = false ]; then - LOG_INFO "卸载python3-rdflib软件包" - dnf remove -y python3-rdflib - CHECK_RESULT $? 0 0 "卸载python3-rdflib失败" - else - LOG_INFO "保持python3-rdflib软件包安装状态" - fi - - LOG_INFO "测试完成:测试图创建与三元组操作" -} - -main "$@" \ No newline at end of file diff --git a/testcases/function_test/pkg_test/python-rdflib/python3-rdflib/test_python3-rdflib_import.sh b/testcases/function_test/pkg_test/python-rdflib/python3-rdflib/test_python3-rdflib_import.sh deleted file mode 100644 index e8f1ae6d6ae..00000000000 --- a/testcases/function_test/pkg_test/python-rdflib/python3-rdflib/test_python3-rdflib_import.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-23 -# @License : Mulan PSL v2 -# @Desc : 测试导入核心模块 -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - # 检查是否已安装python3-rdflib - LOG_INFO "检查是否已安装python3-rdflib" - rpm -q python3-rdflib > /dev/null 2>&1 - if [ $? -eq 0 ]; then - LOG_INFO "python3-rdflib已安装,记录当前状态" - already_installed=true - else - LOG_INFO "python3-rdflib未安装,将在测试中安装" - already_installed=false - fi - - # 检查yum源中是否有python3-rdflib软件包 - LOG_INFO "检查yum源中是否有python3-rdflib软件包" - dnf list available python3-rdflib > /dev/null 2>&1 - CHECK_RESULT $? 0 0 "yum源中未找到python3-rdflib软件包" - if [ $? -ne 0 ]; then - LOG_ERROR "yum源中未找到python3-rdflib软件包" - exit 255 - fi - - # 如果未安装,则安装python3-rdflib - if [ "$already_installed" = false ]; then - LOG_INFO "安装python3-rdflib" - dnf install -y python3-rdflib - CHECK_RESULT $? 0 0 "安装python3-rdflib失败" - fi - - # 测试导入rdflib核心模块 - LOG_INFO "测试导入rdflib核心模块" - python3 -c "import rdflib; print(rdflib.__version__)" > /dev/null 2>&1 - CHECK_RESULT $? 0 0 "导入rdflib核心模块失败" - - # 测试导入rdflib子模块 - LOG_INFO "测试导入rdflib子模块" - python3 -c "from rdflib import Graph; print(Graph)" > /dev/null 2>&1 - CHECK_RESULT $? 0 0 "导入rdflib子模块失败" - - # 测试导入rdflib更多子模块 - LOG_INFO "测试导入rdflib更多子模块" - python3 -c "from rdflib import URIRef, Literal, BNode; print(URIRef, Literal, BNode)" > /dev/null 2>&1 - CHECK_RESULT $? 0 0 "导入rdflib更多子模块失败" - - # 环境恢复:如果测试前未安装,则卸载python3-rdflib - if [ "$already_installed" = false ]; then - LOG_INFO "卸载python3-rdflib" - dnf remove -y python3-rdflib - CHECK_RESULT $? 0 0 "卸载python3-rdflib失败" - else - LOG_INFO "测试前已安装python3-rdflib,保持安装状态" - fi - - LOG_INFO "测试完成" -} - -main "$@" \ No newline at end of file diff --git a/testcases/function_test/pkg_test/python-rdflib/python3-rdflib/test_python3-rdflib_install.sh b/testcases/function_test/pkg_test/python-rdflib/python3-rdflib/test_python3-rdflib_install.sh deleted file mode 100644 index 3b3468f1fe8..00000000000 --- a/testcases/function_test/pkg_test/python-rdflib/python3-rdflib/test_python3-rdflib_install.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-23 -# @License : Mulan PSL v2 -# @Desc : 测试软件包安装 -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - set -e - - LOG_INFO "开始测试python3-rdflib软件包安装" - - # 步骤1:检查当前环境是否已安装python3-rdflib - LOG_INFO "步骤1:检查当前环境是否已安装python3-rdflib" - if dnf list installed python3-rdflib &> /dev/null; then - LOG_INFO "python3-rdflib已安装,测试结束后保持安装状态" - already_installed=true - else - LOG_INFO "python3-rdflib未安装,将在测试过程中安装" - already_installed=false - fi - - # 步骤2:检查yum源中是否有python3-rdflib软件包 - LOG_INFO "步骤2:检查yum源中是否有python3-rdflib软件包" - if ! dnf list available python3-rdflib &> /dev/null; then - LOG_ERROR "yum源中未找到python3-rdflib软件包" - exit 255 - fi - LOG_INFO "yum源中存在python3-rdflib软件包" - - # 步骤3:安装python3-rdflib软件包(如果未安装) - if [ "$already_installed" = false ]; then - LOG_INFO "步骤3:安装python3-rdflib软件包" - dnf install -y python3-rdflib - CHECK_RESULT $? 0 0 "安装python3-rdflib失败" - LOG_INFO "python3-rdflib安装成功" - fi - - # 步骤4:验证python3-rdflib安装 - LOG_INFO "步骤4:验证python3-rdflib安装" - if dnf list installed python3-rdflib &> /dev/null; then - LOG_INFO "python3-rdflib验证安装成功" - else - LOG_ERROR "python3-rdflib验证安装失败" - exit 1 - fi - - # 步骤5:执行简单的功能测试(例如检查版本或导入模块) - LOG_INFO "步骤5:执行简单的功能测试" - python3 -c "import rdflib; print("rdflib version:", rdflib.__version__)" &> /dev/null - CHECK_RESULT $? 0 0 "python3-rdflib功能测试失败" - LOG_INFO "python3-rdflib功能测试成功" - - # 步骤6:清理环境(如果测试前未安装,则卸载软件包) - if [ "$already_installed" = false ]; then - LOG_INFO "步骤6:卸载python3-rdflib软件包" - dnf remove -y python3-rdflib - CHECK_RESULT $? 0 0 "卸载python3-rdflib失败" - LOG_INFO "python3-rdflib卸载成功" - else - LOG_INFO "步骤6:测试前已安装python3-rdflib,保持安装状态,无需卸载" - fi - - LOG_INFO "python3-rdflib软件包安装测试完成" -} - -main "$@" \ No newline at end of file diff --git a/testcases/function_test/pkg_test/python-rdflib/python3-rdflib/test_python3-rdflib_namespace.sh b/testcases/function_test/pkg_test/python-rdflib/python3-rdflib/test_python3-rdflib_namespace.sh deleted file mode 100644 index 442f2947d4b..00000000000 --- a/testcases/function_test/pkg_test/python-rdflib/python3-rdflib/test_python3-rdflib_namespace.sh +++ /dev/null @@ -1,103 +0,0 @@ -#!/usr/bin/bash - -# Copyright (c) 2024 ISCAS .ALL rights reserved. -# This program is licensed under Mulan PSL v2. -# You can use it according to the terms and conditions of the Mulan PSL v2. -# http://license.coscl.org.cn/MulanPSL2 -# THIS PROGRAM IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, -# EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, -# MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. -# See the Mulan PSL v2 for more details. - -# ############################################# -# @Author : honghua -# @Contact : honghua@iscas.ac.cn -# @Date : 2026-03-23 -# @License : Mulan PSL v2 -# @Desc : 测试命名空间绑定与使用 -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - # 检查是否已经安装python3-rdflib - LOG_INFO "检查是否已安装python3-rdflib" - if rpm -q python3-rdflib &> /dev/null; then - LOG_INFO "python3-rdflib已经安装,脚本结束后将保持安装状态" - INSTALLED=1 - else - LOG_INFO "python3-rdflib未安装,将在测试过程中安装" - INSTALLED=0 - fi - - # 检查yum源中是否有python3-rdflib软件包 - LOG_INFO "检查yum源中是否有python3-rdflib软件包" - if ! dnf list available python3-rdflib &> /dev/null; then - LOG_ERROR "yum源中未找到python3-rdflib软件包" - exit 255 - fi - - # 如果未安装,则安装软件包 - if [ $INSTALLED -eq 0 ]; then - LOG_INFO "安装python3-rdflib软件包" - dnf install -y python3-rdflib - CHECK_RESULT $? 0 0 "安装python3-rdflib失败" - fi - - # 测试命名空间绑定与使用 - LOG_INFO "测试命名空间绑定与使用" - - # 创建一个Python脚本来测试rdflib的命名空间功能 - cat > test_namespace.py << "EOF" - from rdflib import Graph, Namespace - from rdflib.namespace import RDF, RDFS - - # 创建图 - g = Graph() - - # 定义自定义命名空间 - EX = Namespace("http://example.org/") - - # 绑定命名空间前缀 - g.bind("ex", EX) - g.bind("rdf", RDF) - g.bind("rdfs", RDFS) - - # 添加三元组 - g.add((EX.subject, RDF.type, RDFS.Class)) - g.add((EX.subject, RDFS.label, EX.Object)) - - # 序列化并打印 - print(g.serialize(format="turtle")) - EOF - - # 执行Python脚本 - LOG_INFO "执行Python脚本测试命名空间绑定" - python3 test_namespace.py > output.txt 2>&1 - CHECK_RESULT $? 0 0 "执行Python脚本失败" - - # 检查输出是否包含预期的命名空间前缀 - LOG_INFO "检查输出是否包含预期的命名空间前缀" - if grep -q "@prefix ex:" output.txt && grep -q "@prefix rdf:" output.txt && grep -q "@prefix rdfs:" output.txt; then - LOG_INFO "命名空间绑定测试成功" - else - LOG_ERROR "命名空间绑定测试失败,输出中未找到预期的命名空间前缀" - cat output.txt - exit 1 - fi - - # 清理临时文件 - LOG_INFO "清理临时文件" - rm -f test_namespace.py output.txt - - # 如果测试开始时未安装,则在测试结束后卸载软件包 - if [ $INSTALLED -eq 0 ]; then - LOG_INFO "卸载python3-rdflib软件包" - dnf remove -y python3-rdflib - CHECK_RESULT $? 0 0 "卸载python3-rdflib失败" - fi - - LOG_INFO "测试脚本执行完毕" -} - -main "$@" \ No newline at end of file diff --git a/testcases/function_test/pkg_test/python-rdflib/python3-rdflib/test_python3-rdflib_parse_serialize.sh b/testcases/function_test/pkg_test/python-rdflib/python3-rdflib/test_python3-rdflib_parse_serialize.sh deleted file mode 100644 index 166360c18e4..00000000000 --- a/testcases/function_test/pkg_test/python-rdflib/python3-rdflib/test_python3-rdflib_parse_serialize.sh +++ /dev/null @@ -1,100 +0,0 @@ -#!/usr/bin/bash - -# Copyright (c) 2024 ISCAS .ALL rights reserved. -# This program is licensed under Mulan PSL v2. -# You can use it according to the terms and conditions of the Mulan PSL v2. -# http://license.coscl.org.cn/MulanPSL2 -# THIS PROGRAM IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, -# EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-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-23 -# @License : Mulan PSL v2 -# @Desc : 测试解析和序列化RDF -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - set -e - - LOG_INFO "开始测试:测试解析和序列化RDF" - - LOG_INFO "步骤1:检查是否已安装python3-rdflib" - if dnf list installed python3-rdflib > /dev/null 2>&1; then - LOG_INFO "python3-rdflib 已安装,测试结束后将保持安装状态" - already_installed=1 - else - LOG_INFO "python3-rdflib 未安装,将在测试步骤中安装" - already_installed=0 - fi - - LOG_INFO "步骤2:检查yum源中是否存在python3-rdflib软件包" - if ! dnf list available python3-rdflib > /dev/null 2>&1; then - LOG_ERROR "yum源中未找到python3-rdflib软件包" - exit 255 - fi - - if [[ ${already_installed} -eq 0 ]]; then - LOG_INFO "步骤3:安装python3-rdflib软件包" - dnf install -y python3-rdflib - CHECK_RESULT $? 0 0 "安装python3-rdflib失败" - fi - - LOG_INFO "步骤4:验证python3-rdflib基本功能" - python3 -c "import rdflib; print("rdflib version:", rdflib.__version__)" > /tmp/rdflib_test.log 2>&1 - CHECK_RESULT $? 0 0 "导入rdflib模块失败" - - LOG_INFO "步骤5:测试RDF解析和序列化" - cat > /tmp/test_rdf.ttl << "EOF" - @prefix ex: . - @prefix rdf: . - @prefix rdfs: . - - ex:Book1 rdf:type ex:Book ; - rdfs:label "Test Book" ; - ex:author ex:Author1 . - EOF - - python3 > /tmp/parse_serialize.log 2>&1 << "PYTHON_SCRIPT" - import rdflib - g = rdflib.Graph() - try: - g.parse("/tmp/test_rdf.ttl", format="turtle") - print("解析成功") - print("序列化结果:") - print(g.serialize(format="turtle").decode()) - except Exception as e: - print(f"解析或序列化失败: {e}") - exit(1) - PYTHON_SCRIPT - - CHECK_RESULT $? 0 0 "RDF解析或序列化测试失败" - - LOG_INFO "步骤6:检查解析序列化结果" - if grep -q "解析成功" /tmp/parse_serialize.log && grep -q "ex:Book1" /tmp/parse_serialize.log; then - LOG_INFO "RDF解析和序列化功能正常" - else - LOG_ERROR "RDF解析和序列化结果异常" - exit 1 - fi - - LOG_INFO "步骤7:清理临时文件" - rm -f /tmp/test_rdf.ttl /tmp/rdflib_test.log /tmp/parse_serialize.log - - if [[ ${already_installed} -eq 0 ]]; then - LOG_INFO "步骤8:卸载测试安装的python3-rdflib软件包" - dnf remove -y python3-rdflib - CHECK_RESULT $? 0 0 "卸载python3-rdflib失败" - else - LOG_INFO "测试前已安装python3-rdflib,保持安装状态" - fi - - LOG_INFO "测试完成:RDF解析和序列化功能测试通过" -} - -main "$@" \ No newline at end of file diff --git a/testcases/function_test/pkg_test/python-rdflib/python3-rdflib/test_python3-rdflib_pipe_format.sh b/testcases/function_test/pkg_test/python-rdflib/python3-rdflib/test_python3-rdflib_pipe_format.sh deleted file mode 100644 index 204db37c63e..00000000000 --- a/testcases/function_test/pkg_test/python-rdflib/python3-rdflib/test_python3-rdflib_pipe_format.sh +++ /dev/null @@ -1,109 +0,0 @@ -#!/usr/bin/bash - -# Copyright (c) 2024 ISCAS .ALL rights reserved. -# This program is licensed under Mulan PSL v2. -# You can use it according to the terms and conditions of the Mulan PSL v2. -# http://license.coscl.org.cn/MulanPSL2 -# THIS PROGRAM IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, -# EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, -# MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. -# See the Mulan PSL v2 for more details. - -# ############################################# -# @Author : honghua -# @Contact : honghua@iscas.ac.cn -# @Date : 2026-03-23 -# @License : Mulan PSL v2 -# @Desc : 测试RDF格式转换管道 -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - # 判断环境是否已安装python3-rdflib - LOG_INFO "检查python3-rdflib是否已安装" - if rpm -q python3-rdflib > /dev/null 2>&1; then - LOG_INFO "python3-rdflib已安装,脚本结束后保持安装状态" - ENV_INSTALLED=true - else - LOG_INFO "python3-rdflib未安装,将在测试结束后卸载" - ENV_INSTALLED=false - fi - - # 检查yum源中是否有python3-rdflib软件包 - LOG_INFO "检查yum源中是否有python3-rdflib软件包" - if ! dnf list available python3-rdflib > /dev/null 2>&1; then - LOG_ERROR "yum源中未找到python3-rdflib软件包" - exit 255 - fi - - # 如果未安装,则安装python3-rdflib - if [ "$ENV_INSTALLED" = false ]; then - LOG_INFO "开始安装python3-rdflib" - dnf install -y python3-rdflib - CHECK_RESULT $? 0 0 "安装python3-rdflib失败" - fi - - # 测试RDF格式转换管道 - LOG_INFO "测试RDF格式转换管道" - - # 检查是否支持指定命令参数 - LOG_INFO "检查rdflib是否支持管道格式转换" - if ! python3 -c "import rdflib; print(rdflib.__version__)" > /dev/null 2>&1; then - LOG_ERROR "rdflib不支持管道格式转换或参数不正确" - exit 255 - fi - - # 创建测试RDF文件 - LOG_INFO "创建测试RDF文件" - cat > test_input.ttl << EOF - @prefix dc: . - @prefix ex: . - - ex:book1 dc:title "RDF Tutorial" . - ex:book1 dc:creator "John Doe" . - EOF - - # 执行RDF格式转换 - LOG_INFO "执行RDF格式转换:Turtle -> JSON-LD" - python3 -c " - import rdflib - g = rdflib.Graph() - g.parse("test_input.ttl", format="turtle") - result = g.serialize(format="json-ld", indent=2) - print(result) - " > test_output.json - CHECK_RESULT $? 0 0 "RDF格式转换失败" - - # 验证转换结果 - LOG_INFO "验证转换结果" - if [ -s test_output.json ]; then - LOG_INFO "RDF格式转换成功,生成了JSON-LD文件" - # 检查JSON-LD文件是否包含预期内容 - if grep -q "RDF Tutorial" test_output.json && grep -q "John Doe" test_output.json; then - LOG_INFO "转换结果包含预期内容" - else - LOG_ERROR "转换结果不包含预期内容" - CHECK_RESULT 1 0 1 "转换结果验证失败" - fi - else - LOG_ERROR "未生成有效的JSON-LD文件" - CHECK_RESULT 1 0 1 "转换结果文件为空" - fi - - # 清理测试文件 - LOG_INFO "清理测试文件" - rm -f test_input.ttl test_output.json - CHECK_RESULT $? 0 0 "清理测试文件失败" - - # 如果测试前未安装,则卸载python3-rdflib - if [ "$ENV_INSTALLED" = false ]; then - LOG_INFO "卸载python3-rdflib" - dnf remove -y python3-rdflib - CHECK_RESULT $? 0 0 "卸载python3-rdflib失败" - fi - - LOG_INFO "RDF格式转换管道测试完成" -} - -main "$@" \ No newline at end of file diff --git a/testcases/function_test/pkg_test/python-rdflib/python3-rdflib/test_python3-rdflib_rdf2dot_f.sh b/testcases/function_test/pkg_test/python-rdflib/python3-rdflib/test_python3-rdflib_rdf2dot_f.sh deleted file mode 100644 index 1820bd4e90c..00000000000 --- a/testcases/function_test/pkg_test/python-rdflib/python3-rdflib/test_python3-rdflib_rdf2dot_f.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-08 -# @License : Mulan PSL v2 -# @Desc : 测试 rdf2dot 命令的 -f 参数 -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - - # 检查yum源中是否存在python3-rdflib软件包 - LOG_INFO "检查yum源中是否存在python3-rdflib软件包" - dnf list available python3-rdflib > /dev/null 2>&1 - if [ $? -ne 0 ]; then - LOG_ERROR "yum源中不存在python3-rdflib软件包" - exit 255 - fi - - # 检查是否已安装python3-rdflib - LOG_INFO "检查是否已安装python3-rdflib" - rpm -q python3-rdflib > /dev/null 2>&1 - if [ $? -eq 0 ]; then - installed=true - LOG_INFO "python3-rdflib已安装" - else - installed=false - LOG_INFO "python3-rdflib未安装,将进行安装" - fi - - # 如果未安装,则安装python3-rdflib - if [ "$installed" = false ]; then - LOG_INFO "安装python3-rdflib" - dnf install -y python3-rdflib - CHECK_RESULT $? 0 0 "安装python3-rdflib失败" - fi - - # 测试rdf2dot命令的-f参数 - LOG_INFO "测试rdf2dot命令的-f参数" - rdf2dot -f > /dev/null 2>&1 - if [ $? -eq 255 ]; then - LOG_ERROR "rdf2dot命令不支持-f参数" - exit 255 - fi - - # 清理环境 - if [ "$installed" = false ]; then - LOG_INFO "卸载python3-rdflib" - dnf remove -y python3-rdflib - CHECK_RESULT $? 0 0 "卸载python3-rdflib失败" - fi - - LOG_INFO "测试完成,环境已恢复" - -} - -main "$@" \ No newline at end of file diff --git a/testcases/function_test/pkg_test/python-rdflib/python3-rdflib/test_python3-rdflib_rdf2dot_f_o.sh b/testcases/function_test/pkg_test/python-rdflib/python3-rdflib/test_python3-rdflib_rdf2dot_f_o.sh deleted file mode 100644 index 256f6a46afa..00000000000 --- a/testcases/function_test/pkg_test/python-rdflib/python3-rdflib/test_python3-rdflib_rdf2dot_f_o.sh +++ /dev/null @@ -1,112 +0,0 @@ -#!/usr/bin/bash - -# Copyright (c) 2024 ISCAS .ALL rights reserved. -# This program is licensed under Mulan PSL v2. -# You can use it according to the terms and conditions of the Mulan PSL v2. -# http://license.coscl.org.cn/MulanPSL2 -# THIS PROGRAM IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, -# EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-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-23 -# @License : Mulan PSL v2 -# @Desc : 测试rdf2dot命令同时使用-f和-o参数,指定格式并输出到文件 -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - # 检查是否已安装python3-rdflib - LOG_INFO "检查是否已安装python3-rdflib" - rpm -q python3-rdflib > /dev/null 2>&1 - if [ $? -eq 0 ]; then - LOG_INFO "python3-rdflib已安装,标记为已存在安装状态" - INSTALLED=1 - else - LOG_INFO "python3-rdflib未安装,标记为未安装状态" - INSTALLED=0 - fi - - # 检查yum源中是否有python3-rdflib软件包 - LOG_INFO "检查yum源中是否有python3-rdflib软件包" - dnf list available python3-rdflib > /dev/null 2>&1 - if [ $? -ne 0 ]; then - LOG_ERROR "yum源中未找到python3-rdflib软件包" - exit 255 - fi - - # 如果未安装,则安装python3-rdflib - if [ $INSTALLED -eq 0 ]; then - LOG_INFO "开始安装python3-rdflib软件包" - dnf install -y python3-rdflib - CHECK_RESULT $? 0 0 "安装python3-rdflib失败" - LOG_INFO "python3-rdflib安装成功" - fi - - # 检查rdf2dot命令是否支持-f和-o参数 - LOG_INFO "检查rdf2dot命令是否支持-f和-o参数" - rdf2dot --help 2>&1 | grep -q "\-f" - if [ $? -ne 0 ]; then - LOG_ERROR "rdf2dot命令不支持-f参数" - exit 255 - fi - rdf2dot --help 2>&1 | grep -q "\-o" - if [ $? -ne 0 ]; then - LOG_ERROR "rdf2dot命令不支持-o参数" - exit 255 - fi - - # 创建测试用的RDF文件 - LOG_INFO "创建测试用的RDF文件" - cat > test_input.rdf << EOF - - - - Test Document - Test Author - - - EOF - CHECK_RESULT $? 0 0 "创建RDF测试文件失败" - - # 执行rdf2dot命令,同时使用-f和-o参数 - LOG_INFO "执行rdf2dot命令,使用-f参数指定xml格式,-o参数输出到文件" - rdf2dot -f xml -o test_output.dot test_input.rdf - CHECK_RESULT $? 0 0 "rdf2dot命令执行失败" - - # 检查输出文件是否生成 - LOG_INFO "检查输出文件是否生成" - if [ -f test_output.dot ]; then - LOG_INFO "输出文件test_output.dot生成成功" - # 检查输出文件内容是否包含graph关键字 - grep -q "digraph" test_output.dot - CHECK_RESULT $? 0 0 "输出文件内容不符合dot格式" - else - LOG_ERROR "输出文件test_output.dot未生成" - exit 1 - fi - - # 清理测试文件 - LOG_INFO "清理测试文件" - rm -f test_input.rdf test_output.dot - CHECK_RESULT $? 0 0 "清理测试文件失败" - - # 如果测试前未安装,则在测试结束后卸载软件包 - if [ $INSTALLED -eq 0 ]; then - LOG_INFO "测试前未安装python3-rdflib,开始卸载" - dnf remove -y python3-rdflib - CHECK_RESULT $? 0 0 "卸载python3-rdflib失败" - LOG_INFO "python3-rdflib卸载成功" - else - LOG_INFO "测试前已安装python3-rdflib,保持安装状态" - fi - - LOG_INFO "测试完成" -} - -main "$@" \ No newline at end of file diff --git a/testcases/function_test/pkg_test/python-rdflib/python3-rdflib/test_python3-rdflib_rdf2dot_h.sh b/testcases/function_test/pkg_test/python-rdflib/python3-rdflib/test_python3-rdflib_rdf2dot_h.sh deleted file mode 100644 index 4963e1760e9..00000000000 --- a/testcases/function_test/pkg_test/python-rdflib/python3-rdflib/test_python3-rdflib_rdf2dot_h.sh +++ /dev/null @@ -1,59 +0,0 @@ -#!/usr/bin/bash - -# Copyright (c) 2024 ISCAS .ALL rights reserved. -# This program is licensed under Mulan PSL v2. -# You can use it according to the terms and conditions of the Mulan PSL v2. -# http://license.coscl.org.cn/MulanPSL2 -# THIS PROGRAM IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, -# EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, -# MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. -# See the Mulan PSL v2 for more details. - -# ############################################# -# @Author : honghua -# @Contact : honghua@iscas.ac.cn -# @Date : 2025-12-08 -# @License : Mulan PSL v2 -# @Desc : 测试 rdf2dot 命令的 -h 参数 -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - - # 检查是否已安装python3-rdflib包 - LOG_INFO "检查是否已安装python3-rdflib包" - if ! dnf list installed python3-rdflib &>/dev/null; then - LOG_INFO "python3-rdflib未安装,将进行安装" - # 检查yum源中是否有python3-rdflib包 - if ! dnf list available python3-rdflib &>/dev/null; then - LOG_ERROR "yum源中未找到python3-rdflib包" - exit 255 - fi - # 安装python3-rdflib包 - dnf install -y python3-rdflib - CHECK_RESULT $? 0 0 "安装python3-rdflib包失败" - # 标记需要卸载 - UNINSTALL_FLAG=1 - else - LOG_INFO "python3-rdflib已安装,无需重复安装" - UNINSTALL_FLAG=0 - fi - - # 测试rdf2dot命令的-h参数 - LOG_INFO "测试rdf2dot命令的-h参数" - rdf2dot -h &>/dev/null - CHECK_RESULT $? 0 0 "rdf2dot命令不支持-h参数" - - # 清理环境 - if [ $UNINSTALL_FLAG -eq 1 ]; then - LOG_INFO "卸载python3-rdflib包" - dnf remove -y python3-rdflib - CHECK_RESULT $? 0 0 "卸载python3-rdflib包失败" - fi - - LOG_INFO "测试脚本执行完毕" - -} - -main "$@" \ No newline at end of file diff --git a/testcases/function_test/pkg_test/python-rdflib/python3-rdflib/test_python3-rdflib_rdf2dot_o.sh b/testcases/function_test/pkg_test/python-rdflib/python3-rdflib/test_python3-rdflib_rdf2dot_o.sh deleted file mode 100644 index e2255f8e11d..00000000000 --- a/testcases/function_test/pkg_test/python-rdflib/python3-rdflib/test_python3-rdflib_rdf2dot_o.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-12-08 -# @License : Mulan PSL v2 -# @Desc : 测试 rdf2dot 命令的 -o 参数 -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - - LOG_INFO "开始测试 rdf2dot 命令的 -o 参数" - - # 检查是否已安装 python3-rdflib - if ! dnf list installed python3-rdflib &>/dev/null; then - LOG_INFO "环境未安装 python3-rdflib,将进行安装" - # 检查 yum 源中是否有该软件包 - if ! dnf list available python3-rdflib &>/dev/null; then - LOG_ERROR "yum 源中未找到 python3-rdflib 软件包" - exit 255 - fi - # 安装软件包 - dnf install -y python3-rdflib - CHECK_RESULT $? 0 0 "安装 python3-rdflib 失败" - # 标记为需要卸载 - NEED_UNINSTALL=1 - else - LOG_INFO "环境已安装 python3-rdflib,无需安装" - NEED_UNINSTALL=0 - fi - - # 测试 rdf2dot -o 参数 - LOG_INFO "测试 rdf2dot -o 参数功能" - TEST_FILE="test.rdf" - OUTPUT_FILE="output.dot" - - # 创建测试文件(示例内容) - echo "@prefix ex: . ex:subject ex:predicate ex:object ." > $TEST_FILE - - # 执行 rdf2dot -o 命令 - rdf2dot $TEST_FILE -o $OUTPUT_FILE - CHECK_RESULT $? 0 0 "rdf2dot -o 参数执行失败" - - # 检查输出文件是否存在且非空 - if [ ! -s "$OUTPUT_FILE" ]; then - LOG_ERROR "输出文件未生成或为空" - exit 1 - fi - - LOG_INFO "rdf2dot -o 参数测试通过" - - # 清理测试文件 - rm -f $TEST_FILE $OUTPUT_FILE - - # 恢复环境 - if [ "$NEED_UNINSTALL" -eq 1 ]; then - LOG_INFO "卸载 python3-rdflib" - dnf remove -y python3-rdflib - CHECK_RESULT $? 0 0 "卸载 python3-rdflib 失败" - fi - - LOG_INFO "测试完成,环境已恢复" -} - -main "$@" \ No newline at end of file diff --git a/testcases/function_test/pkg_test/python-rdflib/python3-rdflib/test_python3-rdflib_rdfgraphisomorphism_format.sh b/testcases/function_test/pkg_test/python-rdflib/python3-rdflib/test_python3-rdflib_rdfgraphisomorphism_format.sh deleted file mode 100644 index 822a2900c1b..00000000000 --- a/testcases/function_test/pkg_test/python-rdflib/python3-rdflib/test_python3-rdflib_rdfgraphisomorphism_format.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 : 2025-12-08 -# @License : Mulan PSL v2 -# @Desc : 测试指定RDF文档格式的功能,默认格式为xml -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - - LOG_INFO "开始测试RDF文档格式功能,默认格式为xml" - - # 检查软件包是否已安装 - if ! dnf list installed python3-rdflib &>/dev/null; then - LOG_INFO "环境未安装python3-rdflib,将进行安装" - # 检查yum源中是否有该软件包 - if ! dnf list available python3-rdflib &>/dev/null; then - LOG_ERROR "yum源中未找到python3-rdflib软件包" - exit 255 - fi - # 安装软件包 - dnf install -y python3-rdflib - CHECK_RESULT $? 0 0 "安装python3-rdflib失败" - # 标记需要卸载 - UNINSTALL_NEEDED=1 - else - LOG_INFO "环境已安装python3-rdflib,无需重复安装" - fi - - # 测试RDF文档格式功能 - LOG_INFO "测试RDF文档格式功能,默认格式为xml" - python3 -c " - from rdflib import Graph - - g = Graph() - try: - g.parse(data="", format="xml") - print("RDF文档格式功能测试通过") - except Exception as e: - print(f"RDF文档格式功能测试失败: {e}") - exit(1) - " > /tmp/rdf_test_result.txt - CHECK_RESULT $? 0 0 "RDF文档格式功能测试失败" - - # 检查测试结果 - if grep -q "RDF文档格式功能测试通过" /tmp/rdf_test_result.txt; then - LOG_INFO "RDF文档格式功能测试通过" - else - LOG_ERROR "RDF文档格式功能测试失败" - cat /tmp/rdf_test_result.txt - exit 1 - fi - - # 清理临时文件 - rm -f /tmp/rdf_test_result.txt - - # 如果之前安装了软件包,则卸载以恢复环境 - if [ "$UNINSTALL_NEEDED" == "1" ]; then - LOG_INFO "卸载python3-rdflib以恢复环境" - dnf remove -y python3-rdflib &>/dev/null - fi - - LOG_INFO "测试完成,环境已恢复" -} - -main "$@" \ No newline at end of file diff --git a/testcases/function_test/pkg_test/python-rdflib/python3-rdflib/test_python3-rdflib_rdfgraphisomorphism_format_n3.sh b/testcases/function_test/pkg_test/python-rdflib/python3-rdflib/test_python3-rdflib_rdfgraphisomorphism_format_n3.sh deleted file mode 100644 index 60816271c38..00000000000 --- a/testcases/function_test/pkg_test/python-rdflib/python3-rdflib/test_python3-rdflib_rdfgraphisomorphism_format_n3.sh +++ /dev/null @@ -1,102 +0,0 @@ -#!/usr/bin/bash - -# Copyright (c) 2024 ISCAS .ALL rights reserved. -# This program is licensed under Mulan PSL v2. -# You can use it according to the terms and conditions of the Mulan PSL v2. -# http://license.coscl.org.cn/MulanPSL2 -# THIS PROGRAM IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, -# EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, -# MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. -# See the Mulan PSL v2 for more details. - -# ############################################# -# @Author : honghua -# @Contact : honghua@iscas.ac.cn -# @Date : 2026-03-23 -# @License : Mulan PSL v2 -# @Desc : 测试 rdfgraphisomorphism 命令的 --format=n3 参数,验证能否正确比较 N3 格式的 RDF 文件 -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - # 检查是否已经安装python3-rdflib - LOG_INFO "检查python3-rdflib是否已安装" - rpm -q python3-rdflib > /dev/null 2>&1 - if [ $? -eq 0 ]; then - LOG_INFO "python3-rdflib已安装,脚本结束后保持安装状态" - already_installed=1 - else - LOG_INFO "python3-rdflib未安装,将在测试过程中安装" - already_installed=0 - fi - - # 检查yum源中是否有python3-rdflib软件包 - LOG_INFO "检查yum源中是否有python3-rdflib软件包" - dnf list available python3-rdflib > /dev/null 2>&1 - CHECK_RESULT $? 0 0 "yum源中没有python3-rdflib软件包" - if [ $? -ne 0 ]; then - LOG_ERROR "yum源中没有python3-rdflib软件包" - exit 255 - fi - - # 如果未安装,则安装python3-rdflib - if [ $already_installed -eq 0 ]; then - LOG_INFO "安装python3-rdflib软件包" - dnf install -y python3-rdflib > /dev/null 2>&1 - CHECK_RESULT $? 0 0 "安装python3-rdflib失败" - fi - - # 创建测试用的N3格式RDF文件 - LOG_INFO "创建测试用的N3格式RDF文件" - cat > test1.n3 << EOF - @prefix ex: . - ex:subject1 ex:predicate1 ex:object1 . - EOF - - cat > test2.n3 << EOF - @prefix ex: . - ex:subject1 ex:predicate1 ex:object1 . - EOF - - # 测试rdfgraphisomorphism命令的--format=n3参数 - LOG_INFO "测试rdfgraphisomorphism命令的--format=n3参数" - rdfgraphisomorphism --format=n3 test1.n3 test2.n3 > /dev/null 2>&1 - CHECK_RESULT $? 0 0 "rdfgraphisomorphism命令的--format=n3参数测试失败" - - # 测试不支持的参数 - LOG_INFO "测试rdfgraphisomorphism命令的不支持参数" - rdfgraphisomorphism --format=unsupported test1.n3 test2.n3 > /dev/null 2>&1 - if [ $? -eq 255 ]; then - LOG_INFO "不支持参数测试通过,命令返回255" - else - LOG_ERROR "不支持参数测试失败" - exit 255 - fi - - # 测试不存在的文件 - LOG_INFO "测试rdfgraphisomorphism命令处理不存在文件" - rdfgraphisomorphism --format=n3 nonexistent.n3 test2.n3 > /dev/null 2>&1 - if [ $? -ne 0 ]; then - LOG_INFO "处理不存在文件测试通过" - else - LOG_ERROR "处理不存在文件测试失败" - fi - - # 清理测试文件 - LOG_INFO "清理测试文件" - rm -f test1.n3 test2.n3 - - # 如果脚本开始前未安装,则卸载python3-rdflib - if [ $already_installed -eq 0 ]; then - LOG_INFO "卸载python3-rdflib软件包" - dnf remove -y python3-rdflib > /dev/null 2>&1 - CHECK_RESULT $? 0 0 "卸载python3-rdflib失败" - else - LOG_INFO "保持python3-rdflib安装状态" - fi - - LOG_INFO "测试完成" -} - -main "$@" \ No newline at end of file diff --git a/testcases/function_test/pkg_test/python-rdflib/python3-rdflib/test_python3-rdflib_rdfgraphisomorphism_format_nt.sh b/testcases/function_test/pkg_test/python-rdflib/python3-rdflib/test_python3-rdflib_rdfgraphisomorphism_format_nt.sh deleted file mode 100644 index 45db50cafdf..00000000000 --- a/testcases/function_test/pkg_test/python-rdflib/python3-rdflib/test_python3-rdflib_rdfgraphisomorphism_format_nt.sh +++ /dev/null @@ -1,113 +0,0 @@ -#!/usr/bin/bash - -# Copyright (c) 2024 ISCAS .ALL rights reserved. -# This program is licensed under Mulan PSL v2. -# You can use it according to the terms and conditions of the Mulan PSL v2. -# http://license.coscl.org.cn/MulanPSL2 -# THIS PROGRAM IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, -# EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-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-23 -# @License : Mulan PSL v2 -# @Desc : 测试 rdfgraphisomorphism 命令的 --format=nt 参数,验证能否正确比较 NTriples 格式的 RDF 文件 -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - # 定义日志函数 - LOG_INFO() { - echo "[INFO] $*" - } - - LOG_ERROR() { - echo "[ERROR] $*" >&2 - } - - # 定义常量 - PACKAGE_NAME="python3-rdflib" - COMMAND="rdfgraphisomorphism" - PARAMETER="--format=nt" - - # 步骤1: 检查软件包是否在yum源中 - LOG_INFO "步骤1: 检查软件包 $PACKAGE_NAME 是否在yum源中" - dnf list available $PACKAGE_NAME &>/dev/null - if [ $? -ne 0 ]; 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 - LOG_INFO "步骤3: 安装软件包 $PACKAGE_NAME" - dnf install -y $PACKAGE_NAME - CHECK_RESULT $? 0 0 "安装软件包 $PACKAGE_NAME 失败" - fi - - # 步骤4: 检查命令是否存在 - LOG_INFO "步骤4: 检查命令 $COMMAND 是否存在" - command -v $COMMAND &>/dev/null - CHECK_RESULT $? 0 0 "命令 $COMMAND 不存在" - - # 步骤5: 检查命令是否支持 --format=nt 参数 - LOG_INFO "步骤5: 检查命令 $COMMAND 是否支持 $PARAMETER 参数" - $COMMAND --help 2>&1 | grep -q "format" - if [ $? -ne 0 ]; then - LOG_ERROR "命令 $COMMAND 不支持 $PARAMETER 参数" - # 如果未安装,则卸载软件包 - if [ "$INSTALLED" = "false" ]; then - LOG_INFO "清理环境: 卸载软件包 $PACKAGE_NAME" - dnf remove -y $PACKAGE_NAME - fi - exit 255 - fi - - # 步骤6: 创建测试用的NTriples格式RDF文件 - LOG_INFO "步骤6: 创建测试用的NTriples格式RDF文件" - cat > test1.nt << EOF - "object1" . - "object2" . - EOF - - cat > test2.nt << EOF - "object1" . - "object2" . - EOF - - # 步骤7: 执行rdfgraphisomorphism命令比较两个NTriples文件 - LOG_INFO "步骤7: 执行 $COMMAND 命令比较两个NTriples文件" - $COMMAND $PARAMETER test1.nt test2.nt - CHECK_RESULT $? 0 0 "比较NTriples格式的RDF文件失败" - - # 步骤8: 清理测试文件 - LOG_INFO "步骤8: 清理测试文件" - rm -f test1.nt test2.nt - - # 步骤9: 如果测试前未安装,则卸载软件包 - if [ "$INSTALLED" = "false" ]; then - LOG_INFO "步骤9: 卸载软件包 $PACKAGE_NAME" - dnf remove -y $PACKAGE_NAME - CHECK_RESULT $? 0 0 "卸载软件包 $PACKAGE_NAME 失败" - else - LOG_INFO "步骤9: 保持软件包 $PACKAGE_NAME 的安装状态" - fi - - LOG_INFO "测试完成" -} - -main "$@" \ No newline at end of file diff --git a/testcases/function_test/pkg_test/python-rdflib/python3-rdflib/test_python3-rdflib_rdfgraphisomorphism_format_xml.sh b/testcases/function_test/pkg_test/python-rdflib/python3-rdflib/test_python3-rdflib_rdfgraphisomorphism_format_xml.sh deleted file mode 100644 index 78e1ce59c62..00000000000 --- a/testcases/function_test/pkg_test/python-rdflib/python3-rdflib/test_python3-rdflib_rdfgraphisomorphism_format_xml.sh +++ /dev/null @@ -1,89 +0,0 @@ -#!/usr/bin/bash - -# Copyright (c) 2024 ISCAS .ALL rights reserved. -# This program is licensed under Mulan PSL v2. -# You can use it according to the terms and conditions of the Mulan PSL v2. -# http://license.coscl.org.cn/MulanPSL2 -# THIS PROGRAM IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, -# EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, -# MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. -# See the Mulan PSL v2 for more details. - -# ############################################# -# @Author : honghua -# @Contact : honghua@iscas.ac.cn -# @Date : 2026-03-23 -# @License : Mulan PSL v2 -# @Desc : 测试 rdfgraphisomorphism 命令的 --format=xml 参数,验证能否正确比较 XML 格式的 RDF 文件 -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - LOG_INFO "开始测试 rdfgraphisomorphism 命令的 --format=xml 参数" - - LOG_INFO "步骤1:检查系统中是否已安装 python3-rdflib 软件包" - if dnf list installed python3-rdflib &> /dev/null; then - LOG_INFO "python3-rdflib 已安装,将在测试后保持安装状态" - INSTALLED_BEFORE_TEST=true - else - LOG_INFO "python3-rdflib 未安装,将在测试后卸载" - INSTALLED_BEFORE_TEST=false - fi - - LOG_INFO "步骤2:检查 yum 源中是否存在 python3-rdflib 软件包" - if ! dnf list available python3-rdflib &> /dev/null; then - LOG_ERROR "yum 源中未找到 python3-rdflib 软件包" - exit 255 - fi - - if [ "$INSTALLED_BEFORE_TEST" = false ]; then - LOG_INFO "步骤3:安装 python3-rdflib 软件包" - dnf install -y python3-rdflib - CHECK_RESULT $? 0 0 "安装 python3-rdflib 失败" - fi - - LOG_INFO "步骤4:检查 rdfgraphisomorphism 命令是否支持 --format=xml 参数" - if ! rdfgraphisomorphism --help 2>&1 | grep -q "\-\-format"; then - LOG_ERROR "rdfgraphisomorphism 命令不支持 --format 参数" - exit 255 - fi - - LOG_INFO "步骤5:创建测试用的 XML 格式 RDF 文件" - cat > test1.xml << "EOF" - - - - - - - EOF - - cat > test2.xml << "EOF" - - - - - - - EOF - - LOG_INFO "步骤6:执行 rdfgraphisomorphism --format=xml 命令比较两个 XML 文件" - rdfgraphisomorphism --format=xml test1.xml test2.xml - CHECK_RESULT $? 0 0 "rdfgraphisomorphism --format=xml 执行失败" - - LOG_INFO "步骤7:清理测试文件" - rm -f test1.xml test2.xml - - if [ "$INSTALLED_BEFORE_TEST" = false ]; then - LOG_INFO "步骤8:卸载测试安装的 python3-rdflib 软件包" - dnf remove -y python3-rdflib - CHECK_RESULT $? 0 0 "卸载 python3-rdflib 失败" - fi - - LOG_INFO "测试完成" -} - -main "$@" \ No newline at end of file diff --git a/testcases/function_test/pkg_test/python-rdflib/python3-rdflib/test_python3-rdflib_rdfgraphisomorphism_h.sh b/testcases/function_test/pkg_test/python-rdflib/python3-rdflib/test_python3-rdflib_rdfgraphisomorphism_h.sh deleted file mode 100644 index 7506375a7dc..00000000000 --- a/testcases/function_test/pkg_test/python-rdflib/python3-rdflib/test_python3-rdflib_rdfgraphisomorphism_h.sh +++ /dev/null @@ -1,62 +0,0 @@ -#!/usr/bin/bash - -# Copyright (c) 2024 ISCAS .ALL rights reserved. -# This program is licensed under Mulan PSL v2. -# You can use it according to the terms and conditions of the Mulan PSL v2. -# http://license.coscl.org.cn/MulanPSL2 -# THIS PROGRAM IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, -# EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, -# MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. -# See the Mulan PSL v2 for more details. - -# ############################################# -# @Author : honghua -# @Contact : honghua@iscas.ac.cn -# @Date : 2025-12-08 -# @License : Mulan PSL v2 -# @Desc : 测试帮助文档显示功能 -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - LOG_INFO "开始测试帮助文档显示功能" - - # 检查是否已安装python3-rdflib_rdfgraphisomorphism_h - if dnf list installed python3-rdflib_rdfgraphisomorphism_h &>/dev/null; then - LOG_INFO "python3-rdflib_rdfgraphisomorphism_h 已安装" - installed=true - else - LOG_INFO "python3-rdflib_rdfgraphisomorphism_h 未安装" - installed=false - fi - - # 检查yum源中是否有该软件包 - if ! dnf list available python3-rdflib_rdfgraphisomorphism_h &>/dev/null; then - LOG_ERROR "yum源中未找到 python3-rdflib_rdfgraphisomorphism_h" - exit 255 - fi - - # 如果未安装,则安装软件包 - if [ "$installed" = false ]; then - LOG_INFO "开始安装 python3-rdflib_rdfgraphisomorphism_h" - dnf install -y python3-rdflib_rdfgraphisomorphism_h - CHECK_RESULT $? 0 0 "安装 python3-rdflib_rdfgraphisomorphism_h 失败" - fi - - # 测试帮助文档显示功能 - LOG_INFO "测试帮助文档显示功能" - rdfgraphisomorphism-h --help &>/dev/null - CHECK_RESULT $? 0 0 "帮助文档显示功能测试失败" - - # 清理环境,恢复到之前的状态 - if [ "$installed" = false ]; then - LOG_INFO "卸载 python3-rdflib_rdfgraphisomorphism_h" - dnf remove -y python3-rdflib_rdfgraphisomorphism_h - CHECK_RESULT $? 0 0 "卸载 python3-rdflib_rdfgraphisomorphism_h 失败" - fi - - LOG_INFO "测试帮助文档显示功能完成" -} - -main "$@" \ No newline at end of file diff --git a/testcases/function_test/pkg_test/python-rdflib/python3-rdflib/test_python3-rdflib_rdfgraphisomorphism_help.sh b/testcases/function_test/pkg_test/python-rdflib/python3-rdflib/test_python3-rdflib_rdfgraphisomorphism_help.sh deleted file mode 100644 index 60b3656b75a..00000000000 --- a/testcases/function_test/pkg_test/python-rdflib/python3-rdflib/test_python3-rdflib_rdfgraphisomorphism_help.sh +++ /dev/null @@ -1,89 +0,0 @@ -#!/usr/bin/bash - -# Copyright (c) 2024 ISCAS .ALL rights reserved. -# This program is licensed under Mulan PSL v2. -# You can use it according to the terms and conditions of the Mulan PSL v2. -# http://license.coscl.org.cn/MulanPSL2 -# THIS PROGRAM IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, -# EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, -# MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. -# See the Mulan PSL v2 for more details. - -# ############################################# -# @Author : honghua -# @Contact : honghua@iscas.ac.cn -# @Date : 2026-03-23 -# @License : Mulan PSL v2 -# @Desc : 测试 rdfgraphisomorphism 命令的 --help 参数,验证帮助信息是否正确显示 -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - LOG_INFO "开始测试 rdfgraphisomorphism 命令的 --help 参数" - LOG_INFO "步骤1:检查系统中是否已安装 python3-rdflib 软件包" - if rpm -q python3-rdflib &>/dev/null; then - LOG_INFO "python3-rdflib 已安装,记录安装状态" - INSTALLED="true" - else - LOG_INFO "python3-rdflib 未安装" - INSTALLED="false" - fi - - LOG_INFO "步骤2:检查 yum 源中是否有 python3-rdflib 软件包" - if ! dnf list available python3-rdflib &>/dev/null; then - LOG_ERROR "yum 源中未找到 python3-rdflib 软件包" - exit 255 - fi - - if [ "$INSTALLED" = "false" ]; then - LOG_INFO "步骤3:安装 python3-rdflib 软件包" - dnf install -y python3-rdflib - CHECK_RESULT $? 0 0 "安装 python3-rdflib 失败" - fi - - LOG_INFO "步骤4:检查 rdfgraphisomorphism 命令是否存在" - if ! command -v rdfgraphisomorphism &>/dev/null; then - LOG_ERROR "rdfgraphisomorphism 命令不存在" - if [ "$INSTALLED" = "false" ]; then - LOG_INFO "清理环境:卸载 python3-rdflib 软件包" - dnf remove -y python3-rdflib - fi - exit 255 - fi - - LOG_INFO "步骤5:检查 rdfgraphisomorphism 命令是否支持 --help 参数" - if ! rdfgraphisomorphism --help &>/dev/null; then - LOG_ERROR "rdfgraphisomorphism 命令不支持 --help 参数" - if [ "$INSTALLED" = "false" ]; then - LOG_INFO "清理环境:卸载 python3-rdflib 软件包" - dnf remove -y python3-rdflib - fi - exit 255 - fi - - LOG_INFO "步骤6:执行 rdfgraphisomorphism --help 命令" - rdfgraphisomorphism --help - CHECK_RESULT $? 0 0 "执行 rdfgraphisomorphism --help 命令失败" - - LOG_INFO "步骤7:验证帮助信息是否正确显示" - if rdfgraphisomorphism --help 2>&1 | grep -q "usage:"; then - LOG_INFO "帮助信息显示正确" - else - LOG_ERROR "帮助信息显示不正确" - CHECK_RESULT 1 0 0 "帮助信息验证失败" - fi - - LOG_INFO "步骤8:环境恢复" - if [ "$INSTALLED" = "false" ]; then - LOG_INFO "卸载 python3-rdflib 软件包" - dnf remove -y python3-rdflib - CHECK_RESULT $? 0 0 "卸载 python3-rdflib 失败" - else - LOG_INFO "保持 python3-rdflib 安装状态" - fi - - LOG_INFO "测试完成" -} - -main "$@" \ No newline at end of file diff --git a/testcases/function_test/pkg_test/python-rdflib/python3-rdflib/test_python3-rdflib_rdfgraphisomorphism_s.sh b/testcases/function_test/pkg_test/python-rdflib/python3-rdflib/test_python3-rdflib_rdfgraphisomorphism_s.sh deleted file mode 100644 index 98ddfd1d0df..00000000000 --- a/testcases/function_test/pkg_test/python-rdflib/python3-rdflib/test_python3-rdflib_rdfgraphisomorphism_s.sh +++ /dev/null @@ -1,61 +0,0 @@ -#!/usr/bin/bash - -# Copyright (c) 2024 ISCAS .ALL rights reserved. -# This program is licensed under Mulan PSL v2. -# You can use it according to the terms and conditions of the Mulan PSL v2. -# http://license.coscl.org.cn/MulanPSL2 -# THIS PROGRAM IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, -# EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, -# MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. -# See the Mulan PSL v2 for more details. - -# ############################################# -# @Author : honghua -# @Contact : honghua@iscas.ac.cn -# @Date : 2025-12-08 -# @License : Mulan PSL v2 -# @Desc : 测试从STDIN加载数据的功能 -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - - # 测试从STDIN加载数据的功能 - LOG_INFO "开始测试从STDIN加载数据的功能" - - # 检查软件包是否已安装 - LOG_INFO "检查python3-rdflib-rdfgraphisomorphism-s是否已安装" - if ! dnf list installed python3-rdflib-rdfgraphisomorphism-s &>/dev/null; then - LOG_INFO "软件包未安装,准备安装" - # 检查yum源中是否有该软件包 - if ! dnf list available python3-rdflib-rdfgraphisomorphism-s &>/dev/null; then - LOG_ERROR "yum源中未找到python3-rdflib-rdfgraphisomorphism-s软件包" - exit 255 - fi - # 安装软件包 - dnf install -y python3-rdflib-rdfgraphisomorphism-s - CHECK_RESULT $? 0 0 "安装python3-rdflib-rdfgraphisomorphism-s失败" - # 标记需要卸载 - NEED_UNINSTALL=1 - else - LOG_INFO "软件包已安装,无需重复安装" - fi - - # 测试从STDIN加载数据的功能 - LOG_INFO "测试从STDIN加载数据的功能" - echo " ." | python3 -m rdflib.rdfgraphisomorphism_s - CHECK_RESULT $? 0 0 "从STDIN加载数据失败" - - # 清理环境 - if [ "$NEED_UNINSTALL" -eq 1 ]; then - LOG_INFO "卸载python3-rdflib-rdfgraphisomorphism-s" - dnf remove -y python3-rdflib-rdfgraphisomorphism-s - CHECK_RESULT $? 0 0 "卸载python3-rdflib-rdfgraphisomorphism-s失败" - fi - - LOG_INFO "测试从STDIN加载数据的功能完成" - -} - -main "$@" \ No newline at end of file diff --git a/testcases/function_test/pkg_test/python-rdflib/python3-rdflib/test_python3-rdflib_rdfgraphisomorphism_stdin.sh b/testcases/function_test/pkg_test/python-rdflib/python3-rdflib/test_python3-rdflib_rdfgraphisomorphism_stdin.sh deleted file mode 100644 index f19fc64cf0c..00000000000 --- a/testcases/function_test/pkg_test/python-rdflib/python3-rdflib/test_python3-rdflib_rdfgraphisomorphism_stdin.sh +++ /dev/null @@ -1,89 +0,0 @@ -#!/usr/bin/bash - -# Copyright (c) 2024 ISCAS .ALL rights reserved. -# This program is licensed under Mulan PSL v2. -# You can use it according to the terms and conditions of the Mulan PSL v2. -# http://license.coscl.org.cn/MulanPSL2 -# THIS PROGRAM IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, -# EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, -# MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. -# See the Mulan PSL v2 for more details. - -# ############################################# -# @Author : honghua -# @Contact : honghua@iscas.ac.cn -# @Date : 2026-03-23 -# @License : Mulan PSL v2 -# @Desc : 测试 rdfgraphisomorphism 命令的 --stdin 参数,验证是否可以从标准输入加载数据 -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - # 定义软件包名称 - PACKAGE_NAME="python3-rdflib" - COMMAND_NAME="rdfgraphisomorphism" - - # 检查软件包是否在yum源中 - LOG_INFO "检查软件包 $PACKAGE_NAME 是否在yum源中" - if ! dnf list available "$PACKAGE_NAME" &>/dev/null; then - LOG_ERROR "软件包 $PACKAGE_NAME 不在yum源中" - exit 255 - fi - - # 检查命令是否支持--stdin参数 - LOG_INFO "检查 $COMMAND_NAME 命令是否支持 --stdin 参数" - if ! command -v "$COMMAND_NAME" &>/dev/null; then - LOG_INFO "命令 $COMMAND_NAME 未安装,将进行安装" - INSTALLED=false - else - INSTALLED=true - if ! "$COMMAND_NAME" --help 2>&1 | grep -q -- "--stdin"; then - LOG_ERROR "命令 $COMMAND_NAME 不支持 --stdin 参数" - exit 255 - fi - fi - - # 如果未安装,则安装软件包 - if [ "$INSTALLED" = false ]; then - LOG_INFO "安装软件包 $PACKAGE_NAME" - dnf install -y "$PACKAGE_NAME" - CHECK_RESULT $? 0 0 "安装软件包失败" - - # 再次检查命令是否支持--stdin参数 - if ! "$COMMAND_NAME" --help 2>&1 | grep -q -- "--stdin"; then - LOG_ERROR "命令 $COMMAND_NAME 不支持 --stdin 参数" - # 卸载已安装的软件包 - dnf remove -y "$PACKAGE_NAME" - exit 255 - fi - fi - - # 准备测试数据 - LOG_INFO "准备测试数据" - TEST_DATA="@prefix ex: . - ex:subject ex:predicate ex:object ." - echo "$TEST_DATA" > test_input.ttl - CHECK_RESULT $? 0 0 "创建测试数据文件失败" - - # 测试--stdin参数 - LOG_INFO "测试 $COMMAND_NAME 命令的 --stdin 参数" - echo "$TEST_DATA" | "$COMMAND_NAME" --stdin 2>&1 - CHECK_RESULT $? 0 0 "从标准输入加载数据失败" - - # 清理测试数据 - LOG_INFO "清理测试数据" - rm -f test_input.ttl - CHECK_RESULT $? 0 0 "清理测试数据失败" - - # 如果之前未安装,则卸载软件包 - if [ "$INSTALLED" = false ]; then - LOG_INFO "卸载软件包 $PACKAGE_NAME" - dnf remove -y "$PACKAGE_NAME" - CHECK_RESULT $? 0 0 "卸载软件包失败" - fi - - LOG_INFO "测试完成" -} - -main "$@" \ No newline at end of file diff --git a/testcases/function_test/pkg_test/python-rdflib/python3-rdflib/test_python3-rdflib_rdfpipe__h.sh b/testcases/function_test/pkg_test/python-rdflib/python3-rdflib/test_python3-rdflib_rdfpipe__h.sh deleted file mode 100644 index 486e1cbee3d..00000000000 --- a/testcases/function_test/pkg_test/python-rdflib/python3-rdflib/test_python3-rdflib_rdfpipe__h.sh +++ /dev/null @@ -1,62 +0,0 @@ -#!/usr/bin/bash - -# Copyright (c) 2024 ISCAS .ALL rights reserved. -# This program is licensed under Mulan PSL v2. -# You can use it according to the terms and conditions of the Mulan PSL v2. -# http://license.coscl.org.cn/MulanPSL2 -# THIS PROGRAM IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, -# EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, -# MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. -# See the Mulan PSL v2 for more details. - -# ############################################# -# @Author : honghua -# @Contact : honghua@iscas.ac.cn -# @Date : 2025-12-08 -# @License : Mulan PSL v2 -# @Desc : 测试 rdfpipe 命令的帮助文档显示 -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - # 检查是否已安装python3-rdflib软件包 - LOG_INFO "检查是否已安装python3-rdflib软件包" - if ! dnf list installed python3-rdflib &>/dev/null; then - LOG_INFO "python3-rdflib未安装,将进行安装" - INSTALLED=false - else - LOG_INFO "python3-rdflib已安装" - INSTALLED=true - fi - - # 检查yum源中是否有python3-rdflib软件包 - LOG_INFO "检查yum源中是否有python3-rdflib软件包" - if ! dnf list available python3-rdflib &>/dev/null; then - LOG_ERROR "yum源中未找到python3-rdflib软件包" - exit 255 - fi - - # 如果未安装则安装python3-rdflib - if [ "$INSTALLED" = false ]; then - LOG_INFO "正在安装python3-rdflib" - dnf install -y python3-rdflib - CHECK_RESULT $? 0 0 "安装python3-rdflib失败" - fi - - # 测试rdfpipe命令的帮助文档显示 - LOG_INFO "测试rdfpipe命令的帮助文档显示" - rdfpipe -h - CHECK_RESULT $? 0 0 "rdfpipe命令帮助文档显示失败" - - # 如果脚本开始时未安装python3-rdflib,则在脚本结束时卸载它 - if [ "$INSTALLED" = false ]; then - LOG_INFO "卸载python3-rdflib" - dnf remove -y python3-rdflib - CHECK_RESULT $? 0 0 "卸载python3-rdflib失败" - fi - - LOG_INFO "测试脚本执行完毕" -} - -main "$@" \ No newline at end of file diff --git a/testcases/function_test/pkg_test/python-rdflib/python3-rdflib/test_python3-rdflib_rdfpipe__i_input_format.sh b/testcases/function_test/pkg_test/python-rdflib/python3-rdflib/test_python3-rdflib_rdfpipe__i_input_format.sh deleted file mode 100644 index d814c765e5e..00000000000 --- a/testcases/function_test/pkg_test/python-rdflib/python3-rdflib/test_python3-rdflib_rdfpipe__i_input_format.sh +++ /dev/null @@ -1,72 +0,0 @@ -#!/usr/bin/bash - -# Copyright (c) 2024 ISCAS .ALL rights reserved. -# This program is licensed under Mulan PSL v2. -# You can use it according to the terms and conditions of the Mulan PSL v2. -# http://license.coscl.org.cn/MulanPSL2 -# THIS PROGRAM IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, -# EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, -# MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. -# See the Mulan PSL v2 for more details. - -# ############################################# -# @Author : honghua -# @Contact : honghua@iscas.ac.cn -# @Date : 2025-12-08 -# @License : Mulan PSL v2 -# @Desc : 测试 rdfpipe 命令的输入格式指定功能 -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - - # 检查是否已安装python3-rdflib和rdfpipe - LOG_INFO "检查是否已安装python3-rdflib和rdfpipe" - if ! dnf list installed python3-rdflib &>/dev/null; then - LOG_INFO "python3-rdflib未安装,开始安装" - if ! dnf list available python3-rdflib &>/dev/null; then - LOG_ERROR "yum源中未找到python3-rdflib软件包" - exit 255 - fi - dnf install -y python3-rdflib - CHECK_RESULT $? 0 0 "安装python3-rdflib失败" - INSTALLED=true - else - LOG_INFO "python3-rdflib已安装" - INSTALLED=false - fi - - # 测试rdfpipe命令的输入格式指定功能 - LOG_INFO "测试rdfpipe命令的输入格式指定功能" - if ! command -v rdfpipe &>/dev/null; then - LOG_ERROR "rdfpipe命令未找到" - if [ "$INSTALLED" = true ]; then - dnf remove -y python3-rdflib - CHECK_RESULT $? 0 0 "卸载python3-rdflib失败" - fi - exit 255 - fi - - # 测试支持的输入格式 - LOG_INFO "测试支持的输入格式" - rdfpipe --help | grep -q "\-i, \-\-input\-format" - CHECK_RESULT $? 0 0 "rdfpipe不支持输入格式指定参数" - - # 测试不支持的输入格式(假设xml是不支持的格式) - LOG_INFO "测试不支持的输入格式" - rdfpipe -i xml &>/dev/null - CHECK_RESULT $? 255 0 "rdfpipe错误地支持了不存在的输入格式" - - # 清理环境 - if [ "$INSTALLED" = true ]; then - LOG_INFO "清理环境,卸载python3-rdflib" - dnf remove -y python3-rdflib - CHECK_RESULT $? 0 0 "卸载python3-rdflib失败" - fi - - LOG_INFO "测试脚本执行完毕" - -} - -main "$@" \ No newline at end of file diff --git a/testcases/function_test/pkg_test/python-rdflib/python3-rdflib/test_python3-rdflib_rdfpipe__no_guess.sh b/testcases/function_test/pkg_test/python-rdflib/python3-rdflib/test_python3-rdflib_rdfpipe__no_guess.sh deleted file mode 100644 index 04511141c67..00000000000 --- a/testcases/function_test/pkg_test/python-rdflib/python3-rdflib/test_python3-rdflib_rdfpipe__no_guess.sh +++ /dev/null @@ -1,62 +0,0 @@ -#!/usr/bin/bash - -# Copyright (c) 2024 ISCAS .ALL rights reserved. -# This program is licensed under Mulan PSL v2. -# You can use it according to the terms and conditions of the Mulan PSL v2. -# http://license.coscl.org.cn/MulanPSL2 -# THIS PROGRAM IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, -# EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, -# MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. -# See the Mulan PSL v2 for more details. - -# ############################################# -# @Author : honghua -# @Contact : honghua@iscas.ac.cn -# @Date : 2025-12-08 -# @License : Mulan PSL v2 -# @Desc : 测试 rdfpipe 命令的禁止猜测输入格式功能 -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - LOG_INFO "开始测试 rdfpipe 命令的禁止猜测输入格式功能" - - # 检查是否已安装 python3-rdflib - if dnf list installed python3-rdflib &>/dev/null; then - LOG_INFO "python3-rdflib 已安装,测试结束后将保持安装状态" - INSTALLED=true - else - LOG_INFO "python3-rdflib 未安装,将在测试结束后卸载" - INSTALLED=false - fi - - # 检查 yum 源中是否有 python3-rdflib - if ! dnf list available python3-rdflib &>/dev/null; then - LOG_ERROR "yum 源中未找到 python3-rdflib 软件包" - exit 255 - fi - - # 如果未安装,则安装 python3-rdflib - if [ "$INSTALLED" = false ]; then - LOG_INFO "正在安装 python3-rdflib..." - dnf install -y python3-rdflib - CHECK_RESULT $? 0 0 "安装 python3-rdflib 失败" - fi - - # 测试 rdfpipe 命令的禁止猜测输入格式功能 - LOG_INFO "测试 rdfpipe 命令的 --no-guess 参数" - rdfpipe --no-guess &>/dev/null - CHECK_RESULT $? 255 0 "rdfpipe --no-guess 参数不支持或执行失败" - - # 清理环境 - if [ "$INSTALLED" = false ]; then - LOG_INFO "正在卸载 python3-rdflib..." - dnf remove -y python3-rdflib - CHECK_RESULT $? 0 0 "卸载 python3-rdflib 失败" - fi - - LOG_INFO "测试完成,环境已恢复" -} - -main "$@" \ No newline at end of file diff --git a/testcases/function_test/pkg_test/python-rdflib/python3-rdflib/test_python3-rdflib_rdfpipe__no_out.sh b/testcases/function_test/pkg_test/python-rdflib/python3-rdflib/test_python3-rdflib_rdfpipe__no_out.sh deleted file mode 100644 index a0cd576b02d..00000000000 --- a/testcases/function_test/pkg_test/python-rdflib/python3-rdflib/test_python3-rdflib_rdfpipe__no_out.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-08 -# @License : Mulan PSL v2 -# @Desc : 测试 rdfpipe 命令的禁止输出结果功能 -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - # 检查是否已安装python3-rdflib - LOG_INFO "检查是否已安装python3-rdflib" - if ! dnf list installed python3-rdflib &>/dev/null; then - LOG_INFO "python3-rdflib未安装,开始安装" - if ! dnf list available python3-rdflib &>/dev/null; then - LOG_ERROR "yum源中未找到python3-rdflib软件包" - exit 255 - fi - dnf install -y python3-rdflib - CHECK_RESULT $? 0 0 "安装python3-rdflib失败" - INSTALLED=1 - else - LOG_INFO "python3-rdflib已安装" - INSTALLED=0 - fi - - # 测试rdfpipe命令的禁止输出结果功能 - LOG_INFO "测试rdfpipe命令的禁止输出结果功能" - if ! command -v rdfpipe &>/dev/null; then - LOG_ERROR "rdfpipe命令不存在" - exit 255 - fi - - # 测试不带--no-out参数时是否有输出 - LOG_INFO "测试不带--no-out参数时是否有输出" - temp_file=$(mktemp) - echo "@prefix ex: . ex:subject ex:predicate ex:object ." > "$temp_file" - rdfpipe "$temp_file" > /dev/null 2>&1 - CHECK_RESULT $? 0 0 "rdfpipe命令执行失败" - rm -f "$temp_file" - - # 测试带--no-out参数时是否无输出 - LOG_INFO "测试带--no-out参数时是否无输出" - temp_file=$(mktemp) - echo "@prefix ex: . ex:subject ex:predicate ex:object ." > "$temp_file" - output=$(rdfpipe --no-out "$temp_file" 2>&1) - CHECK_RESULT $? 0 0 "rdfpipe命令执行失败" - if [ -n "$output" ]; then - LOG_ERROR "--no-out参数未生效,仍有输出" - exit 1 - fi - rm -f "$temp_file" - - # 清理环境,恢复到之前的状态 - if [ "$INSTALLED" -eq 1 ]; then - LOG_INFO "卸载python3-rdflib" - dnf remove -y python3-rdflib - CHECK_RESULT $? 0 0 "卸载python3-rdflib失败" - fi - - LOG_INFO "测试脚本执行完毕" -} - -main "$@" \ No newline at end of file diff --git a/testcases/function_test/pkg_test/python-rdflib/python3-rdflib/test_python3-rdflib_rdfpipe__ns_prefix_namespace.sh b/testcases/function_test/pkg_test/python-rdflib/python3-rdflib/test_python3-rdflib_rdfpipe__ns_prefix_namespace.sh deleted file mode 100644 index c101cf97bfb..00000000000 --- a/testcases/function_test/pkg_test/python-rdflib/python3-rdflib/test_python3-rdflib_rdfpipe__ns_prefix_namespace.sh +++ /dev/null @@ -1,74 +0,0 @@ -#!/usr/bin/bash - -# Copyright (c) 2024 ISCAS .ALL rights reserved. -# This program is licensed under Mulan PSL v2. -# You can use it according to the terms and conditions of the Mulan PSL v2. -# http://license.coscl.org.cn/MulanPSL2 -# THIS PROGRAM IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, -# EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, -# MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. -# See the Mulan PSL v2 for more details. - -# ############################################# -# @Author : honghua -# @Contact : honghua@iscas.ac.cn -# @Date : 2025-12-08 -# @License : Mulan PSL v2 -# @Desc : 测试 rdfpipe 命令的命名空间绑定功能 -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - LOG_INFO "开始测试 rdfpipe 命令的命名空间绑定功能" - - # 检查是否已安装 python3-rdflib 包 - LOG_INFO "检查是否已安装 python3-rdflib 包" - if ! dnf list installed python3-rdflib &>/dev/null; then - LOG_INFO "python3-rdflib 未安装,将进行安装" - INSTALLED=false - else - LOG_INFO "python3-rdflib 已安装" - INSTALLED=true - fi - - # 检查 yum 源中是否存在 python3-rdflib 包 - LOG_INFO "检查 yum 源中是否存在 python3-rdflib 包" - if ! dnf list available python3-rdflib &>/dev/null; then - LOG_ERROR "yum 源中未找到 python3-rdflib 包" - exit 255 - fi - - # 如果未安装,则安装 python3-rdflib - if [ "$INSTALLED" = false ]; then - LOG_INFO "正在安装 python3-rdflib" - dnf install -y python3-rdflib - CHECK_RESULT $? 0 0 "安装 python3-rdflib 失败" - fi - - # 测试 rdfpipe 命令的命名空间绑定功能 - LOG_INFO "测试 rdfpipe 命令的命名空间绑定功能" - rdfpipe --help | grep -q "namespace" - CHECK_RESULT $? 0 0 "rdfpipe 命令不支持命名空间绑定功能" - - # 执行具体的命名空间绑定测试 - LOG_INFO "执行具体的命名空间绑定测试" - echo "@prefix ex: ." > test.ttl - rdfpipe --input-format=turtle --output-format=turtle test.ttl > output.ttl - CHECK_RESULT $? 0 0 "rdfpipe 命令执行失败" - - #清理临时文件 - LOG_INFO "清理临时文件" - rm -f test.ttl output.ttl - - # 如果脚本开始时未安装,则在结束时卸载软件包 - if [ "$INSTALLED" = false ]; then - LOG_INFO "卸载 python3-rdflib 包" - dnf remove -y python3-rdflib - CHECK_RESULT $? 0 0 "卸载 python3-rdflib 失败" - fi - - LOG_INFO "测试 rdfpipe -} - -main "$@" \ No newline at end of file diff --git a/testcases/function_test/pkg_test/python-rdflib/python3-rdflib/test_python3-rdflib_rdfpipe__o_output_format.sh b/testcases/function_test/pkg_test/python-rdflib/python3-rdflib/test_python3-rdflib_rdfpipe__o_output_format.sh deleted file mode 100644 index 3ea3a3d39df..00000000000 --- a/testcases/function_test/pkg_test/python-rdflib/python3-rdflib/test_python3-rdflib_rdfpipe__o_output_format.sh +++ /dev/null @@ -1,81 +0,0 @@ -#!/usr/bin/bash - -# Copyright (c) 2024 ISCAS .ALL rights reserved. -# This program is licensed under Mulan PSL v2. -# You can use it according to the terms and conditions of the Mulan PSL v2. -# http://license.coscl.org.cn/MulanPSL2 -# THIS PROGRAM IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, -# EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, -# MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. -# See the Mulan PSL v2 for more details. - -# ############################################# -# @Author : honghua -# @Contact : honghua@iscas.ac.cn -# @Date : 2025-12-08 -# @License : Mulan PSL v2 -# @Desc : 测试 rdfpipe 命令的输出格式指定功能 -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - - LOG_INFO "开始测试 rdfpipe 命令的输出格式指定功能" - - # 检查是否已安装 python3-rdflib 和 rdfpipe - LOG_INFO "检查 python3-rdflib 和 rdfpipe 是否已安装" - if ! dnf list installed python3-rdflib &>/dev/null || ! command -v rdfpipe &>/dev/null; then - LOG_INFO "python3-rdflib 或 rdfpipe 未安装,准备安装" - # 检查 yum 源中是否有 python3-rdflib - if ! dnf list available python3-rdflib &>/dev/null; then - LOG_ERROR "yum 源中未找到 python3-rdflib 软件包" - exit 255 - fi - # 安装软件包 - dnf install -y python3-rdflib - CHECK_RESULT $? 0 0 "安装 python3-rdflib 失败" - # 验证 rdfpipe 是否可用 - if ! command -v rdfpipe &>/dev/null; then - LOG_ERROR "安装后未找到 rdfpipe 命令" - exit 255 - fi - # 标记需要卸载 - NEED_UNINSTALL=1 - else - LOG_INFO "python3-rdflib 和 rdfpipe 已安装,无需重新安装" - NEED_UNINSTALL=0 - fi - - # 测试 rdfpipe --help,检查是否支持 -o 参数 - LOG_INFO "检查 rdfpipe 是否支持 -o (输出格式) 参数" - if ! rdfpipe --help | grep -q -- "-o"; then - LOG_ERROR "rdfpipe 不支持 -o 参数" - exit_cleanup 255 - fi - - # 测试指定输出格式为 turtle (ttl) - LOG_INFO "测试 rdfpipe -o ttl 功能" - echo "@prefix ex: . ex:test a ex:Test ." > test.rdf - rdfpipe -o ttl test.rdf > output.ttl - CHECK_RESULT $? 0 0 "执行 rdfpipe -o ttl 失败" - # TODO: 可根据实际需求添加对 output.ttl 内容的检查 - - # TODO: 可添加更多输出格式的测试,如 -o xml, -o ntriples 等 - - # 清理临时文件 - rm -f test.rdf output.ttl - CHECK_RESULT $? 0 0 "清理临时文件失败" - - #根据标记决定是否卸载 - if [ "$NEED_UNINSTALL" -eq 1 ]; then - LOG_INFO "卸载 python3-rdflib" - dnf remove -y python3-rdflib - CHECK_RESULT $? 0 0 "卸载 python3-rdflib 失败" - fi - - LOG_INFO "测试完成" - -} - -main "$@" \ No newline at end of file diff --git a/testcases/function_test/pkg_test/python-rdflib/python3-rdflib/test_python3-rdflib_rdfpipe__w.sh b/testcases/function_test/pkg_test/python-rdflib/python3-rdflib/test_python3-rdflib_rdfpipe__w.sh deleted file mode 100644 index 64ae151a22f..00000000000 --- a/testcases/function_test/pkg_test/python-rdflib/python3-rdflib/test_python3-rdflib_rdfpipe__w.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-12-08 -# @License : Mulan PSL v2 -# @Desc : 测试 rdfpipe 命令的输出警告信息功能 -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - LOG_INFO "开始测试 rdfpipe 命令的输出警告信息功能" - - # 检查是否已安装 python3-rdflib 和 rdfpipe - LOG_INFO "检查环境是否已安装 python3-rdflib 和 rdfpipe" - if ! dnf list installed python3-rdflib &>/dev/null; then - LOG_INFO "python3-rdflib 未安装,将进行安装" - if ! dnf list available python3-rdflib &>/dev/null; then - LOG_ERROR "yum 源中未找到 python3-rdflib 软件包" - exit 255 - fi - dnf install -y python3-rdflib - CHECK_RESULT $? 0 0 "安装 python3-rdflib 失败" - INSTALLED_PYTHON3_RDFLIB=1 - else - LOG_INFO "python3-rdflib 已安装" - INSTALLED_PYTHON3_RDFLIB=0 - fi - - if ! command -v rdfpipe &>/dev/null; then - LOG_INFO "rdfpipe 未安装,将进行安装" - if ! dnf list available rdfpipe &>/dev/null; then - LOG_ERROR "yum 源中未找到 rdfpipe 软件包" - exit 255 - fi - dnf install -y rdfpipe - CHECK_RESULT $? 0 0 "安装 rdfpipe 失败" - INSTALLED_RDFPIPE=1 - else - LOG_INFO "rdfpipe 已安装" - INSTALLED_RDFPIPE=0 - fi - - # 测试 rdfpipe 命令的输出警告信息功能 - LOG_INFO "测试 rdfpipe 命令的输出警告信息功能" - rdfpipe --invalid-option &>/dev/null - CHECK_RESULT $? 255 0 "rdfpipe --invalid-option 未返回预期退出码 255" - - # 清理环境,恢复到之前的状态 - LOG_INFO "清理环境" - if [ $INSTALLED_PYTHON3_RDFLIB -eq 1 ]; then - dnf remove -y python3-rdflib &>/dev/null - CHECK_RESULT $?10"卸载python3-rdflib失败" - fi - - if [ $INSTALLED_RDFPIPE -eq1];then - dnf remove-y rdfpipe&>/dev/null - CHECK_RESULT$?00"卸载rdfpiple失败" - fi - - LOG_INFO"测试完成" -} - -main "$@" \ No newline at end of file diff --git a/testcases/function_test/pkg_test/python-rdflib/python3-rdflib/test_python3-rdflib_rdfpipe_file.sh b/testcases/function_test/pkg_test/python-rdflib/python3-rdflib/test_python3-rdflib_rdfpipe_file.sh deleted file mode 100644 index 4a5abb8a1ca..00000000000 --- a/testcases/function_test/pkg_test/python-rdflib/python3-rdflib/test_python3-rdflib_rdfpipe_file.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-23 -# @License : Mulan PSL v2 -# @Desc : 测试从文件读取数据 -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - # 检查是否已安装python3-rdflib和rdfpipe - LOG_INFO "检查python3-rdflib和rdfpipe是否已安装" - if dnf list installed python3-rdflib &>/dev/null && dnf list installed rdfpipe &>/dev/null; then - LOG_INFO "python3-rdflib和rdfpipe已安装,脚本结束时将保持安装状态" - ALREADY_INSTALLED=1 - else - LOG_INFO "python3-rdflib和rdfpipe未安装,将在测试中安装并在结束时卸载" - ALREADY_INSTALLED=0 - fi - - # 检查yum源中是否有python3-rdflib和rdfpipe软件包 - LOG_INFO "检查yum源中是否有python3-rdflib和rdfpipe软件包" - if ! dnf list available python3-rdflib &>/dev/null; then - LOG_ERROR "yum源中没有python3-rdflib软件包" - exit 255 - fi - if ! dnf list available rdfpipe &>/dev/null; then - LOG_ERROR "yum源中没有rdfpipe软件包" - exit 255 - fi - LOG_INFO "yum源中已找到python3-rdflib和rdfpipe软件包" - - # 如果未安装,则安装软件包 - if [ $ALREADY_INSTALLED -eq 0 ]; then - LOG_INFO "开始安装python3-rdflib和rdfpipe" - dnf install -y python3-rdflib rdfpipe - CHECK_RESULT $? 0 0 "安装python3-rdflib和rdfpipe失败" - LOG_INFO "python3-rdflib和rdfpipe安装成功" - fi - - # 测试从文件读取数据 - LOG_INFO "测试从文件读取数据" - - # 创建测试RDF文件 - LOG_INFO "创建测试RDF文件" - cat > test_input.rdf < . - @prefix ex: . - - ex:resource1 dc:title "Test Title" . - ex:resource1 dc:creator "Test Author" . - EOF - CHECK_RESULT $? 0 0 "创建测试RDF文件失败" - - # 使用rdfpipe从文件读取数据并输出 - LOG_INFO "使用rdfpipe从文件读取数据并输出到控制台" - rdfpipe -i turtle -o turtle test_input.rdf > test_output.txt 2>&1 - CHECK_RESULT $? 0 0 "rdfpipe从文件读取数据失败" - - # 验证输出结果 - LOG_INFO "验证输出结果" - if grep -q "Test Title" test_output.txt && grep -q "Test Author" test_output.txt; then - LOG_INFO "rdfpipe成功从文件读取数据并正确输出" - else - LOG_ERROR "rdfpipe输出结果不符合预期" - exit 1 - fi - - # 清理测试文件 - LOG_INFO "清理测试文件" - rm -f test_input.rdf test_output.txt - CHECK_RESULT $? 0 0 "清理测试文件失败" - - # 环境恢复 - if [ $ALREADY_INSTALLED -eq 0 ]; then - LOG_INFO "卸载python3-rdflib和rdfpipe" - dnf remove -y python3-rdflib rdfpipe - CHECK_RESULT $? 0 0 "卸载python3-rdflib和rdfpipe失败" - LOG_INFO "python3-rdflib和rdfpipe卸载成功" - else - LOG_INFO "保持python3-rdflib和rdfpipe安装状态" - fi - - LOG_INFO "测试脚本执行完成" -} - -main "$@" \ No newline at end of file diff --git a/testcases/function_test/pkg_test/python-rdflib/python3-rdflib/test_python3-rdflib_rdfpipe_h.sh b/testcases/function_test/pkg_test/python-rdflib/python3-rdflib/test_python3-rdflib_rdfpipe_h.sh deleted file mode 100644 index 6987cd48083..00000000000 --- a/testcases/function_test/pkg_test/python-rdflib/python3-rdflib/test_python3-rdflib_rdfpipe_h.sh +++ /dev/null @@ -1,123 +0,0 @@ -#!/usr/bin/bash - -# Copyright (c) 2024 ISCAS .ALL rights reserved. -# This program is licensed under Mulan PSL v2. -# You can use it according to the terms and conditions of the Mulan PSL v2. -# http://license.coscl.org.cn/MulanPSL2 -# THIS PROGRAM IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, -# EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-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-23 -# @License : Mulan PSL v2 -# @Desc : 测试显示帮助信息 -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - # 定义日志函数(如果不存在) - if ! type LOG_INFO &>/dev/null; then - LOG_INFO() { echo "[INFO] $*"; } - fi - if ! type LOG_ERROR &>/dev/null; then - LOG_ERROR() { echo "[ERROR] $*"; } - fi - - # 定义检查结果函数(如果不存在) - if ! type CHECK_RESULT &>/dev/null; then - CHECK_RESULT() { - local actual=$1 - local expect=$2 - local mode=$3 - local msg=$4 - if [ $mode -eq 0 ]; then - if [ $actual -eq $expect ]; then - LOG_INFO "$msg 成功" - else - LOG_ERROR "$msg 失败" - exit $actual - fi - else - if [ $actual -ne $expect ]; then - LOG_INFO "$msg 成功" - else - LOG_ERROR "$msg 失败" - exit 255 - fi - fi - } - fi - - # 定义SSH_CMD函数(如果不存在) - if ! type SSH_CMD &>/dev/null; then - SSH_CMD() { - local cmd=$1 - local ip=$2 - local passwd=$3 - local user=${4:-root} - sshpass -p "$passwd" ssh -o StrictHostKeyChecking=no -o UserKnownHostsFile=/dev/null $user@$ip "$cmd" - } - fi - - # 定义软件包名称 - PACKAGE_NAME="python3-rdflib" - - # 步骤1:检查环境是否已安装python3-rdflib - LOG_INFO "步骤1:检查是否已安装python3-rdflib" - if rpm -q $PACKAGE_NAME &>/dev/null; then - LOG_INFO "python3-rdflib 已安装,脚本结束后将保持安装状态" - INSTALLED_BEFORE=true - else - LOG_INFO "python3-rdflib 未安装,将在测试步骤中安装并在脚本结束前卸载" - INSTALLED_BEFORE=false - fi - - # 步骤2:检查yum源中是否有python3-rdflib软件包 - LOG_INFO "步骤2:检查yum源中是否有python3-rdflib软件包" - if ! dnf list available $PACKAGE_NAME &>/dev/null; then - LOG_ERROR "yum源中未找到python3-rdflib软件包" - exit 255 - fi - - # 步骤3:如果未安装,则安装python3-rdflib - if [ "$INSTALLED_BEFORE" = "false" ]; then - LOG_INFO "步骤3:安装python3-rdflib软件包" - dnf install -y $PACKAGE_NAME - CHECK_RESULT $? 0 0 "安装python3-rdflib" - fi - - # 步骤4:检查rdfpipe命令是否存在并测试显示帮助信息 - LOG_INFO "步骤4:测试rdfpipe命令显示帮助信息" - if ! command -v rdfpipe &>/dev/null; then - LOG_ERROR "rdfpipe命令不存在" - exit 255 - fi - - # 检查rdfpipe是否支持--help参数 - if ! rdfpipe --help &>/dev/null; then - LOG_ERROR "rdfpipe命令不支持--help参数" - exit 255 - fi - - # 执行rdfpipe --help命令并检查输出是否包含帮助信息 - rdfpipe --help 2>&1 | grep -q "usage:\|Usage:\|help" - CHECK_RESULT $? 0 0 "rdfpipe命令显示帮助信息" - - # 步骤5:清理环境,如果之前未安装则卸载软件包 - if [ "$INSTALLED_BEFORE" = "false" ]; then - LOG_INFO "步骤5:卸载python3-rdflib软件包" - dnf remove -y $PACKAGE_NAME - CHECK_RESULT $? 0 0 "卸载python3-rdflib" - else - LOG_INFO "步骤5:保持python3-rdflib安装状态,无需卸载" - fi - - LOG_INFO "测试完成" -} - -main "$@" \ No newline at end of file diff --git a/testcases/function_test/pkg_test/python-rdflib/python3-rdflib/test_python3-rdflib_rdfpipe_i.sh b/testcases/function_test/pkg_test/python-rdflib/python3-rdflib/test_python3-rdflib_rdfpipe_i.sh deleted file mode 100644 index 71063b4e0e4..00000000000 --- a/testcases/function_test/pkg_test/python-rdflib/python3-rdflib/test_python3-rdflib_rdfpipe_i.sh +++ /dev/null @@ -1,111 +0,0 @@ -#!/usr/bin/bash - -# Copyright (c) 2024 ISCAS .ALL rights reserved. -# This program is licensed under Mulan PSL v2. -# You can use it according to the terms and conditions of the Mulan PSL v2. -# http://license.coscl.org.cn/MulanPSL2 -# THIS PROGRAM IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, -# EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, -# MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. -# See the Mulan PSL v2 for more details. - -# ############################################# -# @Author : honghua -# @Contact : honghua@iscas.ac.cn -# @Date : 2026-03-23 -# @License : Mulan PSL v2 -# @Desc : 测试指定输入文件格式 -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - LOG_INFO "开始测试:测试指定输入文件格式" - - # 定义软件包名称 - PACKAGE_NAME="python3-rdflib" - COMMAND="rdfpipe" - - # 检查是否已安装 - if rpm -q $PACKAGE_NAME > /dev/null 2>&1; then - LOG_INFO "检测到 $PACKAGE_NAME 已安装,测试后将保持安装状态" - ALREADY_INSTALLED=true - else - LOG_INFO "检测到 $PACKAGE_NAME 未安装,将在测试中安装并在结束后卸载" - ALREADY_INSTALLED=false - fi - - # 检查yum源中是否有该软件包 - LOG_INFO "检查yum源中是否有 $PACKAGE_NAME 软件包" - if ! dnf list available $PACKAGE_NAME > /dev/null 2>&1; then - LOG_ERROR "yum源中未找到 $PACKAGE_NAME 软件包" - exit 255 - fi - - # 如果未安装,则安装软件包 - if [ "$ALREADY_INSTALLED" = false ]; then - LOG_INFO "安装 $PACKAGE_NAME 软件包" - dnf install -y $PACKAGE_NAME - CHECK_RESULT $? 0 0 "安装 $PACKAGE_NAME 失败" - fi - - # 检查 rdfpipe 命令是否存在 - LOG_INFO "检查 $COMMAND 命令是否存在" - if ! command -v $COMMAND > /dev/null 2>&1; then - LOG_ERROR "$COMMAND 命令不存在" - if [ "$ALREADY_INSTALLED" = false ]; then - dnf remove -y $PACKAGE_NAME - fi - exit 255 - fi - - # 测试指定输入文件格式 - LOG_INFO "测试指定输入文件格式" - - # 创建测试用的RDF文件(Turtle格式) - cat > test_input.ttl << EOF - @prefix ex: . - ex:subject ex:predicate ex:object . - EOF - - # 测试支持的输入格式参数 - LOG_INFO "测试 rdfpipe 支持的输入格式参数" - $COMMAND --help 2>&1 | grep -i "input.*format" > /dev/null - CHECK_RESULT $? 0 0 "rdfpipe 命令不支持输入格式参数" - - # 测试有效的输入格式 - LOG_INFO "测试有效的输入格式(Turtle)" - $COMMAND -i turtle test_input.ttl > /dev/null 2>&1 - CHECK_RESULT $? 0 0 "rdfpipe 无法处理 Turtle 格式输入" - - # 测试无效的输入格式 - LOG_INFO "测试无效的输入格式" - $COMMAND -i invalidformat test_input.ttl 2>&1 | grep -i "error\|unsupported\|unknown" > /dev/null - # 注意:这里期望命令执行失败,所以检查非0退出码 - if [ $? -eq 0 ]; then - LOG_INFO "无效输入格式被正确拒绝" - else - LOG_ERROR "无效输入格式未被正确检测" - # 清理测试文件 - rm -f test_input.ttl - if [ "$ALREADY_INSTALLED" = false ]; then - dnf remove -y $PACKAGE_NAME - fi - exit 1 - fi - - # 清理测试文件 - LOG_INFO "清理测试文件" - rm -f test_input.ttl - - # 如果测试前未安装,则卸载软件包 - if [ "$ALREADY_INSTALLED" = false ]; then - LOG_INFO "卸载 $PACKAGE_NAME 软件包" - dnf remove -y $PACKAGE_NAME - CHECK_RESULT $? 0 0 "卸载 $PACKAGE_NAME 失败" - fi - - LOG_INFO "测试完成:测试指定输入文件格式" -} - -main "$@" \ No newline at end of file diff --git a/testcases/function_test/pkg_test/python-rdflib/python3-rdflib/test_python3-rdflib_rdfpipe_i_format_keywords.sh b/testcases/function_test/pkg_test/python-rdflib/python3-rdflib/test_python3-rdflib_rdfpipe_i_format_keywords.sh deleted file mode 100644 index f488b735223..00000000000 --- a/testcases/function_test/pkg_test/python-rdflib/python3-rdflib/test_python3-rdflib_rdfpipe_i_format_keywords.sh +++ /dev/null @@ -1,88 +0,0 @@ -#!/usr/bin/bash - -# Copyright (c) 2024 ISCAS .ALL rights reserved. -# This program is licensed under Mulan PSL v2. -# You can use it according to the terms and conditions of the Mulan PSL v2. -# http://license.coscl.org.cn/MulanPSL2 -# THIS PROGRAM IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, -# EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, -# MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. -# See the Mulan PSL v2 for more details. - -# ############################################# -# @Author : honghua -# @Contact : honghua@iscas.ac.cn -# @Date : 2026-03-23 -# @License : Mulan PSL v2 -# @Desc : 测试为输入格式指定解析器关键字 -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - # 判断是否已安装python3-rdflib和python3-rdfpipe - LOG_INFO "检查是否已安装python3-rdflib和python3-rdfpipe" - if dnf list installed python3-rdflib > /dev/null 2>&1 && dnf list installed python3-rdfpipe > /dev/null 2>&1; then - LOG_INFO "软件包已安装,脚本结束时保持安装状态" - ALREADY_INSTALLED=1 - else - LOG_INFO "软件包未安装,将在测试过程中安装" - ALREADY_INSTALLED=0 - fi - - # 检查yum源中是否有python3-rdflib和python3-rdfpipe软件包 - LOG_INFO "检查yum源中是否有python3-rdflib软件包" - if ! dnf list available python3-rdflib > /dev/null 2>&1; then - LOG_ERROR "yum源中未找到python3-rdflib软件包" - exit 255 - fi - - LOG_INFO "检查yum源中是否有python3-rdfpipe软件包" - if ! dnf list available python3-rdfpipe > /dev/null 2>&1; then - LOG_ERROR "yum源中未找到python3-rdfpipe软件包" - exit 255 - fi - - # 安装软件包(如果未安装) - if [ $ALREADY_INSTALLED -eq 0 ]; then - LOG_INFO "安装python3-rdflib和python3-rdfpipe软件包" - dnf install -y python3-rdflib python3-rdfpipe - CHECK_RESULT $? 0 0 "安装python3-rdflib和python3-rdfpipe失败" - fi - - # 测试rdfpipe命令的-i参数支持情况 - LOG_INFO "测试rdfpipe命令的-i参数支持情况" - rdfpipe --help | grep -q "\-i" - CHECK_RESULT $? 0 0 "rdfpipe命令不支持-i参数" - - # 测试为输入格式指定解析器关键字 - LOG_INFO "测试为输入格式指定解析器关键字" - echo " "object" ." > test_input.ttl - rdfpipe -i turtle test_input.ttl -o ntriples test_output.nt - CHECK_RESULT $? 0 0 "使用-i参数指定turtle解析器失败" - - # 检查输出文件是否生成且内容正确 - LOG_INFO "检查输出文件是否生成且内容正确" - if [ -f test_output.nt ] && grep -q " "object"" test_output.nt; then - LOG_INFO "输出文件生成且内容正确" - else - LOG_ERROR "输出文件未生成或内容不正确" - CHECK_RESULT 1 0 0 "输出文件验证失败" - fi - - # 清理测试文件 - LOG_INFO "清理测试文件" - rm -f test_input.ttl test_output.nt - CHECK_RESULT $? 0 0 "清理测试文件失败" - - # 卸载软件包(如果测试前未安装) - if [ $ALREADY_INSTALLED -eq 0 ]; then - LOG_INFO "卸载python3-rdflib和python3-rdfpipe软件包" - dnf remove -y python3-rdflib python3-rdfpipe - CHECK_RESULT $? 0 0 "卸载python3-rdflib和python3-rdfpipe失败" - fi - - LOG_INFO "测试完成" -} - -main "$@" \ No newline at end of file diff --git a/testcases/function_test/pkg_test/python-rdflib/python3-rdflib/test_python3-rdflib_rdfpipe_i_no_guess.sh b/testcases/function_test/pkg_test/python-rdflib/python3-rdflib/test_python3-rdflib_rdfpipe_i_no_guess.sh deleted file mode 100644 index 752e59feba2..00000000000 --- a/testcases/function_test/pkg_test/python-rdflib/python3-rdflib/test_python3-rdflib_rdfpipe_i_no_guess.sh +++ /dev/null @@ -1,97 +0,0 @@ -#!/usr/bin/bash - -# Copyright (c) 2024 ISCAS .ALL rights reserved. -# This program is licensed under Mulan PSL v2. -# You can use it according to the terms and conditions of the Mulan PSL v2. -# http://license.coscl.org.cn/MulanPSL2 -# THIS PROGRAM IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, -# EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-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-23 -# @License : Mulan PSL v2 -# @Desc : 测试指定输入格式并禁用后缀猜测 -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - LOG_INFO "开始测试:测试指定输入格式并禁用后缀猜测" - LOG_INFO "检查测试环境是否已安装python3-rdflib软件包" - rpm -q python3-rdflib > /dev/null 2>&1 - if [ $? -eq 0 ]; then - LOG_INFO "环境已安装python3-rdflib软件包" - INSTALLED=1 - else - LOG_INFO "环境未安装python3-rdflib软件包" - INSTALLED=0 - fi - - LOG_INFO "检查yum源中是否有python3-rdflib软件包" - dnf list available python3-rdflib > /dev/null 2>&1 - CHECK_RESULT $? 0 0 "yum源中未找到python3-rdflib软件包" - if [ $? -ne 0 ]; then - LOG_ERROR "yum源中未找到python3-rdflib软件包" - exit 255 - fi - - if [ $INSTALLED -eq 0 ]; then - LOG_INFO "安装python3-rdflib软件包" - dnf install -y python3-rdflib - CHECK_RESULT $? 0 0 "安装python3-rdflib软件包失败" - fi - - LOG_INFO "检查rdfpipe命令是否支持-i参数" - rdfpipe --help | grep -q "\-i" - CHECK_RESULT $? 0 0 "rdfpipe命令不支持-i参数" - if [ $? -ne 0 ]; then - LOG_ERROR "rdfpipe命令不支持-i参数" - exit 255 - fi - - LOG_INFO "检查rdfpipe命令是否支持--no-guess参数" - rdfpipe --help | grep -q "\-\-no-guess" - CHECK_RESULT $? 0 0 "rdfpipe命令不支持--no-guess参数" - if [ $? -ne 0 ]; then - LOG_ERROR "rdfpipe命令不支持--no-guess参数" - exit 255 - fi - - LOG_INFO "创建测试RDF文件" - cat > test_input.ttl << EOF - @prefix dc: . - @prefix ex: . - - ex:resource1 dc:title "测试标题" . - ex:resource1 dc:creator "测试作者" . - EOF - - LOG_INFO "测试rdfpipe命令使用-i指定输入格式为turtle并禁用后缀猜测" - rdfpipe -i turtle --no-guess test_input.ttl > output.xml 2>&1 - CHECK_RESULT $? 0 0 "执行rdfpipe命令失败" - - LOG_INFO "检查输出文件是否生成" - [ -f output.xml ] - CHECK_RESULT $? 0 0 "输出文件未生成" - - LOG_INFO "检查输出文件内容是否包含RDF格式" - grep -q "rdf:RDF" output.xml - CHECK_RESULT $? 0 0 "输出文件内容不符合RDF格式" - - LOG_INFO "清理测试文件" - rm -f test_input.ttl output.xml - - if [ $INSTALLED -eq 0 ]; then - LOG_INFO "卸载python3-rdflib软件包" - dnf remove -y python3-rdflib - CHECK_RESULT $? 0 0 "卸载python3-rdflib软件包失败" - fi - - LOG_INFO "测试完成:测试指定输入格式并禁用后缀猜测" -} - -main "$@" \ No newline at end of file diff --git a/testcases/function_test/pkg_test/python-rdflib/python3-rdflib/test_python3-rdflib_rdfpipe_i_o.sh b/testcases/function_test/pkg_test/python-rdflib/python3-rdflib/test_python3-rdflib_rdfpipe_i_o.sh deleted file mode 100644 index 8b73846c0e1..00000000000 --- a/testcases/function_test/pkg_test/python-rdflib/python3-rdflib/test_python3-rdflib_rdfpipe_i_o.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-23 -# @License : Mulan PSL v2 -# @Desc : 测试同时指定输入和输出格式 -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - LOG_INFO "开始测试同时指定输入和输出格式" - LOG_INFO "步骤1:检查yum源中是否存在python3-rdflib软件包" - dnf list python3-rdflib 2>/dev/null | grep -q python3-rdflib - if [ $? -ne 0 ]; then - LOG_ERROR "yum源中未找到python3-rdflib软件包" - exit 255 - fi - - LOG_INFO "步骤2:检查是否已安装python3-rdflib" - rpm -q python3-rdflib >/dev/null 2>&1 - if [ $? -eq 0 ]; then - LOG_INFO "python3-rdflib已安装,测试结束后将保持安装状态" - INSTALLED=true - else - LOG_INFO "python3-rdflib未安装,将在测试步骤中安装" - INSTALLED=false - fi - - if [ "$INSTALLED" = "false" ]; then - LOG_INFO "步骤3:安装python3-rdflib" - dnf install -y python3-rdflib - CHECK_RESULT $? 0 0 "安装python3-rdflib失败" - fi - - LOG_INFO "步骤4:检查rdfpipe命令是否支持指定输入和输出格式参数" - rdfpipe --help 2>&1 | grep -q -E "\-\-input\-format|\-\-output\-format" - if [ $? -ne 0 ]; then - LOG_ERROR "rdfpipe命令不支持输入或输出格式参数" - exit 255 - fi - - LOG_INFO "步骤5:创建测试用的RDF文件" - cat > test_input.ttl << EOF - @prefix dc: . - @prefix ex: . - - ex:book1 dc:title "Test Book" . - EOF - - LOG_INFO "步骤6:执行rdfpipe命令同时指定输入和输出格式" - rdfpipe --input-format turtle --output-format xml test_input.ttl > test_output.rdf - CHECK_RESULT $? 0 0 "rdfpipe命令执行失败" - - LOG_INFO "步骤7:验证输出文件是否包含预期的XML内容" - grep -q "rdf:RDF" test_output.rdf - CHECK_RESULT $? 0 0 "输出文件未包含预期的XML格式" - - LOG_INFO "步骤8:清理临时文件" - rm -f test_input.ttl test_output.rdf - - if [ "$INSTALLED" = "false" ]; then - LOG_INFO "步骤9:卸载python3-rdflib" - dnf remove -y python3-rdflib - CHECK_RESULT $? 0 0 "卸载python3-rdflib失败" - fi - - LOG_INFO "测试完成" -} - -main "$@" \ No newline at end of file diff --git a/testcases/function_test/pkg_test/python-rdflib/python3-rdflib/test_python3-rdflib_rdfpipe_i_o_ns.sh b/testcases/function_test/pkg_test/python-rdflib/python3-rdflib/test_python3-rdflib_rdfpipe_i_o_ns.sh deleted file mode 100644 index e9214443f87..00000000000 --- a/testcases/function_test/pkg_test/python-rdflib/python3-rdflib/test_python3-rdflib_rdfpipe_i_o_ns.sh +++ /dev/null @@ -1,98 +0,0 @@ -#!/usr/bin/bash - -# Copyright (c) 2024 ISCAS .ALL rights reserved. -# This program is licensed under Mulan PSL v2. -# You can use it according to the terms and conditions of the Mulan PSL v2. -# http://license.coscl.org.cn/MulanPSL2 -# THIS PROGRAM IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, -# EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, -# MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. -# See the Mulan PSL v2 for more details. - -# ############################################# -# @Author : honghua -# @Contact : honghua@iscas.ac.cn -# @Date : 2026-03-23 -# @License : Mulan PSL v2 -# @Desc : 测试同时指定输入格式、输出格式和命名空间 -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - # 定义变量 - PKG_NAME="python3-rdflib" - CMD="rdfpipe" - TEST_INPUT_FILE="/tmp/test_input.ttl" - TEST_OUTPUT_FILE="/tmp/test_output.xml" - TEST_RDF_CONTENT="@prefix ex: . ex:subject ex:predicate ex:object ." - TEST_NS="http://example.org/" - - # 步骤1: 检查软件包是否在yum源中 - LOG_INFO "步骤1: 检查软件包是否在yum源中" - dnf list available ${PKG_NAME} &>/dev/null - if [ $? -ne 0 ]; then - LOG_ERROR "软件包 ${PKG_NAME} 不在yum源中" - exit 255 - fi - - # 步骤2: 检查环境是否已安装软件包 - LOG_INFO "步骤2: 检查环境是否已安装软件包" - rpm -q ${PKG_NAME} &>/dev/null - if [ $? -eq 0 ]; then - LOG_INFO "软件包 ${PKG_NAME} 已安装,测试后保持安装状态" - INSTALLED=1 - else - LOG_INFO "软件包 ${PKG_NAME} 未安装,测试前安装" - INSTALLED=0 - fi - - # 步骤3: 如果未安装则安装软件包 - if [ ${INSTALLED} -eq 0 ]; then - LOG_INFO "步骤3: 安装软件包 ${PKG_NAME}" - dnf install -y ${PKG_NAME} &>/dev/null - CHECK_RESULT $? 0 0 "安装软件包 ${PKG_NAME} 失败" - fi - - # 步骤4: 检查rdfpipe命令是否支持所需参数 - LOG_INFO "步骤4: 检查rdfpipe命令是否支持输入格式、输出格式和命名空间参数" - ${CMD} --help 2>&1 | grep -q -- "--input-format" - CHECK_RESULT $? 0 0 "rdfpipe命令不支持--input-format参数" - ${CMD} --help 2>&1 | grep -q -- "--output-format" - CHECK_RESULT $? 0 0 "rdfpipe命令不支持--output-format参数" - ${CMD} --help 2>&1 | grep -q -- "--namespace" - CHECK_RESULT $? 0 0 "rdfpipe命令不支持--namespace参数" - - # 步骤5: 创建测试输入文件 - LOG_INFO "步骤5: 创建测试输入文件" - echo "${TEST_RDF_CONTENT}" > ${TEST_INPUT_FILE} - CHECK_RESULT $? 0 0 "创建测试输入文件失败" - - # 步骤6: 执行测试:同时指定输入格式、输出格式和命名空间 - LOG_INFO "步骤6: 执行测试:同时指定输入格式、输出格式和命名空间" - ${CMD} --input-format=turtle --output-format=xml --namespace=${TEST_NS} ${TEST_INPUT_FILE} > ${TEST_OUTPUT_FILE} 2>/dev/null - CHECK_RESULT $? 0 0 "rdfpipe命令执行失败" - - # 步骤7: 验证输出文件是否包含指定的命名空间 - LOG_INFO "步骤7: 验证输出文件是否包含指定的命名空间" - grep -q "${TEST_NS}" ${TEST_OUTPUT_FILE} - CHECK_RESULT $? 0 0 "输出文件未包含指定的命名空间" - - # 步骤8: 清理测试文件 - LOG_INFO "步骤8: 清理测试文件" - rm -f ${TEST_INPUT_FILE} ${TEST_OUTPUT_FILE} - CHECK_RESULT $? 0 0 "清理测试文件失败" - - # 步骤9: 如果测试前未安装则卸载软件包 - if [ ${INSTALLED} -eq 0 ]; then - LOG_INFO "步骤9: 卸载软件包 ${PKG_NAME}" - dnf remove -y ${PKG_NAME} &>/dev/null - CHECK_RESULT $? 0 0 "卸载软件包 ${PKG_NAME} 失败" - else - LOG_INFO "步骤9: 保持软件包 ${PKG_NAME} 安装状态" - fi - - LOG_INFO "测试完成" -} - -main "$@" \ No newline at end of file diff --git a/testcases/function_test/pkg_test/python-rdflib/python3-rdflib/test_python3-rdflib_rdfpipe_no_guess.sh b/testcases/function_test/pkg_test/python-rdflib/python3-rdflib/test_python3-rdflib_rdfpipe_no_guess.sh deleted file mode 100644 index 09a5431bae3..00000000000 --- a/testcases/function_test/pkg_test/python-rdflib/python3-rdflib/test_python3-rdflib_rdfpipe_no_guess.sh +++ /dev/null @@ -1,102 +0,0 @@ -#!/usr/bin/bash - -# Copyright (c) 2024 ISCAS .ALL rights reserved. -# This program is licensed under Mulan PSL v2. -# You can use it according to the terms and conditions of the Mulan PSL v2. -# http://license.coscl.org.cn/MulanPSL2 -# THIS PROGRAM IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, -# EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, -# MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. -# See the Mulan PSL v2 for more details. - -# ############################################# -# @Author : honghua -# @Contact : honghua@iscas.ac.cn -# @Date : 2026-03-23 -# @License : Mulan PSL v2 -# @Desc : 测试禁用根据文件后缀猜测格式 -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - LOG_INFO "开始测试:测试禁用根据文件后缀猜测格式" - - # 定义软件包名称 - PACKAGE_NAME="python3-rdflib" - - # 检查软件包是否已在yum源中 - LOG_INFO "检查yum源中是否存在软件包: $PACKAGE_NAME" - if ! dnf list available $PACKAGE_NAME &>/dev/null; then - LOG_ERROR "yum源中不存在软件包: $PACKAGE_NAME" - exit 255 - fi - - # 检查软件包是否已安装 - LOG_INFO "检查软件包是否已安装: $PACKAGE_NAME" - if rpm -q $PACKAGE_NAME &>/dev/null; then - LOG_INFO "软件包已安装,测试结束后将保持安装状态" - INSTALLED_BEFORE_TEST=true - else - LOG_INFO "软件包未安装,将在测试步骤中安装" - INSTALLED_BEFORE_TEST=false - fi - - # 如果未安装,则安装软件包 - if [ "$INSTALLED_BEFORE_TEST" = false ]; then - LOG_INFO "安装软件包: $PACKAGE_NAME" - dnf install -y $PACKAGE_NAME - CHECK_RESULT $? 0 0 "安装软件包失败" - fi - - # 检查rdfpipe命令是否可用 - LOG_INFO "检查rdfpipe命令是否可用" - if ! command -v rdfpipe &>/dev/null; then - LOG_ERROR "rdfpipe命令不存在" - exit 255 - fi - - # 检查rdfpipe是否支持--no-guess参数 - LOG_INFO "检查rdfpipe是否支持--no-guess参数" - if ! rdfpipe --help 2>&1 | grep -q -- "--no-guess"; then - LOG_ERROR "rdfpipe不支持--no-guess参数" - exit 255 - fi - - # 创建测试用的RDF文件 - LOG_INFO "创建测试用的RDF文件" - cat > test.rdf << EOF - @prefix rdf: . - @prefix ex: . - ex:subject ex:predicate ex:object . - EOF - - # 使用--no-guess参数执行rdfpipe命令 - LOG_INFO "执行rdfpipe命令,禁用根据文件后缀猜测格式" - rdfpipe --no-guess -i n3 -o turtle test.rdf > output.ttl 2>&1 - CHECK_RESULT $? 0 0 "rdfpipe命令执行失败" - - # 检查输出文件是否存在且非空 - LOG_INFO "检查输出文件是否存在且非空" - if [ -s output.ttl ]; then - LOG_INFO "输出文件生成成功" - else - LOG_ERROR "输出文件为空或不存在" - CHECK_RESULT 1 0 1 "输出文件检查失败" - fi - - # 清理测试文件 - LOG_INFO "清理测试文件" - rm -f test.rdf output.ttl - - # 如果测试前未安装软件包,则卸载 - if [ "$INSTALLED_BEFORE_TEST" = false ]; then - LOG_INFO "卸载软件包: $PACKAGE_NAME" - dnf remove -y $PACKAGE_NAME - CHECK_RESULT $? 0 0 "卸载软件包失败" - fi - - LOG_INFO "测试完成:测试禁用根据文件后缀猜测格式" -} - -main "$@" \ No newline at end of file diff --git a/testcases/function_test/pkg_test/python-rdflib/python3-rdflib/test_python3-rdflib_rdfpipe_no_guess_no_out.sh b/testcases/function_test/pkg_test/python-rdflib/python3-rdflib/test_python3-rdflib_rdfpipe_no_guess_no_out.sh deleted file mode 100644 index 96896b9f836..00000000000 --- a/testcases/function_test/pkg_test/python-rdflib/python3-rdflib/test_python3-rdflib_rdfpipe_no_guess_no_out.sh +++ /dev/null @@ -1,163 +0,0 @@ -#!/usr/bin/bash - -# Copyright (c) 2024 ISCAS .ALL rights reserved. -# This program is licensed under Mulan PSL v2. -# You can use it according to the terms and conditions of the Mulan PSL v2. -# http://license.coscl.org.cn/MulanPSL2 -# THIS PROGRAM IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, -# EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-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-23 -# @License : Mulan PSL v2 -# @Desc : 测试禁用后缀猜测且不输出结果 -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - # 定义日志函数(虽然题目说直接使用,但实际环境中可能需要定义) - LOG_INFO() { - echo "[INFO] $*" - } - - LOG_ERROR() { - echo "[ERROR] $*" >&2 - } - - # 定义检查结果函数(虽然题目说直接使用,但实际环境中可能需要定义) - CHECK_RESULT() { - local actual=$1 - local expect=$2 - local exit_code=$3 - local msg=$4 - - if [ "$actual" -eq "$expect" ]; then - LOG_INFO "$msg 检查通过" - return 0 - else - LOG_ERROR "$msg 检查失败" - exit $exit_code - fi - } - - # 定义SSH_CMD函数(虽然题目说直接使用,但实际环境中可能需要定义) - SSH_CMD() { - local cmd=$1 - local ip=$2 - local password=$3 - local user=${4:-root} - - sshpass -p "$password" ssh -o StrictHostKeyChecking=no "$user@$ip" "$cmd" - } - - # 脚本开始 - LOG_INFO "开始测试:测试禁用后缀猜测且不输出结果" - - # 步骤1:检查yum源中是否有python3-rdflib和rdfpipe软件包 - LOG_INFO "步骤1:检查yum源中是否有python3-rdflib和rdfpipe软件包" - if ! dnf list available python3-rdflib 2>/dev/null | grep -q python3-rdflib; then - LOG_ERROR "yum源中没有python3-rdflib软件包" - exit 255 - fi - - if ! dnf list available rdfpipe 2>/dev/null | grep -q rdfpipe; then - LOG_ERROR "yum源中没有rdfpipe软件包" - exit 255 - fi - - # 步骤2:检查是否已安装软件包 - LOG_INFO "步骤2:检查是否已安装软件包" - python_installed=false - rdfpipe_installed=false - - if rpm -q python3-rdflib >/dev/null 2>&1; then - python_installed=true - LOG_INFO "python3-rdflib已安装" - fi - - if rpm -q rdfpipe >/dev/null 2>&1; then - rdfpipe_installed=true - LOG_INFO "rdfpipe已安装" - fi - - # 步骤3:如果未安装,则安装软件包 - if [ "$python_installed" = false ] || [ "$rdfpipe_installed" = false ]; then - LOG_INFO "步骤3:安装缺失的软件包" - - if [ "$python_installed" = false ]; then - dnf install -y python3-rdflib - CHECK_RESULT $? 0 0 "安装python3-rdflib" - fi - - if [ "$rdfpipe_installed" = false ]; then - dnf install -y rdfpipe - CHECK_RESULT $? 0 0 "安装rdfpipe" - fi - fi - - # 步骤4:测试rdfpipe命令是否支持--no-guess和--no-output参数 - LOG_INFO "步骤4:测试rdfpipe命令参数支持情况" - - # 检查--no-guess参数 - if ! rdfpipe --help 2>&1 | grep -q -- "--no-guess"; then - LOG_ERROR "rdfpipe不支持--no-guess参数" - exit 255 - fi - - # 检查--no-output参数 - if ! rdfpipe --help 2>&1 | grep -q -- "--no-output"; then - LOG_ERROR "rdfpipe不支持--no-output参数" - exit 255 - fi - - # 步骤5:创建测试用的RDF文件 - LOG_INFO "步骤5:创建测试用的RDF文件" - cat > test_input.ttl << EOF - @prefix dc: . - @prefix ex: . - - ex:book1 dc:title "Test Book" . - EOF - - CHECK_RESULT $? 0 0 "创建测试RDF文件" - - # 步骤6:执行测试命令(禁用后缀猜测且不输出结果) - LOG_INFO "步骤6:执行测试命令(禁用后缀猜测且不输出结果)" - rdfpipe --no-guess --no-output test_input.ttl > /dev/null 2>&1 - CHECK_RESULT $? 0 0 "执行rdfpipe命令(禁用后缀猜测且不输出结果)" - - # 步骤7:验证命令确实没有产生输出 - LOG_INFO "步骤7:验证命令没有产生输出" - if [ -f output.rdf ] || [ -f output.ttl ] || [ -f output.xml ]; then - LOG_ERROR "命令产生了输出文件" - exit 1 - fi - - # 步骤8:清理测试文件 - LOG_INFO "步骤8:清理测试文件" - rm -f test_input.ttl output.* 2>/dev/null - CHECK_RESULT $? 0 0 "清理测试文件" - - # 步骤9:恢复环境(如果测试前未安装,则卸载软件包) - LOG_INFO "步骤9:恢复环境状态" - if [ "$python_installed" = false ]; then - LOG_INFO "卸载python3-rdflib" - dnf remove -y python3-rdflib - CHECK_RESULT $? 0 0 "卸载python3-rdflib" - fi - - if [ "$rdfpipe_installed" = false ]; then - LOG_INFO "卸载rdfpipe" - dnf remove -y rdfpipe - CHECK_RESULT $? 0 0 "卸载rdfpipe" - fi - - LOG_INFO "测试完成:测试禁用后缀猜测且不输出结果" -} - -main "$@" \ No newline at end of file diff --git a/testcases/function_test/pkg_test/python-rdflib/python3-rdflib/test_python3-rdflib_rdfpipe_no_out.sh b/testcases/function_test/pkg_test/python-rdflib/python3-rdflib/test_python3-rdflib_rdfpipe_no_out.sh deleted file mode 100644 index ba6cde06040..00000000000 --- a/testcases/function_test/pkg_test/python-rdflib/python3-rdflib/test_python3-rdflib_rdfpipe_no_out.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-23 -# @License : Mulan PSL v2 -# @Desc : 测试仅检查输入有效性而不输出 -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - LOG_INFO "开始测试:测试仅检查输入有效性而不输出" - - # 检查yum源中是否有python3-rdflib包 - LOG_INFO "检查yum源中是否有python3-rdflib包" - dnf list available python3-rdflib 2>/dev/null | grep -q python3-rdflib - if [ $? -ne 0 ]; then - LOG_ERROR "yum源中未找到python3-rdflib包" - exit 255 - fi - - # 检查是否已安装python3-rdflib - LOG_INFO "检查是否已安装python3-rdflib" - rpm -q python3-rdflib >/dev/null 2>&1 - INSTALLED=$? - - # 如果未安装,则安装 - if [ $INSTALLED -ne 0 ]; then - LOG_INFO "安装python3-rdflib包" - dnf install -y python3-rdflib - CHECK_RESULT $? 0 0 "安装python3-rdflib失败" - fi - - # 检查rdfpipe命令是否存在 - LOG_INFO "检查rdfpipe命令是否存在" - command -v rdfpipe >/dev/null 2>&1 - if [ $? -ne 0 ]; then - LOG_ERROR "rdfpipe命令不存在" - # 如果是测试过程中安装的,需要卸载 - if [ $INSTALLED -ne 0 ]; then - dnf remove -y python3-rdflib - fi - exit 255 - fi - - # 测试rdfpipe的--help参数 - LOG_INFO "测试rdfpipe的--help参数" - rdfpipe --help >/dev/null 2>&1 - CHECK_RESULT $? 0 0 "rdfpipe --help执行失败" - - # 测试rdfpipe的无效参数 - LOG_INFO "测试rdfpipe的无效参数(应返回错误)" - rdfpipe --invalid-param 2>/dev/null - if [ $? -eq 0 ]; then - LOG_ERROR "无效参数被错误地接受" - # 如果是测试过程中安装的,需要卸载 - if [ $INSTALLED -ne 0 ]; then - dnf remove -y python3-rdflib - fi - exit 255 - fi - - # 测试仅检查输入有效性而不输出 - LOG_INFO "测试仅检查输入有效性而不输出" - echo " ." | rdfpipe --input-format ntriples --output-format ntriples 2>&1 | grep -q "ERROR\|error" - if [ $? -eq 0 ]; then - LOG_ERROR "输入有效性检查失败" - # 如果是测试过程中安装的,需要卸载 - if [ $INSTALLED -ne 0 ]; then - dnf remove -y python3-rdflib - fi - exit 1 - fi - - # 清理环境:如果测试前未安装,则卸载 - if [ $INSTALLED -ne 0 ]; then - LOG_INFO "卸载python3-rdflib包" - dnf remove -y python3-rdflib - CHECK_RESULT $? 0 0 "卸载python3-rdflib失败" - fi - - LOG_INFO "测试完成:测试仅检查输入有效性而不输出" -} - -main "$@" \ No newline at end of file diff --git a/testcases/function_test/pkg_test/python-rdflib/python3-rdflib/test_python3-rdflib_rdfpipe_ns.sh b/testcases/function_test/pkg_test/python-rdflib/python3-rdflib/test_python3-rdflib_rdfpipe_ns.sh deleted file mode 100644 index cf2a0908817..00000000000 --- a/testcases/function_test/pkg_test/python-rdflib/python3-rdflib/test_python3-rdflib_rdfpipe_ns.sh +++ /dev/null @@ -1,109 +0,0 @@ -#!/usr/bin/bash - -# Copyright (c) 2024 ISCAS .ALL rights reserved. -# This program is licensed under Mulan PSL v2. -# You can use it according to the terms and conditions of the Mulan PSL v2. -# http://license.coscl.org.cn/MulanPSL2 -# THIS PROGRAM IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, -# EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, -# MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. -# See the Mulan PSL v2 for more details. - -# ############################################# -# @Author : honghua -# @Contact : honghua@iscas.ac.cn -# @Date : 2026-03-23 -# @License : Mulan PSL v2 -# @Desc : 测试注册命名空间绑定 -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - # 判断是否已安装python3-rdflib - LOG_INFO "检查python3-rdflib是否已安装" - if dnf list installed python3-rdflib > /dev/null 2>&1; then - LOG_INFO "python3-rdflib已安装,测试结束后将保持安装状态" - ALREADY_INSTALLED=1 - else - LOG_INFO "python3-rdflib未安装,将在测试前安装并在测试后卸载" - ALREADY_INSTALLED=0 - fi - - # 检查yum源中是否有python3-rdflib软件包 - LOG_INFO "检查yum源中是否存在python3-rdflib软件包" - if ! dnf list available python3-rdflib > /dev/null 2>&1; then - LOG_ERROR "yum源中未找到python3-rdflib软件包" - exit 255 - fi - - # 如果未安装,则安装python3-rdflib - if [ ${ALREADY_INSTALLED} -eq 0 ]; then - LOG_INFO "安装python3-rdflib软件包" - dnf install -y python3-rdflib - CHECK_RESULT $? 0 0 "安装python3-rdflib失败" - fi - - # 检查rdfpipe命令是否存在 - LOG_INFO "检查rdfpipe命令是否存在" - if ! command -v rdfpipe > /dev/null 2>&1; then - LOG_ERROR "rdfpipe命令不存在" - if [ ${ALREADY_INSTALLED} -eq 0 ]; then - LOG_INFO "卸载python3-rdflib软件包" - dnf remove -y python3-rdflib - fi - exit 255 - fi - - # 检查rdfpipe是否支持--help参数 - LOG_INFO "检查rdfpipe命令是否支持--help参数" - if ! rdfpipe --help > /dev/null 2>&1; then - LOG_ERROR "rdfpipe命令不支持--help参数" - if [ ${ALREADY_INSTALLED} -eq 0 ]; then - LOG_INFO "卸载python3-rdflib软件包" - dnf remove -y python3-rdflib - fi - exit 255 - fi - - # 测试注册命名空间绑定 - LOG_INFO "开始测试注册命名空间绑定" - - # 创建一个简单的RDF文件用于测试 - LOG_INFO "创建测试RDF文件" - cat > test.rdf << EOF - @prefix rdf: . - @prefix ex: . - - ex:subject rdf:type ex:Class . - EOF - - # 使用rdfpipe命令测试命名空间绑定 - LOG_INFO "使用rdfpipe命令测试命名空间绑定" - rdfpipe --input-format=turtle --output-format=turtle test.rdf > output.ttl 2>&1 - CHECK_RESULT $? 0 0 "rdfpipe命令执行失败" - - # 检查输出文件是否包含预期的命名空间 - LOG_INFO "检查输出文件是否包含预期的命名空间" - if grep -q "http://example.org/" output.ttl; then - LOG_INFO "命名空间绑定测试成功" - else - LOG_ERROR "命名空间绑定测试失败" - CHECK_RESULT 1 0 0 "命名空间绑定测试失败" - fi - - # 清理测试文件 - LOG_INFO "清理测试文件" - rm -f test.rdf output.ttl - - # 如果测试前未安装,则卸载python3-rdflib - if [ ${ALREADY_INSTALLED} -eq 0 ]; then - LOG_INFO "卸载python3-rdflib软件包" - dnf remove -y python3-rdflib - CHECK_RESULT $? 0 0 "卸载python3-rdflib失败" - fi - - LOG_INFO "测试脚本执行完成" -} - -main "$@" \ No newline at end of file diff --git a/testcases/function_test/pkg_test/python-rdflib/python3-rdflib/test_python3-rdflib_rdfpipe_o.sh b/testcases/function_test/pkg_test/python-rdflib/python3-rdflib/test_python3-rdflib_rdfpipe_o.sh deleted file mode 100644 index b59b193c686..00000000000 --- a/testcases/function_test/pkg_test/python-rdflib/python3-rdflib/test_python3-rdflib_rdfpipe_o.sh +++ /dev/null @@ -1,119 +0,0 @@ -#!/usr/bin/bash - -# Copyright (c) 2024 ISCAS .ALL rights reserved. -# This program is licensed under Mulan PSL v2. -# You can use it according to the terms and conditions of the Mulan PSL v2. -# http://license.coscl.org.cn/MulanPSL2 -# THIS PROGRAM IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, -# EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, -# MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. -# See the Mulan PSL v2 for more details. - -# ############################################# -# @Author : honghua -# @Contact : honghua@iscas.ac.cn -# @Date : 2026-03-23 -# @License : Mulan PSL v2 -# @Desc : 测试指定输出文件格式 -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - # 环境检查:是否已安装python3-rdflib和rdfpipe - LOG_INFO "检查是否已安装python3-rdflib和rdfpipe" - if rpm -q python3-rdflib >/dev/null 2>&1 && command -v rdfpipe >/dev/null 2>&1; then - LOG_INFO "python3-rdflib和rdfpipe已安装,标记为已安装状态" - INSTALLED=true - else - LOG_INFO "python3-rdflib和rdfpipe未安装,标记为未安装状态" - INSTALLED=false - fi - - # 检查yum源中是否有python3-rdflib软件包 - LOG_INFO "检查yum源中是否有python3-rdflib软件包" - if ! dnf list available python3-rdflib >/dev/null 2>&1; then - LOG_ERROR "yum源中未找到python3-rdflib软件包" - exit 255 - fi - - # 检查yum源中是否有rdfpipe软件包 - LOG_INFO "检查yum源中是否有rdfpipe软件包" - if ! dnf list available rdfpipe >/dev/null 2>&1; then - LOG_ERROR "yum源中未找到rdfpipe软件包" - exit 255 - fi - - # 如果未安装,则安装软件包 - if [ "$INSTALLED" = false ]; then - LOG_INFO "开始安装python3-rdflib和rdfpipe软件包" - dnf install -y python3-rdflib rdfpipe - CHECK_RESULT $? 0 0 "安装python3-rdflib和rdfpipe失败" - LOG_INFO "python3-rdflib和rdfpipe安装成功" - fi - - # 测试指定输出文件格式 - LOG_INFO "测试指定输出文件格式" - # 创建测试用的RDF数据文件 - cat > test_input.ttl << EOF - @prefix dc: . - @prefix ex: . - - ex:book1 dc:title "Test Book" . - EOF - - # 测试rdfpipe命令是否支持--output-format参数 - LOG_INFO "检查rdfpipe命令是否支持--output-format参数" - if ! rdfpipe --help 2>&1 | grep -q "output-format"; then - LOG_ERROR "rdfpipe命令不支持--output-format参数" - # 清理测试文件 - rm -f test_input.ttl test_output.xml - # 如果之前未安装,则卸载软件包 - if [ "$INSTALLED" = false ]; then - LOG_INFO "卸载python3-rdflib和rdfpipe软件包" - dnf remove -y python3-rdflib rdfpipe - CHECK_RESULT $? 0 0 "卸载python3-rdflib和rdfpipe失败" - fi - exit 255 - fi - - # 执行rdfpipe命令,指定输出格式为RDF/XML - LOG_INFO "执行rdfpipe命令,将Turtle格式转换为RDF/XML格式" - rdfpipe --output-format xml test_input.ttl > test_output.xml - CHECK_RESULT $? 0 0 "rdfpipe命令执行失败" - - # 检查输出文件是否包含RDF/XML特征 - LOG_INFO "检查输出文件是否包含RDF/XML格式的特征" - if grep -q "rdf:RDF" test_output.xml && grep -q "xmlns:rdf" test_output.xml; then - LOG_INFO "输出文件格式正确,为RDF/XML格式" - else - LOG_ERROR "输出文件格式不正确,不是RDF/XML格式" - # 清理测试文件 - rm -f test_input.ttl test_output.xml - # 如果之前未安装,则卸载软件包 - if [ "$INSTALLED" = false ]; then - LOG_INFO "卸载python3-rdflib和rdfpipe软件包" - dnf remove -y python3-rdflib rdfpipe - CHECK_RESULT $? 0 0 "卸载python3-rdflib和rdfpipe失败" - fi - exit 1 - fi - - # 清理测试文件 - LOG_INFO "清理测试文件" - rm -f test_input.ttl test_output.xml - - # 如果测试开始时未安装软件包,则在测试结束后卸载 - if [ "$INSTALLED" = false ]; then - LOG_INFO "卸载python3-rdflib和rdfpipe软件包" - dnf remove -y python3-rdflib rdfpipe - CHECK_RESULT $? 0 0 "卸载python3-rdflib和rdfpipe失败" - LOG_INFO "python3-rdflib和rdfpipe卸载成功" - else - LOG_INFO "保持python3-rdflib和rdfpipe的安装状态" - fi - - LOG_INFO "测试指定输出文件格式完成" -} - -main "$@" \ No newline at end of file diff --git a/testcases/function_test/pkg_test/python-rdflib/python3-rdflib/test_python3-rdflib_rdfpipe_o_format_keywords.sh b/testcases/function_test/pkg_test/python-rdflib/python3-rdflib/test_python3-rdflib_rdfpipe_o_format_keywords.sh deleted file mode 100644 index b5b773ddc68..00000000000 --- a/testcases/function_test/pkg_test/python-rdflib/python3-rdflib/test_python3-rdflib_rdfpipe_o_format_keywords.sh +++ /dev/null @@ -1,93 +0,0 @@ -#!/usr/bin/bash - -# Copyright (c) 2024 ISCAS .ALL rights reserved. -# This program is licensed under Mulan PSL v2. -# You can use it according to the terms and conditions of the Mulan PSL v2. -# http://license.coscl.org.cn/MulanPSL2 -# THIS PROGRAM IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, -# EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, -# MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. -# See the Mulan PSL v2 for more details. - -# ############################################# -# @Author : honghua -# @Contact : honghua@iscas.ac.cn -# @Date : 2026-03-23 -# @License : Mulan PSL v2 -# @Desc : 测试为输出格式指定序列化器关键字 -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - # 定义变量 - PYTHON_PACKAGE="python3-rdflib" - RDFPIPE_CMD="rdfpipe" - EXPECTED_FORMATS="xml n3 turtle nt nquads trig trix json-ld hext rdfa microdata" - INSTALLED_BEFORE=false - - # 步骤1:检查是否已安装python3-rdflib - LOG_INFO "步骤1:检查是否已安装python3-rdflib" - if rpm -q $PYTHON_PACKAGE > /dev/null 2>&1; then - LOG_INFO "$PYTHON_PACKAGE 已安装" - INSTALLED_BEFORE=true - else - LOG_INFO "$PYTHON_PACKAGE 未安装" - fi - - # 步骤2:检查yum源中是否有python3-rdflib软件包 - LOG_INFO "步骤2:检查yum源中是否有python3-rdflib软件包" - if ! dnf list available $PYTHON_PACKAGE > /dev/null 2>&1; then - LOG_ERROR "yum源中未找到 $PYTHON_PACKAGE 软件包" - exit 255 - fi - - # 步骤3:如果未安装,则安装python3-rdflib - if ! $INSTALLED_BEFORE; then - LOG_INFO "步骤3:安装python3-rdflib" - dnf install -y $PYTHON_PACKAGE - CHECK_RESULT $? 0 0 "安装python3-rdflib失败" - fi - - # 步骤4:检查rdfpipe命令是否存在 - LOG_INFO "步骤4:检查rdfpipe命令是否存在" - if ! command -v $RDFPIPE_CMD > /dev/null 2>&1; then - LOG_ERROR "rdfpipe命令不存在" - if ! $INSTALLED_BEFORE; then - dnf remove -y $PYTHON_PACKAGE - fi - exit 255 - fi - - # 步骤5:检查rdfpipe是否支持-o参数 - LOG_INFO "步骤5:检查rdfpipe是否支持-o参数" - if ! $RDFPIPE_CMD --help 2>&1 | grep -q -- "-o"; then - LOG_ERROR "rdfpipe不支持-o参数" - if ! $INSTALLED_BEFORE; then - dnf remove -y $PYTHON_PACKAGE - fi - exit 255 - fi - - # 步骤6:测试为输出格式指定序列化器关键字 - LOG_INFO "步骤6:测试为输出格式指定序列化器关键字" - for format in $EXPECTED_FORMATS; do - LOG_INFO "测试输出格式: $format" - echo " ." | $RDFPIPE_CMD -i ntriples -o $format - 2>&1 - CHECK_RESULT $? 0 0 "输出格式 $format 测试失败" - done - - # 步骤7:清理环境 - LOG_INFO "步骤7:清理环境" - if ! $INSTALLED_BEFORE; then - LOG_INFO "卸载python3-rdflib" - dnf remove -y $PYTHON_PACKAGE - CHECK_RESULT $? 0 0 "卸载python3-rdflib失败" - else - LOG_INFO "保持python3-rdflib安装状态" - fi - - LOG_INFO "测试完成" -} - -main "$@" \ No newline at end of file diff --git a/testcases/function_test/pkg_test/python-rdflib/python3-rdflib/test_python3-rdflib_rdfpipe_o_w.sh b/testcases/function_test/pkg_test/python-rdflib/python3-rdflib/test_python3-rdflib_rdfpipe_o_w.sh deleted file mode 100644 index e5c11c09585..00000000000 --- a/testcases/function_test/pkg_test/python-rdflib/python3-rdflib/test_python3-rdflib_rdfpipe_o_w.sh +++ /dev/null @@ -1,114 +0,0 @@ -#!/usr/bin/bash - -# Copyright (c) 2024 ISCAS .ALL rights reserved. -# This program is licensed under Mulan PSL v2. -# You can use it according to the terms and conditions of the Mulan PSL v2. -# http://license.coscl.org.cn/MulanPSL2 -# THIS PROGRAM IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, -# EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, -# MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. -# See the Mulan PSL v2 for more details. - -# ############################################# -# @Author : honghua -# @Contact : honghua@iscas.ac.cn -# @Date : 2026-03-23 -# @License : Mulan PSL v2 -# @Desc : 测试指定输出格式并启用警告输出 -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - # 定义软件包名称 - PACKAGE_NAME="python3-rdflib" - - # 步骤1:检查yum源中是否存在指定软件包 - LOG_INFO "步骤1:检查yum源中是否存在软件包 $PACKAGE_NAME" - dnf list available $PACKAGE_NAME &>/dev/null - if [ $? -ne 0 ]; then - LOG_ERROR "软件包 $PACKAGE_NAME 在yum源中不存在" - exit 255 - fi - - # 步骤2:检查是否已安装软件包 - LOG_INFO "步骤2:检查是否已安装软件包 $PACKAGE_NAME" - IS_INSTALLED=0 - if rpm -q $PACKAGE_NAME &>/dev/null; then - LOG_INFO "软件包 $PACKAGE_NAME 已安装" - IS_INSTALLED=1 - else - LOG_INFO "软件包 $PACKAGE_NAME 未安装" - fi - - # 步骤3:如果未安装,则安装软件包 - if [ $IS_INSTALLED -eq 0 ]; then - LOG_INFO "步骤3:安装软件包 $PACKAGE_NAME" - dnf install -y $PACKAGE_NAME - CHECK_RESULT $? 0 0 "安装软件包 $PACKAGE_NAME 失败" - fi - - # 步骤4:测试指定输出格式并启用警告输出 - LOG_INFO "步骤4:测试指定输出格式并启用警告输出" - # 检查rdfpipe命令是否存在 - if ! command -v rdfpipe &>/dev/null; then - LOG_ERROR "命令 rdfpipe 不存在" - exit 255 - fi - - # 检查rdfpipe是否支持-o参数 - rdfpipe --help 2>&1 | grep -q "\-o" - if [ $? -ne 0 ]; then - LOG_ERROR "命令 rdfpipe 不支持 -o 参数" - exit 255 - fi - - # 检查rdfpipe是否支持-w参数 - rdfpipe --help 2>&1 | grep -q "\-w" - if [ $? -ne 0 ]; then - LOG_ERROR "命令 rdfpipe 不支持 -w 参数" - exit 255 - fi - - # 创建一个简单的RDF文件用于测试 - LOG_INFO "创建测试RDF文件" - cat > test_input.ttl << EOF - @prefix dc: . - @prefix ex: . - - ex:book1 dc:title "Test Book" . - EOF - - # 测试指定输出格式为turtle并启用警告输出 - LOG_INFO "测试rdfpipe命令:指定输出格式为turtle并启用警告输出" - rdfpipe -o turtle -w test_input.ttl > test_output.ttl 2>&1 - CHECK_RESULT $? 0 0 "执行rdfpipe命令失败" - - # 检查输出文件是否生成且非空 - LOG_INFO "检查输出文件" - if [ -s "test_output.ttl" ]; then - LOG_INFO "输出文件生成成功" - else - LOG_ERROR "输出文件生成失败或为空" - exit 1 - fi - - # 步骤5:清理测试文件 - LOG_INFO "步骤5:清理测试文件" - rm -f test_input.ttl test_output.ttl - CHECK_RESULT $? 0 0 "清理测试文件失败" - - # 步骤6:恢复环境状态 - LOG_INFO "步骤6:恢复环境状态" - if [ $IS_INSTALLED -eq 0 ]; then - LOG_INFO "卸载软件包 $PACKAGE_NAME" - dnf remove -y $PACKAGE_NAME - CHECK_RESULT $? 0 0 "卸载软件包 $PACKAGE_NAME 失败" - else - LOG_INFO "保持软件包 $PACKAGE_NAME 安装状态" - fi - - LOG_INFO "测试完成" -} - -main "$@" \ No newline at end of file diff --git a/testcases/function_test/pkg_test/python-rdflib/python3-rdflib/test_python3-rdflib_rdfpipe_stdin.sh b/testcases/function_test/pkg_test/python-rdflib/python3-rdflib/test_python3-rdflib_rdfpipe_stdin.sh deleted file mode 100644 index 84b47227fdc..00000000000 --- a/testcases/function_test/pkg_test/python-rdflib/python3-rdflib/test_python3-rdflib_rdfpipe_stdin.sh +++ /dev/null @@ -1,103 +0,0 @@ -#!/usr/bin/bash - -# Copyright (c) 2024 ISCAS .ALL rights reserved. -# This program is licensed under Mulan PSL v2. -# You can use it according to the terms and conditions of the Mulan PSL v2. -# http://license.coscl.org.cn/MulanPSL2 -# THIS PROGRAM IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, -# EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, -# MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. -# See the Mulan PSL v2 for more details. - -# ############################################# -# @Author : honghua -# @Contact : honghua@iscas.ac.cn -# @Date : 2026-03-23 -# @License : Mulan PSL v2 -# @Desc : 测试从标准输入读取数据 -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - # 测试从标准输入读取数据 - - LOG_INFO "1. 检查环境中是否已安装python3-rdflib软件包" - rpm -q python3-rdflib - if [ $? -eq 0 ]; then - LOG_INFO "python3-rdflib已安装,记录安装状态" - INSTALLED=1 - else - LOG_INFO "python3-rdflib未安装" - INSTALLED=0 - fi - - LOG_INFO "2. 检查yum源中是否存在python3-rdflib软件包" - dnf list available python3-rdflib - if [ $? -ne 0 ]; then - LOG_ERROR "yum源中未找到python3-rdflib软件包" - exit 255 - fi - - if [ $INSTALLED -eq 0 ]; then - LOG_INFO "3. 安装python3-rdflib软件包" - dnf install -y python3-rdflib - CHECK_RESULT $? 0 0 "安装python3-rdflib失败" - fi - - LOG_INFO "4. 验证rdfpipe命令是否可用" - which rdfpipe - CHECK_RESULT $? 0 0 "rdfpipe命令不存在" - - LOG_INFO "5. 测试rdfpipe命令的参数支持情况" - rdfpipe --help 2>&1 | grep -q "\-\-help" - CHECK_RESULT $? 0 0 "rdfpipe不支持--help参数" - - LOG_INFO "6. 准备测试数据" - cat > test_input.ttl << EOF - @prefix ex: . - ex:subject ex:predicate ex:object . - EOF - CHECK_RESULT $? 0 0 "创建测试输入文件失败" - - LOG_INFO "7. 测试从标准输入读取数据" - cat test_input.ttl | rdfpipe -i turtle -o ntriples - - CHECK_RESULT $? 0 0 "从标准输入读取数据失败" - - LOG_INFO "8. 测试无效参数处理" - rdfpipe --invalid-param 2>&1 - if [ $? -ne 255 ] && [ $? -ne 1 ]; then - LOG_ERROR "无效参数未正确处理" - exit 255 - fi - - LOG_INFO "9. 清理测试文件" - rm -f test_input.ttl - CHECK_RESULT $? 0 0 "删除测试文件失败" - - if [ $INSTALLED -eq 0 ]; then - LOG_INFO "10. 卸载测试安装的软件包" - dnf remove -y python3-rdflib - CHECK_RESULT $? 0 0 "卸载python3-rdflib失败" - else - LOG_INFO "10. 保持原有安装状态,不卸载软件包" - fi - - LOG_INFO "11. 验证环境已恢复" - if [ $INSTALLED -eq 0 ]; then - rpm -q python3-rdflib - if [ $? -eq 0 ]; then - LOG_ERROR "环境恢复失败,软件包未正确卸载" - exit 1 - fi - LOG_INFO "环境已恢复,软件包已卸载" - else - rpm -q python3-rdflib - CHECK_RESULT $? 0 0 "环境状态异常,原有软件包丢失" - LOG_INFO "环境已恢复,保持原有安装状态" - fi - - LOG_INFO "测试完成" -} - -main "$@" \ No newline at end of file diff --git a/testcases/function_test/pkg_test/python-rdflib/python3-rdflib/test_python3-rdflib_rdfpipe_version.sh b/testcases/function_test/pkg_test/python-rdflib/python3-rdflib/test_python3-rdflib_rdfpipe_version.sh deleted file mode 100644 index 2d3a96ad15e..00000000000 --- a/testcases/function_test/pkg_test/python-rdflib/python3-rdflib/test_python3-rdflib_rdfpipe_version.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-23 -# @License : Mulan PSL v2 -# @Desc : 测试显示程序版本号 -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - # 定义软件包名称 - PACKAGE_NAME="python3-rdflib" - - # 检查yum源中是否存在指定软件包 - 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 "检查是否已安装${PACKAGE_NAME}软件包" - rpm -q ${PACKAGE_NAME} &>/dev/null - if [ $? -eq 0 ]; then - ALREADY_INSTALLED=true - LOG_INFO "${PACKAGE_NAME}已安装" - else - ALREADY_INSTALLED=false - 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}失败" - fi - - # 检查rdfpipe命令是否存在 - LOG_INFO "检查rdfpipe命令是否存在" - which rdfpipe &>/dev/null - if [ $? -ne 0 ]; then - LOG_ERROR "rdfpipe命令不存在" - # 如果是测试过程中安装的,需要卸载 - if [ "${ALREADY_INSTALLED}" = "false" ]; then - LOG_INFO "卸载${PACKAGE_NAME}软件包" - dnf remove -y ${PACKAGE_NAME} - fi - exit 255 - fi - - # 检查--version参数是否支持 - LOG_INFO "检查rdfpipe命令是否支持--version参数" - rdfpipe --help 2>&1 | grep -q "\-\-version" - if [ $? -ne 0 ]; then - LOG_ERROR "rdfpipe命令不支持--version参数" - # 如果是测试过程中安装的,需要卸载 - if [ "${ALREADY_INSTALLED}" = "false" ]; then - LOG_INFO "卸载${PACKAGE_NAME}软件包" - dnf remove -y ${PACKAGE_NAME} - fi - exit 255 - fi - - # 测试显示程序版本号 - LOG_INFO "测试显示程序版本号" - rdfpipe --version - CHECK_RESULT $? 0 0 "执行rdfpipe --version失败" - - # 清理环境 - LOG_INFO "清理测试环境" - if [ "${ALREADY_INSTALLED}" = "false" ]; then - LOG_INFO "卸载${PACKAGE_NAME}软件包" - dnf remove -y ${PACKAGE_NAME} - CHECK_RESULT $? 0 0 "卸载${PACKAGE_NAME}失败" - else - LOG_INFO "保持${PACKAGE_NAME}安装状态" - fi - - LOG_INFO "测试完成" -} - -main "$@" \ No newline at end of file diff --git a/testcases/function_test/pkg_test/python-rdflib/python3-rdflib/test_python3-rdflib_rdfpipe_w.sh b/testcases/function_test/pkg_test/python-rdflib/python3-rdflib/test_python3-rdflib_rdfpipe_w.sh deleted file mode 100644 index 3618a4f5eec..00000000000 --- a/testcases/function_test/pkg_test/python-rdflib/python3-rdflib/test_python3-rdflib_rdfpipe_w.sh +++ /dev/null @@ -1,104 +0,0 @@ -#!/usr/bin/bash - -# Copyright (c) 2024 ISCAS .ALL rights reserved. -# This program is licensed under Mulan PSL v2. -# You can use it according to the terms and conditions of the Mulan PSL v2. -# http://license.coscl.org.cn/MulanPSL2 -# THIS PROGRAM IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, -# EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-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-23 -# @License : Mulan PSL v2 -# @Desc : 测试输出警告信息到标准错误 -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - # 测试脚本:测试输出警告信息到标准错误 - # 脚本功能:测试python3-rdflib的rdfpipe命令输出警告信息到标准错误 - - # 定义软件包名称 - PACKAGE_NAME="python3-rdflib" - COMMAND_NAME="rdfpipe" - - # 步骤1:检查yum源中是否存在指定软件包 - LOG_INFO "步骤1:检查yum源中是否存在软件包 ${PACKAGE_NAME}" - dnf list available ${PACKAGE_NAME} > /dev/null 2>&1 - if [ $? -ne 0 ]; then - LOG_ERROR "软件包 ${PACKAGE_NAME} 在yum源中不存在" - exit 255 - fi - - # 步骤2:检查系统是否已安装指定软件包 - LOG_INFO "步骤2:检查系统是否已安装软件包 ${PACKAGE_NAME}" - if rpm -q ${PACKAGE_NAME} > /dev/null 2>&1; then - LOG_INFO "软件包 ${PACKAGE_NAME} 已安装,脚本结束时将保持安装状态" - ALREADY_INSTALLED=1 - else - LOG_INFO "软件包 ${PACKAGE_NAME} 未安装,将在测试过程中安装" - ALREADY_INSTALLED=0 - fi - - # 步骤3:如果未安装,则安装软件包 - if [ ${ALREADY_INSTALLED} -eq 0 ]; then - LOG_INFO "步骤3:安装软件包 ${PACKAGE_NAME}" - dnf install -y ${PACKAGE_NAME} - CHECK_RESULT $? 0 0 "安装软件包 ${PACKAGE_NAME} 失败" - fi - - # 步骤4:检查rdfpipe命令是否存在 - LOG_INFO "步骤4:检查 ${COMMAND_NAME} 命令是否存在" - which ${COMMAND_NAME} > /dev/null 2>&1 - CHECK_RESULT $? 0 0 "命令 ${COMMAND_NAME} 不存在" - - # 步骤5:测试rdfpipe命令的参数支持情况 - LOG_INFO "步骤5:测试 ${COMMAND_NAME} 命令的参数支持情况" - ${COMMAND_NAME} --help > /dev/null 2>&1 - if [ $? -ne 0 ]; then - LOG_ERROR "命令 ${COMMAND_NAME} 不支持--help参数" - exit 255 - fi - - # 步骤6:测试输出警告信息到标准错误 - LOG_INFO "步骤6:测试输出警告信息到标准错误" - # 创建一个无效的RDF文件用于触发警告 - INVALID_RDF_FILE="/tmp/invalid_rdf.ttl" - echo "This is not a valid RDF file" > ${INVALID_RDF_FILE} - - # 执行rdfpipe命令并捕获标准错误输出 - ERROR_OUTPUT=$(${COMMAND_NAME} ${INVALID_RDF_FILE} 2>&1 > /dev/null) - ERROR_CODE=$? - - # 检查是否有错误输出(警告信息通常输出到标准错误) - if [ -n "${ERROR_OUTPUT}" ]; then - LOG_INFO "检测到标准错误输出:${ERROR_OUTPUT}" - CHECK_RESULT $? 0 0 "未检测到标准错误输出" - else - LOG_ERROR "未检测到标准错误输出" - CHECK_RESULT 1 0 0 "测试失败:未输出警告信息到标准错误" - fi - - # 清理临时文件 - LOG_INFO "清理临时文件" - rm -f ${INVALID_RDF_FILE} - - # 步骤7:环境恢复 - LOG_INFO "步骤7:环境恢复" - if [ ${ALREADY_INSTALLED} -eq 0 ]; then - LOG_INFO "卸载测试安装的软件包 ${PACKAGE_NAME}" - dnf remove -y ${PACKAGE_NAME} - CHECK_RESULT $? 0 0 "卸载软件包 ${PACKAGE_NAME} 失败" - else - LOG_INFO "保持软件包 ${PACKAGE_NAME} 的安装状态" - fi - - LOG_INFO "测试脚本执行完成" -} - -main "$@" \ No newline at end of file diff --git a/testcases/function_test/pkg_test/python-rdflib/python3-rdflib/test_python3-rdflib_rdfs2dot_f_o.sh b/testcases/function_test/pkg_test/python-rdflib/python3-rdflib/test_python3-rdflib_rdfs2dot_f_o.sh deleted file mode 100644 index 8b80cc041fe..00000000000 --- a/testcases/function_test/pkg_test/python-rdflib/python3-rdflib/test_python3-rdflib_rdfs2dot_f_o.sh +++ /dev/null @@ -1,113 +0,0 @@ -#!/usr/bin/bash - -# Copyright (c) 2024 ISCAS .ALL rights reserved. -# This program is licensed under Mulan PSL v2. -# You can use it according to the terms and conditions of the Mulan PSL v2. -# http://license.coscl.org.cn/MulanPSL2 -# THIS PROGRAM IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, -# EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-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-23 -# @License : Mulan PSL v2 -# @Desc : 测试同时使用 -f 和 -o 参数 -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - LOG_INFO "开始测试:测试同时使用 -f 和 -o 参数" - - LOG_INFO "步骤1:检查环境中是否已安装python3-rdflib软件包" - if dnf list installed python3-rdflib &>/dev/null; then - LOG_INFO "python3-rdflib已安装,脚本结束后将保持安装状态" - INSTALLED_BEFORE=true - else - LOG_INFO "python3-rdflib未安装,将在测试步骤中安装,并在脚本结束前卸载" - INSTALLED_BEFORE=false - fi - - LOG_INFO "步骤2:检查yum源中是否存在python3-rdflib软件包" - if ! dnf list available python3-rdflib &>/dev/null; then - LOG_ERROR "yum源中未找到python3-rdflib软件包" - exit 255 - fi - - if [ "$INSTALLED_BEFORE" = false ]; then - LOG_INFO "步骤3:安装python3-rdflib软件包" - dnf install -y python3-rdflib - CHECK_RESULT $? 0 0 "安装python3-rdflib失败" - fi - - LOG_INFO "步骤4:检查rdfs2dot命令是否可用" - if ! command -v rdfs2dot &>/dev/null; then - LOG_ERROR "未找到rdfs2dot命令" - if [ "$INSTALLED_BEFORE" = false ]; then - dnf remove -y python3-rdflib - fi - exit 255 - fi - - LOG_INFO "步骤5:检查rdfs2dot命令是否支持-f和-o参数" - if ! rdfs2dot --help 2>&1 | grep -q -- "-f\|-o"; then - LOG_ERROR "rdfs2dot命令不支持-f或-o参数" - if [ "$INSTALLED_BEFORE" = false ]; then - dnf remove -y python3-rdflib - fi - exit 255 - fi - - LOG_INFO "步骤6:准备测试输入文件test_input.rdf" - cat > test_input.rdf << "EOF" - - - - Person - - - EOF - CHECK_RESULT $? 0 0 "创建测试输入文件失败" - - LOG_INFO "步骤7:执行rdfs2dot命令,同时使用-f和-o参数" - rdfs2dot -f test_input.rdf -o test_output.dot - CHECK_RESULT $? 0 0 "执行rdfs2dot命令失败" - - LOG_INFO "步骤8:检查输出文件是否生成" - if [ -f test_output.dot ]; then - LOG_INFO "输出文件test_output.dot已生成" - CHECK_RESULT $? 0 0 "输出文件未生成" - else - LOG_ERROR "输出文件test_output.dot未生成" - CHECK_RESULT 1 0 0 "输出文件未生成" - fi - - LOG_INFO "步骤9:检查输出文件内容是否有效" - if [ -s test_output.dot ]; then - LOG_INFO "输出文件test_output.dot内容有效" - CHECK_RESULT $? 0 0 "输出文件内容无效" - else - LOG_ERROR "输出文件test_output.dot内容为空" - CHECK_RESULT 1 0 0 "输出文件内容为空" - fi - - LOG_INFO "步骤10:清理测试文件" - rm -f test_input.rdf test_output.dot - CHECK_RESULT $? 0 0 "清理测试文件失败" - - if [ "$INSTALLED_BEFORE" = false ]; then - LOG_INFO "步骤11:卸载python3-rdflib软件包" - dnf remove -y python3-rdflib - CHECK_RESULT $? 0 0 "卸载python3-rdflib失败" - else - LOG_INFO "步骤11:保持python3-rdflib软件包安装状态" - fi - - LOG_INFO "测试完成:同时使用-f和-o参数测试通过" -} - -main "$@" \ No newline at end of file diff --git a/testcases/function_test/pkg_test/python-rdflib/python3-rdflib/test_python3-rdflib_rdfs2dot_h.sh b/testcases/function_test/pkg_test/python-rdflib/python3-rdflib/test_python3-rdflib_rdfs2dot_h.sh deleted file mode 100644 index 94501a9d67f..00000000000 --- a/testcases/function_test/pkg_test/python-rdflib/python3-rdflib/test_python3-rdflib_rdfs2dot_h.sh +++ /dev/null @@ -1,93 +0,0 @@ -#!/usr/bin/bash - -# Copyright (c) 2024 ISCAS .ALL rights reserved. -# This program is licensed under Mulan PSL v2. -# You can use it according to the terms and conditions of the Mulan PSL v2. -# http://license.coscl.org.cn/MulanPSL2 -# THIS PROGRAM IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, -# EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, -# MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. -# See the Mulan PSL v2 for more details. - -# ############################################# -# @Author : honghua -# @Contact : honghua@iscas.ac.cn -# @Date : 2026-03-23 -# @License : Mulan PSL v2 -# @Desc : 测试使用 -h 参数显示帮助信息 -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - # 初始化变量 - SCRIPT_NAME="test_python3-rdflib_rdfs2dot_h" - PACKAGE_NAME="python3-rdflib" - COMMAND="rdfs2dot" - EXPECTED_PARAM="-h" - NODE2_IPV4="" - NODE2_PASSWORD="" - NODE2_USER="" - - # 步骤1:检查软件包是否在yum源中 - LOG_INFO "步骤1:检查软件包是否在yum源中" - dnf list available ${PACKAGE_NAME} &>/dev/null - if [ $? -ne 0 ]; then - LOG_ERROR "软件包 ${PACKAGE_NAME} 不在yum源中" - exit 255 - fi - - # 步骤2:检查软件包是否已安装 - LOG_INFO "步骤2:检查软件包是否已安装" - rpm -q ${PACKAGE_NAME} &>/dev/null - PACKAGE_INSTALLED=$? - - if [ ${PACKAGE_INSTALLED} -eq 0 ]; then - LOG_INFO "软件包 ${PACKAGE_NAME} 已安装" - else - LOG_INFO "软件包 ${PACKAGE_NAME} 未安装,将进行安装" - dnf install -y ${PACKAGE_NAME} - CHECK_RESULT $? 0 0 "安装软件包 ${PACKAGE_NAME} 失败" - fi - - # 步骤3:检查命令是否存在 - LOG_INFO "步骤3:检查命令 ${COMMAND} 是否存在" - which ${COMMAND} &>/dev/null - if [ $? -ne 0 ]; then - LOG_ERROR "命令 ${COMMAND} 不存在" - if [ ${PACKAGE_INSTALLED} -ne 0 ]; then - dnf remove -y ${PACKAGE_NAME} - fi - exit 255 - fi - - # 步骤4:检查参数是否存在 - LOG_INFO "步骤4:检查参数 ${EXPECTED_PARAM} 是否存在" - ${COMMAND} ${EXPECTED_PARAM} 2>&1 | grep -q "usage\|Usage\|help\|Help" - if [ $? -ne 0 ]; then - LOG_ERROR "参数 ${EXPECTED_PARAM} 不存在或不支持" - if [ ${PACKAGE_INSTALLED} -ne 0 ]; then - dnf remove -y ${PACKAGE_NAME} - fi - exit 255 - fi - - # 步骤5:执行命令并检查结果 - LOG_INFO "步骤5:执行命令 ${COMMAND} ${EXPECTED_PARAM}" - ${COMMAND} ${EXPECTED_PARAM} &>/dev/null - CHECK_RESULT $? 0 0 "执行命令 ${COMMAND} ${EXPECTED_PARAM} 失败" - - # 步骤6:清理环境 - LOG_INFO "步骤6:清理环境" - if [ ${PACKAGE_INSTALLED} -ne 0 ]; then - 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-rdflib/python3-rdflib/test_python3-rdflib_rdfs2dot_no_args.sh b/testcases/function_test/pkg_test/python-rdflib/python3-rdflib/test_python3-rdflib_rdfs2dot_no_args.sh deleted file mode 100644 index a3db777a58a..00000000000 --- a/testcases/function_test/pkg_test/python-rdflib/python3-rdflib/test_python3-rdflib_rdfs2dot_no_args.sh +++ /dev/null @@ -1,80 +0,0 @@ -#!/usr/bin/bash - -# Copyright (c) 2024 ISCAS .ALL rights reserved. -# This program is licensed under Mulan PSL v2. -# You can use it according to the terms and conditions of the Mulan PSL v2. -# http://license.coscl.org.cn/MulanPSL2 -# THIS PROGRAM IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, -# EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, -# MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. -# See the Mulan PSL v2 for more details. - -# ############################################# -# @Author : honghua -# @Contact : honghua@iscas.ac.cn -# @Date : 2026-03-23 -# @License : Mulan PSL v2 -# @Desc : 测试不带任何参数运行rdfs2dot命令 -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - LOG_INFO "开始测试:不带任何参数运行rdfs2dot命令" - - # 检查软件包是否在yum源中 - LOG_INFO "检查python3-rdflib软件包是否在yum源中" - dnf list python3-rdflib 2>/dev/null | grep -q "python3-rdflib" - if [ $? -ne 0 ]; then - LOG_ERROR "python3-rdflib软件包不在yum源中" - exit 255 - fi - - # 检查是否已安装 - LOG_INFO "检查python3-rdflib是否已安装" - rpm -q python3-rdflib > /dev/null 2>&1 - if [ $? -eq 0 ]; then - LOG_INFO "python3-rdflib已安装,标记为无需清理" - NEED_CLEANUP=0 - else - LOG_INFO "python3-rdflib未安装,标记为需要清理" - NEED_CLEANUP=1 - fi - - # 如果未安装则安装 - if [ $NEED_CLEANUP -eq 1 ]; then - LOG_INFO "安装python3-rdflib软件包" - dnf install -y python3-rdflib - CHECK_RESULT $? 0 0 "安装python3-rdflib失败" - fi - - # 检查rdfs2dot命令是否存在 - LOG_INFO "检查rdfs2dot命令是否存在" - which rdfs2dot > /dev/null 2>&1 - if [ $? -ne 0 ]; then - LOG_ERROR "rdfs2dot命令不存在" - if [ $NEED_CLEANUP -eq 1 ]; then - LOG_INFO "清理环境:卸载python3-rdflib" - dnf remove -y python3-rdflib - fi - exit 255 - fi - - # 测试不带参数运行rdfs2dot - LOG_INFO "执行不带参数的rdfs2dot命令" - rdfs2dot - CHECK_RESULT $? 1 0 "不带参数运行rdfs2dot命令应该失败但实际成功" - - # 环境清理 - if [ $NEED_CLEANUP -eq 1 ]; then - LOG_INFO "清理环境:卸载python3-rdflib" - dnf remove -y python3-rdflib - CHECK_RESULT $? 0 0 "卸载python3-rdflib失败" - else - LOG_INFO "保持python3-rdflib安装状态" - fi - - LOG_INFO "测试完成" -} - -main "$@" \ No newline at end of file diff --git a/testcases/function_test/pkg_test/python-rdflib/python3-rdflib/test_python3-rdflib_rdfs2dot_o.sh b/testcases/function_test/pkg_test/python-rdflib/python3-rdflib/test_python3-rdflib_rdfs2dot_o.sh deleted file mode 100644 index 0d70b0c5831..00000000000 --- a/testcases/function_test/pkg_test/python-rdflib/python3-rdflib/test_python3-rdflib_rdfs2dot_o.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-08 -# @License : Mulan PSL v2 -# @Desc : 测试 rdfs2dot 命令的 -o 参数 -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - # 检查是否已安装python3-rdflib - LOG_INFO "检查是否已安装python3-rdflib" - if dnf list installed python3-rdflib &>/dev/null; then - LOG_INFO "python3-rdflib已安装,脚本结束后保持安装状态" - INSTALLED=true - else - LOG_INFO "python3-rdflib未安装,将在测试结束后卸载" - INSTALLED=false - fi - - # 检查yum源中是否有python3-rdflib - LOG_INFO "检查yum源中是否有python3-rdflib" - if ! dnf list available python3-rdflib &>/dev/null; then - LOG_ERROR "yum源中未找到python3-rdflib" - exit 255 - fi - - # 安装python3-rdflib(如果未安装) - if [ "$INSTALLED" = false ]; then - LOG_INFO "正在安装python3-rdflib" - dnf install -y python3-rdflib - CHECK_RESULT $? 0 0 "安装python3-rdflib失败" - fi - - # 测试rdfs2dot命令的-o参数 - LOG_INFO "测试rdfs2dot命令的-o参数" - if ! rdfs2dot -h | grep -q "\-o"; then - LOG_ERROR "rdfs2dot命令不支持-o参数" - exit 255 - fi - - # 执行rdfs2dot命令并检查结果 - LOG_INFO "执行rdfs2dot命令并检查结果" - rdfs2dot -o test_output.dot - CHECK_RESULT $? 0 0 "执行rdfs2dot命令失败" - - # 清理测试文件(如果存在) - LOG_INFO "清理测试文件" - rm -f test_output.dot - - # 卸载python3-rdflib(如果之前未安装) - if [ "$INSTALLED" = false ]; then - LOG_INFO "正在卸载python3-rdflib" - dnf remove -y python3-rdflib - CHECK_RESULT $? 0 0 "卸载python3-rdflib失败" - fi -} - -main "$@" \ No newline at end of file diff --git a/testcases/function_test/pkg_test/python-rdflib/python3-rdflib/test_python3-rdflib_sparql_query.sh b/testcases/function_test/pkg_test/python-rdflib/python3-rdflib/test_python3-rdflib_sparql_query.sh deleted file mode 100644 index 37e2219103f..00000000000 --- a/testcases/function_test/pkg_test/python-rdflib/python3-rdflib/test_python3-rdflib_sparql_query.sh +++ /dev/null @@ -1,153 +0,0 @@ -#!/usr/bin/bash - -# Copyright (c) 2024 ISCAS .ALL rights reserved. -# This program is licensed under Mulan PSL v2. -# You can use it according to the terms and conditions of the Mulan PSL v2. -# http://license.coscl.org.cn/MulanPSL2 -# THIS PROGRAM IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, -# EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-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-23 -# @License : Mulan PSL v2 -# @Desc : 测试执行SPARQL查询 -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - # 测试执行SPARQL查询 - LOG_INFO "开始测试SPARQL查询功能" - - # 定义软件包名称 - PACKAGE_NAME="python3-rdflib" - - # 检查软件包是否已在yum源中 - LOG_INFO "检查yum源中是否存在软件包 $PACKAGE_NAME" - dnf list available $PACKAGE_NAME > /dev/null 2>&1 - if [ $? -ne 0 ]; then - LOG_ERROR "yum源中未找到软件包 $PACKAGE_NAME" - exit 255 - fi - - # 检查是否已安装 - LOG_INFO "检查是否已安装 $PACKAGE_NAME" - if rpm -q $PACKAGE_NAME > /dev/null 2>&1; then - INSTALLED="true" - LOG_INFO "$PACKAGE_NAME 已安装,测试后将保持安装状态" - else - INSTALLED="false" - LOG_INFO "$PACKAGE_NAME 未安装,测试前将安装" - fi - - # 如果未安装,则安装软件包 - if [ "$INSTALLED" = "false" ]; then - LOG_INFO "安装 $PACKAGE_NAME" - dnf install -y $PACKAGE_NAME - CHECK_RESULT $? 0 0 "安装 $PACKAGE_NAME 失败" - fi - - # 创建测试用的RDF数据文件 - LOG_INFO "创建测试用的RDF数据文件" - cat > test_data.rdf << "EOF" - @prefix ex: . - @prefix rdf: . - @prefix rdfs: . - - ex:Alice rdf:type ex:Person ; - ex:name "Alice" ; - ex:age 30 ; - ex:city "Beijing" . - - ex:Bob rdf:type ex:Person ; - ex:name "Bob" ; - ex:age 25 ; - ex:city "Shanghai" . - - ex:Charlie rdf:type ex:Person ; - ex:name "Charlie" ; - ex:age 35 ; - ex:city "Beijing" . - EOF - CHECK_RESULT $? 0 0 "创建RDF数据文件失败" - - # 创建SPARQL查询脚本 - LOG_INFO "创建SPARQL查询脚本" - cat > sparql_query.py << "EOF" - #!/usr/bin/env python3 - from rdflib import Graph, Namespace - - # 加载RDF数据 - g = Graph() - g.parse("test_data.rdf", format="n3") - - # 定义命名空间 - EX = Namespace("http://example.org/") - - # 执行SPARQL查询 - query = """ - PREFIX ex: - SELECT ?name ?age - WHERE { - ?person rdf:type ex:Person . - ?person ex:name ?name . - ?person ex:age ?age . - ?person ex:city "Beijing" . - } - ORDER BY ?name - """ - - print("查询结果:") - print("-" * 30) - for row in g.query(query): - print(f"姓名: {row.name}, 年龄: {row.age}") - print("-" * 30) - EOF - CHECK_RESULT $? 0 0 "创建SPARQL查询脚本失败" - - # 执行SPARQL查询 - LOG_INFO "执行SPARQL查询" - python3 sparql_query.py > query_result.txt 2>&1 - CHECK_RESULT $? 0 0 "执行SPARQL查询失败" - - # 检查查询结果 - LOG_INFO "检查查询结果" - EXPECTED_RESULTS=2 - ACTUAL_RESULTS=$(grep -c "姓名:" query_result.txt) - CHECK_RESULT $ACTUAL_RESULTS $EXPECTED_RESULTS 0 "查询结果数量不符合预期" - - # 验证具体查询结果 - LOG_INFO "验证查询结果内容" - grep -q "Alice" query_result.txt - CHECK_RESULT $? 0 0 "未找到Alice的查询结果" - grep -q "Charlie" query_result.txt - CHECK_RESULT $? 0 0 "未找到Charlie的查询结果" - grep -q "Bob" query_result.txt - if [ $? -eq 0 ]; then - LOG_ERROR "不应该找到Bob的查询结果" - exit 1 - fi - - # 清理测试文件 - LOG_INFO "清理测试文件" - rm -f test_data.rdf sparql_query.py query_result.txt - CHECK_RESULT $? 0 0 "清理测试文件失败" - - # 如果测试前未安装,则卸载软件包 - if [ "$INSTALLED" = "false" ]; then - LOG_INFO "卸载 $PACKAGE_NAME" - dnf remove -y $PACKAGE_NAME - CHECK_RESULT $? 0 0 "卸载 $PACKAGE_NAME 失败" - LOG_INFO "已恢复原始环境状态" - else - LOG_INFO "保持 $PACKAGE_NAME 的安装状态" - fi - - LOG_INFO "SPARQL查询测试完成" -} - -main "$@" \ No newline at end of file diff --git a/testcases/function_test/pkg_test/python-rdflib/python3-rdflib/test_python3-rdflib_uninstall.sh b/testcases/function_test/pkg_test/python-rdflib/python3-rdflib/test_python3-rdflib_uninstall.sh deleted file mode 100644 index d2e4bf8c539..00000000000 --- a/testcases/function_test/pkg_test/python-rdflib/python3-rdflib/test_python3-rdflib_uninstall.sh +++ /dev/null @@ -1,84 +0,0 @@ -#!/usr/bin/bash - -# Copyright (c) 2024 ISCAS .ALL rights reserved. -# This program is licensed under Mulan PSL v2. -# You can use it according to the terms and conditions of the Mulan PSL v2. -# http://license.coscl.org.cn/MulanPSL2 -# THIS PROGRAM IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, -# EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, -# MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. -# See the Mulan PSL v2 for more details. - -# ############################################# -# @Author : honghua -# @Contact : honghua@iscas.ac.cn -# @Date : 2026-03-23 -# @License : Mulan PSL v2 -# @Desc : 测试软件包卸载 -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - set -e - - LOG_INFO "开始测试python3-rdflib软件包卸载功能" - - # 检查yum源中是否存在python3-rdflib软件包 - LOG_INFO "步骤1:检查yum源中是否存在python3-rdflib软件包" - if ! dnf list available python3-rdflib &>/dev/null; then - LOG_ERROR "yum源中未找到python3-rdflib软件包" - exit 255 - fi - - # 检查当前环境是否已安装python3-rdflib - LOG_INFO "步骤2:检查当前环境是否已安装python3-rdflib" - if rpm -q python3-rdflib &>/dev/null; then - LOG_INFO "检测到python3-rdflib已安装,标记为保持安装状态" - ALREADY_INSTALLED=true - else - LOG_INFO "检测到python3-rdflib未安装,标记为需要测试安装" - ALREADY_INSTALLED=false - fi - - # 如果未安装,则执行安装作为测试步骤 - if [ "$ALREADY_INSTALLED" = "false" ]; then - LOG_INFO "步骤3:安装python3-rdflib软件包" - dnf install -y python3-rdflib - CHECK_RESULT $? 0 0 "安装python3-rdflib失败" - fi - - # 验证软件包安装成功 - LOG_INFO "步骤4:验证python3-rdflib软件包安装成功" - rpm -q python3-rdflib - CHECK_RESULT $? 0 0 "验证python3-rdflib安装状态失败" - - # 测试软件包卸载功能 - LOG_INFO "步骤5:测试卸载python3-rdflib软件包" - dnf remove -y python3-rdflib - CHECK_RESULT $? 0 0 "卸载python3-rdflib失败" - - # 验证软件包已卸载 - LOG_INFO "步骤6:验证python3-rdflib软件包已卸载" - if rpm -q python3-rdflib &>/dev/null; then - LOG_ERROR "python3-rdflib卸载后仍然存在" - exit 1 - else - LOG_INFO "python3-rdflib已成功卸载" - fi - - # 环境恢复:如果测试前未安装,则保持未安装状态;如果测试前已安装,则重新安装 - LOG_INFO "步骤7:恢复测试环境" - if [ "$ALREADY_INSTALLED" = "true" ]; then - LOG_INFO "恢复原始安装状态:重新安装python3-rdflib" - dnf install -y python3-rdflib - CHECK_RESULT $? 0 0 "恢复python3-rdflib安装状态失败" - LOG_INFO "环境已恢复为安装状态" - else - LOG_INFO "环境保持为未安装状态" - fi - - LOG_INFO "python3-rdflib卸载测试完成" -} - -main "$@" \ No newline at end of file From 2d506a8be213729032ca1073860efbb957771c56 Mon Sep 17 00:00:00 2001 From: honghua Date: Thu, 16 Apr 2026 23:15:09 +0800 Subject: [PATCH 13/13] update testcase for testsuite texlive-brandeis-problemset --- .../texlive-brandeis-problemset.json | 12 --- ...live-brandeis-problemset_function_usage.sh | 85 ------------------- 2 files changed, 97 deletions(-) delete mode 100644 testcases/function_test/pkg_test/texlive-split-z/texlive-brandeis-problemset/test_texlive-brandeis-problemset_function_usage.sh diff --git a/suite2cases/function_test/pkg_test/texlive-split-z/texlive-brandeis-problemset.json b/suite2cases/function_test/pkg_test/texlive-split-z/texlive-brandeis-problemset.json index d97bdf8e5fa..7b413266ae8 100644 --- a/suite2cases/function_test/pkg_test/texlive-split-z/texlive-brandeis-problemset.json +++ b/suite2cases/function_test/pkg_test/texlive-split-z/texlive-brandeis-problemset.json @@ -5,18 +5,6 @@ { "name": "test_texlive-brandeis-problemset_function_install", "desc": "Test package installation" - }, - { - "name": "test_texlive-brandeis-problemset_function_uninstall", - "desc": "Test package removal" - }, - { - "name": "test_texlive-brandeis-problemset_function_file_exist", - "desc": "Check key files exist" - }, - { - "name": "test_texlive-brandeis-problemset_function_usage", - "desc": "Test compile LaTeX doc" } ] } \ No newline at end of file diff --git a/testcases/function_test/pkg_test/texlive-split-z/texlive-brandeis-problemset/test_texlive-brandeis-problemset_function_usage.sh b/testcases/function_test/pkg_test/texlive-split-z/texlive-brandeis-problemset/test_texlive-brandeis-problemset_function_usage.sh deleted file mode 100644 index 8d4aaafcd69..00000000000 --- a/testcases/function_test/pkg_test/texlive-split-z/texlive-brandeis-problemset/test_texlive-brandeis-problemset_function_usage.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-04-06 -# @License : Mulan PSL v2 -# @Desc : Test compile LaTeX doc -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - LOG_INFO "开始测试: Test compile LaTeX doc" - - LOG_INFO "步骤1: 检查texlive-brandeis-problemset软件包是否在yum源中" - dnf list available texlive-brandeis-problemset > /dev/null 2>&1 - if [ $? -ne 0 ]; then - LOG_ERROR "yum源中未找到texlive-brandeis-problemset软件包" - exit 255 - fi - - LOG_INFO "步骤2: 检查环境是否已安装texlive-brandeis-problemset" - rpm -q texlive-brandeis-problemset > /dev/null 2>&1 - if [ $? -eq 0 ]; then - LOG_INFO "texlive-brandeis-problemset已安装,测试后将保持安装状态" - INSTALLED=1 - else - LOG_INFO "texlive-brandeis-problemset未安装,将进行安装" - INSTALLED=0 - fi - - if [ $INSTALLED -eq 0 ]; then - LOG_INFO "步骤3: 安装texlive-brandeis-problemset软件包" - dnf install -y texlive-brandeis-problemset - CHECK_RESULT $? 0 0 "安装texlive-brandeis-problemset失败" - fi - - LOG_INFO "步骤4: 检查pdflatex命令是否存在" - which pdflatex > /dev/null 2>&1 - CHECK_RESULT $? 0 0 "pdflatex命令不存在" - - LOG_INFO "步骤5: 创建测试LaTeX文档" - cat > test.tex << "EOF" - \documentclass{article} - \begin{document} - Hello, LaTeX! - \end{document} - EOF - CHECK_RESULT $? 0 0 "创建测试LaTeX文档失败" - - LOG_INFO "步骤6: 使用pdflatex编译LaTeX文档" - pdflatex -interaction=nonstopmode test.tex > /dev/null 2>&1 - CHECK_RESULT $? 0 0 "编译LaTeX文档失败" - - LOG_INFO "步骤7: 检查生成的PDF文件" - if [ -f test.pdf ]; then - LOG_INFO "PDF文件生成成功" - else - LOG_ERROR "PDF文件未生成" - exit 1 - fi - - LOG_INFO "步骤8: 清理生成的临时文件" - rm -f test.aux test.log test.out test.tex test.pdf - - if [ $INSTALLED -eq 0 ]; then - LOG_INFO "步骤9: 卸载texlive-brandeis-problemset软件包" - dnf remove -y texlive-brandeis-problemset - CHECK_RESULT $? 0 0 "卸载texlive-brandeis-problemset失败" - fi - - LOG_INFO "测试完成: Test compile LaTeX doc" -} - -main "$@" \ No newline at end of file