mirror of
https://github.com/apache/cloudstack.git
synced 2025-12-16 10:32:34 +01:00
testClient: add timestamp for sync job
This commit is contained in:
parent
c8dafa8628
commit
db8341bb35
@ -5,6 +5,7 @@ import Queue
|
|||||||
import copy
|
import copy
|
||||||
import sys
|
import sys
|
||||||
import jsonHelper
|
import jsonHelper
|
||||||
|
import datetime
|
||||||
|
|
||||||
class job(object):
|
class job(object):
|
||||||
def __init__(self):
|
def __init__(self):
|
||||||
@ -52,11 +53,12 @@ class workThread(threading.Thread):
|
|||||||
self.lock.acquire()
|
self.lock.acquire()
|
||||||
|
|
||||||
if cmd.isAsync == "false":
|
if cmd.isAsync == "false":
|
||||||
jobstatus.startTime = time.time()
|
jobstatus.startTime = datetime.datetime.now()
|
||||||
|
|
||||||
result = self.connection.make_request(cmd)
|
result = self.connection.make_request(cmd)
|
||||||
jobstatus.result = result
|
jobstatus.result = result
|
||||||
jobstatus.endTime = time.time()
|
jobstatus.endTime = datetime.datetime.now()
|
||||||
|
jobstatus.duration = time.mktime(jobstatus.endTime.timetuple()) - time.mktime(jobstatus.startTime.timetuple())
|
||||||
else:
|
else:
|
||||||
result = self.connection.make_request(cmd, None, True)
|
result = self.connection.make_request(cmd, None, True)
|
||||||
if result is None:
|
if result is None:
|
||||||
|
|||||||
@ -1,7 +1,7 @@
|
|||||||
from cloudstackTestCase import *
|
from cloudstackTestCase import *
|
||||||
|
|
||||||
class TestCase1(cloudstackTestCase):
|
class TestCase1(cloudstackTestCase):
|
||||||
@unittest.skip("demonstrating skipping")
|
|
||||||
def test_cloudstackapi(self):
|
def test_cloudstackapi(self):
|
||||||
apiClient = self.testClient.getApiClient()
|
apiClient = self.testClient.getApiClient()
|
||||||
listtmcmd = listTemplates.listTemplatesCmd()
|
listtmcmd = listTemplates.listTemplatesCmd()
|
||||||
|
|||||||
@ -18,7 +18,6 @@ class TestCase2(cloudstackTestCase):
|
|||||||
listVMresponse = asyncJobResult[0].result
|
listVMresponse = asyncJobResult[0].result
|
||||||
self.debug("Total Number of Hosts: " + str(len(listVMresponse)))
|
self.debug("Total Number of Hosts: " + str(len(listVMresponse)))
|
||||||
|
|
||||||
'''
|
for i in listVMresponse:
|
||||||
for i in listhostresponse:
|
self.debug("id: " + str(i.id) +" pod id: " + str(i.podid) +" host tag: " + str(i.hosttags))
|
||||||
self.debug("id: " + i.id +" pod id: " + i.podid +" host tag: " + i.hosttags)
|
|
||||||
'''
|
|
||||||
@ -26,7 +26,6 @@ class TestCase1(cloudstackTestCase):
|
|||||||
self.zoneId = tmpl.zoneid
|
self.zoneId = tmpl.zoneid
|
||||||
break
|
break
|
||||||
|
|
||||||
@unittest.skip("demonstrating skipping")
|
|
||||||
def test_cloudstackapi(self):
|
def test_cloudstackapi(self):
|
||||||
apiClient = self.testClient.getApiClient()
|
apiClient = self.testClient.getApiClient()
|
||||||
|
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user