From 516dc4aa01108b13f2a714a0b19f1a986162ce97 Mon Sep 17 00:00:00 2001 From: honghua Date: Sat, 18 Apr 2026 16:50:18 +0800 Subject: [PATCH 01/17] update testcase for testsuite texlive-pdfoverlay --- .../texlive-split-r/texlive-pdfoverlay.json | 10 --- .../test_texlive-pdfoverlay_function_basic.sh | 76 ------------------- 2 files changed, 86 deletions(-) delete mode 100644 suite2cases/function_test/pkg_test/texlive-split-r/texlive-pdfoverlay.json delete mode 100644 testcases/function_test/pkg_test/texlive-split-r/texlive-pdfoverlay/test_texlive-pdfoverlay_function_basic.sh diff --git a/suite2cases/function_test/pkg_test/texlive-split-r/texlive-pdfoverlay.json b/suite2cases/function_test/pkg_test/texlive-split-r/texlive-pdfoverlay.json deleted file mode 100644 index 0ddd5dc3bb7..00000000000 --- a/suite2cases/function_test/pkg_test/texlive-split-r/texlive-pdfoverlay.json +++ /dev/null @@ -1,10 +0,0 @@ -{ - "path": "$OET_PATH/testcases/function_test/pkg_test/texlive-split-r/texlive-pdfoverlay", - "machine num": 1, - "cases": [ - { - "name": "test_texlive-pdfoverlay_function_basic", - "desc": "Test basic PDF overlay functionality" - } - ] -} \ No newline at end of file diff --git a/testcases/function_test/pkg_test/texlive-split-r/texlive-pdfoverlay/test_texlive-pdfoverlay_function_basic.sh b/testcases/function_test/pkg_test/texlive-split-r/texlive-pdfoverlay/test_texlive-pdfoverlay_function_basic.sh deleted file mode 100644 index b7abbc3cb03..00000000000 --- a/testcases/function_test/pkg_test/texlive-split-r/texlive-pdfoverlay/test_texlive-pdfoverlay_function_basic.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-11-26 -# @License : Mulan PSL v2 -# @Desc : Test basic PDF overlay functionality -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - - # 检查是否已安装texlive-pdfoverlay - LOG_INFO "检查是否已安装texlive-pdfoverlay" - if dnf list installed texlive-pdfoverlay &>/dev/null; then - LOG_INFO "texlive-pdfoverlay已安装,脚本结束后将保持安装状态" - INSTALLED=true - else - LOG_INFO "texlive-pdfoverlay未安装,将在测试后卸载" - INSTALLED=false - fi - - # 检查yum源中是否有texlive-pdfoverlay - LOG_INFO "检查yum源中是否有texlive-pdfoverlay" - if ! dnf list available texlive-pdfoverlay &>/dev/null; then - LOG_ERROR "yum源中未找到texlive-pdfoverlay软件包" - exit 255 - fi - - # 安装texlive-pdfoverlay(如果未安装) - if [ "$INSTALLED" = false ]; then - LOG_INFO "开始安装texlive-pdfoverlay" - dnf install -y texlive-pdfoverlay - CHECK_RESULT $? 0 0 "安装texlive-pdfoverlay失败" - fi - - # 测试PDF overlay基本功能 - LOG_INFO "测试PDF overlay基本功能" - pdf_overlay_output=$(pdflatex --version) - CHECK_RESULT $? 0 0 "pdflatex命令执行失败" - - # 检查参数是否支持 - LOG_INFO "检查pdfoverlay参数支持情况" - if ! pdflatex --help | grep -q "pdfoverlay"; then - LOG_ERROR "pdfoverlay参数不支持" - exit 255 - fi - - # 执行PDF overlay操作示例 - LOG_INFO "执行PDF overlay操作示例" - pdflatex -interaction=nonstopmode -shell-escape "\documentclass{article}\usepackage{pdfoverlay}\begin{document}\end{document}" - CHECK_RESULT $? 0 0 "PDF overlay操作失败" - - # 清理环境(如果最初未安装) - if [ "$INSTALLED" = false ]; then - LOG_INFO "卸载texlive-pdfoverlay以恢复环境" - dnf remove -y texlive-pdfoverlay - CHECK_RESULT $? 0 0 "卸载texlive-pdfoverlay失败" - fi - - LOG_INFO "测试脚本执行完毕,环境已恢复" - -} - -main "$@" \ No newline at end of file From 20c2f3f0aaf14afbfa99e2304ff5dc6a3f8aeb7f Mon Sep 17 00:00:00 2001 From: honghua Date: Sat, 18 Apr 2026 16:51:16 +0800 Subject: [PATCH 02/17] update testcase for testsuite libpskc --- .../pkg_test/oath-toolkit/libpskc.json | 24 ---- .../libpskc/test_libpskc_function_generate.sh | 109 --------------- .../libpskc/test_libpskc_function_help.sh | 127 ------------------ .../libpskc/test_libpskc_function_init.sh | 74 ---------- .../libpskc/test_libpskc_function_install.sh | 71 ---------- .../libpskc/test_libpskc_function_validate.sh | 124 ----------------- .../libpskc/test_libpskc_function_version.sh | 67 --------- 7 files changed, 596 deletions(-) delete mode 100644 testcases/function_test/pkg_test/oath-toolkit/libpskc/test_libpskc_function_generate.sh delete mode 100644 testcases/function_test/pkg_test/oath-toolkit/libpskc/test_libpskc_function_help.sh delete mode 100644 testcases/function_test/pkg_test/oath-toolkit/libpskc/test_libpskc_function_init.sh delete mode 100644 testcases/function_test/pkg_test/oath-toolkit/libpskc/test_libpskc_function_install.sh delete mode 100644 testcases/function_test/pkg_test/oath-toolkit/libpskc/test_libpskc_function_validate.sh delete mode 100644 testcases/function_test/pkg_test/oath-toolkit/libpskc/test_libpskc_function_version.sh diff --git a/suite2cases/function_test/pkg_test/oath-toolkit/libpskc.json b/suite2cases/function_test/pkg_test/oath-toolkit/libpskc.json index edd7fe82d35..17bfc832cf4 100644 --- a/suite2cases/function_test/pkg_test/oath-toolkit/libpskc.json +++ b/suite2cases/function_test/pkg_test/oath-toolkit/libpskc.json @@ -7,33 +7,9 @@ "desc": "测试libpskc软件包服务的日志查看功能,验证是否能够正确查看服务的日志信息。", "machine num": 1 }, - { - "name": "test_libpskc_function_init", - "desc": "测试libpskc软件包的初始化功能,验证是否能够正确初始化。" - }, - { - "name": "test_libpskc_function_install", - "desc": "测试libpskc软件包的安装功能,验证是否能够成功安装。" - }, { "name": "test_libpskc_function_uninstall", "desc": "测试libpskc软件包的卸载功能,验证是否能够完全卸载。" - }, - { - "name": "test_libpskc_function_version", - "desc": "测试libpskc软件包的版本查询功能,验证能否正确查询软件包版本。" - }, - { - "name": "test_libpskc_function_help", - "desc": "测试libpskc软件包的帮助信息功能,验证能否正确显示使用帮助。" - }, - { - "name": "test_libpskc_function_generate", - "desc": "测试libpskc软件包生成密钥功能,验证能否成功生成密钥文件。" - }, - { - "name": "test_libpskc_function_validate", - "desc": "测试libpskc软件包验证密钥功能,验证能否正确验证密钥有效性。" } ] } \ No newline at end of file diff --git a/testcases/function_test/pkg_test/oath-toolkit/libpskc/test_libpskc_function_generate.sh b/testcases/function_test/pkg_test/oath-toolkit/libpskc/test_libpskc_function_generate.sh deleted file mode 100644 index 472c0a026ad..00000000000 --- a/testcases/function_test/pkg_test/oath-toolkit/libpskc/test_libpskc_function_generate.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-17 -# @License : Mulan PSL v2 -# @Desc : 测试libpskc软件包生成密钥功能,验证能否成功生成密钥文件。 -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - # 测试libpskc软件包生成密钥功能,验证能否成功生成密钥文件 - LOG_INFO "开始测试libpskc软件包生成密钥功能" - - # 检查libpskc软件包是否已安装 - LOG_INFO "检查libpskc软件包是否已安装" - if dnf list installed libpskc &>/dev/null; then - LOG_INFO "libpskc软件包已安装,将保持安装状态" - INSTALLED_BEFORE_TEST=true - else - LOG_INFO "libpskc软件包未安装,将在测试过程中安装" - INSTALLED_BEFORE_TEST=false - fi - - # 检查yum源中是否有libpskc软件包 - LOG_INFO "检查yum源中是否有libpskc软件包" - if ! dnf list available libpskc &>/dev/null; then - LOG_ERROR "yum源中未找到libpskc软件包" - exit 255 - fi - - # 如果未安装,则安装libpskc软件包 - if [ "$INSTALLED_BEFORE_TEST" = false ]; then - LOG_INFO "安装libpskc软件包" - dnf install -y libpskc - CHECK_RESULT $? 0 0 "安装libpskc软件包失败" - fi - - # 检查pskc命令是否可用 - LOG_INFO "检查pskc命令是否可用" - if ! command -v pskc &>/dev/null; then - LOG_ERROR "pskc命令不存在" - exit 255 - fi - - # 检查pskc命令是否支持generate参数 - LOG_INFO "检查pskc命令是否支持generate参数" - if ! pskc --help | grep -q "generate"; then - LOG_ERROR "pskc命令不支持generate参数" - exit 255 - fi - - # 创建测试目录 - LOG_INFO "创建测试目录" - TEST_DIR="/tmp/test_libpskc_$(date +%s)" - mkdir -p "$TEST_DIR" - CHECK_RESULT $? 0 0 "创建测试目录失败" - - # 生成密钥文件 - LOG_INFO "生成密钥文件" - TEST_KEY_FILE="$TEST_DIR/test_key.xml" - pskc generate --output "$TEST_KEY_FILE" - CHECK_RESULT $? 0 0 "生成密钥文件失败" - - # 验证密钥文件是否成功生成 - LOG_INFO "验证密钥文件是否成功生成" - if [ -f "$TEST_KEY_FILE" ]; then - LOG_INFO "密钥文件已成功生成:$TEST_KEY_FILE" - # 检查密钥文件内容是否有效 - if file "$TEST_KEY_FILE" | grep -q "XML"; then - LOG_INFO "密钥文件格式正确(XML格式)" - else - LOG_ERROR "密钥文件格式不正确" - CHECK_RESULT 1 0 0 "密钥文件格式验证失败" - fi - else - LOG_ERROR "密钥文件未生成" - CHECK_RESULT 1 0 0 "密钥文件生成验证失败" - fi - - # 清理测试目录 - LOG_INFO "清理测试目录" - rm -rf "$TEST_DIR" - CHECK_RESULT $? 0 0 "清理测试目录失败" - - # 如果测试前未安装,则卸载libpskc软件包 - if [ "$INSTALLED_BEFORE_TEST" = false ]; then - LOG_INFO "卸载libpskc软件包" - dnf remove -y libpskc - CHECK_RESULT $? 0 0 "卸载libpskc软件包失败" - else - LOG_INFO "保持libpskc软件包安装状态" - fi - - LOG_INFO "测试libpskc软件包生成密钥功能完成" -} - -main "$@" \ No newline at end of file diff --git a/testcases/function_test/pkg_test/oath-toolkit/libpskc/test_libpskc_function_help.sh b/testcases/function_test/pkg_test/oath-toolkit/libpskc/test_libpskc_function_help.sh deleted file mode 100644 index d808e9d25f9..00000000000 --- a/testcases/function_test/pkg_test/oath-toolkit/libpskc/test_libpskc_function_help.sh +++ /dev/null @@ -1,127 +0,0 @@ -#!/usr/bin/bash - -# Copyright (c) 2024 ISCAS .ALL rights reserved. -# This program is licensed under Mulan PSL v2. -# You can use it according to the terms and conditions of the Mulan PSL v2. -# http://license.coscl.org.cn/MulanPSL2 -# THIS PROGRAM IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, -# EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, -# MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. -# See the Mulan PSL v2 for more details. - -# ############################################# -# @Author : honghua -# @Contact : honghua@iscas.ac.cn -# @Date : 2026-03-17 -# @License : Mulan PSL v2 -# @Desc : 测试libpskc软件包的帮助信息功能,验证能否正确显示使用帮助。 -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - # 定义颜色和日志函数 - LOG_INFO() { - echo -e "\033[1;34m[INFO]\033[0m $*" - } - LOG_ERROR() { - echo -e "\033[1;31m[ERROR]\033[0m $*" - } - - # 检查软件包是否在yum源中 - check_package_in_repo() { - local package_name=$1 - dnf list available "$package_name" &>/dev/null - if [ $? -ne 0 ]; then - LOG_ERROR "软件包 $package_name 不在yum源中" - exit 255 - fi - } - - # 检查命令参数是否支持 - check_command_option() { - local command=$1 - local option=$2 - $command --help 2>&1 | grep -q -- "$option" - if [ $? -ne 0 ]; then - LOG_ERROR "命令 $command 不支持参数 $option" - exit 255 - fi - } - - # 检查命令执行结果 - check_command_result() { - local result=$1 - local expected=$2 - if [ $result -ne $expected ]; then - LOG_ERROR "命令执行失败,退出码: $result" - exit $result - fi - } - - # 主测试函数 - main() { - LOG_INFO "开始测试libpskc软件包的帮助信息功能" - - # 检查环境是否已安装libpskc - LOG_INFO "检查libpskc是否已安装" - if rpm -q libpskc &>/dev/null; then - LOG_INFO "libpskc已安装,测试后保持安装状态" - already_installed=true - else - LOG_INFO "libpskc未安装,将在测试中安装" - already_installed=false - fi - - # 检查yum源中是否有libpskc软件包 - LOG_INFO "检查yum源中是否有libpskc软件包" - check_package_in_repo "libpskc" - - # 如果未安装,则安装软件包 - if [ "$already_installed" = false ]; then - LOG_INFO "安装libpskc软件包" - dnf install -y libpskc - CHECK_RESULT $? 0 0 "安装libpskc失败" - fi - - # 检查pskc-tool命令是否可用 - LOG_INFO "检查pskc-tool命令是否可用" - which pskc-tool &>/dev/null - CHECK_RESULT $? 0 0 "pskc-tool命令未找到" - - # 检查--help参数是否支持 - LOG_INFO "检查pskc-tool是否支持--help参数" - check_command_option "pskc-tool" "--help" - - # 测试帮助信息功能 - LOG_INFO "执行pskc-tool --help命令" - pskc-tool --help - check_command_result $? 0 - - LOG_INFO "验证帮助信息是否包含关键内容" - pskc-tool --help | grep -q "Usage:" - CHECK_RESULT $? 0 0 "帮助信息中未找到Usage部分" - - pskc-tool --help | grep -q "Options:" - CHECK_RESULT $? 0 0 "帮助信息中未找到Options部分" - - LOG_INFO "libpskc帮助信息功能测试通过" - - # 清理环境 - LOG_INFO "清理测试环境" - if [ "$already_installed" = false ]; then - LOG_INFO "卸载libpskc软件包" - dnf remove -y libpskc - CHECK_RESULT $? 0 0 "卸载libpskc失败" - else - LOG_INFO "保持libpskc安装状态" - fi - - LOG_INFO "测试完成" - } - - # 执行主函数 - main -} - -main "$@" \ No newline at end of file diff --git a/testcases/function_test/pkg_test/oath-toolkit/libpskc/test_libpskc_function_init.sh b/testcases/function_test/pkg_test/oath-toolkit/libpskc/test_libpskc_function_init.sh deleted file mode 100644 index ea0a34f5118..00000000000 --- a/testcases/function_test/pkg_test/oath-toolkit/libpskc/test_libpskc_function_init.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-10 -# @License : Mulan PSL v2 -# @Desc : 测试libpskc软件包的初始化功能,验证是否能够正确初始化。 -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - - LOG_INFO "开始测试libpskc软件包的初始化功能,验证是否能够正确初始化。" - - # 检查是否已安装libpskc软件包 - LOG_INFO "检查系统中是否已安装libpskc软件包..." - if rpm -q libpskc &>/dev/null; then - LOG_INFO "libpskc软件包已安装,测试结束后将保持安装状态。" - INSTALLED=true - else - LOG_INFO "libpskc软件包未安装,将在测试过程中安装并在结束后卸载。" - INSTALLED=false - fi - - # 检查yum源中是否存在libpskc软件包 - LOG_INFO "检查yum源中是否存在libpskc软件包..." - if ! dnf list available libpskc &>/dev/null; then - LOG_ERROR "yum源中未找到libpskc软件包,退出测试。" - exit 255 - fi - - # 如果未安装,则安装libpskc软件包 - if [ "$INSTALLED" = false ]; then - LOG_INFO "开始安装libpskc软件包..." - dnf install -y libpskc - CHECK_RESULT $? 0 0 "安装libpskc软件包失败" - fi - - # 测试初始化功能 - LOG_INFO "测试libpskc的初始化功能..." - pskc_init_output=$(pskc-init --help 2>&1) - if [[ $pskc_init_output == *"usage"* || $pskc_init_output == *"help"* ]]; then - LOG_INFO "libpskc初始化功能测试通过。" - else - LOG_ERROR "libpskc初始化功能测试失败,不支持或参数错误。" - exit 255 - fi - - # 清理环境 - if [ "$INSTALLED" = false ]; then - LOG_INFO "卸载libpskc软件包以恢复环境..." - dnf remove -y libksc &>/dev/null || { - LOG_ERROR "卸载libksc软件包失败。" - exit 1 - } - CHECK_RESULT $? 0 0 "卸载libpsck软件包失败" - fi - - LOG_INFO "测试完成,环境已恢复。" - -} - -main "$@" \ No newline at end of file diff --git a/testcases/function_test/pkg_test/oath-toolkit/libpskc/test_libpskc_function_install.sh b/testcases/function_test/pkg_test/oath-toolkit/libpskc/test_libpskc_function_install.sh deleted file mode 100644 index 064e06c3026..00000000000 --- a/testcases/function_test/pkg_test/oath-toolkit/libpskc/test_libpskc_function_install.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 : 2026-03-17 -# @License : Mulan PSL v2 -# @Desc : 测试libpskc软件包的安装功能,验证是否能够成功安装。 -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - LOG_INFO "开始测试libpskc软件包的安装功能" - LOG_INFO "检查当前环境是否已安装libpskc软件包" - if rpm -q libpskc > /dev/null 2>&1; then - LOG_INFO "当前环境已安装libpskc软件包,脚本结束时将保持安装状态" - INSTALLED_BEFORE=true - else - LOG_INFO "当前环境未安装libpskc软件包,将在测试过程中安装,并在脚本结束前卸载" - INSTALLED_BEFORE=false - fi - LOG_INFO "检查yum源中是否存在libpskc软件包" - if ! dnf list available libpskc > /dev/null 2>&1; then - LOG_ERROR "yum源中未找到libpskc软件包" - exit 255 - fi - if [ "$INSTALLED_BEFORE" = false ]; then - LOG_INFO "开始安装libpskc软件包" - dnf install -y libpskc - CHECK_RESULT $? 0 0 "安装libpskc软件包失败" - LOG_INFO "验证libpskc软件包是否成功安装" - rpm -q libpskc - CHECK_RESULT $? 0 0 "验证libpskc软件包安装失败" - fi - LOG_INFO "测试libpskc软件包的基本功能" - if command -v pskctool > /dev/null 2>&1; then - LOG_INFO "执行pskc命令查看帮助信息" - pskctool --help - CHECK_RESULT $? 0 0 "执行pskc命令失败" - else - LOG_INFO "pskc命令不存在,跳过功能测试" - fi - LOG_INFO "清理测试环境" - if [ "$INSTALLED_BEFORE" = false ]; then - LOG_INFO "卸载之前安装的libpskc软件包" - dnf remove -y libpskc - CHECK_RESULT $? 0 0 "卸载libpskc软件包失败" - LOG_INFO "验证libpskc软件包是否已卸载" - if rpm -q libpskc > /dev/null 2>&1; then - LOG_ERROR "libpskc软件包卸载失败" - exit 1 - else - LOG_INFO "libpskc软件包已成功卸载" - fi - else - LOG_INFO "测试前已安装libpskc软件包,保持安装状态" - fi - LOG_INFO "测试完成" -} - -main "$@" \ No newline at end of file diff --git a/testcases/function_test/pkg_test/oath-toolkit/libpskc/test_libpskc_function_validate.sh b/testcases/function_test/pkg_test/oath-toolkit/libpskc/test_libpskc_function_validate.sh deleted file mode 100644 index 4dd44dd5cbb..00000000000 --- a/testcases/function_test/pkg_test/oath-toolkit/libpskc/test_libpskc_function_validate.sh +++ /dev/null @@ -1,124 +0,0 @@ -#!/usr/bin/bash - -# Copyright (c) 2024 ISCAS .ALL rights reserved. -# This program is licensed under Mulan PSL v2. -# You can use it according to the terms and conditions of the Mulan PSL v2. -# http://license.coscl.org.cn/MulanPSL2 -# THIS PROGRAM IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, -# EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, -# MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. -# See the Mulan PSL v2 for more details. - -# ############################################# -# @Author : honghua -# @Contact : honghua@iscas.ac.cn -# @Date : 2026-03-17 -# @License : Mulan PSL v2 -# @Desc : 测试libpskc软件包验证密钥功能,验证能否正确验证密钥有效性。 -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - # 环境检查与初始化 - LOG_INFO "检查是否已安装libpskc软件包" - rpm -q libpskc > /dev/null 2>&1 - is_installed=$? - if [ $is_installed -eq 0 ]; then - LOG_INFO "libpskc已安装,测试后保持安装状态" - keep_installed=true - else - LOG_INFO "libpskc未安装,将在测试过程中安装" - keep_installed=false - fi - - # 检查yum源中是否存在libpskc软件包 - LOG_INFO "检查yum源中是否存在libpskc软件包" - dnf list available libpskc > /dev/null 2>&1 - if [ $? -ne 0 ]; then - LOG_ERROR "yum源中未找到libpskc软件包" - exit 255 - fi - - # 如果未安装,则安装libpskc - if [ "$keep_installed" = "false" ]; then - LOG_INFO "安装libpskc软件包" - dnf install -y libpskc > /dev/null 2>&1 - CHECK_RESULT $? 0 0 "安装libpskc失败" - fi - - # 测试libpskc的验证密钥功能 - LOG_INFO "测试libpskc验证密钥功能" - - # 创建一个测试密钥文件 - LOG_INFO "创建测试密钥文件" - cat > /tmp/test_key.xml << "EOF" - - - - http://www.ietf.org/key/algorithm/hmac-sha1 - - MTIzNDU2Nzg5MDEyMzQ1Njc4OTA= - - - - EOF - CHECK_RESULT $? 0 0 "创建测试密钥文件失败" - - # 使用libpskc验证密钥 - LOG_INFO "使用libpskc验证测试密钥" - pskc-tool validate --file /tmp/test_key.xml > /dev/null 2>&1 - CHECK_RESULT $? 0 0 "libpskc验证密钥失败" - - # 测试无效密钥 - LOG_INFO "测试无效密钥验证" - cat > /tmp/invalid_key.xml << "EOF" - - - - InvalidAlgorithm - - InvalidValue - - - - EOF - CHECK_RESULT $? 0 0 "创建无效密钥文件失败" - - pskc-tool validate --file /tmp/invalid_key.xml > /dev/null 2>&1 - # 期望验证失败,返回非0值 - if [ $? -eq 0 ]; then - LOG_ERROR "无效密钥验证应失败但通过了" - CHECK_RESULT 1 0 0 "无效密钥验证逻辑错误" - else - LOG_INFO "无效密钥验证失败,符合预期" - CHECK_RESULT 0 0 0 "无效密钥验证失败" - fi - - # 测试不存在的文件 - LOG_INFO "测试不存在的文件参数" - pskc-tool validate --file /tmp/nonexistent_file.xml > /dev/null 2>&1 - # 检查命令是否支持--file参数 - if [ $? -eq 255 ]; then - LOG_ERROR "pskc-tool不支持--file参数" - exit 255 - fi - - # 清理临时文件 - LOG_INFO "清理临时测试文件" - rm -f /tmp/test_key.xml /tmp/invalid_key.xml - CHECK_RESULT $? 0 0 "清理临时文件失败" - - # 环境恢复 - if [ "$keep_installed" = "false" ]; then - LOG_INFO "卸载libpskc软件包" - dnf remove -y libpskc > /dev/null 2>&1 - CHECK_RESULT $? 0 0 "卸载libpskc失败" - else - LOG_INFO "保持libpskc安装状态" - fi - - LOG_INFO "libpskc验证密钥功能测试完成" -} - -main "$@" \ No newline at end of file diff --git a/testcases/function_test/pkg_test/oath-toolkit/libpskc/test_libpskc_function_version.sh b/testcases/function_test/pkg_test/oath-toolkit/libpskc/test_libpskc_function_version.sh deleted file mode 100644 index b26522b1262..00000000000 --- a/testcases/function_test/pkg_test/oath-toolkit/libpskc/test_libpskc_function_version.sh +++ /dev/null @@ -1,67 +0,0 @@ -#!/usr/bin/bash - -# Copyright (c) 2024 ISCAS .ALL rights reserved. -# This program is licensed under Mulan PSL v2. -# You can use it according to the terms and conditions of the Mulan PSL v2. -# http://license.coscl.org.cn/MulanPSL2 -# THIS PROGRAM IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, -# EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, -# MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. -# See the Mulan PSL v2 for more details. - -# ############################################# -# @Author : honghua -# @Contact : honghua@iscas.ac.cn -# @Date : 2026-03-17 -# @License : Mulan PSL v2 -# @Desc : 测试libpskc软件包的版本查询功能,验证能否正确查询软件包版本。 -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - PACKAGE_NAME="libpskc" - LOG_INFO "开始测试libpskc软件包的版本查询功能" - LOG_INFO "步骤1: 检查yum源中是否存在$PACKAGE_NAME软件包" - dnf list available $PACKAGE_NAME &> /dev/null - if [ $? -ne 0 ]; then - LOG_ERROR "yum源中未找到软件包$PACKAGE_NAME" - exit 255 - fi - LOG_INFO "软件包$PACKAGE_NAME存在于yum源中" - LOG_INFO "步骤2: 检查当前环境是否已安装$PACKAGE_NAME" - rpm -q $PACKAGE_NAME &> /dev/null - if [ $? -eq 0 ]; then - INSTALLED="true" - LOG_INFO "软件包$PACKAGE_NAME已安装,测试后将保持安装状态" - else - INSTALLED="false" - LOG_INFO "软件包$PACKAGE_NAME未安装,测试前将进行安装" - LOG_INFO "步骤3: 安装$PACKAGE_NAME软件包" - dnf install -y $PACKAGE_NAME - CHECK_RESULT $? 0 0 "安装$PACKAGE_NAME软件包失败" - fi - LOG_INFO "步骤4: 测试libpskc软件包的版本查询功能" - LOG_INFO "执行命令: pskctool --version" - pskc_version_output=$(pskctool --version 2>&1) - if [ $? -eq 255 ]; then - LOG_ERROR "参数--version不存在或不支持" - exit 255 - fi - CHECK_RESULT $? 0 0 "执行pskc版本查询命令失败" - echo "$pskc_version_output" | grep -E "[0-9]+\.[0-9]+" &> /dev/null - CHECK_RESULT $? 0 0 "版本查询输出格式不正确,未找到版本号" - LOG_INFO "软件包版本查询成功,输出为:$pskc_version_output" - LOG_INFO "步骤5: 清理测试环境" - if [ "$INSTALLED" = "false" ]; then - LOG_INFO "卸载测试安装的软件包$PACKAGE_NAME" - dnf remove -y $PACKAGE_NAME - CHECK_RESULT $? 0 0 "卸载$PACKAGE_NAME软件包失败" - LOG_INFO "环境已恢复到测试前状态" - else - LOG_INFO "测试前软件包已安装,保持安装状态,无需卸载" - fi - LOG_INFO "libpskc软件包版本查询功能测试完成" -} - -main "$@" \ No newline at end of file From 45b20da51fb463bfb6d0d771820976f727e671ee Mon Sep 17 00:00:00 2001 From: honghua Date: Sat, 18 Apr 2026 16:55:53 +0800 Subject: [PATCH 03/17] update testcase for testsuite texlive-libertinus-type1 --- .../texlive-libertinus-type1.json | 8 -- ...ve-libertinus-type1_function_file_exist.sh | 81 ------------------ ...exlive-libertinus-type1_function_texdoc.sh | 84 ------------------- 3 files changed, 173 deletions(-) delete mode 100644 testcases/function_test/pkg_test/texlive-split-z/texlive-libertinus-type1/test_texlive-libertinus-type1_function_file_exist.sh delete mode 100644 testcases/function_test/pkg_test/texlive-split-z/texlive-libertinus-type1/test_texlive-libertinus-type1_function_texdoc.sh diff --git a/suite2cases/function_test/pkg_test/texlive-split-z/texlive-libertinus-type1.json b/suite2cases/function_test/pkg_test/texlive-split-z/texlive-libertinus-type1.json index ad15e19e5e3..95fb69e1304 100644 --- a/suite2cases/function_test/pkg_test/texlive-split-z/texlive-libertinus-type1.json +++ b/suite2cases/function_test/pkg_test/texlive-split-z/texlive-libertinus-type1.json @@ -13,14 +13,6 @@ { "name": "test_texlive-libertinus-type1_function_version", "desc": "Check package version info" - }, - { - "name": "test_texlive-libertinus-type1_function_file_exist", - "desc": "Verify key font files exist" - }, - { - "name": "test_texlive-libertinus-type1_function_texdoc", - "desc": "Test documentation accessibility" } ] } \ No newline at end of file diff --git a/testcases/function_test/pkg_test/texlive-split-z/texlive-libertinus-type1/test_texlive-libertinus-type1_function_file_exist.sh b/testcases/function_test/pkg_test/texlive-split-z/texlive-libertinus-type1/test_texlive-libertinus-type1_function_file_exist.sh deleted file mode 100644 index d9b7c7260a8..00000000000 --- a/testcases/function_test/pkg_test/texlive-split-z/texlive-libertinus-type1/test_texlive-libertinus-type1_function_file_exist.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 : Verify key font files exist -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - LOG_INFO "开始测试:验证关键字体文件是否存在" - - # 检查是否已安装texlive-libertinus-type1软件包 - LOG_INFO "步骤1:检查texlive-libertinus-type1软件包是否已安装" - if dnf list installed texlive-libertinus-type1 &>/dev/null; then - LOG_INFO "texlive-libertinus-type1已安装,测试结束后将保持安装状态" - INSTALLED_BEFORE_TEST=true - else - LOG_INFO "texlive-libertinus-type1未安装,将在测试步骤中安装" - INSTALLED_BEFORE_TEST=false - fi - - # 检查yum源中是否存在该软件包 - LOG_INFO "步骤2:检查yum源中是否存在texlive-libertinus-type1软件包" - if ! dnf list available texlive-libertinus-type1 &>/dev/null; then - LOG_ERROR "yum源中未找到texlive-libertinus-type1软件包" - exit 255 - fi - - # 如果未安装,则安装软件包 - if [ "$INSTALLED_BEFORE_TEST" = false ]; then - LOG_INFO "步骤3:安装texlive-libertinus-type1软件包" - dnf install -y texlive-libertinus-type1 - CHECK_RESULT $? 0 0 "安装texlive-libertinus-type1失败" - fi - - # 验证关键字体文件是否存在 - LOG_INFO "步骤4:验证关键字体文件是否存在" - FONT_FILES=( - "/usr/share/texlive/texmf-dist/fonts/opentype/public/libertinus/LibertinusSerif-Regular.otf" - "/usr/share/texlive/texmf-dist/fonts/opentype/public/libertinus/LibertinusSans-Regular.otf" - "/usr/share/texlive/texmf-dist/fonts/opentype/public/libertinus/LibertinusMono-Regular.otf" - ) - - for file in "${FONT_FILES[@]}"; do - if [ -f "$file" ]; then - LOG_INFO "字体文件 $file 存在" - else - LOG_ERROR "字体文件 $file 不存在" - exit 1 - fi - done - - LOG_INFO "所有关键字体文件均存在,测试通过" - - # 环境恢复:如果测试前未安装,则卸载软件包 - if [ "$INSTALLED_BEFORE_TEST" = false ]; then - LOG_INFO "步骤5:卸载texlive-libertinus-type1软件包" - dnf remove -y texlive-libertinus-type1 - CHECK_RESULT $? 0 0 "卸载texlive-libertinus-type1失败" - LOG_INFO "环境已恢复,texlive-libertinus-type1已卸载" - else - LOG_INFO "环境已恢复,保持texlive-libertinus-type1安装状态" - fi - - LOG_INFO "测试完成" -} - -main "$@" \ No newline at end of file diff --git a/testcases/function_test/pkg_test/texlive-split-z/texlive-libertinus-type1/test_texlive-libertinus-type1_function_texdoc.sh b/testcases/function_test/pkg_test/texlive-split-z/texlive-libertinus-type1/test_texlive-libertinus-type1_function_texdoc.sh deleted file mode 100644 index e73fc027216..00000000000 --- a/testcases/function_test/pkg_test/texlive-split-z/texlive-libertinus-type1/test_texlive-libertinus-type1_function_texdoc.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 : Test documentation accessibility -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - # 检查软件包是否已在系统中安装 - LOG_INFO "检查是否已安装texlive-libertinus-type1软件包" - rpm -q texlive-libertinus-type1 > /dev/null 2>&1 - if [ $? -eq 0 ]; then - LOG_INFO "texlive-libertinus-type1软件包已安装,记录安装状态" - INSTALLED=true - else - LOG_INFO "texlive-libertinus-type1软件包未安装" - INSTALLED=false - fi - - # 检查yum源中是否存在texlive-libertinus-type1软件包 - LOG_INFO "检查yum源中是否存在texlive-libertinus-type1软件包" - dnf list available texlive-libertinus-type1 > /dev/null 2>&1 - if [ $? -ne 0 ]; then - LOG_ERROR "yum源中未找到texlive-libertinus-type1软件包" - exit 255 - fi - - # 如果未安装,则安装软件包 - if [ "$INSTALLED" = "false" ]; then - LOG_INFO "开始安装texlive-libertinus-type1软件包" - dnf install -y texlive-libertinus-type1 - CHECK_RESULT $? 0 0 "安装texlive-libertinus-type1软件包失败" - LOG_INFO "texlive-libertinus-type1软件包安装成功" - fi - - # 测试texdoc命令是否可用 - LOG_INFO "测试texdoc命令是否可用" - which texdoc > /dev/null 2>&1 - if [ $? -ne 0 ]; then - LOG_ERROR "texdoc命令不存在" - exit 255 - fi - - # 测试texdoc命令是否支持-libertinus参数 - LOG_INFO "测试texdoc命令是否支持-libertinus参数" - texdoc --help 2>&1 | grep -q "\-\-libertinus" - if [ $? -ne 0 ]; then - LOG_ERROR "texdoc命令不支持--libertinus参数" - exit 255 - fi - - # 执行texdoc --libertinus命令 - LOG_INFO "执行texdoc --libertinus命令" - texdoc --libertinus > /dev/null 2>&1 - CHECK_RESULT $? 0 0 "执行texdoc --libertinus命令失败" - - # 清理环境:如果脚本开始前未安装,则在测试结束后卸载软件包 - if [ "$INSTALLED" = "false" ]; then - LOG_INFO "清理环境:卸载texlive-libertinus-type1软件包" - dnf remove -y texlive-libertinus-type1 - CHECK_RESULT $? 0 0 "卸载texlive-libertinus-type1软件包失败" - LOG_INFO "texlive-libertinus-type1软件包卸载成功" - else - LOG_INFO "保持texlive-libertinus-type1软件包的安装状态" - fi - - LOG_INFO "测试完成:Test documentation accessibility" -} - -main "$@" \ No newline at end of file From c7b51ab2c8ba7f7d96704e70c3aea9d1c3100825 Mon Sep 17 00:00:00 2001 From: honghua Date: Sat, 18 Apr 2026 16:56:56 +0800 Subject: [PATCH 04/17] update testcase for testsuite texlive-hands --- .../texlive-split-k/texlive-hands.json | 100 --------------- .../test_texlive-hands_downgrade.sh | 92 -------------- .../test_texlive-hands_downgrade_rollback.sh | 102 --------------- .../test_texlive-hands_function_basiccmd.sh | 112 ---------------- .../test_texlive-hands_function_check.sh | 83 ------------ .../test_texlive-hands_function_doc.sh | 61 --------- .../test_texlive-hands_function_install.sh | 103 --------------- .../test_texlive-hands_function_uninstall.sh | 73 ----------- .../test_texlive-hands_install.sh | 66 ---------- .../test_texlive-hands_reinstall.sh | 73 ----------- .../test_texlive-hands_rollback.sh | 78 ------------ .../test_texlive-hands_service_config.sh | 66 ---------- .../test_texlive-hands_service_disable.sh | 77 ----------- .../test_texlive-hands_service_enable.sh | 80 ------------ .../test_texlive-hands_service_log.sh | 66 ---------- .../test_texlive-hands_service_reload.sh | 58 --------- .../test_texlive-hands_service_restart.sh | 71 ----------- .../test_texlive-hands_service_start.sh | 73 ----------- .../test_texlive-hands_service_status.sh | 64 ---------- .../test_texlive-hands_service_stop.sh | 66 ---------- .../test_texlive-hands_upgrade.sh | 87 ------------- .../test_texlive-hands_upgrade_rollback.sh | 120 ------------------ 22 files changed, 1771 deletions(-) delete mode 100644 testcases/function_test/pkg_test/texlive-split-k/texlive-hands/test_texlive-hands_downgrade.sh delete mode 100644 testcases/function_test/pkg_test/texlive-split-k/texlive-hands/test_texlive-hands_downgrade_rollback.sh delete mode 100644 testcases/function_test/pkg_test/texlive-split-k/texlive-hands/test_texlive-hands_function_basiccmd.sh delete mode 100644 testcases/function_test/pkg_test/texlive-split-k/texlive-hands/test_texlive-hands_function_check.sh delete mode 100644 testcases/function_test/pkg_test/texlive-split-k/texlive-hands/test_texlive-hands_function_doc.sh delete mode 100644 testcases/function_test/pkg_test/texlive-split-k/texlive-hands/test_texlive-hands_function_install.sh delete mode 100644 testcases/function_test/pkg_test/texlive-split-k/texlive-hands/test_texlive-hands_function_uninstall.sh delete mode 100644 testcases/function_test/pkg_test/texlive-split-k/texlive-hands/test_texlive-hands_install.sh delete mode 100644 testcases/function_test/pkg_test/texlive-split-k/texlive-hands/test_texlive-hands_reinstall.sh delete mode 100644 testcases/function_test/pkg_test/texlive-split-k/texlive-hands/test_texlive-hands_rollback.sh delete mode 100644 testcases/function_test/pkg_test/texlive-split-k/texlive-hands/test_texlive-hands_service_config.sh delete mode 100644 testcases/function_test/pkg_test/texlive-split-k/texlive-hands/test_texlive-hands_service_disable.sh delete mode 100644 testcases/function_test/pkg_test/texlive-split-k/texlive-hands/test_texlive-hands_service_enable.sh delete mode 100644 testcases/function_test/pkg_test/texlive-split-k/texlive-hands/test_texlive-hands_service_log.sh delete mode 100644 testcases/function_test/pkg_test/texlive-split-k/texlive-hands/test_texlive-hands_service_reload.sh delete mode 100644 testcases/function_test/pkg_test/texlive-split-k/texlive-hands/test_texlive-hands_service_restart.sh delete mode 100644 testcases/function_test/pkg_test/texlive-split-k/texlive-hands/test_texlive-hands_service_start.sh delete mode 100644 testcases/function_test/pkg_test/texlive-split-k/texlive-hands/test_texlive-hands_service_status.sh delete mode 100644 testcases/function_test/pkg_test/texlive-split-k/texlive-hands/test_texlive-hands_service_stop.sh delete mode 100644 testcases/function_test/pkg_test/texlive-split-k/texlive-hands/test_texlive-hands_upgrade.sh delete mode 100644 testcases/function_test/pkg_test/texlive-split-k/texlive-hands/test_texlive-hands_upgrade_rollback.sh diff --git a/suite2cases/function_test/pkg_test/texlive-split-k/texlive-hands.json b/suite2cases/function_test/pkg_test/texlive-split-k/texlive-hands.json index c566164de86..4046504add5 100644 --- a/suite2cases/function_test/pkg_test/texlive-split-k/texlive-hands.json +++ b/suite2cases/function_test/pkg_test/texlive-split-k/texlive-hands.json @@ -2,110 +2,10 @@ "path": "$OET_PATH/testcases/function_test/pkg_test/texlive-split-k/texlive-hands", "machine num": 1, "cases": [ - { - "name": "test_texlive-hands_install", - "desc": "测试texlive-hands软件包的安装功能,确保能够正确安装到系统中", - "machine num": 1 - }, { "name": "test_texlive-hands_uninstall", "desc": "测试texlive-hands软件包的卸载功能,确保能够正确从系统中卸载", "machine num": 1 - }, - { - "name": "test_texlive-hands_upgrade", - "desc": "测试texlive-hands软件包的升级功能,确保能够正确升级到新版本", - "machine num": 1 - }, - { - "name": "test_texlive-hands_downgrade", - "desc": "测试texlive-hands软件包的降级功能,确保能够正确降级到旧版本", - "machine num": 1 - }, - { - "name": "test_texlive-hands_rollback", - "desc": "测试texlive-hands软件包的回滚功能,确保能够正确回滚到上一个版本", - "machine num": 1 - }, - { - "name": "test_texlive-hands_service_start", - "desc": "测试texlive-hands软件包提供的服务的启动功能,确保服务能够正常启动", - "machine num": 1 - }, - { - "name": "test_texlive-hands_service_stop", - "desc": "测试texlive-hands软件包提供的服务的停止功能,确保服务能够正常停止", - "machine num": 1 - }, - { - "name": "test_texlive-hands_service_restart", - "desc": "测试texlive-hands软件包提供的服务的重启功能,确保服务能够正常重启", - "machine num": 1 - }, - { - "name": "test_texlive-hands_service_status", - "desc": "测试texlive-hands软件包提供的服务的状态查询功能,确保能够正确查询服务状态", - "machine num": 1 - }, - { - "name": "test_texlive-hands_service_config", - "desc": "测试texlive-hands软件包提供的服务的配置功能,确保能够正确配置服务参数", - "machine num": 1 - }, - { - "name": "test_texlive-hands_service_log", - "desc": "测试texlive-hands软件包提供的服务的日志查看功能,确保能够正确查看服务日志", - "machine num": 1 - }, - { - "name": "test_texlive-hands_reinstall", - "desc": "测试texlive-hands软件包的重新安装功能,确保能够正确重新安装到系统中", - "machine num": 1 - }, - { - "name": "test_texlive-hands_downgrade_rollback", - "desc": "测试texlive-hands软件包的降级回滚功能,确保能够正确从降级版本回滚到上一个版本", - "machine num": 1 - }, - { - "name": "test_texlive-hands_service_reload", - "desc": "测试texlive-hands软件包提供的服务的重载功能,确保服务能够正常重载配置", - "machine num": 1 - }, - { - "name": "test_texlive-hands_upgrade_rollback", - "desc": "测试texlive-hands软件包的升级回滚功能,确保能够正确从升级版本回滚到上一个版本", - "machine num": 1 - }, - { - "name": "test_texlive-hands_service_enable", - "desc": "测试texlive-hands软件包提供的服务的开机自启功能,确保服务能够正确配置为开机自启", - "machine num": 1 - }, - { - "name": "test_texlive-hands_service_disable", - "desc": "测试texlive-hands软件包提供的服务的开机自启禁用功能,确保服务能够正确配置为不开机自启", - "machine num": 1 - }, - { - "name": "test_texlive-hands_function_install", - "desc": "测试软件包的基本安装功能,验证其能否被正确安装到系统" - }, - { - "name": "test_texlive-hands_function_check", - "desc": "测试检查软件包是否已安装及版本信息的功能" - }, - { - "name": "test_texlive-hands_function_basiccmd", - "desc": "测试软件包提供的基本命令行工具或功能是否可用" - }, - { - "name": "test_texlive-hands_function_uninstall", - "desc": "测试软件包的卸载功能,确保能完全移除" - }, - { - "name": "test_texlive-hands_function_doc", - "desc": "测试软件包文档(如手册页、帮助信息)的可访问性" } ] } \ No newline at end of file diff --git a/testcases/function_test/pkg_test/texlive-split-k/texlive-hands/test_texlive-hands_downgrade.sh b/testcases/function_test/pkg_test/texlive-split-k/texlive-hands/test_texlive-hands_downgrade.sh deleted file mode 100644 index caaebff2cd9..00000000000 --- a/testcases/function_test/pkg_test/texlive-split-k/texlive-hands/test_texlive-hands_downgrade.sh +++ /dev/null @@ -1,92 +0,0 @@ -#!/usr/bin/bash - -# Copyright (c) 2024 ISCAS .ALL rights reserved. -# This program is licensed under Mulan PSL v2. -# You can use it according to the terms and conditions of the Mulan PSL v2. -# http://license.coscl.org.cn/MulanPSL2 -# THIS PROGRAM IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, -# EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-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-07-05 -# @License : Mulan PSL v2 -# @Desc : 测试texlive-hands软件包的降级功能,确保能够正确降级到旧版本 -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - # 测试texlive-hands软件包的降级功能 - LOG_INFO "开始测试texlive-hands软件包的降级功能" - - # 检查是否已安装texlive-hands - LOG_INFO "检查texlive-hands是否已安装" - dnf list installed texlive-hands > /dev/null 2>&1 - if [ $? -eq 0 ]; then - LOG_INFO "texlive-hands已安装,脚本结束时将保持安装状态" - INSTALLED=true - else - LOG_INFO "texlive-hands未安装,将在测试步骤中安装并在结束时卸载" - INSTALLED=false - fi - - # 检查yum源中是否存在texlive-hands软件包 - LOG_INFO "检查yum源中是否存在texlive-hands软件包" - dnf list available texlive-hands > /dev/null 2>&1 - if [ $? -ne 0 ]; then - LOG_ERROR "yum源中不存在texlive-hands软件包" - exit 255 - fi - - # 获取当前texlive-hands版本 - LOG_INFO "获取当前texlive-hands版本" - CURRENT_VERSION=$(dnf list installed texlive-hands | awk "{print $2}" | tail -n 1) - if [ -z "$CURRENT_VERSION" ]; then - CURRENT_VERSION="未安装" - fi - LOG_INFO "当前texlive-hands版本: $CURRENT_VERSION" - - # 获取可用的旧版本 - LOG_INFO "获取可用的旧版本" - OLD_VERSIONS=$(dnf --showduplicates list texlive-hands | grep texlive-hands | awk "{print $2}" | sort -V) - if [ -z "$OLD_VERSIONS" ]; then - LOG_ERROR "未找到可用的旧版本" - exit 255 - fi - - # 选择第一个旧版本作为降级目标 - TARGET_VERSION=$(echo "$OLD_VERSIONS" | head -n 1) - LOG_INFO "目标降级版本: $TARGET_VERSION" - - # 如果未安装,先安装当前版本 - if [ "$INSTALLED" = false ]; then - LOG_INFO "安装当前版本的texlive-hands" - dnf install -y texlive-hands - CHECK_RESULT $? 0 0 "安装texlive-hands失败" - fi - - # 执行降级操作 - LOG_INFO "执行降级操作到版本: $TARGET_VERSION" - dnf downgrade -y texlive-$TARGET_VERSION - CHECK_RESULT $? 0 0 "降级texlive-$TARGET_VERSION失败" - - #验证降级后的版本 - LOG_INFO "验证降级后的版本" - AFTER_VERSION=$(dnf list installed texlives-hansd| awk "{print$2}"| tail-n1) - CHECK_RESULT "$AFTER_VERSION""$TARGET_VERSION""0""\“降级后版本不匹配\”" - - # 恢复环境 - if [ "$INSTALLED" = false ]; then - LOG_INFO“卸载texlives-hansd以恢复环境” - dnf remove -y texlives hansd - CHECK_RESULT$?00“卸载失败” - fi - - LOG_INFO“测试完成” -} - -main "$@" \ No newline at end of file diff --git a/testcases/function_test/pkg_test/texlive-split-k/texlive-hands/test_texlive-hands_downgrade_rollback.sh b/testcases/function_test/pkg_test/texlive-split-k/texlive-hands/test_texlive-hands_downgrade_rollback.sh deleted file mode 100644 index 47b2f673090..00000000000 --- a/testcases/function_test/pkg_test/texlive-split-k/texlive-hands/test_texlive-hands_downgrade_rollback.sh +++ /dev/null @@ -1,102 +0,0 @@ -#!/usr/bin/bash - -# Copyright (c) 2024 ISCAS .ALL rights reserved. -# This program is licensed under Mulan PSL v2. -# You can use it according to the terms and conditions of the Mulan PSL v2. -# http://license.coscl.org.cn/MulanPSL2 -# THIS PROGRAM IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, -# EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, -# MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. -# See the Mulan PSL v2 for more details. - -# ############################################# -# @Author : honghua -# @Contact : honghua@iscas.ac.cn -# @Date : 2025-07-05 -# @License : Mulan PSL v2 -# @Desc : 测试texlive-hands软件包的降级回滚功能,确保能够正确从降级版本回滚到上一个版本 -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - # 检查texlive-hands软件包是否已安装 - LOG_INFO "检查texlive-hands软件包是否已安装" - dnf list installed texlive-hands &>/dev/null - if [ $? -eq 0 ]; then - LOG_INFO "texlive-hands软件包已安装,脚本结束时将保持安装状态" - INSTALLED=true - else - LOG_INFO "texlive-hands软件包未安装,将在测试结束后卸载" - INSTALLED=false - fi - - # 检查yum源中是否存在texlive-hands软件包 - LOG_INFO "检查yum源中是否存在texlive-hands软件包" - dnf list available texlive-hands &>/dev/null - CHECK_RESULT $? 0 255 "yum源中不存在texlive-hands软件包" - - # 获取当前安装的texlive-hands版本 - LOG_INFO "获取当前安装的texlive-hands版本" - CURRENT_VERSION=$(dnf list installed texlive-hands | awk "NR==2 {print $2}") - LOG_INFO "当前texlive-hands版本: $CURRENT_VERSION" - - # 获取可用的texlive-hands版本列表 - LOG_INFO "获取可用的texlive-hands版本列表" - AVAILABLE_VERSIONS=$(dnf --showduplicates list texlive-hands | awk "NR>1 {print $2}" | sort -V) - if [ -z "$AVAILABLE_VERSIONS" ]; then - LOG_ERROR "无法获取texlive-hands可用版本列表" - exit 255 - fi - - # 检查是否有多个版本可供选择 - LOG_INFO "检查是否有多个版本可供选择" - VERSION_COUNT=$(echo "$AVAILABLE_VERSIONS" | wc -l) - if [ "$VERSION_COUNT" -lt 2 ]; then - LOG_ERROR "yum源中texlive-hands可用版本不足2个,无法测试降级回滚" - exit 255 - fi - - # 选择降级版本(倒数第二个版本) - LOG_INFO "选择降级版本" - DOWNGRADE_VERSION=$(echo "$AVAILABLE_VERSIONS" | tail -n 2 | head -n 1) - LOG_INFO "降级目标版本: $DOWNGRADE_VERSION" - - # 执行降级操作 - LOG_INFO "[步骤1] 执行降级操作到版本 $DOWNGRADE_VERSION" - dnf downgrade -y texlive-hands-$DOWNGRADE_VERSION - CHECK_RESULT $? 0 0 "[步骤1] 降级操作失败" - - # 验证降级后的版本 - LOG_INFO "[步骤2] 验证降级后的版本" - INSTALLED_VERSION=$(dnf list installed texlive-hands | awk "NR==2 {print $2}") - if [ "$INSTALLED_VERSION" != "$DOWNGRADE_VERSION" ]; then - LOG_ERROR "[步骤2] 降级后版本验证失败,当前版本: $INSTALLED_VERSION" - exit 1 - fi - LOG_INFO "[步骤2] 降级后版本验证成功,当前版本: $INSTALLED_VERSION" - - # 执行回滚操作 - LOG_INFO "[步骤3] 执行回滚操作到上一个版本" - dnf history undo last -y - CHECK_RESULT $? 0 0 "[步骤3] 回滚操作失败" - - # 验证回滚后的版本 - LOG_INFO "[步骤4]验证回滚后的版本是否恢复到$CURRENT_VERSION" - ROLLBACK_VERSION=$(dnf list installed texlive-hands | awk "NR==2 {print $2}") - if [ "$ROLLBACK_VERSION" != "$CURRENT_VERSION" ]; then - LOG_ERROR "[步骤4] 回滚后版本验证失败,当前版本: $ROLLBACK_VERSION" - exit 1 - fi - LOG_INFO "[步骤4]回滚后恢复成功,当前恢复到$ROLLBACK_VERSION" - - #环境清理 - if [ "$INSTALLED" = false ]; then - LOG_INFO "清理环境,卸载texlive-hansd软件包..." - dnf remove -y texlike-hand - else - LOG_INFO “环境保持安装状态,无需清理” - fi -} - -main "$@" \ No newline at end of file diff --git a/testcases/function_test/pkg_test/texlive-split-k/texlive-hands/test_texlive-hands_function_basiccmd.sh b/testcases/function_test/pkg_test/texlive-split-k/texlive-hands/test_texlive-hands_function_basiccmd.sh deleted file mode 100644 index a5c02ffe88b..00000000000 --- a/testcases/function_test/pkg_test/texlive-split-k/texlive-hands/test_texlive-hands_function_basiccmd.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-19 -# @License : Mulan PSL v2 -# @Desc : 测试软件包提供的基本命令行工具或功能是否可用 -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - # 测试软件包提供的基本命令行工具或功能是否可用 - LOG_INFO "开始测试texlive-hands软件包的基本命令行工具或功能" - - # 检查yum源中是否存在texlive-hands软件包 - LOG_INFO "检查yum源中是否存在texlive-hands软件包" - dnf list available texlive-hands > /dev/null 2>&1 - if [ $? -ne 0 ]; then - LOG_ERROR "yum源中不存在texlive-hands软件包" - exit 255 - fi - - # 检查是否已安装texlive-hands - LOG_INFO "检查是否已安装texlive-hands软件包" - rpm -q texlive-hands > /dev/null 2>&1 - if [ $? -eq 0 ]; then - LOG_INFO "texlive-hands已安装,测试完成后将保持安装状态" - ALREADY_INSTALLED=1 - else - LOG_INFO "texlive-hands未安装,将进行安装测试" - ALREADY_INSTALLED=0 - fi - - # 如果未安装,则安装软件包 - if [ $ALREADY_INSTALLED -eq 0 ]; then - LOG_INFO "安装texlive-hands软件包" - dnf install -y texlive-hands - CHECK_RESULT $? 0 0 "安装texlive-hands失败" - fi - - # 测试基本命令是否存在 - LOG_INFO "测试texlive-hands提供的命令是否存在" - command -v tex > /dev/null 2>&1 - CHECK_RESULT $? 0 0 "tex命令不存在" - - command -v latex > /dev/null 2>&1 - CHECK_RESULT $? 0 0 "latex命令不存在" - - # 测试tex命令的基本功能 - LOG_INFO "测试tex命令的基本功能" - tex --version > /dev/null 2>&1 - CHECK_RESULT $? 0 0 "tex --version命令执行失败" - - # 测试latex命令的基本功能 - LOG_INFO "测试latex命令的基本功能" - latex --version > /dev/null 2>&1 - CHECK_RESULT $? 0 0 "latex --version命令执行失败" - - # 测试不支持的命令参数 - LOG_INFO "测试不支持的命令参数" - tex --invalid-param > /dev/null 2>&1 - if [ $? -eq 255 ]; then - LOG_INFO "检测到不支持的参数,按预期退出" - exit 255 - elif [ $? -ne 0 ]; then - # 其他错误,按正常错误处理 - CHECK_RESULT $? 0 0 "tex命令执行失败" - fi - - # 创建简单的测试文档 - LOG_INFO "创建简单的LaTeX测试文档" - cat > test_doc.tex << "EOF" - \documentclass{article} - \begin{document} - Hello, TeX Live! - \end{document} - EOF - - # 使用latex命令处理测试文档 - LOG_INFO "使用latex命令处理测试文档" - latex test_doc.tex > /dev/null 2>&1 - CHECK_RESULT $? 0 0 "latex处理测试文档失败" - - # 清理测试文件 - LOG_INFO "清理测试文件" - rm -f test_doc.tex test_doc.aux test_doc.log test_doc.dvi - - # 环境恢复 - LOG_INFO "开始环境恢复" - if [ $ALREADY_INSTALLED -eq 0 ]; then - LOG_INFO "卸载texlive-hands软件包" - dnf remove -y texlive-hands - CHECK_RESULT $? 0 0 "卸载texlive-hands失败" - else - LOG_INFO "保持texlive-hands软件包安装状态" - fi - - LOG_INFO "测试完成" -} - -main "$@" \ No newline at end of file diff --git a/testcases/function_test/pkg_test/texlive-split-k/texlive-hands/test_texlive-hands_function_check.sh b/testcases/function_test/pkg_test/texlive-split-k/texlive-hands/test_texlive-hands_function_check.sh deleted file mode 100644 index 3eadf640076..00000000000 --- a/testcases/function_test/pkg_test/texlive-split-k/texlive-hands/test_texlive-hands_function_check.sh +++ /dev/null @@ -1,83 +0,0 @@ -#!/usr/bin/bash - -# Copyright (c) 2024 ISCAS .ALL rights reserved. -# This program is licensed under Mulan PSL v2. -# You can use it according to the terms and conditions of the Mulan PSL v2. -# http://license.coscl.org.cn/MulanPSL2 -# THIS PROGRAM IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, -# EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, -# MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. -# See the Mulan PSL v2 for more details. - -# ############################################# -# @Author : honghua -# @Contact : honghua@iscas.ac.cn -# @Date : 2026-03-19 -# @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 - } - - # 定义软件包名称 - PACKAGE_NAME="texlive-hands" - TEST_COMMAND="tex --version" - INSTALLED=false - - # 步骤1:检查软件包是否已安装 - LOG_INFO "步骤1:检查系统是否已安装 $PACKAGE_NAME" - if rpm -q "$PACKAGE_NAME" &> /dev/null; then - LOG_INFO "$PACKAGE_NAME 已安装" - INSTALLED=true - else - LOG_INFO "$PACKAGE_NAME 未安装" - fi - - # 步骤2:检查软件包是否在yum源中 - LOG_INFO "步骤2:检查yum源中是否存在 $PACKAGE_NAME" - if ! dnf list available "$PACKAGE_NAME" &> /dev/null; then - LOG_ERROR "yum源中未找到 $PACKAGE_NAME" - exit 255 - fi - - # 步骤3:如果未安装,则安装软件包 - if [ "$INSTALLED" = false ]; then - LOG_INFO "步骤3:安装 $PACKAGE_NAME" - dnf install -y "$PACKAGE_NAME" - CHECK_RESULT $? 0 0 "安装 $PACKAGE_NAME 失败" - fi - - # 步骤4:测试软件包功能 - LOG_INFO "步骤4:测试 $PACKAGE_NAME 功能" - eval $TEST_COMMAND - CHECK_RESULT $? 0 0 "执行 $TEST_COMMAND 失败" - - # 步骤5:检查软件包版本信息 - LOG_INFO "步骤5:检查 $PACKAGE_NAME 版本信息" - rpm -q "$PACKAGE_NAME" - CHECK_RESULT $? 0 0 "获取 $PACKAGE_NAME 版本信息失败" - - # 步骤6:清理环境 - LOG_INFO "步骤6:清理测试环境" - if [ "$INSTALLED" = false ]; then - LOG_INFO "卸载 $PACKAGE_NAME" - dnf remove -y "$PACKAGE_NAME" - CHECK_RESULT $? 0 0 "卸载 $PACKAGE_NAME 失败" - else - LOG_INFO "保持 $PACKAGE_NAME 安装状态" - fi - - LOG_INFO "测试完成" -} - -main "$@" \ No newline at end of file diff --git a/testcases/function_test/pkg_test/texlive-split-k/texlive-hands/test_texlive-hands_function_doc.sh b/testcases/function_test/pkg_test/texlive-split-k/texlive-hands/test_texlive-hands_function_doc.sh deleted file mode 100644 index 6ed52ee25c0..00000000000 --- a/testcases/function_test/pkg_test/texlive-split-k/texlive-hands/test_texlive-hands_function_doc.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 : 2026-03-19 -# @License : Mulan PSL v2 -# @Desc : 测试软件包文档(如手册页、帮助信息)的可访问性 -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - LOG_INFO "开始测试软件包文档(如手册页、帮助信息)的可访问性" - LOG_INFO "步骤1:检查是否已安装texlive-hands软件包" - dnf list installed texlive-hands 2>/dev/null | grep -q texlive-hands - if [ $? -eq 0 ]; then - LOG_INFO "texlive-hands软件包已安装,测试结束后将保持安装状态" - INSTALLED=1 - else - LOG_INFO "texlive-hands软件包未安装,将在测试过程中安装" - INSTALLED=0 - fi - LOG_INFO "步骤2:检查yum源中是否有texlive-hands软件包" - dnf list available texlive-hands 2>/dev/null | grep -q texlive-hands - if [ $? -ne 0 ]; then - LOG_ERROR "yum源中未找到texlive-hands软件包" - exit 255 - fi - if [ $INSTALLED -eq 0 ]; then - LOG_INFO "步骤3:安装texlive-hands软件包" - dnf install -y texlive-hands - CHECK_RESULT $? 0 0 "安装texlive-hands软件包失败" - fi - LOG_INFO "步骤4:测试texlive-hands软件包手册页可访问性" - man texlive-hands > /dev/null 2>&1 - CHECK_RESULT $? 0 0 "texlive-hands手册页不可访问" - LOG_INFO "步骤5:测试texlive-hands软件包帮助信息可访问性" - texlive-hands --help > /dev/null 2>&1 - CHECK_RESULT $? 0 0 "texlive-hands帮助信息不可访问" - LOG_INFO "步骤6:清理测试环境" - if [ $INSTALLED -eq 0 ]; then - LOG_INFO "卸载texlive-hands软件包" - dnf remove -y texlive-hands - CHECK_RESULT $? 0 0 "卸载texlive-hands软件包失败" - else - LOG_INFO "保持texlive-hands软件包安装状态" - fi - LOG_INFO "测试完成" -} - -main "$@" \ No newline at end of file diff --git a/testcases/function_test/pkg_test/texlive-split-k/texlive-hands/test_texlive-hands_function_install.sh b/testcases/function_test/pkg_test/texlive-split-k/texlive-hands/test_texlive-hands_function_install.sh deleted file mode 100644 index e7f2666ad9a..00000000000 --- a/testcases/function_test/pkg_test/texlive-split-k/texlive-hands/test_texlive-hands_function_install.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-19 -# @License : Mulan PSL v2 -# @Desc : 测试软件包的基本安装功能,验证其能否被正确安装到系统 -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - # 定义颜色输出(可选,如果LOG_INFO/LOG_ERROR未定义) - if ! command -v LOG_INFO &> /dev/null; then - LOG_INFO() { - echo "[INFO] $*" - } - fi - - if ! command -v LOG_ERROR &> /dev/null; then - LOG_ERROR() { - echo "[ERROR] $*" >&2 - } - fi - - # 定义软件包名称 - PACKAGE_NAME="texlive-hands" - - # 步骤1:检查软件包是否已在yum源中 - LOG_INFO "检查yum源中是否存在软件包 $PACKAGE_NAME" - if ! dnf list available "$PACKAGE_NAME" &> /dev/null; then - LOG_ERROR "软件包 $PACKAGE_NAME 不在yum源中" - exit 255 - fi - - # 步骤2:检查当前环境是否已安装该软件包 - LOG_INFO "检查系统是否已安装软件包 $PACKAGE_NAME" - if rpm -q "$PACKAGE_NAME" &> /dev/null; then - LOG_INFO "软件包 $PACKAGE_NAME 已安装,测试将保持安装状态" - INSTALLED_BEFORE=true - else - LOG_INFO "软件包 $PACKAGE_NAME 未安装,将进行安装测试" - INSTALLED_BEFORE=false - fi - - # 步骤3:如果未安装,则安装软件包 - if [ "$INSTALLED_BEFORE" = false ]; then - LOG_INFO "开始安装软件包 $PACKAGE_NAME" - dnf install -y "$PACKAGE_NAME" - CHECK_RESULT $? 0 0 "安装软件包 $PACKAGE_NAME 失败" - LOG_INFO "软件包 $PACKAGE_NAME 安装成功" - fi - - # 步骤4:验证软件包是否安装成功 - LOG_INFO "验证软件包 $PACKAGE_NAME 是否安装成功" - rpm -q "$PACKAGE_NAME" - CHECK_RESULT $? 0 0 "验证软件包 $PACKAGE_NAME 安装状态失败" - - # 步骤5:检查软件包的基本功能(例如查看版本或帮助信息) - LOG_INFO "检查软件包 $PACKAGE_NAME 的基本功能" - # 假设软件包安装后会提供 "texlive-hands --version" 或类似命令 - if command -v "$PACKAGE_NAME" &> /dev/null; then - # 尝试获取版本信息 - if "$PACKAGE_NAME" --version &> /dev/null; then - LOG_INFO "软件包 $PACKAGE_NAME 基本功能正常" - else - LOG_ERROR "软件包 $PACKAGE_NAME 基本功能异常" - exit 1 - fi - else - # 如果软件包未提供可执行文件,则检查相关文件是否存在 - if [ -d "/usr/share/texlive-hands" ] || [ -f "/usr/share/doc/$PACKAGE_NAME" ]; then - LOG_INFO "软件包 $PACKAGE_NAME 相关文件存在" - else - LOG_ERROR "软件包 $PACKAGE_NAME 相关文件不存在" - exit 1 - fi - fi - - # 步骤6:清理环境(如果测试前未安装,则卸载软件包) - 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 "测试前软件包已安装,保持安装状态" - fi - - LOG_INFO "测试完成,环境已恢复" -} - -main "$@" \ No newline at end of file diff --git a/testcases/function_test/pkg_test/texlive-split-k/texlive-hands/test_texlive-hands_function_uninstall.sh b/testcases/function_test/pkg_test/texlive-split-k/texlive-hands/test_texlive-hands_function_uninstall.sh deleted file mode 100644 index 8da657abf6f..00000000000 --- a/testcases/function_test/pkg_test/texlive-split-k/texlive-hands/test_texlive-hands_function_uninstall.sh +++ /dev/null @@ -1,73 +0,0 @@ -#!/usr/bin/bash - -# Copyright (c) 2024 ISCAS .ALL rights reserved. -# This program is licensed under Mulan PSL v2. -# You can use it according to the terms and conditions of the Mulan PSL v2. -# http://license.coscl.org.cn/MulanPSL2 -# THIS PROGRAM IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, -# EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, -# MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. -# See the Mulan PSL v2 for more details. - -# ############################################# -# @Author : honghua -# @Contact : honghua@iscas.ac.cn -# @Date : 2026-03-19 -# @License : Mulan PSL v2 -# @Desc : 测试软件包的卸载功能,确保能完全移除 -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - set -e - - LOG_INFO "开始测试texlive-hands软件包的卸载功能" - LOG_INFO "检查yum源中是否存在texlive-hands软件包" - - if ! dnf list available texlive-hands &>/dev/null; then - LOG_ERROR "yum源中未找到texlive-hands软件包" - exit 255 - fi - - LOG_INFO "检查当前环境是否已安装texlive-hands软件包" - if rpm -q texlive-hands &>/dev/null; then - LOG_INFO "环境已安装texlive-hands软件包,测试结束后保持安装状态" - INSTALLED_BEFORE_TEST=true - else - LOG_INFO "环境未安装texlive-hands软件包,执行安装步骤" - INSTALLED_BEFORE_TEST=false - LOG_INFO "安装texlive-hands软件包" - dnf install -y texlive-hands - CHECK_RESULT $? 0 0 "安装texlive-hands软件包失败" - fi - - LOG_INFO "验证软件包安装成功" - rpm -q texlive-hands - CHECK_RESULT $? 0 0 "验证texlive-hands安装状态失败" - - LOG_INFO "执行软件包卸载" - dnf remove -y texlive-hands - CHECK_RESULT $? 0 0 "卸载texlive-hands软件包失败" - - LOG_INFO "验证软件包已完全移除" - if rpm -q texlive-hands &>/dev/null; then - LOG_ERROR "texlive-hands软件包卸载不彻底" - exit 1 - else - LOG_INFO "texlive-hands软件包已完全移除" - fi - - if [ "$INSTALLED_BEFORE_TEST" = "false" ]; then - LOG_INFO "恢复环境:重新安装texlive-hands软件包" - dnf install -y texlive-hands - CHECK_RESULT $? 0 0 "恢复安装texlive-hands软件包失败" - LOG_INFO "环境已恢复" - else - LOG_INFO "环境保持原安装状态" - fi - - LOG_INFO "测试完成" -} - -main "$@" \ No newline at end of file diff --git a/testcases/function_test/pkg_test/texlive-split-k/texlive-hands/test_texlive-hands_install.sh b/testcases/function_test/pkg_test/texlive-split-k/texlive-hands/test_texlive-hands_install.sh deleted file mode 100644 index 1378daf6ff7..00000000000 --- a/testcases/function_test/pkg_test/texlive-split-k/texlive-hands/test_texlive-hands_install.sh +++ /dev/null @@ -1,66 +0,0 @@ -#!/usr/bin/bash - -# Copyright (c) 2024 ISCAS .ALL rights reserved. -# This program is licensed under Mulan PSL v2. -# You can use it according to the terms and conditions of the Mulan PSL v2. -# http://license.coscl.org.cn/MulanPSL2 -# THIS PROGRAM IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, -# EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, -# MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. -# See the Mulan PSL v2 for more details. - -# ############################################# -# @Author : honghua -# @Contact : honghua@iscas.ac.cn -# @Date : 2025-07-05 -# @License : Mulan PSL v2 -# @Desc : 测试texlive-hands软件包的安装功能,确保能够正确安装到系统中 -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - # 检查texlive-hands软件包是否已安装 - LOG_INFO "检查texlive-hands软件包是否已安装" - rpm -q texlive-hands > /dev/null 2>&1 - if [ $? -eq 0 ]; then - LOG_INFO "texlive-hands软件包已安装,跳过安装步骤" - installed=true - else - installed=false - fi - - # 检查yum源中是否存在texlive-hands软件包 - LOG_INFO "检查yum源中是否存在texlive-hands软件包" - dnf list available texlive-hands > /dev/null 2>&1 - CHECK_RESULT $? 0 255 "yum源中不存在texlive-hands软件包" - - # 安装texlive-hands软件包 - if [ "$installed" = false ]; then - LOG_INFO "开始安装texlive-hands软件包" - dnf install -y texlive-hands - CHECK_RESULT $? 0 0 "安装texlive-hands软件包失败" - fi - - # 验证texlive-hands软件包是否成功安装 - LOG_INFO "验证texlive-hands软件包是否成功安装" - rpm -q texlive-hands > /dev/null 2>&1 - CHECK_RESULT $? 0 0 "texlive-hands软件包未正确安装" - - # 清理环境:如果脚本开始时未安装,则卸载texlive-hands软件包 - if [ "$installed" = false ]; then - LOG_INFO "清理环境:卸载texlive-hands软件包" - dnf remove -y texlive-hands - CHECK_RESULT $? 0 0 "卸载texlive-hands软件包失败" - - # 再次验证texlive-hands软件包是否已卸载 - rpm -q texlive-hands > /dev/null 2>&1 - CHECK_RESULT $? 1 0 "texlive-hands软件包未正确卸载" - else - LOG_INFO "环境保持安装状态,无需卸载" - fi - - LOG_INFO "测试完成:texlive-hansd测试通过" -} - -main "$@" \ No newline at end of file diff --git a/testcases/function_test/pkg_test/texlive-split-k/texlive-hands/test_texlive-hands_reinstall.sh b/testcases/function_test/pkg_test/texlive-split-k/texlive-hands/test_texlive-hands_reinstall.sh deleted file mode 100644 index 0b33d55479a..00000000000 --- a/testcases/function_test/pkg_test/texlive-split-k/texlive-hands/test_texlive-hands_reinstall.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-07-05 -# @License : Mulan PSL v2 -# @Desc : 测试texlive-hands软件包的重新安装功能,确保能够正确重新安装到系统中 -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - # 检查texlive-hands软件包是否已安装 - LOG_INFO "检查texlive-hands软件包是否已安装" - rpm -q texlive-hands - if [ $? -eq 0 ]; then - LOG_INFO "texlive-hands软件包已安装,脚本结束时将保持安装状态" - INSTALLED=true - else - LOG_INFO "texlive-hands软件包未安装,脚本结束时将卸载该软件包" - INSTALLED=false - fi - - # 检查yum源中是否存在texlive-hands软件包 - LOG_INFO "检查yum源中是否存在texlive-hands软件包" - dnf list available texlive-hands > /dev/null 2>&1 - CHECK_RESULT $? 0 255 "yum源中不存在texlive-hands软件包" - - # 安装texlive-hands软件包 - LOG_INFO "安装texlive-hands软件包" - dnf install -y texlive-hands - CHECK_RESULT $? 0 0 "安装texlive-hands软件包失败" - - # 验证texlive-hands软件包是否安装成功 - LOG_INFO "验证texlive-hands软件包是否安装成功" - rpm -q texlive-hands > /dev/null 2>&1 - CHECK_RESULT $? 0 0 "验证texlive-hands软件包安装失败" - - # 卸载并重新安装texlive-hands软件包以测试重新安装功能 - LOG_INFO "卸载texlive-hands软件包" - dnf remove -y texlive-hands - CHECK_RESULT $? 0 0 "卸载texlive-hands软件包失败" - - LOG_INFO "重新安装texlive-hands软件包" - dnf install -y texlive-hands - CHECK_RESULT $? 0 0 "重新安装texlive-hands软件包失败" - - # 验证重新安装后的texlive-hands软件包是否可用 - LOG_INFO "验证重新安装后的texlive-live-handles功能" - command_to_test_installation_successful_here - CHECK_RESULT $? 0 0 “重新安裝後功能驗證失敗” - - # 环境恢复:如果脚本开始时未安裝,則卸載軟件包;否則保持安裝狀態 - if [ "$INSTALLED" = false ]; then - LOG_INFO “環境恢復:卸載 texlives-handles” - dnf remove-y texiives-handles - CHECK_RESULT$?00“環境恢復失敗” - fi - - LOG_INFO“測試完成” -} - -main "$@" \ No newline at end of file diff --git a/testcases/function_test/pkg_test/texlive-split-k/texlive-hands/test_texlive-hands_rollback.sh b/testcases/function_test/pkg_test/texlive-split-k/texlive-hands/test_texlive-hands_rollback.sh deleted file mode 100644 index 8ea0d5fa959..00000000000 --- a/testcases/function_test/pkg_test/texlive-split-k/texlive-hands/test_texlive-hands_rollback.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-07-05 -# @License : Mulan PSL v2 -# @Desc : 测试texlive-hands软件包的回滚功能,确保能够正确回滚到上一个版本 -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - LOG_INFO "开始测试texlive-hands软件包的回滚功能" - - # 检查texlive-hands是否已安装 - if dnf list installed texlive-hands &> /dev/null; then - LOG_INFO "检测到texlive-hands已安装,脚本结束后将保持安装状态" - INSTALLED=true - else - LOG_INFO "未检测到texlive-hands安装,脚本结束后将卸载" - INSTALLED=false - fi - - # 检查yum源中是否存在texlive-hands软件包 - LOG_INFO "检查yum源中是否存在texlive-hands软件包" - if ! dnf list available texlive-hands &> /dev/null; then - LOG_ERROR "yum源中未找到texlive-hands软件包" - exit 255 - fi - - # 安装texlive-hands软件包 - LOG_INFO "安装texlive-hands软件包" - dnf install -y texlive-hands - CHECK_RESULT $? 0 0 "安装texlive-hands失败" - - # 获取当前版本号 - CURRENT_VERSION=$(rpm -q texlive-hands --queryformat "%{version}") - LOG_INFO "当前安装的texlive-hands版本为: $CURRENT_VERSION" - - # 检查回滚功能是否可用 - LOG_INFO "检查回滚功能是否可用" - if ! dnf history undo last -y &> /dev/null; then - LOG_ERROR "回滚功能不可用" - exit 255 - fi - - # 验证回滚后的版本号是否与之前一致(假设回滚后版本应不同) - PREVIOUS_VERSION=$(rpm -q texlive-hands --queryformat "%{version}") &> /dev/null || true - if [ "$PREVIOUS_VERSION" == "$CURRENT_VERSION" ]; then - LOG_ERROR "回滚失败,版本未发生变化" - exit 1 - else - LOG_INFO "回滚成功,当前版本为: $PREVIOUS_VERSION" - fi - - # 根据初始状态恢复环境 - if [ "$INSTALLED" = false ]; then - LOG_INFO "卸载texlive-hands软件包" - dnf remove -y texlive-hands &> /dev/null || true - else - LOG_INFO "重新安装texlive-hans至原版本" - dnf install -y texlive-hands-$CURRENT_VERSION &> /dev/null || true - fi - - LOG_INFO "测试完成,环境已恢复" -} - -main "$@" \ No newline at end of file diff --git a/testcases/function_test/pkg_test/texlive-split-k/texlive-hands/test_texlive-hands_service_config.sh b/testcases/function_test/pkg_test/texlive-split-k/texlive-hands/test_texlive-hands_service_config.sh deleted file mode 100644 index 0459ba61c9c..00000000000 --- a/testcases/function_test/pkg_test/texlive-split-k/texlive-hands/test_texlive-hands_service_config.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-07-05 -# @License : Mulan PSL v2 -# @Desc : 测试texlive-hands软件包提供的服务的配置功能,确保能够正确配置服务参数 -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - # 检查texlive-hands软件包是否已安装 - LOG_INFO "检查texlive-hands软件包是否已安装" - rpm -q texlive-hands > /dev/null 2>&1 - if [ $? -eq 0 ]; then - LOG_INFO "texlive-hands软件包已安装" - installed=true - else - LOG_INFO "texlive-hands软件包未安装" - installed=false - fi - - # 检查yum源中是否存在texlive-hands软件包 - LOG_INFO "检查yum源中是否存在texlive-hands软件包" - dnf list available texlive-hands > /dev/null 2>&1 - if [ $? -ne 0 ]; then - LOG_ERROR "yum源中不存在texlive-hands软件包" - exit 255 - fi - - # 如果未安装,则安装texlive-hands软件包 - if [ "$installed" = false ]; then - LOG_INFO "开始安装texlive-hands软件包" - dnf install -y texlive-hands > /dev/null 2>&1 - CHECK_RESULT $? 0 0 "安装texlive-hands软件包失败" - LOG_INFO "texlive-hands软件包安装成功" - fi - - # 测试texlive-hands服务配置功能 - LOG_INFO "测试texlive-hands服务配置功能" - texlive-hands --config > /dev/null 2>&1 - CHECK_RESULT $? 0 0 "配置服务参数失败" - - # 清理环境 - if [ "$installed" = false ]; then - LOG_INFO "清理环境,卸载texlive-hands软件包" - dnf remove -y texlive-hands > /dev/null 2>&1 - CHECK_RESULT $? 0 0 "卸载texlive-hands软件包失败" - LOG_INFO "texlive-hands软件包卸载成功" - fi - - LOG_INFO "测试完成" -} - -main "$@" \ No newline at end of file diff --git a/testcases/function_test/pkg_test/texlive-split-k/texlive-hands/test_texlive-hands_service_disable.sh b/testcases/function_test/pkg_test/texlive-split-k/texlive-hands/test_texlive-hands_service_disable.sh deleted file mode 100644 index d10a0085f91..00000000000 --- a/testcases/function_test/pkg_test/texlive-split-k/texlive-hands/test_texlive-hands_service_disable.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-07-05 -# @License : Mulan PSL v2 -# @Desc : 测试texlive-hands软件包提供的服务的开机自启禁用功能,确保服务能够正确配置为不开机自启 -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - # 检查texlive-hands软件包是否在yum源中 - LOG_INFO "检查texlive-hands软件包是否在yum源中" - dnf list available texlive-hands &> /dev/null - if [ $? -ne 0 ]; then - LOG_ERROR "texlive-hands软件包不在yum源中" - exit 255 - fi - - # 检查当前是否已安装texlive-hands - LOG_INFO "检查当前是否已安装texlive-hands" - rpm -q texlive-hands &> /dev/null - if [ $? -eq 0 ]; then - installed=true - LOG_INFO "texlive-hands已安装,脚本结束后将保持安装状态" - else - installed=false - LOG_INFO "texlive-hands未安装,脚本结束后将卸载" - fi - - # 如果未安装,则安装texlive-hands - if [ "$installed" = false ]; then - LOG_INFO "安装texlive-hands软件包" - dnf install -y texlive-hands - CHECK_RESULT $? 0 0 "安装texlive-hands失败" - fi - - # 检查texlive-hands服务是否存在 - LOG_INFO "检查texlive-hands服务是否存在" - systemctl list-unit-files | grep texlive-hands.service &> /dev/null - if [ $? -ne 0 ]; then - LOG_ERROR "texlive-hands服务不存在" - exit 255 - fi - - # 禁用texlive-hands服务开机自启 - LOG_INFO "禁用texlive-hands服务开机自启" - systemctl disable texlive-hands.service - CHECK_RESULT $? 0 0 "禁用texlive-hands服务开机自启失败" - - # 检查服务是否已禁用开机自启 - LOG_INFO "检查texlive-hands服务是否已禁用开机自启" - systemctl is-enabled texlive-hands.service | grep disabled &> /dev/null - CHECK_RESULT $? 0 0 "texlive-hands服务未成功禁用开机自启" - - # 恢复环境 - if [ "$installed" = false ]; then - LOG_INFO "卸载texlive-hands软件包" - dnf remove -y texlive-hands - CHECK_RESULT $? 0 0 "卸载texlive-hands失败" - fi - - LOG_INFO "测试完成,环境已恢复" -} - -main "$@" \ No newline at end of file diff --git a/testcases/function_test/pkg_test/texlive-split-k/texlive-hands/test_texlive-hands_service_enable.sh b/testcases/function_test/pkg_test/texlive-split-k/texlive-hands/test_texlive-hands_service_enable.sh deleted file mode 100644 index 114e10e5775..00000000000 --- a/testcases/function_test/pkg_test/texlive-split-k/texlive-hands/test_texlive-hands_service_enable.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-07-05 -# @License : Mulan PSL v2 -# @Desc : 测试texlive-hands软件包提供的服务的开机自启功能,确保服务能够正确配置为开机自启 -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - - # 检查texlive-hands软件包是否已安装 - LOG_INFO "检查texlive-hands软件包是否已安装" - rpm -q texlive-hands > /dev/null 2>&1 - if [ $? -eq 0 ]; then - LOG_INFO "texlive-hands软件包已安装" - INSTALLED=true - else - LOG_INFO "texlive-hands软件包未安装" - INSTALLED=false - fi - - # 检查yum源中是否存在texlive-hands软件包 - LOG_INFO "检查yum源中是否存在texlive-hands软件包" - dnf list available texlive-hands > /dev/null 2>&1 - if [ $? -ne 0 ]; then - LOG_ERROR "yum源中不存在texlive-hands软件包" - exit 255 - fi - - # 如果未安装,则安装texlive-hands软件包 - if [ "$INSTALLED" = false ]; then - LOG_INFO "开始安装texlive-hands软件包" - dnf install -y texlive-hands > /dev/null 2>&1 - CHECK_RESULT $? 0 0 "安装texlive-hands软件包失败" - LOG_INFO "texlive-hands软件包安装成功" - fi - - # 检查texlive-hands服务是否已启用开机自启 - LOG_INFO "检查texlive-hands服务是否已启用开机自启" - systemctl is-enabled texlive-hands > /dev/null 2>&1 - if [ $? -eq 0 ]; then - LOG_INFO "texlive-hands服务已启用开机自启" - else - LOG_INFO "texlive-hands服务未启用开机自启,尝试启用" - systemctl enable texlive-hands > /dev/null 2>&1 - CHECK_RESULT $? 0 0 "启用texlive-hands服务开机自启失败" - LOG_INFO "成功启用texlive-hands服务开机自启" - fi - - # 验证服务配置是否正确 - LOG_INFO "验证服务配置是否正确" - systemctl status texlive-hands > /dev/null 2>&1 - CHECK_RESULT $? 0 0 "texlive-hands服务状态异常" - - # 清理环境 - if [ "$INSTALLED" = false ]; then - LOG_INFO "清理环境,卸载texlive-hands软件包" - dnf remove -y texlive-hands > /dev/null 2>&1 - CHECK_RESULT $? 0 0 "卸载texlive-hands软件包失败" - LOG_INFO "texlike-hand软件包卸载成功" - fi - - LOG_INFO "测试完成,环境已恢复" - -} - -main "$@" \ No newline at end of file diff --git a/testcases/function_test/pkg_test/texlive-split-k/texlive-hands/test_texlive-hands_service_log.sh b/testcases/function_test/pkg_test/texlive-split-k/texlive-hands/test_texlive-hands_service_log.sh deleted file mode 100644 index eab92d8d936..00000000000 --- a/testcases/function_test/pkg_test/texlive-split-k/texlive-hands/test_texlive-hands_service_log.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-07-05 -# @License : Mulan PSL v2 -# @Desc : 测试texlive-hands软件包提供的服务的日志查看功能,确保能够正确查看服务日志 -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - # 检查texlive-hands软件包是否已安装 - LOG_INFO "检查texlive-hands软件包是否已安装" - rpm -q texlive-hands > /dev/null 2>&1 - if [ $? -eq 0 ]; then - LOG_INFO "texlive-hands软件包已安装" - INSTALLED=true - else - LOG_INFO "texlive-hands软件包未安装" - INSTALLED=false - fi - - # 检查yum源中是否存在texlive-hands软件包 - LOG_INFO "检查yum源中是否存在texlive-hands软件包" - dnf list available texlive-hands > /dev/null 2>&1 - if [ $? -ne 0 ]; then - LOG_ERROR "yum源中不存在texlive-hands软件包" - exit 255 - fi - - # 如果未安装,则安装texlive-hands软件包 - if [ "$INSTALLED" = false ]; then - LOG_INFO "开始安装texlive-hands软件包" - dnf install -y texlive-hands > /dev/null 2>&1 - CHECK_RESULT $? 0 0 "安装texlive-hands软件包失败" - LOG_INFO "texlive-hands软件包安装成功" - fi - - # 测试texlive-hands服务日志查看功能 - LOG_INFO "测试texlive-hands服务日志查看功能" - journalctl -u texlive-hands > /dev/null 2>&1 - CHECK_RESULT $? 0 0 "查看texlive-hands服务日志失败" - - # 如果脚本开始时未安装,则在结束时卸载texlive-hands软件包 - if [ "$INSTALLED" = false ]; then - LOG_INFO "开始卸载texlive-hands软件包" - dnf remove -y texlive-hands > /dev/null 2>&1 - CHECK_RESULT $? 0 0 "卸载texlive-hands软件包失败" - LOG_INFO "texlive-hands软件包卸载成功" - fi - - LOG_INFO "测试完成,环境已恢复" -} - -main "$@" \ No newline at end of file diff --git a/testcases/function_test/pkg_test/texlive-split-k/texlive-hands/test_texlive-hands_service_reload.sh b/testcases/function_test/pkg_test/texlive-split-k/texlive-hands/test_texlive-hands_service_reload.sh deleted file mode 100644 index 81813e74c67..00000000000 --- a/testcases/function_test/pkg_test/texlive-split-k/texlive-hands/test_texlive-hands_service_reload.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-07-05 -# @License : Mulan PSL v2 -# @Desc : 测试texlive-hands软件包提供的服务的重载功能,确保服务能够正常重载配置 -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - - # 检查texlive-hands软件包是否已安装 - LOG_INFO "检查texlive-hands软件包是否已安装" - if ! dnf list installed texlive-hands &>/dev/null; then - LOG_INFO "texlive-hands未安装,开始安装" - # 检查yum源中是否有texlive-hands软件包 - if ! dnf list available texlive-hands &>/dev/null; then - LOG_ERROR "yum源中未找到texlive-hands软件包" - exit 255 - fi - # 安装texlive-hands软件包 - dnf install -y texlive-hands - CHECK_RESULT $? 0 0 "安装texlive-hands失败" - INSTALLED=1 - else - LOG_INFO "texlive-hands已安装" - INSTALLED=0 - fi - - # 测试texlive-hands服务重载功能 - LOG_INFO "测试texlive-hands服务重载功能" - systemctl reload texlive-hands.service - CHECK_RESULT $? 0 0 "重载texlive-hands服务失败" - - # 清理环境 - if [ $INSTALLED -eq 1 ]; then - LOG_INFO "卸载texlive-hands软件包" - dnf remove -y texlive-hands - CHECK_RESULT $? 0 0 "卸载texlive-hands失败" - fi - - LOG_INFO "测试完成,环境已恢复" - -} - -main "$@" \ No newline at end of file diff --git a/testcases/function_test/pkg_test/texlive-split-k/texlive-hands/test_texlive-hands_service_restart.sh b/testcases/function_test/pkg_test/texlive-split-k/texlive-hands/test_texlive-hands_service_restart.sh deleted file mode 100644 index 0e895b459f9..00000000000 --- a/testcases/function_test/pkg_test/texlive-split-k/texlive-hands/test_texlive-hands_service_restart.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-07-05 -# @License : Mulan PSL v2 -# @Desc : 测试texlive-hands软件包提供的服务的重启功能,确保服务能够正常重启 -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - - # 检查texlive-hands软件包是否已安装 - LOG_INFO "检查texlive-hands软件包是否已安装" - if ! dnf list installed texlive-hands &>/dev/null; then - LOG_INFO "texlive-hands未安装,开始安装" - # 检查yum源中是否有texlive-hands软件包 - if ! dnf list available texlive-hands &>/dev/null; then - LOG_ERROR "yum源中未找到texlive-hands软件包" - exit 255 - fi - dnf install -y texlive-hands - CHECK_RESULT $? 0 0 "安装texlive-hands失败" - INSTALLED=1 - else - LOG_INFO "texlive-hands已安装" - INSTALLED=0 - fi - - # 检查texlive-hands服务是否已启动 - LOG_INFO "检查texlive-hands服务是否已启动" - systemctl is-active texlive-hands &>/dev/null - if [ $? -ne 0 ]; then - LOG_INFO "启动texlive-hands服务" - systemctl start texlive-hands - CHECK_RESULT $? 0 0 "启动texlive-hands服务失败" - fi - - # 重启texlive-hands服务 - LOG_INFO "重启texlive-hands服务" - systemctl restart texlive-hands - CHECK_RESULT $? 0 0 "重启texlive-hands服务失败" - - # 检查服务是否正常运行 - LOG_INFO "检查texlive-hands服务是否正常运行" - systemctl is-active texlive-hands &>/dev/null - CHECK_RESULT $? 0 0 "texlive-hands服务未正常运行" - - # 清理环境 - if [ $INSTALLED -eq 1 ]; then - LOG_INFO "卸载texlive-hands软件包" - dnf remove -y texlive-hands - CHECK_RESULT $? 0 0 "卸载texlive-hands失败" - fi - - LOG_INFO "测试完成" - -} - -main "$@" \ No newline at end of file diff --git a/testcases/function_test/pkg_test/texlive-split-k/texlive-hands/test_texlive-hands_service_start.sh b/testcases/function_test/pkg_test/texlive-split-k/texlive-hands/test_texlive-hands_service_start.sh deleted file mode 100644 index 64a9249b71c..00000000000 --- a/testcases/function_test/pkg_test/texlive-split-k/texlive-hands/test_texlive-hands_service_start.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-07-05 -# @License : Mulan PSL v2 -# @Desc : 测试texlive-hands软件包提供的服务的启动功能,确保服务能够正常启动 -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - - # 检查texlive-hands软件包是否已安装 - LOG_INFO "检查texlive-hands软件包是否已安装" - rpm -q texlive-hands > /dev/null 2>&1 - if [ $? -eq 0 ]; then - LOG_INFO "texlive-hands软件包已安装" - INSTALLED=true - else - LOG_INFO "texlive-hands软件包未安装" - INSTALLED=false - fi - - # 检查yum源中是否有texlive-hands软件包 - LOG_INFO "检查yum源中是否有texlive-hands软件包" - dnf list available texlive-hands > /dev/null 2>&1 - if [ $? -ne 0 ]; then - LOG_ERROR "yum源中未找到texlive-hands软件包" - exit 255 - fi - - # 如果未安装,则安装texlive-hands软件包 - if [ "$INSTALLED" = false ]; then - LOG_INFO "开始安装texlive-hands软件包" - dnf install -y texlive-hands > /dev/null 2>&1 - CHECK_RESULT $? 0 0 "安装texlive-hands软件包失败" - LOG_INFO "texlive-hands软件包安装成功" - fi - - # 测试服务启动功能 - LOG_INFO "测试texlive-hands服务启动功能" - systemctl start texlive-hands > /dev/null 2>&1 - CHECK_RESULT $? 0 0 "启动texlive-hands服务失败" - - # 检查服务状态 - LOG_INFO "检查texlive-hands服务状态" - systemctl status texlive-hands > /dev/null 2>&1 - CHECK_RESULT $? 0 0 "texlive-hands服务状态异常" - - # 如果脚本开始时未安装,则卸载软件包 - if [ "$INSTALLED" = false ]; then - LOG_INFO "卸载texlive-hands软件包" - dnf remove -y texlive-hands > /dev/null 2>&1 - CHECK_RESULT $? 0 0 "卸载texlive-hands软件包失败" - LOG_INFO "texlive-hands软件包卸载成功" - fi - - LOG_INFO "测试完成,环境已恢复" - -} - -main "$@" \ No newline at end of file diff --git a/testcases/function_test/pkg_test/texlive-split-k/texlive-hands/test_texlive-hands_service_status.sh b/testcases/function_test/pkg_test/texlive-split-k/texlive-hands/test_texlive-hands_service_status.sh deleted file mode 100644 index 5f506e08fe9..00000000000 --- a/testcases/function_test/pkg_test/texlive-split-k/texlive-hands/test_texlive-hands_service_status.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-07-05 -# @License : Mulan PSL v2 -# @Desc : 测试texlive-hands软件包提供的服务的状态查询功能,确保能够正确查询服务状态 -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - # 检查texlive-hands软件包是否已安装 - LOG_INFO "检查texlive-hands软件包是否已安装" - rpm -q texlive-hands > /dev/null 2>&1 - if [ $? -eq 0 ]; then - LOG_INFO "texlive-hands软件包已安装" - installed=true - else - LOG_INFO "texlive-hands软件包未安装" - installed=false - fi - - # 检查yum源中是否有texlive-hands软件包 - LOG_INFO "检查yum源中是否有texlive-hands软件包" - dnf list available texlive-hands > /dev/null 2>&1 - if [ $? -ne 0 ]; then - LOG_ERROR "yum源中未找到texlive-hands软件包" - exit 255 - fi - - # 如果未安装,则安装texlive-hands软件包 - if [ "$installed" = false ]; then - LOG_INFO "开始安装texlive-hands软件包" - dnf install -y texlive-hands - CHECK_RESULT $? 0 0 "安装texlive-hands软件包失败" - fi - - # 检查服务状态查询功能 - LOG_INFO "测试texlive-hands服务状态查询功能" - systemctl status texlive-hands > /dev/null 2>&1 - CHECK_RESULT $? 0 0 "查询texlive-hands服务状态失败" - - # 环境恢复:如果脚本开始时未安装,则卸载texlive-hands软件包 - if [ "$installed" = false ]; then - LOG_INFO "卸载texlive-hands软件包" - dnf remove -y texlive-hands - CHECK_RESULT $? 0 0 "卸载texlive-hands软件包失败" - fi - - LOG_INFO "测试完成,环境已恢复" -} - -main "$@" \ No newline at end of file diff --git a/testcases/function_test/pkg_test/texlive-split-k/texlive-hands/test_texlive-hands_service_stop.sh b/testcases/function_test/pkg_test/texlive-split-k/texlive-hands/test_texlive-hands_service_stop.sh deleted file mode 100644 index 3f029f94ea1..00000000000 --- a/testcases/function_test/pkg_test/texlive-split-k/texlive-hands/test_texlive-hands_service_stop.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-07-05 -# @License : Mulan PSL v2 -# @Desc : 测试texlive-hands软件包提供的服务的停止功能,确保服务能够正常停止 -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - # 检查texlive-hands软件包是否已安装 - LOG_INFO "检查texlive-hands软件包是否已安装" - rpm -q texlive-hands > /dev/null 2>&1 - if [ $? -ne 0 ]; then - LOG_INFO "texlive-hands未安装,开始安装" - # 检查yum源中是否有texlive-hands软件包 - LOG_INFO "检查yum源中是否有texlive-hands软件包" - dnf list available texlive-hands > /dev/null 2>&1 - if [ $? -ne 0 ]; then - LOG_ERROR "yum源中未找到texlive-hands软件包" - exit 255 - fi - # 安装texlive-hands软件包 - LOG_INFO "开始安装texlive-hands软件包" - dnf install -y texlive-hands > /dev/null 2>&1 - CHECK_RESULT $? 0 0 "安装texlive-hands软件包失败" - # 标记需要卸载 - UNINSTALL_FLAG=1 - else - LOG_INFO "texlive-hands已安装,无需重新安装" - UNINSTALL_FLAG=0 - fi - - # 测试服务停止功能 - LOG_INFO "测试texlive-hands服务停止功能" - systemctl stop texlive-hands > /dev/null 2>&1 - CHECK_RESULT $? 0 0 "停止texlive-hands服务失败" - - # 检查服务状态是否为inactive - LOG_INFO "检查服务状态是否为inactive" - systemctl is-active texlive-hands > /dev/null 2>&1 - CHECK_RESULT $? 3 0 "服务状态未变为inactive" - - # 恢复环境 - if [ ${UNINSTALL_FLAG} -eq 1 ]; then - LOG_INFO "卸载texlive-hands软件包以恢复环境" - dnf remove -y texlive-hands > /dev/null 2>&1 - CHECK_RESULT $? 0 0 "卸载texlive-hands软件包失败" - fi - - LOG_INFO "测试完成" -} - -main "$@" \ No newline at end of file diff --git a/testcases/function_test/pkg_test/texlive-split-k/texlive-hands/test_texlive-hands_upgrade.sh b/testcases/function_test/pkg_test/texlive-split-k/texlive-hands/test_texlive-hands_upgrade.sh deleted file mode 100644 index d6b31ac58f8..00000000000 --- a/testcases/function_test/pkg_test/texlive-split-k/texlive-hands/test_texlive-hands_upgrade.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-07-05 -# @License : Mulan PSL v2 -# @Desc : 测试texlive-hands软件包的升级功能,确保能够正确升级到新版本 -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - # 测试texlive-hands软件包的升级功能,确保能够正确升级到新版本 - - LOG_INFO "开始测试texlive-hands软件包的升级功能" - - # 检查是否已安装texlive-hands - if dnf list installed texlive-hands &>/dev/null; then - LOG_INFO "texlive-hands已安装,测试结束后将保持安装状态" - INSTALLED=true - else - LOG_INFO "texlive-hands未安装,测试结束后将卸载" - INSTALLED=false - fi - - # 检查yum源中是否有texlive-hands软件包 - LOG_INFO "检查yum源中是否有texlive-hands软件包" - if ! dnf list available texlive-hands &>/dev/null; then - LOG_ERROR "yum源中未找到texlive-hands软件包" - exit 255 - fi - - # 安装texlive-hands(如果未安装) - if [ "$INSTALLED" = false ]; then - LOG_INFO "开始安装texlive-hands软件包" - dnf install -y texlive-hands - CHECK_RESULT $? 0 0 "安装texlive-hands失败" - fi - - # 检查当前版本 - LOG_INFO "检查当前texlive-hands版本" - CURRENT_VERSION=$(rpm -q texlive-hands --queryformat "%{VERSION}-%{RELEASE}") - CHECK_RESULT $? 0 0 "获取当前版本失败" - - LOG_INFO "当前texlive-hands版本: $CURRENT_VERSION" - - # 模拟升级操作(假设升级命令为dnf upgrade) - LOG_INFO "开始升级texlive-hands软件包" - dnf upgrade -y texlive-hands - CHECK_RESULT $? 0 0 "升级texlive-hands失败" - - # 检查升级后的版本 - LOG_INFO "检查升级后的texlive-hansd版本" - NEW_VERSION=$(rpm -q texlive-hansd --queryformat "%{VERSION}-%{RELEASE}") - CHECK_RESULT $? 0 0 "获取升级后版本失败" - - LOG_INFO "升级后texlive-handsd版本: $NEW_VERSION" - - # 验证版本是否已更新 - if [ "$CURRENT_VERSION" = "$NEW_VERSION" ]; then - LOG_ERROR "texlived-handse未成功升级" - exit1 - else - LOG_INFO"te xliv e-han ds成功从$CURREN T_ VERS ION升级到$N EW_V ERSI ON" - fi - - # 清理环境(如果最初未安装) - if [ "$INSTALLED" = false ]; then - LOG _INF O"卸载te xli ve-ha nds软包 " - dn f remove -y te xli ve-ha nds - CH ECK_RES ULT $?0 0 “卸载失败” - fi - - LO G_INF O“测完完成” -} - -main "$@" \ No newline at end of file diff --git a/testcases/function_test/pkg_test/texlive-split-k/texlive-hands/test_texlive-hands_upgrade_rollback.sh b/testcases/function_test/pkg_test/texlive-split-k/texlive-hands/test_texlive-hands_upgrade_rollback.sh deleted file mode 100644 index 0667e32671d..00000000000 --- a/testcases/function_test/pkg_test/texlive-split-k/texlive-hands/test_texlive-hands_upgrade_rollback.sh +++ /dev/null @@ -1,120 +0,0 @@ -#!/usr/bin/bash - -# Copyright (c) 2024 ISCAS .ALL rights reserved. -# This program is licensed under Mulan PSL v2. -# You can use it according to the terms and conditions of the Mulan PSL v2. -# http://license.coscl.org.cn/MulanPSL2 -# THIS PROGRAM IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, -# EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, -# MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. -# See the Mulan PSL v2 for more details. - -# ############################################# -# @Author : honghua -# @Contact : honghua@iscas.ac.cn -# @Date : 2025-07-05 -# @License : Mulan PSL v2 -# @Desc : 测试texlive-hands软件包的升级回滚功能,确保能够正确从升级版本回滚到上一个版本 -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - - # 检查软件包是否存在于yum源中 - check_package_in_repo() { - local package_name=$1 - dnf list available "$package_name" &>/dev/null - if [ $? -ne 0 ]; then - LOG_ERROR "软件包 $package_name 不在yum源中" - exit 255 - fi - } - - # 检查命令参数是否有效 - check_command_args() { - local command=$1 - shift - local args=("$@") - - $command --help | grep -q -- "${args[0]}" - if [ $? -ne 0 ]; then - LOG_ERROR "命令 $command 不支持参数 ${args[0]}" - exit 255 - fi - } - - # 检查环境是否已安装texlive-hands - check_installed() { - rpm -q texlive-hands &>/dev/null - return $? - } - - # 安装软件包 - install_package() { - local package_name=$1 - LOG_INFO "正在安装软件包 $package_name" - dnf install -y "$package_name" - CHECK_RESULT $? 0 0 "安装软件包 $package_name 失败" - } - - # 卸载软件包 - uninstall_package() { - local package_name=$1 - LOG_INFO "正在卸载软件包 $package_name" - dnf remove -y "$package_name" - CHECK_RESULT $? 0 0 "卸载软件包 $package_name 失败" - } - - # 升级软件包 - upgrade_package() { - local package_name=$1 - LOG_INFO "正在升级软件包 $package_name" - dnf upgrade -y "$package_name" - CHECK_RESULT $? 0 0 "升级软件包 $package_name 失败" - } - - # 回滚软件包到上一个版本 - rollback_package() { - local package_name=$1 - LOG_INFO "正在回滚软件包 $package_name" - dnf history undo last -y - CHECK_RESULT $?   ·     ·· ···· ·· ·· ·· ········ ······ ········ ········ - } - - main() { - # 检查texlive-hands是否在yum源中 - check_package_in_repo texlive-hands - - # 判断环境是否已安装texlive-hands -    if check_installed; then -        LOG_INFO "环境已安装texlive-hands,测试结束后保持安装状态" -        installed=true -    else -        LOG_INFO "环境未安装texlive-hands,测试结束后将卸载" -        installed=false -    fi - -    # 如果未安装则先进行安装 -    if ! $installed; then -        install_package texlive-hands -    fi - -    # 测试升级功能   -     upgrade_package texlive-hands - -     # 测试回滚功能   -     rollback_package texlive-hands - -     #恢复环境 -     if ! $installed; then -         uninstall_package texlive-hands    -     fi - -     LOG_INFO "测试完成" } - - main "$@" - -} - -main "$@" \ No newline at end of file From 3a103961e8eca6922299e18bcb97b28ee8059adc Mon Sep 17 00:00:00 2001 From: honghua Date: Sat, 18 Apr 2026 16:57:26 +0800 Subject: [PATCH 05/17] update testcase for testsuite ocaml-calendar-devel --- .../ocaml-calendar/ocaml-calendar-devel.json | 38 ----- ...caml-calendar-devel_function_arithmetic.sh | 88 ----------- ...ocaml-calendar-devel_function_basic_ops.sh | 142 ------------------ ...ocaml-calendar-devel_function_date_calc.sh | 66 -------- ...caml-calendar-devel_function_date_parse.sh | 72 --------- ...ml-calendar-devel_function_format_print.sh | 70 --------- ...t_ocaml-calendar-devel_function_install.sh | 76 ---------- ...st_ocaml-calendar-devel_function_period.sh | 82 ---------- ...ocaml-calendar-devel_function_uninstall.sh | 83 ---------- 9 files changed, 717 deletions(-) delete mode 100644 suite2cases/function_test/pkg_test/ocaml-calendar/ocaml-calendar-devel.json delete mode 100644 testcases/function_test/pkg_test/ocaml-calendar/ocaml-calendar-devel/test_ocaml-calendar-devel_function_arithmetic.sh delete mode 100644 testcases/function_test/pkg_test/ocaml-calendar/ocaml-calendar-devel/test_ocaml-calendar-devel_function_basic_ops.sh delete mode 100644 testcases/function_test/pkg_test/ocaml-calendar/ocaml-calendar-devel/test_ocaml-calendar-devel_function_date_calc.sh delete mode 100644 testcases/function_test/pkg_test/ocaml-calendar/ocaml-calendar-devel/test_ocaml-calendar-devel_function_date_parse.sh delete mode 100644 testcases/function_test/pkg_test/ocaml-calendar/ocaml-calendar-devel/test_ocaml-calendar-devel_function_format_print.sh delete mode 100644 testcases/function_test/pkg_test/ocaml-calendar/ocaml-calendar-devel/test_ocaml-calendar-devel_function_install.sh delete mode 100644 testcases/function_test/pkg_test/ocaml-calendar/ocaml-calendar-devel/test_ocaml-calendar-devel_function_period.sh delete mode 100644 testcases/function_test/pkg_test/ocaml-calendar/ocaml-calendar-devel/test_ocaml-calendar-devel_function_uninstall.sh diff --git a/suite2cases/function_test/pkg_test/ocaml-calendar/ocaml-calendar-devel.json b/suite2cases/function_test/pkg_test/ocaml-calendar/ocaml-calendar-devel.json deleted file mode 100644 index 4e6f72afece..00000000000 --- a/suite2cases/function_test/pkg_test/ocaml-calendar/ocaml-calendar-devel.json +++ /dev/null @@ -1,38 +0,0 @@ -{ - "path": "$OET_PATH/testcases/function_test/pkg_test/ocaml-calendar/ocaml-calendar-devel", - "machine num": 1, - "cases": [ - { - "name": "test_ocaml-calendar-devel_function_date_calc", - "desc": "Test date calculation functionality" - }, - { - "name": "test_ocaml-calendar-devel_function_date_parse", - "desc": "Test date parsing functionality" - }, - { - "name": "test_ocaml-calendar-devel_function_install", - "desc": "Test package installation" - }, - { - "name": "test_ocaml-calendar-devel_function_uninstall", - "desc": "Test package removal" - }, - { - "name": "test_ocaml-calendar-devel_function_basic_ops", - "desc": "Test basic calendar operations" - }, - { - "name": "test_ocaml-calendar-devel_function_format_print", - "desc": "Test date formatting and printing" - }, - { - "name": "test_ocaml-calendar-devel_function_arithmetic", - "desc": "Test date arithmetic operations" - }, - { - "name": "test_ocaml-calendar-devel_function_period", - "desc": "Test period and interval handling" - } - ] -} \ No newline at end of file diff --git a/testcases/function_test/pkg_test/ocaml-calendar/ocaml-calendar-devel/test_ocaml-calendar-devel_function_arithmetic.sh b/testcases/function_test/pkg_test/ocaml-calendar/ocaml-calendar-devel/test_ocaml-calendar-devel_function_arithmetic.sh deleted file mode 100644 index 3912ffafe9e..00000000000 --- a/testcases/function_test/pkg_test/ocaml-calendar/ocaml-calendar-devel/test_ocaml-calendar-devel_function_arithmetic.sh +++ /dev/null @@ -1,88 +0,0 @@ -#!/usr/bin/bash - -# Copyright (c) 2024 ISCAS .ALL rights reserved. -# This program is licensed under Mulan PSL v2. -# You can use it according to the terms and conditions of the Mulan PSL v2. -# http://license.coscl.org.cn/MulanPSL2 -# THIS PROGRAM IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, -# EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, -# MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. -# See the Mulan PSL v2 for more details. - -# ############################################# -# @Author : honghua -# @Contact : honghua@iscas.ac.cn -# @Date : 2026-02-23 -# @License : Mulan PSL v2 -# @Desc : Test date arithmetic operations -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - LOG_INFO "检查是否已安装ocaml-calendar-devel软件包" - rpm -q ocaml-calendar-devel > /dev/null 2>&1 - if [ $? -eq 0 ]; then - LOG_INFO "ocaml-calendar-devel已安装,测试结束后将保持安装状态" - INSTALLED=true - else - LOG_INFO "ocaml-calendar-devel未安装,将在测试前安装,测试后卸载" - INSTALLED=false - fi - - LOG_INFO "检查yum源中是否存在ocaml-calendar-devel软件包" - dnf list available ocaml-calendar-devel > /dev/null 2>&1 - if [ $? -ne 0 ]; then - LOG_ERROR "yum源中未找到ocaml-calendar-devel软件包" - exit 255 - fi - - if [ "$INSTALLED" = false ]; then - LOG_INFO "安装ocaml-calendar-devel软件包" - dnf install -y ocaml-calendar-devel > /dev/null 2>&1 - CHECK_RESULT $? 0 0 "安装ocaml-calendar-devel失败" - fi - - LOG_INFO "测试date arithmetic operations: 创建测试OCaml脚本" - cat > test_date_arithmetic.ml << "EOF" - open CalendarLib - - let () = - let date1 = Date.make 2023 10 1 in - let date2 = Date.add date1 (Period.day 5) in - let diff = Date.sub date2 date1 in - Printf.printf "Date1: %s\n" (Date.to_string date1); - Printf.printf "Date2 (Date1 + 5 days): %s\n" (Date.to_string date2); - Printf.printf "Difference in days: %d\n" (Period.nb_days diff) - EOF - CHECK_RESULT $? 0 0 "创建测试OCaml脚本失败" - - LOG_INFO "编译测试OCaml脚本" - ocamlfind ocamlc -package calendar -linkpkg -o test_date_arithmetic test_date_arithmetic.ml > /dev/null 2>&1 - CHECK_RESULT $? 0 0 "编译OCaml脚本失败" - - LOG_INFO "执行测试程序" - ./test_date_arithmetic > output.txt 2>&1 - CHECK_RESULT $? 0 0 "执行测试程序失败" - - LOG_INFO "验证输出结果" - EXPECTED="Date1: 2023-10-01" - grep "$EXPECTED" output.txt > /dev/null 2>&1 - CHECK_RESULT $? 0 0 "输出结果不符合预期" - - LOG_INFO "清理临时文件" - rm -f test_date_arithmetic.ml test_date_arithmetic.cmi test_date_arithmetic.cmo test_date_arithmetic output.txt - CHECK_RESULT $? 0 0 "清理临时文件失败" - - if [ "$INSTALLED" = false ]; then - LOG_INFO "卸载ocaml-calendar-devel软件包" - dnf remove -y ocaml-calendar-devel > /dev/null 2>&1 - CHECK_RESULT $? 0 0 "卸载ocaml-calendar-devel失败" - else - LOG_INFO "保持ocaml-calendar-devel软件包安装状态" - fi - - LOG_INFO "测试完成" -} - -main "$@" \ No newline at end of file diff --git a/testcases/function_test/pkg_test/ocaml-calendar/ocaml-calendar-devel/test_ocaml-calendar-devel_function_basic_ops.sh b/testcases/function_test/pkg_test/ocaml-calendar/ocaml-calendar-devel/test_ocaml-calendar-devel_function_basic_ops.sh deleted file mode 100644 index 5a42dcfdc2b..00000000000 --- a/testcases/function_test/pkg_test/ocaml-calendar/ocaml-calendar-devel/test_ocaml-calendar-devel_function_basic_ops.sh +++ /dev/null @@ -1,142 +0,0 @@ -#!/usr/bin/bash - -# Copyright (c) 2024 ISCAS .ALL rights reserved. -# This program is licensed under Mulan PSL v2. -# You can use it according to the terms and conditions of the Mulan PSL v2. -# http://license.coscl.org.cn/MulanPSL2 -# THIS PROGRAM IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, -# EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-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-23 -# @License : Mulan PSL v2 -# @Desc : Test basic calendar operations -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - # 测试基础日历操作 - LOG_INFO "开始测试:Test basic calendar operations" - - # 定义软件包名称 - PACKAGE_NAME="ocaml-calendar-devel" - - # 检查环境是否已安装目标软件包 - LOG_INFO "步骤1:检查系统是否已安装 $PACKAGE_NAME" - if dnf list installed "$PACKAGE_NAME" &>/dev/null; then - LOG_INFO "检测到 $PACKAGE_NAME 已安装,测试结束后将保持安装状态" - WAS_INSTALLED=true - else - LOG_INFO "$PACKAGE_NAME 未安装,将在测试过程中安装,测试结束后卸载" - WAS_INSTALLED=false - fi - - # 检查yum源中是否有该软件包 - LOG_INFO "步骤2:检查yum源中是否存在 $PACKAGE_NAME" - if ! dnf list available "$PACKAGE_NAME" &>/dev/null; then - LOG_ERROR "yum源中不存在 $PACKAGE_NAME 软件包" - exit 255 - fi - - # 如果未安装,则安装软件包 - if [ "$WAS_INSTALLED" = false ]; then - LOG_INFO "步骤3:安装 $PACKAGE_NAME" - dnf install -y "$PACKAGE_NAME" - CHECK_RESULT $? 0 0 "安装 $PACKAGE_NAME 失败" - fi - - # 测试日历基本操作命令 - LOG_INFO "步骤4:测试日历基本操作命令" - - # 测试1:检查ocaml-calendar-devel提供的命令是否存在 - LOG_INFO "测试1:检查相关命令是否存在" - if command -v calendar &>/dev/null; then - LOG_INFO "找到 calendar 命令" - else - LOG_ERROR "未找到 calendar 命令" - # 如果是因为参数不存在或不支持,退出码为255 - exit 255 - fi - - # 测试2:执行基本的日历操作(示例) - LOG_INFO "测试2:执行基本的日历操作" - # 这里假设calendar命令支持--version参数,实际应根据具体软件调整 - calendar --version - CHECK_RESULT $? 0 0 "执行 calendar --version 失败" - - # 测试3:检查日历库功能 - LOG_INFO "测试3:检查OCaml日历库功能" - # 创建一个简单的OCaml测试程序 - cat > /tmp/test_calendar.ml << "EOF" - let () = - Printf.printf "Testing calendar library...\n"; - let today = CalendarLib.Date.today () in - Printf.printf "Today is: %s\n" (CalendarLib.Date.to_string today); - Printf.printf "Test passed!\n" - EOF - - # 编译并运行测试程序 - if command -v ocamlopt &>/dev/null; then - LOG_INFO "编译测试程序" - ocamlopt -I $(ocamlfind query calendar) -o /tmp/test_calendar \ - calendar.cmxa /tmp/test_calendar.ml 2>/dev/null - - if [ $? -eq 0 ]; then - LOG_INFO "运行测试程序" - /tmp/test_calendar - CHECK_RESULT $? 0 0 "运行日历测试程序失败" - else - LOG_INFO "使用ocamlc编译测试程序" - ocamlc -I $(ocamlfind query calendar) -o /tmp/test_calendar \ - calendar.cma /tmp/test_calendar.ml 2>/dev/null - CHECK_RESULT $? 0 0 "编译日历测试程序失败" - - LOG_INFO "运行测试程序" - /tmp/test_calendar - CHECK_RESULT $? 0 0 "运行日历测试程序失败" - fi - else - LOG_INFO "跳过OCaml编译测试(ocamlopt/ocamlc未安装)" - fi - - # 测试4:检查日历开发文件 - LOG_INFO "测试4:检查开发文件是否存在" - if [ -d "/usr/lib/ocaml/calendar" ] || [ -d "/usr/lib64/ocaml/calendar" ]; then - LOG_INFO "找到日历库文件" - CHECK_RESULT 0 0 0 "日历库文件检查" - else - # 尝试通过ocamlfind查找 - if command -v ocamlfind &>/dev/null; then - ocamlfind query calendar &>/dev/null - CHECK_RESULT $? 0 0 "未找到日历库文件" - else - LOG_INFO "跳过ocamlfind检查" - CHECK_RESULT 0 0 0 "跳过库文件检查" - fi - fi - - # 清理临时文件 - LOG_INFO "清理临时文件" - rm -f /tmp/test_calendar.ml /tmp/test_calendar /tmp/test_calendar.cmi /tmp/test_calendar.cmo 2>/dev/null - rm -f /tmp/test_calendar.cmx /tmp/test_calendar.o 2>/dev/null - - # 环境恢复 - LOG_INFO "步骤5:恢复测试环境" - if [ "$WAS_INSTALLED" = 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 "测试完成:Test basic calendar operations" -} - -main "$@" \ No newline at end of file diff --git a/testcases/function_test/pkg_test/ocaml-calendar/ocaml-calendar-devel/test_ocaml-calendar-devel_function_date_calc.sh b/testcases/function_test/pkg_test/ocaml-calendar/ocaml-calendar-devel/test_ocaml-calendar-devel_function_date_calc.sh deleted file mode 100644 index 2dc3e06c0be..00000000000 --- a/testcases/function_test/pkg_test/ocaml-calendar/ocaml-calendar-devel/test_ocaml-calendar-devel_function_date_calc.sh +++ /dev/null @@ -1,66 +0,0 @@ -#!/usr/bin/bash - -# Copyright (c) 2024 ISCAS .ALL rights reserved. -# This program is licensed under Mulan PSL v2. -# You can use it according to the terms and conditions of the Mulan PSL v2. -# http://license.coscl.org.cn/MulanPSL2 -# THIS PROGRAM IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, -# EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, -# MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. -# See the Mulan PSL v2 for more details. - -# ############################################# -# @Author : honghua -# @Contact : honghua@iscas.ac.cn -# @Date : 2025-11-30 -# @License : Mulan PSL v2 -# @Desc : Test date calculation functionality -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - - # 检查软件包是否已安装 - if ! dnf list installed ocaml-calendar-devel &>/dev/null; then - LOG_INFO "环境未安装ocaml-calendar-devel,开始安装..." - # 检查yum源中是否有该软件包 - if ! dnf list available ocaml-calendar-devel &>/dev/null; then - LOG_ERROR "yum源中未找到ocaml-calendar-devel软件包" - exit 255 - fi - # 安装软件包 - dnf install -y ocaml-calendar-devel - CHECK_RESULT $? 0 0 "安装ocaml-calendar-devel失败" - # 标记需要卸载 - NEED_UNINSTALL=1 - else - LOG_INFO "环境已安装ocaml-calendar-devel,跳过安装步骤" - fi - - # 测试日期计算功能 - LOG_INFO "开始测试日期计算功能..." - # 示例命令,假设date_calc是测试的命令,具体根据实际命令调整 - date_calc --add-days 10 2023-01-01 | grep -q "2023-01-11" - CHECK_RESULT $? 0 0 "日期加10天计算失败" - - # 测试不支持参数的情况 - LOG_INFO "测试不支持参数的情况..." - date_calc --invalid-arg &>/dev/null - if [ $? -ne 255 ]; then - LOG_ERROR "不支持参数未返回退出码255" - exit 255 - fi - - # 清理环境(如果之前安装了软件包) - if [ "$NEED_UNINSTALL" -eq 1 ]; then - LOG_INFO "卸载ocaml-calendar-devel..." - dnf remove -y ocaml-calendar-devel - CHECK_RESULT $? 0 0 "卸载ocaml-calendar-devel失败" - fi - - LOG_INFO "测试完成,环境已恢复" - -} - -main "$@" \ No newline at end of file diff --git a/testcases/function_test/pkg_test/ocaml-calendar/ocaml-calendar-devel/test_ocaml-calendar-devel_function_date_parse.sh b/testcases/function_test/pkg_test/ocaml-calendar/ocaml-calendar-devel/test_ocaml-calendar-devel_function_date_parse.sh deleted file mode 100644 index 2f69cc0aca2..00000000000 --- a/testcases/function_test/pkg_test/ocaml-calendar/ocaml-calendar-devel/test_ocaml-calendar-devel_function_date_parse.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 : Test date parsing functionality -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - LOG_INFO "开始测试:Test date parsing functionality" - - # 检查是否已安装ocaml-calendar-devel软件包 - LOG_INFO "检查是否已安装ocaml-calendar-devel软件包" - if rpm -q ocaml-calendar-devel > /dev/null 2>&1; then - LOG_INFO "ocaml-calendar-devel已安装,测试完成后将保持安装状态" - INSTALLED=true - else - LOG_INFO "ocaml-calendar-devel未安装,将在测试完成后卸载" - INSTALLED=false - fi - - # 检查yum源中是否有ocaml-calendar-devel软件包 - LOG_INFO "检查yum源中是否有ocaml-calendar-devel软件包" - if ! dnf list available ocaml-calendar-devel > /dev/null 2>&1; then - LOG_ERROR "yum源中未找到ocaml-calendar-devel软件包" - exit 255 - fi - - # 安装ocaml-calendar-devel软件包 - if [ "$INSTALLED" = false ]; then - LOG_INFO "安装ocaml-calendar-devel软件包" - dnf install -y ocaml-calendar-devel - CHECK_RESULT $? 0 0 "安装ocaml-calendar-devel软件包失败" - fi - - # 测试date parsing功能 - LOG_INFO "测试date parsing功能" - TEST_DATE="2023-10-01" - EXPECTED_RESULT="2023-10-01" - ACTUAL_RESULT=$(ocaml-calendar-devel-function-date-parse "$TEST_DATE") - CHECK_RESULT $? 0 0 "date parsing命令执行失败" - if [ "$ACTUAL_RESULT" != "$EXPECTED_RESULT" ]; then - LOG_ERROR "date parsing结果不符合预期:期望[$EXPECTED_RESULT],实际[$ACTUAL_RESULT]" - exit 1 - else - LOG_INFO "date parsing结果符合预期:[$ACTUAL_RESULT]" - fi - - # 清理环境,恢复到之前的状态 - if [ "$INSTALLED" = false ]; then - LOG_INFO "卸载ocaml-calendar-devel软件包" - dnf remove -y ocaml-calendar-devel - CHECK_RESULT $? 0 0 "卸载ocaml-calendar-devel软件包失败" - fi - - LOG_INFO "测试完成:Test date parsing functionality" -} - -main "$@" \ No newline at end of file diff --git a/testcases/function_test/pkg_test/ocaml-calendar/ocaml-calendar-devel/test_ocaml-calendar-devel_function_format_print.sh b/testcases/function_test/pkg_test/ocaml-calendar/ocaml-calendar-devel/test_ocaml-calendar-devel_function_format_print.sh deleted file mode 100644 index a9556e01f95..00000000000 --- a/testcases/function_test/pkg_test/ocaml-calendar/ocaml-calendar-devel/test_ocaml-calendar-devel_function_format_print.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-23 -# @License : Mulan PSL v2 -# @Desc : Test date formatting and printing -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - LOG_INFO "测试开始:测试日期格式化与打印功能" - LOG_INFO "步骤1:检查yum源中是否存在ocaml-calendar-devel软件包" - if ! dnf list available ocaml-calendar-devel &>/dev/null; then - LOG_ERROR "yum源中未找到ocaml-calendar-devel软件包" - exit 255 - fi - - LOG_INFO "步骤2:检查系统是否已安装ocaml-calendar-devel软件包" - if rpm -q ocaml-calendar-devel &>/dev/null; then - LOG_INFO "软件包已安装,测试结束后保持安装状态" - INSTALLED=true - else - LOG_INFO "软件包未安装,将安装作为测试步骤" - INSTALLED=false - fi - - if [ "$INSTALLED" = false ]; then - LOG_INFO "步骤3:安装ocaml-calendar-devel软件包" - dnf install -y ocaml-calendar-devel - CHECK_RESULT $? 0 0 "安装ocaml-calendar-devel失败" - fi - - LOG_INFO "步骤4:验证ocaml-calendar-devel提供的命令或功能" - if ! command -v calendar &>/dev/null; then - LOG_ERROR "未找到calendar命令,可能软件包不提供该命令" - exit 255 - fi - - LOG_INFO "步骤5:测试日期格式化与打印功能" - calendar --help &>/dev/null - CHECK_RESULT $? 0 0 "calendar命令参数不支持或执行失败" - - LOG_INFO "步骤6:执行具体的日期格式化测试(示例:显示当前月日历)" - calendar -m - CHECK_RESULT $? 0 0 "日期格式化打印失败" - - if [ "$INSTALLED" = false ]; then - LOG_INFO "步骤7:卸载ocaml-calendar-devel软件包" - dnf remove -y ocaml-calendar-devel - CHECK_RESULT $? 0 0 "卸载ocaml-calendar-devel失败" - else - LOG_INFO "步骤7:软件包已预先安装,跳过卸载步骤" - fi - - LOG_INFO "测试结束:日期格式化与打印功能测试完成" -} - -main "$@" \ No newline at end of file diff --git a/testcases/function_test/pkg_test/ocaml-calendar/ocaml-calendar-devel/test_ocaml-calendar-devel_function_install.sh b/testcases/function_test/pkg_test/ocaml-calendar/ocaml-calendar-devel/test_ocaml-calendar-devel_function_install.sh deleted file mode 100644 index f7673d1b3f8..00000000000 --- a/testcases/function_test/pkg_test/ocaml-calendar/ocaml-calendar-devel/test_ocaml-calendar-devel_function_install.sh +++ /dev/null @@ -1,76 +0,0 @@ -#!/usr/bin/bash - -# Copyright (c) 2024 ISCAS .ALL rights reserved. -# This program is licensed under Mulan PSL v2. -# You can use it according to the terms and conditions of the Mulan PSL v2. -# http://license.coscl.org.cn/MulanPSL2 -# THIS PROGRAM IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, -# EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, -# MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. -# See the Mulan PSL v2 for more details. - -# ############################################# -# @Author : honghua -# @Contact : honghua@iscas.ac.cn -# @Date : 2026-02-23 -# @License : Mulan PSL v2 -# @Desc : Test package installation -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - LOG_INFO "开始测试软件包安装功能" - LOG_INFO "检查是否已安装ocaml-calendar-devel软件包" - rpm -q ocaml-calendar-devel > /dev/null 2>&1 - if [ $? -eq 0 ]; then - LOG_INFO "ocaml-calendar-devel已安装,测试结束后将保持安装状态" - INSTALLED=1 - else - LOG_INFO "ocaml-calendar-devel未安装,将在测试前安装" - INSTALLED=0 - fi - - LOG_INFO "检查yum源中是否存在ocaml-calendar-devel软件包" - dnf list available ocaml-calendar-devel > /dev/null 2>&1 - CHECK_RESULT $? 0 0 "yum源中未找到ocaml-calendar-devel软件包" - if [ $? -ne 0 ]; then - LOG_ERROR "yum源中未找到ocaml-calendar-devel软件包" - exit 255 - fi - - if [ $INSTALLED -eq 0 ]; then - LOG_INFO "安装ocaml-calendar-devel软件包" - dnf install -y ocaml-calendar-devel - CHECK_RESULT $? 0 0 "安装ocaml-calendar-devel软件包失败" - fi - - LOG_INFO "验证软件包是否成功安装" - rpm -q ocaml-calendar-devel > /dev/null 2>&1 - CHECK_RESULT $? 0 0 "软件包安装后验证失败" - - LOG_INFO "测试软件包基本功能" - ocaml -version > /dev/null 2>&1 - CHECK_RESULT $? 0 0 "ocaml命令执行失败" - - if [ $INSTALLED -eq 0 ]; then - LOG_INFO "清理环境:卸载ocaml-calendar-devel软件包" - dnf remove -y ocaml-calendar-devel - CHECK_RESULT $? 0 0 "卸载ocaml-calendar-devel软件包失败" - - LOG_INFO "验证软件包是否已卸载" - rpm -q ocaml-calendar-devel > /dev/null 2>&1 - if [ $? -eq 0 ]; then - LOG_ERROR "软件包卸载后仍然存在" - exit 1 - else - LOG_INFO "软件包已成功卸载" - fi - else - LOG_INFO "测试前已安装ocaml-calendar-devel,保持安装状态" - fi - - LOG_INFO "测试完成" -} - -main "$@" \ No newline at end of file diff --git a/testcases/function_test/pkg_test/ocaml-calendar/ocaml-calendar-devel/test_ocaml-calendar-devel_function_period.sh b/testcases/function_test/pkg_test/ocaml-calendar/ocaml-calendar-devel/test_ocaml-calendar-devel_function_period.sh deleted file mode 100644 index 46ccd75fa84..00000000000 --- a/testcases/function_test/pkg_test/ocaml-calendar/ocaml-calendar-devel/test_ocaml-calendar-devel_function_period.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-02-23 -# @License : Mulan PSL v2 -# @Desc : Test period and interval handling -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - # 测试脚本开始 - - LOG_INFO "测试开始:Test period and interval handling" - - # 检查yum源中是否有ocaml-calendar-devel软件包 - LOG_INFO "步骤1:检查yum源中是否有ocaml-calendar-devel软件包" - if ! dnf list available ocaml-calendar-devel &>/dev/null; then - LOG_ERROR "yum源中没有找到ocaml-calendar-devel软件包" - exit 255 - fi - - # 检查是否已经安装ocaml-calendar-devel - LOG_INFO "步骤2:检查是否已经安装ocaml-calendar-devel" - if rpm -q ocaml-calendar-devel &>/dev/null; then - LOG_INFO "ocaml-calendar-devel已经安装,脚本结束时将保持安装状态" - already_installed=true - else - LOG_INFO "ocaml-calendar-devel未安装,将在测试步骤中安装" - already_installed=false - fi - - # 如果未安装,则安装软件包 - if [ "$already_installed" = false ]; then - LOG_INFO "步骤3:安装ocaml-calendar-devel软件包" - dnf install -y ocaml-calendar-devel - CHECK_RESULT $? 0 0 "安装ocaml-calendar-devel失败" - fi - - # 测试period和interval处理功能 - LOG_INFO "步骤4:测试period和interval处理功能" - # 假设测试命令是calendar_test,参数为--period和--interval - # 检查参数是否存在 - if ! calendar_test --help 2>&1 | grep -q "\-\-period"; then - LOG_ERROR "calendar_test命令不支持--period参数" - exit 255 - fi - - if ! calendar_test --help 2>&1 | grep -q "\-\-interval"; then - LOG_ERROR "calendar_test命令不支持--interval参数" - exit 255 - fi - - # 执行测试命令 - LOG_INFO "步骤5:执行calendar_test命令测试period和interval" - calendar_test --period 7 --interval 2 - CHECK_RESULT $? 0 0 "calendar_test命令执行失败" - - # 清理环境:如果之前未安装,则卸载软件包 - if [ "$already_installed" = false ]; then - LOG_INFO "步骤6:卸载ocaml-calendar-devel软件包" - dnf remove -y ocaml-calendar-devel - CHECK_RESULT $? 0 0 "卸载ocaml-calendar-devel失败" - else - LOG_INFO "步骤6:保持ocaml-calendar-devel安装状态,无需卸载" - fi - - LOG_INFO "测试结束:Test period and interval handling" -} - -main "$@" \ No newline at end of file diff --git a/testcases/function_test/pkg_test/ocaml-calendar/ocaml-calendar-devel/test_ocaml-calendar-devel_function_uninstall.sh b/testcases/function_test/pkg_test/ocaml-calendar/ocaml-calendar-devel/test_ocaml-calendar-devel_function_uninstall.sh deleted file mode 100644 index 9cad89aa64e..00000000000 --- a/testcases/function_test/pkg_test/ocaml-calendar/ocaml-calendar-devel/test_ocaml-calendar-devel_function_uninstall.sh +++ /dev/null @@ -1,83 +0,0 @@ -#!/usr/bin/bash - -# Copyright (c) 2024 ISCAS .ALL rights reserved. -# This program is licensed under Mulan PSL v2. -# You can use it according to the terms and conditions of the Mulan PSL v2. -# http://license.coscl.org.cn/MulanPSL2 -# THIS PROGRAM IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, -# EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, -# MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. -# See the Mulan PSL v2 for more details. - -# ############################################# -# @Author : honghua -# @Contact : honghua@iscas.ac.cn -# @Date : 2026-02-23 -# @License : Mulan PSL v2 -# @Desc : Test package removal -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - # 环境预检查:判断软件包是否已安装 - LOG_INFO "开始测试:Test package removal" - LOG_INFO "步骤1:检查当前环境中是否已安装ocaml-calendar-devel软件包" - rpm -q ocaml-calendar-devel > /dev/null 2>&1 - if [ $? -eq 0 ]; then - LOG_INFO "检测到ocaml-calendar-devel已安装,测试将在保持安装状态下进行" - INSTALLED_BEFORE_TEST=true - else - LOG_INFO "检测到ocaml-calendar-devel未安装,将在测试过程中安装并最终卸载" - INSTALLED_BEFORE_TEST=false - fi - - # 检查yum源中是否存在该软件包 - LOG_INFO "步骤2:检查yum源中是否存在ocaml-calendar-devel软件包" - dnf list available ocaml-calendar-devel > /dev/null 2>&1 - if [ $? -ne 0 ]; then - LOG_ERROR "yum源中未找到ocaml-calendar-devel软件包" - exit 255 - fi - - # 如果未安装,则进行安装作为测试步骤 - if [ "$INSTALLED_BEFORE_TEST" = "false" ]; then - LOG_INFO "步骤3:安装ocaml-calendar-devel软件包" - dnf install -y ocaml-calendar-devel - CHECK_RESULT $? 0 0 "安装ocaml-calendar-devel失败" - fi - - # 验证软件包是否安装成功 - LOG_INFO "步骤4:验证ocaml-calendar-devel软件包是否安装成功" - rpm -q ocaml-calendar-devel > /dev/null 2>&1 - CHECK_RESULT $? 0 0 "ocaml-calendar-devel软件包未正确安装" - - # 测试卸载功能 - LOG_INFO "步骤5:测试卸载ocaml-calendar-devel软件包" - dnf remove -y ocaml-calendar-devel - CHECK_RESULT $? 0 0 "卸载ocaml-calendar-devel失败" - - # 验证软件包是否已卸载 - LOG_INFO "步骤6:验证ocaml-calendar-devel软件包是否已卸载" - rpm -q ocaml-calendar-devel > /dev/null 2>&1 - if [ $? -eq 0 ]; then - LOG_ERROR "ocaml-calendar-devel软件包卸载后仍然存在" - exit 1 - else - LOG_INFO "ocaml-calendar-devel软件包已成功卸载" - fi - - # 环境恢复:如果测试前已安装,则重新安装 - if [ "$INSTALLED_BEFORE_TEST" = "true" ]; then - LOG_INFO "步骤7:恢复环境,重新安装ocaml-calendar-devel软件包" - dnf install -y ocaml-calendar-devel - CHECK_RESULT $? 0 0 "恢复安装ocaml-calendar-devel失败" - LOG_INFO "环境已恢复,ocaml-calendar-devel软件包已重新安装" - else - LOG_INFO "步骤7:环境恢复,无需重新安装ocaml-calendar-devel" - fi - - LOG_INFO "测试完成:Test package removal" -} - -main "$@" \ No newline at end of file From 64c9fbff373f0a2e89963006c56b0013df3c10a9 Mon Sep 17 00:00:00 2001 From: honghua Date: Sat, 18 Apr 2026 16:58:20 +0800 Subject: [PATCH 06/17] update testcase for testsuite abrt-help --- .../pkg_test/abrt/abrt-help.json | 4 - .../test_abrt-help_function_start.sh | 74 ------------------- 2 files changed, 78 deletions(-) delete mode 100644 testcases/function_test/pkg_test/abrt/abrt-help/test_abrt-help_function_start.sh diff --git a/suite2cases/function_test/pkg_test/abrt/abrt-help.json b/suite2cases/function_test/pkg_test/abrt/abrt-help.json index 97adf5ce727..c7ed4682b0b 100644 --- a/suite2cases/function_test/pkg_test/abrt/abrt-help.json +++ b/suite2cases/function_test/pkg_test/abrt/abrt-help.json @@ -6,10 +6,6 @@ "name": "test_abrt-help_install", "desc": "测试abrt-help软件包的安装功能,验证安装过程是否成功。", "machine num": 1 - }, - { - "name": "test_abrt-help_function_start", - "desc": "测试abrt-help软件包的启动功能,验证服务是否能正常启动。" } ] } \ No newline at end of file diff --git a/testcases/function_test/pkg_test/abrt/abrt-help/test_abrt-help_function_start.sh b/testcases/function_test/pkg_test/abrt/abrt-help/test_abrt-help_function_start.sh deleted file mode 100644 index 813733ecc8a..00000000000 --- a/testcases/function_test/pkg_test/abrt/abrt-help/test_abrt-help_function_start.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-04 -# @License : Mulan PSL v2 -# @Desc : 测试abrt-help软件包的启动功能,验证服务是否能正常启动。 -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - LOG_INFO "开始测试abrt-help软件包的启动功能,验证服务是否能正常启动。" - - # 检查abrt-help软件包是否已安装 - if ! dnf list installed abrt-help &>/dev/null; then - LOG_INFO "abrt-help软件包未安装,开始安装..." - if ! dnf list abrt-help &>/dev/null; then - LOG_ERROR "yum源中未找到abrt-help软件包,退出测试。" - exit 255 - fi - dnf install -y abrt-help - CHECK_RESULT $? 0 0 "安装abrt-help软件包失败。" - INSTALLED=1 - else - LOG_INFO "abrt-help软件包已安装,跳过安装步骤。" - INSTALLED=0 - fi - - # 检查abrt-help服务是否存在 - if ! systemctl list-unit-files | grep -q abrt-help.service; then - LOG_ERROR "abrt-help服务不存在,退出测试。" - if [ $INSTALLED -eq 1 ]; then - dnf remove -y abrt-help - fi - exit 255 - fi - - # 启动abrt-help服务 - LOG_INFO "启动abrt-help服务..." - systemctl start abrt-help - CHECK_RESULT $? 0 0 "启动abrt-help服务失败。" - - # 检查服务状态 - LOG_INFO "检查abrt-help服务状态..." - systemctl status abrt-help | grep -q "active (running)" - CHECK_RESULT $? 0 0 "abrt-help服务未正常运行。" - - # 停止abrt-help服务 - LOG_INFO "停止abrt-help服务..." - systemctl stop abrt-help - CHECK_RESULT $? 0 0 "停止abrt-help服务失败。" - - # 清理环境 - if [ $INSTALLED -eq 1 ]; then - LOG_INFO "卸载abrt-help软件包..." - dnf remove -y abrt-help - CHECK_RESULT $? 0 0 "卸载abrt-help软件包失败。" - fi - - LOG_INFO "测试完成,环境已恢复。" -} - -main "$@" \ No newline at end of file From e1b58c2a6c2a8c3de5dc10fbe9c54f0b8ef60657 Mon Sep 17 00:00:00 2001 From: honghua Date: Sat, 18 Apr 2026 16:58:31 +0800 Subject: [PATCH 07/17] update testcase for testsuite texlive-tabls-doc --- .../texlive-split-w/texlive-tabls-doc.json | 30 ------- .../test_texlive-tabls-doc_function_basic.sh | 75 ----------------- ...st_texlive-tabls-doc_function_doc_files.sh | 70 ---------------- ...t_texlive-tabls-doc_function_info_query.sh | 69 --------------- ...test_texlive-tabls-doc_function_install.sh | 76 ----------------- ...exlive-tabls-doc_function_manual_access.sh | 73 ---------------- ...st_texlive-tabls-doc_function_uninstall.sh | 84 ------------------- 7 files changed, 477 deletions(-) delete mode 100644 suite2cases/function_test/pkg_test/texlive-split-w/texlive-tabls-doc.json delete mode 100644 testcases/function_test/pkg_test/texlive-split-w/texlive-tabls-doc/test_texlive-tabls-doc_function_basic.sh delete mode 100644 testcases/function_test/pkg_test/texlive-split-w/texlive-tabls-doc/test_texlive-tabls-doc_function_doc_files.sh delete mode 100644 testcases/function_test/pkg_test/texlive-split-w/texlive-tabls-doc/test_texlive-tabls-doc_function_info_query.sh delete mode 100644 testcases/function_test/pkg_test/texlive-split-w/texlive-tabls-doc/test_texlive-tabls-doc_function_install.sh delete mode 100644 testcases/function_test/pkg_test/texlive-split-w/texlive-tabls-doc/test_texlive-tabls-doc_function_manual_access.sh delete mode 100644 testcases/function_test/pkg_test/texlive-split-w/texlive-tabls-doc/test_texlive-tabls-doc_function_uninstall.sh diff --git a/suite2cases/function_test/pkg_test/texlive-split-w/texlive-tabls-doc.json b/suite2cases/function_test/pkg_test/texlive-split-w/texlive-tabls-doc.json deleted file mode 100644 index fc48500198e..00000000000 --- a/suite2cases/function_test/pkg_test/texlive-split-w/texlive-tabls-doc.json +++ /dev/null @@ -1,30 +0,0 @@ -{ - "path": "$OET_PATH/testcases/function_test/pkg_test/texlive-split-w/texlive-tabls-doc", - "machine num": 1, - "cases": [ - { - "name": "test_texlive-tabls-doc_function_basic", - "desc": "Test basic functionality of texlive-tabls-doc" - }, - { - "name": "test_texlive-tabls-doc_function_install", - "desc": "Test the installation process of texlive-tabls-doc package" - }, - { - "name": "test_texlive-tabls-doc_function_uninstall", - "desc": "Test the uninstallation process of texlive-tabls-doc package" - }, - { - "name": "test_texlive-tabls-doc_function_doc_files", - "desc": "Test the presence of documentation files after installation" - }, - { - "name": "test_texlive-tabls-doc_function_info_query", - "desc": "Test querying package information via package manager" - }, - { - "name": "test_texlive-tabls-doc_function_manual_access", - "desc": "Test accessing the main documentation manual" - } - ] -} \ No newline at end of file diff --git a/testcases/function_test/pkg_test/texlive-split-w/texlive-tabls-doc/test_texlive-tabls-doc_function_basic.sh b/testcases/function_test/pkg_test/texlive-split-w/texlive-tabls-doc/test_texlive-tabls-doc_function_basic.sh deleted file mode 100644 index 39f8a3f1337..00000000000 --- a/testcases/function_test/pkg_test/texlive-split-w/texlive-tabls-doc/test_texlive-tabls-doc_function_basic.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-11-26 -# @License : Mulan PSL v2 -# @Desc : Test basic functionality of texlive-tabls-doc -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - - # 检查texlive-tabls-doc软件包是否已安装 - LOG_INFO "检查texlive-tabls-doc软件包是否已安装" - rpm -q texlive-tabls-doc > /dev/null 2>&1 - if [ $? -eq 0 ]; then - LOG_INFO "texlive-tabls-doc已安装,脚本结束时保持安装状态" - INSTALLED=true - else - LOG_INFO "texlive-tabls-doc未安装,将在测试结束后卸载" - INSTALLED=false - fi - - # 检查yum源中是否存在texlive-tabls-doc软件包 - LOG_INFO "检查yum源中是否存在texlive-tabls-doc软件包" - dnf list available texlive-tabls-doc > /dev/null 2>&1 - if [ $? -ne 0 ]; then - LOG_ERROR "yum源中不存在texlive-tabls-doc软件包" - exit 255 - fi - - # 安装texlive-tabls-doc软件包 - LOG_INFO "安装texlive-tabls-doc软件包" - dnf install -y texlive-tabls-doc - CHECK_RESULT $? 0 0 "安装texlive-tabls-doc失败" - - # 测试texlive-tabls-doc基本功能 - LOG_INFO "测试texlive-tabls-doc基本功能" - - # 示例命令:检查是否支持某个参数(假设命令为texdoc) - LOG_INFO "检查texdoc命令是否支持--list参数" - texdoc --list > /dev/null 2>&1 - if [ $? -ne 0 ]; then - LOG_ERROR "texdoc命令不支持--list参数" - exit 255 - fi - - # 示例命令:执行某个功能(假设命令为texdoc tabu) - LOG_INFO "执行texdoc tabu命令" - texdoc tabu - CHECK_RESULT $? 0 0 "执行texdoc tabu失败" - - # 清理环境:如果脚本开始时未安装texlive-tabls-doc,则卸载 - if [ "$INSTALLED" = false ]; then - LOG_INFO "卸载texlive-tabls-doc软件包" - dnf remove -y texlive-tabls-doc - CHECK_RESULT $? 0 0 "卸载texlive-tabls-doc失败" - fi - - LOG_INFO "测试脚本执行完毕,环境已恢复" - -} - -main "$@" \ No newline at end of file diff --git a/testcases/function_test/pkg_test/texlive-split-w/texlive-tabls-doc/test_texlive-tabls-doc_function_doc_files.sh b/testcases/function_test/pkg_test/texlive-split-w/texlive-tabls-doc/test_texlive-tabls-doc_function_doc_files.sh deleted file mode 100644 index 2f916f3aaff..00000000000 --- a/testcases/function_test/pkg_test/texlive-split-w/texlive-tabls-doc/test_texlive-tabls-doc_function_doc_files.sh +++ /dev/null @@ -1,70 +0,0 @@ -#!/usr/bin/bash - -# Copyright (c) 2024 ISCAS .ALL rights reserved. -# This program is licensed under Mulan PSL v2. -# You can use it according to the terms and conditions of the Mulan PSL v2. -# http://license.coscl.org.cn/MulanPSL2 -# THIS PROGRAM IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, -# EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, -# MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. -# See the Mulan PSL v2 for more details. - -# ############################################# -# @Author : honghua -# @Contact : honghua@iscas.ac.cn -# @Date : 2026-03-05 -# @License : Mulan PSL v2 -# @Desc : Test the presence of documentation files after installation -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - LOG_INFO "开始测试:验证安装后文档文件的存在性" - LOG_INFO "步骤1:检查环境中是否已安装 texlive-tabls-doc 软件包" - rpm -q texlive-tabls-doc - if [ $? -eq 0 ]; then - LOG_INFO "texlive-tabls-doc 已安装,测试结束后将保持安装状态" - INSTALLED=1 - else - LOG_INFO "texlive-tabls-doc 未安装,将在测试过程中安装并在结束前卸载" - INSTALLED=0 - fi - - LOG_INFO "步骤2:检查 yum 源中是否有 texlive-tabls-doc 软件包" - dnf list available texlive-tabls-doc - CHECK_RESULT $? 0 0 "yum 源中未找到 texlive-tabls-doc 软件包" - if [ $? -ne 0 ]; then - LOG_ERROR "yum 源中未找到 texlive-tabls-doc 软件包" - exit 255 - fi - - if [ $INSTALLED -eq 0 ]; then - LOG_INFO "步骤3:安装 texlive-tabls-doc 软件包" - dnf install -y texlive-tabls-doc - CHECK_RESULT $? 0 0 "安装 texlive-tabls-doc 失败" - fi - - LOG_INFO "步骤4:验证文档文件是否存在" - rpm -ql texlive-tabls-doc | grep -E "\.pdf$|\.html$|\.txt$|\.md$" | head -5 - CHECK_RESULT $? 0 0 "未找到文档文件" - - LOG_INFO "步骤5:验证特定文档文件内容" - DOC_FILE=$(rpm -ql texlive-tabls-doc | grep -E "README|LICENSE" | head -1) - if [ -n "$DOC_FILE" ]; then - file "$DOC_FILE" - CHECK_RESULT $? 0 0 "文档文件检查失败" - else - LOG_INFO "未找到 README 或 LICENSE 文件,跳过文件内容检查" - fi - - if [ $INSTALLED -eq 0 ]; then - LOG_INFO "步骤6:卸载 texlive-tabls-doc 软件包以恢复环境" - dnf remove -y texlive-tabls-doc - CHECK_RESULT $? 0 0 "卸载 texlive-tabls-doc 失败" - fi - - LOG_INFO "测试完成:文档文件存在性验证成功" -} - -main "$@" \ No newline at end of file diff --git a/testcases/function_test/pkg_test/texlive-split-w/texlive-tabls-doc/test_texlive-tabls-doc_function_info_query.sh b/testcases/function_test/pkg_test/texlive-split-w/texlive-tabls-doc/test_texlive-tabls-doc_function_info_query.sh deleted file mode 100644 index 6c63312958e..00000000000 --- a/testcases/function_test/pkg_test/texlive-split-w/texlive-tabls-doc/test_texlive-tabls-doc_function_info_query.sh +++ /dev/null @@ -1,69 +0,0 @@ -#!/usr/bin/bash - -# Copyright (c) 2024 ISCAS .ALL rights reserved. -# This program is licensed under Mulan PSL v2. -# You can use it according to the terms and conditions of the Mulan PSL v2. -# http://license.coscl.org.cn/MulanPSL2 -# THIS PROGRAM IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, -# EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, -# MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. -# See the Mulan PSL v2 for more details. - -# ############################################# -# @Author : honghua -# @Contact : honghua@iscas.ac.cn -# @Date : 2026-03-05 -# @License : Mulan PSL v2 -# @Desc : Test querying package information via package manager -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - LOG_INFO "测试开始:通过包管理器查询软件包信息" - LOG_INFO "步骤1:检查yum源中是否存在texlive-tabls-doc软件包" - if ! dnf list available texlive-tabls-doc &>/dev/null; then - LOG_ERROR "yum源中未找到texlive-tabls-doc软件包" - exit 255 - fi - LOG_INFO "texlive-tabls-doc软件包在yum源中存在" - - LOG_INFO "步骤2:检查系统是否已安装texlive-tabls-doc" - if rpm -q texlive-tabls-doc &>/dev/null; then - LOG_INFO "texlive-tabls-doc已安装,测试结束后将保持安装状态" - INSTALLED=true - else - LOG_INFO "texlive-tabls-doc未安装,将在测试步骤中安装" - INSTALLED=false - fi - - LOG_INFO "步骤3:安装texlive-tabls-doc软件包(如未安装)" - if [ "$INSTALLED" = false ]; then - dnf install -y texlive-tabls-doc - CHECK_RESULT $? 0 0 "安装texlive-tabls-doc失败" - LOG_INFO "texlive-tabls-doc安装成功" - fi - - LOG_INFO "步骤4:查询texlive-tabls-doc软件包信息" - dnf info texlive-tabls-doc - CHECK_RESULT $? 0 0 "查询texlive-tabls-doc软件包信息失败" - - LOG_INFO "步骤5:验证查询结果包含关键信息" - dnf info texlive-tabls-doc | grep -q "Name.*texlive-tabls-doc" - CHECK_RESULT $? 0 0 "查询结果未包含软件包名称" - LOG_INFO "软件包信息查询成功" - - LOG_INFO "步骤6:清理环境,恢复原始状态" - if [ "$INSTALLED" = false ]; then - LOG_INFO "卸载测试安装的texlive-tabls-doc软件包" - dnf remove -y texlive-tabls-doc - CHECK_RESULT $? 0 0 "卸载texlive-tabls-doc失败" - LOG_INFO "texlive-tabls-doc卸载成功" - else - LOG_INFO "系统原已安装texlive-tabls-doc,保持安装状态" - fi - - LOG_INFO "测试结束:通过包管理器查询软件包信息完成" -} - -main "$@" \ No newline at end of file diff --git a/testcases/function_test/pkg_test/texlive-split-w/texlive-tabls-doc/test_texlive-tabls-doc_function_install.sh b/testcases/function_test/pkg_test/texlive-split-w/texlive-tabls-doc/test_texlive-tabls-doc_function_install.sh deleted file mode 100644 index 98b3cd6dd51..00000000000 --- a/testcases/function_test/pkg_test/texlive-split-w/texlive-tabls-doc/test_texlive-tabls-doc_function_install.sh +++ /dev/null @@ -1,76 +0,0 @@ -#!/usr/bin/bash - -# Copyright (c) 2024 ISCAS .ALL rights reserved. -# This program is licensed under Mulan PSL v2. -# You can use it according to the terms and conditions of the Mulan PSL v2. -# http://license.coscl.org.cn/MulanPSL2 -# THIS PROGRAM IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, -# EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, -# MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. -# See the Mulan PSL v2 for more details. - -# ############################################# -# @Author : honghua -# @Contact : honghua@iscas.ac.cn -# @Date : 2026-03-05 -# @License : Mulan PSL v2 -# @Desc : Test the installation process of texlive-tabls-doc package -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - set -e - - LOG_INFO "开始测试 texlive-tabls-doc 包的安装过程" - - # 步骤1:检查软件包是否在yum源中 - LOG_INFO "步骤1:检查yum源中是否存在 texlive-tabls-doc 软件包" - if ! dnf list available texlive-tabls-doc &>/dev/null; then - LOG_ERROR "yum源中未找到 texlive-tabls-doc 软件包" - exit 255 - fi - LOG_INFO "yum源中存在 texlive-tabls-doc 软件包" - - # 步骤2:检查当前是否已安装 - LOG_INFO "步骤2:检查 texlive-tabls-doc 是否已安装" - if rpm -q texlive-tabls-doc &>/dev/null; then - LOG_INFO "texlive-tabls-doc 已安装,标记为已存在安装" - ALREADY_INSTALLED=1 - else - LOG_INFO "texlive-tabls-doc 未安装" - ALREADY_INSTALLED=0 - fi - - # 步骤3:如果未安装,则执行安装 - if [ $ALREADY_INSTALLED -eq 0 ]; then - LOG_INFO "步骤3:安装 texlive-tabls-doc 软件包" - dnf install -y texlive-tabls-doc - CHECK_RESULT $? 0 0 "安装 texlive-tabls-doc 失败" - LOG_INFO "安装 texlive-tabls-doc 成功" - fi - - # 步骤4:验证安装 - LOG_INFO "步骤4:验证 texlive-tabls-doc 安装" - rpm -q texlive-tabls-doc - CHECK_RESULT $? 0 0 "验证 texlive-tabls-doc 安装失败" - - # 步骤5:执行包相关的功能测试(示例:列出包文件) - LOG_INFO "步骤5:执行 texlive-tabls-doc 功能测试(列出包文件)" - rpm -ql texlive-tabls-doc | head -5 - CHECK_RESULT $? 0 0 "列出 texlive-tabls-doc 文件失败" - - # 步骤6:环境恢复(如果本次测试安装的,则卸载) - if [ $ALREADY_INSTALLED -eq 0 ]; then - LOG_INFO "步骤6:卸载 texlive-tabls-doc 软件包(恢复环境)" - dnf remove -y texlive-tabls-doc - CHECK_RESULT $? 0 0 "卸载 texlive-tabls-doc 失败" - LOG_INFO "卸载 texlive-tabls-doc 成功" - else - LOG_INFO "步骤6:保持 texlive-tabls-doc 已安装状态(不执行卸载)" - fi - - LOG_INFO "测试 texlive-tabls-doc 包的安装过程完成" -} - -main "$@" \ No newline at end of file diff --git a/testcases/function_test/pkg_test/texlive-split-w/texlive-tabls-doc/test_texlive-tabls-doc_function_manual_access.sh b/testcases/function_test/pkg_test/texlive-split-w/texlive-tabls-doc/test_texlive-tabls-doc_function_manual_access.sh deleted file mode 100644 index c871fc0ee56..00000000000 --- a/testcases/function_test/pkg_test/texlive-split-w/texlive-tabls-doc/test_texlive-tabls-doc_function_manual_access.sh +++ /dev/null @@ -1,73 +0,0 @@ -#!/usr/bin/bash - -# Copyright (c) 2024 ISCAS .ALL rights reserved. -# This program is licensed under Mulan PSL v2. -# You can use it according to the terms and conditions of the Mulan PSL v2. -# http://license.coscl.org.cn/MulanPSL2 -# THIS PROGRAM IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, -# EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, -# MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. -# See the Mulan PSL v2 for more details. - -# ############################################# -# @Author : honghua -# @Contact : honghua@iscas.ac.cn -# @Date : 2026-03-05 -# @License : Mulan PSL v2 -# @Desc : Test accessing the main documentation manual -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - LOG_INFO "开始测试:访问主要文档手册" - - # 定义软件包名称 - PACKAGE_NAME="texlive-tabls-doc" - - # 检查是否已经安装 - LOG_INFO "检查是否已经安装 $PACKAGE_NAME" - if dnf list installed "$PACKAGE_NAME" &> /dev/null; then - LOG_INFO "$PACKAGE_NAME 已安装,脚本结束后将保持安装状态" - INSTALLED_BEFORE=true - else - LOG_INFO "$PACKAGE_NAME 未安装,将在测试中安装并在结束后卸载" - INSTALLED_BEFORE=false - fi - - # 检查yum源中是否有该软件包 - LOG_INFO "检查yum源中是否有 $PACKAGE_NAME" - if ! dnf list available "$PACKAGE_NAME" &> /dev/null; then - LOG_ERROR "yum源中没有找到 $PACKAGE_NAME 软件包" - exit 255 - fi - - # 如果未安装,则安装软件包 - if [ "$INSTALLED_BEFORE" = false ]; then - LOG_INFO "安装 $PACKAGE_NAME" - dnf install -y "$PACKAGE_NAME" - CHECK_RESULT $? 0 0 "安装 $PACKAGE_NAME 失败" - fi - - # 测试访问主要文档手册 - LOG_INFO "测试访问 $PACKAGE_NAME 的主要文档手册" - if [ -d "/usr/share/doc/$PACKAGE_NAME" ]; then - LOG_INFO "文档目录存在,尝试列出文档文件" - ls -la "/usr/share/doc/$PACKAGE_NAME/" - CHECK_RESULT $? 0 0 "列出文档文件失败" - else - LOG_ERROR "文档目录 /usr/share/doc/$PACKAGE_NAME 不存在" - exit 1 - fi - - # 清理环境:如果之前未安装,则卸载软件包 - if [ "$INSTALLED_BEFORE" = 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/texlive-split-w/texlive-tabls-doc/test_texlive-tabls-doc_function_uninstall.sh b/testcases/function_test/pkg_test/texlive-split-w/texlive-tabls-doc/test_texlive-tabls-doc_function_uninstall.sh deleted file mode 100644 index 6e7dea1493a..00000000000 --- a/testcases/function_test/pkg_test/texlive-split-w/texlive-tabls-doc/test_texlive-tabls-doc_function_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-05 -# @License : Mulan PSL v2 -# @Desc : Test the uninstallation process of texlive-tabls-doc package -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - # 检查是否已经安装texlive-tabls-doc - LOG_INFO "检查是否已经安装texlive-tabls-doc软件包" - rpm -q texlive-tabls-doc >/dev/null 2>&1 - if [ $? -eq 0 ]; then - LOG_INFO "检测到texlive-tabls-doc已安装,脚本结束时将保持安装状态" - INSTALLED_BEFORE=1 - else - LOG_INFO "未检测到texlive-tabls-doc安装,将在测试后卸载" - INSTALLED_BEFORE=0 - fi - - # 检查yum源中是否存在该软件包 - LOG_INFO "检查yum源中是否存在texlive-tabls-doc软件包" - dnf list available texlive-tabls-doc >/dev/null 2>&1 - CHECK_RESULT $? 0 0 "yum源中未找到texlive-tabls-doc软件包" - if [ $? -ne 0 ]; then - LOG_ERROR "yum源中未找到texlive-tabls-doc软件包" - exit 255 - fi - - # 如果未安装,则进行安装 - if [ $INSTALLED_BEFORE -eq 0 ]; then - LOG_INFO "安装texlive-tabls-doc软件包" - dnf install -y texlive-tabls-doc - CHECK_RESULT $? 0 0 "安装texlive-tabls-doc失败" - fi - - # 验证软件包已安装 - LOG_INFO "验证texlive-tabls-doc软件包已安装" - rpm -q texlive-tabls-doc - CHECK_RESULT $? 0 0 "texlive-tabls-doc软件包未正确安装" - - # 执行卸载测试 - LOG_INFO "执行texlive-tabls-doc卸载测试" - dnf remove -y texlive-tabls-doc - CHECK_RESULT $? 0 0 "卸载texlive-tabls-doc失败" - - # 验证软件包已卸载 - LOG_INFO "验证texlive-tabls-doc软件包已卸载" - rpm -q texlive-tabls-doc - if [ $? -eq 0 ]; then - LOG_ERROR "卸载后仍检测到texlive-tabls-doc软件包" - exit 1 - else - LOG_INFO "texlive-tabls-doc软件包已成功卸载" - fi - - # 环境恢复 - LOG_INFO "开始环境恢复" - if [ $INSTALLED_BEFORE -eq 1 ]; then - LOG_INFO "重新安装texlive-tabls-doc以恢复原始状态" - dnf install -y texlive-tabls-doc - CHECK_RESULT $? 0 0 "重新安装texlive-tabls-doc失败" - LOG_INFO "环境已恢复到原始安装状态" - else - LOG_INFO "环境已恢复到原始未安装状态" - fi - - LOG_INFO "texlive-tabls-doc卸载功能测试完成" -} - -main "$@" \ No newline at end of file From 2e929035ef2fbe6ef29c1908eb57cc4ee078a73c Mon Sep 17 00:00:00 2001 From: honghua Date: Sat, 18 Apr 2026 17:04:41 +0800 Subject: [PATCH 08/17] update testcase for testsuite texlive-plain-doc-doc --- .../texlive-plain-doc-doc.json | 10 --- ...test_texlive-plain-doc-doc_function_doc.sh | 78 ------------------- 2 files changed, 88 deletions(-) delete mode 100644 suite2cases/function_test/pkg_test/texlive-split-r/texlive-plain-doc-doc.json delete mode 100644 testcases/function_test/pkg_test/texlive-split-r/texlive-plain-doc-doc/test_texlive-plain-doc-doc_function_doc.sh diff --git a/suite2cases/function_test/pkg_test/texlive-split-r/texlive-plain-doc-doc.json b/suite2cases/function_test/pkg_test/texlive-split-r/texlive-plain-doc-doc.json deleted file mode 100644 index e2ec386432e..00000000000 --- a/suite2cases/function_test/pkg_test/texlive-split-r/texlive-plain-doc-doc.json +++ /dev/null @@ -1,10 +0,0 @@ -{ - "path": "$OET_PATH/testcases/function_test/pkg_test/texlive-split-r/texlive-plain-doc-doc", - "machine num": 1, - "cases": [ - { - "name": "test_texlive-plain-doc-doc_function_doc", - "desc": "Verify the documentation files are correctly installed" - } - ] -} \ No newline at end of file diff --git a/testcases/function_test/pkg_test/texlive-split-r/texlive-plain-doc-doc/test_texlive-plain-doc-doc_function_doc.sh b/testcases/function_test/pkg_test/texlive-split-r/texlive-plain-doc-doc/test_texlive-plain-doc-doc_function_doc.sh deleted file mode 100644 index 909bac306c2..00000000000 --- a/testcases/function_test/pkg_test/texlive-split-r/texlive-plain-doc-doc/test_texlive-plain-doc-doc_function_doc.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-11-26 -# @License : Mulan PSL v2 -# @Desc : Verify the documentation files are correctly installed -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - - # 检查texlive-plain-doc-doc是否已安装 - LOG_INFO "检查texlive-plain-doc-doc是否已安装" - dnf list installed texlive-plain-doc-doc > /dev/null 2>&1 - if [ $? -eq 0 ]; then - LOG_INFO "texlive-plain-doc-doc已安装,脚本结束时保持安装状态" - installed=true - else - LOG_INFO "texlive-plain-doc-doc未安装,将在测试结束后卸载" - installed=false - fi - - # 检查yum源中是否有texlive-plain-doc-doc软件包 - LOG_INFO "检查yum源中是否有texlive-plain-doc-doc软件包" - dnf list available texlive-plain-doc-doc > /dev/null 2>&1 - if [ $? -ne 0 ]; then - LOG_ERROR "yum源中未找到texlive-plain-doc-doc软件包" - exit 255 - fi - - # 安装texlive-plain-doc-doc软件包 - if [ "$installed" = false ]; then - LOG_INFO "开始安装texlive-plain-doc-doc软件包" - dnf install -y texlive-plain-doc-doc > /dev/null 2>&1 - CHECK_RESULT $? 0 0 "安装texlive-plain-doc-doc软件包失败" - fi - - # 验证文档文件是否正确安装 - LOG_INFO "验证文档文件是否正确安装" - rpm -ql texlive-plain-common > /dev/null 2>&1 - CHECK_RESULT $? 0 0 "文档文件未正确安装" - - # 清理环境 - if [ "$installed" = false ]; then - LOG_INFO "卸载texlive-plain-common软件包" - dnf remove -y texlive-plain-common > /dev/null 2>&1 - CHECK_RESULT $? 0 0 "卸载texlive-plain-common软件包失败" - - LOG_INFO "卸载texlive-plain-docs-common软件包" - dnf remove -y texlive-plain-docs-common > /dev/null 2>&1 - CHECK_RESULT $? , , ,"卸载texlivedocs-plaion-files失败" - - # 恢复环境到初始状态(如果之前未安装) - if [ "$installed" = false ]; then - LOG_INF0“恢复环境到初始状态” - # No additional steps needed as the package was not initially installed - fi - else - LOG_INF0“保持环境不变” - fi - - #脚本结束 - exitO -} - -main "$@" \ No newline at end of file From c6f0fdaf86d56113658656448141e469786f8213 Mon Sep 17 00:00:00 2001 From: honghua Date: Sat, 18 Apr 2026 17:04:57 +0800 Subject: [PATCH 09/17] update testcase for testsuite texlive-eurosym-doc --- .../texlive-split-h/texlive-eurosym-doc.json | 12 -- ...test_texlive-eurosym-doc_function_check.sh | 88 -------------- ...texlive-eurosym-doc_function_doc_access.sh | 87 -------------- ...test_texlive-eurosym-doc_function_purge.sh | 111 ------------------ 4 files changed, 298 deletions(-) delete mode 100644 testcases/function_test/pkg_test/texlive-split-h/texlive-eurosym-doc/test_texlive-eurosym-doc_function_check.sh delete mode 100644 testcases/function_test/pkg_test/texlive-split-h/texlive-eurosym-doc/test_texlive-eurosym-doc_function_doc_access.sh delete mode 100644 testcases/function_test/pkg_test/texlive-split-h/texlive-eurosym-doc/test_texlive-eurosym-doc_function_purge.sh diff --git a/suite2cases/function_test/pkg_test/texlive-split-h/texlive-eurosym-doc.json b/suite2cases/function_test/pkg_test/texlive-split-h/texlive-eurosym-doc.json index 7b2275541bf..29529aefe87 100644 --- a/suite2cases/function_test/pkg_test/texlive-split-h/texlive-eurosym-doc.json +++ b/suite2cases/function_test/pkg_test/texlive-split-h/texlive-eurosym-doc.json @@ -5,18 +5,6 @@ { "name": "test_texlive-eurosym-doc_function_install", "desc": "Test package installation" - }, - { - "name": "test_texlive-eurosym-doc_function_purge", - "desc": "Test package complete removal" - }, - { - "name": "test_texlive-eurosym-doc_function_check", - "desc": "Check if package is installed" - }, - { - "name": "test_texlive-eurosym-doc_function_doc_access", - "desc": "Verify documentation accessibility" } ] } \ No newline at end of file diff --git a/testcases/function_test/pkg_test/texlive-split-h/texlive-eurosym-doc/test_texlive-eurosym-doc_function_check.sh b/testcases/function_test/pkg_test/texlive-split-h/texlive-eurosym-doc/test_texlive-eurosym-doc_function_check.sh deleted file mode 100644 index 2c2d9a20145..00000000000 --- a/testcases/function_test/pkg_test/texlive-split-h/texlive-eurosym-doc/test_texlive-eurosym-doc_function_check.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-04-03 -# @License : Mulan PSL v2 -# @Desc : Check if package is installed -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - # 检查系统是否已经安装了texlive-eurosym-doc软件包 - LOG_INFO "开始检查texlive-eurosym-doc软件包安装情况" - - # 检查软件包是否已在yum源中 - LOG_INFO "检查yum源中是否存在texlive-eurosym-doc软件包" - dnf list available texlive-eurosym-doc &>/dev/null - if [ $? -ne 0 ]; then - LOG_ERROR "yum源中未找到texlive-eurosym-doc软件包" - exit 255 - fi - - # 检查软件包是否已经安装 - LOG_INFO "检查系统是否已安装texlive-eurosym-doc软件包" - rpm -q texlive-eurosym-doc &>/dev/null - if [ $? -eq 0 ]; then - LOG_INFO "系统已安装texlive-eurosym-doc软件包,保持安装状态" - INSTALLED=1 - else - LOG_INFO "系统未安装texlive-eurosym-doc软件包,将进行安装测试" - INSTALLED=0 - fi - - # 如果未安装,则执行安装测试 - if [ $INSTALLED -eq 0 ]; then - LOG_INFO "开始安装texlive-eurosym-doc软件包" - dnf install -y texlive-eurosym-doc - CHECK_RESULT $? 0 0 "安装texlive-eurosym-doc软件包失败" - - LOG_INFO "验证texlive-eurosym-doc软件包是否安装成功" - rpm -q texlive-eurosym-doc - CHECK_RESULT $? 0 0 "验证texlive-eurosym-doc软件包安装失败" - - LOG_INFO "测试软件包功能检查" - # 检查软件包安装后的相关文件是否存在 - # 这里假设软件包会安装一些文档文件在/usr/share/texlive/texmf-dist/doc目录下 - # 实际测试可能需要根据软件包具体内容调整 - if [ -d "/usr/share/texlive/texmf-dist/doc" ]; then - LOG_INFO "找到texlive文档目录" - # 检查是否有eurosym相关的文档 - find /usr/share/texlive/texmf-dist/doc -name "*eurosym*" -type f | head -5 - CHECK_RESULT $? 0 0 "未找到eurosym相关文档" - fi - - LOG_INFO "开始卸载texlive-eurosym-doc软件包" - dnf remove -y texlive-eurosym-doc - CHECK_RESULT $? 0 0 "卸载texlive-eurosym-doc软件包失败" - - LOG_INFO "验证texlive-eurosym-doc软件包是否已卸载" - rpm -q texlive-eurosym-doc &>/dev/null - if [ $? -eq 0 ]; then - LOG_ERROR "texlive-eurosym-doc软件包卸载失败" - exit 1 - else - LOG_INFO "texlive-eurosym-doc软件包已成功卸载" - fi - else - LOG_INFO "系统已安装texlive-eurosym-doc软件包,跳过安装测试步骤" - LOG_INFO "验证已安装的texlive-eurosym-doc软件包" - rpm -q texlive-eurosym-doc - CHECK_RESULT $? 0 0 "验证已安装的texlive-eurosym-doc软件包失败" - fi - - LOG_INFO "测试完成,环境已恢复" -} - -main "$@" \ No newline at end of file diff --git a/testcases/function_test/pkg_test/texlive-split-h/texlive-eurosym-doc/test_texlive-eurosym-doc_function_doc_access.sh b/testcases/function_test/pkg_test/texlive-split-h/texlive-eurosym-doc/test_texlive-eurosym-doc_function_doc_access.sh deleted file mode 100644 index 6b47e68b81d..00000000000 --- a/testcases/function_test/pkg_test/texlive-split-h/texlive-eurosym-doc/test_texlive-eurosym-doc_function_doc_access.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-04-03 -# @License : Mulan PSL v2 -# @Desc : Verify documentation accessibility -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - LOG_INFO "开始测试文档可访问性" - LOG_INFO "检查是否已安装texlive-eurosym-doc软件包" - rpm -q texlive-eurosym-doc - if [ $? -eq 0 ]; then - LOG_INFO "软件包已安装,标记为已安装状态" - INSTALLED=true - else - LOG_INFO "软件包未安装,标记为未安装状态" - INSTALLED=false - fi - - LOG_INFO "检查yum源中是否存在texlive-eurosym-doc软件包" - dnf list available texlive-eurosym-doc - CHECK_RESULT $? 0 0 "yum源中不存在texlive-eurosym-doc软件包" - if [ $? -ne 0 ]; then - LOG_ERROR "yum源中不存在texlive-eurosym-doc软件包" - exit 255 - fi - - if [ "$INSTALLED" = "false" ]; then - LOG_INFO "开始安装texlive-eurosym-doc软件包" - dnf install -y texlive-eurosym-doc - CHECK_RESULT $? 0 0 "安装texlive-eurosym-doc软件包失败" - if [ $? -ne 0 ]; then - LOG_ERROR "安装texlive-eurosym-doc软件包失败" - exit 255 - fi - LOG_INFO "安装texlive-eurosym-doc软件包成功" - fi - - LOG_INFO "检查文档文件是否存在" - find /usr/share/doc -name "*eurosym*" -type f - CHECK_RESULT $? 0 0 "未找到texlive-eurosym-doc文档文件" - if [ $? -ne 0 ]; then - LOG_ERROR "未找到texlive-eurosym-doc文档文件" - exit 255 - fi - LOG_INFO "找到texlive-eurosym-doc文档文件" - - LOG_INFO "测试文档可读性" - find /usr/share/doc -name "*eurosym*" -type f | head -1 | xargs cat > /dev/null 2>&1 - CHECK_RESULT $? 0 0 "texlive-eurosym-doc文档文件不可读" - if [ $? -ne 0 ]; then - LOG_ERROR "texlive-eurosym-doc文档文件不可读" - exit 255 - fi - LOG_INFO "texlive-eurosym-doc文档文件可读" - - if [ "$INSTALLED" = "false" ]; then - LOG_INFO "清理环境:卸载texlive-eurosym-doc软件包" - dnf remove -y texlive-eurosym-doc - CHECK_RESULT $? 0 0 "卸载texlive-eurosym-doc软件包失败" - if [ $? -ne 0 ]; then - LOG_ERROR "卸载texlive-eurosym-doc软件包失败" - exit 255 - fi - LOG_INFO "卸载texlive-eurosym-doc软件包成功" - else - LOG_INFO "保持软件包安装状态" - fi - - LOG_INFO "测试完成" -} - -main "$@" \ No newline at end of file diff --git a/testcases/function_test/pkg_test/texlive-split-h/texlive-eurosym-doc/test_texlive-eurosym-doc_function_purge.sh b/testcases/function_test/pkg_test/texlive-split-h/texlive-eurosym-doc/test_texlive-eurosym-doc_function_purge.sh deleted file mode 100644 index 267fcd60d66..00000000000 --- a/testcases/function_test/pkg_test/texlive-split-h/texlive-eurosym-doc/test_texlive-eurosym-doc_function_purge.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-04-03 -# @License : Mulan PSL v2 -# @Desc : Test package complete removal -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - # 测试脚本:Test package complete removal - LOG_INFO "开始测试软件包完全移除功能" - - # 步骤1:检查yum源中是否存在texlive-eurosym-doc软件包 - LOG_INFO "步骤1:检查yum源中是否存在texlive-eurosym-doc软件包" - dnf list available texlive-eurosym-doc - if [ $? -ne 0 ]; then - LOG_ERROR "yum源中未找到texlive-eurosym-doc软件包" - exit 255 - fi - - # 步骤2:检查当前环境是否已安装texlive-eurosym-doc软件包 - LOG_INFO "步骤2:检查当前环境是否已安装texlive-eurosym-doc软件包" - dnf list installed texlive-eurosym-doc - if [ $? -eq 0 ]; then - LOG_INFO "检测到texlive-eurosym-doc已安装,标记为已安装状态" - INSTALLED=1 - else - LOG_INFO "未检测到texlive-eurosym-doc安装,标记为未安装状态" - INSTALLED=0 - fi - - # 步骤3:如果未安装,则安装软件包作为测试步骤 - if [ $INSTALLED -eq 0 ]; then - LOG_INFO "步骤3:安装texlive-eurosym-doc软件包" - dnf install -y texlive-eurosym-doc - CHECK_RESULT $? 0 0 "安装texlive-eurosym-doc失败" - fi - - # 步骤4:测试purge参数功能 - LOG_INFO "步骤4:测试purge参数功能" - # 检查dnf命令是否支持purge参数 - dnf --help | grep -q "purge" - if [ $? -ne 0 ]; then - LOG_ERROR "dnf命令不支持purge参数" - exit 255 - fi - - # 执行purge命令移除软件包 - LOG_INFO "执行dnf purge命令移除texlive-eurosym-doc" - dnf purge -y texlive-eurosym-doc - CHECK_RESULT $? 0 0 "执行dnf purge命令失败" - - # 步骤5:验证软件包是否被完全移除 - LOG_INFO "步骤5:验证软件包是否被完全移除" - dnf list installed texlive-eurosym-doc - if [ $? -eq 0 ]; then - LOG_ERROR "软件包未被完全移除" - CHECK_RESULT 1 0 0 "软件包未被完全移除" - else - LOG_INFO "软件包已被完全移除" - CHECK_RESULT 0 0 0 "软件包移除验证失败" - fi - - # 步骤6:清理环境,恢复到之前的状态 - LOG_INFO "步骤6:清理环境,恢复到之前的状态" - if [ $INSTALLED -eq 1 ]; then - # 如果测试前已安装,则重新安装软件包 - LOG_INFO "重新安装texlive-eurosym-doc软件包以恢复环境" - dnf install -y texlive-eurosym-doc - CHECK_RESULT $? 0 0 "重新安装texlive-eurosym-doc失败" - else - # 如果测试前未安装,则确保软件包已被移除 - LOG_INFO "确保texlive-eurosym-doc软件包已被移除" - dnf remove -y texlive-eurosym-doc 2>/dev/null - # 不检查结果,因为软件包可能已被移除 - fi - - # 步骤7:最终验证环境状态 - LOG_INFO "步骤7:最终验证环境状态" - if [ $INSTALLED -eq 1 ]; then - dnf list installed texlive-eurosym-doc - CHECK_RESULT $? 0 0 "环境恢复失败,texlive-eurosym-doc未正确安装" - LOG_INFO "环境已恢复:texlive-eurosym-doc处于安装状态" - else - dnf list installed texlive-eurosym-doc - if [ $? -eq 0 ]; then - LOG_ERROR "环境恢复失败,texlive-eurosym-doc未被移除" - CHECK_RESULT 1 0 0 "环境恢复失败" - else - LOG_INFO "环境已恢复:texlive-eurosym-doc处于未安装状态" - CHECK_RESULT 0 0 0 "环境恢复验证失败" - fi - fi - - LOG_INFO "测试完成:软件包完全移除功能测试通过" -} - -main "$@" \ No newline at end of file From b97161fd4267256e946f72324ed70f47ceef7aee Mon Sep 17 00:00:00 2001 From: honghua Date: Sat, 18 Apr 2026 17:05:20 +0800 Subject: [PATCH 10/17] update testcase for testsuite llvm-toolset-19-libcxx-static --- .../llvm-toolset-19-libcxx-static.json | 4 - ...m-toolset-19-libcxx-static_compile_link.sh | 88 ------------------- 2 files changed, 92 deletions(-) delete mode 100644 testcases/function_test/pkg_test/llvm-toolset/llvm-toolset-19-libcxx-static/test_llvm-toolset-19-libcxx-static_compile_link.sh diff --git a/suite2cases/function_test/pkg_test/llvm-toolset/llvm-toolset-19-libcxx-static.json b/suite2cases/function_test/pkg_test/llvm-toolset/llvm-toolset-19-libcxx-static.json index b1a5ec847a7..954d1545078 100644 --- a/suite2cases/function_test/pkg_test/llvm-toolset/llvm-toolset-19-libcxx-static.json +++ b/suite2cases/function_test/pkg_test/llvm-toolset/llvm-toolset-19-libcxx-static.json @@ -17,10 +17,6 @@ { "name": "test_llvm-toolset-19-libcxx-static_lib_exists", "desc": "Test the existence and basic integrity of the static libc++ library files (e.g., libc++.a, libc++abi.a) provided by the package." - }, - { - "name": "test_llvm-toolset-19-libcxx-static_compile_link", - "desc": "Test compiling and linking a simple C++ program against the static libc++ library to verify usability." } ] } \ No newline at end of file diff --git a/testcases/function_test/pkg_test/llvm-toolset/llvm-toolset-19-libcxx-static/test_llvm-toolset-19-libcxx-static_compile_link.sh b/testcases/function_test/pkg_test/llvm-toolset/llvm-toolset-19-libcxx-static/test_llvm-toolset-19-libcxx-static_compile_link.sh deleted file mode 100644 index a08eef12b28..00000000000 --- a/testcases/function_test/pkg_test/llvm-toolset/llvm-toolset-19-libcxx-static/test_llvm-toolset-19-libcxx-static_compile_link.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-26 -# @License : Mulan PSL v2 -# @Desc : Test compiling and linking a simple C++ program against the static libc++ library to verify usability. -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - LOG_INFO "检查yum源中是否存在llvm-toolset-19-libcxx-static软件包" - dnf list available llvm-toolset-19-libcxx-static > /dev/null 2>&1 - CHECK_RESULT $? 0 0 "yum源中未找到llvm-toolset-19-libcxx-static软件包" - if [ $? -ne 0 ]; then - LOG_ERROR "yum源中未找到llvm-toolset-19-libcxx-static软件包" - exit 255 - fi - - LOG_INFO "检查当前环境是否已安装llvm-toolset-19-libcxx-static" - rpm -q llvm-toolset-19-libcxx-static > /dev/null 2>&1 - if [ $? -eq 0 ]; then - LOG_INFO "软件包已安装,标记为已安装状态" - INSTALLED=1 - else - LOG_INFO "软件包未安装,标记为未安装状态" - INSTALLED=0 - fi - - if [ $INSTALLED -eq 0 ]; then - LOG_INFO "开始安装llvm-toolset-19-libcxx-static软件包" - dnf install -y llvm-toolset-19-libcxx-static - CHECK_RESULT $? 0 0 "安装llvm-toolset-19-libcxx-static软件包失败" - fi - - LOG_INFO "验证clang++命令是否可用,并检查其是否支持-static-libstdc++参数" - clang++ --help | grep -q "\-static-libstdc++" - CHECK_RESULT $? 0 0 "clang++命令不支持-static-libstdc++参数" - if [ $? -ne 0 ]; then - LOG_ERROR "clang++命令不支持-static-libstdc++参数" - exit 255 - fi - - LOG_INFO "创建一个简单的C++测试程序源代码文件test_static.cpp" - cat > test_static.cpp << "EOF" - #include - int main() { - std::cout << "Hello, static libc++!" << std::endl; - return 0; - } - EOF - CHECK_RESULT $? 0 0 "创建C++测试程序源代码文件失败" - - LOG_INFO "使用clang++和静态libc++库编译测试程序" - clang++ -stdlib=libc++ -static-libstdc++ -o test_static_program test_static.cpp - CHECK_RESULT $? 0 0 "使用静态libc++库编译测试程序失败" - - LOG_INFO "运行编译生成的测试程序" - ./test_static_program - CHECK_RESULT $? 0 0 "运行测试程序失败" - - LOG_INFO "清理测试过程中生成的临时文件" - rm -f test_static.cpp test_static_program - CHECK_RESULT $? 0 0 "清理临时文件失败" - - if [ $INSTALLED -eq 0 ]; then - LOG_INFO "测试完成,卸载之前安装的llvm-toolset-19-libcxx-static软件包" - dnf remove -y llvm-toolset-19-libcxx-static - CHECK_RESULT $? 0 0 "卸载llvm-toolset-19-libcxx-static软件包失败" - else - LOG_INFO "测试完成,保持原有安装状态" - fi - - LOG_INFO "测试脚本执行完毕" -} - -main "$@" \ No newline at end of file From f4745b4e9f45916932e3a1bb704b0b04bc54f1a6 Mon Sep 17 00:00:00 2001 From: honghua Date: Sat, 18 Apr 2026 17:06:11 +0800 Subject: [PATCH 11/17] update testcase for testsuite maven-plugin-build-helper-help --- .../maven-plugin-build-helper-help.json | 42 ---------- ...plugin-build-helper-help_function_build.sh | 58 -------------- ...-plugin-build-helper-help_function_goal.sh | 80 ------------------- ...-plugin-build-helper-help_function_help.sh | 68 ---------------- 4 files changed, 248 deletions(-) delete mode 100644 suite2cases/function_test/pkg_test/maven-plugin-build-helper/maven-plugin-build-helper-help.json delete mode 100644 testcases/function_test/pkg_test/maven-plugin-build-helper/maven-plugin-build-helper-help/test_maven-plugin-build-helper-help_function_build.sh delete mode 100644 testcases/function_test/pkg_test/maven-plugin-build-helper/maven-plugin-build-helper-help/test_maven-plugin-build-helper-help_function_goal.sh delete mode 100644 testcases/function_test/pkg_test/maven-plugin-build-helper/maven-plugin-build-helper-help/test_maven-plugin-build-helper-help_function_help.sh diff --git a/suite2cases/function_test/pkg_test/maven-plugin-build-helper/maven-plugin-build-helper-help.json b/suite2cases/function_test/pkg_test/maven-plugin-build-helper/maven-plugin-build-helper-help.json deleted file mode 100644 index a82794d4b29..00000000000 --- a/suite2cases/function_test/pkg_test/maven-plugin-build-helper/maven-plugin-build-helper-help.json +++ /dev/null @@ -1,42 +0,0 @@ -{ - "path": "$OET_PATH/testcases/function_test/pkg_test/maven-plugin-build-helper/maven-plugin-build-helper-help", - "machine num": 1, - "cases": [ - { - "name": "test_maven-plugin-build-helper-help_function_build", - "desc": "Test the build functionality of the plugin" - }, - { - "name": "test_maven-plugin-build-helper-help_function_config", - "desc": "Test the configuration functionality of the plugin" - }, - { - "name": "test_maven-plugin-build-helper-help_function_validate", - "desc": "Test the validation functionality of the plugin" - }, - { - "name": "test_maven-plugin-build-helper-help_function_execute", - "desc": "Test the execution functionality of the plugin" - }, - { - "name": "test_maven-plugin-build-helper-help_function_install", - "desc": "Test the installation of the maven-plugin-build-helper-help package" - }, - { - "name": "test_maven-plugin-build-helper-help_function_uninstall", - "desc": "Test the uninstallation of the maven-plugin-build-helper-help package" - }, - { - "name": "test_maven-plugin-build-helper-help_function_version", - "desc": "Test checking the version of the installed package" - }, - { - "name": "test_maven-plugin-build-helper-help_function_help", - "desc": "Test displaying the help or usage information for the plugin" - }, - { - "name": "test_maven-plugin-build-helper-help_function_goal", - "desc": "Test listing available plugin goals" - } - ] -} \ No newline at end of file diff --git a/testcases/function_test/pkg_test/maven-plugin-build-helper/maven-plugin-build-helper-help/test_maven-plugin-build-helper-help_function_build.sh b/testcases/function_test/pkg_test/maven-plugin-build-helper/maven-plugin-build-helper-help/test_maven-plugin-build-helper-help_function_build.sh deleted file mode 100644 index 7a5dee75284..00000000000 --- a/testcases/function_test/pkg_test/maven-plugin-build-helper/maven-plugin-build-helper-help/test_maven-plugin-build-helper-help_function_build.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-11-29 -# @License : Mulan PSL v2 -# @Desc : Test the build functionality of the plugin -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - - LOG_INFO "开始测试插件构建功能" - - # 检查是否已安装指定软件包 - LOG_INFO "检查软件包是否已安装" - if ! dnf list installed maven-plugin-build-helper &>/dev/null; then - LOG_INFO "软件包未安装,准备安装" - if ! dnf list available maven-plugin-build-helper &>/dev/null; then - LOG_ERROR "yum源中未找到软件包maven-plugin-build-helper" - exit 255 - fi - dnf install -y maven-plugin-build-helper - CHECK_RESULT $? 0 0 "安装软件包失败" - INSTALLED=1 - else - LOG_INFO "软件包已安装,跳过安装步骤" - INSTALLED=0 - fi - - # 测试构建功能 - LOG_INFO "测试插件构建功能" - mvn build-helper:help -Ddetail=true > /dev/null 2>&1 - CHECK_RESULT $? 0 0 "插件构建功能测试失败" - - # 清理环境 - if [ $INSTALLED -eq 1 ]; then - LOG_INFO "清理环境,卸载软件包" - dnf remove -y maven-plugin-build-helper - CHECK_RESULT $? 0 0 "卸载软件包失败" - fi - - LOG_INFO "测试完成,环境已恢复" - -} - -main "$@" \ No newline at end of file diff --git a/testcases/function_test/pkg_test/maven-plugin-build-helper/maven-plugin-build-helper-help/test_maven-plugin-build-helper-help_function_goal.sh b/testcases/function_test/pkg_test/maven-plugin-build-helper/maven-plugin-build-helper-help/test_maven-plugin-build-helper-help_function_goal.sh deleted file mode 100644 index 753076a8bc9..00000000000 --- a/testcases/function_test/pkg_test/maven-plugin-build-helper/maven-plugin-build-helper-help/test_maven-plugin-build-helper-help_function_goal.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-08 -# @License : Mulan PSL v2 -# @Desc : Test listing available plugin goals -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - LOG_INFO "开始测试:Test listing available plugin goals" - - # 检查是否已安装maven-plugin-build-helper插件 - LOG_INFO "步骤1:检查maven-plugin-build-helper插件是否已安装" - if command -v mvn >/dev/null 2>&1; then - LOG_INFO "Maven已安装,继续检查插件" - if mvn help:describe -Dplugin=org.codehaus.mojo:build-helper-maven-plugin -Ddetail >/dev/null 2>&1; then - LOG_INFO "maven-plugin-build-helper插件已安装" - INSTALLED=true - else - LOG_INFO "maven-plugin-build-helper插件未安装" - INSTALLED=false - fi - else - LOG_INFO "Maven未安装,将进行安装" - INSTALLED=false - fi - - # 如果未安装,则安装Maven和插件 - if [ "$INSTALLED" = false ]; then - LOG_INFO "步骤2:安装Maven" - # 检查yum源中是否有maven - if ! dnf list available maven >/dev/null 2>&1; then - LOG_ERROR "yum源中未找到maven软件包" - exit 255 - fi - dnf install -y maven - CHECK_RESULT $? 0 0 "安装Maven失败" - - LOG_INFO "步骤3:安装maven-plugin-build-helper插件" - mvn org.apache.maven.plugins:maven-plugin-plugin:descriptor - CHECK_RESULT $? 0 0 "安装maven-plugin-build-helper插件失败" - fi - - # 测试列出可用插件目标 - LOG_INFO "步骤4:执行mvn help:describe命令列出插件目标" - mvn help:describe -Dplugin=org.codehaus.mojo:build-helper-maven-plugin -Ddetail - CHECK_RESULT $? 0 0 "执行mvn help:describe命令失败" - - # 检查插件目标列表是否包含预期的目标 - LOG_INFO "步骤5:验证插件目标列表" - mvn help:describe -Dplugin=org.codehaus.mojo:build-helper-maven-plugin -Ddetail | grep -q "add-source" - CHECK_RESULT $? 0 0 "插件目标列表中未找到"add-source"目标" - - # 环境清理 - LOG_INFO "步骤6:清理测试环境" - if [ "$INSTALLED" = false ]; then - LOG_INFO "卸载Maven" - dnf remove -y maven - CHECK_RESULT $? 0 0 "卸载Maven失败" - else - LOG_INFO "测试开始前已安装,保持安装状态" - fi - - LOG_INFO "测试完成:Test listing available plugin goals" -} - -main "$@" \ No newline at end of file diff --git a/testcases/function_test/pkg_test/maven-plugin-build-helper/maven-plugin-build-helper-help/test_maven-plugin-build-helper-help_function_help.sh b/testcases/function_test/pkg_test/maven-plugin-build-helper/maven-plugin-build-helper-help/test_maven-plugin-build-helper-help_function_help.sh deleted file mode 100644 index 11773053422..00000000000 --- a/testcases/function_test/pkg_test/maven-plugin-build-helper/maven-plugin-build-helper-help/test_maven-plugin-build-helper-help_function_help.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 : 2026-03-08 -# @License : Mulan PSL v2 -# @Desc : Test displaying the help or usage information for the plugin -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - # 检查是否已经安装了maven-plugin-build-helper-help软件包 - LOG_INFO "检查maven-plugin-build-helper-help软件包是否已安装" - rpm -q maven-plugin-build-helper-help > /dev/null 2>&1 - if [ $? -eq 0 ]; then - LOG_INFO "maven-plugin-build-helper-help软件包已安装,测试完成后将保持安装状态" - INSTALLED_BEFORE=true - else - LOG_INFO "maven-plugin-build-helper-help软件包未安装,将在测试前安装并在测试后卸载" - INSTALLED_BEFORE=false - fi - - # 检查yum源中是否有maven-plugin-build-helper-help软件包 - LOG_INFO "检查yum源中是否存在maven-plugin-build-helper-help软件包" - dnf list available maven-plugin-build-helper-help > /dev/null 2>&1 - if [ $? -ne 0 ]; then - LOG_ERROR "yum源中未找到maven-plugin-build-helper-help软件包" - exit 255 - fi - - # 如果未安装,则安装软件包 - if [ "$INSTALLED_BEFORE" = false ]; then - LOG_INFO "开始安装maven-plugin-build-helper-help软件包" - dnf install -y maven-plugin-build-helper-help - CHECK_RESULT $? 0 0 "安装maven-plugin-build-helper-help软件包失败" - fi - - # 测试显示插件的帮助或使用信息 - LOG_INFO "测试显示maven-plugin-build-helper-help插件的帮助信息" - mvn build-helper:help -Ddetail=true > /dev/null 2>&1 - if [ $? -ne 0 ]; then - LOG_ERROR "maven-plugin-build-helper-help插件不支持-help参数或命令执行失败" - exit 255 - fi - CHECK_RESULT $? 0 0 "执行maven-plugin-build-helper-help插件的帮助命令失败" - - # 清理环境,恢复到之前的状态 - if [ "$INSTALLED_BEFORE" = false ]; then - LOG_INFO "卸载maven-plugin-build-helper-help软件包" - dnf remove -y maven-plugin-build-helper-help - CHECK_RESULT $? 0 0 "卸载maven-plugin-build-helper-help软件包失败" - fi - - LOG_INFO "测试完成,环境已恢复到初始状态" -} - -main "$@" \ No newline at end of file From b4ca8d9e48ed0d6eba68f5fd66971bcc12593ee6 Mon Sep 17 00:00:00 2001 From: honghua Date: Sat, 18 Apr 2026 17:13:23 +0800 Subject: [PATCH 12/17] update testcase for testsuite maven-jarsigner-plugin-javadoc --- .../maven-jarsigner-plugin-javadoc.json | 4 -- ...-jarsigner-plugin-javadoc_function_sign.sh | 63 ------------------- 2 files changed, 67 deletions(-) delete mode 100644 testcases/function_test/pkg_test/maven-jarsigner-plugin/maven-jarsigner-plugin-javadoc/test_maven-jarsigner-plugin-javadoc_function_sign.sh diff --git a/suite2cases/function_test/pkg_test/maven-jarsigner-plugin/maven-jarsigner-plugin-javadoc.json b/suite2cases/function_test/pkg_test/maven-jarsigner-plugin/maven-jarsigner-plugin-javadoc.json index 185bfcc7fe3..5f18f2f717d 100644 --- a/suite2cases/function_test/pkg_test/maven-jarsigner-plugin/maven-jarsigner-plugin-javadoc.json +++ b/suite2cases/function_test/pkg_test/maven-jarsigner-plugin/maven-jarsigner-plugin-javadoc.json @@ -6,10 +6,6 @@ "name": "test_maven-jarsigner-plugin-javadoc_install", "desc": "测试maven-jarsigner-plugin-javadoc软件包的安装功能", "machine num": 1 - }, - { - "name": "test_maven-jarsigner-plugin-javadoc_function_sign", - "desc": "测试maven-jarsigner-plugin-javadoc软件包的签名功能" } ] } \ No newline at end of file diff --git a/testcases/function_test/pkg_test/maven-jarsigner-plugin/maven-jarsigner-plugin-javadoc/test_maven-jarsigner-plugin-javadoc_function_sign.sh b/testcases/function_test/pkg_test/maven-jarsigner-plugin/maven-jarsigner-plugin-javadoc/test_maven-jarsigner-plugin-javadoc_function_sign.sh deleted file mode 100644 index 0c64d82fe2c..00000000000 --- a/testcases/function_test/pkg_test/maven-jarsigner-plugin/maven-jarsigner-plugin-javadoc/test_maven-jarsigner-plugin-javadoc_function_sign.sh +++ /dev/null @@ -1,63 +0,0 @@ -#!/usr/bin/bash - -# Copyright (c) 2024 ISCAS .ALL rights reserved. -# This program is licensed under Mulan PSL v2. -# You can use it according to the terms and conditions of the Mulan PSL v2. -# http://license.coscl.org.cn/MulanPSL2 -# THIS PROGRAM IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, -# EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, -# MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. -# See the Mulan PSL v2 for more details. - -# ############################################# -# @Author : honghua -# @Contact : honghua@iscas.ac.cn -# @Date : 2025-12-10 -# @License : Mulan PSL v2 -# @Desc : 测试maven-jarsigner-plugin-javadoc软件包的签名功能 -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - # 测试脚本:test_maven-jarsigner-plugin-javadoc_function_sign - - LOG_INFO "开始测试 maven-jarsigner-plugin-javadoc 软件包的签名功能" - - # 检查 yum 源中是否存在 maven-jarsigner-plugin-javadoc 软件包 - LOG_INFO "检查 yum 源中是否存在 maven-jarsigner-plugin-javadoc 软件包" - dnf list available maven-jarsigner-plugin-javadoc > /dev/null 2>&1 - if [ $? -ne 0 ]; then - LOG_ERROR "yum 源中未找到 maven-jarsigner-plugin-javadoc 软件包" - exit 255 - fi - - # 检查是否已安装 maven-jarsigner-plugin-javadoc - LOG_INFO "检查是否已安装 maven-jarsigner-plugin-javadoc" - rpm -q maven-jarsigner-plugin-javadoc > /dev/null 2>&1 - if [ $? -eq 0 ]; then - LOG_INFO "maven-jarsigner-plugin-javadoc 已安装,跳过安装步骤" - INSTALLED=true - else - LOG_INFO "maven-jarsigner-plugin-javadoc 未安装,开始安装" - dnf install -y maven-jarsigner-plugin-javadoc > /dev/null 2>&1 - CHECK_RESULT $? 0 0 "安装 maven-jarsigner-plugin-javadoc 失败" - INSTALLED=false - fi - - # 测试签名功能 - LOG_INFO "测试 maven-jarsigner-plugin-javadoc 的签名功能" - jarsigner -verify -verbose -certs /usr/share/java/maven-jarsigner-plugin/javadoc.jar > /dev/null 2>&1 - CHECK_RESULT $? 0 0 "签名验证失败" - - # 清理环境:如果脚本开始时未安装,则卸载软件包 - if [ "$INSTALLED" = false ]; then - LOG_INFO "卸载 maven-jarsigner-plugin-javadoc" - dnf remove -y maven-jarsigner-plugin-javadoc > /dev/null 2>&1 - CHECK_RESULT $? 0 0 "卸载 maven-jarsigner-plugin-javadoc失败" - fi - - LOG_INFO "测试 maven-jarsigner-plugin-javadoc的签名功能完成" -} - -main "$@" \ No newline at end of file From 32749e7b8b7682b7b0790642a3051e64b4882737 Mon Sep 17 00:00:00 2001 From: honghua Date: Sat, 18 Apr 2026 17:13:44 +0800 Subject: [PATCH 13/17] update testcase for testsuite texlive-datetime2-slovene-doc --- .../texlive-datetime2-slovene-doc.json | 30 --------- ...e-datetime2-slovene-doc_function_format.sh | 63 ------------------- 2 files changed, 93 deletions(-) delete mode 100644 suite2cases/function_test/pkg_test/texlive-split-f/texlive-datetime2-slovene-doc.json delete mode 100644 testcases/function_test/pkg_test/texlive-split-f/texlive-datetime2-slovene-doc/test_texlive-datetime2-slovene-doc_function_format.sh diff --git a/suite2cases/function_test/pkg_test/texlive-split-f/texlive-datetime2-slovene-doc.json b/suite2cases/function_test/pkg_test/texlive-split-f/texlive-datetime2-slovene-doc.json deleted file mode 100644 index 5d2b33d6e2e..00000000000 --- a/suite2cases/function_test/pkg_test/texlive-split-f/texlive-datetime2-slovene-doc.json +++ /dev/null @@ -1,30 +0,0 @@ -{ - "path": "$OET_PATH/testcases/function_test/pkg_test/texlive-split-f/texlive-datetime2-slovene-doc", - "machine num": 1, - "cases": [ - { - "name": "test_texlive-datetime2-slovene-doc_function_format", - "desc": "Test date formatting" - }, - { - "name": "test_texlive-datetime2-slovene-doc_function_install", - "desc": "Test package installation" - }, - { - "name": "test_texlive-datetime2-slovene-doc_function_uninstall", - "desc": "Test package removal" - }, - { - "name": "test_texlive-datetime2-slovene-doc_function_verify_installed", - "desc": "Check package is installed" - }, - { - "name": "test_texlive-datetime2-slovene-doc_function_show_doc", - "desc": "Verify documentation files exist" - }, - { - "name": "test_texlive-datetime2-slovene-doc_function_list_files", - "desc": "List all package files" - } - ] -} \ No newline at end of file diff --git a/testcases/function_test/pkg_test/texlive-split-f/texlive-datetime2-slovene-doc/test_texlive-datetime2-slovene-doc_function_format.sh b/testcases/function_test/pkg_test/texlive-split-f/texlive-datetime2-slovene-doc/test_texlive-datetime2-slovene-doc_function_format.sh deleted file mode 100644 index 3fab190722f..00000000000 --- a/testcases/function_test/pkg_test/texlive-split-f/texlive-datetime2-slovene-doc/test_texlive-datetime2-slovene-doc_function_format.sh +++ /dev/null @@ -1,63 +0,0 @@ -#!/usr/bin/bash - -# Copyright (c) 2024 ISCAS .ALL rights reserved. -# This program is licensed under Mulan PSL v2. -# You can use it according to the terms and conditions of the Mulan PSL v2. -# http://license.coscl.org.cn/MulanPSL2 -# THIS PROGRAM IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, -# EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, -# MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. -# See the Mulan PSL v2 for more details. - -# ############################################# -# @Author : honghua -# @Contact : honghua@iscas.ac.cn -# @Date : 2025-11-26 -# @License : Mulan PSL v2 -# @Desc : Test date formatting -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - # 检查是否已安装texlive-datetime2-slovene-doc - if dnf list installed texlive-datetime2-slovene-doc &>/dev/null; then - LOG_INFO "环境已安装texlive-datetime2-slovene-doc,脚本结束时将保持安装状态" - INSTALLED=true - else - LOG_INFO "环境未安装texlive-datetime2-slovene-doc,将在测试结束后卸载" - INSTALLED=false - fi - - # 检查yum源中是否有texlive-datetime2-slovene-doc - LOG_INFO "检查yum源中是否有texlive-datetime2-slovene-doc" - if ! dnf list available texlive-datetime2-slovene-doc &>/dev/null; then - LOG_ERROR "yum源中未找到texlive-datetime2-slovene-doc" - exit 255 - fi - - # 安装texlive-datetime2-slovene-doc - if [ "$INSTALLED" = false ]; then - LOG_INFO "安装texlive-datetime2-slovene-doc" - dnf install -y texlive-datetime2-slovene-doc - CHECK_RESULT $? 0 0 "安装texlive-datetime2-slovene-doc失败" - fi - - # 测试日期格式化功能 - LOG_INFO "测试日期格式化功能" - TEST_OUTPUT=$(date +"%Y-%m-%d") - EXPECTED_OUTPUT=$(date +"%Y-%m-%d") - CHECK_RESULT $? 0 0 "日期格式化命令执行失败" - if [ "$TEST_OUTPUT" != "$EXPECTED_OUTPUT" ]; then - LOG_ERROR "日期格式化结果不符合预期" - exit 1 - fi - - # 清理环境 - if [ "$INSTALLED" = false ]; then - LOG_INFO "卸载texlive-datetime2-slovene-doc" - dnf remove -y texlive-datetime2-slovene-doc - CHECK_RESULT $? 0 0 "卸载texlive -} - -main "$@" \ No newline at end of file From 08c874b6f616853248072462f24401d34e53c312 Mon Sep 17 00:00:00 2001 From: honghua Date: Sat, 18 Apr 2026 17:15:22 +0800 Subject: [PATCH 14/17] update testcase for testsuite texlive-paper --- .../texlive-split-r/texlive-paper.json | 8 -- .../test_texlate-paper_function_usage.sh | 82 ---------------- .../test_texlive-paper_function_check.sh | 97 ------------------- 3 files changed, 187 deletions(-) delete mode 100644 testcases/function_test/pkg_test/texlive-split-r/texlive-paper/test_texlate-paper_function_usage.sh delete mode 100644 testcases/function_test/pkg_test/texlive-split-r/texlive-paper/test_texlive-paper_function_check.sh diff --git a/suite2cases/function_test/pkg_test/texlive-split-r/texlive-paper.json b/suite2cases/function_test/pkg_test/texlive-split-r/texlive-paper.json index bb688621ffe..663b25117d0 100644 --- a/suite2cases/function_test/pkg_test/texlive-split-r/texlive-paper.json +++ b/suite2cases/function_test/pkg_test/texlive-split-r/texlive-paper.json @@ -11,14 +11,6 @@ "name": "test_texlive-paper_function_install", "desc": "测试 texlive-paper 软件包的安装功能" }, - { - "name": "test_texlive-paper_function_check", - "desc": "测试 texlive-paper 软件包是否成功安装" - }, - { - "name": "test_texlate-paper_function_usage", - "desc": "测试在 LaTeX 文档中调用 paper 包" - }, { "name": "test_texlive-paper_function_uninstall", "desc": "测试 texlive-paper 软件包的卸载功能" diff --git a/testcases/function_test/pkg_test/texlive-split-r/texlive-paper/test_texlate-paper_function_usage.sh b/testcases/function_test/pkg_test/texlive-split-r/texlive-paper/test_texlate-paper_function_usage.sh deleted file mode 100644 index 06fbe598415..00000000000 --- a/testcases/function_test/pkg_test/texlive-split-r/texlive-paper/test_texlate-paper_function_usage.sh +++ /dev/null @@ -1,82 +0,0 @@ -#!/usr/bin/bash - -# Copyright (c) 2024 ISCAS .ALL rights reserved. -# This program is licensed under Mulan PSL v2. -# You can use it according to the terms and conditions of the Mulan PSL v2. -# http://license.coscl.org.cn/MulanPSL2 -# THIS PROGRAM IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, -# EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, -# MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. -# See the Mulan PSL v2 for more details. - -# ############################################# -# @Author : honghua -# @Contact : honghua@iscas.ac.cn -# @Date : 2026-03-02 -# @License : Mulan PSL v2 -# @Desc : 测试在 LaTeX 文档中调用 paper 包 -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - LOG_INFO "开始测试:在 LaTeX 文档中调用 paper 包" - - LOG_INFO "步骤1:检查系统中是否已安装 texlive-paper 软件包" - dnf list installed texlive-paper > /dev/null 2>&1 - if [ $? -eq 0 ]; then - LOG_INFO "texlive-paper 已安装,标记为已安装状态" - INSTALLED=1 - else - LOG_INFO "texlive-paper 未安装,标记为未安装状态" - INSTALLED=0 - fi - - LOG_INFO "步骤2:检查 yum 源中是否有 texlive-paper 软件包" - dnf search texlive-paper > /dev/null 2>&1 - if [ $? -ne 0 ]; then - LOG_ERROR "yum 源中未找到 texlive-paper 软件包" - exit 255 - fi - - if [ $INSTALLED -eq 0 ]; then - LOG_INFO "步骤3:安装 texlive-paper 软件包" - dnf install -y texlive-paper - CHECK_RESULT $? 0 0 "安装 texlive-paper 失败" - fi - - LOG_INFO "步骤4:创建测试 LaTeX 文档" - cat > test_paper.tex << "EOF" - \documentclass{article} - \usepackage{paper} - \begin{document} - Test document using paper package. - \end{document} - EOF - CHECK_RESULT $? 0 0 "创建测试 LaTeX 文档失败" - - LOG_INFO "步骤5:编译 LaTeX 文档" - pdflatex test_paper.tex > /dev/null 2>&1 - CHECK_RESULT $? 0 0 "编译 LaTeX 文档失败" - - LOG_INFO "步骤6:验证生成的 PDF 文件" - if [ -f test_paper.pdf ]; then - LOG_INFO "PDF 文件生成成功" - else - LOG_ERROR "PDF 文件生成失败" - exit 1 - fi - - LOG_INFO "步骤7:清理生成的临时文件" - rm -f test_paper.tex test_paper.pdf test_paper.aux test_paper.log test_paper.out - - if [ $INSTALLED -eq 0 ]; then - LOG_INFO "步骤8:卸载 texlive-paper 软件包" - dnf remove -y texlive-paper - CHECK_RESULT $? 0 0 "卸载 texlive-paper 失败" - fi - - LOG_INFO "测试完成:在 LaTeX 文档中调用 paper 包" -} - -main "$@" \ No newline at end of file diff --git a/testcases/function_test/pkg_test/texlive-split-r/texlive-paper/test_texlive-paper_function_check.sh b/testcases/function_test/pkg_test/texlive-split-r/texlive-paper/test_texlive-paper_function_check.sh deleted file mode 100644 index ec8fd58e782..00000000000 --- a/testcases/function_test/pkg_test/texlive-split-r/texlive-paper/test_texlive-paper_function_check.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-02 -# @License : Mulan PSL v2 -# @Desc : 测试 texlive-paper 软件包是否成功安装 -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - set -e - - LOG_INFO "开始测试 texlive-paper 软件包功能" - - # 检查软件包是否已在yum源中 - LOG_INFO "检查yum源中是否存在 texlive-paper 软件包" - dnf list available texlive-paper &>/dev/null - if [ $? -ne 0 ]; then - LOG_ERROR "yum源中未找到 texlive-paper 软件包" - exit 255 - fi - - # 检查当前是否已安装 - LOG_INFO "检查 texlive-paper 是否已安装" - rpm -q texlive-paper &>/dev/null - already_installed=$? - - if [ $already_installed -eq 0 ]; then - LOG_INFO "texlive-paper 已安装,测试后将保持安装状态" - need_cleanup=0 - else - LOG_INFO "texlive-paper 未安装,开始安装" - need_cleanup=1 - dnf install -y texlive-paper - CHECK_RESULT $? 0 0 "安装 texlive-paper 失败" - fi - - # 测试基本功能 - LOG_INFO "测试 texlive-paper 基本功能" - - # 检查texlive-paper提供的命令或文件 - LOG_INFO "检查texlive-paper提供的文件" - rpm -ql texlive-paper | head -5 - CHECK_RESULT $? 0 0 "获取texlive-paper文件列表失败" - - # 检查是否有paper相关的tex文件 - LOG_INFO "检查paper相关的tex文件" - texmf_path=$(kpsewhich -var-value TEXMFMAIN) - if [ -n "$texmf_path" ]; then - find $texmf_path -name "*paper*" -type f | head -5 - CHECK_RESULT $? 0 0 "查找paper相关文件失败" - else - LOG_INFO "未找到TEXMFMAIN路径,跳过文件检查" - fi - - # 测试paper包在LaTeX中的使用 - LOG_INFO "测试paper包在LaTeX中的基本功能" - TEST_TEX_FILE=$(mktemp test_paper.XXXXXX.tex) - cat > $TEST_TEX_FILE << "EOF" - \documentclass{article} - \usepackage{paper} - \begin{document} - Test paper package. - \end{document} - EOF - - # 尝试编译(不要求成功,但要求能处理paper包) - pdflatex -halt-on-error -interaction=nonstopmode $TEST_TEX_FILE &>/dev/null || true - rm -f ${TEST_TEX_FILE%.tex}.* $TEST_TEX_FILE - - LOG_INFO "基本功能测试完成" - - # 环境清理 - if [ $need_cleanup -eq 1 ]; then - LOG_INFO "清理测试环境,卸载 texlive-paper" - dnf remove -y texlive-paper - CHECK_RESULT $? 0 0 "卸载 texlive-paper 失败" - else - LOG_INFO "保持 texlive-paper 安装状态" - fi - - LOG_INFO "texlive-paper 功能测试完成" -} - -main "$@" \ No newline at end of file From 2e0dd62d93c82fcac6144e10f5766c56fdc26bc4 Mon Sep 17 00:00:00 2001 From: honghua Date: Sat, 18 Apr 2026 17:16:45 +0800 Subject: [PATCH 15/17] update testcase for testsuite python3-nox --- .../pkg_test/python-nox/python3-nox.json | 44 ------- .../test_python3-nox_function_nox_env.sh | 66 ---------- .../python3-nox/test_python3-nox_nox_h.sh | 60 --------- .../python3-nox/test_python3-nox_nox_json.sh | 74 ----------- .../python3-nox/test_python3-nox_nox_k.sh | 64 ---------- .../python3-nox/test_python3-nox_nox_l.sh | 61 --------- .../python3-nox/test_python3-nox_nox_p.sh | 64 ---------- .../python3-nox/test_python3-nox_nox_s.sh | 59 --------- .../python3-nox/test_python3-nox_nox_t.sh | 118 ------------------ .../python3-nox/test_python3-nox_nox_ts.sh | 70 ----------- .../python3-nox/test_python3-nox_nox_v.sh | 64 ---------- .../test_python3-nox_tox-to-nox.sh | 69 ---------- 12 files changed, 813 deletions(-) delete mode 100644 testcases/function_test/pkg_test/python-nox/python3-nox/test_python3-nox_function_nox_env.sh delete mode 100644 testcases/function_test/pkg_test/python-nox/python3-nox/test_python3-nox_nox_h.sh delete mode 100644 testcases/function_test/pkg_test/python-nox/python3-nox/test_python3-nox_nox_json.sh delete mode 100644 testcases/function_test/pkg_test/python-nox/python3-nox/test_python3-nox_nox_k.sh delete mode 100644 testcases/function_test/pkg_test/python-nox/python3-nox/test_python3-nox_nox_l.sh delete mode 100644 testcases/function_test/pkg_test/python-nox/python3-nox/test_python3-nox_nox_p.sh delete mode 100644 testcases/function_test/pkg_test/python-nox/python3-nox/test_python3-nox_nox_s.sh delete mode 100644 testcases/function_test/pkg_test/python-nox/python3-nox/test_python3-nox_nox_t.sh delete mode 100644 testcases/function_test/pkg_test/python-nox/python3-nox/test_python3-nox_nox_ts.sh delete mode 100644 testcases/function_test/pkg_test/python-nox/python3-nox/test_python3-nox_nox_v.sh delete mode 100644 testcases/function_test/pkg_test/python-nox/python3-nox/test_python3-nox_tox-to-nox.sh diff --git a/suite2cases/function_test/pkg_test/python-nox/python3-nox.json b/suite2cases/function_test/pkg_test/python-nox/python3-nox.json index ce691bb6cfd..92ab58d3a9b 100644 --- a/suite2cases/function_test/pkg_test/python-nox/python3-nox.json +++ b/suite2cases/function_test/pkg_test/python-nox/python3-nox.json @@ -2,53 +2,9 @@ "path": "$OET_PATH/testcases/function_test/pkg_test/python-nox/python3-nox", "machine num": 1, "cases": [ - { - "name": "test_python3-nox_nox_h", - "desc": "测试 nox 命令的 -h 参数,显示帮助信息" - }, { "name": "test_python3-nox_nox_version", "desc": "测试 nox 命令的 --version 参数,显示版本信息" - }, - { - "name": "test_python3-nox_nox_l", - "desc": "测试 nox 命令的 -l 参数,列出所有可用会话" - }, - { - "name": "test_python3-nox_nox_json", - "desc": "测试 nox 命令的 --json 参数,以 JSON 格式输出会话列表" - }, - { - "name": "test_python3-nox_nox_s", - "desc": "测试 nox 命令的 -s 参数,运行指定会话" - }, - { - "name": "test_python3-nox_nox_k", - "desc": "测试 nox 命令的 -k 参数,运行匹配关键字的会话" - }, - { - "name": "test_python3-nox_nox_t", - "desc": "测试 nox 命令的 -t 参数,运行带有指定标签的会话" - }, - { - "name": "test_python3-nox_nox_p", - "desc": "测试 nox 命令的 -p 参数,运行指定 Python 解释器版本的会话" - }, - { - "name": "test_python3-nox_nox_v", - "desc": "测试 nox 命令的 -v 参数,输出详细日志信息" - }, - { - "name": "test_python3-nox_nox_ts", - "desc": "测试 nox 命令的 -ts 参数,在日志输出中添加时间戳" - }, - { - "name": "test_python3-nox_tox-to-nox", - "desc": "测试 tox-to-nox 命令的基本功能" - }, - { - "name": "test_python3-nox_function_nox_env", - "desc": "测试 nox 命令的环境变量功能" } ] } \ No newline at end of file diff --git a/testcases/function_test/pkg_test/python-nox/python3-nox/test_python3-nox_function_nox_env.sh b/testcases/function_test/pkg_test/python-nox/python3-nox/test_python3-nox_function_nox_env.sh deleted file mode 100644 index 9590a624e85..00000000000 --- a/testcases/function_test/pkg_test/python-nox/python3-nox/test_python3-nox_function_nox_env.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-11 -# @License : Mulan PSL v2 -# @Desc : 测试 nox 命令的环境变量功能 -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - LOG_INFO "开始测试 nox 命令的环境变量功能" - - # 检查是否已安装 python3-nox - LOG_INFO "检查是否已安装 python3-nox" - dnf list installed python3-nox > /dev/null 2>&1 - if [ $? -eq 0 ]; then - LOG_INFO "python3-nox 已安装,测试结束后将保持安装状态" - INSTALLED=true - else - LOG_INFO "python3-nox 未安装,将在测试结束后卸载" - INSTALLED=false - fi - - # 检查 yum 源中是否有 python3-nox - LOG_INFO "检查 yum 源中是否有 python3-nox" - dnf list available python3-nox > /dev/null 2>&1 - if [ $? -ne 0 ]; then - LOG_ERROR "yum 源中未找到 python3-nox,退出测试" - exit 255 - fi - - # 如果未安装则安装 python3-nox - if [ "$INSTALLED" = false ]; then - LOG_INFO "正在安装 python3-nox" - dnf install -y python3-nox > /dev/null 2>&1 - CHECK_RESULT $? 0 0 "安装 python3-nox 失败" - fi - - # 测试 nox env命令的功能性验证环境变量 - LOG_INFO "测试 nox env 命令的环境变量功能" - nox env > /dev/null 2>&1 - CHECK_RESULT $? 0 0 "nox env命令执行失败" - - # 清理环境 - if [ "$INSTALLED" = false ]; then - LOG_INFO "正在卸载 python3-nox" - dnf remove -y python3-nox > /dev/null 2>&1 - CHECK_RESULT $? 0 0 "卸载 python3-nox失败" - fi - - LOG_INFO "nox命令的环境变量功能测试完成" -} - -main "$@" \ No newline at end of file diff --git a/testcases/function_test/pkg_test/python-nox/python3-nox/test_python3-nox_nox_h.sh b/testcases/function_test/pkg_test/python-nox/python3-nox/test_python3-nox_nox_h.sh deleted file mode 100644 index b991970acac..00000000000 --- a/testcases/function_test/pkg_test/python-nox/python3-nox/test_python3-nox_nox_h.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-11 -# @License : Mulan PSL v2 -# @Desc : 测试 nox 命令的 -h 参数,显示帮助信息 -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - LOG_INFO "开始测试 nox 命令的 -h 参数,显示帮助信息" - - # 检查环境是否已安装 python3-nox 和 nox - LOG_INFO "检查是否已安装 python3-nox 和 nox" - if ! dnf list installed python3-nox &> /dev/null || ! dnf list installed nox &> /dev/null; then - LOG_INFO "环境未安装 python3-nox 或 nox,将进行安装" - # 检查 yum 源中是否有 python3-nox 和 nox - LOG_INFO "检查 yum 源中是否有 python3-nox 和 nox" - if ! dnf list available python3-nox &> /dev/null || ! dnf list available nox &> /dev/null; then - LOG_ERROR "yum 源中未找到 python3-nox 或 nox,退出测试" - exit 255 - fi - # 安装软件包 - LOG_INFO "安装 python3-nox 和 nox" - dnf install -y python3-nox nox - CHECK_RESULT $? 0 0 "安装 python3-nox 或 nox失败" - else - LOG_INFO "环境已安装 python3-nox 和 nox,跳过安装步骤" - fi - - # 测试 nox 命令的 -h 参数 - LOG_INFO "测试 nox 命令的 -h参数" - nox -h &> /dev/null - CHECK_RESULT $? 0 0 "nox -h 执行失败" - - # 恢复环境 - if ! dnf list installed python3-nox &> /dev/null || ! dnf list installed nox &> /dev/null; then - LOG_INFO "脚本开始时未安装软件包,卸载 python3-nox 和 nox" - dnf remove -y python3-nox nox - CHECK_RESULT $? 0 0 "卸载 python3-nox 或 nox失败" - else - LOG_INFO "脚本开始时已安装软件包,保持环境状态不变" - fi - - LOG_INFO "测试完成" -} - -main "$@" \ No newline at end of file diff --git a/testcases/function_test/pkg_test/python-nox/python3-nox/test_python3-nox_nox_json.sh b/testcases/function_test/pkg_test/python-nox/python3-nox/test_python3-nox_nox_json.sh deleted file mode 100644 index c3ce7783e5b..00000000000 --- a/testcases/function_test/pkg_test/python-nox/python3-nox/test_python3-nox_nox_json.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-11 -# @License : Mulan PSL v2 -# @Desc : 测试 nox 命令的 --json 参数,以 JSON 格式输出会话列表 -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - LOG_INFO "开始测试 nox 命令的 --json 参数,以 JSON 格式输出会话列表" - - # 检查环境是否已安装 python3-nox 和 nox - LOG_INFO "检查 python3-nox 和 nox 是否已安装" - if ! dnf list installed python3-nox > /dev/null 2>&1; then - LOG_INFO "python3-nox 未安装,将进行安装" - if ! dnf list available python3-nox > /dev/null 2>&1; then - LOG_ERROR "yum 源中未找到 python3-nox,退出测试" - exit 255 - fi - dnf install -y python3-nox - INSTALLED=1 - else - LOG_INFO "python3-nox 已安装" - INSTALLED=0 - fi - - # 检查 nox 命令是否支持 --json 参数 - LOG_INFO "检查 nox 命令是否支持 --json 参数" - if ! nox --help | grep -q -- --json; then - LOG_ERROR "nox 命令不支持 --json 参数,退出测试" - if [ $INSTALLED -eq 1 ]; then - dnf remove -y python3-nox - fi - exit 255 - fi - - # 执行 nox --json 命令 - LOG_INFO "执行 nox --json 命令" - nox --json > /tmp/nox_json_output.txt - CHECK_RESULT $? 0 0 "执行 nox --json 命令失败" - - # 验证输出是否为 JSON 格式 - LOG_INFO "验证输出是否为 JSON 格式" - if ! jq empty /tmp/nox_json_output.txt > /dev/null 2>&1; then - LOG_ERROR "nox --json 输出不是有效的 JSON" - CHECK_RESULT $? 0 1 "输出验证失败" - fi - - # 清理临时文件 - rm -f /tmp/nox_json_output.txt - - #如果之前未安装则卸载软件包恢复环境 - if [ $INSTALLED -eq 1 ]; then - LOG_INFO “卸载 python3-nox 恢复环境” - dnf remove -y python3-nox - fi - - LOG_INFO “测试完成” -} - -main "$@" \ No newline at end of file diff --git a/testcases/function_test/pkg_test/python-nox/python3-nox/test_python3-nox_nox_k.sh b/testcases/function_test/pkg_test/python-nox/python3-nox/test_python3-nox_nox_k.sh deleted file mode 100644 index 85047ae3f62..00000000000 --- a/testcases/function_test/pkg_test/python-nox/python3-nox/test_python3-nox_nox_k.sh +++ /dev/null @@ -1,64 +0,0 @@ -#!/usr/bin/bash - -# Copyright (c) 2024 ISCAS .ALL rights reserved. -# This program is licensed under Mulan PSL v2. -# You can use it according to the terms and conditions of the Mulan PSL v2. -# http://license.coscl.org.cn/MulanPSL2 -# THIS PROGRAM IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, -# EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, -# MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. -# See the Mulan PSL v2 for more details. - -# ############################################# -# @Author : honghua -# @Contact : honghua@iscas.ac.cn -# @Date : 2025-12-11 -# @License : Mulan PSL v2 -# @Desc : 测试 nox 命令的 -k 参数,运行匹配关键字的会话 -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - - # 检查环境是否已安装nox - LOG_INFO "检查nox是否已安装..." - if dnf list installed python3-nox &> /dev/null; then - LOG_INFO "nox已安装,测试完成后将保持安装状态" - INSTALLED=true - else - LOG_INFO "nox未安装,测试完成后将卸载" - INSTALLED=false - fi - - # 检查yum源中是否有python3-nox - LOG_INFO "检查yum源中是否有python3-nox..." - if ! dnf list available python3-nox &> /dev/null; then - LOG_ERROR "yum源中未找到python3-nox" - exit 255 - fi - - # 安装python3-nox(如果未安装) - if [ "$INSTALLED" = false ]; then - LOG_INFO "安装python3-nox..." - dnf install -y python3-nox - CHECK_RESULT $? 0 0 "安装python3-nox失败" - fi - - # 测试nox命令的-k参数 - LOG_INFO "测试nox命令的-k参数..." - nox -k "test_keyword" &> /dev/null - CHECK_RESULT $? 0 0 "nox -k参数测试失败" - - # 清理环境(如果最初未安装) - if [ "$INSTALLED" = false ]; then - LOG_INFO "卸载python3-nox..." - dnf remove -y python3-nox - CHECK_RESULT $? 0 0 "卸载python3-nox失败" - fi - - LOG_INFO "测试完成,环境已恢复" - -} - -main "$@" \ No newline at end of file diff --git a/testcases/function_test/pkg_test/python-nox/python3-nox/test_python3-nox_nox_l.sh b/testcases/function_test/pkg_test/python-nox/python3-nox/test_python3-nox_nox_l.sh deleted file mode 100644 index 1c6730e28c9..00000000000 --- a/testcases/function_test/pkg_test/python-nox/python3-nox/test_python3-nox_nox_l.sh +++ /dev/null @@ -1,61 +0,0 @@ -#!/usr/bin/bash - -# Copyright (c) 2024 ISCAS .ALL rights reserved. -# This program is licensed under Mulan PSL v2. -# You can use it according to the terms and conditions of the Mulan PSL v2. -# http://license.coscl.org.cn/MulanPSL2 -# THIS PROGRAM IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, -# EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, -# MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. -# See the Mulan PSL v2 for more details. - -# ############################################# -# @Author : honghua -# @Contact : honghua@iscas.ac.cn -# @Date : 2025-12-11 -# @License : Mulan PSL v2 -# @Desc : 测试 nox 命令的 -l 参数,列出所有可用会话 -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - - # 检查是否已安装python3-nox和nox软件包 - LOG_INFO "检查是否已安装python3-nox和nox软件包" - if ! dnf list installed python3-nox nox &>/dev/null; then - LOG_INFO "python3-nox或nox未安装,将进行安装" - # 检查yum源中是否有python3-nox和nox软件包 - LOG_INFO "检查yum源中是否有python3-nox和nox软件包" - if ! dnf list available python3-nox nox &>/dev/null; then - LOG_ERROR "yum源中未找到python3-nox或nox软件包" - exit 255 - fi - # 安装软件包 - LOG_INFO "正在安装python3-nox和nox软件包" - dnf install -y python3-nox nox - CHECK_RESULT $? 0 0 "安装python3-nox和nox软件包失败" - # 标记需要卸载 - UNINSTALL=1 - else - LOG_INFO "python3-nox和nox已安装,无需重复安装" - UNINSTALL=0 - fi - - # 测试nox命令的-l参数 - LOG_INFO "测试nox命令的-l参数,列出所有可用会话" - nox -l &>/dev/null - CHECK_RESULT $? 0 0 "nox -l命令执行失败" - - # 清理环境 - if [ $UNINSTALL -eq 1 ]; then - LOG_INFO "清理环境,卸载python3-nox和nox软件包" - dnf remove -y python3-nox nox &>/dev/null - CHECK_RESULT $? 0 0 "卸载python3-nox和nox软件包失败" - fi - - LOG_INFO "测试脚本执行完毕,环境已恢复" - -} - -main "$@" \ No newline at end of file diff --git a/testcases/function_test/pkg_test/python-nox/python3-nox/test_python3-nox_nox_p.sh b/testcases/function_test/pkg_test/python-nox/python3-nox/test_python3-nox_nox_p.sh deleted file mode 100644 index 7c6974d9dfa..00000000000 --- a/testcases/function_test/pkg_test/python-nox/python3-nox/test_python3-nox_nox_p.sh +++ /dev/null @@ -1,64 +0,0 @@ -#!/usr/bin/bash - -# Copyright (c) 2024 ISCAS .ALL rights reserved. -# This program is licensed under Mulan PSL v2. -# You can use it according to the terms and conditions of the Mulan PSL v2. -# http://license.coscl.org.cn/MulanPSL2 -# THIS PROGRAM IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, -# EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, -# MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. -# See the Mulan PSL v2 for more details. - -# ############################################# -# @Author : honghua -# @Contact : honghua@iscas.ac.cn -# @Date : 2025-12-11 -# @License : Mulan PSL v2 -# @Desc : 测试 nox 命令的 -p 参数,运行指定 Python 解释器版本的会话 -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - LOG_INFO "开始测试 nox 命令的 -p 参数,运行指定 Python 解释器版本的会话" - - # 检查是否已安装 python3-nox 和 nox - LOG_INFO "检查是否已安装 python3-nox 和 nox" - if ! dnf list installed python3-nox > /dev/null 2>&1 || ! dnf list installed nox > /dev/null 2>&1; then - LOG_INFO "python3-nox 或 nox 未安装,将进行安装" - INSTALLED=false - else - LOG_INFO "python3-nox 和 nox 已安装" - INSTALLED=true - fi - - # 检查 yum 源中是否有 python3-nox 和 nox - LOG_INFO "检查 yum 源中是否有 python3-nox 和 nox" - if ! dnf list available python3-nox > /dev/null 2>&1 || ! dnf list available nox > /dev/null 2>&1; then - LOG_ERROR "yum 源中未找到 python3-nox 或 nox" - exit 255 - fi - - # 如果未安装,则安装软件包 - if [ "$INSTALLED" = false ]; then - LOG_INFO "正在安装 python3-nox 和 nox" - dnf install -y python3-nox nox - CHECK_RESULT $? 0 0 "安装 python3-nox 和 nox 失败" - fi - - # 测试 nox 命令的 -p 参数 - LOG_INFO "测试 nox 命令的 -p 参数,运行指定 Python解释器版本的会话" - nox -p python3.8 -c "import sys; print(sys.version)" - CHECK_RESULT $? 0 0 "nox -p 参数测试失败" - - # 如果之前未安装,则卸载软件包 - if [ "$INSTALLED" = false ]; then - LOG_INFO "卸载 python3-nox 和 nox" - dnf remove -y python3-nox nox - CHECK_RESULT $? 0 0 "卸载 python3-nox 和 nox 失败" - fi - - LOG_INFO "测试完成,环境已恢复" -} - -main "$@" \ No newline at end of file diff --git a/testcases/function_test/pkg_test/python-nox/python3-nox/test_python3-nox_nox_s.sh b/testcases/function_test/pkg_test/python-nox/python3-nox/test_python3-nox_nox_s.sh deleted file mode 100644 index 057fb254fb3..00000000000 --- a/testcases/function_test/pkg_test/python-nox/python3-nox/test_python3-nox_nox_s.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-11 -# @License : Mulan PSL v2 -# @Desc : 测试 nox 命令的 -s 参数,运行指定会话 -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - - LOG_INFO "开始测试 nox 命令的 -s 参数,运行指定会话" - - # 检查是否已安装 python3-nox 和 nox - if ! dnf list installed python3-nox &> /dev/null || ! dnf list installed nox &> /dev/null; then - LOG_INFO "环境未安装 python3-nox 或 nox,将进行安装" - # 检查 yum 源中是否有 python3-nox 和 nox - if ! dnf list available python3-nox &> /dev/null || ! dnf list available nox &> /dev/null; then - LOG_ERROR "yum 源中未找到 python3-nox 或 nox" - exit 255 - fi - # 安装软件包 - dnf install -y python3-nox nox - CHECK_RESULT $? 0 0 "安装 python3-nox 和 nox 失败" - INSTALLED=true - else - LOG_INFO "环境已安装 python3-nox 和 nox" - INSTALLED=false - fi - - # 测试 nox -s 参数功能 - LOG_INFO "测试 nox -s 参数,运行指定会话" - nox -s test_session - CHECK_RESULT $? 0 0 "nox -s 参数执行失败" - - # 清理环境,如果之前未安装则卸载软件包 - if [ "$INSTALLED" = true ]; then - LOG_INFO "清理环境,卸载 python3-nox 和 nox" - dnf remove -y python3-nox nox - CHECK_RESULT $? 0 0 "卸载 python3-nox 和 nox 失败" - fi - - LOG_INFO "测试完成,环境已恢复" - -} - -main "$@" \ No newline at end of file diff --git a/testcases/function_test/pkg_test/python-nox/python3-nox/test_python3-nox_nox_t.sh b/testcases/function_test/pkg_test/python-nox/python3-nox/test_python3-nox_nox_t.sh deleted file mode 100644 index 71966883aef..00000000000 --- a/testcases/function_test/pkg_test/python-nox/python3-nox/test_python3-nox_nox_t.sh +++ /dev/null @@ -1,118 +0,0 @@ -#!/usr/bin/bash - -# Copyright (c) 2024 ISCAS .ALL rights reserved. -# This program is licensed under Mulan PSL v2. -# You can use it according to the terms and conditions of the Mulan PSL v2. -# http://license.coscl.org.cn/MulanPSL2 -# THIS PROGRAM IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, -# EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, -# MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. -# See the Mulan PSL v2 for more details. - -# ############################################# -# @Author : honghua -# @Contact : honghua@iscas.ac.cn -# @Date : 2025-12-11 -# @License : Mulan PSL v2 -# @Desc : 测试 nox 命令的 -t 参数,运行带有指定标签的会话 -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - LOG_INFO "开始测试 nox 命令的 -t 参数,运行带有指定标签的会话" - - # 检查环境是否已安装 python3-nox 和 nox - LOG_INFO "检查 python3-nox 和 nox 是否已安装" - if ! dnf list installed python3-nox > /dev/null 2>&1; then - LOG_INFO "python3-nox 未安装,将进行安装" - INSTALLED_PYTHON3_NOX=0 - else - LOG_INFO "python3-nox 已安装" - INSTALLED_PYTHON3_NOX=1 - fi - - if ! dnf list installed nox > /dev/null 2>&1; then - LOG_INFO "nox 未安装,将进行安装" - INSTALLED_NOX=0 - else - LOG_INFO "nox 已安装" - INSTALLED_NOX=1 - fi - - # 检查 yum 源中是否有 python3-nox 和 nox - LOG_INFO "检查 yum 源中是否有 python3-nox 和 nox" - if ! dnf list available python3-nox > /dev/null 2>&1; then - LOG_ERROR "yum 源中无 python3-nox,退出测试" - exit 255 - fi - - if ! dnf list available nox > /dev/null 2>&1; then - LOG_ERROR "yum 源中无 nox,退出测试" - exit 255 - fi - - # 若未安装则进行安装 - if [ $INSTALLED_PYTHON3_NOX -eq 0 ]; then - LOG_INFO "正在安装 python3-nox" - dnf install -y python3-nox || { - LOG_ERROR "python3-nox 安装失败" - exit 255 - } - fi - - if [ $INSTALLED_NOX -eq 0 ]; then - LOG_INFO "正在安装 nox" - dnf install -y nox || { - LOG_ERROR "nox 安装失败" - exit 255 - } - fi - - # 测试 nox -t 参数 - LOG_INFO "测试 nox -t 参数" - - # 创建临时测试目录 - TEST_DIR=$(mktemp -d) - cd $TEST_DIR || { - LOG_ERROR "无法进入临时目录 $TEST_DIR" - exit 1 - } - - # Create a simple test session with a tag in a noxfile.py - cat >noxfile.py </dev/null; then - LOG_INFO "未安装python3-nox和nox,将进行安装" - # 检查yum源中是否有python3-nox和nox - if ! dnf list available python3-nox nox &>/dev/null; then - LOG_ERROR "yum源中未找到python3-nox或nox,退出" - exit 255 - fi - # 安装软件包 - dnf install -y python3-nox nox || { - LOG_ERROR "安装python3-nox或nox失败,退出" - exit 1 - } - # 标记需要卸载 - NEED_UNINSTALL=1 - else - LOG_INFO "已安装python3-nox和nox,无需安装" - NEED_UNINSTALL=0 - fi - - # 测试nox命令的-ts参数功能 - LOG_INFO "测试nox命令的-ts参数功能" - if ! nox --help | grep -q -- "-ts"; then - LOG_ERROR "nox命令不支持-ts参数,退出" - exit 255 - fi - - # 执行带-ts参数的nox命令 - LOG_INFO "执行带-ts参数的nox命令" - nox -ts - CHECK_RESULT $? 0 0 "nox -ts命令执行失败" - - # 清理环境 - if [ "$NEED_UNINSTALL" -eq 1 ]; then - LOG_INFO "卸载python3-nox和nox" - dnf remove -y python3-nox nox || { - LOG_ERROR "卸载python3-nox或nox失败" - exit 1 - } - fi - - LOG_INFO "测试完成,环境已恢复" - exit 0 -} - -main "$@" \ No newline at end of file diff --git a/testcases/function_test/pkg_test/python-nox/python3-nox/test_python3-nox_nox_v.sh b/testcases/function_test/pkg_test/python-nox/python3-nox/test_python3-nox_nox_v.sh deleted file mode 100644 index ee2958dfd35..00000000000 --- a/testcases/function_test/pkg_test/python-nox/python3-nox/test_python3-nox_nox_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-11 -# @License : Mulan PSL v2 -# @Desc : 测试 nox 命令的 -v 参数,输出详细日志信息 -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - - # 检查环境是否已安装python3-nox和nox - LOG_INFO "检查是否已安装python3-nox和nox" - if dnf list installed python3-nox nox &>/dev/null; then - LOG_INFO "python3-nox和nox已安装,测试结束后将保持安装状态" - INSTALLED=true - else - LOG_INFO "python3-nox和nox未安装,测试结束后将卸载" - INSTALLED=false - fi - - # 检查yum源中是否存在python3-nox和nox - LOG_INFO "检查yum源中是否存在python3-nox和nox" - if ! dnf list available python3-nox nox &>/dev/null; then - LOG_ERROR "yum源中不存在python3-nox或nox,退出测试" - exit 255 - fi - - # 如果未安装,则安装python3-nox和nox - if [ "$INSTALLED" = false ]; then - LOG_INFO "开始安装python3-nox和nox" - dnf install -y python3-nox nox - CHECK_RESULT $? 0 0 "安装python3-nox和nox失败" - fi - - # 测试nox命令的-v参数 - LOG_INFO "测试nox命令的-v参数,输出详细日志信息" - nox -v &>/dev/null - CHECK_RESULT $? 0 0 "执行nox -v命令失败" - - # 如果测试开始时未安装,则卸载python3-nox和nox - if [ "$INSTALLED" = false ]; then - LOG_INFO "卸载python3-nox和nox" - dnf remove -y python3-nox nox - CHECK_RESULT $? 0 0 "卸载python3-nox和nox失败" - fi - - LOG_INFO "测试完成,环境已恢复" - -} - -main "$@" \ No newline at end of file diff --git a/testcases/function_test/pkg_test/python-nox/python3-nox/test_python3-nox_tox-to-nox.sh b/testcases/function_test/pkg_test/python-nox/python3-nox/test_python3-nox_tox-to-nox.sh deleted file mode 100644 index 5867c23a5b9..00000000000 --- a/testcases/function_test/pkg_test/python-nox/python3-nox/test_python3-nox_tox-to-nox.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-11 -# @License : Mulan PSL v2 -# @Desc : 测试 tox-to-nox 命令的基本功能 -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - # 检查是否已安装python3-nox和tox-to-nox - LOG_INFO "检查是否已安装python3-nox和tox-to-nox" - if dnf list installed python3-nox &>/dev/null && dnf list installed tox-to-nox &>/dev/null; then - LOG_INFO "python3-nox和tox-to-nox已安装" - INSTALLED=true - else - LOG_INFO "python3-nox和tox-to-nox未安装" - INSTALLED=false - fi - - # 检查yum源中是否有python3-nox和tox-to-nox - LOG_INFO "检查yum源中是否有python3-nox和tox-to-nox" - if ! dnf list available python3-nox &>/dev/null || ! dnf list available tox-to-nox &>/dev/null; then - LOG_ERROR "yum源中缺少python3-nox或tox-to-nox" - exit 255 - fi - - # 如果未安装,则安装软件包 - if [ "$INSTALLED" = false ]; then - LOG_INFO "开始安装python3-nox和tox-to-nox" - dnf install -y python3-nox tox-to-nox - CHECK_RESULT $? 0 0 "安装python3-nox和tox-to-nox失败" - fi - - # 测试tox-to-no命令的基本功能 - LOG_INFO "测试tox-to-nx命令的基本功能" - if ! command -v tox-to-no &>/dev/null; then - LOG_ERROR "tox-to-nx命令不存在或不支持" - exit 255 - fi - - # 执行命令并检查结果 - LOG_INFO "执行命令:tox-tx-no --help" - toxto-no --help &>/dev/null - CHECK_RESULT $? 0 0 "执行toxto-no --help失败" - - # 清理环境 - if [ "$INSTALLED" = false ]; then - LOG_INFO "卸载python3-nx和tox-tx-no" - dnf remove -y python3nox toxto-no - CHECK_RESULT $? 0 0 "卸载pythn3nox和toxtono失败" - fi - - LOG_INFO "测试脚本执行完毕" -} - -main "$@" \ No newline at end of file From cfc4b5b3e86d4ec54e0cdd014452c16b6794c34d Mon Sep 17 00:00:00 2001 From: honghua Date: Sat, 18 Apr 2026 17:19:53 +0800 Subject: [PATCH 16/17] update testcase for testsuite texlive-custom-bib --- .../texlive-split-f/texlive-custom-bib.json | 10 ---- ...est_texlive-custom-bib_function_install.sh | 60 ------------------- 2 files changed, 70 deletions(-) delete mode 100644 suite2cases/function_test/pkg_test/texlive-split-f/texlive-custom-bib.json delete mode 100644 testcases/function_test/pkg_test/texlive-split-f/texlive-custom-bib/test_texlive-custom-bib_function_install.sh diff --git a/suite2cases/function_test/pkg_test/texlive-split-f/texlive-custom-bib.json b/suite2cases/function_test/pkg_test/texlive-split-f/texlive-custom-bib.json deleted file mode 100644 index 460390a3a9b..00000000000 --- a/suite2cases/function_test/pkg_test/texlive-split-f/texlive-custom-bib.json +++ /dev/null @@ -1,10 +0,0 @@ -{ - "path": "$OET_PATH/testcases/function_test/pkg_test/texlive-split-f/texlive-custom-bib", - "machine num": 1, - "cases": [ - { - "name": "test_texlive-custom-bib_function_install", - "desc": "Test package installation" - } - ] -} \ No newline at end of file diff --git a/testcases/function_test/pkg_test/texlive-split-f/texlive-custom-bib/test_texlive-custom-bib_function_install.sh b/testcases/function_test/pkg_test/texlive-split-f/texlive-custom-bib/test_texlive-custom-bib_function_install.sh deleted file mode 100644 index ae7bdf0471e..00000000000 --- a/testcases/function_test/pkg_test/texlive-split-f/texlive-custom-bib/test_texlive-custom-bib_function_install.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-09-30 -# @License : Mulan PSL v2 -# @Desc : Test package installation -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - # 检查是否已安装texlive-custom-bib - LOG_INFO "检查是否已安装texlive-custom-bib" - rpm -q texlive-custom-bib - if [ $? -eq 0 ]; then - LOG_INFO "texlive-custom-bib已安装,脚本结束时保持安装状态" - installed=true - else - installed=false - fi - - # 检查yum源中是否有texlive-custom-bib - LOG_INFO "检查yum源中是否有texlive-custom-bib" - dnf list available texlive-custom-bib > /dev/null 2>&1 - CHECK_RESULT $? 0 255 "yum源中没有texlive-custom-bib包" - - # 安装texlive-custom-bib - if [ "$installed" = false ]; then - LOG_INFO "安装texlive-custom-bib" - dnf install -y texlive-custom-bib - CHECK_RESULT $? 0 0 "安装texlive-custom-bib失败" - fi - - # 测试texlive-custom-bib功能 - LOG_INFO "测试texlive-custom-bib功能" - texlive-custom-bib --version - CHECK_RESULT $? 0 255 "texlive-custom-bib命令不支持或参数错误" - - # 清理环境 - if [ "$installed" = false ]; then - LOG_INFO "卸载texlive-custom-bib" - dnf remove -y texlive-custom-bib - CHECK_RESULT $? 0 0 "卸载texlive-custom-bib失败" - fi - - LOG_INFO "测试完成,环境已恢复" -} - -main "$@" \ No newline at end of file From 9485ad2c56c9c771f1e524dc4fbf67aa439ac20a Mon Sep 17 00:00:00 2001 From: honghua Date: Sat, 18 Apr 2026 17:20:17 +0800 Subject: [PATCH 17/17] update testcase for testsuite texlive-romanneg --- .../texlive-split-u/texlive-romanneg.json | 16 --- .../test_texlive-romanneg_function_files.sh | 92 -------------- .../test_texlive-romanneg_function_remove.sh | 116 ------------------ .../test_texlive-romanneg_function_usage.sh | 80 ------------ .../test_texlive-romanneg_function_version.sh | 69 ----------- 5 files changed, 373 deletions(-) delete mode 100644 testcases/function_test/pkg_test/texlive-split-u/texlive-romanneg/test_texlive-romanneg_function_files.sh delete mode 100644 testcases/function_test/pkg_test/texlive-split-u/texlive-romanneg/test_texlive-romanneg_function_remove.sh delete mode 100644 testcases/function_test/pkg_test/texlive-split-u/texlive-romanneg/test_texlive-romanneg_function_usage.sh delete mode 100644 testcases/function_test/pkg_test/texlive-split-u/texlive-romanneg/test_texlive-romanneg_function_version.sh diff --git a/suite2cases/function_test/pkg_test/texlive-split-u/texlive-romanneg.json b/suite2cases/function_test/pkg_test/texlive-split-u/texlive-romanneg.json index 05793a7e8fe..d7706c3cdb2 100644 --- a/suite2cases/function_test/pkg_test/texlive-split-u/texlive-romanneg.json +++ b/suite2cases/function_test/pkg_test/texlive-split-u/texlive-romanneg.json @@ -5,22 +5,6 @@ { "name": "test_texlive-romanneg_function_install", "desc": "Test package installation" - }, - { - "name": "test_texlive-romanneg_function_remove", - "desc": "Test package removal" - }, - { - "name": "test_texlive-romanneg_function_version", - "desc": "Test package version check" - }, - { - "name": "test_texlive-romanneg_function_usage", - "desc": "Test LaTeX document usage" - }, - { - "name": "test_texlive-romanneg_function_files", - "desc": "Test package files existence" } ] } \ No newline at end of file diff --git a/testcases/function_test/pkg_test/texlive-split-u/texlive-romanneg/test_texlive-romanneg_function_files.sh b/testcases/function_test/pkg_test/texlive-split-u/texlive-romanneg/test_texlive-romanneg_function_files.sh deleted file mode 100644 index ba0f6de00a6..00000000000 --- a/testcases/function_test/pkg_test/texlive-split-u/texlive-romanneg/test_texlive-romanneg_function_files.sh +++ /dev/null @@ -1,92 +0,0 @@ -#!/usr/bin/bash - -# Copyright (c) 2024 ISCAS .ALL rights reserved. -# This program is licensed under Mulan PSL v2. -# You can use it according to the terms and conditions of the Mulan PSL v2. -# http://license.coscl.org.cn/MulanPSL2 -# THIS PROGRAM IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, -# EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-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-05 -# @License : Mulan PSL v2 -# @Desc : Test package files existence -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - # 定义软件包名称 - PACKAGE_NAME="texlive-romanneg" - LOG_INFO "开始测试软件包 ${PACKAGE_NAME} 的文件存在性" - - # 步骤1: 检查yum源中是否存在指定软件包 - LOG_INFO "步骤1: 检查yum源中是否存在 ${PACKAGE_NAME} 软件包" - dnf list available ${PACKAGE_NAME} &>/dev/null - if [ $? -ne 0 ]; then - LOG_ERROR "yum源中未找到 ${PACKAGE_NAME} 软件包" - exit 255 - fi - LOG_INFO "yum源中存在 ${PACKAGE_NAME} 软件包" - - # 步骤2: 检查软件包是否已安装 - LOG_INFO "步骤2: 检查 ${PACKAGE_NAME} 是否已安装" - rpm -q ${PACKAGE_NAME} &>/dev/null - if [ $? -eq 0 ]; then - LOG_INFO "${PACKAGE_NAME} 已安装,标记为已安装状态" - INSTALLED="true" - else - LOG_INFO "${PACKAGE_NAME} 未安装,标记为未安装状态" - INSTALLED="false" - fi - - # 步骤3: 如果未安装,则安装软件包 - if [ "${INSTALLED}" = "false" ]; then - LOG_INFO "步骤3: 安装 ${PACKAGE_NAME} 软件包" - dnf install -y ${PACKAGE_NAME} - CHECK_RESULT $? 0 0 "安装 ${PACKAGE_NAME} 失败" - LOG_INFO "成功安装 ${PACKAGE_NAME}" - fi - - # 步骤4: 检查软件包文件是否存在 - LOG_INFO "步骤4: 检查 ${PACKAGE_NAME} 软件包的文件是否存在" - rpm -ql ${PACKAGE_NAME} &>/dev/null - CHECK_RESULT $? 0 0 "软件包 ${PACKAGE_NAME} 的文件列表查询失败" - LOG_INFO "软件包 ${PACKAGE_NAME} 的文件列表查询成功" - - # 步骤5: 验证特定文件是否存在 - LOG_INFO "步骤5: 验证 ${PACKAGE_NAME} 的特定文件是否存在" - FILES_EXIST=true - for file in $(rpm -ql ${PACKAGE_NAME} | head -5); do - if [ -e "$file" ]; then - LOG_INFO "文件存在: $file" - else - LOG_ERROR "文件不存在: $file" - FILES_EXIST=false - fi - done - if [ "$FILES_EXIST" = "false" ]; then - LOG_ERROR "部分文件不存在,测试失败" - exit 1 - fi - LOG_INFO "所有检查的文件均存在" - - # 步骤6: 环境恢复 - LOG_INFO "步骤6: 恢复环境状态" - if [ "${INSTALLED}" = "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 "测试完成: ${PACKAGE_NAME} 文件存在性测试通过" -} - -main "$@" \ No newline at end of file diff --git a/testcases/function_test/pkg_test/texlive-split-u/texlive-romanneg/test_texlive-romanneg_function_remove.sh b/testcases/function_test/pkg_test/texlive-split-u/texlive-romanneg/test_texlive-romanneg_function_remove.sh deleted file mode 100644 index 87e2fd2f859..00000000000 --- a/testcases/function_test/pkg_test/texlive-split-u/texlive-romanneg/test_texlive-romanneg_function_remove.sh +++ /dev/null @@ -1,116 +0,0 @@ -#!/usr/bin/bash - -# Copyright (c) 2024 ISCAS .ALL rights reserved. -# This program is licensed under Mulan PSL v2. -# You can use it according to the terms and conditions of the Mulan PSL v2. -# http://license.coscl.org.cn/MulanPSL2 -# THIS PROGRAM IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, -# EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-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-05 -# @License : Mulan PSL v2 -# @Desc : Test package removal -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - # 定义日志函数(虽然题目说直接使用,但实际环境中可能需要定义,这里为了脚本完整性提供定义) - LOG_INFO() { - echo "[INFO] $*" - } - - LOG_ERROR() { - echo "[ERROR] $*" - } - - # 定义检查结果函数(题目说直接使用,这里提供定义以确保脚本可运行) - CHECK_RESULT() { - local actual=$1 - local expect=$2 - local exit_code=$3 - local error_msg=$4 - - if [ $actual -ne $expect ]; then - LOG_ERROR "$error_msg" - exit $exit_code - fi - } - - # 定义SSH_CMD函数(题目说直接使用,这里提供定义以确保脚本可运行) - SSH_CMD() { - local cmd=$1 - local ip=$2 - local password=$3 - local user=$4 - - # 这里只是示例,实际应根据环境实现 - sshpass -p "$password" ssh "$user@$ip" "$cmd" - } - - # 测试包名称 - PACKAGE_NAME="texlive-romanneg" - - # 步骤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" - if rpm -q "$PACKAGE_NAME" &>/dev/null; then - LOG_INFO "软件包 $PACKAGE_NAME 已安装,脚本结束后将保持安装状态" - WAS_INSTALLED=true - else - LOG_INFO "软件包 $PACKAGE_NAME 未安装,将在测试中安装并最终卸载" - WAS_INSTALLED=false - fi - - # 步骤3: 如果未安装,则安装软件包 - if [ "$WAS_INSTALLED" = false ]; then - LOG_INFO "步骤3: 安装软件包 $PACKAGE_NAME" - dnf install -y "$PACKAGE_NAME" - CHECK_RESULT $? 0 0 "安装软件包 $PACKAGE_NAME 失败" - fi - - # 步骤4: 验证软件包已正确安装 - LOG_INFO "步骤4: 验证软件包 $PACKAGE_NAME 已正确安装" - rpm -q "$PACKAGE_NAME" - CHECK_RESULT $? 0 0 "验证软件包 $PACKAGE_NAME 安装状态失败" - - # 步骤5: 测试移除软件包功能(但不实际执行) - LOG_INFO "步骤5: 测试软件包移除功能(模拟测试)" - # 这里只是检查移除命令的参数支持情况 - dnf remove --help | grep -q "\-\-nodeps" - CHECK_RESULT $? 0 255 "dnf remove 不支持 --nodeps 参数" - - # 步骤6: 清理环境 - LOG_INFO "步骤6: 清理测试环境" - if [ "$WAS_INSTALLED" = false ]; then - LOG_INFO "卸载测试安装的软件包 $PACKAGE_NAME" - dnf remove -y "$PACKAGE_NAME" - CHECK_RESULT $? 0 0 "卸载软件包 $PACKAGE_NAME 失败" - - # 验证软件包已被卸载 - rpm -q "$PACKAGE_NAME" &>/dev/null - if [ $? -eq 0 ]; then - LOG_ERROR "软件包 $PACKAGE_NAME 卸载后仍存在" - exit 1 - fi - LOG_INFO "软件包 $PACKAGE_NAME 已成功卸载" - else - LOG_INFO "保持软件包 $PACKAGE_NAME 的安装状态不变" - fi - - LOG_INFO "测试完成: Test package removal" -} - -main "$@" \ No newline at end of file diff --git a/testcases/function_test/pkg_test/texlive-split-u/texlive-romanneg/test_texlive-romanneg_function_usage.sh b/testcases/function_test/pkg_test/texlive-split-u/texlive-romanneg/test_texlive-romanneg_function_usage.sh deleted file mode 100644 index ae773f82016..00000000000 --- a/testcases/function_test/pkg_test/texlive-split-u/texlive-romanneg/test_texlive-romanneg_function_usage.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-05 -# @License : Mulan PSL v2 -# @Desc : Test LaTeX document usage -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - # 定义变量 - PACKAGE_NAME="texlive-romanneg" - COMMAND="texdoc" - COMMAND_ARGS="romanneg" - - # 步骤1: 检查软件包是否在yum源中 - LOG_INFO "1. 检查软件包是否在yum源中" - dnf list available $PACKAGE_NAME &> /dev/null - if [ $? -ne 0 ]; then - LOG_ERROR "软件包 $PACKAGE_NAME 不在yum源中" - exit 255 - fi - - # 步骤2: 检查环境是否已安装 - LOG_INFO "2. 检查环境是否已安装" - rpm -q $PACKAGE_NAME &> /dev/null - if [ $? -eq 0 ]; then - LOG_INFO "软件包 $PACKAGE_NAME 已安装,测试后将保持安装状态" - INSTALLED=true - else - LOG_INFO "软件包 $PACKAGE_NAME 未安装,测试后将卸载" - INSTALLED=false - fi - - # 步骤3: 如果未安装则安装软件包 - if [ "$INSTALLED" = false ]; then - LOG_INFO "3. 安装软件包 $PACKAGE_NAME" - dnf install -y $PACKAGE_NAME - CHECK_RESULT $? 0 0 "安装软件包 $PACKAGE_NAME 失败" - fi - - # 步骤4: 检查命令参数是否支持 - LOG_INFO "4. 检查命令参数是否支持" - $COMMAND --help 2>&1 | grep -q "$COMMAND_ARGS" - if [ $? -ne 0 ]; then - LOG_ERROR "命令 $COMMAND 不支持参数 $COMMAND_ARGS" - exit 255 - fi - - # 步骤5: 执行测试命令 - LOG_INFO "5. 执行测试命令 $COMMAND $COMMAND_ARGS" - $COMMAND $COMMAND_ARGS - CHECK_RESULT $? 0 0 "执行命令 $COMMAND $COMMAND_ARGS 失败" - - # 步骤6: 清理环境 - LOG_INFO "6. 清理环境" - if [ "$INSTALLED" = false ]; then - LOG_INFO "卸载软件包 $PACKAGE_NAME" - dnf remove -y $PACKAGE_NAME - CHECK_RESULT $? 0 0 "卸载软件包 $PACKAGE_NAME 失败" - else - LOG_INFO "保持软件包 $PACKAGE_NAME 安装状态" - fi - - LOG_INFO "测试完成" -} - -main "$@" \ No newline at end of file diff --git a/testcases/function_test/pkg_test/texlive-split-u/texlive-romanneg/test_texlive-romanneg_function_version.sh b/testcases/function_test/pkg_test/texlive-split-u/texlive-romanneg/test_texlive-romanneg_function_version.sh deleted file mode 100644 index 55055d990be..00000000000 --- a/testcases/function_test/pkg_test/texlive-split-u/texlive-romanneg/test_texlive-romanneg_function_version.sh +++ /dev/null @@ -1,69 +0,0 @@ -#!/usr/bin/bash - -# Copyright (c) 2024 ISCAS .ALL rights reserved. -# This program is licensed under Mulan PSL v2. -# You can use it according to the terms and conditions of the Mulan PSL v2. -# http://license.coscl.org.cn/MulanPSL2 -# THIS PROGRAM IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, -# EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, -# MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. -# See the Mulan PSL v2 for more details. - -# ############################################# -# @Author : honghua -# @Contact : honghua@iscas.ac.cn -# @Date : 2026-03-05 -# @License : Mulan PSL v2 -# @Desc : Test package version check -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - # 测试包版本检查 - - LOG_INFO "开始测试:检查texlive-romanneg软件包版本" - - # 检查yum源中是否存在texlive-romanneg软件包 - LOG_INFO "步骤1:检查yum源中是否存在texlive-romanneg软件包" - dnf list available texlive-romanneg 2>/dev/null - if [ $? -ne 0 ]; then - LOG_ERROR "yum源中不存在texlive-romanneg软件包" - exit 255 - fi - CHECK_RESULT $? 0 0 "检查yum源中是否存在texlive-romanneg软件包失败" - - # 检查当前是否已安装texlive-romanneg - LOG_INFO "步骤2:检查当前是否已安装texlive-romanneg" - rpm -q texlive-romanneg - if [ $? -eq 0 ]; then - LOG_INFO "texlive-romanneg已安装,标记为已安装状态" - INSTALLED=true - else - LOG_INFO "texlive-romanneg未安装,标记为未安装状态" - INSTALLED=false - fi - - # 如果未安装,则安装软件包 - if [ "$INSTALLED" = "false" ]; then - LOG_INFO "步骤3:安装texlive-romanneg软件包" - dnf install -y texlive-romanneg - CHECK_RESULT $? 0 0 "安装texlive-romanneg软件包失败" - fi - - # 检查软件包版本 - LOG_INFO "步骤4:检查texlive-romanneg软件包版本" - rpm -q texlive-romanneg --queryformat "%{VERSION}-%{RELEASE}\n" - CHECK_RESULT $? 0 0 "检查texlive-romanneg软件包版本失败" - - # 如果测试前未安装,则卸载软件包 - if [ "$INSTALLED" = "false" ]; then - LOG_INFO "步骤5:卸载texlive-romanneg软件包" - dnf remove -y texlive-romanneg - CHECK_RESULT $? 0 0 "卸载texlive-romanneg软件包失败" - fi - - LOG_INFO "测试完成:texlive-romanneg软件包版本检查成功" -} - -main "$@" \ No newline at end of file