From fdec10e0ee8e8b5d8ea0fbeef17947dcc6dcf55c Mon Sep 17 00:00:00 2001 From: root Date: Sun, 28 May 2023 21:21:54 +0800 Subject: [PATCH] add dile-test.sh --- file/testcase/file-test.sh | 42 ++++++++++++++++++++++++++++++++++++++ 1 file changed, 42 insertions(+) create mode 100755 file/testcase/file-test.sh diff --git a/file/testcase/file-test.sh b/file/testcase/file-test.sh new file mode 100755 index 0000000..12cde52 --- /dev/null +++ b/file/testcase/file-test.sh @@ -0,0 +1,42 @@ +#!/bin/bash +############################################################################### +# @用例ID: 20230528-211019-324373895 +# @用例名称: file +# @用例级别: 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" + assert_true yum install -y file + return 0 +} + +do_test() { + msg "this is do_test" + assert_ture touch a.txt + echo "test" >> a.txt + assert_true file -b a.txt + + return 0 +} + +tc_teardown() { + msg "this is tc_teardown" + rm a.txt + rm -rfv "$g_tmpdir" || return 1 + return 0 +} + +############################################################################### +tst_main "$@" +############################################################################### -- Gitee