Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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

/**
* 最小化虚拟机测试用例
* 仅验证虚拟机创建后的状态
*/
Comment on lines +11 to +14
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue | 🟡 Minor

注释中包含中文,违反编码规范。

根据编码规范,代码中不应包含中文(包括注释)。请将中文注释改为英文。

📝 建议修改
 /**
- * 最小化虚拟机测试用例
- * 仅验证虚拟机创建后的状态
+ * Minimal VM test case
+ * Only verifies the VM state after creation
  */
 class SimpleVmLifeCycleCase extends SubCase {
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
/**
* 最小化虚拟机测试用例
* 仅验证虚拟机创建后的状态
*/
/**
* Minimal VM test case
* Only verifies the VM state after creation
*/
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In
`@test/src/test/groovy/org/zstack/test/integration/kvm/vm/SimpleVmLifeCycleCase.groovy`
around lines 11 - 14, The top-of-file Chinese comment block in
SimpleVmLifeCycleCase.groovy contains non-compliant Chinese text; replace the
Chinese comments with equivalent English wording (e.g., "Minimal VM test case"
and "Only verifies VM state after creation") so the header comment above the
class SimpleVmLifeCycleCase uses English only and complies with the coding
standard.

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 状态
*/
Comment on lines +36 to +38
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue | 🟡 Minor

方法注释中包含中文,违反编码规范。

根据编码规范,代码中不应包含中文(包括注释)。请将中文注释改为英文。

📝 建议修改
     /**
-     * 测试:创建后虚拟机应处于 Running 状态
+     * Test: VM should be in Running state after creation
      */
     void testVmIsRunningAfterCreation() {
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
/**
* 测试:创建后虚拟机应处于 Running 状态
*/
/**
* Test: VM should be in Running state after creation
*/
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In
`@test/src/test/groovy/org/zstack/test/integration/kvm/vm/SimpleVmLifeCycleCase.groovy`
around lines 36 - 38, Replace the Chinese Javadoc comment in
SimpleVmLifeCycleCase.groovy with an English equivalent; specifically update the
comment block (the /** ... */ above the test) to read something like "Test: VM
should be in Running state after creation" so the file contains no Chinese text.

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()
}
}
176 changes: 88 additions & 88 deletions test/src/test/resources/zstack.properties
Original file line number Diff line number Diff line change
@@ -1,88 +1,88 @@
#DbFacadeDataSource.jdbcUrl=jdbc:mysql://192.168.0.214:3306/zstack
DB.url=jdbc:mysql://localhost:3306/
DB.user=root
DB.password=
DB.idleConnectionTestPeriod=500
DB.maxIdleTime=600
DbFacadeDataSource.maxPoolSize=64
RESTFacade.hostname=localhost
RESTFacade.port=8989
RESTFacade.path=
KVMHostFactory.agentPort=8989
Ceph.backupStorageAgent.port=8989
Ceph.primaryStorageAgent.port=8989
Zbs.primaryStorageAgent.port=8989
SftpBackupStorageFactory.deployPuppetModule=false
SftpBackupStorage.agentPort=8989
CdpBackupStorage.agentPort=8989
ImageStoreBackupStorage.agentPort=8989
Zabbix.port=8989
NfsPrimaryStorageKVMBackend.syncGetCapacity=true
VirtualRouterManager.agentPort=8989
VirtualRouterManager.cleanVirtualRouterVmWhenFail=true
ManagementServerConsoleProxyBackend.agentPort=8989
IscsiFileSystemBackendPrimaryStorage.agentPort=8989
BaremetalPxeServer.agentPort=8989
httpConsoleProxyPort = 8989
AppBuildSystem.agentPort=8989
Zdfs.agentPort=8989
ApiMediator.apiWorkerNum=50
unitTestOn=true
elaboration.slowThresholdMs=200
exitJVMOnStop=false
#CloudBus.closeTracker=true
#CloudBus.messageTTL=1
#CloudBus.closeTracker=true
#vmTracerOn=false
#Simulator.notCacheAgentCommand=true
ErrorFacade.dumpOnError=false
#ThreadFacade.maxThreadNum=2100
Ansible.cfg.forks=100
Ansible.cfg.host_key_checking=False
Ansible.cfg.pipelining=True
CloudBus.serverIp.0 = localhost
org.jboss.logging.provider=slf4j
exposeSimulatorType=true
Cassandra.contactPoints=127.0.0.1
Cassandra.port=9042
Cassandra.keyspace=zstack_billing
Cassandra.bin=~/apache-cassandra-2.2.3/bin/cassandra
Cassandra.cqlsh=~/apache-cassandra-2.2.3/bin/cqlsh
PrimaryStorage.capacityTrackerOn=true
shadowEntityOn=true
isThreadContextMapInheritable=true
enableElaboration=true
Prometheus.versionMode=2.x
InfluxDB.metadata.version=v2
chain.task.qos=true
identity.init.type=
#DbFacadeDataSource.jdbcUrl=jdbc:mysql://192.168.0.214:3306/zstack
DB.url=jdbc:mysql://localhost:3306/
DB.user=root
DB.password=
DB.idleConnectionTestPeriod=500
DB.maxIdleTime=600

DbFacadeDataSource.maxPoolSize=64

RESTFacade.hostname=localhost
RESTFacade.port=8989
RESTFacade.path=

KVMHostFactory.agentPort=8989

Ceph.backupStorageAgent.port=8989
Ceph.primaryStorageAgent.port=8989

Zbs.primaryStorageAgent.port=8989

SftpBackupStorageFactory.deployPuppetModule=false
SftpBackupStorage.agentPort=8989

CdpBackupStorage.agentPort=8989
ImageStoreBackupStorage.agentPort=8989
Zabbix.port=8989

NfsPrimaryStorageKVMBackend.syncGetCapacity=true

VirtualRouterManager.agentPort=8989
VirtualRouterManager.cleanVirtualRouterVmWhenFail=true

ManagementServerConsoleProxyBackend.agentPort=8989

IscsiFileSystemBackendPrimaryStorage.agentPort=8989

BaremetalPxeServer.agentPort=8989

httpConsoleProxyPort = 8989

AppBuildSystem.agentPort=8989

Zdfs.agentPort=8989

ApiMediator.apiWorkerNum=50

unitTestOn=true
elaboration.slowThresholdMs=200
exitJVMOnStop=false

#CloudBus.closeTracker=true
#CloudBus.messageTTL=1
#CloudBus.closeTracker=true

#vmTracerOn=false
#Simulator.notCacheAgentCommand=true

ErrorFacade.dumpOnError=false

#ThreadFacade.maxThreadNum=2100

Ansible.cfg.forks=100
Ansible.cfg.host_key_checking=False
Ansible.cfg.pipelining=True

CloudBus.serverIp.0 = localhost

org.jboss.logging.provider=slf4j

exposeSimulatorType=true

Cassandra.contactPoints=127.0.0.1
Cassandra.port=9042
Cassandra.keyspace=zstack_billing
Cassandra.bin=~/apache-cassandra-2.2.3/bin/cassandra
Cassandra.cqlsh=~/apache-cassandra-2.2.3/bin/cqlsh

PrimaryStorage.capacityTrackerOn=true
shadowEntityOn=true
isThreadContextMapInheritable=true
enableElaboration=true
Prometheus.versionMode=2.x
InfluxDB.metadata.version=v2

chain.task.qos=true

identity.init.type=