From e2a9be916b7d33bd4ab5e132373986dc4674a446 Mon Sep 17 00:00:00 2001 From: xufei Date: Fri, 27 Feb 2026 17:00:58 +0800 Subject: [PATCH] add docbook5-schemas test case --- .../tc_service_docbook5-schemas_fun001.yaml | 18 +++++++++ .../docbook5-schemas/docbook-5.xml | 38 +++++++++++++++++++ .../tc_service_docbook5-schemas_fun001.py | 33 ++++++++++++++++ 3 files changed, 89 insertions(+) create mode 100644 docs/system_base/docbook5-schemas/tc_service_docbook5-schemas_fun001.yaml create mode 100644 tests/system_base/docbook5-schemas/docbook-5.xml create mode 100644 tests/system_base/docbook5-schemas/tc_service_docbook5-schemas_fun001.py diff --git a/docs/system_base/docbook5-schemas/tc_service_docbook5-schemas_fun001.yaml b/docs/system_base/docbook5-schemas/tc_service_docbook5-schemas_fun001.yaml new file mode 100644 index 00000000..bbd6c156 --- /dev/null +++ b/docs/system_base/docbook5-schemas/tc_service_docbook5-schemas_fun001.yaml @@ -0,0 +1,18 @@ +作者: xufei +优先级: P1 +支持架构: noarch +执行方式: 自动 +测试类型: 功能测试 +通用标签: local,docbook5-schemas +用例描述: db4-entities.pl命令功能测试 +修改人: xufei + +前置条件: +- 安装docbook5-schemas软件包 + +测试步骤: +- 执行db4-entities.pl命令处理docbook-5.xml文件,验证输出中是否包含版本信息 + +期望结果: +- db4-entities.pl命令执行成功 +- 命令输出中包含"version="字符串 diff --git a/tests/system_base/docbook5-schemas/docbook-5.xml b/tests/system_base/docbook5-schemas/docbook-5.xml new file mode 100644 index 00000000..67c67617 --- /dev/null +++ b/tests/system_base/docbook5-schemas/docbook-5.xml @@ -0,0 +1,38 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/tests/system_base/docbook5-schemas/tc_service_docbook5-schemas_fun001.py b/tests/system_base/docbook5-schemas/tc_service_docbook5-schemas_fun001.py new file mode 100644 index 00000000..95722317 --- /dev/null +++ b/tests/system_base/docbook5-schemas/tc_service_docbook5-schemas_fun001.py @@ -0,0 +1,33 @@ +""" +@File: tc_service_docbook5-schemas_fun001.py +@Time: 2026/2/27 15:30:20 +@Author: xufei +@Version: 1.0 +@Contact: xufei@inspur.com +@License: Mulan PSL v2 +@Modify: xufei +""" +import subprocess +import time + +from common.basetest import LocalTest + + +class Test(LocalTest): + """ + See tc_service_docbook5-schemas_fun001.yaml for details + + :avocado: tags=P1,noarch,local,docbook5-schemas + """ + PARAM_DIC = {"pkg_name": "docbook5-schemas"} + + def setUp(self): + super().setUp(self.PARAM_DIC) + + def test(self): + code, result = self.cmd('db4-entities.pl ./tests/system_base/docbook5-schemas/docbook-5.xml | grep "version="') + self.assertFalse(code, "Check db4-entities.pl failed") + + def tearDown(self): + super().tearDown(self.PARAM_DIC) + -- Gitee