From 3afa9531680f1a9810f5a90a8b4fe08b1506ff73 Mon Sep 17 00:00:00 2001 From: An <54012338+Aph-CUG@users.noreply.github.com> Date: Mon, 29 May 2023 10:46:37 +0800 Subject: [PATCH 1/3] =?UTF-8?q?=E6=96=B0=E5=A2=9Egrub2=E6=B5=8B=E8=AF=95?= =?UTF-8?q?=E7=94=A8=E4=BE=8B?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: An <54012338+Aph-CUG@users.noreply.github.com> --- grub2/testcase/grub2_test.sh | 47 ++++++++++++++++++++++++++++++++++++ 1 file changed, 47 insertions(+) create mode 100644 grub2/testcase/grub2_test.sh diff --git a/grub2/testcase/grub2_test.sh b/grub2/testcase/grub2_test.sh new file mode 100644 index 0000000..52fdba8 --- /dev/null +++ b/grub2/testcase/grub2_test.sh @@ -0,0 +1,47 @@ +#!/bin/bash +############################################################################### +# @用例ID: 20230525-202902-718027017 +# @用例名称: grub-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" + # @预置条件: 测试是否安装grub2 + assert_true yum install -y grub2 + return 0 +} + +do_test() { + msg "this is do_test" + + # @测试步骤:1: 测试grub2命令 + assert_true grub2-install --help + # @测试步骤:2: 测试grub2输出结果 + output = $(grub2-install -V) + assert_equals "$output" "grub2-install (GRUB) *" + + 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 00f0cb2c06845741e1b5407dd3490abe844b9226 Mon Sep 17 00:00:00 2001 From: An <54012338+Aph-CUG@users.noreply.github.com> Date: Mon, 29 May 2023 11:14:21 +0800 Subject: [PATCH 2/3] =?UTF-8?q?grub2=E6=B5=8B=E8=AF=95=E7=94=A8=E4=BE=8B?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: An <54012338+Aph-CUG@users.noreply.github.com> --- grub2/testcase/grub2_test.sh | 3 --- 1 file changed, 3 deletions(-) diff --git a/grub2/testcase/grub2_test.sh b/grub2/testcase/grub2_test.sh index 52fdba8..08e0213 100644 --- a/grub2/testcase/grub2_test.sh +++ b/grub2/testcase/grub2_test.sh @@ -30,9 +30,6 @@ do_test() { # @测试步骤:2: 测试grub2输出结果 output = $(grub2-install -V) assert_equals "$output" "grub2-install (GRUB) *" - - assert_true [ 1 -eq 1 ] - return 0 } -- Gitee From b7702d729803c4db640a06a38ae0a241f42efc55 Mon Sep 17 00:00:00 2001 From: An <54012338+Aph-CUG@users.noreply.github.com> Date: Tue, 30 May 2023 09:15:51 +0800 Subject: [PATCH 3/3] =?UTF-8?q?=E6=96=B0=E5=A2=9Egrub2=E6=B5=8B=E8=AF=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: An <54012338+Aph-CUG@users.noreply.github.com> --- grub2/testcase/grub2_test.sh | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/grub2/testcase/grub2_test.sh b/grub2/testcase/grub2_test.sh index 08e0213..7d8557f 100644 --- a/grub2/testcase/grub2_test.sh +++ b/grub2/testcase/grub2_test.sh @@ -25,11 +25,9 @@ tc_setup() { do_test() { msg "this is do_test" - # @测试步骤:1: 测试grub2命令 + # @测试步骤: 测试grub2命令 assert_true grub2-install --help - # @测试步骤:2: 测试grub2输出结果 - output = $(grub2-install -V) - assert_equals "$output" "grub2-install (GRUB) *" + assert_true grub2-install --version return 0 } -- Gitee