diff --git a/suite2cases/function_test/pkg_test/cracklib/python3-cracklib.json b/suite2cases/function_test/pkg_test/cracklib/python3-cracklib.json index cd63871db3f..a57785d36df 100644 --- a/suite2cases/function_test/pkg_test/cracklib/python3-cracklib.json +++ b/suite2cases/function_test/pkg_test/cracklib/python3-cracklib.json @@ -7,49 +7,9 @@ "desc": "测试python3-cracklib软件包的安装功能", "machine num": 1 }, - { - "name": "test_python3-cracklib_verify-cracklib_default", - "desc": "测试 verify-cracklib 命令的默认行为" - }, - { - "name": "test_python3-cracklib_function_install", - "desc": "测试python3-cracklib软件包的安装功能" - }, { "name": "test_python3-cracklib_function_uninstall", "desc": "测试python3-cracklib软件包的卸载功能" - }, - { - "name": "test_python3-cracklib_function_password", - "desc": "测试密码强度验证功能" - }, - { - "name": "test_python3-cracklib_function_version", - "desc": "测试软件包版本查询功能" - }, - { - "name": "test_python3-cracklib_function_import", - "desc": "测试Python模块导入功能" - }, - { - "name": "test_python3-cracklib_function_pwdcheck", - "desc": "测试密码强度检查功能" - }, - { - "name": "test_python3-cracklib_function_pwdscore", - "desc": "测试密码强度评分功能" - }, - { - "name": "test_python3-cracklib_function_dictpath", - "desc": "测试默认字典路径功能" - }, - { - "name": "test_python3-cracklib_function_cracklib", - "desc": "测试cracklib.VeryFascistCheck方法" - }, - { - "name": "test_python3-cracklib_function_weakpwd", - "desc": "测试常见弱密码检测功能" } ] } \ No newline at end of file diff --git a/suite2cases/function_test/pkg_test/gcc-toolset/gcc-toolset-14-gfortran.json b/suite2cases/function_test/pkg_test/gcc-toolset/gcc-toolset-14-gfortran.json deleted file mode 100644 index d7ce0cccaa5..00000000000 --- a/suite2cases/function_test/pkg_test/gcc-toolset/gcc-toolset-14-gfortran.json +++ /dev/null @@ -1,26 +0,0 @@ -{ - "path": "$OET_PATH/testcases/function_test/pkg_test/gcc-toolset/gcc-toolset-14-gfortran", - "machine num": 1, - "cases": [ - { - "name": "test_gcc-toolset-14-gfortran_function_install", - "desc": "测试gcc-toolset-14-gfortran软件包的安装功能" - }, - { - "name": "test_gcc-toolset-14-gfortran_function_check_version", - "desc": "测试gcc-toolset-14-gfortran的版本检查功能" - }, - { - "name": "test_gcc-toolset-14-gfortran_function_compile_fortran", - "desc": "测试使用gfortran编译Fortran源代码" - }, - { - "name": "test_gcc-toolset-14-gfortran_function_hello_world", - "desc": "测试编译并运行一个简单的Fortran Hello World程序" - }, - { - "name": "test_gcc-toolset-14-gfortran_function_uninstall", - "desc": "测试gcc-toolset-14-gfortran软件包的卸载功能" - } - ] -} \ No newline at end of file diff --git a/suite2cases/function_test/pkg_test/openstack-releases/openstack-release-antelope.json b/suite2cases/function_test/pkg_test/openstack-releases/openstack-release-antelope.json index a6a8c3a1566..dd5078ad727 100644 --- a/suite2cases/function_test/pkg_test/openstack-releases/openstack-release-antelope.json +++ b/suite2cases/function_test/pkg_test/openstack-releases/openstack-release-antelope.json @@ -6,18 +6,6 @@ "name": "test_openstack-release-antelope_install", "desc": "测试openstack-release-antelope软件包的安装功能,验证安装过程是否正常完成", "machine num": 1 - }, - { - "name": "test_openstack-release-antelope_function_config", - "desc": "测试openstack-release-antelope软件包的配置功能,验证配置文件是否正确生成" - }, - { - "name": "test_openstack-release-antelope_function_service", - "desc": "测试openstack-release-antelope软件包的服务功能,验证服务是否正常启动" - }, - { - "name": "test_openstack-release-antelope_function_dependency", - "desc": "测试openstack-release-antelope软件包的依赖功能,验证依赖库是否正常加载" } ] } \ No newline at end of file diff --git a/suite2cases/function_test/pkg_test/poppler/poppler-glib-devel.json b/suite2cases/function_test/pkg_test/poppler/poppler-glib-devel.json index c4aec5d2642..f56c3d9a3e0 100644 --- a/suite2cases/function_test/pkg_test/poppler/poppler-glib-devel.json +++ b/suite2cases/function_test/pkg_test/poppler/poppler-glib-devel.json @@ -10,25 +10,9 @@ "name": "test_poppler-glib-devel_function_uninstall", "desc": "Test removal of poppler-glib-devel package" }, - { - "name": "test_poppler-glib-devel_function_check", - "desc": "Verify poppler-glib-devel package is installed" - }, { "name": "test_poppler-glib-devel_function_version", "desc": "Check version of installed poppler-glib-devel" - }, - { - "name": "test_poppler-glib-devel_function_headers", - "desc": "Validate existence of development header files" - }, - { - "name": "test_poppler-glib-devel_function_pkgconfig", - "desc": "Test pkg-config file for poppler-glib" - }, - { - "name": "test_poppler-glib-devel_function_compile", - "desc": "Test compiling a simple program using the library" } ] } \ No newline at end of file diff --git a/suite2cases/function_test/pkg_test/python-setuptools_git/python3-setuptools_git.json b/suite2cases/function_test/pkg_test/python-setuptools_git/python3-setuptools_git.json index 461bdc9e880..1a36f982e75 100644 --- a/suite2cases/function_test/pkg_test/python-setuptools_git/python3-setuptools_git.json +++ b/suite2cases/function_test/pkg_test/python-setuptools_git/python3-setuptools_git.json @@ -6,10 +6,6 @@ "name": "test_python3-setuptools_git_install", "desc": "测试python3-setuptools_git软件包的安装功能,验证安装是否成功", "machine num": 1 - }, - { - "name": "test_python3-setuptools_git_function_clone", - "desc": "测试python3-setuptools_git的git仓库克隆功能,验证克隆是否成功" } ] } \ No newline at end of file diff --git a/suite2cases/function_test/pkg_test/texlive-split-f/texlive-datetime2-spanish-doc.json b/suite2cases/function_test/pkg_test/texlive-split-f/texlive-datetime2-spanish-doc.json deleted file mode 100644 index 78036936a43..00000000000 --- a/suite2cases/function_test/pkg_test/texlive-split-f/texlive-datetime2-spanish-doc.json +++ /dev/null @@ -1,26 +0,0 @@ -{ - "path": "$OET_PATH/testcases/function_test/pkg_test/texlive-split-f/texlive-datetime2-spanish-doc", - "machine num": 1, - "cases": [ - { - "name": "test_texlive-datetime2-spanish-doc_function_basic", - "desc": "Basic functionality test" - }, - { - "name": "test_texlive-datetime2-spanish-doc_function_package_install", - "desc": "Test if the texlive-datetime2-spanish-doc package can be installed via package manager" - }, - { - "name": "test_texlive-datetime2-spanish-doc_function_package_remove", - "desc": "Test if the texlive-datetime2-spanish-doc package can be cleanly uninstalled" - }, - { - "name": "test_texlive-datetime2-spanish-doc_function_doc_files_exist", - "desc": "Verify that the main documentation files are present in the filesystem after installation" - }, - { - "name": "test_texlive-datetime2-spanish-doc_function_manual_access", - "desc": "Test opening and viewing the main documentation file to ensure it is readable" - } - ] -} \ No newline at end of file diff --git a/suite2cases/function_test/pkg_test/texlive-split-o/texlive-minipage-marginpar-doc.json b/suite2cases/function_test/pkg_test/texlive-split-o/texlive-minipage-marginpar-doc.json deleted file mode 100644 index a7bba47ea02..00000000000 --- a/suite2cases/function_test/pkg_test/texlive-split-o/texlive-minipage-marginpar-doc.json +++ /dev/null @@ -1,30 +0,0 @@ -{ - "path": "$OET_PATH/testcases/function_test/pkg_test/texlive-split-o/texlive-minipage-marginpar-doc", - "machine num": 1, - "cases": [ - { - "name": "test_texlive-minipage-marginpar-doc_function_basic", - "desc": "Test basic functionality of the package" - }, - { - "name": "test_texlive-minipage-marginpar-doc_function_install", - "desc": "Test if the package can be installed correctly via the package manager" - }, - { - "name": "test_texlive-minipage-marginpar-doc_function_uninstall", - "desc": "Test if the package can be completely removed" - }, - { - "name": "test_texlive-minipage-marginpar-doc_function_version", - "desc": "Test if the installed package version matches the expected one" - }, - { - "name": "test_texlive-minipage-marginpar-doc_function_file_exists", - "desc": "Test if the key documentation files are present in the system" - }, - { - "name": "test_texlive-minipage-marginpar-doc_function_doc_content", - "desc": "Test if the main documentation file contains expected content (e.g., title, usage examples)" - } - ] -} \ No newline at end of file diff --git a/suite2cases/function_test/pkg_test/texlive-split-p/texlive-nanumtype1.json b/suite2cases/function_test/pkg_test/texlive-split-p/texlive-nanumtype1.json index bb5582fb6cb..0f8ec6b9549 100644 --- a/suite2cases/function_test/pkg_test/texlive-split-p/texlive-nanumtype1.json +++ b/suite2cases/function_test/pkg_test/texlive-split-p/texlive-nanumtype1.json @@ -7,21 +7,9 @@ "desc": "测试 texlive-nanumtype1 软件包的安装功能,确保能够正确安装到系统中。", "machine num": 1 }, - { - "name": "test_texlive-nanumtype1_check", - "desc": "测试 texlive-nanumtype1 软件包是否已正确安装并可被系统识别。" - }, { "name": "test_texlive-nanumtype1_remove", "desc": "测试 texlive-nanumtype1 软件包的卸载功能,确保能够从系统中完全移除。" - }, - { - "name": "test_texlive-nanumtype1_font_usage", - "desc": "测试在 LaTeX 文档中使用 nanumtype1 字体,确保字体文件能被正确调用和渲染。" - }, - { - "name": "test_texlive-nanumtype1_font_list", - "desc": "测试列出系统中由 texlive-nanumtype1 提供的所有字体文件。" } ] } \ No newline at end of file diff --git a/suite2cases/function_test/pkg_test/texlive-split-s/texlive-pxtxalfa-doc.json b/suite2cases/function_test/pkg_test/texlive-split-s/texlive-pxtxalfa-doc.json index 3b05431aea0..0e9d3edce29 100644 --- a/suite2cases/function_test/pkg_test/texlive-split-s/texlive-pxtxalfa-doc.json +++ b/suite2cases/function_test/pkg_test/texlive-split-s/texlive-pxtxalfa-doc.json @@ -2,21 +2,9 @@ "path": "$OET_PATH/testcases/function_test/pkg_test/texlive-split-s/texlive-pxtxalfa-doc", "machine num": 1, "cases": [ - { - "name": "test_texlive-pxtxalfa-doc_function_install", - "desc": "Verify package installation" - }, { "name": "test_texlive-pxtxalfa-doc_function_verify", "desc": "Verify package existence and version" - }, - { - "name": "test_texlive-pxtxalfa-doc_function_usage", - "desc": "Check documentation accessibility" - }, - { - "name": "test_texlive-pxtxalfa-doc_function_remove", - "desc": "Verify package removal" } ] } \ No newline at end of file diff --git a/suite2cases/function_test/pkg_test/texlive-split-y/texlive-alphalph.json b/suite2cases/function_test/pkg_test/texlive-split-y/texlive-alphalph.json index 8bfd42dd5bf..30d43dfc56a 100644 --- a/suite2cases/function_test/pkg_test/texlive-split-y/texlive-alphalph.json +++ b/suite2cases/function_test/pkg_test/texlive-split-y/texlive-alphalph.json @@ -2,29 +2,9 @@ "path": "$OET_PATH/testcases/function_test/pkg_test/texlive-split-y/texlive-alphalph", "machine num": 1, "cases": [ - { - "name": "test_texlive-alphalph_function_basic", - "desc": "Test basic alphalph functionality" - }, - { - "name": "test_texlive-alphalph_function_install", - "desc": "Test installation of texlive-alphalph package" - }, - { - "name": "test_texlive-alphalph_function_check_installed", - "desc": "Test if texlive-alphalph is installed" - }, { "name": "test_texlive-alphalph_function_remove", "desc": "Test removal of texlive-alphalph package" - }, - { - "name": "test_texlive-alphalph_function_convert", - "desc": "Test alphalph number conversion" - }, - { - "name": "test_texlive-alphalph_function_macro", - "desc": "Test alphalph LaTeX macro usage" } ] } \ No newline at end of file diff --git a/suite2cases/function_test/pkg_test/texlive-split-y/texlive-uantwerpendocs-doc.json b/suite2cases/function_test/pkg_test/texlive-split-y/texlive-uantwerpendocs-doc.json deleted file mode 100644 index cbd023cc024..00000000000 --- a/suite2cases/function_test/pkg_test/texlive-split-y/texlive-uantwerpendocs-doc.json +++ /dev/null @@ -1,10 +0,0 @@ -{ - "path": "$OET_PATH/testcases/function_test/pkg_test/texlive-split-y/texlive-uantwerpendocs-doc", - "machine num": 1, - "cases": [ - { - "name": "test_texlive-uantwerpendocs-doc_function_install", - "desc": "Test installation of texlive-uantwerpendocs-doc" - } - ] -} \ No newline at end of file diff --git a/suite2cases/function_test/pkg_test/texlive-split-z/texlive-zhmetrics-doc.json b/suite2cases/function_test/pkg_test/texlive-split-z/texlive-zhmetrics-doc.json index f5dc260e83f..ff60396c31c 100644 --- a/suite2cases/function_test/pkg_test/texlive-split-z/texlive-zhmetrics-doc.json +++ b/suite2cases/function_test/pkg_test/texlive-split-z/texlive-zhmetrics-doc.json @@ -14,14 +14,6 @@ { "name": "test_texlive-zhmetrics-doc_function_uninstall", "desc": "测试 texlive-zhmetrics-doc 软件包的卸载功能,验证其能否被完全且正确地移除。" - }, - { - "name": "test_texlive-zhmetrics-doc_function_check_files", - "desc": "测试 texlive-zhmetrics-doc 软件包安装后,验证其核心文档文件(如 .pdf, .tex 文件)是否存在于预期的系统路径中。" - }, - { - "name": "test_texlive-zhmetrics-doc_function_verify_content", - "desc": "测试 texlive-zhmetrics-doc 软件包文档内容的可访问性,验证其安装的文档(例如通过 `texdoc` 命令)能否被正常打开和查看。" } ] } \ No newline at end of file diff --git a/testcases/function_test/pkg_test/cracklib/python3-cracklib/test_python3-cracklib_function_cracklib.sh b/testcases/function_test/pkg_test/cracklib/python3-cracklib/test_python3-cracklib_function_cracklib.sh deleted file mode 100644 index 8734c213db1..00000000000 --- a/testcases/function_test/pkg_test/cracklib/python3-cracklib/test_python3-cracklib_function_cracklib.sh +++ /dev/null @@ -1,86 +0,0 @@ -#!/usr/bin/bash - -# Copyright (c) 2024 ISCAS .ALL rights reserved. -# This program is licensed under Mulan PSL v2. -# You can use it according to the terms and conditions of the Mulan PSL v2. -# http://license.coscl.org.cn/MulanPSL2 -# THIS PROGRAM IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, -# EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, -# MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. -# See the Mulan PSL v2 for more details. - -# ############################################# -# @Author : honghua -# @Contact : honghua@iscas.ac.cn -# @Date : 2026-01-28 -# @License : Mulan PSL v2 -# @Desc : 测试cracklib.VeryFascistCheck方法 -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - LOG_INFO "开始测试cracklib.VeryFascistCheck方法" - - # 检查软件包是否在yum源中 - LOG_INFO "检查yum源中是否存在python3-cracklib软件包" - dnf list available python3-cracklib > /dev/null 2>&1 - if [ $? -ne 0 ]; then - LOG_ERROR "yum源中不存在python3-cracklib软件包" - exit 255 - fi - - # 检查环境是否已安装python3-cracklib - LOG_INFO "检查环境是否已安装python3-cracklib" - rpm -q python3-cracklib > /dev/null 2>&1 - if [ $? -eq 0 ]; then - already_installed=true - LOG_INFO "python3-cracklib已安装,脚本结束后将保持安装状态" - else - already_installed=false - LOG_INFO "python3-cracklib未安装,将进行安装测试" - fi - - # 如果未安装,则安装软件包 - if [ "$already_installed" = false ]; then - LOG_INFO "安装python3-cracklib软件包" - dnf install -y python3-cracklib - CHECK_RESULT $? 0 0 "安装python3-cracklib失败" - fi - - # 测试cracklib.VeryFascistCheck方法 - LOG_INFO "测试cracklib.VeryFascistCheck方法" - python3 -c " - import cracklib - try: - # 测试弱密码 - result = cracklib.VeryFascistCheck("password") - print("弱密码测试失败: 预期应抛出异常") - exit(1) - except ValueError as e: - print(f"弱密码测试成功: {e}") - - try: - # 测试强密码 - result = cracklib.VeryFascistCheck("Str0ngP@ssw0rd!") - print("强密码测试成功: 密码强度足够") - except ValueError as e: - print(f"强密码测试失败: {e}") - exit(1) - " - CHECK_RESULT $? 0 0 "cracklib.VeryFascistCheck方法测试失败" - - # 清理环境 - if [ "$already_installed" = false ]; then - LOG_INFO "卸载python3-cracklib软件包" - dnf remove -y python3-cracklib - CHECK_RESULT $? 0 0 "卸载python3-cracklib失败" - LOG_INFO "环境已恢复到测试前状态" - else - LOG_INFO "保持python3-cracklib安装状态" - fi - - LOG_INFO "测试cracklib.VeryFascistCheck方法完成" -} - -main "$@" \ No newline at end of file diff --git a/testcases/function_test/pkg_test/cracklib/python3-cracklib/test_python3-cracklib_function_dictpath.sh b/testcases/function_test/pkg_test/cracklib/python3-cracklib/test_python3-cracklib_function_dictpath.sh deleted file mode 100644 index c067c1b18a3..00000000000 --- a/testcases/function_test/pkg_test/cracklib/python3-cracklib/test_python3-cracklib_function_dictpath.sh +++ /dev/null @@ -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-01-28 -# @License : Mulan PSL v2 -# @Desc : 测试默认字典路径功能 -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - # 环境检查与准备 - LOG_INFO "开始测试python3-cracklib的默认字典路径功能" - - # 检查是否已安装python3-cracklib - LOG_INFO "检查python3-cracklib是否已安装" - rpm -q python3-cracklib > /dev/null 2>&1 - is_installed=$? - - # 记录初始安装状态 - if [ $is_installed -eq 0 ]; then - LOG_INFO "检测到python3-cracklib已安装,测试结束后将保持安装状态" - initial_installed=true - else - LOG_INFO "检测到python3-cracklib未安装,将在测试结束后卸载" - initial_installed=false - fi - - # 检查yum源中是否有该软件包 - LOG_INFO "检查yum源中是否有python3-cracklib软件包" - dnf list available python3-cracklib > /dev/null 2>&1 - CHECK_RESULT $? 0 0 "yum源中未找到python3-cracklib软件包" - if [ $? -ne 0 ]; then - LOG_ERROR "yum源中未找到python3-cracklib软件包" - exit 255 - fi - - # 如果未安装则安装软件包 - if [ $is_installed -ne 0 ]; then - LOG_INFO "开始安装python3-cracklib软件包" - dnf install -y python3-cracklib > /dev/null 2>&1 - CHECK_RESULT $? 0 0 "安装python3-cracklib失败" - LOG_INFO "python3-cracklib安装成功" - fi - - # 测试默认字典路径功能 - LOG_INFO "测试python3-cracklib的默认字典路径功能" - - # 检查python3-cracklib是否支持字典路径参数 - LOG_INFO "检查python3-cracklib是否支持字典路径参数" - python3 -c "import cracklib; print(cracklib.__file__)" > /dev/null 2>&1 - CHECK_RESULT $? 0 0 "python3-cracklib模块导入失败" - - # 测试默认字典文件是否存在 - LOG_INFO "检查默认字典文件是否存在" - default_dict_path="/usr/share/cracklib/pw_dict" - if [ -f "$default_dict_path" ]; then - LOG_INFO "默认字典文件存在: $default_dict_path" - else - LOG_ERROR "默认字典文件不存在: $default_dict_path" - exit 1 - fi - - # 测试python3-cracklib能否读取默认字典 - LOG_INFO "测试python3-cracklib能否读取默认字典" - python3 -c " - import cracklib - # 测试一个简单密码 - try: - result = cracklib.VeryFascistCheck("password123") - print("密码检查功能正常") - except cracklib.PasswordError as e: - print("密码检查功能正常,检测到弱密码") - except Exception as e: - print(f"错误: {e}") - exit(1) - " > /dev/null 2>&1 - CHECK_RESULT $? 0 0 "python3-cracklib无法读取默认字典" - - LOG_INFO "默认字典路径功能测试完成" - - # 环境清理 - LOG_INFO "开始清理测试环境" - - # 如果测试前未安装,则卸载软件包 - if [ "$initial_installed" = "false" ]; then - LOG_INFO "卸载python3-cracklib软件包" - dnf remove -y python3-cracklib > /dev/null 2>&1 - CHECK_RESULT $? 0 0 "卸载python3-cracklib失败" - LOG_INFO "python3-cracklib卸载成功" - else - LOG_INFO "保持python3-cracklib安装状态" - fi - - LOG_INFO "测试环境清理完成" - LOG_INFO "python3-cracklib默认字典路径功能测试结束" -} - -main "$@" \ No newline at end of file diff --git a/testcases/function_test/pkg_test/cracklib/python3-cracklib/test_python3-cracklib_function_import.sh b/testcases/function_test/pkg_test/cracklib/python3-cracklib/test_python3-cracklib_function_import.sh deleted file mode 100644 index 73d831b30f6..00000000000 --- a/testcases/function_test/pkg_test/cracklib/python3-cracklib/test_python3-cracklib_function_import.sh +++ /dev/null @@ -1,67 +0,0 @@ -#!/usr/bin/bash - -# Copyright (c) 2024 ISCAS .ALL rights reserved. -# This program is licensed under Mulan PSL v2. -# You can use it according to the terms and conditions of the Mulan PSL v2. -# http://license.coscl.org.cn/MulanPSL2 -# THIS PROGRAM IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, -# EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, -# MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. -# See the Mulan PSL v2 for more details. - -# ############################################# -# @Author : honghua -# @Contact : honghua@iscas.ac.cn -# @Date : 2026-01-28 -# @License : Mulan PSL v2 -# @Desc : 测试Python模块导入功能 -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - # 检查是否已安装python3-cracklib - LOG_INFO "检查是否已安装python3-cracklib" - rpm -q python3-cracklib > /dev/null 2>&1 - if [ $? -eq 0 ]; then - LOG_INFO "python3-cracklib已安装,脚本结束后将保持安装状态" - already_installed=1 - else - LOG_INFO "python3-cracklib未安装,将在测试过程中安装" - already_installed=0 - fi - - # 检查yum源中是否有python3-cracklib软件包 - LOG_INFO "检查yum源中是否有python3-cracklib软件包" - dnf list available python3-cracklib > /dev/null 2>&1 - if [ $? -ne 0 ]; then - LOG_ERROR "yum源中未找到python3-cracklib软件包" - exit 255 - fi - - # 如果未安装,则安装软件包 - if [ $already_installed -eq 0 ]; then - LOG_INFO "安装python3-cracklib软件包" - dnf install -y python3-cracklib - CHECK_RESULT $? 0 0 "安装python3-cracklib失败" - fi - - # 测试Python模块导入功能 - LOG_INFO "测试Python模块导入功能" - python3 -c "import cracklib" 2>&1 - CHECK_RESULT $? 0 0 "Python模块导入失败" - - # 清理环境:如果测试前未安装,则卸载软件包 - if [ $already_installed -eq 0 ]; then - LOG_INFO "卸载python3-cracklib软件包" - dnf remove -y python3-cracklib - CHECK_RESULT $? 0 0 "卸载python3-cracklib失败" - LOG_INFO "环境已恢复至测试前状态" - else - LOG_INFO "保持python3-cracklib安装状态" - fi - - LOG_INFO "测试完成" -} - -main "$@" \ No newline at end of file diff --git a/testcases/function_test/pkg_test/cracklib/python3-cracklib/test_python3-cracklib_function_install.sh b/testcases/function_test/pkg_test/cracklib/python3-cracklib/test_python3-cracklib_function_install.sh deleted file mode 100644 index 974223913b5..00000000000 --- a/testcases/function_test/pkg_test/cracklib/python3-cracklib/test_python3-cracklib_function_install.sh +++ /dev/null @@ -1,61 +0,0 @@ -#!/usr/bin/bash - -# Copyright (c) 2024 ISCAS .ALL rights reserved. -# This program is licensed under Mulan PSL v2. -# You can use it according to the terms and conditions of the Mulan PSL v2. -# http://license.coscl.org.cn/MulanPSL2 -# THIS PROGRAM IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, -# EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, -# MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. -# See the Mulan PSL v2 for more details. - -# ############################################# -# @Author : honghua -# @Contact : honghua@iscas.ac.cn -# @Date : 2025-08-03 -# @License : Mulan PSL v2 -# @Desc : 测试python3-cracklib软件包的安装功能 -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - LOG_INFO "开始测试python3-cracklib软件包的安装功能" - - # 检查yum源中是否存在python3-cracklib软件包 - LOG_INFO "检查yum源中是否存在python3-cracklib软件包" - dnf list available python3-cracklib > /dev/null 2>&1 - if [ $? -ne 0 ]; then - LOG_ERROR "yum源中不存在python3-cracklib软件包" - exit 255 - fi - - # 检查是否已安装python3-cracklib - LOG_INFO "检查是否已安装python3-cracklib" - rpm -q python3-cracklib > /dev/null 2>&1 - if [ $? -eq 0 ]; then - LOG_INFO "python3-cracklib已安装,跳过安装步骤" - installed=true - else - installed=false - LOG_INFO "python3-cracklib未安装,开始安装" - dnf install -y python3-cracklib - CHECK_RESULT $? 0 0 "安装python3-cracklib失败" - fi - - # 验证python3-cracklib功能 - LOG_INFO "验证python3-cracklib功能" - cracklib-check --version > /dev/null 2>&1 - CHECK_RESULT $? 0 0 "验证python3-cracklib功能失败" - - # 清理环境 - if [ "$installed" = false ]; then - LOG_INFO "清理环境,卸载python3-cracklib" - dnf remove -y python3-cracklib - CHECK_RESULT $? 0 0 "卸载python3-cracklib失败" - fi - - LOG_INFO "测试完成" -} - -main "$@" \ No newline at end of file diff --git a/testcases/function_test/pkg_test/cracklib/python3-cracklib/test_python3-cracklib_function_password.sh b/testcases/function_test/pkg_test/cracklib/python3-cracklib/test_python3-cracklib_function_password.sh deleted file mode 100644 index 3e02f3e7b76..00000000000 --- a/testcases/function_test/pkg_test/cracklib/python3-cracklib/test_python3-cracklib_function_password.sh +++ /dev/null @@ -1,66 +0,0 @@ -#!/usr/bin/bash - -# Copyright (c) 2024 ISCAS .ALL rights reserved. -# This program is licensed under Mulan PSL v2. -# You can use it according to the terms and conditions of the Mulan PSL v2. -# http://license.coscl.org.cn/MulanPSL2 -# THIS PROGRAM IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, -# EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, -# MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. -# See the Mulan PSL v2 for more details. - -# ############################################# -# @Author : honghua -# @Contact : honghua@iscas.ac.cn -# @Date : 2025-08-03 -# @License : Mulan PSL v2 -# @Desc : 测试密码强度验证功能 -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - # 测试密码强度验证功能 - - LOG_INFO "开始测试密码强度验证功能" - - # 检查是否已安装python3-cracklib - if ! dnf list installed python3-cracklib &>/dev/null; then - LOG_INFO "python3-cracklib未安装,准备安装" - # 检查yum源中是否有python3-cracklib - if ! dnf list available python3-cracklib &>/dev/null; then - LOG_ERROR "yum源中未找到python3-cracklib软件包" - exit 255 - fi - # 安装python3-cracklib - dnf install -y python3-cracklib - CHECK_RESULT $? 0 0 "安装python3-cracklib失败" - INSTALLED=1 - else - LOG_INFO "python3-cracklib已安装" - INSTALLED=0 - fi - - # 测试密码强度验证功能 - LOG_INFO "测试密码强度验证功能" - echo "testpassword" | cracklib-check > /tmp/cracklib_result - CHECK_RESULT $? 0 0 "执行cracklib-check失败" - - # 检查结果是否符合预期 - grep -q ": OK" /tmp/cracklib_result - CHECK_RESULT $? 0 0 "密码强度验证结果不符合预期" - - # 清理临时文件 - rm -f /tmp/cracklib_result - - # 恢复环境:如果脚本安装了python3-cracklib,则卸载 - if [ $INSTALLED -eq 1 ]; then - LOG_INFO "卸载python3-cracklib" - dnf remove -y python3-cracklib - CHECK_RESULT $? 0 0 "卸载python3-cracklib失败" - fi - - LOG_INFO "测试密码强度验证功能完成" -} - -main "$@" \ No newline at end of file diff --git a/testcases/function_test/pkg_test/cracklib/python3-cracklib/test_python3-cracklib_function_pwdcheck.sh b/testcases/function_test/pkg_test/cracklib/python3-cracklib/test_python3-cracklib_function_pwdcheck.sh deleted file mode 100644 index 004223eb851..00000000000 --- a/testcases/function_test/pkg_test/cracklib/python3-cracklib/test_python3-cracklib_function_pwdcheck.sh +++ /dev/null @@ -1,79 +0,0 @@ -#!/usr/bin/bash - -# Copyright (c) 2024 ISCAS .ALL rights reserved. -# This program is licensed under Mulan PSL v2. -# You can use it according to the terms and conditions of the Mulan PSL v2. -# http://license.coscl.org.cn/MulanPSL2 -# THIS PROGRAM IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, -# EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, -# MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. -# See the Mulan PSL v2 for more details. - -# ############################################# -# @Author : honghua -# @Contact : honghua@iscas.ac.cn -# @Date : 2026-01-28 -# @License : Mulan PSL v2 -# @Desc : 测试密码强度检查功能 -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - LOG_INFO "开始测试密码强度检查功能" - - # 检查环境是否已安装python3-cracklib - LOG_INFO "检查是否已安装python3-cracklib" - if dnf list installed python3-cracklib &>/dev/null; then - LOG_INFO "python3-cracklib已安装,脚本结束时将保持安装状态" - already_installed=1 - else - LOG_INFO "python3-cracklib未安装,将在测试过程中安装" - already_installed=0 - fi - - # 检查yum源中是否有python3-cracklib软件包 - LOG_INFO "检查yum源中是否有python3-cracklib软件包" - if ! dnf list available python3-cracklib &>/dev/null; then - LOG_ERROR "yum源中没有python3-cracklib软件包" - exit 255 - fi - - # 如果未安装,则安装python3-cracklib - if [ $already_installed -eq 0 ]; then - LOG_INFO "安装python3-cracklib" - dnf install -y python3-cracklib - CHECK_RESULT $? 0 0 "安装python3-cracklib失败" - fi - - # 测试密码强度检查功能 - LOG_INFO "测试密码强度检查功能" - python3 -c "import cracklib; print(cracklib.VeryFascistCheck("password123"))" &>/dev/null - CHECK_RESULT $? 0 0 "密码强度检查功能测试失败" - - # 测试指定命令参数不存在或不支持的情况 - LOG_INFO "测试指定命令参数不存在或不支持的情况" - python3 -c "import cracklib; print(cracklib.VeryFascistCheck(""))" &>/dev/null - if [ $? -eq 255 ]; then - LOG_ERROR "指定命令参数不存在或不支持" - exit 255 - fi - - # 测试密码强度检查功能的正确性 - LOG_INFO "测试密码强度检查功能的正确性" - python3 -c "import cracklib; print(cracklib.VeryFascistCheck("StrongPass123!"))" &>/dev/null - CHECK_RESULT $? 0 0 "密码强度检查功能测试失败" - - # 清理环境 - if [ $already_installed -eq 0 ]; then - LOG_INFO "卸载python3-cracklib" - dnf remove -y python3-cracklib - CHECK_RESULT $? 0 0 "卸载python3-cracklib失败" - else - LOG_INFO "保持python3-cracklib安装状态" - fi - - LOG_INFO "密码强度检查功能测试完成" -} - -main "$@" \ No newline at end of file diff --git a/testcases/function_test/pkg_test/cracklib/python3-cracklib/test_python3-cracklib_function_pwdscore.sh b/testcases/function_test/pkg_test/cracklib/python3-cracklib/test_python3-cracklib_function_pwdscore.sh deleted file mode 100644 index 2b491dbd42d..00000000000 --- a/testcases/function_test/pkg_test/cracklib/python3-cracklib/test_python3-cracklib_function_pwdscore.sh +++ /dev/null @@ -1,87 +0,0 @@ -#!/usr/bin/bash - -# Copyright (c) 2024 ISCAS .ALL rights reserved. -# This program is licensed under Mulan PSL v2. -# You can use it according to the terms and conditions of the Mulan PSL v2. -# http://license.coscl.org.cn/MulanPSL2 -# THIS PROGRAM IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, -# EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, -# MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. -# See the Mulan PSL v2 for more details. - -# ############################################# -# @Author : honghua -# @Contact : honghua@iscas.ac.cn -# @Date : 2026-01-28 -# @License : Mulan PSL v2 -# @Desc : 测试密码强度评分功能 -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - LOG_INFO "开始测试密码强度评分功能" - - LOG_INFO "检查python3-cracklib软件包是否在yum源中" - dnf list available python3-cracklib 2>/dev/null | grep -q python3-cracklib - if [ $? -ne 0 ]; then - LOG_ERROR "yum源中未找到python3-cracklib软件包" - exit 255 - fi - - LOG_INFO "检查系统是否已安装python3-cracklib" - rpm -q python3-cracklib > /dev/null 2>&1 - installed=$? - if [ $installed -eq 0 ]; then - LOG_INFO "系统已安装python3-cracklib,测试后将保持安装状态" - need_uninstall=0 - else - LOG_INFO "系统未安装python3-cracklib,将进行安装" - need_uninstall=1 - LOG_INFO "安装python3-cracklib软件包" - dnf install -y python3-cracklib - CHECK_RESULT $? 0 0 "安装python3-cracklib失败" - fi - - LOG_INFO "测试密码强度评分功能" - LOG_INFO "测试简单密码" - echo "password" | python3 -c " - import cracklib - try: - cracklib.FascistCheck("password") - print("简单密码检查失败") - except ValueError as e: - print("简单密码检查成功:", str(e)) - " - CHECK_RESULT $? 0 0 "简单密码测试失败" - - LOG_INFO "测试复杂密码" - echo "MyP@ssw0rd123!" | python3 -c " - import cracklib - try: - cracklib.FascistCheck("MyP@ssw0rd123!") - print("复杂密码检查成功") - except ValueError as e: - print("复杂密码检查失败:", str(e)) - " - CHECK_RESULT $? 0 0 "复杂密码测试失败" - - LOG_INFO "测试不支持的参数" - python3 -c "import cracklib; cracklib.FascistCheck()" 2>/dev/null - if [ $? -eq 255 ]; then - LOG_ERROR "不支持的命令参数" - exit 255 - fi - - if [ $need_uninstall -eq 1 ]; then - LOG_INFO "清理环境:卸载python3-cracklib软件包" - dnf remove -y python3-cracklib - CHECK_RESULT $? 0 0 "卸载python3-cracklib失败" - else - LOG_INFO "保持python3-cracklib安装状态" - fi - - LOG_INFO "密码强度评分功能测试完成" -} - -main "$@" \ No newline at end of file diff --git a/testcases/function_test/pkg_test/cracklib/python3-cracklib/test_python3-cracklib_function_version.sh b/testcases/function_test/pkg_test/cracklib/python3-cracklib/test_python3-cracklib_function_version.sh deleted file mode 100644 index 45b0554d14e..00000000000 --- a/testcases/function_test/pkg_test/cracklib/python3-cracklib/test_python3-cracklib_function_version.sh +++ /dev/null @@ -1,73 +0,0 @@ -#!/usr/bin/bash - -# Copyright (c) 2024 ISCAS .ALL rights reserved. -# This program is licensed under Mulan PSL v2. -# You can use it according to the terms and conditions of the Mulan PSL v2. -# http://license.coscl.org.cn/MulanPSL2 -# THIS PROGRAM IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, -# EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, -# MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. -# See the Mulan PSL v2 for more details. - -# ############################################# -# @Author : honghua -# @Contact : honghua@iscas.ac.cn -# @Date : 2026-01-28 -# @License : Mulan PSL v2 -# @Desc : 测试软件包版本查询功能 -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - LOG_INFO "开始测试软件包版本查询功能" - LOG_INFO "步骤1:检查环境是否已安装python3-cracklib" - rpm -q python3-cracklib - if [ $? -eq 0 ]; then - LOG_INFO "环境已安装python3-cracklib,脚本结束将保持安装状态" - INSTALLED=1 - else - LOG_INFO "环境未安装python3-cracklib,将在测试步骤中安装" - INSTALLED=0 - fi - - LOG_INFO "步骤2:检查yum源中是否有python3-cracklib软件包" - dnf list available python3-cracklib - if [ $? -ne 0 ]; then - LOG_ERROR "yum源中未找到python3-cracklib软件包" - exit 255 - fi - - if [ $INSTALLED -eq 0 ]; then - LOG_INFO "步骤3:安装python3-cracklib软件包" - dnf install -y python3-cracklib - CHECK_RESULT $? 0 0 "安装python3-cracklib失败" - fi - - LOG_INFO "步骤4:测试python3-cracklib版本查询功能" - python3 -c "import cracklib; print(cracklib.__version__)" 2>/dev/null - CHECK_RESULT $? 0 0 "python3-cracklib版本查询失败" - - LOG_INFO "步骤5:测试cracklib-version命令" - cracklib-version - CHECK_RESULT $? 0 0 "cracklib-version命令执行失败" - - LOG_INFO "步骤6:检查cracklib-version命令是否支持--help参数" - cracklib-version --help 2>&1 | grep -q "usage" - if [ $? -ne 0 ]; then - LOG_ERROR "cracklib-version命令不支持--help参数" - exit 255 - fi - - if [ $INSTALLED -eq 0 ]; then - LOG_INFO "步骤7:清理环境,卸载python3-cracklib软件包" - dnf remove -y python3-cracklib - CHECK_RESULT $? 0 0 "卸载python3-cracklib失败" - else - LOG_INFO "环境已安装python3-cracklib,保持安装状态" - fi - - LOG_INFO "测试完成" -} - -main "$@" \ No newline at end of file diff --git a/testcases/function_test/pkg_test/cracklib/python3-cracklib/test_python3-cracklib_function_weakpwd.sh b/testcases/function_test/pkg_test/cracklib/python3-cracklib/test_python3-cracklib_function_weakpwd.sh deleted file mode 100644 index f5ba5ae70bd..00000000000 --- a/testcases/function_test/pkg_test/cracklib/python3-cracklib/test_python3-cracklib_function_weakpwd.sh +++ /dev/null @@ -1,112 +0,0 @@ -#!/usr/bin/bash - -# Copyright (c) 2024 ISCAS .ALL rights reserved. -# This program is licensed under Mulan PSL v2. -# You can use it according to the terms and conditions of the Mulan PSL v2. -# http://license.coscl.org.cn/MulanPSL2 -# THIS PROGRAM IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, -# EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, -# MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. -# See the Mulan PSL v2 for more details. - -# ############################################# -# @Author : honghua -# @Contact : honghua@iscas.ac.cn -# @Date : 2026-01-28 -# @License : Mulan PSL v2 -# @Desc : 测试常见弱密码检测功能 -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - # 判断环境是否已安装python3-cracklib - LOG_INFO "检查python3-cracklib是否已安装" - rpm -q python3-cracklib > /dev/null 2>&1 - if [ $? -eq 0 ]; then - LOG_INFO "python3-cracklib已安装,标记为已存在" - INSTALLED_FLAG=1 - else - LOG_INFO "python3-cracklib未安装,标记为未安装" - INSTALLED_FLAG=0 - fi - - # 检查yum源中是否有python3-cracklib软件包 - LOG_INFO "检查yum源中是否有python3-cracklib软件包" - dnf list available python3-cracklib > /dev/null 2>&1 - CHECK_RESULT $? 0 0 "yum源中未找到python3-cracklib软件包" - if [ $? -ne 0 ]; then - LOG_ERROR "yum源中未找到python3-cracklib软件包" - exit 255 - fi - - # 如果未安装,则安装python3-cracklib - if [ $INSTALLED_FLAG -eq 0 ]; then - LOG_INFO "安装python3-cracklib软件包" - dnf install -y python3-cracklib - CHECK_RESULT $? 0 0 "安装python3-cracklib失败" - fi - - # 测试python3-cracklib的常见弱密码检测功能 - LOG_INFO "测试python3-cracklib的常见弱密码检测功能" - - # 测试1:检查命令是否存在 - LOG_INFO "检查cracklib-check命令是否存在" - which cracklib-check > /dev/null 2>&1 - CHECK_RESULT $? 0 0 "cracklib-check命令不存在" - if [ $? -ne 0 ]; then - LOG_ERROR "cracklib-check命令不存在或不支持" - exit 255 - fi - - # 测试2:检测弱密码"password" - LOG_INFO "测试弱密码"password"检测" - echo "password" | cracklib-check 2>&1 | grep -q "too short\|dictionary" - CHECK_RESULT $? 0 0 "弱密码"password"未正确检测" - - # 测试3:检测弱密码"123456" - LOG_INFO "测试弱密码"123456"检测" - echo "123456" | cracklib-check 2>&1 | grep -q "too short\|dictionary" - CHECK_RESULT $? 0 0 "弱密码"123456"未正确检测" - - # 测试4:检测强密码"OpenEuler@2023" - LOG_INFO "测试强密码"OpenEuler@2023"检测" - echo "OpenEuler@2023" | cracklib-check 2>&1 | grep -q "OK" - CHECK_RESULT $? 0 0 "强密码"OpenEuler@2023"被误判为弱密码" - - # 测试5:检查python3-cracklib模块是否可用 - LOG_INFO "测试python3-cracklib模块导入" - python3 -c "import cracklib; print("python3-cracklib模块导入成功")" 2>&1 | grep -q "导入成功" - CHECK_RESULT $? 0 0 "python3-cracklib模块导入失败" - - # 测试6:使用python3-cracklib检测弱密码 - LOG_INFO "使用python3-cracklib检测弱密码"admin"" - python3 << "EOF" - import cracklib - try: - result = cracklib.FascistCheck("admin") - print("弱密码检测失败:"admin"应被识别为弱密码") - exit(1) - except ValueError as e: - if "too short" in str(e) or "dictionary" in str(e): - print("弱密码检测成功") - exit(0) - else: - print(f"弱密码检测异常:{e}") - exit(1) - EOF - CHECK_RESULT $? 0 0 "python3-cracklib弱密码检测功能异常" - - # 清理环境:如果测试前未安装,则卸载软件包 - if [ $INSTALLED_FLAG -eq 0 ]; then - LOG_INFO "卸载python3-cracklib软件包" - dnf remove -y python3-cracklib - CHECK_RESULT $? 0 0 "卸载python3-cracklib失败" - else - LOG_INFO "测试前已安装python3-cracklib,保持安装状态" - fi - - LOG_INFO "python3-cracklib弱密码检测功能测试完成" -} - -main "$@" \ No newline at end of file diff --git a/testcases/function_test/pkg_test/cracklib/python3-cracklib/test_python3-cracklib_verify-cracklib_default.sh b/testcases/function_test/pkg_test/cracklib/python3-cracklib/test_python3-cracklib_verify-cracklib_default.sh deleted file mode 100644 index bf0985d92da..00000000000 --- a/testcases/function_test/pkg_test/cracklib/python3-cracklib/test_python3-cracklib_verify-cracklib_default.sh +++ /dev/null @@ -1,66 +0,0 @@ -#!/usr/bin/bash - -# Copyright (c) 2024 ISCAS .ALL rights reserved. -# This program is licensed under Mulan PSL v2. -# You can use it according to the terms and conditions of the Mulan PSL v2. -# http://license.coscl.org.cn/MulanPSL2 -# THIS PROGRAM IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, -# EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, -# MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. -# See the Mulan PSL v2 for more details. - -# ############################################# -# @Author : honghua -# @Contact : honghua@iscas.ac.cn -# @Date : 2025-08-03 -# @License : Mulan PSL v2 -# @Desc : 测试 verify-cracklib 命令的默认行为 -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - - # 检查是否已安装python3-cracklib - LOG_INFO "检查是否已安装python3-cracklib" - rpm -q python3-cracklib > /dev/null 2>&1 - if [ $? -eq 0 ]; then - LOG_INFO "python3-cracklib已安装,脚本结束后保持安装状态" - INSTALLED=1 - else - LOG_INFO "python3-cracklib未安装,将在测试完成后卸载" - INSTALLED=0 - fi - - # 检查yum源中是否存在python3-cracklib - LOG_INFO "检查yum源中是否存在python3-cracklib" - dnf list available python3-cracklib > /dev/null 2>&1 - if [ $? -ne 0 ]; then - LOG_ERROR "yum源中不存在python3-cracklib,退出码255" - exit 255 - fi - - # 安装python3-cracklib - if [ $INSTALLED -eq 0 ]; then - LOG_INFO "开始安装python3-cracklib" - dnf install -y python3-cracklib > /dev/null 2>&1 - CHECK_RESULT $? 0 0 "安装python3-cracklib失败" - fi - - # 测试verify-cracklib命令的默认行为 - LOG_INFO "测试verify-cracklib命令的默认行为" - echo "testpassword" | verify-cracklib > /dev/null 2>&1 - CHECK_RESULT $? 0 0 "verify-cracklib命令默认行为测试失败" - - # 清理环境,如果脚本开始时未安装则卸载python3-cracklib - if [ $INSTALLED -eq 0 ]; then - LOG_INFO "卸载python3-cracklib" - dnf remove -y python3-cracklib > /dev/null 2>&1 - CHECK_RESULT $? 0 0 "卸载python3-cracklib失败" - fi - - LOG_INFO "测试脚本执行完毕" - -} - -main "$@" \ No newline at end of file diff --git a/testcases/function_test/pkg_test/gcc-toolset/gcc-toolset-14-gfortran/test_gcc-toolset-14-gfortran_function_hello_world.sh b/testcases/function_test/pkg_test/gcc-toolset/gcc-toolset-14-gfortran/test_gcc-toolset-14-gfortran_function_hello_world.sh deleted file mode 100644 index 4710db01233..00000000000 --- a/testcases/function_test/pkg_test/gcc-toolset/gcc-toolset-14-gfortran/test_gcc-toolset-14-gfortran_function_hello_world.sh +++ /dev/null @@ -1,82 +0,0 @@ -#!/usr/bin/bash - -# Copyright (c) 2024 ISCAS .ALL rights reserved. -# This program is licensed under Mulan PSL v2. -# You can use it according to the terms and conditions of the Mulan PSL v2. -# http://license.coscl.org.cn/MulanPSL2 -# THIS PROGRAM IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, -# EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, -# MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. -# See the Mulan PSL v2 for more details. - -# ############################################# -# @Author : honghua -# @Contact : honghua@iscas.ac.cn -# @Date : 2026-03-03 -# @License : Mulan PSL v2 -# @Desc : 测试编译并运行一个简单的Fortran Hello World程序 -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - LOG_INFO "开始测试编译并运行一个简单的Fortran Hello World程序" - - LOG_INFO "检查gcc-toolset-14-gfortran软件包是否在yum源中" - if ! dnf list available gcc-toolset-14-gfortran &> /dev/null; then - LOG_ERROR "yum源中未找到gcc-toolset-14-gfortran软件包" - exit 255 - fi - - LOG_INFO "检查是否已安装gcc-toolset-14-gfortran" - if rpm -q gcc-toolset-14-gfortran &> /dev/null; then - LOG_INFO "gcc-toolset-14-gfortran已安装,测试后保持安装状态" - already_installed=1 - else - LOG_INFO "gcc-toolset-14-gfortran未安装,开始安装" - dnf install -y gcc-toolset-14-gfortran - CHECK_RESULT $? 0 0 "安装gcc-toolset-14-gfortran失败" - already_installed=0 - fi - - LOG_INFO "检查gfortran命令是否可用" - if ! command -v scl &> /dev/null; then - LOG_ERROR "scl命令不存在,可能软件包未正确安装" - exit 255 - fi - - LOG_INFO "创建Fortran Hello World源文件" - cat > hello.f90 << "EOF" - program hello - print *, "Hello, World!" - end program hello - EOF - CHECK_RESULT $? 0 0 "创建hello.f90文件失败" - - LOG_INFO "使用gcc-toolset-14的gfortran编译程序" - scl enable gcc-toolset-14 "gfortran -o hello hello.f90" - CHECK_RESULT $? 0 0 "编译Fortran程序失败" - - LOG_INFO "运行编译后的程序" - output=$(./hello) - expected="Hello, World!" - CHECK_RESULT $? 0 0 "运行hello程序失败" - [[ "$output" == "$expected" ]] - CHECK_RESULT $? 0 0 "程序输出不符合预期,输出为:$output" - - LOG_INFO "清理临时文件" - rm -f hello hello.f90 - CHECK_RESULT $? 0 0 "清理临时文件失败" - - if [ $already_installed -eq 0 ]; then - LOG_INFO "卸载测试安装的gcc-toolset-14-gfortran软件包" - dnf remove -y gcc-toolset-14-gfortran - CHECK_RESULT $? 0 0 "卸载gcc-toolset-14-gfortran失败" - else - LOG_INFO "保持gcc-toolset-14-gfortran安装状态" - fi - - LOG_INFO "测试完成" -} - -main "$@" \ No newline at end of file diff --git a/testcases/function_test/pkg_test/gcc-toolset/gcc-toolset-14-gfortran/test_gcc-toolset-14-gfortran_function_install.sh b/testcases/function_test/pkg_test/gcc-toolset/gcc-toolset-14-gfortran/test_gcc-toolset-14-gfortran_function_install.sh deleted file mode 100644 index a92fe2c9559..00000000000 --- a/testcases/function_test/pkg_test/gcc-toolset/gcc-toolset-14-gfortran/test_gcc-toolset-14-gfortran_function_install.sh +++ /dev/null @@ -1,103 +0,0 @@ -#!/usr/bin/bash - -# Copyright (c) 2024 ISCAS .ALL rights reserved. -# This program is licensed under Mulan PSL v2. -# You can use it according to the terms and conditions of the Mulan PSL v2. -# http://license.coscl.org.cn/MulanPSL2 -# THIS PROGRAM IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, -# EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, -# MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. -# See the Mulan PSL v2 for more details. - -# ############################################# -# @Author : honghua -# @Contact : honghua@iscas.ac.cn -# @Date : 2026-03-03 -# @License : Mulan PSL v2 -# @Desc : 测试gcc-toolset-14-gfortran软件包的安装功能 -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - # 定义变量 - PACKAGE_NAME="gcc-toolset-14-gfortran" - - # 步骤1:检查yum源中是否存在指定软件包 - LOG_INFO "检查yum源中是否存在$PACKAGE_NAME软件包" - dnf list available $PACKAGE_NAME > /dev/null 2>&1 - if [ $? -ne 0 ]; then - LOG_ERROR "yum源中不存在$PACKAGE_NAME软件包" - exit 255 - fi - - # 步骤2:检查当前是否已安装 - LOG_INFO "检查当前是否已安装$PACKAGE_NAME" - rpm -q $PACKAGE_NAME > /dev/null 2>&1 - if [ $? -eq 0 ]; then - LOG_INFO "检测到$PACKAGE_NAME已安装,跳过安装步骤" - INSTALLED_BEFORE=true - else - LOG_INFO "检测到$PACKAGE_NAME未安装,将进行安装测试" - INSTALLED_BEFORE=false - fi - - # 步骤3:执行安装测试 - if [ "$INSTALLED_BEFORE" = "false" ]; then - LOG_INFO "开始安装$PACKAGE_NAME" - dnf install -y $PACKAGE_NAME - CHECK_RESULT $? 0 0 "安装$PACKAGE_NAME失败" - - # 验证安装 - LOG_INFO "验证$PACKAGE_NAME是否安装成功" - rpm -q $PACKAGE_NAME - CHECK_RESULT $? 0 0 "验证$PACKAGE_NAME安装失败" - fi - - # 步骤4:测试gfortran命令 - LOG_INFO "测试gfortran命令是否可用" - gfortran --version > /dev/null 2>&1 - CHECK_RESULT $? 0 0 "gfortran命令不可用" - - # 步骤5:测试简单的Fortran程序编译 - LOG_INFO "测试简单的Fortran程序编译" - cat > test_fortran.f90 << "EOF" - program hello - print *, "Hello, Fortran!" - end program hello - EOF - - gfortran -o test_fortran test_fortran.f90 - CHECK_RESULT $? 0 0 "Fortran程序编译失败" - - # 步骤6:测试编译后的程序运行 - LOG_INFO "测试编译后的Fortran程序运行" - ./test_fortran > /dev/null 2>&1 - CHECK_RESULT $? 0 0 "Fortran程序运行失败" - - # 步骤7:清理测试文件 - LOG_INFO "清理测试文件" - rm -f test_fortran.f90 test_fortran - - # 步骤8:环境恢复 - if [ "$INSTALLED_BEFORE" = "false" ]; then - LOG_INFO "开始卸载$PACKAGE_NAME" - dnf remove -y $PACKAGE_NAME - CHECK_RESULT $? 0 0 "卸载$PACKAGE_NAME失败" - - # 验证卸载 - LOG_INFO "验证$PACKAGE_NAME是否卸载成功" - rpm -q $PACKAGE_NAME > /dev/null 2>&1 - if [ $? -eq 0 ]; then - LOG_ERROR "$PACKAGE_NAME卸载失败" - exit 1 - fi - LOG_INFO "$PACKAGE_NAME已成功卸载" - else - LOG_INFO "保持$PACKAGE_NAME安装状态" - fi - - LOG_INFO "测试完成:gcc-toolset-14-gfortran软件包安装功能测试通过" -} - -main "$@" \ No newline at end of file diff --git a/testcases/function_test/pkg_test/gcc-toolset/gcc-toolset-14-gfortran/test_gcc-toolset-14-gfortran_function_uninstall.sh b/testcases/function_test/pkg_test/gcc-toolset/gcc-toolset-14-gfortran/test_gcc-toolset-14-gfortran_function_uninstall.sh deleted file mode 100644 index 8b408e98197..00000000000 --- a/testcases/function_test/pkg_test/gcc-toolset/gcc-toolset-14-gfortran/test_gcc-toolset-14-gfortran_function_uninstall.sh +++ /dev/null @@ -1,74 +0,0 @@ -#!/usr/bin/bash - -# Copyright (c) 2024 ISCAS .ALL rights reserved. -# This program is licensed under Mulan PSL v2. -# You can use it according to the terms and conditions of the Mulan PSL v2. -# http://license.coscl.org.cn/MulanPSL2 -# THIS PROGRAM IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, -# EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, -# MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. -# See the Mulan PSL v2 for more details. - -# ############################################# -# @Author : honghua -# @Contact : honghua@iscas.ac.cn -# @Date : 2026-03-03 -# @License : Mulan PSL v2 -# @Desc : 测试gcc-toolset-14-gfortran软件包的卸载功能 -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - PACKAGE_NAME="gcc-toolset-14-gfortran" - - LOG_INFO "开始测试gcc-toolset-14-gfortran软件包的卸载功能" - - LOG_INFO "步骤1:检查yum源中是否存在${PACKAGE_NAME}软件包" - dnf list available "${PACKAGE_NAME}" &>/dev/null - if [ $? -ne 0 ]; then - LOG_ERROR "yum源中未找到${PACKAGE_NAME}软件包" - exit 255 - fi - - LOG_INFO "步骤2:检查当前环境是否已安装${PACKAGE_NAME}" - rpm -q "${PACKAGE_NAME}" &>/dev/null - if [ $? -eq 0 ]; then - LOG_INFO "检测到${PACKAGE_NAME}已安装,脚本将保持安装状态" - ALREADY_INSTALLED=1 - else - LOG_INFO "检测到${PACKAGE_NAME}未安装,将在测试过程中安装" - ALREADY_INSTALLED=0 - fi - - if [ ${ALREADY_INSTALLED} -eq 0 ]; then - LOG_INFO "步骤3:安装${PACKAGE_NAME}软件包" - dnf install -y "${PACKAGE_NAME}" - CHECK_RESULT $? 0 0 "安装${PACKAGE_NAME}失败" - fi - - LOG_INFO "步骤4:验证${PACKAGE_NAME}基本功能" - gfortran --version &>/dev/null - CHECK_RESULT $? 0 0 "验证gfortran命令失败" - - LOG_INFO "步骤5:卸载${PACKAGE_NAME}软件包" - dnf remove -y "${PACKAGE_NAME}" - CHECK_RESULT $? 0 0 "卸载${PACKAGE_NAME}失败" - - LOG_INFO "步骤6:验证${PACKAGE_NAME}已成功卸载" - rpm -q "${PACKAGE_NAME}" &>/dev/null - CHECK_RESULT $? 1 0 "卸载后仍能检测到${PACKAGE_NAME}软件包" - - LOG_INFO "步骤7:环境恢复" - if [ ${ALREADY_INSTALLED} -eq 0 ]; then - LOG_INFO "测试前未安装${PACKAGE_NAME},无需重新安装" - else - LOG_INFO "重新安装${PACKAGE_NAME}以恢复原始环境" - dnf install -y "${PACKAGE_NAME}" - CHECK_RESULT $? 0 0 "重新安装${PACKAGE_NAME}失败" - fi - - LOG_INFO "测试完成:gcc-toolset-14-gfortran软件包的卸载功能测试通过" -} - -main "$@" \ No newline at end of file diff --git a/testcases/function_test/pkg_test/openstack-releases/openstack-release-antelope/test_openstack-release-antelope_function_config.sh b/testcases/function_test/pkg_test/openstack-releases/openstack-release-antelope/test_openstack-release-antelope_function_config.sh deleted file mode 100644 index 30e4dfa12c7..00000000000 --- a/testcases/function_test/pkg_test/openstack-releases/openstack-release-antelope/test_openstack-release-antelope_function_config.sh +++ /dev/null @@ -1,68 +0,0 @@ -#!/usr/bin/bash - -# Copyright (c) 2024 ISCAS .ALL rights reserved. -# This program is licensed under Mulan PSL v2. -# You can use it according to the terms and conditions of the Mulan PSL v2. -# http://license.coscl.org.cn/MulanPSL2 -# THIS PROGRAM IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, -# EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, -# MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. -# See the Mulan PSL v2 for more details. - -# ############################################# -# @Author : honghua -# @Contact : honghua@iscas.ac.cn -# @Date : 2025-12-05 -# @License : Mulan PSL v2 -# @Desc : 测试openstack-release-antelope软件包的配置功能,验证配置文件是否正确生成 -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - LOG_INFO "开始测试openstack-release-antelope软件包的配置功能,验证配置文件是否正确生成" - - # 检查是否已安装openstack-release-antelope软件包 - LOG_INFO "检查是否已安装openstack-release-antelope软件包" - if dnf list installed openstack-release-antelope &>/dev/null; then - LOG_INFO "openstack-release-antelope软件包已安装,脚本结束时将保持安装状态" - INSTALLED=true - else - LOG_INFO "openstack-release-antelope软件包未安装,将在测试步骤中安装并在脚本结束前卸载" - INSTALLED=false - fi - - # 检查yum源中是否有openstack-release-antelope软件包 - LOG_INFO "检查yum源中是否有openstack-release-antelope软件包" - if ! dnf list available openstack-release-antelope &>/dev/null; then - LOG_ERROR "yum源中未找到openstack-release-antelope软件包" - exit 255 - fi - - # 安装openstack-release-antelope软件包(如果未安装) - if [ "$INSTALLED" = false ]; then - LOG_INFO "正在安装openstack-release-antelope软件包" - dnf install -y openstack-release-antelope - CHECK_RESULT $? 0 0 "安装openstack-release-antelope软件包失败" - fi - - # 验证配置文件是否正确生成 - LOG_INFO "验证配置文件是否正确生成" - if [ -f "/etc/openstack-release/antelope.conf" ]; then - LOG_INFO "配置文件/etc/openstack-release/antelope.conf已生成" - else - LOG_ERROR "配置文件/etc/openstack-release/antelope.conf未生成" - exit 1 - fi - - # 清理环境(如果之前未安装) - if [ "$INSTALLED" = false ]; then - LOG_INFO "正在卸载openstack-release-antelope软件包以恢复环境" - dnf remove -y openstack-release-antelope - CHECK_RESULT $? 0 0 "卸载openstack-release-antelope软件包失败" - fi - - LOG_INFO "测试完成,环境已恢复" -} - -main "$@" \ No newline at end of file diff --git a/testcases/function_test/pkg_test/openstack-releases/openstack-release-antelope/test_openstack-release-antelope_function_service.sh b/testcases/function_test/pkg_test/openstack-releases/openstack-release-antelope/test_openstack-release-antelope_function_service.sh deleted file mode 100644 index 34f27b6dcf4..00000000000 --- a/testcases/function_test/pkg_test/openstack-releases/openstack-release-antelope/test_openstack-release-antelope_function_service.sh +++ /dev/null @@ -1,64 +0,0 @@ -#!/usr/bin/bash - -# Copyright (c) 2024 ISCAS .ALL rights reserved. -# This program is licensed under Mulan PSL v2. -# You can use it according to the terms and conditions of the Mulan PSL v2. -# http://license.coscl.org.cn/MulanPSL2 -# THIS PROGRAM IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, -# EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, -# MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. -# See the Mulan PSL v2 for more details. - -# ############################################# -# @Author : honghua -# @Contact : honghua@iscas.ac.cn -# @Date : 2025-12-05 -# @License : Mulan PSL v2 -# @Desc : 测试openstack-release-antelope软件包的服务功能,验证服务是否正常启动 -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - - # 检查环境是否已安装openstack-release-antelope软件包 - LOG_INFO "检查环境是否已安装openstack-release-antelope软件包" - if dnf list installed openstack-release-antelope &>/dev/null; then - LOG_INFO "环境已安装openstack-release-antelope软件包" - INSTALLED=true - else - LOG_INFO "环境未安装openstack-release-antelope软件包" - INSTALLED=false - fi - - # 检查yum源中是否存在openstack-release-antelope软件包 - LOG_INFO "检查yum源中是否存在openstack-release-antelope软件包" - if ! dnf list available openstack-release-antelope &>/dev/null; then - LOG_ERROR "yum源中不存在openstack-release-antelope软件包" - exit 255 - fi - - # 如果未安装,则安装软件包 - if [ "$INSTALLED" = false ]; then - LOG_INFO "开始安装openstack-release-antelope软件包" - dnf install -y openstack-release-antelope - CHECK_RESULT $? 0 0 "安装openstack-release-antelope软件包失败" - fi - - # 验证服务是否正常启动 - LOG_INFO "验证openstack-release-antelope服务是否正常启动" - systemctl status openstack-release-antelope &>/dev/null - CHECK_RESULT $? 0 0 "openstack-release-antelope服务未正常启动" - - # 如果最初未安装,则在脚本结束前卸载软件包以恢复环境 - if [ "$INSTALLED" = false ]; then - LOG_INFO "卸载openstack-release-antelope软件包以恢复环境" - dnf remove -y openstack-release-antelope - CHECK_RESULT $? 0 0 "卸载openstack-release-antelope软件包失败" - fi - - LOG_INFO "测试脚本执行完毕,环境已恢复" - -} - -main "$@" \ No newline at end of file diff --git a/testcases/function_test/pkg_test/poppler/poppler-glib-devel/test_poppler-glib-devel_function_check.sh b/testcases/function_test/pkg_test/poppler/poppler-glib-devel/test_poppler-glib-devel_function_check.sh deleted file mode 100644 index 58b1a1ac609..00000000000 --- a/testcases/function_test/pkg_test/poppler/poppler-glib-devel/test_poppler-glib-devel_function_check.sh +++ /dev/null @@ -1,127 +0,0 @@ -#!/usr/bin/bash - -# Copyright (c) 2024 ISCAS .ALL rights reserved. -# This program is licensed under Mulan PSL v2. -# You can use it according to the terms and conditions of the Mulan PSL v2. -# http://license.coscl.org.cn/MulanPSL2 -# THIS PROGRAM IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, -# EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, -# MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. -# See the Mulan PSL v2 for more details. - -# ############################################# -# @Author : honghua -# @Contact : honghua@iscas.ac.cn -# @Date : 2026-03-10 -# @License : Mulan PSL v2 -# @Desc : Verify poppler-glib-devel package is installed -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - # 测试脚本:验证poppler-glib-devel包安装功能 - # 作者:OpenEuler操作系统专家 - # 描述:验证poppler-glib-devel包是否安装 - - # 步骤1:检查环境中是否已安装poppler-glib-devel包 - LOG_INFO "步骤1:检查环境中是否已安装poppler-glib-devel包" - rpm -q poppler-glib-devel > /dev/null 2>&1 - if [ $? -eq 0 ]; then - LOG_INFO "poppler-glib-devel包已安装" - ALREADY_INSTALLED=1 - else - LOG_INFO "poppler-glib-devel包未安装" - ALREADY_INSTALLED=0 - fi - - # 步骤2:检查yum源中是否存在poppler-glib-devel包 - LOG_INFO "步骤2:检查yum源中是否存在poppler-glib-devel包" - dnf list available poppler-glib-devel > /dev/null 2>&1 - CHECK_RESULT $? 0 0 "yum源中不存在poppler-glib-devel包" - if [ $? -ne 0 ]; then - LOG_ERROR "yum源中不存在poppler-glib-devel包" - exit 255 - fi - - # 步骤3:如果未安装,则安装poppler-glib-devel包 - if [ $ALREADY_INSTALLED -eq 0 ]; then - LOG_INFO "步骤3:安装poppler-glib-devel包" - dnf install -y poppler-glib-devel - CHECK_RESULT $? 0 0 "安装poppler-glib-devel包失败" - fi - - # 步骤4:验证poppler-glib-devel包安装成功 - LOG_INFO "步骤4:验证poppler-glib-devel包安装成功" - rpm -q poppler-glib-devel - CHECK_RESULT $? 0 0 "poppler-glib-devel包未正确安装" - - # 步骤5:检查poppler-glib-devel包提供的库文件 - LOG_INFO "步骤5:检查poppler-glib-devel包提供的库文件" - pkg-config --cflags poppler-glib - CHECK_RESULT $? 0 0 "poppler-glib开发库配置不正确" - - # 步骤6:验证头文件是否存在 - LOG_INFO "步骤6:验证头文件是否存在" - ls /usr/include/poppler/glib/poppler.h > /dev/null 2>&1 - CHECK_RESULT $? 0 0 "poppler-glib头文件不存在" - - # 步骤7:验证库文件是否存在 - LOG_INFO "步骤7:验证库文件是否存在" - ls /usr/lib*/libpoppler-glib.so > /dev/null 2>&1 - if [ $? -ne 0 ]; then - ls /usr/lib64/libpoppler-glib.so > /dev/null 2>&1 - CHECK_RESULT $? 0 0 "poppler-glib库文件不存在" - fi - - # 步骤8:编写简单的测试程序验证开发包功能 - LOG_INFO "步骤8:编写简单的测试程序验证开发包功能" - TEST_PROGRAM=$(mktemp /tmp/test_poppler_XXXXXX.c) - cat > $TEST_PROGRAM << "EOF" - #include - #include - - int main() { - printf("Poppler-glib version: %s\n", poppler_get_version()); - return 0; - } - EOF - - # 步骤9:编译测试程序 - LOG_INFO "步骤9:编译测试程序" - TEST_BINARY="${TEST_PROGRAM%.c}" - gcc $TEST_PROGRAM -o $TEST_BINARY $(pkg-config --cflags --libs poppler-glib) 2>&1 - CHECK_RESULT $? 0 0 "编译poppler-glib测试程序失败" - - # 步骤10:运行测试程序 - LOG_INFO "步骤10:运行测试程序" - $TEST_BINARY - CHECK_RESULT $? 0 0 "运行poppler-glib测试程序失败" - - # 步骤11:清理测试文件 - LOG_INFO "步骤11:清理测试文件" - rm -f $TEST_PROGRAM $TEST_BINARY - - # 步骤12:环境恢复 - LOG_INFO "步骤12:环境恢复" - if [ $ALREADY_INSTALLED -eq 0 ]; then - LOG_INFO "卸载测试安装的poppler-glib-devel包" - dnf remove -y poppler-glib-devel - CHECK_RESULT $? 0 0 "卸载poppler-glib-devel包失败" - - # 验证包已卸载 - rpm -q poppler-glib-devel > /dev/null 2>&1 - if [ $? -eq 0 ]; then - LOG_ERROR "poppler-glib-devel包卸载失败" - exit 1 - else - LOG_INFO "poppler-glib-devel包已成功卸载" - fi - else - LOG_INFO "保持原有poppler-glib-devel包安装状态" - fi - - LOG_INFO "测试完成:poppler-glib-devel包安装功能验证成功" -} - -main "$@" \ No newline at end of file diff --git a/testcases/function_test/pkg_test/poppler/poppler-glib-devel/test_poppler-glib-devel_function_compile.sh b/testcases/function_test/pkg_test/poppler/poppler-glib-devel/test_poppler-glib-devel_function_compile.sh deleted file mode 100644 index f44ee7883eb..00000000000 --- a/testcases/function_test/pkg_test/poppler/poppler-glib-devel/test_poppler-glib-devel_function_compile.sh +++ /dev/null @@ -1,87 +0,0 @@ -#!/usr/bin/bash - -# Copyright (c) 2024 ISCAS .ALL rights reserved. -# This program is licensed under Mulan PSL v2. -# You can use it according to the terms and conditions of the Mulan PSL v2. -# http://license.coscl.org.cn/MulanPSL2 -# THIS PROGRAM IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, -# EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, -# MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. -# See the Mulan PSL v2 for more details. - -# ############################################# -# @Author : honghua -# @Contact : honghua@iscas.ac.cn -# @Date : 2026-03-10 -# @License : Mulan PSL v2 -# @Desc : Test compiling a simple program using the library -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - LOG_INFO "开始测试:使用库编译简单程序" - - # 检查是否已安装poppler-glib-devel - LOG_INFO "检查是否已安装poppler-glib-devel软件包" - if rpm -q poppler-glib-devel &> /dev/null; then - LOG_INFO "poppler-glib-devel已安装,标记为已存在" - already_installed=1 - else - LOG_INFO "poppler-glib-devel未安装,标记为未安装" - already_installed=0 - fi - - # 检查yum源中是否有poppler-glib-devel软件包 - LOG_INFO "检查yum源中是否有poppler-glib-devel软件包" - dnf list available poppler-glib-devel &> /dev/null - CHECK_RESULT $? 0 0 "yum源中未找到poppler-glib-devel软件包" - if [ $? -ne 0 ]; then - LOG_ERROR "yum源中未找到poppler-glib-devel软件包" - exit 255 - fi - - # 如果未安装,则安装软件包 - if [ $already_installed -eq 0 ]; then - LOG_INFO "安装poppler-glib-devel软件包" - dnf install -y poppler-glib-devel - CHECK_RESULT $? 0 0 "安装poppler-glib-devel失败" - fi - - # 创建测试C程序 - LOG_INFO "创建测试C程序test_compile.c" - cat > test_compile.c << "EOF" - #include - #include - - int main() { - printf("Poppler version: %s\n", poppler_get_version()); - return 0; - } - EOF - - # 编译测试程序 - LOG_INFO "编译测试程序" - gcc test_compile.c -o test_compile $(pkg-config --cflags --libs poppler-glib) - CHECK_RESULT $? 0 0 "编译测试程序失败" - - # 运行测试程序 - LOG_INFO "运行测试程序" - ./test_compile - CHECK_RESULT $? 0 0 "运行测试程序失败" - - # 清理测试文件 - LOG_INFO "清理测试文件" - rm -f test_compile.c test_compile - - # 如果之前未安装,则卸载软件包 - if [ $already_installed -eq 0 ]; then - LOG_INFO "卸载poppler-glib-devel软件包" - dnf remove -y poppler-glib-devel - CHECK_RESULT $? 0 0 "卸载poppler-glib-devel失败" - fi - - LOG_INFO "测试完成:使用库编译简单程序" -} - -main "$@" \ No newline at end of file diff --git a/testcases/function_test/pkg_test/poppler/poppler-glib-devel/test_poppler-glib-devel_function_headers.sh b/testcases/function_test/pkg_test/poppler/poppler-glib-devel/test_poppler-glib-devel_function_headers.sh deleted file mode 100644 index e57dfa2083b..00000000000 --- a/testcases/function_test/pkg_test/poppler/poppler-glib-devel/test_poppler-glib-devel_function_headers.sh +++ /dev/null @@ -1,81 +0,0 @@ -#!/usr/bin/bash - -# Copyright (c) 2024 ISCAS .ALL rights reserved. -# This program is licensed under Mulan PSL v2. -# You can use it according to the terms and conditions of the Mulan PSL v2. -# http://license.coscl.org.cn/MulanPSL2 -# THIS PROGRAM IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, -# EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, -# MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. -# See the Mulan PSL v2 for more details. - -# ############################################# -# @Author : honghua -# @Contact : honghua@iscas.ac.cn -# @Date : 2026-03-10 -# @License : Mulan PSL v2 -# @Desc : Validate existence of development header files -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - LOG_INFO "开始测试:验证开发头文件的存在性" - - # 检查软件包是否在yum源中 - LOG_INFO "步骤1:检查poppler-glib-devel软件包是否在yum源中" - dnf list available poppler-glib-devel > /dev/null 2>&1 - CHECK_RESULT $? 0 0 "软件包poppler-glib-devel不在yum源中" - if [ $? -ne 0 ]; then - LOG_ERROR "软件包poppler-glib-devel不在yum源中" - exit 255 - fi - - # 检查是否已安装软件包 - LOG_INFO "步骤2:检查poppler-glib-devel是否已安装" - if rpm -q poppler-glib-devel > /dev/null 2>&1; then - LOG_INFO "poppler-glib-devel已安装,测试结束后将保持安装状态" - already_installed=1 - else - LOG_INFO "poppler-glib-devel未安装,将进行安装" - already_installed=0 - fi - - # 如果未安装,则安装软件包 - if [ $already_installed -eq 0 ]; then - LOG_INFO "步骤3:安装poppler-glib-devel软件包" - dnf install -y poppler-glib-devel - CHECK_RESULT $? 0 0 "安装poppler-glib-devel失败" - fi - - # 验证开发头文件的存在性 - LOG_INFO "步骤4:验证开发头文件的存在性" - if [ -d /usr/include/poppler ]; then - LOG_INFO "开发头文件目录存在:/usr/include/poppler" - CHECK_RESULT $? 0 0 "开发头文件目录不存在" - else - LOG_ERROR "开发头文件目录不存在:/usr/include/poppler" - CHECK_RESULT $? 1 0 "开发头文件目录不存在" - fi - - # 检查特定头文件是否存在 - LOG_INFO "步骤5:检查特定头文件poppler.h是否存在" - if [ -f /usr/include/poppler/poppler.h ]; then - LOG_INFO "头文件poppler.h存在" - CHECK_RESULT $? 0 0 "头文件poppler.h不存在" - else - LOG_ERROR "头文件poppler.h不存在" - CHECK_RESULT $? 1 0 "头文件poppler.h不存在" - fi - - # 环境恢复:如果测试前未安装,则卸载软件包 - if [ $already_installed -eq 0 ]; then - LOG_INFO "步骤6:卸载poppler-glib-devel软件包" - dnf remove -y poppler-glib-devel - CHECK_RESULT $? 0 0 "卸载poppler-glib-devel失败" - fi - - LOG_INFO "测试完成:验证开发头文件的存在性" -} - -main "$@" \ No newline at end of file diff --git a/testcases/function_test/pkg_test/poppler/poppler-glib-devel/test_poppler-glib-devel_function_pkgconfig.sh b/testcases/function_test/pkg_test/poppler/poppler-glib-devel/test_poppler-glib-devel_function_pkgconfig.sh deleted file mode 100644 index 10a5dc29955..00000000000 --- a/testcases/function_test/pkg_test/poppler/poppler-glib-devel/test_poppler-glib-devel_function_pkgconfig.sh +++ /dev/null @@ -1,130 +0,0 @@ -#!/usr/bin/bash - -# Copyright (c) 2024 ISCAS .ALL rights reserved. -# This program is licensed under Mulan PSL v2. -# You can use it according to the terms and conditions of the Mulan PSL v2. -# http://license.coscl.org.cn/MulanPSL2 -# THIS PROGRAM IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, -# EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-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-10 -# @License : Mulan PSL v2 -# @Desc : Test pkg-config file for poppler-glib -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - # 测试poppler-glib的pkg-config文件功能 - - LOG_INFO "开始测试poppler-glib的pkg-config文件功能" - - # 检查yum源中是否有poppler-glib-devel软件包 - LOG_INFO "检查yum源中是否有poppler-glib-devel软件包" - dnf list available poppler-glib-devel >/dev/null 2>&1 - if [ $? -ne 0 ]; then - LOG_ERROR "yum源中没有找到poppler-glib-devel软件包" - exit 255 - fi - - # 检查系统是否已安装poppler-glib-devel - LOG_INFO "检查系统是否已安装poppler-glib-devel" - rpm -q poppler-glib-devel >/dev/null 2>&1 - installed=$? - if [ $installed -eq 0 ]; then - LOG_INFO "系统已安装poppler-glib-devel,测试后保持安装状态" - need_cleanup=0 - else - LOG_INFO "系统未安装poppler-glib-devel,将进行安装测试" - need_cleanup=1 - fi - - # 如果未安装,则安装软件包 - if [ $need_cleanup -eq 1 ]; then - LOG_INFO "安装poppler-glib-devel软件包" - dnf install -y poppler-glib-devel - CHECK_RESULT $? 0 0 "安装poppler-glib-devel失败" - fi - - # 测试pkg-config命令是否存在 - LOG_INFO "检查pkg-config命令是否存在" - command -v pkg-config >/dev/null 2>&1 - CHECK_RESULT $? 0 0 "pkg-config命令不存在" - - # 测试pkg-config是否支持poppler-glib - LOG_INFO "检查pkg-config是否支持poppler-glib" - pkg-config --list-all | grep -i poppler-glib >/dev/null 2>&1 - CHECK_RESULT $? 0 0 "pkg-config不支持poppler-glib" - - # 测试获取poppler-glib的版本信息 - LOG_INFO "获取poppler-glib的版本信息" - poppler_version=$(pkg-config --modversion poppler-glib 2>/dev/null) - CHECK_RESULT $? 0 0 "获取poppler-glib版本信息失败" - LOG_INFO "poppler-glib版本: $poppler_version" - - # 测试获取poppler-glib的编译参数 - LOG_INFO "获取poppler-glib的编译参数" - cflags=$(pkg-config --cflags poppler-glib 2>/dev/null) - CHECK_RESULT $? 0 0 "获取poppler-glib编译参数失败" - LOG_INFO "poppler-glib CFLAGS: $cflags" - - # 测试获取poppler-glib的链接参数 - LOG_INFO "获取poppler-glib的链接参数" - libs=$(pkg-config --libs poppler-glib 2>/dev/null) - CHECK_RESULT $? 0 0 "获取poppler-glib链接参数失败" - LOG_INFO "poppler-glib LIBS: $libs" - - # 测试检查poppler-glib的依赖关系 - LOG_INFO "检查poppler-glib的依赖关系" - requires=$(pkg-config --print-requires poppler-glib 2>/dev/null) - CHECK_RESULT $? 0 0 "检查poppler-glib依赖关系失败" - LOG_INFO "poppler-glib依赖: $requires" - - # 测试检查poppler-glib的依赖版本要求 - LOG_INFO "检查poppler-glib的依赖版本要求" - requires_private=$(pkg-config --print-requires-private poppler-glib 2>/dev/null) - CHECK_RESULT $? 0 0 "检查poppler-glib依赖版本要求失败" - LOG_INFO "poppler-glib私有依赖: $requires_private" - - # 测试检查poppler-glib的变量定义 - LOG_INFO "检查poppler-glib的变量定义" - variables=$(pkg-config --print-variables poppler-glib 2>/dev/null) - CHECK_RESULT $? 0 0 "检查poppler-glib变量定义失败" - LOG_INFO "poppler-glib变量: $variables" - - # 测试使用pkg-config验证简单C程序编译 - LOG_INFO "测试使用pkg-config验证简单C程序编译" - cat > test_poppler.c << "EOF" - #include - #include - - int main() { - printf("Poppler version: %s\n", poppler_get_version()); - return 0; - } - EOF - - gcc -o test_poppler test_poppler.c $(pkg-config --cflags --libs poppler-glib) 2>/dev/null - compile_result=$? - rm -f test_poppler test_poppler.c - CHECK_RESULT $compile_result 0 0 "使用pkg-config编译测试程序失败" - - # 清理环境:如果测试前未安装,则卸载软件包 - if [ $need_cleanup -eq 1 ]; then - LOG_INFO "清理环境:卸载poppler-glib-devel软件包" - dnf remove -y poppler-glib-devel - CHECK_RESULT $? 0 0 "卸载poppler-glib-devel失败" - LOG_INFO "环境已恢复到测试前状态" - else - LOG_INFO "保持poppler-glib-devel安装状态" - fi - - LOG_INFO "poppler-glib的pkg-config文件功能测试完成" -} - -main "$@" \ No newline at end of file diff --git a/testcases/function_test/pkg_test/python-setuptools_git/python3-setuptools_git/test_python3-setuptools_git_function_clone.sh b/testcases/function_test/pkg_test/python-setuptools_git/python3-setuptools_git/test_python3-setuptools_git_function_clone.sh deleted file mode 100644 index 9e37910639a..00000000000 --- a/testcases/function_test/pkg_test/python-setuptools_git/python3-setuptools_git/test_python3-setuptools_git_function_clone.sh +++ /dev/null @@ -1,79 +0,0 @@ -#!/usr/bin/bash - -# Copyright (c) 2024 ISCAS .ALL rights reserved. -# This program is licensed under Mulan PSL v2. -# You can use it according to the terms and conditions of the Mulan PSL v2. -# http://license.coscl.org.cn/MulanPSL2 -# THIS PROGRAM IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, -# EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, -# MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. -# See the Mulan PSL v2 for more details. - -# ############################################# -# @Author : honghua -# @Contact : honghua@iscas.ac.cn -# @Date : 2025-12-03 -# @License : Mulan PSL v2 -# @Desc : 测试python3-setuptools_git的git仓库克隆功能,验证克隆是否成功 -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - - # 检查是否已安装python3-setuptools_git - LOG_INFO "检查是否已安装python3-setuptools_git" - rpm -q python3-setuptools_git > /dev/null 2>&1 - if [ $? -eq 0 ]; then - LOG_INFO "python3-setuptools_git已安装,测试结束后保持安装状态" - INSTALLED=1 - else - LOG_INFO "python3-setuptools_git未安装,测试结束后将卸载" - INSTALLED=0 - fi - - # 检查yum源中是否有python3-setuptools_git软件包 - LOG_INFO "检查yum源中是否有python3-setuptools_git软件包" - dnf list available python3-setuptools_git > /dev/null 2>&1 - if [ $? -ne 0 ]; then - LOG_ERROR "yum源中未找到python3-setuptools_git软件包" - exit 255 - fi - - # 安装python3-setuptools_git - if [ $INSTALLED -eq 0 ]; then - LOG_INFO "安装python3-setuptools_git" - dnf install -y python3-setuptools_git - CHECK_RESULT $? 0 0 "安装python3-setuptools_git失败" - fi - - # 测试git仓库克隆功能 - LOG_INFO "测试git仓库克隆功能" - git clone https://github.com/python/cpython.git /tmp/cpython_test > /dev/null 2>&1 - CHECK_RESULT $? 0 0 "git仓库克隆失败" - - # 验证克隆是否成功 - LOG_INFO "验证克隆是否成功" - if [ -d "/tmp/cpython_test/.git" ]; then - LOG_INFO "git仓库克隆成功" - else - LOG_ERROR "git仓库克隆失败,未找到.git目录" - exit 1 - fi - - # 清理临时目录 - LOG_INFO "清理临时目录" - rm -rf /tmp/cpython_test - - # 如果之前未安装,则卸载python3-setuptools_git - if [ $INSTALLED -eq 0 ]; then - LOG_INFO "卸载python3-setuptools_git" - dnf remove -y python3-setuptools_git > /dev/null 2>&1 - CHECK_RESULT $? 0 0 "卸载python3-setuptools_git失败" - fi - - LOG_INFO "测试脚本执行完毕,环境已恢复" - -} - -main "$@" \ No newline at end of file diff --git a/testcases/function_test/pkg_test/texlive-split-f/texlive-datetime2-spanish-doc/test_texlive-datetime2-spanish-doc_function_basic.sh b/testcases/function_test/pkg_test/texlive-split-f/texlive-datetime2-spanish-doc/test_texlive-datetime2-spanish-doc_function_basic.sh deleted file mode 100644 index 1875cf40898..00000000000 --- a/testcases/function_test/pkg_test/texlive-split-f/texlive-datetime2-spanish-doc/test_texlive-datetime2-spanish-doc_function_basic.sh +++ /dev/null @@ -1,73 +0,0 @@ -#!/usr/bin/bash - -# Copyright (c) 2024 ISCAS .ALL rights reserved. -# This program is licensed under Mulan PSL v2. -# You can use it according to the terms and conditions of the Mulan PSL v2. -# http://license.coscl.org.cn/MulanPSL2 -# THIS PROGRAM IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, -# EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, -# MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. -# See the Mulan PSL v2 for more details. - -# ############################################# -# @Author : honghua -# @Contact : honghua@iscas.ac.cn -# @Date : 2025-11-26 -# @License : Mulan PSL v2 -# @Desc : Basic functionality test -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - # 测试脚本:test_texlive-datetime2-spanish-doc_function_basic - # 测试用例描述:Basic functionality test - - LOG_INFO "开始测试:Basic functionality test" - - # 检查软件包是否存在于yum源中 - LOG_INFO "检查软件包texlive-datetime2-spanish-doc是否存在于yum源中" - dnf list available texlive-datetime2-spanish-doc > /dev/null 2>&1 - if [ $? -ne 0 ]; then - LOG_ERROR "软件包texlive-datetime2-spanish-doc不存在于yum源中" - exit 255 - fi - - # 检查是否已安装软件包 - LOG_INFO "检查是否已安装软件包texlive-datetime2-spanish-doc" - rpm -q texlive-datetime2-spanish-doc > /dev/null 2>&1 - if [ $? -eq 0 ]; then - LOG_INFO "软件包texlive-datetime2-spanish-doc已安装,跳过安装步骤" - INSTALLED=true - else - LOG_INFO "软件包texlive-datetime2-spanish-doc未安装,将进行安装" - INSTALLED=false - fi - - # 如果未安装,则安装软件包 - if [ "$INSTALLED" = false ]; then - LOG_INFO "安装软件包texlive-datetime2-spanish-doc" - dnf install -y texlive-datetime2-spanish-doc - CHECK_RESULT $? 0 0 "安装软件包texlive-datetime2-spanish-doc失败" - fi - - # 测试基本功能(假设有一个命令可以测试基本功能) - LOG_INFO "测试基本功能" - test_command --basic-functionality > /dev/null 2>&1 - if [ $? -ne 0 ]; then - LOG_ERROR "参数--basic-functionality不存在或不支持" - exit 255 - fi - CHECK_RESULT $? 0 0 "基本功能测试失败" - - # 清理环境 - if [ "$INSTALLED" = false ]; then - LOG_INFO "卸载软件包texlive-datetime2-spanish-doc" - dnf remove -y texlive-datetime2-spanish-doc - CHECK_RESULT $? 0 0 "卸载软件包texlive- datetime2- spanish- doc失败" - fi - - LOG_INFO "测试完成:Basic functionality test" -} - -main "$@" \ No newline at end of file diff --git a/testcases/function_test/pkg_test/texlive-split-o/texlive-minipage-marginpar-doc/test_texlive-minipage-marginpar-doc_function_basic.sh b/testcases/function_test/pkg_test/texlive-split-o/texlive-minipage-marginpar-doc/test_texlive-minipage-marginpar-doc_function_basic.sh deleted file mode 100644 index c3f694b7eec..00000000000 --- a/testcases/function_test/pkg_test/texlive-split-o/texlive-minipage-marginpar-doc/test_texlive-minipage-marginpar-doc_function_basic.sh +++ /dev/null @@ -1,64 +0,0 @@ -#!/usr/bin/bash - -# Copyright (c) 2024 ISCAS .ALL rights reserved. -# This program is licensed under Mulan PSL v2. -# You can use it according to the terms and conditions of the Mulan PSL v2. -# http://license.coscl.org.cn/MulanPSL2 -# THIS PROGRAM IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, -# EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, -# MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. -# See the Mulan PSL v2 for more details. - -# ############################################# -# @Author : honghua -# @Contact : honghua@iscas.ac.cn -# @Date : 2025-11-26 -# @License : Mulan PSL v2 -# @Desc : Test basic functionality of the package -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - - # 检查软件包是否已安装 - if dnf list installed texlive-minipage-marginpar-doc &>/dev/null; then - LOG_INFO "软件包 texlive-minipage-marginpar-doc 已安装,脚本结束后将保持安装状态" - INSTALLED=true - else - LOG_INFO "软件包 texlive-minipage-marginpar-doc 未安装,脚本结束后将卸载" - INSTALLED=false - fi - - # 检查yum源中是否有该软件包 - LOG_INFO "检查yum源中是否存在 texlive-minipage-marginpar-doc 软件包" - if ! dnf list available texlive-minipage-marginpar-doc &>/dev/null; then - LOG_ERROR "yum源中未找到 texlive-minipage-marginpar-doc 软件包" - exit 255 - fi - - # 安装软件包 - if [ "$INSTALLED" = false ]; then - LOG_INFO "安装 texlive-minipage-marginpar-doc 软件包" - dnf install -y texlive-minipage-marginpar-doc - CHECK_RESULT $? 0 0 "安装 texlive-minipage-marginpar-doc 失败" - fi - - # 测试软件包基本功能 - LOG_INFO "测试 texlive-minipage-marginpar-doc 基本功能" - # 示例命令,假设该软件包的测试命令为 "texdoc minipage" - texdoc minipage &>/dev/null - CHECK_RESULT $? 0 0 "texdoc minipage 命令执行失败" - - # 清理环境:如果脚本开始时未安装,则卸载软件包 - if [ "$INSTALLED" = false ]; then - LOG_INFO "卸载 texlive-minipage-marginpar-doc 软件包" - dnf remove -y texlive-minipage-marginpar-doc - CHECK_RESULT $? 0 0 "卸载 texlive-minipage-marginpar-doc 失败" - fi - - LOG_INFO "测试脚本执行完成,环境已恢复" - -} - -main "$@" \ No newline at end of file diff --git a/testcases/function_test/pkg_test/texlive-split-p/texlive-nanumtype1/test_texlive-nanumtype1_check.sh b/testcases/function_test/pkg_test/texlive-split-p/texlive-nanumtype1/test_texlive-nanumtype1_check.sh deleted file mode 100644 index 88886fd54e2..00000000000 --- a/testcases/function_test/pkg_test/texlive-split-p/texlive-nanumtype1/test_texlive-nanumtype1_check.sh +++ /dev/null @@ -1,61 +0,0 @@ -#!/usr/bin/bash - -# Copyright (c) 2024 ISCAS .ALL rights reserved. -# This program is licensed under Mulan PSL v2. -# You can use it according to the terms and conditions of the Mulan PSL v2. -# http://license.coscl.org.cn/MulanPSL2 -# THIS PROGRAM IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, -# EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, -# MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. -# See the Mulan PSL v2 for more details. - -# ############################################# -# @Author : honghua -# @Contact : honghua@iscas.ac.cn -# @Date : 2026-02-21 -# @License : Mulan PSL v2 -# @Desc : 测试 texlive-nanumtype1 软件包是否已正确安装并可被系统识别。 -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - LOG_INFO "开始测试 texlive-nanumtype1 软件包是否已正确安装并可被系统识别" - LOG_INFO "步骤1:检查 yum 源中是否存在 texlive-nanumtype1 软件包" - dnf list available texlive-nanumtype1 &> /dev/null - if [ $? -ne 0 ]; then - LOG_ERROR "yum 源中未找到 texlive-nanumtype1 软件包" - exit 255 - fi - LOG_INFO "步骤2:检查当前环境是否已安装 texlive-nanumtype1" - rpm -q texlive-nanumtype1 &> /dev/null - if [ $? -eq 0 ]; then - LOG_INFO "texlive-nanumtype1 已安装,测试后将保持安装状态" - already_installed=1 - else - LOG_INFO "texlive-nanumtype1 未安装,将执行安装作为测试步骤" - already_installed=0 - fi - if [ $already_installed -eq 0 ]; then - LOG_INFO "步骤3:安装 texlive-nanumtype1 软件包" - dnf install -y texlive-nanumtype1 - CHECK_RESULT $? 0 0 "安装 texlive-nanumtype1 失败" - fi - LOG_INFO "步骤4:验证 texlive-nanumtype1 软件包是否可被系统识别" - rpm -q texlive-nanumtype1 - CHECK_RESULT $? 0 0 "系统无法识别 texlive-nanumtype1 软件包" - LOG_INFO "步骤5:检查 texlive-nanumtype1 提供的字体文件" - fc-list | grep -i "nanum" &> /dev/null - CHECK_RESULT $? 0 0 "未找到 nanum 相关字体文件" - if [ $already_installed -eq 0 ]; then - LOG_INFO "步骤6:清理环境,卸载 texlive-nanumtype1 软件包" - dnf remove -y texlive-nanumtype1 - CHECK_RESULT $? 0 0 "卸载 texlive-nanumtype1 失败" - LOG_INFO "环境已恢复至测试前状态" - else - LOG_INFO "测试完成,保持 texlive-nanumtype1 安装状态" - fi - LOG_INFO "测试结束" -} - -main "$@" \ No newline at end of file diff --git a/testcases/function_test/pkg_test/texlive-split-p/texlive-nanumtype1/test_texlive-nanumtype1_font_list.sh b/testcases/function_test/pkg_test/texlive-split-p/texlive-nanumtype1/test_texlive-nanumtype1_font_list.sh deleted file mode 100644 index c63a462bbbe..00000000000 --- a/testcases/function_test/pkg_test/texlive-split-p/texlive-nanumtype1/test_texlive-nanumtype1_font_list.sh +++ /dev/null @@ -1,72 +0,0 @@ -#!/usr/bin/bash - -# Copyright (c) 2024 ISCAS .ALL rights reserved. -# This program is licensed under Mulan PSL v2. -# You can use it according to the terms and conditions of the Mulan PSL v2. -# http://license.coscl.org.cn/MulanPSL2 -# THIS PROGRAM IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, -# EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, -# MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. -# See the Mulan PSL v2 for more details. - -# ############################################# -# @Author : honghua -# @Contact : honghua@iscas.ac.cn -# @Date : 2026-02-21 -# @License : Mulan PSL v2 -# @Desc : 测试列出系统中由 texlive-nanumtype1 提供的所有字体文件。 -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - LOG_INFO "开始测试:测试列出系统中由 texlive-nanumtype1 提供的所有字体文件。" - - LOG_INFO "步骤1: 检查texlive-nanumtype1软件包是否在yum源中" - dnf list available texlive-nanumtype1 > /dev/null 2>&1 - CHECK_RESULT $? 0 0 "yum源中不存在texlive-nanumtype1软件包" - if [ $? -ne 0 ]; then - LOG_ERROR "yum源中不存在texlive-nanumtype1软件包,退出测试" - exit 255 - fi - - LOG_INFO "步骤2: 检查系统是否已经安装texlive-nanumtype1" - rpm -q texlive-nanumtype1 > /dev/null 2>&1 - if [ $? -eq 0 ]; then - LOG_INFO "texlive-nanumtype1已安装,测试后保持安装状态" - INSTALLED=1 - else - LOG_INFO "texlive-nanumtype1未安装,开始安装" - INSTALLED=0 - dnf install -y texlive-nanumtype1 - CHECK_RESULT $? 0 0 "安装texlive-nanumtype1失败" - fi - - LOG_INFO "步骤3: 执行列出字体文件的命令" - fc-list | grep -i nanum > /dev/null 2>&1 - CHECK_RESULT $? 0 0 "系统中未找到texlive-nanumtype1提供的字体文件" - - LOG_INFO "步骤4: 验证字体文件列表命令执行成功" - FONT_LIST=$(fc-list | grep -i nanum) - if [ -z "$FONT_LIST" ]; then - LOG_ERROR "未找到texlive-nanumtype1提供的字体文件" - CHECK_RESULT 1 0 0 "列出字体文件失败" - else - LOG_INFO "找到texlive-nanumtype1提供的字体文件:" - echo "$FONT_LIST" - CHECK_RESULT $? 0 0 "列出字体文件成功" - fi - - LOG_INFO "步骤5: 清理环境" - if [ $INSTALLED -eq 0 ]; then - LOG_INFO "卸载测试安装的texlive-nanumtype1软件包" - dnf remove -y texlive-nanumtype1 - CHECK_RESULT $? 0 0 "卸载texlive-nanumtype1失败" - else - LOG_INFO "保持texlive-nanumtype1安装状态" - fi - - LOG_INFO "测试完成" -} - -main "$@" \ No newline at end of file diff --git a/testcases/function_test/pkg_test/texlive-split-p/texlive-nanumtype1/test_texlive-nanumtype1_font_usage.sh b/testcases/function_test/pkg_test/texlive-split-p/texlive-nanumtype1/test_texlive-nanumtype1_font_usage.sh deleted file mode 100644 index 2a8998153a9..00000000000 --- a/testcases/function_test/pkg_test/texlive-split-p/texlive-nanumtype1/test_texlive-nanumtype1_font_usage.sh +++ /dev/null @@ -1,86 +0,0 @@ -#!/usr/bin/bash - -# Copyright (c) 2024 ISCAS .ALL rights reserved. -# This program is licensed under Mulan PSL v2. -# You can use it according to the terms and conditions of the Mulan PSL v2. -# http://license.coscl.org.cn/MulanPSL2 -# THIS PROGRAM IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, -# EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, -# MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. -# See the Mulan PSL v2 for more details. - -# ############################################# -# @Author : honghua -# @Contact : honghua@iscas.ac.cn -# @Date : 2026-02-21 -# @License : Mulan PSL v2 -# @Desc : 测试在 LaTeX 文档中使用 nanumtype1 字体,确保字体文件能被正确调用和渲染。 -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - LOG_INFO "步骤1:检查是否已安装texlive-nanumtype1字体包" - rpm -q texlive-nanumtype1 > /dev/null 2>&1 - if [ $? -eq 0 ]; then - LOG_INFO "texlive-nanumtype1已安装,测试后将保持安装状态" - INSTALLED="yes" - else - LOG_INFO "texlive-nanumtype1未安装,将在测试中安装,测试后卸载" - INSTALLED="no" - fi - - LOG_INFO "步骤2:检查yum源中是否存在texlive-nanumtype1软件包" - dnf list available texlive-nanumtype1 > /dev/null 2>&1 - CHECK_RESULT $? 0 0 "yum源中未找到texlive-nanumtype1软件包" - if [ $? -ne 0 ]; then - LOG_ERROR "yum源中未找到texlive-nanumtype1软件包" - exit 255 - fi - - if [ "$INSTALLED" = "no" ]; then - LOG_INFO "步骤3:安装texlive-nanumtype1字体包" - dnf install -y texlive-nanumtype1 - CHECK_RESULT $? 0 0 "安装texlive-nanumtype1失败" - fi - - LOG_INFO "步骤4:创建测试LaTeX文档" - cat > test_nanum.tex << "EOF" - \documentclass{article} - \usepackage[utf8]{inputenc} - \usepackage[T1]{fontenc} - \usepackage{nanumtype1} - \begin{document} - \fontfamily{nanumtype1}\selectfont - 这是一个使用nanumtype1字体的测试文档。 - \end{document} - EOF - CHECK_RESULT $? 0 0 "创建测试LaTeX文档失败" - - LOG_INFO "步骤5:使用pdflatex编译测试文档" - pdflatex test_nanum.tex > /dev/null 2>&1 - CHECK_RESULT $? 0 0 "pdflatex编译失败,可能字体未正确调用" - - LOG_INFO "步骤6:检查生成的PDF文件" - if [ -f test_nanum.pdf ]; then - LOG_INFO "PDF文件生成成功,nanumtype1字体可能已被正确渲染" - file test_nanum.pdf | grep -q "PDF document" - CHECK_RESULT $? 0 0 "生成的PDF文件格式不正确" - else - LOG_ERROR "PDF文件未生成" - exit 1 - fi - - LOG_INFO "步骤7:清理生成的临时文件" - rm -f test_nanum.tex test_nanum.aux test_nanum.log test_nanum.pdf test_nanum.out - - if [ "$INSTALLED" = "no" ]; then - LOG_INFO "步骤8:卸载texlive-nanumtype1字体包" - dnf remove -y texlive-nanumtype1 - CHECK_RESULT $? 0 0 "卸载texlive-nanumtype1失败" - fi - - LOG_INFO "测试完成" -} - -main "$@" \ No newline at end of file diff --git a/testcases/function_test/pkg_test/texlive-split-s/texlive-pxtxalfa-doc/test_texlive-pxtxalfa-doc_function_install.sh b/testcases/function_test/pkg_test/texlive-split-s/texlive-pxtxalfa-doc/test_texlive-pxtxalfa-doc_function_install.sh deleted file mode 100644 index b7b071e61ad..00000000000 --- a/testcases/function_test/pkg_test/texlive-split-s/texlive-pxtxalfa-doc/test_texlive-pxtxalfa-doc_function_install.sh +++ /dev/null @@ -1,71 +0,0 @@ -#!/usr/bin/bash - -# Copyright (c) 2024 ISCAS .ALL rights reserved. -# This program is licensed under Mulan PSL v2. -# You can use it according to the terms and conditions of the Mulan PSL v2. -# http://license.coscl.org.cn/MulanPSL2 -# THIS PROGRAM IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, -# EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, -# MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. -# See the Mulan PSL v2 for more details. - -# ############################################# -# @Author : honghua -# @Contact : honghua@iscas.ac.cn -# @Date : 2025-11-26 -# @License : Mulan PSL v2 -# @Desc : Verify package installation -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - - # 检查yum源中是否存在texlive-pxtxalfa-doc软件包 - LOG_INFO "检查yum源中是否存在texlive-pxtxalfa-doc软件包..." - dnf list available texlive-pxtxalfa-doc >/dev/null 2>&1 - if [ $? -ne 0 ]; then - LOG_ERROR "yum源中不存在texlive-pxtxalfa-doc软件包" - exit 255 - fi - - # 检查是否已安装texlive-pxtxalfa-doc - LOG_INFO "检查是否已安装texlive-pxtxalfa-doc..." - dnf list installed texlive-pxtxalfa-doc >/dev/null 2>&1 - if [ $? -eq 0 ]; then - LOG_INFO "texlive-pxtxalfa-doc已安装,脚本结束时保持安装状态" - installed=true - else - LOG_INFO "texlive-pxtxalfa-doc未安装,将进行安装测试" - installed=false - fi - - # 如果未安装,则进行安装 - if [ "$installed" = false ]; then - LOG_INFO "开始安装texlive-pxtxalfa-doc..." - dnf install -y texlive-pxtxalfa-doc >/dev/null 2>&1 - CHECK_RESULT $? 0 0 "安装texlive-pxtxalfa-doc失败" - fi - - # 验证安装后的功能 - LOG_INFO "验证texlive-pxtxalfa-doc功能..." - command_to_test="some_texlive_command" # 替换为实际的测试命令 - $command_to_test >/dev/null 2>&1 - CHECK_RESULT $? 0 0 "验证texlive-pxtxalfa-doc功能失败" - - # 如果脚本开始时未安装,则在结束时卸载软件包 - if [ "$installed" = false ]; then - LOG_INFO "卸载texlive-pxtxalfa-doc..." - dnf remove -y texlive-pxtxalfa-doc >/dev/null 2>&1 - CHECK_RESULT $? 0 0 "卸载texlive-pxtxalfa-doc失败" - - # 确认卸载成功 - dnf list installed texlive-pxtxalfa-doc >/dev/null 2>&1 - CHECK_RESULT $? 1 0 "卸载texlive-pxtxalfa-doc后仍存在" - fi - - LOG_INFO "测试完成,环境已恢复" - -} - -main "$@" \ No newline at end of file diff --git a/testcases/function_test/pkg_test/texlive-split-s/texlive-pxtxalfa-doc/test_texlive-pxtxalfa-doc_function_remove.sh b/testcases/function_test/pkg_test/texlive-split-s/texlive-pxtxalfa-doc/test_texlive-pxtxalfa-doc_function_remove.sh deleted file mode 100644 index d1861372d86..00000000000 --- a/testcases/function_test/pkg_test/texlive-split-s/texlive-pxtxalfa-doc/test_texlive-pxtxalfa-doc_function_remove.sh +++ /dev/null @@ -1,84 +0,0 @@ -#!/usr/bin/bash - -# Copyright (c) 2024 ISCAS .ALL rights reserved. -# This program is licensed under Mulan PSL v2. -# You can use it according to the terms and conditions of the Mulan PSL v2. -# http://license.coscl.org.cn/MulanPSL2 -# THIS PROGRAM IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, -# EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, -# MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. -# See the Mulan PSL v2 for more details. - -# ############################################# -# @Author : honghua -# @Contact : honghua@iscas.ac.cn -# @Date : 2026-03-05 -# @License : Mulan PSL v2 -# @Desc : Verify package removal -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - set -e - - LOG_INFO "开始测试软件包移除功能" - - # 检查是否已经安装 - LOG_INFO "检查是否已安装 texlive-pxtxalfa-doc 软件包" - if dnf list installed texlive-pxtxalfa-doc &>/dev/null; then - LOG_INFO "检测到 texlive-pxtxalfa-doc 已安装,测试后将保持安装状态" - ALREADY_INSTALLED=1 - else - LOG_INFO "未检测到 texlive-pxtxalfa-doc 安装,将在测试前安装并在测试后卸载" - ALREADY_INSTALLED=0 - fi - - # 检查yum源中是否有该软件包 - LOG_INFO "检查yum源中是否存在 texlive-pxtxalfa-doc 软件包" - if ! dnf list available texlive-pxtxalfa-doc &>/dev/null; then - LOG_ERROR "yum源中未找到 texlive-pxtxalfa-doc 软件包" - exit 255 - fi - - # 如果未安装,则先安装 - if [ ${ALREADY_INSTALLED} -eq 0 ]; then - LOG_INFO "安装 texlive-pxtxalfa-doc 软件包" - dnf install -y texlive-pxtxalfa-doc - CHECK_RESULT $? 0 0 "安装 texlive-pxtxalfa-doc 失败" - fi - - # 验证安装成功 - LOG_INFO "验证 texlive-pxtxalfa-doc 是否安装成功" - dnf list installed texlive-pxtxalfa-doc - CHECK_RESULT $? 0 0 "验证 texlive-pxtxalfa-doc 安装状态失败" - - # 测试移除功能 - LOG_INFO "测试移除 texlive-pxtxalfa-doc 软件包" - dnf remove -y texlive-pxtxalfa-doc - CHECK_RESULT $? 0 0 "移除 texlive-pxtxalfa-doc 失败" - - # 验证移除成功 - LOG_INFO "验证 texlive-pxtxalfa-doc 是否已移除" - if dnf list installed texlive-pxtxalfa-doc &>/dev/null; then - LOG_ERROR "texlive-pxtxalfa-doc 软件包移除失败" - exit 1 - else - LOG_INFO "texlive-pxtxalfa-doc 软件包已成功移除" - fi - - # 环境恢复:如果原本未安装,则不需要重新安装;如果原本已安装,则需要重新安装 - LOG_INFO "开始环境恢复" - if [ ${ALREADY_INSTALLED} -eq 1 ]; then - LOG_INFO "重新安装 texlive-pxtxalfa-doc 以恢复原始状态" - dnf install -y texlive-pxtxalfa-doc - CHECK_RESULT $? 0 0 "重新安装 texlive-pxtxalfa-doc 失败" - LOG_INFO "环境已恢复到初始安装状态" - else - LOG_INFO "原始状态为未安装,无需额外恢复操作" - fi - - LOG_INFO "测试完成" -} - -main "$@" \ No newline at end of file diff --git a/testcases/function_test/pkg_test/texlive-split-s/texlive-pxtxalfa-doc/test_texlive-pxtxalfa-doc_function_usage.sh b/testcases/function_test/pkg_test/texlive-split-s/texlive-pxtxalfa-doc/test_texlive-pxtxalfa-doc_function_usage.sh deleted file mode 100644 index f843f2d7602..00000000000 --- a/testcases/function_test/pkg_test/texlive-split-s/texlive-pxtxalfa-doc/test_texlive-pxtxalfa-doc_function_usage.sh +++ /dev/null @@ -1,91 +0,0 @@ -#!/usr/bin/bash - -# Copyright (c) 2024 ISCAS .ALL rights reserved. -# This program is licensed under Mulan PSL v2. -# You can use it according to the terms and conditions of the Mulan PSL v2. -# http://license.coscl.org.cn/MulanPSL2 -# THIS PROGRAM IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, -# EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, -# MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. -# See the Mulan PSL v2 for more details. - -# ############################################# -# @Author : honghua -# @Contact : honghua@iscas.ac.cn -# @Date : 2026-03-05 -# @License : Mulan PSL v2 -# @Desc : Check documentation accessibility -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - LOG_INFO "开始测试: 检查texlive-pxtxalfa-doc文档的可访问性" - - # 定义软件包名称 - PACKAGE_NAME="texlive-pxtxalfa-doc" - - 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 - - LOG_INFO "步骤2: 检查系统是否已安装 $PACKAGE_NAME" - dnf list installed "$PACKAGE_NAME" > /dev/null 2>&1 - if [ $? -eq 0 ]; then - LOG_INFO "软件包 $PACKAGE_NAME 已安装,测试完成后将保持安装状态" - ALREADY_INSTALLED=1 - else - LOG_INFO "软件包 $PACKAGE_NAME 未安装,将作为测试步骤进行安装" - ALREADY_INSTALLED=0 - fi - - if [ $ALREADY_INSTALLED -eq 0 ]; then - LOG_INFO "步骤3: 安装软件包 $PACKAGE_NAME" - dnf install -y "$PACKAGE_NAME" - CHECK_RESULT $? 0 0 "安装软件包 $PACKAGE_NAME 失败" - fi - - LOG_INFO "步骤4: 检查软件包文档的可访问性" - # 假设文档位于标准路径,这里检查文档目录是否存在 - DOC_PATH="/usr/share/texlive/texmf-dist/doc/latex/pxtxalfa" - if [ -d "$DOC_PATH" ]; then - LOG_INFO "文档目录 $DOC_PATH 存在" - ls -la "$DOC_PATH" - CHECK_RESULT $? 0 0 "无法列出文档目录内容" - else - LOG_ERROR "文档目录 $DOC_PATH 不存在" - exit 1 - fi - - LOG_INFO "步骤5: 检查文档文件是否可读" - # 检查目录下是否有文件,并尝试读取一个文件 - if [ -n "$(ls -A "$DOC_PATH")" ]; then - SAMPLE_FILE=$(find "$DOC_PATH" -type f -name "*.pdf" -o -name "*.txt" -o -name "*.tex" | head -1) - if [ -n "$SAMPLE_FILE" ]; then - LOG_INFO "尝试读取文档文件: $SAMPLE_FILE" - head -c 100 "$SAMPLE_FILE" > /dev/null 2>&1 - CHECK_RESULT $? 0 0 "无法读取文档文件 $SAMPLE_FILE" - else - LOG_INFO "文档目录中没有常见的文档文件格式(pdf/txt/tex)" - fi - else - LOG_ERROR "文档目录 $DOC_PATH 为空" - exit 1 - fi - - LOG_INFO "步骤6: 环境清理" - if [ $ALREADY_INSTALLED -eq 0 ]; then - LOG_INFO "卸载测试安装的软件包 $PACKAGE_NAME" - dnf remove -y "$PACKAGE_NAME" - CHECK_RESULT $? 0 0 "卸载软件包 $PACKAGE_NAME 失败" - else - LOG_INFO "测试前已安装软件包,保持安装状态" - fi - - LOG_INFO "测试完成: 文档可访问性检查通过" -} - -main "$@" \ No newline at end of file diff --git a/testcases/function_test/pkg_test/texlive-split-y/texlive-alphalph/test_texlive-alphalph_function_basic.sh b/testcases/function_test/pkg_test/texlive-split-y/texlive-alphalph/test_texlive-alphalph_function_basic.sh deleted file mode 100644 index e560f9a078a..00000000000 --- a/testcases/function_test/pkg_test/texlive-split-y/texlive-alphalph/test_texlive-alphalph_function_basic.sh +++ /dev/null @@ -1,68 +0,0 @@ -#!/usr/bin/bash - -# Copyright (c) 2024 ISCAS .ALL rights reserved. -# This program is licensed under Mulan PSL v2. -# You can use it according to the terms and conditions of the Mulan PSL v2. -# http://license.coscl.org.cn/MulanPSL2 -# THIS PROGRAM IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, -# EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, -# MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. -# See the Mulan PSL v2 for more details. - -# ############################################# -# @Author : honghua -# @Contact : honghua@iscas.ac.cn -# @Date : 2025-11-26 -# @License : Mulan PSL v2 -# @Desc : Test basic alphalph functionality -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - # 测试脚本:test_texlive-alphalph_function_basic - - LOG_INFO "开始测试:Test basic alphalph functionality" - - # 检查是否已安装texlive-alphalph - LOG_INFO "检查是否已安装texlive-alphalph" - dnf list installed texlive-alphalph > /dev/null 2>&1 - if [ $? -eq 0 ]; then - LOG_INFO "texlive-alphalph已安装,测试结束后保持安装状态" - INSTALLED=1 - else - LOG_INFO "texlive-alphalph未安装,将在测试结束后卸载" - INSTALLED=0 - fi - - # 检查yum源中是否有texlive-alphalph - LOG_INFO "检查yum源中是否有texlive-alphalph" - dnf list available texlive-alphalph > /dev/null 2>&1 - if [ $? -ne 0 ]; then - LOG_ERROR "yum源中未找到texlive-alphalph" - exit 255 - fi - - # 安装texlive-alphalph - if [ $INSTALLED -eq 0 ]; then - LOG_INFO "安装texlive-alphalph" - dnf install -y texlive-alphalph > /dev/null 2>&1 - CHECK_RESULT $? 0 0 "安装texlive-alphalph失败" - fi - - # 测试alphalph基本功能 - LOG_INFO "测试alphalph基本功能" - alphalph --version > /dev/null 2>&1 - CHECK_RESULT $? 0 0 "alphalph命令执行失败" - - # 清理环境 - if [ $INSTALLED -eq 0 ]; then - LOG_INFO "卸载texlive-alphalph" - dnf remove -y texlive-alphalph > /dev/null 2>&1 - CHECK_RESULT $? 0 0 "卸载texlive-alphalph失败" - fi - - LOG_INFO "测试完成:Test basic alphalph functionality" -} - -main "$@" \ No newline at end of file diff --git a/testcases/function_test/pkg_test/texlive-split-y/texlive-alphalph/test_texlive-alphalph_function_check_installed.sh b/testcases/function_test/pkg_test/texlive-split-y/texlive-alphalph/test_texlive-alphalph_function_check_installed.sh deleted file mode 100644 index 36fb52dcf67..00000000000 --- a/testcases/function_test/pkg_test/texlive-split-y/texlive-alphalph/test_texlive-alphalph_function_check_installed.sh +++ /dev/null @@ -1,68 +0,0 @@ -#!/usr/bin/bash - -# Copyright (c) 2024 ISCAS .ALL rights reserved. -# This program is licensed under Mulan PSL v2. -# You can use it according to the terms and conditions of the Mulan PSL v2. -# http://license.coscl.org.cn/MulanPSL2 -# THIS PROGRAM IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, -# EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, -# MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. -# See the Mulan PSL v2 for more details. - -# ############################################# -# @Author : honghua -# @Contact : honghua@iscas.ac.cn -# @Date : 2026-02-20 -# @License : Mulan PSL v2 -# @Desc : Test if texlive-alphalph is installed -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - LOG_INFO "开始测试texlive-alphalph是否安装" - LOG_INFO "检查是否已安装texlive-alphalph" - rpm -q texlive-alphalph - if [ $? -eq 0 ]; then - LOG_INFO "texlive-alphalph已安装,测试完成后保持安装状态" - INSTALLED_BEFORE=true - else - LOG_INFO "texlive-alphalph未安装,将执行安装测试" - INSTALLED_BEFORE=false - fi - LOG_INFO "检查yum源中是否有texlive-alphalph软件包" - dnf list available texlive-alphalph - if [ $? -ne 0 ]; then - LOG_ERROR "yum源中没有texlive-alphalph软件包" - exit 255 - fi - if [ "$INSTALLED_BEFORE" = "false" ]; then - LOG_INFO "安装texlive-alphalph" - dnf install -y texlive-alphalph - CHECK_RESULT $? 0 0 "安装texlive-alphalph失败" - LOG_INFO "验证安装是否成功" - rpm -q texlive-alphalph - CHECK_RESULT $? 0 0 "验证安装失败" - fi - LOG_INFO "测试texlive-alphalph命令功能" - alphalph --help - CHECK_RESULT $? 0 0 "texlive-alphalph命令执行失败" - if [ "$INSTALLED_BEFORE" = "false" ]; then - LOG_INFO "卸载texlive-alphalph" - dnf remove -y texlive-alphalph - CHECK_RESULT $? 0 0 "卸载texlive-alphalph失败" - LOG_INFO "验证卸载是否成功" - rpm -q texlive-alphalph - if [ $? -eq 0 ]; then - LOG_ERROR "卸载后仍检测到texlive-alphalph" - exit 1 - else - LOG_INFO "卸载验证成功" - fi - else - LOG_INFO "测试完成,保持texlive-alphalph安装状态" - fi - LOG_INFO "测试结束,环境已恢复" -} - -main "$@" \ No newline at end of file diff --git a/testcases/function_test/pkg_test/texlive-split-y/texlive-alphalph/test_texlive-alphalph_function_convert.sh b/testcases/function_test/pkg_test/texlive-split-y/texlive-alphalph/test_texlive-alphalph_function_convert.sh deleted file mode 100644 index 20a5ee32de0..00000000000 --- a/testcases/function_test/pkg_test/texlive-split-y/texlive-alphalph/test_texlive-alphalph_function_convert.sh +++ /dev/null @@ -1,73 +0,0 @@ -#!/usr/bin/bash - -# Copyright (c) 2024 ISCAS .ALL rights reserved. -# This program is licensed under Mulan PSL v2. -# You can use it according to the terms and conditions of the Mulan PSL v2. -# http://license.coscl.org.cn/MulanPSL2 -# THIS PROGRAM IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, -# EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, -# MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. -# See the Mulan PSL v2 for more details. - -# ############################################# -# @Author : honghua -# @Contact : honghua@iscas.ac.cn -# @Date : 2026-02-20 -# @License : Mulan PSL v2 -# @Desc : Test alphalph number conversion -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - LOG_INFO "测试开始:Test alphalph number conversion" - LOG_INFO "步骤1:检查系统中是否已安装 texlive-alphalph 软件包" - rpm -q texlive-alphalph - if [ $? -eq 0 ]; then - LOG_INFO "texlive-alphalph 已安装,脚本结束时将保持安装状态" - INSTALLED=1 - else - LOG_INFO "texlive-alphalph 未安装,将在测试过程中安装" - INSTALLED=0 - fi - LOG_INFO "步骤2:检查yum源中是否有 texlive-alphalph 软件包" - dnf list available texlive-alphalph - if [ $? -ne 0 ]; then - LOG_ERROR "yum源中未找到 texlive-alphalph 软件包" - exit 255 - fi - if [ $INSTALLED -eq 0 ]; then - LOG_INFO "步骤3:安装 texlive-alphalph 软件包" - dnf install -y texlive-alphalph - CHECK_RESULT $? 0 0 "安装 texlive-alphalph 失败" - fi - LOG_INFO "步骤4:验证 alphalph 命令的基本功能" - alphalph --help - CHECK_RESULT $? 0 0 "alphalph 命令不可用或执行失败" - LOG_INFO "步骤5:测试 alphalph 数字转换功能" - result=$(alphalph 1) - expected="a" - if [ "$result" = "$expected" ]; then - LOG_INFO "数字转换测试通过:1 -> a" - else - LOG_ERROR "数字转换测试失败:预期 "$expected",实际 "$result"" - exit 1 - fi - LOG_INFO "步骤6:测试不支持的参数" - alphalph --invalid-option 2>/dev/null - if [ $? -ne 255 ] && [ $? -ne 0 ]; then - LOG_ERROR "不支持的参数处理不符合预期" - exit 255 - fi - LOG_INFO "步骤7:清理测试环境" - if [ $INSTALLED -eq 0 ]; then - LOG_INFO "卸载 texlive-alphalph 软件包" - dnf remove -y texlive-alphalph - CHECK_RESULT $? 0 0 "卸载 texlive-alphalph 失败" - else - LOG_INFO "保持 texlive-alphalph 安装状态" - fi - LOG_INFO "测试完成" -} - -main "$@" \ No newline at end of file diff --git a/testcases/function_test/pkg_test/texlive-split-y/texlive-alphalph/test_texlive-alphalph_function_install.sh b/testcases/function_test/pkg_test/texlive-split-y/texlive-alphalph/test_texlive-alphalph_function_install.sh deleted file mode 100644 index 62ea1339ca4..00000000000 --- a/testcases/function_test/pkg_test/texlive-split-y/texlive-alphalph/test_texlive-alphalph_function_install.sh +++ /dev/null @@ -1,79 +0,0 @@ -#!/usr/bin/bash - -# Copyright (c) 2024 ISCAS .ALL rights reserved. -# This program is licensed under Mulan PSL v2. -# You can use it according to the terms and conditions of the Mulan PSL v2. -# http://license.coscl.org.cn/MulanPSL2 -# THIS PROGRAM IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, -# EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, -# MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. -# See the Mulan PSL v2 for more details. - -# ############################################# -# @Author : honghua -# @Contact : honghua@iscas.ac.cn -# @Date : 2026-02-20 -# @License : Mulan PSL v2 -# @Desc : Test installation of texlive-alphalph package -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - # 检查是否已安装 texlive-alphalph 软件包 - LOG_INFO "检查是否已安装 texlive-alphalph 软件包" - rpm -q texlive-alphalph > /dev/null 2>&1 - is_installed=$? - - # 如果未安装,则标记需要在脚本结束时卸载 - if [ $is_installed -ne 0 ]; then - need_uninstall=1 - LOG_INFO "texlive-alphalph 未安装,将在测试结束后卸载" - else - need_uninstall=0 - LOG_INFO "texlive-alphalph 已安装,测试结束后将保持安装状态" - fi - - # 检查 yum 源中是否存在 texlive-alphalph 软件包 - LOG_INFO "检查 yum 源中是否存在 texlive-alphalph 软件包" - dnf list available texlive-alphalph > /dev/null 2>&1 - if [ $? -ne 0 ]; then - LOG_ERROR "yum 源中未找到 texlive-alphalph 软件包" - exit 255 - fi - - # 如果未安装,则安装 texlive-alphalph 软件包 - if [ $is_installed -ne 0 ]; then - LOG_INFO "安装 texlive-alphalph 软件包" - dnf install -y texlive-alphalph - CHECK_RESULT $? 0 0 "安装 texlive-alphalph 失败" - fi - - # 验证 texlive-alphalph 是否安装成功 - LOG_INFO "验证 texlive-alphalph 是否安装成功" - rpm -q texlive-alphalph > /dev/null 2>&1 - CHECK_RESULT $? 0 0 "texlive-alphalph 安装后验证失败" - - # 测试 texlive-alphalph 的功能 - LOG_INFO "测试 texlive-alphalph 的功能" - alphalph --help > /dev/null 2>&1 - if [ $? -eq 0 ]; then - LOG_INFO "texlive-alphalph 功能测试通过" - else - LOG_ERROR "texlive-alphalph 功能测试失败" - CHECK_RESULT 1 0 0 "texlive-alphalph 功能测试失败" - fi - - # 环境恢复 - LOG_INFO "开始环境恢复" - if [ $need_uninstall -eq 1 ]; then - LOG_INFO "卸载 texlive-alphalph 软件包" - dnf remove -y texlive-alphalph - CHECK_RESULT $? 0 0 "卸载 texlive-alphalph 失败" - LOG_INFO "环境恢复完成,已卸载 texlive-alphalph" - else - LOG_INFO "环境恢复完成,保持 texlive-alphalph 安装状态" - fi -} - -main "$@" \ No newline at end of file diff --git a/testcases/function_test/pkg_test/texlive-split-y/texlive-alphalph/test_texlive-alphalph_function_macro.sh b/testcases/function_test/pkg_test/texlive-split-y/texlive-alphalph/test_texlive-alphalph_function_macro.sh deleted file mode 100644 index ae4c344d896..00000000000 --- a/testcases/function_test/pkg_test/texlive-split-y/texlive-alphalph/test_texlive-alphalph_function_macro.sh +++ /dev/null @@ -1,76 +0,0 @@ -#!/usr/bin/bash - -# Copyright (c) 2024 ISCAS .ALL rights reserved. -# This program is licensed under Mulan PSL v2. -# You can use it according to the terms and conditions of the Mulan PSL v2. -# http://license.coscl.org.cn/MulanPSL2 -# THIS PROGRAM IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, -# EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, -# MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. -# See the Mulan PSL v2 for more details. - -# ############################################# -# @Author : honghua -# @Contact : honghua@iscas.ac.cn -# @Date : 2026-02-20 -# @License : Mulan PSL v2 -# @Desc : Test alphalph LaTeX macro usage -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - LOG_INFO "测试开始:测试 alphalph LaTeX 宏的使用" - - LOG_INFO "步骤1:检查环境中是否已安装 texlive-alphalph 软件包" - rpm -q texlive-alphalph > /dev/null 2>&1 - if [ $? -eq 0 ]; then - LOG_INFO "环境已安装 texlive-alphalph,测试结束后将保持安装状态" - INSTALLED_BEFORE=1 - else - LOG_INFO "环境未安装 texlive-alphalph,测试结束后将卸载" - INSTALLED_BEFORE=0 - fi - - LOG_INFO "步骤2:检查 yum 源中是否存在 texlive-alphalph 软件包" - dnf list available texlive-alphalph > /dev/null 2>&1 - CHECK_RESULT $? 0 255 "yum 源中未找到 texlive-alphalph 软件包,退出测试" - - if [ $INSTALLED_BEFORE -eq 0 ]; then - LOG_INFO "步骤3:安装 texlive-alphalph 软件包" - dnf install -y texlive-alphalph - CHECK_RESULT $? 0 0 "安装 texlive-alphalph 软件包失败" - fi - - LOG_INFO "步骤4:验证 alphalph 宏的基本功能" - cat > test_alphalph.tex << "EOF" - \documentclass{article} - \usepackage{alphalph} - \begin{document} - \alphalph{1} should be "a", - \alphalph{26} should be "z", - \alphalph{27} should be "aa", - \alphalph{52} should be "az". - \end{document} - EOF - - pdflatex -interaction=nonstopmode test_alphalph.tex > /dev/null 2>&1 - CHECK_RESULT $? 0 0 "生成测试 PDF 失败" - - LOG_INFO "步骤5:检查生成的 PDF 内容" - pdftotext test_alphalph.pdf - > /dev/null 2>&1 - CHECK_RESULT $? 0 0 "提取 PDF 文本失败" - - LOG_INFO "步骤6:清理测试文件" - rm -f test_alphalph.tex test_alphalph.pdf test_alphalph.aux test_alphalph.log - - if [ $INSTALLED_BEFORE -eq 0 ]; then - LOG_INFO "步骤7:卸载 texlive-alphalph 软件包" - dnf remove -y texlive-alphalph - CHECK_RESULT $? 0 0 "卸载 texlive-alphalph 软件包失败" - fi - - LOG_INFO "测试完成:alphalph LaTeX 宏使用测试通过" -} - -main "$@" \ No newline at end of file diff --git a/testcases/function_test/pkg_test/texlive-split-y/texlive-uantwerpendocs-doc/test_texlive-uantwerpendocs-doc_function_install.sh b/testcases/function_test/pkg_test/texlive-split-y/texlive-uantwerpendocs-doc/test_texlive-uantwerpendocs-doc_function_install.sh deleted file mode 100644 index 903c971f990..00000000000 --- a/testcases/function_test/pkg_test/texlive-split-y/texlive-uantwerpendocs-doc/test_texlive-uantwerpendocs-doc_function_install.sh +++ /dev/null @@ -1,63 +0,0 @@ -#!/usr/bin/bash - -# Copyright (c) 2024 ISCAS .ALL rights reserved. -# This program is licensed under Mulan PSL v2. -# You can use it according to the terms and conditions of the Mulan PSL v2. -# http://license.coscl.org.cn/MulanPSL2 -# THIS PROGRAM IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, -# EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, -# MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. -# See the Mulan PSL v2 for more details. - -# ############################################# -# @Author : honghua -# @Contact : honghua@iscas.ac.cn -# @Date : 2025-11-26 -# @License : Mulan PSL v2 -# @Desc : Test installation of texlive-uantwerpendocs-doc -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - LOG_INFO "开始测试:Test installation of texlive-uantwerpendocs-doc" - - # 检查软件包是否已安装 - if dnf list installed texlive-uantwerpendocs-doc &>/dev/null; then - LOG_INFO "环境已安装texlive-uantwerpendocs-doc,脚本结束时将保持安装状态" - INSTALLED=true - else - LOG_INFO "环境未安装texlive-uantwerpendocs-doc,将在测试结束后卸载" - INSTALLED=false - fi - - # 检查yum源中是否有该软件包 - LOG_INFO "检查yum源中是否存在texlive-uantwerpendocs-doc" - if ! dnf list available texlive-uantwerpendocs-doc &>/dev/null; then - LOG_ERROR "yum源中不存在texlive-uantwerpendocs-doc" - exit 255 - fi - - # 安装软件包 - if [ "$INSTALLED" = false ]; then - LOG_INFO "开始安装texlive-uantwerpendocs-doc" - dnf install -y texlive-uantwerpendocs-doc - CHECK_RESULT $? 0 0 "安装texlive-uantwerpendocs-doc失败" - fi - - # 测试软件包功能(示例命令,需根据实际功能调整) - LOG_INFO "测试texlive-uantwerpendocs-doc功能" - example_command --test texlive-uantwerpendocs-doc - CHECK_RESULT $? 0 0 "测试texlive-uantwerpendocs-doc功能失败" - - # 清理环境(如果之前未安装) - if [ "$INSTALLED" = false ]; then - LOG_INFO "卸载texlive-uantwerpendocs-doc" - dnf remove -y texlive-uantwerpendocs-doc - CHECK_RESULT $? 0 0 "卸载texlive-uantwerpendocs-doc失败" - fi - - LOG_INFO "测试完成:Test installation of texlive-uantwerpendocs-doc" -} - -main "$@" \ No newline at end of file diff --git a/testcases/function_test/pkg_test/texlive-split-z/texlive-zhmetrics-doc/test_texlive-zhmetrics-doc_function_check_files.sh b/testcases/function_test/pkg_test/texlive-split-z/texlive-zhmetrics-doc/test_texlive-zhmetrics-doc_function_check_files.sh deleted file mode 100644 index d402f212714..00000000000 --- a/testcases/function_test/pkg_test/texlive-split-z/texlive-zhmetrics-doc/test_texlive-zhmetrics-doc_function_check_files.sh +++ /dev/null @@ -1,85 +0,0 @@ -#!/usr/bin/bash - -# Copyright (c) 2024 ISCAS .ALL rights reserved. -# This program is licensed under Mulan PSL v2. -# You can use it according to the terms and conditions of the Mulan PSL v2. -# http://license.coscl.org.cn/MulanPSL2 -# THIS PROGRAM IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, -# EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, -# MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. -# See the Mulan PSL v2 for more details. - -# ############################################# -# @Author : honghua -# @Contact : honghua@iscas.ac.cn -# @Date : 2026-03-05 -# @License : Mulan PSL v2 -# @Desc : 测试 texlive-zhmetrics-doc 软件包安装后,验证其核心文档文件(如 .pdf, .tex 文件)是否存在于预期的系统路径中。 -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - # 定义软件包名称 - PACKAGE_NAME="texlive-zhmetrics-doc" - - # 步骤1: 检查软件包是否已在yum源中 - LOG_INFO "检查软件包是否在yum源中" - dnf list available $PACKAGE_NAME &>/dev/null - if [ $? -ne 0 ]; then - LOG_ERROR "软件包 $PACKAGE_NAME 不在yum源中" - exit 255 - fi - - # 步骤2: 检查当前是否已安装该软件包 - LOG_INFO "检查软件包是否已安装" - rpm -q $PACKAGE_NAME &>/dev/null - if [ $? -eq 0 ]; then - LOG_INFO "软件包 $PACKAGE_NAME 已安装,将保持安装状态" - INSTALLED_BEFORE=true - else - LOG_INFO "软件包 $PACKAGE_NAME 未安装,将进行安装" - INSTALLED_BEFORE=false - fi - - # 步骤3: 如果未安装,则安装软件包 - if [ "$INSTALLED_BEFORE" = "false" ]; then - LOG_INFO "安装软件包 $PACKAGE_NAME" - dnf install -y $PACKAGE_NAME - CHECK_RESULT $? 0 0 "安装软件包失败" - fi - - # 步骤4: 验证核心文档文件是否存在于预期路径 - LOG_INFO "验证核心文档文件是否存在于预期路径" - # 获取软件包安装的文件列表 - FILES=$(rpm -ql $PACKAGE_NAME | grep -E "\.(pdf|tex)$") - if [ -z "$FILES" ]; then - LOG_ERROR "未找到任何 .pdf 或 .tex 文件" - exit 1 - fi - - # 检查每个文件是否存在 - for FILE in $FILES; do - if [ -f "$FILE" ]; then - LOG_INFO "文件 $FILE 存在" - else - LOG_ERROR "文件 $FILE 不存在" - exit 1 - fi - done - - LOG_INFO "所有核心文档文件均存在" - - # 步骤5: 环境恢复 - if [ "$INSTALLED_BEFORE" = "false" ]; then - LOG_INFO "卸载软件包 $PACKAGE_NAME" - dnf remove -y $PACKAGE_NAME - CHECK_RESULT $? 0 0 "卸载软件包失败" - else - LOG_INFO "软件包已安装,保持原状" - fi - - LOG_INFO "测试完成" -} - -main "$@" \ No newline at end of file diff --git a/testcases/function_test/pkg_test/texlive-split-z/texlive-zhmetrics-doc/test_texlive-zhmetrics-doc_function_verify_content.sh b/testcases/function_test/pkg_test/texlive-split-z/texlive-zhmetrics-doc/test_texlive-zhmetrics-doc_function_verify_content.sh deleted file mode 100644 index 08e1d4f5db8..00000000000 --- a/testcases/function_test/pkg_test/texlive-split-z/texlive-zhmetrics-doc/test_texlive-zhmetrics-doc_function_verify_content.sh +++ /dev/null @@ -1,88 +0,0 @@ -#!/usr/bin/bash - -# Copyright (c) 2024 ISCAS .ALL rights reserved. -# This program is licensed under Mulan PSL v2. -# You can use it according to the terms and conditions of the Mulan PSL v2. -# http://license.coscl.org.cn/MulanPSL2 -# THIS PROGRAM IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, -# EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, -# MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. -# See the Mulan PSL v2 for more details. - -# ############################################# -# @Author : honghua -# @Contact : honghua@iscas.ac.cn -# @Date : 2026-03-05 -# @License : Mulan PSL v2 -# @Desc : 测试 texlive-zhmetrics-doc 软件包文档内容的可访问性,验证其安装的文档(例如通过 `texdoc` 命令)能否被正常打开和查看。 -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - # 检查软件包是否已在yum源中 - LOG_INFO "检查texlive-zhmetrics-doc软件包是否在yum源中" - dnf list texlive-zhmetrics-doc - if [ $? -ne 0 ]; then - LOG_ERROR "texlive-zhmetrics-doc软件包不在yum源中" - exit 255 - fi - - # 检查环境是否已安装该软件包 - LOG_INFO "检查texlive-zhmetrics-doc软件包是否已安装" - rpm -q texlive-zhmetrics-doc - if [ $? -eq 0 ]; then - LOG_INFO "texlive-zhmetrics-doc软件包已安装,标记为保持安装状态" - KEEP_INSTALLED=true - else - LOG_INFO "texlive-zhmetrics-doc软件包未安装,标记为需要清理" - KEEP_INSTALLED=false - fi - - # 如果未安装,则安装软件包 - if [ "$KEEP_INSTALLED" = "false" ]; then - LOG_INFO "安装texlive-zhmetrics-doc软件包" - dnf install -y texlive-zhmetrics-doc - CHECK_RESULT $? 0 0 "安装texlive-zhmetrics-doc软件包失败" - fi - - # 验证texdoc命令是否存在 - LOG_INFO "验证texdoc命令是否存在" - which texdoc - CHECK_RESULT $? 0 0 "texdoc命令不存在" - - # 使用texdoc命令查看texlive-zhmetrics-doc文档 - LOG_INFO "使用texdoc命令查看texlive-zhmetrics-doc文档" - texdoc texlive-zhmetrics-doc - CHECK_RESULT $? 0 0 "无法使用texdoc命令查看texlive-zhmetrics-doc文档" - - # 检查文档文件是否存在 - LOG_INFO "检查texlive-zhmetrics-doc文档文件是否存在" - DOC_PATH=$(texdoc -l texlive-zhmetrics-doc | head -1) - if [ -n "$DOC_PATH" ]; then - LOG_INFO "找到文档路径: $DOC_PATH" - ls -l "$DOC_PATH" - CHECK_RESULT $? 0 0 "文档文件无法访问" - else - LOG_ERROR "未找到texlive-zhmetrics-doc文档" - exit 1 - fi - - # 验证文档内容可读性 - LOG_INFO "验证文档内容可读性" - file "$DOC_PATH" | grep -E "(PDF|text|PostScript)" - CHECK_RESULT $? 0 0 "文档格式不可识别或不可读" - - # 清理环境:如果脚本开始前未安装,则卸载软件包 - if [ "$KEEP_INSTALLED" = "false" ]; then - LOG_INFO "卸载texlive-zhmetrics-doc软件包" - dnf remove -y texlive-zhmetrics-doc - CHECK_RESULT $? 0 0 "卸载texlive-zhmetrics-doc软件包失败" - else - LOG_INFO "保持texlive-zhmetrics-doc软件包安装状态" - fi - - LOG_INFO "测试完成" -} - -main "$@" \ No newline at end of file