From fe32852e7b7142f46477dd1314b3b26d1d364fc3 Mon Sep 17 00:00:00 2001 From: hou Date: Sat, 27 May 2023 03:36:23 +0000 Subject: [PATCH] =?UTF-8?q?systemd=E6=B5=8B=E8=AF=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: hou --- systemd/testcase/systemd-test.sh | 51 ++++++++++++++++++++++++++++++++ 1 file changed, 51 insertions(+) create mode 100644 systemd/testcase/systemd-test.sh diff --git a/systemd/testcase/systemd-test.sh b/systemd/testcase/systemd-test.sh new file mode 100644 index 0000000..f848db2 --- /dev/null +++ b/systemd/testcase/systemd-test.sh @@ -0,0 +1,51 @@ +#!/bin/bash +############################################################################### +# @用例ID: 20230525-154056-556766079 +# @用例名称: systemd-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" + # @预置条件:systemctl 命令可用 + + command -v systemctl + assert_true [ $? -eq 0 ] + return 0 +} + +do_test() { + msg "this is do_test" + + # @测试步骤:验证systemctl命令功能 + # @预期结果:可以正确使用systemctl检查 sshd 服务的状态 + assert_true systemctl status sshd.service + + + + return 0 +} + + + +tc_teardown() { + msg "this is tc_teardown" + + rm -rfv "$g_tmpdir" || return 1 + return 0 +} + + +############################################################################### +tst_main "$@" +############################################################################### -- Gitee