mirror of
https://github.com/apache/cloudstack.git
synced 2025-12-15 18:12:35 +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 sys
|
||||
import jsonHelper
|
||||
import datetime
|
||||
|
||||
class job(object):
|
||||
def __init__(self):
|
||||
@ -52,11 +53,12 @@ class workThread(threading.Thread):
|
||||
self.lock.acquire()
|
||||
|
||||
if cmd.isAsync == "false":
|
||||
jobstatus.startTime = time.time()
|
||||
jobstatus.startTime = datetime.datetime.now()
|
||||
|
||||
result = self.connection.make_request(cmd)
|
||||
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:
|
||||
result = self.connection.make_request(cmd, None, True)
|
||||
if result is None:
|
||||
|
||||
@ -1,7 +1,7 @@
|
||||
from cloudstackTestCase import *
|
||||
|
||||
class TestCase1(cloudstackTestCase):
|
||||
@unittest.skip("demonstrating skipping")
|
||||
|
||||
def test_cloudstackapi(self):
|
||||
apiClient = self.testClient.getApiClient()
|
||||
listtmcmd = listTemplates.listTemplatesCmd()
|
||||
|
||||
@ -18,7 +18,6 @@ class TestCase2(cloudstackTestCase):
|
||||
listVMresponse = asyncJobResult[0].result
|
||||
self.debug("Total Number of Hosts: " + str(len(listVMresponse)))
|
||||
|
||||
'''
|
||||
for i in listhostresponse:
|
||||
self.debug("id: " + i.id +" pod id: " + i.podid +" host tag: " + i.hosttags)
|
||||
'''
|
||||
for i in listVMresponse:
|
||||
self.debug("id: " + str(i.id) +" pod id: " + str(i.podid) +" host tag: " + str(i.hosttags))
|
||||
|
||||
@ -26,7 +26,6 @@ class TestCase1(cloudstackTestCase):
|
||||
self.zoneId = tmpl.zoneid
|
||||
break
|
||||
|
||||
@unittest.skip("demonstrating skipping")
|
||||
def test_cloudstackapi(self):
|
||||
apiClient = self.testClient.getApiClient()
|
||||
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user