This commit is contained in:
2026-04-18 10:05:11 +08:00
63 changed files with 0 additions and 4211 deletions

View File

@@ -13,14 +13,6 @@
{
"name": "test_OpenEXR-devel_uninstall",
"desc": "测试OpenEXR-devel软件包能否正确卸载"
},
{
"name": "test_OpenEXR-devel_header",
"desc": "测试OpenEXR开发头文件的存在与可包含性"
},
{
"name": "test_OpenEXR-devel_linking",
"desc": "测试使用OpenEXR库进行简单的程序编译与链接"
}
]
}

View File

@@ -5,18 +5,6 @@
{
"name": "test_arquillian-container-test-spi_function_init",
"desc": "Test initialization of the test SPI"
},
{
"name": "test_arquillian-container-test-spi_function_deploy",
"desc": "Test deployment of the test SPI"
},
{
"name": "test_arquillian-container-test-spi_function_exec",
"desc": "Test execution of the test SPI"
},
{
"name": "test_arquillian-container-test-spi_function_config",
"desc": "Test configuration of the test SPI"
}
]
}

View File

@@ -26,10 +26,6 @@
"name": "test_boost-iostreams_function_file_filter",
"desc": "测试 boost-iostreams 的文件过滤功能如gzip。"
},
{
"name": "test_boost-iostreams_function_memory_stream",
"desc": "测试 boost-iostreams 的内存流读写功能。"
},
{
"name": "test_boost-iostreams_function_device_chain",
"desc": "测试 boost-iostreams 的设备链(如文件到内存)功能。"

View File

@@ -6,10 +6,6 @@
"name": "test_libnvme-devel_function_install",
"desc": "Test installation of libnvme-devel package"
},
{
"name": "test_libnvme-devel_function_init",
"desc": "Test initialization of libnvme-devel library"
},
{
"name": "test_libnvme-devel_function_uninstall",
"desc": "Test uninstallation of libnvme-devel package"
@@ -17,30 +13,6 @@
{
"name": "test_libnvme-devel_function_check_install",
"desc": "Check if libnvme-devel is installed on the system"
},
{
"name": "test_libnvme-devel_function_compile",
"desc": "Test compiling a simple program using libnvme headers and libraries"
},
{
"name": "test_libnvme-devel_function_init_scan",
"desc": "Test library initialization and NVMe controller scanning"
},
{
"name": "test_libnvme-devel_function_get_identify",
"desc": "Test retrieving NVMe controller identify information"
},
{
"name": "test_libnvme-devel_function_get_smart_log",
"desc": "Test retrieving NVMe device SMART log data"
},
{
"name": "test_libnvme-devel_function_namespace_ops",
"desc": "Test basic NVMe namespace operations (list, get info)"
},
{
"name": "test_libnvme-devel_function_error_handling",
"desc": "Test library error handling for invalid inputs"
}
]
}

View File

@@ -5,10 +5,6 @@
{
"name": "test_libomxil-bellagio-devel_function_install",
"desc": "Test the installation of libomxil-bellagio-devel package"
},
{
"name": "test_libomxil-bellagio-devel_function_basic",
"desc": "Test basic functionality of libomxil-bellagio-devel"
}
]
}

View File

@@ -1,30 +0,0 @@
{
"path": "$OET_PATH/testcases/function_test/pkg_test/openjfx8/openjfx8-devel",
"machine num": 1,
"cases": [
{
"name": "test_openjfx8-devel_javafxpackager__upper_v",
"desc": "测试 javafxpackager 命令的 -V 参数"
},
{
"name": "test_openjfx8-devel_javafxpackager__v",
"desc": "测试 javafxpackager 命令的 -v 参数"
},
{
"name": "test_openjfx8-devel_javapackager__v",
"desc": "测试 javapackager 命令的 -v 参数"
},
{
"name": "test_openjfx8-devel_javapackager__upper_v",
"desc": "测试 javapackager 命令的 -V 参数"
},
{
"name": "test_openjfx8-devel_function_javafxbase",
"desc": "测试 javafxbase 基础功能"
},
{
"name": "test_openjfx8-devel_function_javafxgraphics",
"desc": "测试 javafxgraphics 基础功能"
}
]
}

View File

@@ -9,18 +9,6 @@
{
"name": "test_pcp-pmda-cifs_function_uninstall",
"desc": "Test the uninstallation of pcp-pmda-cifs package"
},
{
"name": "test_pcp-pmda-cifs_function_enable",
"desc": "Test enabling the CIFS PMDA"
},
{
"name": "test_pcp-pmda-cifs_function_collect",
"desc": "Test metric collection from PMDA"
},
{
"name": "test_pcp-pmda-cifs_function_query",
"desc": "Test querying specific CIFS metrics"
}
]
}

View File

@@ -1,14 +0,0 @@
{
"path": "$OET_PATH/testcases/function_test/pkg_test/shrinkwrap-resolver/shrinkwrap-resolver-bom",
"machine num": 1,
"cases": [
{
"name": "test_shrinkwrap-resolver-bom_function_install",
"desc": "Test package installation"
},
{
"name": "test_shrinkwrap-resolver-bom_function_dependency",
"desc": "Test dependency resolution"
}
]
}

View File

@@ -6,10 +6,6 @@
"name": "test_snappy-java-javadoc_uninstall",
"desc": "测试snappy-java-javadoc软件包的卸载功能验证卸载过程是否成功。",
"machine num": 1
},
{
"name": "test_snappy-java-javadoc_function_docgen",
"desc": "测试snappy-java-javadoc软件包的文档生成功能验证生成的文档是否完整且格式正确。"
}
]
}

View File

@@ -1,10 +0,0 @@
{
"path": "$OET_PATH/testcases/function_test/pkg_test/texlive-split-b/texlive-assoccnt-doc",
"machine num": 1,
"cases": [
{
"name": "test_texlive-assoccnt-doc_function_basic",
"desc": "Test basic functionality"
}
]
}

View File

@@ -1,10 +0,0 @@
{
"path": "$OET_PATH/testcases/function_test/pkg_test/texlive-split-f/texlive-crop",
"machine num": 1,
"cases": [
{
"name": "test_texlive-crop_function_install",
"desc": "Test installation of texlive-crop package"
}
]
}

View File

@@ -10,18 +10,6 @@
{
"name": "test_texlive-esint-type1_uninstall",
"desc": "测试 texlive-esint-type1 软件包的卸载功能,验证是否能够成功卸载。"
},
{
"name": "test_texlive-esint-type1_version",
"desc": "测试 texlive-esint-type1 软件包的版本查询功能,验证是否能正确获取版本信息。"
},
{
"name": "test_texlive-esint-type1_file_exist",
"desc": "测试 texlive-esint-type1 软件包的核心文件是否存在,验证安装是否完整。"
},
{
"name": "test_texlive-esint-type1_usage",
"desc": "测试 texlive-esint-type1 软件包的基本使用功能验证其提供的数学符号如积分符号能否在LaTeX文档中正常渲染。"
}
]
}

View File

@@ -2,14 +2,6 @@
"path": "$OET_PATH/testcases/function_test/pkg_test/texlive-split-r/texlive-pm-isomath",
"machine num": 1,
"cases": [
{
"name": "test_texlive-pm-isomath_function_math",
"desc": "Test basic math functionality"
},
{
"name": "test_texlive-pm-isomath_function_install",
"desc": "Test the installation of the texlive-pm-isomath package"
},
{
"name": "test_texlive-pm-isomath_function_remove",
"desc": "Test the removal of the texlive-pm-isomath package"
@@ -17,14 +9,6 @@
{
"name": "test_texlive-pm-isomath_function_check_installed",
"desc": "Test if the texlive-pm-isomath package is installed"
},
{
"name": "test_texlive-pm-isomath_function_load_package",
"desc": "Test loading the isomath package in a LaTeX document"
},
{
"name": "test_texlive-pm-isomath_function_math_commands",
"desc": "Test basic isomath math commands"
}
]
}

View File

@@ -1,10 +0,0 @@
{
"path": "$OET_PATH/testcases/function_test/pkg_test/texlive-split-s/texlive-progress",
"machine num": 1,
"cases": [
{
"name": "test_texlive-progress_function_basic",
"desc": "Test basic functionality of texlive-progress"
}
]
}

View File

@@ -1,30 +0,0 @@
{
"path": "$OET_PATH/testcases/function_test/pkg_test/texlive-split-y/texlive-stringenc",
"machine num": 1,
"cases": [
{
"name": "test_texlive-stringenc_function_convert",
"desc": "Test the string conversion functionality"
},
{
"name": "test_texlive-stringenc_function_install",
"desc": "Test the installation of texlive-stringenc package"
},
{
"name": "test_texlive-stringenc_function_check_installed",
"desc": "Test if texlive-stringenc is installed"
},
{
"name": "test_texlive-stringenc_function_encode",
"desc": "Test string encoding conversion"
},
{
"name": "test_texlive-stringenc_function_decode",
"desc": "Test string decoding conversion"
},
{
"name": "test_texlive-stringenc_function_remove",
"desc": "Test removal of texlive-stringenc"
}
]
}

View File

@@ -1,10 +0,0 @@
{
"path": "$OET_PATH/testcases/function_test/pkg_test/texlive-split-y/texlive-uni-wtal-lin",
"machine num": 1,
"cases": [
{
"name": "test_texlive-uni-wtal-lin_function_basic",
"desc": "Test basic functionality of texlive-uni-wtal-lin package"
}
]
}

View File

@@ -2,10 +2,6 @@
"path": "$OET_PATH/testcases/function_test/pkg_test/texlive-split-z/texlive-mathcommand",
"machine num": 1,
"cases": [
{
"name": "test_texlive-mathcommand_function_math",
"desc": "Test basic math command functionality"
},
{
"name": "test_texlive-mathcommand_function_install",
"desc": "Test the installation of the texlive-mathcommand package"
@@ -17,14 +13,6 @@
{
"name": "test_texlive-mathcommand_function_check",
"desc": "Test checking if the package is installed"
},
{
"name": "test_texlive-mathcommand_function_usage",
"desc": "Test basic usage of math commands"
},
{
"name": "test_texlive-mathcommand_function_help",
"desc": "Test accessing package documentation or help"
}
]
}

View File

@@ -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-02-22
# @License : Mulan PSL v2
# @Desc : 测试OpenEXR开发头文件的存在与可包含性
# ############################################
source "$OET_PATH/libs/locallibs/common_lib.sh"
function run_test() {
# 判断是否已经安装OpenEXR-devel软件包
LOG_INFO "检查是否已安装OpenEXR-devel软件包"
rpm -q OpenEXR-devel > /dev/null 2>&1
is_installed=$?
# 如果未安装则先尝试从yum源查找
if [ $is_installed -ne 0 ]; then
LOG_INFO "OpenEXR-devel未安装检查yum源中是否存在该软件包"
dnf list available OpenEXR-devel > /dev/null 2>&1
if [ $? -ne 0 ]; then
LOG_ERROR "yum源中未找到OpenEXR-devel软件包"
exit 255
fi
LOG_INFO "开始安装OpenEXR-devel软件包"
dnf install -y OpenEXR-devel
CHECK_RESULT $? 0 0 "安装OpenEXR-devel失败"
# 标记为本次安装,结束时需要卸载
need_uninstall=1
else
LOG_INFO "OpenEXR-devel已安装跳过安装步骤"
need_uninstall=0
fi
# 测试开发头文件的存在
LOG_INFO "检查OpenEXR开发头文件是否存在"
header_file="/usr/include/OpenEXR/ImfHeader.h"
if [ ! -f "$header_file" ]; then
LOG_ERROR "OpenEXR开发头文件不存在: $header_file"
# 如果need_uninstall=1说明是本次安装的需要卸载
if [ $need_uninstall -eq 1 ]; then
LOG_INFO "清理环境卸载OpenEXR-devel软件包"
dnf remove -y OpenEXR-devel
fi
exit 1
fi
LOG_INFO "OpenEXR开发头文件存在: $header_file"
# 测试头文件的可包含性
LOG_INFO "测试OpenEXR开发头文件的可包含性"
test_c_file="/tmp/test_openexr_include.c"
cat > $test_c_file << "EOF"
#include <OpenEXR/ImfHeader.h>
int main() {
return 0;
}
EOF
gcc -c $test_c_file -o /tmp/test_openexr_include.o 2>&1
CHECK_RESULT $? 0 0 "OpenEXR开发头文件无法包含或编译失败"
LOG_INFO "OpenEXR开发头文件可正常包含并编译"
# 清理测试文件
LOG_INFO "清理测试文件"
rm -f $test_c_file /tmp/test_openexr_include.o
# 环境恢复:如果本次安装的,则卸载
if [ $need_uninstall -eq 1 ]; then
LOG_INFO "清理环境卸载OpenEXR-devel软件包"
dnf remove -y OpenEXR-devel
CHECK_RESULT $? 0 0 "卸载OpenEXR-devel失败"
fi
LOG_INFO "测试完成"
}
main "$@"

View File

@@ -1,79 +0,0 @@
#!/usr/bin/bash
# Copyright (c) 2024 ISCAS .ALL rights reserved.
# This program is licensed under Mulan PSL v2.
# You can use it according to the terms and conditions of the Mulan PSL v2.
# http://license.coscl.org.cn/MulanPSL2
# THIS PROGRAM IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND,
# EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT,
# MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE.
# See the Mulan PSL v2 for more details.
# #############################################
# @Author : honghua
# @Contact : honghua@iscas.ac.cn
# @Date : 2026-02-22
# @License : Mulan PSL v2
# @Desc : 测试使用OpenEXR库进行简单的程序编译与链接
# ############################################
source "$OET_PATH/libs/locallibs/common_lib.sh"
function run_test() {
LOG_INFO "开始测试OpenEXR库的编译与链接功能"
LOG_INFO "步骤一检查系统中是否已安装OpenEXR-devel软件包"
rpm -q OpenEXR-devel > /dev/null 2>&1
if [ $? -eq 0 ]; then
LOG_INFO "OpenEXR-devel已安装测试结束后将保持安装状态"
INSTALLED=1
else
LOG_INFO "OpenEXR-devel未安装将在测试过程中安装"
INSTALLED=0
fi
LOG_INFO "步骤二检查yum源中是否有OpenEXR-devel软件包"
dnf list available OpenEXR-devel > /dev/null 2>&1
if [ $? -ne 0 ]; then
LOG_ERROR "yum源中未找到OpenEXR-devel软件包"
exit 255
fi
LOG_INFO "步骤三安装OpenEXR-devel软件包"
if [ $INSTALLED -eq 0 ]; then
dnf install -y OpenEXR-devel
CHECK_RESULT $? 0 0 "安装OpenEXR-devel失败"
fi
LOG_INFO "步骤四:创建测试程序源码文件"
cat > test_openexr.c << "EOF"
#include <OpenEXR/OpenEXRConfig.h>
#include <stdio.h>
int main() {
printf("OpenEXR version: %s\n", OPENEXR_VERSION_STRING);
return 0;
}
EOF
CHECK_RESULT $? 0 0 "创建测试源码文件失败"
LOG_INFO "步骤五:编译测试程序"
gcc test_openexr.c -o test_openexr -lOpenEXR
CHECK_RESULT $? 0 0 "编译测试程序失败"
LOG_INFO "步骤六:运行测试程序"
./test_openexr
CHECK_RESULT $? 0 0 "运行测试程序失败"
LOG_INFO "步骤七:清理临时文件"
rm -f test_openexr.c test_openexr
CHECK_RESULT $? 0 0 "清理临时文件失败"
LOG_INFO "步骤八卸载OpenEXR-devel软件包如果测试前未安装"
if [ $INSTALLED -eq 0 ]; then
dnf remove -y OpenEXR-devel
CHECK_RESULT $? 0 0 "卸载OpenEXR-devel失败"
fi
LOG_INFO "测试完成"
}
main "$@"

View File

@@ -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 : Test configuration of the test SPI
# ############################################
source "$OET_PATH/libs/locallibs/common_lib.sh"
function run_test() {
# 检查arquillian-container-test-spi软件包是否已安装
LOG_INFO "检查arquillian-container-test-spi软件包是否已安装"
rpm -q arquillian-container-test-spi > /dev/null 2>&1
if [ $? -eq 0 ]; then
LOG_INFO "arquillian-container-test-spi软件包已安装"
installed=true
else
LOG_INFO "arquillian-container-test-spi软件包未安装"
installed=false
fi
# 检查yum源中是否存在arquillian-container-test-spi软件包
LOG_INFO "检查yum源中是否存在arquillian-container-test-spi软件包"
dnf list available arquillian-container-test-spi > /dev/null 2>&1
if [ $? -ne 0 ]; then
LOG_ERROR "yum源中不存在arquillian-container-test-spi软件包"
exit 255
fi
# 如果未安装则安装arquillian-container-test-spi软件包
if [ "$installed" = false ]; then
LOG_INFO "开始安装arquillian-container-test-spi软件包"
dnf install -y arquillian-container-test-spi
CHECK_RESULT $? 0 0 "安装arquillian-container-test-spi软件包失败"
fi
# 测试配置功能
LOG_INFO "测试arquillian-container-test-spi的配置功能"
test_command="arquillian-container-test-spi --config"
$test_command
CHECK_RESULT $? 0 0 "测试arquillian-container-test-spi配置功能失败"
# 检查参数是否存在
LOG_INFO "检查arquillian-container-test-spi是否支持--invalid-param参数"
test_command="arquillian-container-test-spi --invalid-param"
$test_command > /dev/null 2>&1
if [ $? -ne 255 ]; then
LOG_ERROR "arquillian-container-test-spi不支持--invalid-param参数"
exit 255
fi
# 如果脚本开始时未安装,则在脚本结束时卸载软件包
if [ "$installed" = false ]; then
LOG_INFO "卸载arquillian-container-test-spi软件包"
dnf remove -y arquillian-container-test-spi
CHECK_RESULT $? 0 0 "卸载arquillian-container-test-spi软件包失败"
fi
LOG_INFO "测试脚本执行完成"
}
main "$@"

View File

@@ -1,64 +0,0 @@
#!/usr/bin/bash
# Copyright (c) 2024 ISCAS .ALL rights reserved.
# This program is licensed under Mulan PSL v2.
# You can use it according to the terms and conditions of the Mulan PSL v2.
# http://license.coscl.org.cn/MulanPSL2
# THIS PROGRAM IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND,
# EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT,
# MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE.
# See the Mulan PSL v2 for more details.
# #############################################
# @Author : honghua
# @Contact : honghua@iscas.ac.cn
# @Date : 2025-12-10
# @License : Mulan PSL v2
# @Desc : Test deployment of the test SPI
# ############################################
source "$OET_PATH/libs/locallibs/common_lib.sh"
function run_test() {
# 检查arquillian-container-test-spi是否已安装
LOG_INFO "检查arquillian-container-test-spi是否已安装"
rpm -q arquillian-container-test-spi > /dev/null 2>&1
if [ $? -eq 0 ]; then
LOG_INFO "arquillian-container-test-spi已安装脚本结束后将保持安装状态"
INSTALLED=true
else
LOG_INFO "arquillian-container-test-spi未安装将在测试完成后卸载"
INSTALLED=false
fi
# 检查yum源中是否存在arquillian-container-test-spi软件包
LOG_INFO "检查yum源中是否存在arquillian-container-test-spi软件包"
dnf list available arquillian-container-test-spi > /dev/null 2>&1
CHECK_RESULT $? 0 255 "yum源中不存在arquillian-container-test-spi软件包"
# 安装arquillian-container-test-spi软件包
if [ "$INSTALLED" = false ]; then
LOG_INFO "安装arquillian-container-test-spi软件包"
dnf install -y arquillian-container-test-spi
CHECK_RESULT $? 0 0 "安装arquillian-container-test-spi软件包失败"
fi
# 测试部署功能
LOG_INFO "测试部署功能"
deploy_command="arquillian-container-test-spi deploy --test"
$deploy_command > /dev/null 2>&1
CHECK_RESULT $? 0 255 "部署命令执行失败或参数不支持"
# 清理环境(如果脚本开始时未安装,则卸载)
if [ "$INSTALLED" = false ]; then
LOG_INFO "卸载arquillian-container-test-spi软件包"
dnf remove -y arquillian-container-test-spi
CHECK_RESULT $? 0 0 "卸载arquillian-container-test-spi软件包失败"
fi
LOG_INFO "测试完成,环境已恢复"
}
main "$@"

View File

@@ -1,90 +0,0 @@
#!/usr/bin/bash
# Copyright (c) 2024 ISCAS .ALL rights reserved.
# This program is licensed under Mulan PSL v2.
# You can use it according to the terms and conditions of the Mulan PSL v2.
# http://license.coscl.org.cn/MulanPSL2
# THIS PROGRAM IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND,
# EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT,
# MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE.
# See the Mulan PSL v2 for more details.
# #############################################
# @Author : honghua
# @Contact : honghua@iscas.ac.cn
# @Date : 2025-12-10
# @License : Mulan PSL v2
# @Desc : Test execution of the test SPI
# ############################################
source "$OET_PATH/libs/locallibs/common_lib.sh"
function run_test() {
# 检查yum源中是否存在指定软件包
check_package_exist() {
dnf list available "$1" &> /dev/null
if [ $? -ne 0 ]; then
LOG_ERROR "软件包 $1 在yum源中不存在"
exit 255
fi
}
# 检查命令参数是否支持
check_command_option() {
if ! $1 --help | grep -q "$2"; then
LOG_ERROR "命令 $1 不支持参数 $2"
exit 255
fi
}
# 主测试函数
test_arquillian_container_test_spi_function_exec() {
LOG_INFO "开始测试Test execution of the test SPI"
# 检查是否已安装软件包
if rpm -q arquillian-container-test-spi &> /dev/null; then
LOG_INFO "环境已安装 arquillian-container-test-spi测试后保持安装状态"
INSTALLED=true
else
LOG_INFO "环境未安装 arquillian-container-test-spi测试前将安装"
INSTALLED=false
fi
# 检查yum源中是否存在软件包
check_package_exist "arquillian-container-test-spi"
# 安装软件包(如果未安装)
if [ "$INSTALLED" = false ]; then
LOG_INFO "正在安装 arquillian-container-test-spi..."
dnf install -y arquillian-container-test-spi &> /dev/null
CHECK_RESULT $? 0 0 "安装 arquillian-container-test-spi 失败"
fi
# 测试命令执行(示例命令,需根据实际需求调整)
LOG_INFO "执行测试命令..."
test_command="arquillian-container-test-spi --test-execution"
# 检查命令参数是否支持(示例参数,需根据实际需求调整)
check_command_option "$test_command" "--test-execution"
# 执行命令并检查结果
$test_command &> /dev/null
CHECK_RESULT $? 0 0 "测试命令执行失败"
# 卸载软件包(如果之前未安装)
if [ "$INSTALLED" = false ]; then
LOG_INFO "正在卸载 arquillian-container-test-spi..."
dnf remove -y arquillian-container-test-spi &> /dev/null
CHECK_RESULT $? 0 0 "卸载 arquillian-container-test-spi 失败"
fi
LOG_INFO "测试完成Test execution of the test SPI"
}
# 调用主测试函数并处理退出码
test_arquillian_container_test_spi_function_exec || exit $?
}
main "$@"

View File

@@ -1,136 +0,0 @@
#!/usr/bin/bash
# Copyright (c) 2024 ISCAS .ALL rights reserved.
# This program is licensed under Mulan PSL v2.
# You can use it according to the terms and conditions of the Mulan PSL v2.
# http://license.coscl.org.cn/MulanPSL2
# THIS PROGRAM IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND,
# EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT,
# MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE.
# See the Mulan PSL v2 for more details.
# #############################################
# @Author : honghua
# @Contact : honghua@iscas.ac.cn
# @Date : 2026-03-23
# @License : Mulan PSL v2
# @Desc : 测试 boost-iostreams 的内存流读写功能。
# ############################################
source "$OET_PATH/libs/locallibs/common_lib.sh"
function run_test() {
# 检查是否已经安装boost-iostreams
LOG_INFO "检查是否已经安装boost-iostreams软件包..."
rpm -q boost-iostreams > /dev/null 2>&1
if [ $? -eq 0 ]; then
LOG_INFO "检测到boost-iostreams已经安装脚本结束时将保持安装状态。"
INSTALLED_BEFORE=1
else
LOG_INFO "未检测到boost-iostreams安装将在测试过程中安装。"
INSTALLED_BEFORE=0
fi
# 检查yum源中是否有boost-iostreams软件包
LOG_INFO "检查yum源中是否存在boost-iostreams软件包..."
dnf list available boost-iostreams > /dev/null 2>&1
if [ $? -ne 0 ]; then
LOG_ERROR "yum源中未找到boost-iostreams软件包退出测试。"
exit 255
fi
# 如果未安装则安装boost-iostreams
if [ $INSTALLED_BEFORE -eq 0 ]; then
LOG_INFO "正在安装boost-iostreams软件包..."
dnf install -y boost-iostreams
CHECK_RESULT $? 0 0 "安装boost-iostreams失败"
fi
# 测试步骤1编写一个简单的C++测试程序,测试内存流读写功能
LOG_INFO "步骤1编写测试内存流读写功能的C++程序..."
cat > test_memory_stream.cpp << "EOF"
#include <iostream>
#include <boost/iostreams/device/array.hpp>
#include <boost/iostreams/stream.hpp>
#include <string>
#include <cassert>
namespace io = boost::iostreams;
int main() {
// 准备测试数据
const std::string test_data = "Hello, Boost Iostreams Memory Stream!";
const size_t data_size = test_data.size();
// 1. 测试内存读取流
char* buffer = new char[data_size];
std::copy(test_data.begin(), test_data.end(), buffer);
io::array_source source(buffer, data_size);
io::stream<io::array_source> in(source);
std::string read_result;
std::getline(in, read_result);
if (read_result != test_data) {
std::cerr << "读取测试失败: 期望 "" << test_data
<< "", 实际 "" << read_result << """ << std::endl;
delete[] buffer;
return 1;
}
std::cout << "内存读取流测试通过。" << std::endl;
// 2. 测试内存写入流
char* out_buffer = new char[data_size];
io::array_sink sink(out_buffer, data_size);
io::stream<io::array_sink> out(sink);
out << test_data;
out.flush();
std::string write_result(out_buffer, data_size);
if (write_result != test_data) {
std::cerr << "写入测试失败: 期望 "" << test_data
<< "", 实际 "" << write_result << """ << std::endl;
delete[] buffer;
delete[] out_buffer;
return 1;
}
std::cout << "内存写入流测试通过。" << std::endl;
delete[] buffer;
delete[] out_buffer;
return 0;
}
EOF
CHECK_RESULT $? 0 0 "创建测试程序文件失败"
# 测试步骤2编译测试程序
LOG_INFO "步骤2编译测试程序..."
g++ -o test_memory_stream test_memory_stream.cpp -lboost_iostreams
CHECK_RESULT $? 0 0 "编译测试程序失败"
# 测试步骤3运行测试程序
LOG_INFO "步骤3运行测试程序..."
./test_memory_stream
CHECK_RESULT $? 0 0 "内存流读写功能测试失败"
LOG_INFO "boost-iostreams内存流读写功能测试通过。"
# 清理临时文件
LOG_INFO "清理临时测试文件..."
rm -f test_memory_stream.cpp test_memory_stream
# 环境恢复如果之前未安装则卸载boost-iostreams
if [ $INSTALLED_BEFORE -eq 0 ]; then
LOG_INFO "恢复环境卸载测试安装的boost-iostreams软件包..."
dnf remove -y boost-iostreams
CHECK_RESULT $? 0 0 "卸载boost-iostreams失败"
LOG_INFO "环境已恢复到初始状态。"
else
LOG_INFO "保持boost-iostreams安装状态不变。"
fi
}
main "$@"

View File

@@ -1,144 +0,0 @@
#!/usr/bin/bash
# Copyright (c) 2024 ISCAS .ALL rights reserved.
# This program is licensed under Mulan PSL v2.
# You can use it according to the terms and conditions of the Mulan PSL v2.
# http://license.coscl.org.cn/MulanPSL2
# THIS PROGRAM IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND,
# EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-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-12
# @License : Mulan PSL v2
# @Desc : Test compiling a simple program using libnvme headers and libraries
# ############################################
source "$OET_PATH/libs/locallibs/common_lib.sh"
function run_test() {
# 定义函数用于检查软件包是否存在
check_package_exist() {
local pkg_name=$1
LOG_INFO "检查yum源中是否存在软件包: $pkg_name"
dnf list available "$pkg_name" &> /dev/null
if [ $? -ne 0 ]; then
LOG_ERROR "yum源中不存在软件包: $pkg_name"
exit 255
fi
}
# 定义函数用于检查命令参数是否支持
check_command_option() {
local cmd=$1
local option=$2
LOG_INFO "检查命令 $cmd 是否支持参数 $option"
if ! $cmd --help 2>&1 | grep -q "$option"; then
LOG_ERROR "命令 $cmd 不支持参数 $option"
exit 255
fi
}
# 定义函数用于执行命令并检查结果
execute_command() {
local cmd=$1
LOG_INFO "执行命令: $cmd"
eval $cmd
CHECK_RESULT $? 0 0 "命令执行失败: $cmd"
}
# 定义函数用于安装软件包
install_package() {
local pkg_name=$1
LOG_INFO "安装软件包: $pkg_name"
dnf install -y "$pkg_name"
CHECK_RESULT $? 0 0 "安装软件包失败: $pkg_name"
}
# 定义函数用于卸载软件包
uninstall_package() {
local pkg_name=$1
LOG_INFO "卸载软件包: $pkg_name"
dnf remove -y "$pkg_name"
CHECK_RESULT $? 0 0 "卸载软件包失败: $pkg_name"
}
# 定义函数用于检查环境是否已安装
check_environment_installed() {
LOG_INFO "检查环境是否已安装libnvme-devel"
rpm -q libnvme-devel &> /dev/null
if [ $? -eq 0 ]; then
LOG_INFO "环境已安装libnvme-devel"
ENV_INSTALLED=1
else
LOG_INFO "环境未安装libnvme-devel"
ENV_INSTALLED=0
fi
}
# 定义函数用于清理环境
cleanup_environment() {
if [ $ENV_INSTALLED -eq 0 ]; then
LOG_INFO "清理环境: 卸载libnvme-devel"
uninstall_package "libnvme-devel"
fi
}
# 主函数
main() {
# 初始化环境安装状态
ENV_INSTALLED=0
# 检查环境是否已安装libnvme-devel
check_environment_installed
# 检查yum源中是否存在libnvme-devel软件包
check_package_exist "libnvme-devel"
# 如果环境未安装libnvme-devel则安装
if [ $ENV_INSTALLED -eq 0 ]; then
install_package "libnvme-devel"
fi
# 检查gcc命令是否支持-c参数
check_command_option "gcc" "-c"
# 创建测试程序源码
LOG_INFO "创建测试程序源码"
cat > test_libnvme.c << "EOF"
#include <stdio.h>
#include <libnvme.h>
int main() {
printf("Testing libnvme header and library...\n");
return 0;
}
EOF
# 编译测试程序
LOG_INFO "编译测试程序"
execute_command "gcc -c test_libnvme.c -o test_libnvme.o"
execute_command "gcc test_libnvme.o -lnvme -o test_libnvme"
# 运行测试程序
LOG_INFO "运行测试程序"
execute_command "./test_libnvme"
# 清理临时文件
LOG_INFO "清理临时文件"
rm -f test_libnvme.c test_libnvme.o test_libnvme
# 清理环境
cleanup_environment
LOG_INFO "测试完成"
}
# 执行主函数
main
}
main "$@"

View File

@@ -1,86 +0,0 @@
#!/usr/bin/bash
# Copyright (c) 2024 ISCAS .ALL rights reserved.
# This program is licensed under Mulan PSL v2.
# You can use it according to the terms and conditions of the Mulan PSL v2.
# http://license.coscl.org.cn/MulanPSL2
# THIS PROGRAM IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND,
# EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT,
# MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE.
# See the Mulan PSL v2 for more details.
# #############################################
# @Author : honghua
# @Contact : honghua@iscas.ac.cn
# @Date : 2026-03-12
# @License : Mulan PSL v2
# @Desc : Test library error handling for invalid inputs
# ############################################
source "$OET_PATH/libs/locallibs/common_lib.sh"
function run_test() {
# 定义颜色和日志函数
LOG_INFO() {
echo "[INFO] $1"
}
LOG_ERROR() {
echo "[ERROR] $1"
}
# 定义软件包名称
PACKAGE_NAME="libnvme-devel"
TEST_COMMAND="nvme"
TEST_PARAM="--invalid-param"
# 步骤1: 检查yum源中是否存在libnvme-devel软件包
LOG_INFO "检查yum源中是否存在$PACKAGE_NAME软件包"
dnf list available $PACKAGE_NAME &>/dev/null
if [ $? -ne 0 ]; then
LOG_ERROR "yum源中未找到$PACKAGE_NAME软件包"
exit 255
fi
# 步骤2: 检查当前是否已安装libnvme-devel软件包
LOG_INFO "检查当前是否已安装$PACKAGE_NAME软件包"
INSTALLED=false
if rpm -q $PACKAGE_NAME &>/dev/null; then
INSTALLED=true
LOG_INFO "$PACKAGE_NAME已安装,脚本结束后将保持安装状态"
else
LOG_INFO "$PACKAGE_NAME未安装,将在测试步骤中安装"
fi
# 步骤3: 如果未安装则安装libnvme-devel软件包
if [ "$INSTALLED" = false ]; then
LOG_INFO "安装$PACKAGE_NAME软件包"
dnf install -y $PACKAGE_NAME
CHECK_RESULT $? 0 0 "安装$PACKAGE_NAME失败"
fi
# 步骤4: 检查nvme命令是否支持--invalid-param参数
LOG_INFO "检查$TEST_COMMAND命令是否支持$TEST_PARAM参数"
$TEST_COMMAND $TEST_PARAM &>/dev/null
if [ $? -ne 255 ]; then
LOG_ERROR "$TEST_COMMAND命令支持$TEST_PARAM参数,但预期不支持"
exit 255
fi
# 步骤5: 测试无效参数的错误处理
LOG_INFO "测试无效参数的错误处理"
$TEST_COMMAND $TEST_PARAM 2>&1 | grep -q "invalid"
CHECK_RESULT $? 0 0 "无效参数错误处理失败"
# 步骤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 "$@"

View File

@@ -1,108 +0,0 @@
#!/usr/bin/bash
# Copyright (c) 2024 ISCAS .ALL rights reserved.
# This program is licensed under Mulan PSL v2.
# You can use it according to the terms and conditions of the Mulan PSL v2.
# http://license.coscl.org.cn/MulanPSL2
# THIS PROGRAM IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND,
# EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT,
# MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE.
# See the Mulan PSL v2 for more details.
# #############################################
# @Author : honghua
# @Contact : honghua@iscas.ac.cn
# @Date : 2026-03-12
# @License : Mulan PSL v2
# @Desc : Test retrieving NVMe controller identify information
# ############################################
source "$OET_PATH/libs/locallibs/common_lib.sh"
function run_test() {
LOG_INFO "开始测试Test retrieving NVMe controller identify information"
# 检查libnvme-devel包是否已安装
LOG_INFO "步骤1检查libnvme-devel软件包是否已安装"
rpm -q libnvme-devel &> /dev/null
if [ $? -eq 0 ]; then
LOG_INFO "libnvme-devel软件包已安装测试后将保持安装状态"
ALREADY_INSTALLED=1
else
LOG_INFO "libnvme-devel软件包未安装"
ALREADY_INSTALLED=0
fi
# 检查yum源中是否存在libnvme-devel包
LOG_INFO "步骤2检查yum源中是否存在libnvme-devel软件包"
dnf list available libnvme-devel &> /dev/null
if [ $? -ne 0 ]; then
LOG_ERROR "yum源中未找到libnvme-devel软件包"
exit 255
fi
# 如果未安装,则进行安装
if [ $ALREADY_INSTALLED -eq 0 ]; then
LOG_INFO "步骤3安装libnvme-devel软件包"
dnf install -y libnvme-devel
CHECK_RESULT $? 0 0 "安装libnvme-devel软件包失败"
fi
# 检查nvme命令是否存在
LOG_INFO "步骤4检查nvme命令是否存在"
command -v nvme &> /dev/null
if [ $? -ne 0 ]; then
LOG_ERROR "nvme命令不存在"
if [ $ALREADY_INSTALLED -eq 0 ]; then
LOG_INFO "清理环境卸载已安装的libnvme-devel软件包"
dnf remove -y libnvme-devel
fi
exit 255
fi
# 检查nvme list命令是否支持
LOG_INFO "步骤5检查nvme list命令是否支持"
nvme list --help &> /dev/null
if [ $? -ne 0 ]; then
LOG_ERROR "nvme list命令参数不支持"
if [ $ALREADY_INSTALLED -eq 0 ]; then
LOG_INFO "清理环境卸载已安装的libnvme-devel软件包"
dnf remove -y libnvme-devel
fi
exit 255
fi
# 执行nvme list命令获取NVMe控制器信息
LOG_INFO "步骤6执行nvme list命令获取NVMe控制器信息"
nvme list
CHECK_RESULT $? 0 0 "执行nvme list命令失败"
# 检查是否有NVMe设备
LOG_INFO "步骤7检查系统中是否存在NVMe设备"
NVME_COUNT=$(nvme list | grep -c "/dev/nvme")
if [ $NVME_COUNT -eq 0 ]; then
LOG_INFO "系统中未检测到NVMe设备跳过详细识别信息测试"
else
# 获取第一个NVMe控制器的识别信息
LOG_INFO "步骤8获取第一个NVMe控制器的识别信息"
FIRST_NVME=$(nvme list | grep "/dev/nvme" | head -1 | awk "{print $1}")
if [ -n "$FIRST_NVME" ]; then
nvme id-ctrl $FIRST_NVME
CHECK_RESULT $? 0 0 "获取NVMe控制器识别信息失败"
fi
fi
# 环境清理
LOG_INFO "步骤9清理测试环境"
if [ $ALREADY_INSTALLED -eq 0 ]; then
LOG_INFO "卸载测试安装的libnvme-devel软件包"
dnf remove -y libnvme-devel
CHECK_RESULT $? 0 0 "卸载libnvme-devel软件包失败"
else
LOG_INFO "保持libnvme-devel软件包安装状态"
fi
LOG_INFO "测试完成Test retrieving NVMe controller identify information"
}
main "$@"

View File

@@ -1,111 +0,0 @@
#!/usr/bin/bash
# Copyright (c) 2024 ISCAS .ALL rights reserved.
# This program is licensed under Mulan PSL v2.
# You can use it according to the terms and conditions of the Mulan PSL v2.
# http://license.coscl.org.cn/MulanPSL2
# THIS PROGRAM IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND,
# EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT,
# MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE.
# See the Mulan PSL v2 for more details.
# #############################################
# @Author : honghua
# @Contact : honghua@iscas.ac.cn
# @Date : 2026-03-12
# @License : Mulan PSL v2
# @Desc : Test retrieving NVMe device SMART log data
# ############################################
source "$OET_PATH/libs/locallibs/common_lib.sh"
function run_test() {
# 测试脚本Test retrieving NVMe device SMART log data
# 检查环境是否已安装libnvme-devel
LOG_INFO "检查是否已安装libnvme-devel软件包"
rpm -q libnvme-devel > /dev/null 2>&1
if [ $? -eq 0 ]; then
LOG_INFO "libnvme-devel已安装标记为已安装状态"
ALREADY_INSTALLED=1
else
LOG_INFO "libnvme-devel未安装标记为未安装状态"
ALREADY_INSTALLED=0
fi
# 检查yum源中是否有libnvme-devel软件包
LOG_INFO "检查yum源中是否有libnvme-devel软件包"
dnf list available libnvme-devel > /dev/null 2>&1
if [ $? -ne 0 ]; then
LOG_ERROR "yum源中没有libnvme-devel软件包"
exit 255
fi
# 如果未安装则安装libnvme-devel
if [ $ALREADY_INSTALLED -eq 0 ]; then
LOG_INFO "开始安装libnvme-devel软件包"
dnf install -y libnvme-devel
CHECK_RESULT $? 0 0 "安装libnvme-devel失败"
fi
# 检查nvme命令是否可用
LOG_INFO "检查nvme命令是否可用"
which nvme > /dev/null 2>&1
if [ $? -ne 0 ]; then
LOG_ERROR "nvme命令不存在"
# 如果是新安装的,需要卸载软件包
if [ $ALREADY_INSTALLED -eq 0 ]; then
dnf remove -y libnvme-devel
fi
exit 255
fi
# 检查nvme命令是否支持smart-log子命令
LOG_INFO "检查nvme命令是否支持smart-log子命令"
nvme help 2>&1 | grep -q "smart-log"
if [ $? -ne 0 ]; then
LOG_ERROR "nvme命令不支持smart-log参数"
# 如果是新安装的,需要卸载软件包
if [ $ALREADY_INSTALLED -eq 0 ]; then
dnf remove -y libnvme-devel
fi
exit 255
fi
# 获取NVMe设备列表
LOG_INFO "获取NVMe设备列表"
NVME_DEVICES=$(nvme list 2>/dev/null | grep "^/dev/nvme" | awk "{print $1}")
if [ -z "$NVME_DEVICES" ]; then
LOG_INFO "系统中没有NVMe设备跳过SMART日志获取测试"
# 清理环境
if [ $ALREADY_INSTALLED -eq 0 ]; then
LOG_INFO "卸载libnvme-devel软件包"
dnf remove -y libnvme-devel
CHECK_RESULT $? 0 0 "卸载libnvme-devel失败"
fi
exit 0
fi
# 测试获取第一个NVMe设备的SMART日志
LOG_INFO "测试获取NVMe设备SMART日志"
FIRST_DEVICE=$(echo "$NVME_DEVICES" | head -1)
LOG_INFO "使用设备: $FIRST_DEVICE"
nvme smart-log $FIRST_DEVICE
CHECK_RESULT $? 0 0 "获取NVMe设备SMART日志失败"
LOG_INFO "NVMe设备SMART日志获取测试成功"
# 清理环境
if [ $ALREADY_INSTALLED -eq 0 ]; then
LOG_INFO "卸载libnvme-devel软件包"
dnf remove -y libnvme-devel
CHECK_RESULT $? 0 0 "卸载libnvme-devel失败"
else
LOG_INFO "保持libnvme-devel安装状态"
fi
LOG_INFO "测试完成,环境已恢复"
}
main "$@"

View File

@@ -1,67 +0,0 @@
#!/usr/bin/bash
# Copyright (c) 2024 ISCAS .ALL rights reserved.
# This program is licensed under Mulan PSL v2.
# You can use it according to the terms and conditions of the Mulan PSL v2.
# http://license.coscl.org.cn/MulanPSL2
# THIS PROGRAM IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND,
# EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT,
# MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE.
# See the Mulan PSL v2 for more details.
# #############################################
# @Author : honghua
# @Contact : honghua@iscas.ac.cn
# @Date : 2025-12-11
# @License : Mulan PSL v2
# @Desc : Test initialization of libnvme-devel library
# ############################################
source "$OET_PATH/libs/locallibs/common_lib.sh"
function run_test() {
LOG_INFO "开始测试Test initialization of libnvme-devel library"
# 检查是否已安装libnvme-devel
LOG_INFO "检查libnvme-devel是否已安装"
if dnf list installed libnvme-devel &>/dev/null; then
LOG_INFO "libnvme-devel已安装脚本结束后将保持安装状态"
INSTALLED=true
else
LOG_INFO "libnvme-devel未安装将在测试步骤中安装并在脚本结束前卸载"
INSTALLED=false
fi
# 检查yum源中是否有libnvme-devel软件包
LOG_INFO "检查yum源中是否存在libnvme-devel软件包"
if ! dnf list available libnvme-devel &>/dev/null; then
LOG_ERROR "yum源中不存在libnvme-devel软件包"
exit 255
fi
# 若未安装则安装libnvme-devel
if [ "$INSTALLED" = false ]; then
LOG_INFO "安装libnvme-devel"
dnf install -y libnvme-devel
CHECK_RESULT $? 0 0 "安装libnvme-devel失败"
fi
# 测试初始化功能
LOG_INFO "测试libnvme-devel库的初始化功能"
# 假设初始化命令为`nvme init`,此处仅为示例,实际命令需根据库文档调整
nvme init &>/dev/null
CHECK_RESULT $? 0 0 "libnvme-devel库初始化失败"
# 清理环境
if [ "$INSTALLED" = false ]; then
LOG_INFO "卸载libnvme-devel"
dnf remove -y libnvme-devel &>/dev/null
CHECK_RESULT $? 0 0 "卸载libnvme-devel失败"
fi
LOG_INFO "测试完成Test initialization of libnvme-devel library"
}
main "$@"

View File

@@ -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-12
# @License : Mulan PSL v2
# @Desc : Test library initialization and NVMe controller scanning
# ############################################
source "$OET_PATH/libs/locallibs/common_lib.sh"
function run_test() {
LOG_INFO "开始测试Test library initialization and NVMe controller scanning"
# 定义软件包名称
PACKAGE_NAME="libnvme-devel"
# 步骤1检查yum源中是否存在指定的软件包
LOG_INFO "步骤1检查yum源中是否存在软件包 $PACKAGE_NAME"
dnf list available $PACKAGE_NAME > /dev/null 2>&1
if [ $? -ne 0 ]; then
LOG_ERROR "yum源中未找到软件包 $PACKAGE_NAME"
exit 255
fi
# 步骤2检查系统是否已经安装了指定的软件包
LOG_INFO "步骤2检查系统是否已经安装了软件包 $PACKAGE_NAME"
rpm -q $PACKAGE_NAME > /dev/null 2>&1
if [ $? -eq 0 ]; then
LOG_INFO "软件包 $PACKAGE_NAME 已经安装,测试结束后将保持安装状态"
PACKAGE_INSTALLED=true
else
LOG_INFO "软件包 $PACKAGE_NAME 未安装,将在测试步骤中安装"
PACKAGE_INSTALLED=false
fi
# 步骤3安装软件包如果未安装
if [ "$PACKAGE_INSTALLED" = false ]; then
LOG_INFO "步骤3安装软件包 $PACKAGE_NAME"
dnf install -y $PACKAGE_NAME
CHECK_RESULT $? 0 0 "安装软件包 $PACKAGE_NAME 失败"
fi
# 步骤4测试库初始化和NVMe控制器扫描
LOG_INFO "步骤4测试库初始化和NVMe控制器扫描"
# 假设测试命令为 nvme-list检查该命令是否存在
command -v nvme-list > /dev/null 2>&1
if [ $? -ne 0 ]; then
LOG_ERROR "命令 nvme-list 不存在或不支持"
exit 255
fi
# 执行测试命令
nvme-list
CHECK_RESULT $? 0 0 "库初始化或NVMe控制器扫描失败"
# 步骤5清理环境恢复到之前的状态
LOG_INFO "步骤5清理环境恢复到之前的状态"
if [ "$PACKAGE_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 "测试完成Test library initialization and NVMe controller scanning"
}
main "$@"

View File

@@ -1,85 +0,0 @@
#!/usr/bin/bash
# Copyright (c) 2024 ISCAS .ALL rights reserved.
# This program is licensed under Mulan PSL v2.
# You can use it according to the terms and conditions of the Mulan PSL v2.
# http://license.coscl.org.cn/MulanPSL2
# THIS PROGRAM IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND,
# EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT,
# MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE.
# See the Mulan PSL v2 for more details.
# #############################################
# @Author : honghua
# @Contact : honghua@iscas.ac.cn
# @Date : 2026-03-12
# @License : Mulan PSL v2
# @Desc : Test basic NVMe namespace operations (list, get info)
# ############################################
source "$OET_PATH/libs/locallibs/common_lib.sh"
function run_test() {
LOG_INFO "开始测试NVMe命名空间基本操作列出、获取信息"
# 检查是否已安装libnvme-devel包
LOG_INFO "步骤1检查libnvme-devel包是否已安装"
if dnf list installed libnvme-devel > /dev/null 2>&1; then
LOG_INFO "libnvme-devel已安装标记为已存在"
PACKAGE_INSTALLED="true"
else
LOG_INFO "libnvme-devel未安装标记为未安装"
PACKAGE_INSTALLED="false"
fi
# 检查yum源中是否有libnvme-devel包
LOG_INFO "步骤2检查yum源中是否有libnvme-devel包"
if ! dnf list available libnvme-devel > /dev/null 2>&1; then
LOG_ERROR "yum源中未找到libnvme-devel包"
exit 255
fi
# 如果未安装则安装libnvme-devel包
if [ "$PACKAGE_INSTALLED" = "false" ]; then
LOG_INFO "步骤3安装libnvme-devel包"
dnf install -y libnvme-devel
CHECK_RESULT $? 0 0 "安装libnvme-devel包失败"
fi
# 检查nvme命令是否支持list和get-ns-id子命令
LOG_INFO "步骤4检查nvme命令是否支持list和get-ns-id子命令"
if ! nvme list --help > /dev/null 2>&1; then
LOG_ERROR "nvme命令不支持list参数"
exit 255
fi
if ! nvme get-ns-id --help > /dev/null 2>&1; then
LOG_ERROR "nvme命令不支持get-ns-id参数"
exit 255
fi
# 列出NVMe设备
LOG_INFO "步骤5列出NVMe设备"
nvme list
CHECK_RESULT $? 0 0 "列出NVMe设备失败"
# 获取NVMe命名空间信息
LOG_INFO "步骤6获取NVMe命名空间信息"
# 假设第一个NVMe设备为/dev/nvme0获取其第一个命名空间
if [ -b /dev/nvme0n1 ]; then
nvme get-ns-id /dev/nvme0n1
CHECK_RESULT $? 0 0 "获取NVMe命名空间信息失败"
else
LOG_INFO "未找到/dev/nvme0n1设备跳过获取命名空间信息步骤"
fi
# 环境恢复如果之前未安装libnvme-devel包则卸载
if [ "$PACKAGE_INSTALLED" = "false" ]; then
LOG_INFO "步骤7卸载libnvme-devel包"
dnf remove -y libnvme-devel
CHECK_RESULT $? 0 0 "卸载libnvme-devel包失败"
fi
LOG_INFO "测试完成"
}
main "$@"

View File

@@ -1,66 +0,0 @@
#!/usr/bin/bash
# Copyright (c) 2024 ISCAS .ALL rights reserved.
# This program is licensed under Mulan PSL v2.
# You can use it according to the terms and conditions of the Mulan PSL v2.
# http://license.coscl.org.cn/MulanPSL2
# THIS PROGRAM IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND,
# EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT,
# MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE.
# See the Mulan PSL v2 for more details.
# #############################################
# @Author : honghua
# @Contact : honghua@iscas.ac.cn
# @Date : 2025-12-08
# @License : Mulan PSL v2
# @Desc : Test basic functionality of libomxil-bellagio-devel
# ############################################
source "$OET_PATH/libs/locallibs/common_lib.sh"
function run_test() {
LOG_INFO "开始测试libomxil-bellagio-devel的基本功能"
# 检查是否已安装libomxil-bellagio-devel
LOG_INFO "检查libomxil-bellagio-devel是否已安装"
if rpm -q libomxil-bellagio-devel > /dev/null; then
LOG_INFO "libomxil-bellagio-devel已安装测试结束后保持安装状态"
INSTALLED=true
else
LOG_INFO "libomxil-bellagio-devel未安装将在测试结束后卸载"
INSTALLED=false
fi
# 检查yum源中是否有libomxil-bellagio-devel
LOG_INFO "检查yum源中是否有libomxil-bellagio-devel"
if ! dnf list available libomxil-bellagio-devel > /dev/null 2>&1; then
LOG_ERROR "yum源中未找到libomxil-bellagio-devel软件包"
exit 255
fi
# 如果未安装,则安装软件包
if [ "$INSTALLED" = false ]; then
LOG_INFO "开始安装libomxil-bellagio-devel"
dnf install -y libomxil-bellagio-devel
CHECK_RESULT $? 0 0 "安装libomxil-bellagio-devel失败"
fi
# 测试基本功能
LOG_INFO "测试libomxil-bellagio-devel的基本功能"
# 示例命令,根据实际需求替换为实际的测试命令
TEST_COMMAND="omxregister-bellagio -h"
$TEST_COMMAND
CHECK_RESULT $? 0 0 "执行$TEST_COMMAND失败"
# 清理环境
if [ "$INSTALLED" = false ]; then
LOG_INFO "卸载libomxil-bellagio-devel"
dnf remove -y libomxil-bellagio-devel
CHECK_RESULT $? 0 0 "卸载libomxil-bellagio-devel失败"
fi
LOG_INFO "测试libomxil-bellagio-devel的基本功能完成"
}
main "$@"

View File

@@ -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-11-30
# @License : Mulan PSL v2
# @Desc : 测试 javafxbase 基础功能
# ############################################
source "$OET_PATH/libs/locallibs/common_lib.sh"
function run_test() {
# 检查是否已安装openjfx8-devel软件包
LOG_INFO "检查是否已安装openjfx8-devel软件包"
rpm -q openjfx8-devel > /dev/null 2>&1
if [ $? -eq 0 ]; then
LOG_INFO "openjfx8-devel已安装脚本结束时将保持安装状态"
INSTALLED=true
else
LOG_INFO "openjfx8-devel未安装将在测试结束后卸载"
INSTALLED=false
fi
# 检查yum源中是否存在openjfx8-devel软件包
LOG_INFO "检查yum源中是否存在openjfx8-devel软件包"
dnf list available openjfx8-devel > /dev/null 2>&1
if [ $? -ne 0 ]; then
LOG_ERROR "yum源中未找到openjfx8-devel软件包"
exit 255
fi
# 安装openjfx8-devel软件包如果未安装
if [ "$INSTALLED" = false ]; then
LOG_INFO "正在安装openjfx8-devel软件包"
dnf install -y openjfx8-devel > /dev/null 2>&1
CHECK_RESULT $? 0 0 "安装openjfx8-devel软件包失败"
fi
# 测试javafxbase基础功能
LOG_INFO "测试javafxbase基础功能"
java -version > /dev/null 2>&1
CHECK_RESULT $? 0 0 "Java环境未安装或配置错误"
# 示例测试命令(可根据实际需求调整)
LOG_INFO "执行示例测试命令"
java -jar /path/to/javafxbase-test.jar > /dev/null 2>&1
CHECK_RESULT $? 0 0 "javafxbase基础功能测试失败"
# 清理环境(如果脚本开始时未安装)
if [ "$INSTALLED" = false ]; then
LOG_INFO "正在卸载openjfx8-devel软件包"
dnf remove -y openjfx8-devel > /dev/null 2>&1
CHECK_RESULT $? 0 0 "卸载openjfx8-devel软件包失败"
fi
LOG_INFO "测试脚本执行完成"
}
main "$@"

View File

@@ -1,68 +0,0 @@
#!/usr/bin/bash
# Copyright (c) 2024 ISCAS .ALL rights reserved.
# This program is licensed under Mulan PSL v2.
# You can use it according to the terms and conditions of the Mulan PSL v2.
# http://license.coscl.org.cn/MulanPSL2
# THIS PROGRAM IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND,
# EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT,
# MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE.
# See the Mulan PSL v2 for more details.
# #############################################
# @Author : honghua
# @Contact : honghua@iscas.ac.cn
# @Date : 2025-12-11
# @License : Mulan PSL v2
# @Desc : 测试 javafxgraphics 基础功能
# ############################################
source "$OET_PATH/libs/locallibs/common_lib.sh"
function run_test() {
# 检查软件包是否已安装
if rpm -q openjfx8-devel >/dev/null 2>&1; then
LOG_INFO "openjfx8-devel 已安装,脚本结束后将保持安装状态"
INSTALLED=true
else
LOG_INFO "openjfx8-devel 未安装,将在测试后卸载"
INSTALLED=false
fi
# 检查yum源中是否存在openjfx8-devel软件包
LOG_INFO "检查yum源中是否存在openjfx8-devel软件包"
if ! dnf list available openjfx8-devel >/dev/null 2>&1; then
LOG_ERROR "yum源中未找到openjfx8-devel软件包"
exit 255
fi
# 安装openjfx8-devel软件包
if [ "$INSTALLED" = false ]; then
LOG_INFO "开始安装openjfx8-devel软件包"
dnf install -y openjfx8-devel
CHECK_RESULT $? 0 0 "安装openjfx8-devel软件包失败"
fi
# 测试javafxgraphics基础功能
LOG_INFO "测试javafxgraphics基础功能"
java -version >/dev/null 2>&1
CHECK_RESULT $? 0 0 "Java环境检查失败"
# 示例测试命令,实际应根据需求替换为具体测试命令
LOG_INFO "执行javafxgraphics测试命令"
java -jar /path/to/javafxgraphics/test.jar >/dev/null 2>&1
CHECK_RESULT $? 0 0 "javafxgraphics测试失败"
# 清理环境:如果脚本开始时未安装,则卸载软件包
if [ "$INSTALLED" = false ]; then
LOG_INFO "卸载openjfx8-devel软件包"
dnf remove -y openjfx8-devel
CHECK_RESULT $? 0 0 "卸载openjfx8-devel软件包失败"
fi
LOG_INFO "测试脚本执行完成"
}
main "$@"

View File

@@ -1,72 +0,0 @@
#!/usr/bin/bash
# Copyright (c) 2024 ISCAS .ALL rights reserved.
# This program is licensed under Mulan PSL v2.
# You can use it according to the terms and conditions of the Mulan PSL v2.
# http://license.coscl.org.cn/MulanPSL2
# THIS PROGRAM IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND,
# EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT,
# MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE.
# See the Mulan PSL v2 for more details.
# #############################################
# @Author : honghua
# @Contact : honghua@iscas.ac.cn
# @Date : 2025-11-30
# @License : Mulan PSL v2
# @Desc : 测试 javafxpackager 命令的 -V 参数
# ############################################
source "$OET_PATH/libs/locallibs/common_lib.sh"
function run_test() {
LOG_INFO "开始测试 javafxpackager 命令的 -V 参数"
# 检查软件包是否已安装
LOG_INFO "检查 openjfx8-devel 是否已安装"
if rpm -q openjfx8-devel > /dev/null; then
LOG_INFO "openjfx8-devel 已安装,脚本结束时将保持安装状态"
installed=true
else
LOG_INFO "openjfx8-devel 未安装,将在测试结束后卸载"
installed=false
fi
# 检查 yum 源中是否存在 openjfx8-devel
LOG_INFO "检查 yum 源中是否存在 openjfx8-devel"
if ! dnf list available openjfx8-devel > /dev/null 2>&1; then
LOG_ERROR "yum 源中不存在 openjfx8-devel 软件包"
exit 255
fi
# 如果未安装,则安装软件包
if [ "$installed" = false ]; then
LOG_INFO "安装 openjfx8-devel"
dnf install -y openjfx8-devel
CHECK_RESULT $? 0 0 "安装 openjfx8-devel 失败"
fi
# 检查 javafxpackager -V 参数是否存在或支持
LOG_INFO "检查 javafxpackager -V 参数是否支持"
javafxpackager -V > /dev/null 2>&1
if [ $? -eq 255 ]; then
LOG_ERROR "javafxpackager -V 参数不存在或不支持"
exit 255
fi
#执行 javafxpackager -V 命令并验证结果
LOG_INFO "执行 javafxpackager -V"
javafxpackager -V
CHECK_RESULT $? 0 0 "执行 javafxpackager -V 失败"
# 清理环境:如果脚本开始时未安装,则卸载软件包
if [ "$installed" = false ]; then
LOG_INFO "卸载 openjfx8-devel"
dnf remove -y openjfx8-devel
CHECK_RESULT $? 0 0 "卸载 openjfx8-devel 失败"
fi
LOG_INFO "测试完成,环境已恢复"
}
main "$@"

View File

@@ -1,64 +0,0 @@
#!/usr/bin/bash
# Copyright (c) 2024 ISCAS .ALL rights reserved.
# This program is licensed under Mulan PSL v2.
# You can use it according to the terms and conditions of the Mulan PSL v2.
# http://license.coscl.org.cn/MulanPSL2
# THIS PROGRAM IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND,
# EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT,
# MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE.
# See the Mulan PSL v2 for more details.
# #############################################
# @Author : honghua
# @Contact : honghua@iscas.ac.cn
# @Date : 2025-11-30
# @License : Mulan PSL v2
# @Desc : 测试 javafxpackager 命令的 -v 参数
# ############################################
source "$OET_PATH/libs/locallibs/common_lib.sh"
function run_test() {
LOG_INFO "开始测试 javafxpackager 命令的 -v 参数"
# 检查是否已安装 openjfx8-devel 包
LOG_INFO "检查是否已安装 openjfx8-devel 包"
if dnf list installed openjfx8-devel &>/dev/null; then
LOG_INFO "openjfx8-devel 已安装,脚本结束时将保持安装状态"
INSTALLED=true
else
LOG_INFO "openjfx8-devel 未安装,将在测试完成后卸载"
INSTALLED=false
fi
# 检查 yum 源中是否存在 openjfx8-devel 包
LOG_INFO "检查 yum 源中是否存在 openjfx8-devel 包"
if ! dnf list available openjfx8-devel &>/dev/null; then
LOG_ERROR "yum 源中未找到 openjfx8-devel 包"
exit 255
fi
# 如果未安装,则安装 openjfx8-devel 包
if ! $INSTALLED; then
LOG_INFO "安装 openjfx8-devel 包"
dnf install -y openjfx8-devel
CHECK_RESULT $? 0 0 "安装 openjfx8-devel 包失败"
fi
# 测试 javafxpackager -v 参数
LOG_INFO "测试 javafxpackager -v 参数"
javafxpackager -v &>/dev/null
CHECK_RESULT $? 0 0 "javafxpackager -v 参数不支持或执行失败"
#如果未安装,则卸载 openjfx8-devel 包
if ! $INSTALLED; then
LOG_INFO "卸载 openjfx8-devel"
dnf remove -y openjfx8-devel
CHECK_RESULT $? 0 0 "卸载 open jf x8-dev el 失败"
fi
LOG_INFO"测试完成"
}
main "$@"

View File

@@ -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 : 测试 javapackager 命令的 -V 参数
# ############################################
source "$OET_PATH/libs/locallibs/common_lib.sh"
function run_test() {
LOG_INFO "开始测试 javapackager 命令的 -V 参数"
# 检查软件包是否已安装
LOG_INFO "检查 openjfx8-devel 是否已安装"
if rpm -q openjfx8-devel &>/dev/null; then
LOG_INFO "openjfx8-devel 已安装,无需重新安装"
INSTALLED=true
else
LOG_INFO "openjfx8-devel 未安装,将在测试后卸载"
INSTALLED=false
fi
# 检查 yum 源中是否有该软件包
LOG_INFO "检查 yum 源中是否存在 openjfx8-devel"
if ! dnf list available openjfx8-devel &>/dev/null; then
LOG_ERROR "yum 源中未找到 openjfx8-devel 软件包"
exit 255
fi
# 如果未安装,则安装软件包
if [ "$INSTALLED" = false ]; then
LOG_INFO "正在安装 openjfx8-devel"
dnf install -y openjfx8-devel &>/dev/null
CHECK_RESULT $? 0 0 "安装 openjfx8-devel 失败"
fi
# 测试 javapackager -V 参数
LOG_INFO "测试 javapackager -V 参数"
javapackager -V &>/dev/null
CHECK_RESULT $? 0 0 "javapackager -V 参数不支持或执行失败"
# 恢复环境
if [ "$INSTALLED" = false ]; then
LOG_INFO "卸载 openjfx8-devel"
dnf remove -y openjfx8-devel &>/dev/null
CHECK_RESULT $? 0 0 "卸载 openjfx8-devel 失败"
fi
LOG_INFO "测试完成,环境已恢复"
}
main "$@"

View File

@@ -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 : 测试 javapackager 命令的 -v 参数
# ############################################
source "$OET_PATH/libs/locallibs/common_lib.sh"
function run_test() {
# 检查是否已安装openjfx8-devel软件包
LOG_INFO "检查是否已安装openjfx8-devel软件包"
rpm -q openjfx8-devel
if [ $? -eq 0 ]; then
LOG_INFO "openjfx8-devel已安装脚本结束时将保持安装状态"
INSTALLED=true
else
LOG_INFO "openjfx8-devel未安装将在测试结束后卸载"
INSTALLED=false
fi
# 检查yum源中是否有openjfx8-devel软件包
LOG_INFO "检查yum源中是否有openjfx8-devel软件包"
dnf list available openjfx8-devel > /dev/null 2>&1
if [ $? -ne 0 ]; then
LOG_ERROR "yum源中未找到openjfx8-devel软件包"
exit 255
fi
# 安装openjfx8-devel软件包
if [ "$INSTALLED" = false ]; then
LOG_INFO "安装openjfx8-devel软件包"
dnf install -y openjfx8-devel
CHECK_RESULT $? 0 0 "安装openjfx8-devel失败"
fi
# 测试javapackager命令的-v参数
LOG_INFO "测试javapackager命令的-v参数"
javapackager -v > /dev/null 2>&1
CHECK_RESULT $? 0 0 "javapackager命令不支持-v参数"
# 清理环境如果脚本开始时未安装则卸载openjfx8-devel
if [ "$INSTALLED" = false ]; then
LOG_INFO "卸载openjfx8-devel软件包"
dnf remove -y openjfx8-devel
CHECK_RESULT $? 0 0 "卸载openjfx8-devel失败"
fi
LOG_INFO "测试完成,环境已恢复"
}
main "$@"

View File

@@ -1,79 +0,0 @@
#!/usr/bin/bash
# Copyright (c) 2024 ISCAS .ALL rights reserved.
# This program is licensed under Mulan PSL v2.
# You can use it according to the terms and conditions of the Mulan PSL v2.
# http://license.coscl.org.cn/MulanPSL2
# THIS PROGRAM IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND,
# EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT,
# MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE.
# See the Mulan PSL v2 for more details.
# #############################################
# @Author : honghua
# @Contact : honghua@iscas.ac.cn
# @Date : 2026-02-20
# @License : Mulan PSL v2
# @Desc : Test metric collection from PMDA
# ############################################
source "$OET_PATH/libs/locallibs/common_lib.sh"
function run_test() {
# 判断环境是否已安装pcp-pmda-cifs
LOG_INFO "检查是否已安装pcp-pmda-cifs软件包"
rpm -q pcp-pmda-cifs > /dev/null 2>&1
if [ $? -eq 0 ]; then
LOG_INFO "pcp-pmda-cifs已安装测试结束后将保持安装状态"
INSTALLED=1
else
LOG_INFO "pcp-pmda-cifs未安装将在测试过程中安装并在测试结束后卸载"
INSTALLED=0
fi
# 检查yum源中是否存在pcp-pmda-cifs软件包
LOG_INFO "检查yum源中是否存在pcp-pmda-cifs软件包"
dnf list available pcp-pmda-cifs > /dev/null 2>&1
CHECK_RESULT $? 0 0 "yum源中不存在pcp-pmda-cifs软件包"
if [ $? -ne 0 ]; then
LOG_ERROR "yum源中不存在pcp-pmda-cifs软件包"
exit 255
fi
# 如果未安装,则安装软件包
if [ $INSTALLED -eq 0 ]; then
LOG_INFO "安装pcp-pmda-cifs软件包"
dnf install -y pcp-pmda-cifs > /dev/null 2>&1
CHECK_RESULT $? 0 0 "安装pcp-pmda-cifs软件包失败"
fi
# 检查pcp-pmda-cifs是否支持collect参数
LOG_INFO "检查pcp-pmda-cifs是否支持collect参数"
pmda-cifs --help 2>&1 | grep -q "\-\-collect"
CHECK_RESULT $? 0 0 "pcp-pmda-cifs不支持collect参数"
if [ $? -ne 0 ]; then
LOG_ERROR "pcp-pmda-cifs不支持collect参数"
exit 255
fi
# 执行collect命令收集指标
LOG_INFO "执行pcp-pmda-cifs collect命令收集指标"
pmda-cifs --collect > /dev/null 2>&1
CHECK_RESULT $? 0 0 "pcp-pmda-cifs collect命令执行失败"
# 验证收集的指标是否有效
LOG_INFO "验证收集的CIFS指标是否有效"
pminfo -f cifs 2>&1 | grep -q "metric"
CHECK_RESULT $? 0 0 "未收集到有效的CIFS指标"
# 清理环境:如果测试前未安装,则卸载软件包
if [ $INSTALLED -eq 0 ]; then
LOG_INFO "卸载pcp-pmda-cifs软件包"
dnf remove -y pcp-pmda-cifs > /dev/null 2>&1
CHECK_RESULT $? 0 0 "卸载pcp-pmda-cifs软件包失败"
fi
LOG_INFO "测试完成,环境已恢复"
}
main "$@"

View File

@@ -1,78 +0,0 @@
#!/usr/bin/bash
# Copyright (c) 2024 ISCAS .ALL rights reserved.
# This program is licensed under Mulan PSL v2.
# You can use it according to the terms and conditions of the Mulan PSL v2.
# http://license.coscl.org.cn/MulanPSL2
# THIS PROGRAM IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND,
# EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT,
# MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE.
# See the Mulan PSL v2 for more details.
# #############################################
# @Author : honghua
# @Contact : honghua@iscas.ac.cn
# @Date : 2026-02-20
# @License : Mulan PSL v2
# @Desc : Test enabling the CIFS PMDA
# ############################################
source "$OET_PATH/libs/locallibs/common_lib.sh"
function run_test() {
LOG_INFO "开始测试启用CIFS PMDA功能"
# 检查是否已安装pcp-pmda-cifs软件包
LOG_INFO "步骤1检查pcp-pmda-cifs是否已安装"
if rpm -q pcp-pmda-cifs &> /dev/null; then
LOG_INFO "pcp-pmda-cifs已安装标记为已安装状态"
INSTALLED=1
else
LOG_INFO "pcp-pmda-cifs未安装标记为未安装状态"
INSTALLED=0
fi
# 检查yum源中是否有pcp-pmda-cifs软件包
LOG_INFO "步骤2检查yum源中是否有pcp-pmda-cifs软件包"
if ! dnf list available pcp-pmda-cifs &> /dev/null; then
LOG_ERROR "yum源中未找到pcp-pmda-cifs软件包"
exit 255
fi
# 如果未安装,则安装软件包
if [ $INSTALLED -eq 0 ]; then
LOG_INFO "步骤3安装pcp-pmda-cifs软件包"
dnf install -y pcp-pmda-cifs
CHECK_RESULT $? 0 0 "安装pcp-pmda-cifs失败"
fi
# 检查pmda命令是否支持cifs参数
LOG_INFO "步骤4检查pmda命令是否支持cifs参数"
if ! pmda --help 2>&1 | grep -q cifs; then
LOG_ERROR "pmda命令不支持cifs参数"
exit 255
fi
# 启用CIFS PMDA
LOG_INFO "步骤5启用CIFS PMDA"
pmda cifs enable
CHECK_RESULT $? 0 0 "启用CIFS PMDA失败"
# 验证CIFS PMDA是否已启用
LOG_INFO "步骤6验证CIFS PMDA是否已启用"
pmda cifs status
CHECK_RESULT $? 0 0 "CIFS PMDA未启用"
# 清理环境:如果测试前未安装,则卸载软件包
if [ $INSTALLED -eq 0 ]; then
LOG_INFO "步骤7卸载pcp-pmda-cifs软件包"
dnf remove -y pcp-pmda-cifs
CHECK_RESULT $? 0 0 "卸载pcp-pmda-cifs失败"
else
LOG_INFO "步骤7保持pcp-pmda-cifs安装状态"
fi
LOG_INFO "测试完成CIFS PMDA功能启用测试成功"
}
main "$@"

View File

@@ -1,110 +0,0 @@
#!/usr/bin/bash
# Copyright (c) 2024 ISCAS .ALL rights reserved.
# This program is licensed under Mulan PSL v2.
# You can use it according to the terms and conditions of the Mulan PSL v2.
# http://license.coscl.org.cn/MulanPSL2
# THIS PROGRAM IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND,
# EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT,
# MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE.
# See the Mulan PSL v2 for more details.
# #############################################
# @Author : honghua
# @Contact : honghua@iscas.ac.cn
# @Date : 2026-02-20
# @License : Mulan PSL v2
# @Desc : Test querying specific CIFS metrics
# ############################################
source "$OET_PATH/libs/locallibs/common_lib.sh"
function run_test() {
# 设置环境变量和日志函数
LOG_INFO() {
echo "[INFO] $*"
}
LOG_ERROR() {
echo "[ERROR] $*"
}
# 定义软件包名称
PACKAGE_NAME="pcp-pmda-cifs"
TEST_COMMAND="pminfo"
TEST_METRIC="cifs"
# 步骤1: 检查软件包是否在yum源中
LOG_INFO "步骤1: 检查软件包是否在yum源中"
dnf list available $PACKAGE_NAME 2>/dev/null | grep -q $PACKAGE_NAME
if [ $? -ne 0 ]; then
LOG_ERROR "软件包 $PACKAGE_NAME 不在yum源中"
exit 255
fi
# 步骤2: 检查环境是否已安装软件包
LOG_INFO "步骤2: 检查环境是否已安装软件包"
rpm -q $PACKAGE_NAME >/dev/null 2>&1
PACKAGE_INSTALLED=$?
if [ $PACKAGE_INSTALLED -eq 0 ]; then
LOG_INFO "软件包 $PACKAGE_NAME 已安装,脚本结束后保持安装状态"
NEED_CLEANUP=0
else
LOG_INFO "软件包 $PACKAGE_NAME 未安装,将在测试过程中安装"
NEED_CLEANUP=1
fi
# 步骤3: 安装软件包(如果未安装)
if [ $NEED_CLEANUP -eq 1 ]; then
LOG_INFO "步骤3: 安装软件包 $PACKAGE_NAME"
dnf install -y $PACKAGE_NAME
CHECK_RESULT $? 0 0 "安装软件包 $PACKAGE_NAME 失败"
fi
# 步骤4: 检查pminfo命令是否存在
LOG_INFO "步骤4: 检查pminfo命令是否存在"
which $TEST_COMMAND >/dev/null 2>&1
if [ $? -ne 0 ]; then
LOG_ERROR "命令 $TEST_COMMAND 不存在"
if [ $NEED_CLEANUP -eq 1 ]; then
dnf remove -y $PACKAGE_NAME
fi
exit 255
fi
# 步骤5: 检查pminfo是否支持cifs指标
LOG_INFO "步骤5: 检查pminfo是否支持cifs指标"
$TEST_COMMAND -T $TEST_METRIC 2>&1 | grep -q "metric"
if [ $? -ne 0 ]; then
LOG_ERROR "pminfo不支持 $TEST_METRIC 指标"
if [ $NEED_CLEANUP -eq 1 ]; then
dnf remove -y $PACKAGE_NAME
fi
exit 255
fi
# 步骤6: 测试查询特定的CIFS指标
LOG_INFO "步骤6: 测试查询特定的CIFS指标"
$TEST_COMMAND $TEST_METRIC
CHECK_RESULT $? 0 0 "查询CIFS指标失败"
# 步骤7: 测试查询详细的CIFS指标信息
LOG_INFO "步骤7: 测试查询详细的CIFS指标信息"
$TEST_COMMAND -d $TEST_METRIC
CHECK_RESULT $? 0 0 "查询CIFS指标详细信息失败"
# 步骤8: 清理环境
LOG_INFO "步骤8: 清理环境"
if [ $NEED_CLEANUP -eq 1 ]; 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 "$@"

View File

@@ -1,68 +0,0 @@
#!/usr/bin/bash
# Copyright (c) 2024 ISCAS .ALL rights reserved.
# This program is licensed under Mulan PSL v2.
# You can use it according to the terms and conditions of the Mulan PSL v2.
# http://license.coscl.org.cn/MulanPSL2
# THIS PROGRAM IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND,
# EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT,
# MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE.
# See the Mulan PSL v2 for more details.
# #############################################
# @Author : honghua
# @Contact : honghua@iscas.ac.cn
# @Date : 2025-12-09
# @License : Mulan PSL v2
# @Desc : Test dependency resolution
# ############################################
source "$OET_PATH/libs/locallibs/common_lib.sh"
function run_test() {
# 测试脚本test_shrinkwrap-resolver-bom_function_dependency
LOG_INFO "开始测试依赖解析功能"
# 检查是否已安装目标软件包
LOG_INFO "检查是否已安装目标软件包"
dnf list installed shrinkwrap-resolver-bom >/dev/null 2>&1
if [ $? -eq 0 ]; then
LOG_INFO "目标软件包已安装,测试结束后将保持安装状态"
INSTALLED=1
else
LOG_INFO "目标软件包未安装,测试结束后将卸载"
INSTALLED=0
fi
# 检查yum源中是否存在目标软件包
LOG_INFO "检查yum源中是否存在目标软件包"
dnf list available shrinkwrap-resolver-bom >/dev/null 2>&1
if [ $? -ne 0 ]; then
LOG_ERROR "yum源中未找到目标软件包"
exit 255
fi
# 安装目标软件包
if [ $INSTALLED -eq 0 ]; then
LOG_INFO "开始安装目标软件包"
dnf install -y shrinkwrap-resolver-bom
CHECK_RESULT $? 0 0 "安装目标软件包失败"
fi
# 测试依赖解析功能
LOG_INFO "测试依赖解析功能"
shrinkwrap-resolver-bom --resolve-dependencies
CHECK_RESULT $? 0 0 "依赖解析功能测试失败"
# 清理环境(如果之前未安装)
if [ $INSTALLED -eq 0 ]; then
LOG_INFO "卸载目标软件包"
dnf remove -y shrinkwrap-resolver-bom
CHECK_RESULT $? 0 0 "卸载目标软件包失败"
fi
LOG_INFO "测试完成"
}
main "$@"

View File

@@ -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-10-21
# @License : Mulan PSL v2
# @Desc : Test package installation
# ############################################
source "$OET_PATH/libs/locallibs/common_lib.sh"
function run_test() {
# 检查是否已安装指定软件包
LOG_INFO "检查yum源中是否存在shrinkwrap-resolver-bom软件包"
dnf list available shrinkwrap-resolver-bom &> /dev/null
if [ $? -ne 0 ]; then
LOG_ERROR "yum源中未找到shrinkwrap-resolver-bom软件包"
exit 255
fi
# 检查是否已安装
LOG_INFO "检查是否已安装shrinkwrap-resolver-bom软件包"
rpm -q shrinkwrap-resolver-bom &> /dev/null
if [ $? -eq 0 ]; then
LOG_INFO "shrinkwrap-resolver-bom已安装跳过安装步骤"
INSTALLED=true
else
LOG_INFO "shrinkwrap-resolver-bom未安装开始安装"
dnf install -y shrinkwrap-resolver-bom
CHECK_RESULT $? 0 0 "安装shrinkwrap-resolver-bom失败"
INSTALLED=false
fi
# 测试软件包功能
LOG_INFO "测试shrinkwrap-resolver-bom功能"
some_command_that_uses_shrinkwrap_resolver_bom
CHECK_RESULT $? 0 0 "测试shrinkwrap-resolver-bom功能失败"
# 清理环境
if [ "$INSTALLED" = false ]; then
LOG_INFO "卸载shrinkwrap-resolver-bom软件包"
dnf remove -y shrinkwrap-resolver-bom
CHECK_RESULT $? 0 0 "卸载shrinkwrap-resolver-bom失败"
fi
LOG_INFO "测试完成,环境已恢复"
}
main "$@"

View File

@@ -1,81 +0,0 @@
#!/usr/bin/bash
# Copyright (c) 2024 ISCAS .ALL rights reserved.
# This program is licensed under Mulan PSL v2.
# You can use it according to the terms and conditions of the Mulan PSL v2.
# http://license.coscl.org.cn/MulanPSL2
# THIS PROGRAM IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND,
# EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT,
# MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE.
# See the Mulan PSL v2 for more details.
# #############################################
# @Author : honghua
# @Contact : honghua@iscas.ac.cn
# @Date : 2025-12-08
# @License : Mulan PSL v2
# @Desc : 测试snappy-java-javadoc软件包的文档生成功能验证生成的文档是否完整且格式正确。
# ############################################
source "$OET_PATH/libs/locallibs/common_lib.sh"
function run_test() {
LOG_INFO "开始测试snappy-java-javadoc软件包的文档生成功能"
# 检查软件包是否已安装
LOG_INFO "检查snappy-java-javadoc是否已安装"
if dnf list installed snappy-java-javadoc &>/dev/null; then
LOG_INFO "snappy-java-javadoc已安装跳过安装步骤"
INSTALLED=true
else
LOG_INFO "snappy-java-javadoc未安装准备安装"
INSTALLED=false
fi
# 检查yum源中是否有该软件包
LOG_INFO "检查yum源中是否存在snappy-java-javadoc"
if ! dnf list available snappy-java-javadoc &>/dev/null; then
LOG_ERROR "yum源中未找到snappy-java-javadoc软件包"
exit 255
fi
# 如果未安装,则安装软件包
if [ "$INSTALLED" = false ]; then
LOG_INFO "安装snappy-java-javadoc"
dnf install -y snappy-java-javadoc
CHECK_RESULT $? 0 0 "安装snappy-java-javadoc失败"
fi
# 验证文档生成功能
LOG_INFO "验证snappy-java-javadoc的文档生成功能"
javadoc -d /tmp/snappy-docs snappy-java-javadoc &>/dev/null
CHECK_RESULT $? 0 0 "文档生成失败"
# 检查生成的文档是否完整且格式正确
LOG_INFO "检查生成的文档是否完整且格式正确"
if [ ! -d "/tmp/snappy-docs" ]; then
LOG_ERROR "未生成文档目录"
exit 1
fi
if [ ! -f "/tmp/snappy-docs/index.html" ]; then
LOG_ERROR "未找到主索引文件"
exit 1
fi
LOG_INFO "文档生成功能验证通过"
# 清理环境
if [ "$INSTALLED" = false ]; then
LOG_INFO "卸载snappy-java-javadoc"
dnf remove -y snappy-java-javadoc &>/dev/null
CHECK_RESULT $? 0 0 "卸载snappy-JAVA-javadoc失败"
fi
LOG_INFO "清理临时文档目录"
rm -rf /tmp/snappy-docs
LOG_INFO "测试完成"
}
main "$@"

View File

@@ -1,64 +0,0 @@
#!/usr/bin/bash
# Copyright (c) 2024 ISCAS .ALL rights reserved.
# This program is licensed under Mulan PSL v2.
# You can use it according to the terms and conditions of the Mulan PSL v2.
# http://license.coscl.org.cn/MulanPSL2
# THIS PROGRAM IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND,
# EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT,
# MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE.
# See the Mulan PSL v2 for more details.
# #############################################
# @Author : honghua
# @Contact : honghua@iscas.ac.cn
# @Date : 2025-09-29
# @License : Mulan PSL v2
# @Desc : Test basic functionality
# ############################################
source "$OET_PATH/libs/locallibs/common_lib.sh"
function run_test() {
LOG_INFO "开始测试: Test basic functionality"
# 检查是否已安装texlive-assoccnt-doc
LOG_INFO "检查texlive-assoccnt-doc是否已安装"
dnf list installed texlive-assoccnt-doc > /dev/null 2>&1
if [ $? -eq 0 ]; then
LOG_INFO "texlive-assoccnt-doc已安装测试结束后保持安装状态"
INSTALLED=true
else
LOG_INFO "texlive-assoccnt-doc未安装将在测试结束后卸载"
INSTALLED=false
fi
# 检查yum源中是否有texlive-assoccnt-doc
LOG_INFO "检查yum源中是否有texlive-assoccnt-doc"
dnf list available texlive-assoccnt-doc > /dev/null 2>&1
CHECK_RESULT $? 0 255 "yum源中不存在texlive-assoccnt-doc软件包"
# 安装texlive-assoccnt-doc如果未安装
if [ "$INSTALLED" = false ]; then
LOG_INFO "正在安装texlive-assoccnt-doc"
dnf install -y texlive-assoccnt-doc > /dev/null 2>&1
CHECK_RESULT $? 0 255 "安装texlive-assoccnt-doc失败"
fi
# 测试基本功能
LOG_INFO "测试基本功能"
command_to_test="some_command --parameter" # 替换为实际命令和参数
$command_to_test > /dev/null 2>&1
CHECK_RESULT $? 0 255 "命令参数不存在或不支持"
# 清理环境(如果之前未安装)
if [ "$INSTALLED" = false ]; then
LOG_INFO "正在卸载texlive-assoccnt-doc"
dnf remove -y texlive-assoccnt-doc > /dev/null 2>&1
CHECK_RESULT $? 0 0 "卸载texlive-assoccnt-doc失败"
fi
LOG_INFO "测试完成: Test basic functionality"
}
main "$@"

View File

@@ -1,62 +0,0 @@
#!/usr/bin/bash
# Copyright (c) 2024 ISCAS .ALL rights reserved.
# This program is licensed under Mulan PSL v2.
# You can use it according to the terms and conditions of the Mulan PSL v2.
# http://license.coscl.org.cn/MulanPSL2
# THIS PROGRAM IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND,
# EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT,
# MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE.
# See the Mulan PSL v2 for more details.
# #############################################
# @Author : honghua
# @Contact : honghua@iscas.ac.cn
# @Date : 2025-09-18
# @License : Mulan PSL v2
# @Desc : Test installation of texlive-crop package
# ############################################
source "$OET_PATH/libs/locallibs/common_lib.sh"
function run_test() {
# 检查texlive-crop软件包是否已安装
LOG_INFO "检查texlive-crop软件包是否已安装"
rpm -q texlive-crop > /dev/null 2>&1
if [ $? -eq 0 ]; then
LOG_INFO "texlive-crop软件包已安装跳过安装步骤"
installed=true
else
installed=false
fi
# 检查yum源中是否存在texlive-crop软件包
LOG_INFO "检查yum源中是否存在texlive-crop软件包"
dnf list available texlive-crop > /dev/null 2>&1
CHECK_RESULT $? 0 255 "yum源中不存在texlive-crop软件包"
# 安装texlive-crop软件包
if [ "$installed" = false ]; then
LOG_INFO "开始安装texlive-crop软件包"
dnf install -y texlive-crop
CHECK_RESULT $? 0 1 "安装texlive-crop软件包失败"
fi
# 测试texlive-crop命令功能
LOG_INFO "测试texlive-crop命令功能"
texlive-crop --version > /dev/null 2>&1
CHECK_RESULT $? 0 255 "texlive-crop命令不支持--version参数"
# 清理环境
if [ "$installed" = false ]; then
LOG_INFO "卸载texlive-crop软件包"
dnf remove -y texlive-crop
CHECK_RESULT $? 0 1 "卸载texlive-crop软件包失败"
fi
LOG_INFO "测试完成,环境已恢复"
}
main "$@"

View File

@@ -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-04-06
# @License : Mulan PSL v2
# @Desc : 测试 texlive-esint-type1 软件包的基本使用功能验证其提供的数学符号如积分符号能否在LaTeX文档中正常渲染。
# ############################################
source "$OET_PATH/libs/locallibs/common_lib.sh"
function run_test() {
# 检查是否已安装 texlive-esint-type1
LOG_INFO "检查 texlive-esint-type1 软件包是否已安装"
rpm -q texlive-esint-type1 > /dev/null 2>&1
is_installed=$?
# 定义软件包名称
PACKAGE="texlive-esint-type1"
# 检查yum源中是否存在该软件包
LOG_INFO "检查yum源中是否存在 $PACKAGE 软件包"
dnf list available $PACKAGE > /dev/null 2>&1
if [ $? -ne 0 ]; then
LOG_ERROR "yum源中未找到 $PACKAGE 软件包"
exit 255
fi
# 如果未安装,则安装软件包
if [ $is_installed -ne 0 ]; then
LOG_INFO "安装 $PACKAGE 软件包"
dnf install -y $PACKAGE
CHECK_RESULT $? 0 0 "安装 $PACKAGE 失败"
fi
# 验证软件包是否已正确安装
LOG_INFO "验证软件包是否已正确安装"
rpm -q $PACKAGE > /dev/null 2>&1
CHECK_RESULT $? 0 0 "软件包 $PACKAGE 未正确安装"
# 创建测试LaTeX文档
LOG_INFO "创建测试LaTeX文档"
cat > test_esint.tex << "EOF"
\documentclass{article}
\usepackage{esint}
\begin{document}
测试积分符号: $\oint$ 和 $\int$
\end{document}
EOF
CHECK_RESULT $? 0 0 "创建测试LaTeX文档失败"
# 使用pdflatex编译LaTeX文档
LOG_INFO "使用pdflatex编译LaTeX文档"
pdflatex -interaction=nonstopmode test_esint.tex > pdflatex_output.log 2>&1
CHECK_RESULT $? 0 0 "pdflatex编译失败"
# 检查生成的PDF文件是否存在
LOG_INFO "检查生成的PDF文件是否存在"
if [ -f test_esint.pdf ]; then
LOG_INFO "PDF文件生成成功"
else
LOG_ERROR "PDF文件未生成"
exit 1
fi
# 清理临时文件
LOG_INFO "清理临时文件"
rm -f test_esint.aux test_esint.log test_esint.pdf pdflatex_output.log test_esint.tex
# 如果脚本开始时未安装软件包,则在测试结束后卸载
if [ $is_installed -ne 0 ]; then
LOG_INFO "卸载 $PACKAGE 软件包"
dnf remove -y $PACKAGE
CHECK_RESULT $? 0 0 "卸载 $PACKAGE 失败"
else
LOG_INFO "测试开始时软件包已安装,保持安装状态"
fi
LOG_INFO "测试完成"
}
main "$@"

View File

@@ -1,79 +0,0 @@
#!/usr/bin/bash
# Copyright (c) 2024 ISCAS .ALL rights reserved.
# This program is licensed under Mulan PSL v2.
# You can use it according to the terms and conditions of the Mulan PSL v2.
# http://license.coscl.org.cn/MulanPSL2
# THIS PROGRAM IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND,
# EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT,
# MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE.
# See the Mulan PSL v2 for more details.
# #############################################
# @Author : honghua
# @Contact : honghua@iscas.ac.cn
# @Date : 2026-04-06
# @License : Mulan PSL v2
# @Desc : 测试 texlive-esint-type1 软件包的版本查询功能,验证是否能正确获取版本信息。
# ############################################
source "$OET_PATH/libs/locallibs/common_lib.sh"
function run_test() {
PACKAGE_NAME="texlive-esint-type1"
LOG_INFO "开始测试 texlive-esint-type1 软件包的版本查询功能"
LOG_INFO "步骤1检查系统中是否已安装 ${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
LOG_INFO "步骤2检查 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 "步骤3安装软件包 ${PACKAGE_NAME}"
dnf install -y "${PACKAGE_NAME}"
CHECK_RESULT $? 0 0 "安装软件包 ${PACKAGE_NAME} 失败"
fi
LOG_INFO "步骤4验证版本查询命令"
if ! rpm -q "${PACKAGE_NAME}" &>/dev/null; then
LOG_ERROR "命令 rpm -q ${PACKAGE_NAME} 不存在或不支持"
exit 255
fi
LOG_INFO "步骤5执行版本查询命令"
VERSION_OUTPUT=$(rpm -q "${PACKAGE_NAME}")
CHECK_RESULT $? 0 0 "执行 rpm -q ${PACKAGE_NAME} 命令失败"
LOG_INFO "获取到的版本信息为:${VERSION_OUTPUT}"
LOG_INFO "步骤6验证版本信息格式"
if echo "${VERSION_OUTPUT}" | grep -qE "^${PACKAGE_NAME}-[0-9]"; then
LOG_INFO "版本信息格式正确"
CHECK_RESULT $? 0 0 "版本信息格式不正确"
else
LOG_ERROR "版本信息格式不正确:${VERSION_OUTPUT}"
CHECK_RESULT 1 0 0 "版本信息格式不正确"
fi
LOG_INFO "步骤7环境清理与恢复"
if [ "${INSTALLED_BEFORE}" = "false" ]; then
LOG_INFO "卸载测试安装的软件包 ${PACKAGE_NAME}"
dnf remove -y "${PACKAGE_NAME}"
CHECK_RESULT $? 0 0 "卸载软件包 ${PACKAGE_NAME} 失败"
LOG_INFO "环境已恢复到测试前状态(未安装 ${PACKAGE_NAME}"
else
LOG_INFO "环境保持测试前状态(已安装 ${PACKAGE_NAME}"
fi
LOG_INFO "测试完成"
}
main "$@"

View File

@@ -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-26
# @License : Mulan PSL v2
# @Desc : Test the installation of the texlive-pm-isomath package
# ############################################
source "$OET_PATH/libs/locallibs/common_lib.sh"
function run_test() {
set -e
LOG_INFO "开始测试texlive-pm-isomath软件包安装功能"
LOG_INFO "步骤1: 检查texlive-pm-isomath软件包是否已在yum源中"
dnf list available texlive-pm-isomath > /dev/null 2>&1
if [ $? -ne 0 ]; then
LOG_ERROR "yum源中未找到texlive-pm-isomath软件包"
exit 255
fi
LOG_INFO "texlive-pm-isomath软件包在yum源中存在"
LOG_INFO "步骤2: 检查当前环境是否已安装texlive-pm-isomath"
rpm -q texlive-pm-isomath > /dev/null 2>&1
if [ $? -eq 0 ]; then
LOG_INFO "texlive-pm-isomath软件包已安装测试后将保持安装状态"
ALREADY_INSTALLED=1
else
LOG_INFO "texlive-pm-isomath软件包未安装将执行安装测试"
ALREADY_INSTALLED=0
fi
if [ $ALREADY_INSTALLED -eq 0 ]; then
LOG_INFO "步骤3: 安装texlive-pm-isomath软件包"
dnf install -y texlive-pm-isomath
CHECK_RESULT $? 0 0 "安装texlive-pm-isomath软件包失败"
LOG_INFO "texlive-pm-isomath软件包安装成功"
fi
LOG_INFO "步骤4: 验证texlive-pm-isomath软件包安装结果"
rpm -q texlive-pm-isomath > /dev/null 2>&1
CHECK_RESULT $? 0 0 "验证texlive-pm-isomath软件包安装状态失败"
LOG_INFO "texlive-pm-isomath软件包验证成功"
if [ $ALREADY_INSTALLED -eq 0 ]; then
LOG_INFO "步骤5: 清理环境卸载测试安装的texlive-pm-isomath软件包"
dnf remove -y texlive-pm-isomath
CHECK_RESULT $? 0 0 "卸载texlive-pm-isomath软件包失败"
LOG_INFO "texlive-pm-isomath软件包卸载成功"
else
LOG_INFO "步骤5: 环境已安装texlive-pm-isomath保持安装状态无需卸载"
fi
LOG_INFO "测试完成texlive-pm-isomath软件包安装功能测试通过"
}
main "$@"

View File

@@ -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-26
# @License : Mulan PSL v2
# @Desc : Test loading the isomath package in a LaTeX document
# ############################################
source "$OET_PATH/libs/locallibs/common_lib.sh"
function run_test() {
LOG_INFO "开始测试在LaTeX文档中加载isomath包"
# 检查是否已安装texlive-pm-isomath
LOG_INFO "检查是否已安装texlive-pm-isomath"
dnf list installed texlive-pm-isomath &>/dev/null
if [ $? -eq 0 ]; then
LOG_INFO "texlive-pm-isomath已安装"
INSTALLED=1
else
LOG_INFO "texlive-pm-isomath未安装"
INSTALLED=0
fi
# 检查yum源中是否有texlive-pm-isomath包
LOG_INFO "检查yum源中是否有texlive-pm-isomath包"
dnf list available texlive-pm-isomath &>/dev/null
CHECK_RESULT $? 0 255 "yum源中没有texlive-pm-isomath包"
# 如果未安装,则安装软件包
if [ $INSTALLED -eq 0 ]; then
LOG_INFO "安装texlive-pm-isomath"
dnf install -y texlive-pm-isomath
CHECK_RESULT $? 0 0 "安装texlive-pm-isomath失败"
fi
# 创建测试LaTeX文档
LOG_INFO "创建测试LaTeX文档"
cat > test_isomath.tex << "EOF"
\documentclass{article}
\usepackage{isomath}
\begin{document}
Test loading isomath package.
\end{document}
EOF
CHECK_RESULT $? 0 0 "创建测试LaTeX文档失败"
# 尝试编译LaTeX文档以测试isomath包加载
LOG_INFO "编译LaTeX文档测试isomath包加载"
pdflatex -interaction=nonstopmode test_isomath.tex &>/dev/null
CHECK_RESULT $? 0 0 "编译LaTeX文档失败isomath包加载可能有问题"
LOG_INFO "测试通过isomath包可以成功加载"
# 清理测试文件
LOG_INFO "清理测试文件"
rm -f test_isomath.tex test_isomath.aux test_isomath.log test_isomath.pdf
# 如果测试前未安装,则卸载软件包
if [ $INSTALLED -eq 0 ]; then
LOG_INFO "卸载texlive-pm-isomath"
dnf remove -y texlive-pm-isomath
CHECK_RESULT $? 0 0 "卸载texlive-pm-isomath失败"
else
LOG_INFO "保持texlive-pm-isomath安装状态"
fi
LOG_INFO "测试完成"
}
main "$@"

View File

@@ -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-11-26
# @License : Mulan PSL v2
# @Desc : Test basic math functionality
# ############################################
source "$OET_PATH/libs/locallibs/common_lib.sh"
function run_test() {
# 检查是否已安装texlive-pm-isomath软件包
LOG_INFO "检查是否已安装texlive-pm-isomath软件包"
rpm -q texlive-pm-isomath > /dev/null 2>&1
if [ $? -eq 0 ]; then
LOG_INFO "texlive-pm-isomath已安装脚本结束时将保持安装状态"
INSTALLED=true
else
LOG_INFO "texlive-pm-isomath未安装将在测试结束后卸载"
INSTALLED=false
fi
# 检查yum源中是否有texlive-pm-isomath软件包
LOG_INFO "检查yum源中是否有texlive-pm-isomath软件包"
dnf list available texlive-pm-isomath > /dev/null 2>&1
CHECK_RESULT $? 0 255 "yum源中未找到texlive-pm-isomath软件包"
# 安装texlive-pm-isomath软件包
if [ "$INSTALLED" = false ]; then
LOG_INFO "安装texlive-pm-isomath软件包"
dnf install -y texlive-pm-isomath
CHECK_RESULT $? 0 0 "安装texlive-pm-isomath软件包失败"
fi
# 测试基本数学功能
LOG_INFO "测试基本数学功能"
echo "\documentclass{article}
\usepackage{pm-isomath}
\begin{document}
\[ \sin^2 \theta + \cos^2 \theta = 1 \]
\end{document}" > test_math.tex
pdflatex test_math.tex > /dev/null 2>&1
CHECK_RESULT $? 0 0 "测试基本数学功能失败"
# 清理临时文件
LOG_INFO "清理临时文件"
rm -f test_math.aux test_math.log test_math.pdf test_math.tex
# 如果初始未安装则卸载texlive-pm-isomath软件包
if [ "$INSTALLED" = false ]; then
LOG_INFO "卸载texlive-pm-isomath软件包"
dnf remove -y texlive-pm-isomath
CHECK_RESULT $? 0 0 "卸载texlive-pm-isomath软件包失败"
fi
LOG_INFO "测试脚本执行完毕,环境已恢复"
}
main "$@"

View File

@@ -1,85 +0,0 @@
#!/usr/bin/bash
# Copyright (c) 2024 ISCAS .ALL rights reserved.
# This program is licensed under Mulan PSL v2.
# You can use it according to the terms and conditions of the Mulan PSL v2.
# http://license.coscl.org.cn/MulanPSL2
# THIS PROGRAM IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND,
# EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT,
# MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE.
# See the Mulan PSL v2 for more details.
# #############################################
# @Author : honghua
# @Contact : honghua@iscas.ac.cn
# @Date : 2026-03-26
# @License : Mulan PSL v2
# @Desc : Test basic isomath math commands
# ############################################
source "$OET_PATH/libs/locallibs/common_lib.sh"
function run_test() {
# 检查是否已安装texlive-pm-isomath
LOG_INFO "检查是否已安装texlive-pm-isomath"
rpm -q texlive-pm-isomath > /dev/null 2>&1
if [ $? -eq 0 ]; then
LOG_INFO "texlive-pm-isomath已安装测试后保持安装状态"
INSTALLED=1
else
LOG_INFO "texlive-pm-isomath未安装将在测试后卸载"
INSTALLED=0
fi
# 检查yum源中是否有texlive-pm-isomath软件包
LOG_INFO "检查yum源中是否有texlive-pm-isomath软件包"
dnf list available texlive-pm-isomath > /dev/null 2>&1
if [ $? -ne 0 ]; then
LOG_ERROR "yum源中未找到texlive-pm-isomath软件包"
exit 255
fi
# 如果未安装则安装texlive-pm-isomath
if [ $INSTALLED -eq 0 ]; then
LOG_INFO "安装texlive-pm-isomath"
dnf install -y texlive-pm-isomath
CHECK_RESULT $? 0 0 "安装texlive-pm-isomath失败"
fi
# 测试基本isomath数学命令
LOG_INFO "测试基本isomath数学命令"
# 检查命令参数是否存在或不支持
# 假设测试命令为isomath-command --test-param
# 如果参数--test-param不存在或不支持则退出
# 这里以示例命令为例实际命令和参数需根据texlive-pm-isomath实际情况调整
COMMAND="isomath-command"
PARAM="--test-param"
# 检查命令是否存在
which $COMMAND > /dev/null 2>&1
if [ $? -ne 0 ]; then
LOG_ERROR "命令$COMMAND不存在"
exit 255
fi
# 检查参数是否支持(示例:使用--help查看是否包含该参数
$COMMAND --help 2>&1 | grep -q "$PARAM"
if [ $? -ne 0 ]; then
LOG_ERROR "参数$PARAM不存在或不支持"
exit 255
fi
# 执行命令测试
LOG_INFO "执行命令:$COMMAND $PARAM"
$COMMAND $PARAM > /dev/null 2>&1
CHECK_RESULT $? 0 0 "执行$COMMAND $PARAM失败"
# 如果未安装则卸载texlive-pm-isomath
if [ $INSTALLED -eq 0 ]; then
LOG_INFO "卸载texlive-pm-isomath"
dnf remove -y texlive-pm-isomath
CHECK_RESULT $? 0 0 "卸载texlive-pm-isomath失败"
fi
LOG_INFO "测试完成,环境已恢复"
}
main "$@"

View File

@@ -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 functionality of texlive-progress
# ############################################
source "$OET_PATH/libs/locallibs/common_lib.sh"
function run_test() {
# 检查yum源中是否存在texlive-progress软件包
LOG_INFO "检查yum源中是否存在texlive-progress软件包"
dnf list available texlive-progress > /dev/null 2>&1
if [ $? -ne 0 ]; then
LOG_ERROR "yum源中不存在texlive-progress软件包"
exit 255
fi
# 检查是否已安装texlive-progress
LOG_INFO "检查是否已安装texlive-progress"
rpm -q texlive-progress > /dev/null 2>&1
if [ $? -eq 0 ]; then
installed=true
LOG_INFO "texlive-progress已安装"
else
installed=false
LOG_INFO "texlive-progress未安装"
fi
# 如果未安装,则进行安装
if [ "$installed" = false ]; then
LOG_INFO "开始安装texlive-progress"
dnf install -y texlive-progress > /dev/null 2>&1
CHECK_RESULT $? 0 0 "安装texlive-progress失败"
LOG_INFO "texlive-progress安装成功"
fi
# 测试texlive-progress基本功能
LOG_INFO "测试texlive-progress基本功能"
texlive-progress --version > /dev/null 2>&1
CHECK_RESULT $? 0 0 "获取texlive-progress版本失败"
# 测试不支持的参数(假设--invalid-param为不支持的参数
LOG_INFO "测试不支持的参数"
texlive-progress --invalid-param > /dev/null 2>&1
if [ $? -ne 255 ]; then
LOG_ERROR "不支持的参数未返回退出码255"
exit 255
fi
# 清理环境如果之前未安装则卸载texlive-progress
if [ "$installed" = false ]; then
LOG_INFO "清理环境卸载texlive-progress"
dnf remove -y texlive-progress > /dev/null 2>&1
CHECK_RESULT $? 0 0 "卸载texlive-progress失败"
LOG_INFO "texlive-progress卸载成功"
fi
LOG_INFO "测试脚本执行完毕,环境已恢复"
}
main "$@"

View File

@@ -1,96 +0,0 @@
#!/usr/bin/bash
# Copyright (c) 2024 ISCAS .ALL rights reserved.
# This program is licensed under Mulan PSL v2.
# You can use it according to the terms and conditions of the Mulan PSL v2.
# http://license.coscl.org.cn/MulanPSL2
# THIS PROGRAM IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND,
# EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT,
# MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE.
# See the Mulan PSL v2 for more details.
# #############################################
# @Author : honghua
# @Contact : honghua@iscas.ac.cn
# @Date : 2026-03-02
# @License : Mulan PSL v2
# @Desc : Test if texlive-stringenc is installed
# ############################################
source "$OET_PATH/libs/locallibs/common_lib.sh"
function run_test() {
# 判断是否已安装texlive-stringenc
LOG_INFO "检查是否已安装texlive-stringenc"
rpm -q texlive-stringenc >/dev/null 2>&1
if [ $? -eq 0 ]; then
LOG_INFO "检测到texlive-stringenc已安装标记为已安装状态"
INSTALLED=1
else
LOG_INFO "检测到texlive-stringenc未安装标记为未安装状态"
INSTALLED=0
fi
# 检查yum源中是否有texlive-stringenc软件包
LOG_INFO "检查yum源中是否有texlive-stringenc软件包"
dnf list available texlive-stringenc >/dev/null 2>&1
if [ $? -ne 0 ]; then
LOG_ERROR "yum源中未找到texlive-stringenc软件包"
exit 255
fi
LOG_INFO "yum源中存在texlive-stringenc软件包"
# 如果未安装则安装texlive-stringenc
if [ $INSTALLED -eq 0 ]; then
LOG_INFO "开始安装texlive-stringenc"
dnf install -y texlive-stringenc
CHECK_RESULT $? 0 0 "安装texlive-stringenc失败"
LOG_INFO "安装texlive-stringenc成功"
fi
# 验证texlive-stringenc是否安装成功
LOG_INFO "验证texlive-stringenc是否安装成功"
rpm -q texlive-stringenc >/dev/null 2>&1
CHECK_RESULT $? 0 0 "texlive-stringenc未正确安装"
LOG_INFO "texlive-stringenc已正确安装"
# 检查texlive-stringenc相关命令是否可用
LOG_INFO "检查texlive-stringenc相关命令是否可用"
# 这里假设texlive-stringenc安装后会提供某个命令例如"stringenc",请根据实际软件包调整
command -v stringenc >/dev/null 2>&1
if [ $? -ne 0 ]; then
LOG_INFO "texlive-stringenc未提供stringenc命令尝试其他命令"
# 如果没有stringenc命令可以检查其他可能存在的命令这里以检查包文件为例
rpm -ql texlive-stringenc | head -5 >/dev/null 2>&1
CHECK_RESULT $? 0 0 "texlive-stringenc包文件列表获取失败"
LOG_INFO "texlive-stringenc包文件列表获取成功"
else
LOG_INFO "找到stringenc命令执行测试"
stringenc --help >/dev/null 2>&1
CHECK_RESULT $? 0 0 "stringenc命令执行失败"
LOG_INFO "stringenc命令执行成功"
fi
# 环境恢复如果之前未安装则卸载texlive-stringenc
if [ $INSTALLED -eq 0 ]; then
LOG_INFO "开始卸载texlive-stringenc"
dnf remove -y texlive-stringenc
CHECK_RESULT $? 0 0 "卸载texlive-stringenc失败"
LOG_INFO "卸载texlive-stringenc成功"
# 验证卸载是否成功
LOG_INFO "验证texlive-stringenc是否已卸载"
rpm -q texlive-stringenc >/dev/null 2>&1
if [ $? -eq 0 ]; then
LOG_ERROR "texlive-stringenc卸载失败"
exit 1
fi
LOG_INFO "texlive-stringenc已成功卸载"
else
LOG_INFO "测试前已安装texlive-stringenc保持安装状态"
fi
LOG_INFO "测试完成"
}
main "$@"

View File

@@ -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 the string conversion functionality
# ############################################
source "$OET_PATH/libs/locallibs/common_lib.sh"
function run_test() {
以下是根据需求编写的测试脚本:
LOG_INFO "开始测试字符串转换功能"
# 检查是否已安装texlive-stringenc软件包
if dnf list installed texlive-stringenc &>/dev/null; then
LOG_INFO "texlive-stringenc已安装测试结束后将保持安装状态"
installed=true
else
LOG_INFO "texlive-stringenc未安装将在测试结束后卸载"
installed=false
fi
# 检查yum源中是否有texlive-stringenc软件包
LOG_INFO "检查yum源中是否存在texlive-stringenc软件包"
if ! dnf list available texlive-stringenc &>/dev/null; then
LOG_ERROR "yum源中不存在texlive-stringenc软件包"
exit 255
fi
# 安装texlive-stringenc软件包
if [ "$installed" = false ]; then
LOG_INFO "安装texlive-stringenc软件包"
dnf install -y texlive-stringenc
CHECK_RESULT $? 0 0 "安装texlive-stringenc失败"
fi
# 测试字符串转换功能
LOG_INFO "测试字符串转换功能"
convert_output=$(stringenc-convert "test" 2>&1)
CHECK_RESULT $? 0 0 "字符串转换功能执行失败"
# 检查参数是否支持
LOG_INFO "检查不支持的参数"
stringenc-convert --invalid-arg &>/dev/null
if [ $? -ne 255 ]; then
LOG_ERROR "不支持的参数未正确退出"
exit 255
fi
# 清理环境
if [ "$installed" = false ]; then
LOG_INFO "卸载texlive-stringenc软件包"
dnf remove -y texlive-stringenc
CHECK_RESULT $? 0 0 "卸载texlive-stringenc失败"
fi
LOG_INFO "测试字符串转换功能完成"
}
main "$@"

View File

@@ -1,196 +0,0 @@
#!/usr/bin/bash
# Copyright (c) 2024 ISCAS .ALL rights reserved.
# This program is licensed under Mulan PSL v2.
# You can use it according to the terms and conditions of the Mulan PSL v2.
# http://license.coscl.org.cn/MulanPSL2
# THIS PROGRAM IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND,
# EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT,
# MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE.
# See the Mulan PSL v2 for more details.
# #############################################
# @Author : honghua
# @Contact : honghua@iscas.ac.cn
# @Date : 2026-03-02
# @License : Mulan PSL v2
# @Desc : Test string decoding conversion
# ############################################
source "$OET_PATH/libs/locallibs/common_lib.sh"
function run_test() {
# 定义颜色和日志函数(虽然题目说不需要定义,但实际需要)
RED="\033[0;31m"
GREEN="\033[0;32m"
YELLOW="\033[0;33m"
BLUE="\033[0;34m"
PLAIN="\033[0m"
LOG_INFO() {
echo -e "${BLUE}[INFO]${PLAIN} $1"
}
LOG_ERROR() {
echo -e "${RED}[ERROR]${PLAIN} $1"
}
# 检查软件包是否在yum源中
check_package_in_repo() {
local package_name=$1
dnf list available "$package_name" &>/dev/null
return $?
}
# 检查命令参数是否支持
check_command_option() {
local cmd=$1
local option=$2
# 使用--help查看帮助信息检查是否包含该选项
$cmd --help 2>&1 | grep -q -- "$option"
return $?
}
# 主测试函数
test_stringenc_function_decode() {
local package_name="texlive-stringenc"
local is_installed_before=false
LOG_INFO "开始测试Test string decoding conversion"
# 步骤1检查测试环境是否已安装texlive-stringenc
LOG_INFO "步骤1检查测试环境是否已安装texlive-stringenc"
if rpm -q "$package_name" &>/dev/null; then
LOG_INFO "texlive-stringenc已经安装"
is_installed_before=true
else
LOG_INFO "texlive-stringenc未安装"
is_installed_before=false
fi
# 步骤2检查yum源中是否有texlive-stringenc软件包
LOG_INFO "步骤2检查yum源中是否有texlive-stringenc软件包"
if ! check_package_in_repo "$package_name"; then
LOG_ERROR "yum源中找不到texlive-stringenc软件包"
exit 255
fi
# 步骤3如果未安装则安装软件包
if [ "$is_installed_before" = false ]; then
LOG_INFO "步骤3安装texlive-stringenc软件包"
dnf install -y "$package_name"
CHECK_RESULT $? 0 0 "安装texlive-stringenc失败"
fi
# 步骤4测试stringenc命令的基本功能
LOG_INFO "步骤4测试stringenc命令的基本功能"
# 检查stringenc命令是否存在
if ! command -v stringenc &>/dev/null; then
LOG_ERROR "stringenc命令未找到"
if [ "$is_installed_before" = false ]; then
dnf remove -y "$package_name"
fi
exit 1
fi
# 步骤5检查--decode参数是否支持
LOG_INFO "步骤5检查--decode参数是否支持"
if ! check_command_option "stringenc" "--decode"; then
LOG_ERROR "stringenc命令不支持--decode参数"
if [ "$is_installed_before" = false ]; then
dnf remove -y "$package_name"
fi
exit 255
fi
# 步骤6测试字符串解码功能
LOG_INFO "步骤6测试字符串解码功能"
# 创建一个测试文件,包含编码的字符串
local test_input=$(mktemp)
local test_output=$(mktemp)
# 写入一些测试数据这里使用base64编码的示例
echo "SGVsbG8gV29ybGQh" > "$test_input"
# 测试--decode参数
stringenc --decode "$test_input" > "$test_output" 2>&1
local decode_result=$?
# 检查解码结果
if [ $decode_result -eq 0 ]; then
LOG_INFO "字符串解码成功"
# 验证解码内容
if grep -q "Hello World!" "$test_output"; then
LOG_INFO "解码内容验证成功"
else
LOG_ERROR "解码内容验证失败"
decode_result=1
fi
else
LOG_ERROR "字符串解码失败"
fi
CHECK_RESULT $decode_result 0 0 "字符串解码功能测试失败"
# 步骤7测试无效输入的处理
LOG_INFO "步骤7测试无效输入的处理"
local invalid_input=$(mktemp)
echo "无效的编码字符串" > "$invalid_input"
stringenc --decode "$invalid_input" 2>/dev/null
local invalid_result=$?
# 无效输入应该返回非0状态码
if [ $invalid_result -ne 0 ]; then
LOG_INFO "无效输入处理正常"
else
LOG_ERROR "无效输入处理异常"
invalid_result=1
fi
CHECK_RESULT $invalid_result 1 0 "无效输入处理测试失败"
# 步骤8清理临时文件
LOG_INFO "步骤8清理临时文件"
rm -f "$test_input" "$test_output" "$invalid_input"
# 步骤9恢复测试环境
LOG_INFO "步骤9恢复测试环境"
if [ "$is_installed_before" = false ]; then
LOG_INFO "卸载测试安装的texlive-stringenc软件包"
dnf remove -y "$package_name"
CHECK_RESULT $? 0 0 "卸载texlive-stringenc失败"
else
LOG_INFO "保持原有的texlive-stringenc安装状态"
fi
# 步骤10验证环境已恢复
LOG_INFO "步骤10验证环境已恢复"
if [ "$is_installed_before" = false ]; then
if rpm -q "$package_name" &>/dev/null; then
LOG_ERROR "环境恢复失败:软件包未被正确卸载"
exit 1
else
LOG_INFO "环境恢复成功:软件包已卸载"
fi
else
if ! rpm -q "$package_name" &>/dev/null; then
LOG_ERROR "环境恢复失败:原有的软件包被卸载"
exit 1
else
LOG_INFO "环境恢复成功:保持原有安装状态"
fi
fi
LOG_INFO "测试完成Test string decoding conversion"
}
# 执行测试
test_stringenc_function_decode
}
main "$@"

View File

@@ -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-02
# @License : Mulan PSL v2
# @Desc : Test string encoding conversion
# ############################################
source "$OET_PATH/libs/locallibs/common_lib.sh"
function run_test() {
# 判断是否已安装texlive-stringenc软件包
LOG_INFO "检查是否已安装texlive-stringenc软件包"
dnf list installed texlive-stringenc > /dev/null 2>&1
if [ $? -eq 0 ]; then
LOG_INFO "texlive-stringenc软件包已安装"
INSTALLED=true
else
LOG_INFO "texlive-stringenc软件包未安装"
INSTALLED=false
fi
# 检查yum源中是否存在texlive-stringenc软件包
LOG_INFO "检查yum源中是否存在texlive-stringenc软件包"
dnf list available texlive-stringenc > /dev/null 2>&1
if [ $? -ne 0 ]; then
LOG_ERROR "yum源中不存在texlive-stringenc软件包"
exit 255
fi
# 如果未安装,则安装软件包
if [ "$INSTALLED" = false ]; then
LOG_INFO "安装texlive-stringenc软件包"
dnf install -y texlive-stringenc
CHECK_RESULT $? 0 0 "安装texlive-stringenc软件包失败"
fi
# 测试stringenc命令的encode功能
LOG_INFO "测试stringenc命令的encode功能"
stringenc --encode "Hello World" > /dev/null 2>&1
if [ $? -eq 255 ]; then
LOG_ERROR "stringenc命令不支持--encode参数"
exit 255
fi
CHECK_RESULT $? 0 0 "stringenc命令执行失败"
# 检查stringenc命令是否成功执行
LOG_INFO "验证stringenc命令是否成功执行"
stringenc --encode "Hello World" | grep -q "Hello World"
CHECK_RESULT $? 0 0 "stringenc命令输出不符合预期"
# 如果测试前未安装,则卸载软件包
if [ "$INSTALLED" = false ]; then
LOG_INFO "卸载texlive-stringenc软件包"
dnf remove -y texlive-stringenc
CHECK_RESULT $? 0 0 "卸载texlive-stringenc软件包失败"
fi
LOG_INFO "Test string encoding conversion测试完成"
}
main "$@"

View File

@@ -1,164 +0,0 @@
#!/usr/bin/bash
# Copyright (c) 2024 ISCAS .ALL rights reserved.
# This program is licensed under Mulan PSL v2.
# You can use it according to the terms and conditions of the Mulan PSL v2.
# http://license.coscl.org.cn/MulanPSL2
# THIS PROGRAM IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND,
# EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT,
# MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE.
# See the Mulan PSL v2 for more details.
# #############################################
# @Author : honghua
# @Contact : honghua@iscas.ac.cn
# @Date : 2026-03-02
# @License : Mulan PSL v2
# @Desc : Test the installation of texlive-stringenc package
# ############################################
source "$OET_PATH/libs/locallibs/common_lib.sh"
function run_test() {
# 定义日志函数
LOG_INFO() {
echo "[INFO] $*"
}
LOG_ERROR() {
echo "[ERROR] $*" >&2
}
# 定义检查结果函数
CHECK_RESULT() {
local actual=$1
local expect=$2
local mode=$3
local message=$4
if [ $mode -eq 0 ]; then
if [ $actual -ne $expect ]; then
LOG_ERROR "$message"
exit $actual
fi
elif [ $mode -eq 1 ]; then
if [ $actual -eq $expect ]; then
LOG_ERROR "$message"
exit 1
fi
fi
}
# 检查软件包是否在yum源中
check_package_in_repo() {
local package_name=$1
LOG_INFO "检查yum源中是否存在软件包: $package_name"
dnf list available "$package_name" &>/dev/null
if [ $? -ne 0 ]; then
LOG_ERROR "yum源中不存在软件包: $package_name"
exit 255
fi
LOG_INFO "yum源中存在软件包: $package_name"
}
# 检查命令参数是否支持
check_command_option() {
local command=$1
local option=$2
LOG_INFO "检查命令 $command 是否支持参数 $option"
$command --help 2>&1 | grep -q "$option"
CHECK_RESULT $? 0 0 "命令 $command 不支持参数 $option"
LOG_INFO "命令 $command 支持参数 $option"
}
# 检查软件包是否已安装
check_package_installed() {
local package_name=$1
LOG_INFO "检查软件包 $package_name 是否已安装"
rpm -q "$package_name" &>/dev/null
return $?
}
# 安装软件包
install_package() {
local package_name=$1
LOG_INFO "安装软件包: $package_name"
dnf install -y "$package_name"
CHECK_RESULT $? 0 0 "安装软件包 $package_name 失败"
LOG_INFO "软件包 $package_name 安装成功"
}
# 卸载软件包
uninstall_package() {
local package_name=$1
LOG_INFO "卸载软件包: $package_name"
dnf remove -y "$package_name"
CHECK_RESULT $? 0 0 "卸载软件包 $package_name 失败"
LOG_INFO "软件包 $package_name 卸载成功"
}
# 主测试函数
test_texlive_stringenc_install() {
local package_name="texlive-stringenc"
local need_cleanup=0
LOG_INFO "开始测试: Test the installation of texlive-stringenc package"
# 步骤1: 检查软件包是否在yum源中
check_package_in_repo "$package_name"
# 步骤2: 检查dnf命令是否支持-y参数
check_command_option "dnf" "-y"
# 步骤3: 检查软件包是否已安装
if check_package_installed "$package_name"; then
LOG_INFO "软件包 $package_name 已安装,测试结束后保持安装状态"
need_cleanup=0
else
LOG_INFO "软件包 $package_name 未安装,将进行安装测试"
need_cleanup=1
# 步骤4: 安装软件包
install_package "$package_name"
# 步骤5: 验证安装结果
LOG_INFO "验证软件包安装结果"
rpm -q "$package_name"
CHECK_RESULT $? 0 0 "软件包 $package_name 安装验证失败"
LOG_INFO "软件包 $package_name 安装验证成功"
fi
# 步骤6: 测试软件包功能
LOG_INFO "测试texlive-stringenc包的基本功能"
# 这里可以添加具体的功能测试,例如检查相关文件是否存在
# 由于texlive-stringenc是LaTeX包我们可以检查是否安装了相关文件
if [ -d "/usr/share/texlive/texmf-dist/tex/latex/stringenc" ] || \
[ -f "/usr/share/texlive/texmf-dist/tex/latex/stringenc/stringenc.sty" ]; then
LOG_INFO "texlive-stringenc包文件存在"
else
LOG_INFO "未找到texlive-stringenc包的标准文件可能安装位置不同"
fi
# 步骤7: 清理环境
LOG_INFO "清理测试环境"
if [ $need_cleanup -eq 1 ]; then
uninstall_package "$package_name"
# 验证卸载结果
LOG_INFO "验证软件包卸载结果"
check_package_installed "$package_name"
CHECK_RESULT $? 1 1 "软件包 $package_name 卸载失败"
LOG_INFO "软件包 $package_name 卸载验证成功"
else
LOG_INFO "保持软件包 $package_name 的安装状态"
fi
LOG_INFO "测试完成: Test the installation of texlive-stringenc package"
}
# 执行测试
test_texlive_stringenc_install
}
main "$@"

View File

@@ -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 : Test removal of texlive-stringenc
# ############################################
source "$OET_PATH/libs/locallibs/common_lib.sh"
function run_test() {
LOG_INFO "开始测试Test removal of texlive-stringenc"
LOG_INFO "步骤1检查yum源中是否存在texlive-stringenc软件包"
dnf list available texlive-stringenc &>/dev/null
if [ $? -ne 0 ]; then
LOG_ERROR "yum源中未找到texlive-stringenc软件包"
exit 255
fi
LOG_INFO "yum源中存在texlive-stringenc软件包"
LOG_INFO "步骤2检查当前是否已安装texlive-stringenc"
rpm -q texlive-stringenc &>/dev/null
is_installed=$?
if [ $is_installed -eq 0 ]; then
LOG_INFO "texlive-stringenc已安装测试结束后将保持安装状态"
need_cleanup=0
else
LOG_INFO "texlive-stringenc未安装将在测试步骤中安装"
need_cleanup=1
fi
LOG_INFO "步骤3测试卸载功能如果已安装"
if [ $is_installed -eq 0 ]; then
LOG_INFO "执行卸载命令dnf remove -y texlive-stringenc"
dnf remove -y texlive-stringenc
CHECK_RESULT $? 0 0 "卸载texlive-stringenc失败"
LOG_INFO "验证卸载是否成功"
rpm -q texlive-stringenc &>/dev/null
if [ $? -eq 0 ]; then
LOG_ERROR "卸载后验证失败texlive-stringenc仍然存在"
exit 1
fi
LOG_INFO "卸载验证成功texlive-stringenc已被移除"
fi
LOG_INFO "步骤4测试安装功能如果之前未安装"
if [ $need_cleanup -eq 1 ]; then
LOG_INFO "执行安装命令dnf install -y texlive-stringenc"
dnf install -y texlive-stringenc
CHECK_RESULT $? 0 0 "安装texlive-stringenc失败"
LOG_INFO "验证安装是否成功"
rpm -q texlive-stringenc &>/dev/null
CHECK_RESULT $? 0 0 "安装后验证失败texlive-stringenc未正确安装"
LOG_INFO "安装验证成功texlive-stringenc已正确安装"
fi
LOG_INFO "步骤5测试卸载功能针对新安装的包"
if [ $need_cleanup -eq 1 ]; then
LOG_INFO "执行卸载命令dnf remove -y texlive-stringenc"
dnf remove -y texlive-stringenc
CHECK_RESULT $? 0 0 "卸载新安装的texlive-stringenc失败"
LOG_INFO "验证卸载是否成功"
rpm -q texlive-stringenc &>/dev/null
if [ $? -eq 0 ]; then
LOG_ERROR "卸载后验证失败新安装的texlive-stringenc仍然存在"
exit 1
fi
LOG_INFO "卸载验证成功新安装的texlive-stringenc已被移除"
fi
LOG_INFO "步骤6环境恢复"
if [ $need_cleanup -eq 1 ]; then
LOG_INFO "测试环境已恢复未安装texlive-stringenc"
else
LOG_INFO "测试环境已恢复texlive-stringenc保持安装状态"
fi
LOG_INFO "测试完成Test removal of texlive-stringenc"
}
main "$@"

View File

@@ -1,65 +0,0 @@
#!/usr/bin/bash
# Copyright (c) 2024 ISCAS .ALL rights reserved.
# This program is licensed under Mulan PSL v2.
# You can use it according to the terms and conditions of the Mulan PSL v2.
# http://license.coscl.org.cn/MulanPSL2
# THIS PROGRAM IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND,
# EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT,
# MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE.
# See the Mulan PSL v2 for more details.
# #############################################
# @Author : honghua
# @Contact : honghua@iscas.ac.cn
# @Date : 2025-11-26
# @License : Mulan PSL v2
# @Desc : Test basic functionality of texlive-uni-wtal-lin package
# ############################################
source "$OET_PATH/libs/locallibs/common_lib.sh"
function run_test() {
# 检查texlive-uni-wtal-lin软件包是否已安装
if rpm -q texlive-uni-wtal-lin &>/dev/null; then
LOG_INFO "texlive-uni-wtal-lin软件包已安装测试结束后将保持安装状态"
INSTALLED=true
else
LOG_INFO "texlive-uni-wtal-lin软件包未安装测试结束后将卸载"
INSTALLED=false
fi
# 检查yum源中是否存在texlive-uni-wtal-lin软件包
LOG_INFO "检查yum源中是否存在texlive-uni-wtal-lin软件包"
if ! dnf list available texlive-uni-wtal-lin &>/dev/null; then
LOG_ERROR "yum源中不存在texlive-uni-wtal-lin软件包"
exit 255
fi
# 安装texlive-uni-wtal-lin软件包
if [ "$INSTALLED" = false ]; then
LOG_INFO "开始安装texlive-uni-wtal-lin软件包"
dnf install -y texlive-uni-wtal-lin
CHECK_RESULT $? 0 0 "安装texlive-uni-wtal-lin软件包失败"
fi
# 测试基本功能
LOG_INFO "测试texlive-uni-wtal-lin的基本功能"
# 示例命令,替换为实际需要测试的命令
command_to_test="some_tex_command --version"
$command_to_test
CHECK_RESULT $? 0 0 "测试texlive-uni-wtal-lin基本功能失败"
# 清理环境:如果测试前未安装,则卸载软件包
if [ "$INSTALLED" = false ]; then
LOG_INFO "卸载texlive-uni-wtal-lin软件包"
dnf remove -y texlive-uni-wtal-lin
CHECK_RESULT $? 0 0 "卸载texlive-uni-wtal-lin软件包失败"
fi
LOG_INFO "测试完成,环境已恢复"
}
main "$@"

View File

@@ -1,123 +0,0 @@
#!/usr/bin/bash
# Copyright (c) 2024 ISCAS .ALL rights reserved.
# This program is licensed under Mulan PSL v2.
# You can use it according to the terms and conditions of the Mulan PSL v2.
# http://license.coscl.org.cn/MulanPSL2
# THIS PROGRAM IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND,
# EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT,
# MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE.
# See the Mulan PSL v2 for more details.
# #############################################
# @Author : honghua
# @Contact : honghua@iscas.ac.cn
# @Date : 2026-03-28
# @License : Mulan PSL v2
# @Desc : Test accessing package documentation or help
# ############################################
source "$OET_PATH/libs/locallibs/common_lib.sh"
function run_test() {
# 定义日志函数(虽然题目说无需定义,但实际使用前需要定义,这里按需定义)
LOG_INFO() {
echo "[INFO] $*"
}
LOG_ERROR() {
echo "[ERROR] $*" >&2
}
# 定义检查结果函数
CHECK_RESULT() {
local actual=$1
local expect=$2
local mode=$3
local message=$4
if [ $mode -eq 0 ]; then
if [ $actual -eq $expect ]; then
LOG_INFO "$message 成功"
else
LOG_ERROR "$message 失败"
exit $actual
fi
else
if [ $actual -ne $expect ]; then
LOG_INFO "$message 成功"
else
LOG_ERROR "$message 失败"
exit $actual
fi
fi
}
# 定义SSH_CMD函数虽然题目说无需定义但实际使用前需要定义这里按需定义
SSH_CMD() {
local cmd=$1
local node_ip=$2
local node_password=$3
local node_user=$4
sshpass -p "$node_password" ssh -o StrictHostKeyChecking=no "$node_user@$node_ip" "$cmd"
}
# 测试脚本开始
LOG_INFO "开始测试Test accessing package documentation or help"
# 步骤1检查软件包是否在yum源中
LOG_INFO "步骤1检查yum源中是否有texlive-mathcommand软件包"
if ! dnf list available texlive-mathcommand &>/dev/null; then
LOG_ERROR "yum源中未找到texlive-mathcommand软件包"
exit 255
fi
CHECK_RESULT $? 0 0 "检查yum源中是否有texlive-mathcommand软件包"
# 步骤2检查是否已安装texlive-mathcommand
LOG_INFO "步骤2检查是否已安装texlive-mathcommand"
if rpm -q texlive-mathcommand &>/dev/null; then
LOG_INFO "texlive-mathcommand已安装跳过安装步骤"
INSTALLED=true
else
LOG_INFO "texlive-mathcommand未安装将进行安装"
INSTALLED=false
fi
# 步骤3如果未安装则安装软件包
if [ "$INSTALLED" = false ]; then
LOG_INFO "步骤3安装texlive-mathcommand软件包"
dnf install -y texlive-mathcommand
CHECK_RESULT $? 0 0 "安装texlive-mathcommand软件包"
fi
# 步骤4测试访问软件包文档或帮助
LOG_INFO "步骤4测试访问texlive-mathcommand软件包文档或帮助"
if command -v texdoc &>/dev/null; then
texdoc mathcommand
CHECK_RESULT $? 0 0 "使用texdoc访问mathcommand文档"
else
LOG_ERROR "texdoc命令不存在无法访问文档"
exit 255
fi
# 步骤5测试命令参数是否存在或不支持
LOG_INFO "步骤5测试texdoc命令参数是否存在或不支持"
if texdoc --help 2>&1 | grep -q "--help"; then
LOG_INFO "texdoc命令支持--help参数"
else
LOG_ERROR "texdoc命令不支持--help参数"
exit 255
fi
# 步骤6清理环境如果之前未安装则卸载软件包
if [ "$INSTALLED" = false ]; then
LOG_INFO "步骤6卸载texlive-mathcommand软件包"
dnf remove -y texlive-mathcommand
CHECK_RESULT $? 0 0 "卸载texlive-mathcommand软件包"
else
LOG_INFO "步骤6保持texlive-mathcommand软件包安装状态"
fi
LOG_INFO "测试完成Test accessing package documentation or help"
}
main "$@"

View File

@@ -1,69 +0,0 @@
#!/usr/bin/bash
# Copyright (c) 2024 ISCAS .ALL rights reserved.
# This program is licensed under Mulan PSL v2.
# You can use it according to the terms and conditions of the Mulan PSL v2.
# http://license.coscl.org.cn/MulanPSL2
# THIS PROGRAM IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND,
# EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT,
# MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE.
# See the Mulan PSL v2 for more details.
# #############################################
# @Author : honghua
# @Contact : honghua@iscas.ac.cn
# @Date : 2025-11-27
# @License : Mulan PSL v2
# @Desc : Test basic math command functionality
# ############################################
source "$OET_PATH/libs/locallibs/common_lib.sh"
function run_test() {
LOG_INFO "开始测试基本数学命令功能"
# 检查是否已安装texlive-mathcommand软件包
LOG_INFO "检查texlive-mathcommand是否已安装"
if dnf list installed texlive-mathcommand &> /dev/null; then
LOG_INFO "texlive-mathcommand已安装测试结束后保持安装状态"
INSTALLED=true
else
LOG_INFO "texlive-mathcommand未安装测试结束后将卸载"
INSTALLED=false
fi
# 检查yum源中是否有texlive-mathcommand软件包
LOG_INFO "检查yum源中是否存在texlive-mathcommand"
if ! dnf list available texlive-mathcommand &> /dev/null; then
LOG_ERROR "yum源中未找到texlive-mathcommand软件包"
exit 255
fi
# 如果未安装,则安装软件包
if [ "$INSTALLED" = false ]; then
LOG_INFO "正在安装texlive-mathcommand"
dnf install -y texlive-mathcommand
CHECK_RESULT $? 0 0 "安装texlive-mathcommand失败"
fi
# 测试基本数学命令功能
LOG_INFO "测试基本数学命令功能"
mathcommand --version &> /dev/null
CHECK_RESULT $? 0 0 "mathcommand命令执行失败"
# 测试不支持的参数
LOG_INFO "测试不支持的参数"
mathcommand --invalid-arg &> /dev/null
CHECK_RESULT $? 255 255 "不支持的参数未正确退出"
# 清理环境:如果测试前未安装,则卸载软件包
if [ "$INSTALLED" = false ]; then
LOG_INFO "卸载texlive-mathcommand"
dnf remove -y texlive-mathcommand
CHECK_RESULT $? 0 0 "卸载texlive-mathcommand失败"
fi
LOG_INFO "测试完成"
}
main "$@"

View File

@@ -1,132 +0,0 @@
#!/usr/bin/bash
# Copyright (c) 2024 ISCAS .ALL rights reserved.
# This program is licensed under Mulan PSL v2.
# You can use it according to the terms and conditions of the Mulan PSL v2.
# http://license.coscl.org.cn/MulanPSL2
# THIS PROGRAM IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND,
# EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT,
# MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE.
# See the Mulan PSL v2 for more details.
# #############################################
# @Author : honghua
# @Contact : honghua@iscas.ac.cn
# @Date : 2026-03-28
# @License : Mulan PSL v2
# @Desc : Test basic usage of math commands
# ############################################
source "$OET_PATH/libs/locallibs/common_lib.sh"
function run_test() {
# 测试脚本:测试数学命令的基本用法
LOG_INFO "开始测试数学命令的基本用法"
# 检查是否已安装texlive-mathcommand软件包
LOG_INFO "步骤1检查texlive-mathcommand是否已安装"
rpm -q texlive-mathcommand
if [ $? -eq 0 ]; then
LOG_INFO "texlive-mathcommand已安装测试结束后将保持安装状态"
INSTALLED=true
else
LOG_INFO "texlive-mathcommand未安装将在测试前安装并在测试后卸载"
INSTALLED=false
fi
# 检查yum源中是否有该软件包
LOG_INFO "步骤2检查yum源中是否有texlive-mathcommand软件包"
dnf list available texlive-mathcommand
if [ $? -ne 0 ]; then
LOG_ERROR "yum源中未找到texlive-mathcommand软件包"
exit 255
fi
# 如果未安装,则安装软件包
if [ "$INSTALLED" = false ]; then
LOG_INFO "步骤3安装texlive-mathcommand软件包"
dnf install -y texlive-mathcommand
CHECK_RESULT $? 0 0 "安装texlive-mathcommand失败"
fi
# 测试基本数学命令
LOG_INFO "步骤4测试基本数学命令"
# 测试加法命令
LOG_INFO "测试加法命令"
math_add 5 3
CHECK_RESULT $? 0 0 "加法命令执行失败"
result=$(math_add 5 3)
CHECK_RESULT $? 0 0 "获取加法结果失败"
[ "$result" -eq 8 ]
CHECK_RESULT $? 0 0 "加法结果不正确预期8实际$result"
# 测试减法命令
LOG_INFO "测试减法命令"
math_subtract 10 4
CHECK_RESULT $? 0 0 "减法命令执行失败"
result=$(math_subtract 10 4)
CHECK_RESULT $? 0 0 "获取减法结果失败"
[ "$result" -eq 6 ]
CHECK_RESULT $? 0 0 "减法结果不正确预期6实际$result"
# 测试乘法命令
LOG_INFO "测试乘法命令"
math_multiply 7 6
CHECK_RESULT $? 0 0 "乘法命令执行失败"
result=$(math_multiply 7 6)
CHECK_RESULT $? 0 0 "获取乘法结果失败"
[ "$result" -eq 42 ]
CHECK_RESULT $? 0 0 "乘法结果不正确预期42实际$result"
# 测试除法命令
LOG_INFO "测试除法命令"
math_divide 20 5
CHECK_RESULT $? 0 0 "除法命令执行失败"
result=$(math_divide 20 5)
CHECK_RESULT $? 0 0 "获取除法结果失败"
[ "$result" -eq 4 ]
CHECK_RESULT $? 0 0 "除法结果不正确预期4实际$result"
# 测试不支持的参数
LOG_INFO "步骤5测试不支持的参数"
math_add 5 3 2
if [ $? -eq 255 ]; then
LOG_INFO "不支持多个参数的情况已正确处理"
else
LOG_ERROR "不支持多个参数的情况未正确处理"
exit 255
fi
# 测试不存在的命令选项
LOG_INFO "测试不存在的命令选项"
math_add --invalid-option 5 3
if [ $? -eq 255 ]; then
LOG_INFO "不支持的命令选项已正确处理"
else
LOG_ERROR "不支持的命令选项未正确处理"
exit 255
fi
# 测试在第二个服务器上执行命令(如果配置了多服务器环境)
if [ -n "$NODE2_IPV4" ] && [ -n "$NODE2_PASSWORD" ] && [ -n "$NODE2_USER" ]; then
LOG_INFO "步骤6在第二个服务器上测试数学命令"
SSH_CMD "math_add 10 20" $NODE2_IPV4 $NODE2_PASSWORD $NODE2_USER
CHECK_RESULT $? 0 0 "在第二个服务器上执行数学命令失败"
fi
# 清理环境
LOG_INFO "步骤7清理测试环境"
if [ "$INSTALLED" = false ]; then
LOG_INFO "卸载texlive-mathcommand软件包"
dnf remove -y texlive-mathcommand
CHECK_RESULT $? 0 0 "卸载texlive-mathcommand失败"
LOG_INFO "已卸载texlive-mathcommand软件包"
else
LOG_INFO "测试开始时texlive-mathcommand已安装保持安装状态"
fi
LOG_INFO "数学命令基本用法测试完成"
}
main "$@"