update testcase for testsuite texlive-pdf-trans
This commit is contained in:
@@ -2,10 +2,6 @@
|
||||
"path": "$OET_PATH/testcases/function_test/pkg_test/texlive-split-r/texlive-pdf-trans",
|
||||
"machine num": 1,
|
||||
"cases": [
|
||||
{
|
||||
"name": "test_texlive-pdf-trans_function_basic",
|
||||
"desc": "Basic functionality test"
|
||||
},
|
||||
{
|
||||
"name": "test_texlive-pdf-trans_function_install",
|
||||
"desc": "Test the installation of the texlive-pdf-trans package"
|
||||
@@ -14,17 +10,9 @@
|
||||
"name": "test_texlive-pdf-trans_function_uninstall",
|
||||
"desc": "Test the removal of the texlive-pdf-trans package"
|
||||
},
|
||||
{
|
||||
"name": "test_texlive-pdf-trans_function_usage",
|
||||
"desc": "Test basic usage of the pdf-trans command"
|
||||
},
|
||||
{
|
||||
"name": "test_texlive-pdf-trans_function_version",
|
||||
"desc": "Test checking the version of the package"
|
||||
},
|
||||
{
|
||||
"name": "test_texlive-pdf-trans_function_help",
|
||||
"desc": "Test displaying the help information for pdf-trans"
|
||||
}
|
||||
]
|
||||
}
|
||||
@@ -1,69 +0,0 @@
|
||||
#!/usr/bin/bash
|
||||
|
||||
# Copyright (c) 2024 ISCAS .ALL rights reserved.
|
||||
# This program is licensed under Mulan PSL v2.
|
||||
# You can use it according to the terms and conditions of the Mulan PSL v2.
|
||||
# http://license.coscl.org.cn/MulanPSL2
|
||||
# THIS PROGRAM IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND,
|
||||
# EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT,
|
||||
# MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE.
|
||||
# See the Mulan PSL v2 for more details.
|
||||
|
||||
# #############################################
|
||||
# @Author : honghua
|
||||
# @Contact : honghua@iscas.ac.cn
|
||||
# @Date : 2025-11-26
|
||||
# @License : Mulan PSL v2
|
||||
# @Desc : Basic functionality test
|
||||
# ############################################
|
||||
|
||||
source "$OET_PATH/libs/locallibs/common_lib.sh"
|
||||
|
||||
function run_test() {
|
||||
LOG_INFO "Basic functionality test start"
|
||||
|
||||
# 检查是否已经安装texlive-pdf-trans
|
||||
LOG_INFO "Check if texlive-pdf-trans is installed"
|
||||
if dnf list installed texlive-pdf-trans &>/dev/null; then
|
||||
LOG_INFO "texlive-pdf-trans is already installed"
|
||||
INSTALLED=true
|
||||
else
|
||||
LOG_INFO "texlive-pdf-trans is not installed"
|
||||
INSTALLED=false
|
||||
fi
|
||||
|
||||
# 检查yum源中是否有texlive-pdf-trans
|
||||
LOG_INFO "Check if texlive-pdf-trans is available in the yum repository"
|
||||
if ! dnf list available texlive-pdf-trans &>/dev/null; then
|
||||
LOG_ERROR "texlive-pdf-trans is not available in the yum repository"
|
||||
exit 255
|
||||
fi
|
||||
|
||||
# 如果未安装,则安装texlive-pdf-trans
|
||||
if [ "$INSTALLED" = false ]; then
|
||||
LOG_INFO "Installing texlive-pdf-trans"
|
||||
dnf install -y texlive-pdf-trans
|
||||
CHECK_RESULT $? 0 0 "Failed to install texlive-pdf-trans"
|
||||
fi
|
||||
|
||||
# 测试texlive-pdf-trans基本功能
|
||||
LOG_INFO "Testing basic functionality of texlive-pdf-trans"
|
||||
texlive-pdf-trans --version
|
||||
CHECK_RESULT $? 0 0 "Failed to execute texlive-pdf-trans --version"
|
||||
|
||||
# 检查不支持的参数
|
||||
LOG_INFO "Checking unsupported parameters"
|
||||
texlive-pdf-trans --invalid-option &>/dev/null
|
||||
CHECK_RESULT $? 255 255 "Unsupported parameter should return exit code 255"
|
||||
|
||||
# 清理环境
|
||||
if [ "$INSTALLED" = false ]; then
|
||||
LOG_INFO "Uninstalling texlive-pdf-trans"
|
||||
dnf remove -y texlive-pdf-trans
|
||||
CHECK_RESULT $? 0 0 "Failed to uninstall texlive-pdf-trans"
|
||||
fi
|
||||
|
||||
LOG_INFO "Basic functionality test completed"
|
||||
}
|
||||
|
||||
main "$@"
|
||||
@@ -1,69 +0,0 @@
|
||||
#!/usr/bin/bash
|
||||
|
||||
# Copyright (c) 2024 ISCAS .ALL rights reserved.
|
||||
# This program is licensed under Mulan PSL v2.
|
||||
# You can use it according to the terms and conditions of the Mulan PSL v2.
|
||||
# http://license.coscl.org.cn/MulanPSL2
|
||||
# THIS PROGRAM IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND,
|
||||
# EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT,
|
||||
# MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE.
|
||||
# See the Mulan PSL v2 for more details.
|
||||
|
||||
# #############################################
|
||||
# @Author : honghua
|
||||
# @Contact : honghua@iscas.ac.cn
|
||||
# @Date : 2026-03-19
|
||||
# @License : Mulan PSL v2
|
||||
# @Desc : Test displaying the help information for pdf-trans
|
||||
# ############################################
|
||||
|
||||
source "$OET_PATH/libs/locallibs/common_lib.sh"
|
||||
|
||||
function run_test() {
|
||||
LOG_INFO "开始测试:显示pdf-trans命令的帮助信息"
|
||||
LOG_INFO "步骤1:检查系统中是否已安装texlive-pdf-trans软件包"
|
||||
rpm -q texlive-pdf-trans > /dev/null 2>&1
|
||||
if [ $? -eq 0 ]; then
|
||||
LOG_INFO "texlive-pdf-trans软件包已安装"
|
||||
INSTALLED=1
|
||||
else
|
||||
LOG_INFO "texlive-pdf-trans软件包未安装"
|
||||
INSTALLED=0
|
||||
fi
|
||||
if [ $INSTALLED -eq 0 ]; then
|
||||
LOG_INFO "步骤2:检查yum源中是否有texlive-pdf-trans软件包"
|
||||
dnf list available texlive-pdf-trans > /dev/null 2>&1
|
||||
if [ $? -ne 0 ]; then
|
||||
LOG_ERROR "yum源中未找到texlive-pdf-trans软件包"
|
||||
exit 255
|
||||
fi
|
||||
LOG_INFO "步骤3:安装texlive-pdf-trans软件包"
|
||||
dnf install -y texlive-pdf-trans
|
||||
CHECK_RESULT $? 0 0 "安装texlive-pdf-trans软件包失败"
|
||||
fi
|
||||
LOG_INFO "步骤4:执行pdf-trans --help命令"
|
||||
pdf-trans --help > /dev/null 2>&1
|
||||
if [ $? -eq 0 ]; then
|
||||
LOG_INFO "pdf-trans --help命令执行成功"
|
||||
else
|
||||
LOG_INFO "步骤5:检查pdf-trans命令是否支持--help参数"
|
||||
pdf-trans --help 2>&1 | grep -i "unrecognized option\|invalid option\|未知选项" > /dev/null 2>&1
|
||||
if [ $? -eq 0 ]; then
|
||||
LOG_ERROR "pdf-trans命令不支持--help参数"
|
||||
exit 255
|
||||
else
|
||||
CHECK_RESULT $? 0 0 "pdf-trans --help命令执行失败"
|
||||
fi
|
||||
fi
|
||||
LOG_INFO "步骤6:清理测试环境"
|
||||
if [ $INSTALLED -eq 0 ]; then
|
||||
LOG_INFO "卸载texlive-pdf-trans软件包"
|
||||
dnf remove -y texlive-pdf-trans
|
||||
CHECK_RESULT $? 0 0 "卸载texlive-pdf-trans软件包失败"
|
||||
else
|
||||
LOG_INFO "测试前已安装texlive-pdf-trans软件包,保持安装状态"
|
||||
fi
|
||||
LOG_INFO "测试完成"
|
||||
}
|
||||
|
||||
main "$@"
|
||||
@@ -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-19
|
||||
# @License : Mulan PSL v2
|
||||
# @Desc : Test basic usage of the pdf-trans command
|
||||
# ############################################
|
||||
|
||||
source "$OET_PATH/libs/locallibs/common_lib.sh"
|
||||
|
||||
function run_test() {
|
||||
LOG_INFO "开始测试pdf-trans命令的基本用法"
|
||||
LOG_INFO "步骤1:检查texlive-pdf-trans软件包是否已在yum源中"
|
||||
dnf list available texlive-pdf-trans > /dev/null 2>&1
|
||||
if [ $? -ne 0 ]; then
|
||||
LOG_ERROR "yum源中未找到texlive-pdf-trans软件包"
|
||||
exit 255
|
||||
fi
|
||||
|
||||
LOG_INFO "步骤2:检查texlive-pdf-trans是否已安装"
|
||||
rpm -q texlive-pdf-trans > /dev/null 2>&1
|
||||
if [ $? -eq 0 ]; then
|
||||
LOG_INFO "texlive-pdf-trans已安装,测试结束后将保持安装状态"
|
||||
INSTALLED=true
|
||||
else
|
||||
LOG_INFO "texlive-pdf-trans未安装,将进行安装"
|
||||
INSTALLED=false
|
||||
fi
|
||||
|
||||
if [ "$INSTALLED" = false ]; then
|
||||
LOG_INFO "步骤3:安装texlive-pdf-trans软件包"
|
||||
dnf install -y texlive-pdf-trans
|
||||
CHECK_RESULT $? 0 0 "安装texlive-pdf-trans失败"
|
||||
fi
|
||||
|
||||
LOG_INFO "步骤4:检查pdf-trans命令是否支持基本参数"
|
||||
pdf-trans --help > /dev/null 2>&1
|
||||
CHECK_RESULT $? 0 0 "pdf-trans命令不支持--help参数"
|
||||
|
||||
LOG_INFO "步骤5:执行pdf-trans命令进行基本功能测试"
|
||||
pdf-trans --version > /dev/null 2>&1
|
||||
CHECK_RESULT $? 0 0 "pdf-trans命令版本检查失败"
|
||||
|
||||
LOG_INFO "步骤6:测试pdf-trans转换功能(使用示例文件)"
|
||||
if [ -f /usr/share/doc/texlive-pdf-trans/examples/sample.pdf ]; then
|
||||
pdf-trans /usr/share/doc/texlive-pdf-trans/examples/sample.pdf output.tex > /dev/null 2>&1
|
||||
CHECK_RESULT $? 0 0 "pdf-trans转换示例文件失败"
|
||||
rm -f output.tex
|
||||
else
|
||||
LOG_INFO "未找到示例文件,跳过转换测试"
|
||||
fi
|
||||
|
||||
LOG_INFO "步骤7:清理测试环境"
|
||||
if [ "$INSTALLED" = false ]; then
|
||||
LOG_INFO "卸载texlive-pdf-trans软件包"
|
||||
dnf remove -y texlive-pdf-trans
|
||||
CHECK_RESULT $? 0 0 "卸载texlive-pdf-trans失败"
|
||||
fi
|
||||
|
||||
LOG_INFO "测试完成"
|
||||
}
|
||||
|
||||
main "$@"
|
||||
Reference in New Issue
Block a user