diff --git a/systemd/testcase/systemd-test.sh b/systemd/testcase/systemd-test.sh new file mode 100644 index 0000000000000000000000000000000000000000..f848db208bf228f3e9030911e1607822349cbb2e --- /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 "$@" +###############################################################################