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 0000000000000000000000000000000000000000..32e121a8b88f0ca5cb2ba58dbc41913fc98a2f19 --- /dev/null +++ b/dnf-plugins-core/testcase/dnf-plugins-core.sh @@ -0,0 +1,58 @@ +#!/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" + + + msg "this is do_test" + + # @测试步骤:1 使用 fastestmirror 插件测试镜像源的速度 + # @预期结果:1 确保成功测试了镜像源的速度,并显示了最快的镜像源 + assert_true dnf --enablerepo=base fastestmirror check + + # @测试步骤:2 使用 downloadonly 插件下载软件包但不安装 + # @预期结果:2 确保成功下载了 bash 软件包,但不进行安装 + assert_true dnf downloadonly install bash + + # @测试步骤:3 使用 versionlock 插件锁定软件包的版本 + # @预期结果:3 确保成功锁定了 bash 软件包的版本 + assert_true dnf versionlock add bash + + + + + return 0 +} + +tc_teardown() { + msg "this is tc_teardown" + rm -rfv "$g_tmpdir" || return 1 + return 0 +} + +############################################################################### +tst_main "$@" +###############################################################################