From af272691f630183096c83722acb0725fa04ad249 Mon Sep 17 00:00:00 2001 From: sdu-xinglindu <1783674677@qq.com> Date: Sun, 28 May 2023 12:57:08 +0800 Subject: [PATCH 1/3] dnf-plugins-core --- dnf-plugins-core/testcase/dnf-plugins-core.sh | 64 +++++++++++++++++++ 1 file changed, 64 insertions(+) create mode 100755 dnf-plugins-core/testcase/dnf-plugins-core.sh diff --git a/dnf-plugins-core/testcase/dnf-plugins-core.sh b/dnf-plugins-core/testcase/dnf-plugins-core.sh new file mode 100755 index 0000000..85874f1 --- /dev/null +++ b/dnf-plugins-core/testcase/dnf-plugins-core.sh @@ -0,0 +1,64 @@ +#!/bin/bash +############################################################################### +# @用例ID: 20230528-125517-007330035 +# @用例名称: dnf-plugins-core +# @用例级别: 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" + # @预置条件: + # @预置条件:系统正常运行,且已安装 dnf-plugins-core + assert_true yum install -y dnf-plugins-core + return 0 +} + +do_test() { + msg "this is do_test" + + + # @测试步骤:1 + # 使用 fastestmirror 插件测试镜像源的速度 + assert_true dnf --enablerepo=base fastestmirror check + + # @预期结果:1 + # 确保成功测试了镜像源的速度,并显示了最快的镜像源 + + # @测试步骤:2 + # 使用 downloadonly 插件下载软件包但不安装 + assert_true dnf downloadonly install bash + + # @预期结果:2 + # 确保成功下载了 bash 软件包,但不进行安装 + + # @测试步骤:3 + # 使用 versionlock 插件锁定软件包的版本 + assert_true dnf versionlock add bash + + # @预期结果:3 + # 确保成功锁定了 bash 软件包的版本 + + assert_true [ 1 -eq 1 ] + + return 0 +} + +tc_teardown() { + msg "this is tc_teardown" + rm -rfv "$g_tmpdir" || return 1 + return 0 +} + +############################################################################### +tst_main "$@" +############################################################################### -- Gitee From 7d18ee22fc6b20233f900e3318fc81e9c71b0bb0 Mon Sep 17 00:00:00 2001 From: sdu-xinglindu <1783674677@qq.com> Date: Sun, 28 May 2023 13:02:38 +0800 Subject: [PATCH 2/3] dnf-plugins-core_2 --- dnf-plugins-core/testcase/dnf-plugins-core.sh | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/dnf-plugins-core/testcase/dnf-plugins-core.sh b/dnf-plugins-core/testcase/dnf-plugins-core.sh index 85874f1..8881171 100755 --- a/dnf-plugins-core/testcase/dnf-plugins-core.sh +++ b/dnf-plugins-core/testcase/dnf-plugins-core.sh @@ -27,29 +27,29 @@ do_test() { msg "this is do_test" + msg "this is do_test" + # @测试步骤:1 # 使用 fastestmirror 插件测试镜像源的速度 - assert_true dnf --enablerepo=base fastestmirror check - # @预期结果:1 # 确保成功测试了镜像源的速度,并显示了最快的镜像源 + assert_true dnf --enablerepo=base fastestmirror check # @测试步骤:2 # 使用 downloadonly 插件下载软件包但不安装 - assert_true dnf downloadonly install bash - # @预期结果:2 # 确保成功下载了 bash 软件包,但不进行安装 + assert_true dnf downloadonly install bash # @测试步骤:3 # 使用 versionlock 插件锁定软件包的版本 - assert_true dnf versionlock add bash - # @预期结果:3 # 确保成功锁定了 bash 软件包的版本 + assert_true dnf versionlock add bash + - assert_true [ 1 -eq 1 ] + return 0 } -- Gitee From 1968ace5eb150f421db2f96f6b299be7fa75c499 Mon Sep 17 00:00:00 2001 From: sdu-xinglindu <1783674677@qq.com> Date: Sun, 28 May 2023 13:15:32 +0800 Subject: [PATCH 3/3] dnf-p-c-2 --- dnf-plugins-core/testcase/dnf-plugins-core.sh | 18 ++++++------------ 1 file changed, 6 insertions(+), 12 deletions(-) diff --git a/dnf-plugins-core/testcase/dnf-plugins-core.sh b/dnf-plugins-core/testcase/dnf-plugins-core.sh index 8881171..32e121a 100755 --- a/dnf-plugins-core/testcase/dnf-plugins-core.sh +++ b/dnf-plugins-core/testcase/dnf-plugins-core.sh @@ -29,22 +29,16 @@ do_test() { msg "this is do_test" - # @测试步骤:1 - # 使用 fastestmirror 插件测试镜像源的速度 - # @预期结果:1 - # 确保成功测试了镜像源的速度,并显示了最快的镜像源 + # @测试步骤:1 使用 fastestmirror 插件测试镜像源的速度 + # @预期结果:1 确保成功测试了镜像源的速度,并显示了最快的镜像源 assert_true dnf --enablerepo=base fastestmirror check - # @测试步骤:2 - # 使用 downloadonly 插件下载软件包但不安装 - # @预期结果:2 - # 确保成功下载了 bash 软件包,但不进行安装 + # @测试步骤:2 使用 downloadonly 插件下载软件包但不安装 + # @预期结果:2 确保成功下载了 bash 软件包,但不进行安装 assert_true dnf downloadonly install bash - # @测试步骤:3 - # 使用 versionlock 插件锁定软件包的版本 - # @预期结果:3 - # 确保成功锁定了 bash 软件包的版本 + # @测试步骤:3 使用 versionlock 插件锁定软件包的版本 + # @预期结果:3 确保成功锁定了 bash 软件包的版本 assert_true dnf versionlock add bash -- Gitee