Added a case for GetVmConsoleAddress
package org.zstack.test.integration.kvm.vm
-import org.springframework.http.HttpEntity
-import org.zstack.header.vm.VmInstanceState
-import org.zstack.header.vm.VmInstanceVO
-import org.zstack.kvm.KVMAgentCommands
-import org.zstack.kvm.KVMConstant
+import org.zstack.header.host.HostVO
+import org.zstack.sdk.GetVmConsoleAddressResult
import org.zstack.sdk.GetVmConsolePasswordAction
import org.zstack.sdk.SetVmConsolePasswordAction
import org.zstack.sdk.VmInstanceInventory
@@ -12,10 +9,7 @@ import org.zstack.test.integration.kvm.Env
import org.zstack.test.integration.kvm.KvmTest
import org.zstack.testlib.EnvSpec
import org.zstack.testlib.SubCase
-import org.zstack.testlib.Test
import org.zstack.testlib.VmSpec
-import org.zstack.utils.gson.JSONObjectUtil
-
/**
* Created by Camile on 2017/3/13.
*
@@ -43,7 +37,19 @@ class VmConsoleCase extends SubCase {
env.create {
testSetConsolePasswordSuccess()
testSetConsolePasswordFailure()
+ testGetVmConsoleAddressSuccess()
+ }
+ }
+
+ void testGetVmConsoleAddressSuccess() {
+ VmInstanceInventory inv = env.inventoryByName("vm")
+
+ GetVmConsoleAddressResult res = getVmConsoleAddress {
+ uuid = inv.uuid
}
+
+ assert res != null
+ assert res.hostIp == dbFindByUuid(inv.hostUuid, HostVO.class).getManagementIp()
}
void testSetConsolePasswordSuccess() {
