diff --git a/virt-what/testcase/virt-what-test.sh b/virt-what/testcase/virt-what-test.sh new file mode 100644 index 0000000000000000000000000000000000000000..53e281983f1bd128b1f70787d106390267182d13 --- /dev/null +++ b/virt-what/testcase/virt-what-test.sh @@ -0,0 +1,53 @@ +#!/bin/bash +############################################################################### +# @用例ID: 20230525-154056-556766079 +# @用例名称: virt-what-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" + # @预置条件:virt-what 命令可用 + + command -v virt-what + assert_true [ $? -eq 0 ] + return 0 +} + +do_test() { + msg "this is do_test" + + # @测试步骤:验证virt-what命令功能 + # @预期结果:可以正确使用virt-what命令获取虚拟化类型 + # 执行 virt-what 命令,获取虚拟化类型 + assert_true virtualization_type=$(virt-what) + + + + + return 0 +} + + + +tc_teardown() { + msg "this is tc_teardown" + + rm -rfv "$g_tmpdir" || return 1 + return 0 +} + + +############################################################################### +tst_main "$@" +###############################################################################