forked from zstackio/zstack
-
Notifications
You must be signed in to change notification settings - Fork 0
TESTcase-simplekvm #3474
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Closed
Closed
TESTcase-simplekvm #3474
Changes from all commits
Commits
Show all changes
2 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
51 changes: 51 additions & 0 deletions
51
test/src/test/groovy/org/zstack/test/integration/kvm/vm/SimpleVmLifeCycleCase.groovy
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,51 @@ | ||
| package org.zstack.test.integration.kvm.vm | ||
|
|
||
| import org.zstack.header.vm.VmInstanceState | ||
| import org.zstack.header.vm.VmInstanceVO | ||
| import org.zstack.sdk.VmInstanceInventory | ||
| import org.zstack.test.integration.kvm.Env | ||
| import org.zstack.test.integration.kvm.KvmTest | ||
| import org.zstack.testlib.EnvSpec | ||
| import org.zstack.testlib.SubCase | ||
|
|
||
| /** | ||
| * 最小化虚拟机测试用例 | ||
| * 仅验证虚拟机创建后的状态 | ||
| */ | ||
| class SimpleVmLifeCycleCase extends SubCase { | ||
|
|
||
| EnvSpec env | ||
|
|
||
| @Override | ||
| void setup() { | ||
| useSpring(KvmTest.springSpec) | ||
| } | ||
|
|
||
| @Override | ||
| void environment() { | ||
| env = Env.oneVmTwoHostNfsEnv() | ||
| } | ||
|
|
||
| @Override | ||
| void test() { | ||
| env.create { | ||
| testVmIsRunningAfterCreation() | ||
| } | ||
| } | ||
|
|
||
| /** | ||
| * 测试:创建后虚拟机应处于 Running 状态 | ||
| */ | ||
| void testVmIsRunningAfterCreation() { | ||
| VmInstanceInventory vm = env.inventoryByName("vm") as VmInstanceInventory | ||
|
|
||
| VmInstanceVO vo = dbFindByUuid(vm.uuid, VmInstanceVO.class) | ||
| assert vo != null | ||
| assert vo.state == VmInstanceState.Running | ||
| } | ||
|
|
||
| @Override | ||
| void clean() { | ||
| env.delete() | ||
| } | ||
| } | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
注释应使用英文,不应包含中文。
根据编码规范,代码中不应包含中文,包括注释也应使用正确的英文。请将中文注释替换为英文。
📝 建议的修改
As per coding guidelines:
**/*.*: 代码里不应当有有中文,包括报错、注释等都应当使用正确的、无拼写错误的英文来写Also applies to: 36-38
🤖 Prompt for AI Agents