From 75c757b3bb041f598f78a19045a1eab296b45a52 Mon Sep 17 00:00:00 2001 From: hougit1 Date: Sat, 27 May 2023 09:54:06 +0800 Subject: [PATCH 1/2] =?UTF-8?q?rpm=E9=AA=8C=E8=AF=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: hougit1 --- .gitmodules | 3 +++ rpm_test/tst_common | 1 + 2 files changed, 4 insertions(+) create mode 160000 rpm_test/tst_common diff --git a/.gitmodules b/.gitmodules index f107bf3..2bf0c24 100644 --- a/.gitmodules +++ b/.gitmodules @@ -13,3 +13,6 @@ [submodule "mysql/tst_common"] path = mysql/tst_common url = https://gitee.com/opencloudos-stream/test-suite-base.git +[submodule "rpm_test/tst_common"] + path = rpm_test/tst_common + url = https://gitee.com/opencloudos-stream/test-suite-base.git diff --git a/rpm_test/tst_common b/rpm_test/tst_common new file mode 160000 index 0000000..6a4bfa4 --- /dev/null +++ b/rpm_test/tst_common @@ -0,0 +1 @@ +Subproject commit 6a4bfa4dc8d07271d3a10b7e0518b4e899235c31 -- Gitee From 2b38ef9f192cbdd08630be1ba4f8d6bf9db8254e Mon Sep 17 00:00:00 2001 From: hou Date: Sat, 27 May 2023 01:55:07 +0000 Subject: [PATCH 2/2] =?UTF-8?q?rpm=E6=B5=8B=E8=AF=95=E9=AA=8C=E8=AF=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: hou --- rpm/testcase/rpm-test.sh | 52 ++++++++++++++++++++++++++++++++++++++++ 1 file changed, 52 insertions(+) create mode 100644 rpm/testcase/rpm-test.sh diff --git a/rpm/testcase/rpm-test.sh b/rpm/testcase/rpm-test.sh new file mode 100644 index 0000000..48265f8 --- /dev/null +++ b/rpm/testcase/rpm-test.sh @@ -0,0 +1,52 @@ +#!/bin/bash +############################################################################### +# @用例ID: 20230525-154056-556766079 +# @用例名称: rpm-test +# @用例级别: 3 +# @用例标签: +# @用例类型: 功能 +############################################################################### +[ -z "$TST_TS_TOPDIR" ] && { + TST_TS_TOPDIR="$(realpath "$(dirname "$0")/..")" + export TST_TS_TOPDIR +} +source "${TST_TS_TOPDIR}/tst_common/lib/common.sh" || exit 1 +############################################################################### + +g_tmpdir="$(mktemp -d)" + +tc_setup() { + msg "this is tc_setup" + # @预置条件:wget已安装 + + # 安装 wget软件包 + + sudo yum install -y wget + + return 0 +} + +do_test() { + msg "this is do_test" + + # @测试步骤:使用rpm检查是否安装了wget + # @预期结果:使用rpm指令可以正确检索 + assert_true rpm -q wget + + + return 0 +} + + + +tc_teardown() { + msg "this is tc_teardown" + + rm -rfv "$g_tmpdir" || return 1 + return 0 +} + + +############################################################################### +tst_main "$@" +############################################################################### -- Gitee