diff --git a/file/testcase/file-test.sh b/file/testcase/file-test.sh new file mode 100755 index 0000000000000000000000000000000000000000..8f44d7ffdd2c194daaac0ad557f1a390df213b38 --- /dev/null +++ b/file/testcase/file-test.sh @@ -0,0 +1,46 @@ +#!/bin/bash +############################################################################### +# @用例ID: 20230525-180317-666143046 +# @用例名称: file-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" + # @预置条件: 系统正常运行,且已安装file软件包 + assert_true yum install -y file + return 0 +} + +do_test() { + msg "this is do_test" + + # @测试步骤:1: 测试file -b命令 + touch a.txt + echo "test" >>a.txt + assert_true file -b a.txt + # @预期结果:1: 命令正常 + + return 0 +} + +tc_teardown() { + msg "this is tc_teardown" + rm a.txt + rm -rfv "$g_tmpdir" || return 1 + return 0 +} + +############################################################################### +tst_main "$@" +###############################################################################