Chandan Purushothama created CLOUDSTACK-7440: ------------------------------------------------
Summary: [Automation] Fix the script "test_usage.py" - Template is registered as admin's Key: CLOUDSTACK-7440 URL: https://issues.apache.org/jira/browse/CLOUDSTACK-7440 Project: CloudStack Issue Type: Test Security Level: Public (Anyone can view this level - this is the default.) Reporter: Chandan Purushothama Priority: Critical Template got registered as admin's . Hence the event belongs to the admin. Please correct the template registration part of the code. client log info: {code} requests.packages.urllib3.connectionpool: INFO: Starting new HTTP connection (1): 10.220.135.69 requests.packages.urllib3.connectionpool: DEBUG: "GET /client/api?jobid=4df356b8-bc11-4536-a396-2fb81f682aa4&apiKey=YuaraAK9l9g2KJCAw3APnrD2aNpVmhAesCvWFxlDvGCb0NcARH_sKQxfRM6WF-SCAxikI8awlxCrmw010lUFzg&command=queryAsyncJobResult&response=json&signature=x%2B20vHzmuIb%2BanPRk0EoGtgYm0c%3D HTTP/1.1" 200 1325 test_01_template_usage (integration.component.test_usage.TestTemplateUsage): DEBUG: Response : {jobprocstatus : 0, created : u'2014-08-24T16:18:58+0000', jobresult : {domain : u'ROOT', domainid : u'56ab18f0-2b4d-11e4-89bd-1e5d0e053e75', ostypename : u'CentOS 5.3 (64-bit)', zoneid : u'eb811e7d-59d4-4c72-a965-80d9e30572d1', displaytext : u'Template', ostypeid : u'56b1e2f2-2b4d-11e4-89bd-1e5d0e053e75', passwordenabled : False, id : u'cba11332-8bd9-40a4-bb90-79a47ee170fd', size : 21474836480, isready : True, format : u'VHD', templatetype : u'USER', details : {platform : u'viridian:true;acpi:1;apic:true;pae:true;nx:true', Message.ReservedCapacityFreed.Flag : u'false'}, zonename : u'XenRT-Zone-0', status : u'Download Complete', isdynamicallyscalable : False, tags : [], isfeatured : False, sshkeyenabled : False, account : u'admin', isextractable : True, crossZones : False, sourcetemplateid : u'56af8f20-2b4d-11e4-89bd-1e5d0e053e75', name : u'Template-RJQEXI', created : u'2014-08-24T16:18:58+0000', hypervisor : u'XenServer', ispublic : False}, cmd : u'org.apache.cloudstack.api.command.admin.template.CreateTemplateCmdByAdmin', userid : u'77df13d2-2b4d-11e4-89bd-1e5d0e053e75', jobstatus : 1, jobid : u'4df356b8-bc11-4536-a396-2fb81f682aa4', jobresultcode : 0, jobinstanceid : u'cba11332-8bd9-40a4-bb90-79a47ee170fd', jobresulttype : u'object', jobinstancetype : u'Template', accountid : u'77df055e-2b4d-11e4-89bd-1e5d0e053e75'} test_01_template_usage (integration.component.test_usage.TestTemplateUsage): DEBUG: ===Jobid:4df356b8-bc11-4536-a396-2fb81f682aa4 ; StartTime:Sun Aug 24 16:18:58 2014 ; EndTime:Sun Aug 24 16:23:40 2014 ; TotalTime:-281=== test_01_template_usage (integration.component.test_usage.TestTemplateUsage): DEBUG: Response : {jobprocstatus : 0, created : u'2014-08-24T16:18:58+0000', jobresult : {domain : u'ROOT', domainid : u'56ab18f0-2b4d-11e4-89bd-1e5d0e053e75', ostypename : u'CentOS 5.3 (64-bit)', zoneid : u'eb811e7d-59d4-4c72-a965-80d9e30572d1', displaytext : u'Template', ostypeid : u'56b1e2f2-2b4d-11e4-89bd-1e5d0e053e75', passwordenabled : False, id : u'cba11332-8bd9-40a4-bb90-79a47ee170fd', size : 21474836480, isready : True, format : u'VHD', templatetype : u'USER', details : {platform : u'viridian:true;acpi:1;apic:true;pae:true;nx:true', Message.ReservedCapacityFreed.Flag : u'false'}, zonename : u'XenRT-Zone-0', status : u'Download Complete', isdynamicallyscalable : False, tags : [], isfeatured : False, sshkeyenabled : False, account : u'admin', isextractable : True, crossZones : False, sourcetemplateid : u'56af8f20-2b4d-11e4-89bd-1e5d0e053e75', name : u'Template-RJQEXI', created : u'2014-08-24T16:18:58+0000', hypervisor : u'XenServer', ispublic : False}, cmd : u'org.apache.cloudstack.api.command.admin.template.CreateTemplateCmdByAdmin', userid : u'77df13d2-2b4d-11e4-89bd-1e5d0e053e75', jobstatus : 1, jobid : u'4df356b8-bc11-4536-a396-2fb81f682aa4', jobresultcode : 0, jobinstanceid : u'cba11332-8bd9-40a4-bb90-79a47ee170fd', jobresulttype : u'object', jobinstancetype : u'Template', accountid : u'77df055e-2b4d-11e4-89bd-1e5d0e053e75'} test_01_template_usage (integration.component.test_usage.TestTemplateUsage): DEBUG: Created template with ID: cba11332-8bd9-40a4-bb90-79a47ee170fd test_01_template_usage (integration.component.test_usage.TestTemplateUsage): DEBUG: Payload: {'signature': 'uZXZ8Emles1zD9O5Z8AKkcKON0g=', 'apiKey': u'YuaraAK9l9g2KJCAw3APnrD2aNpVmhAesCvWFxlDvGCb0NcARH_sKQxfRM6WF-SCAxikI8awlxCrmw010lUFzg', 'command': 'deleteTemplate', 'id': u'cba11332-8bd9-40a4-bb90-79a47ee170fd', 'response': 'json'} test_01_template_usage (integration.component.test_usage.TestTemplateUsage): DEBUG: ========Sending GET Cmd : deleteTemplate======= requests.packages.urllib3.connectionpool: INFO: Starting new HTTP connection (1): 10.220.135.69 requests.packages.urllib3.connectionpool: DEBUG: "GET /client/api?response=json&apiKey=YuaraAK9l9g2KJCAw3APnrD2aNpVmhAesCvWFxlDvGCb0NcARH_sKQxfRM6WF-SCAxikI8awlxCrmw010lUFzg&command=deleteTemplate&id=cba11332-8bd9-40a4-bb90-79a47ee170fd&signature=uZXZ8Emles1zD9O5Z8AKkcKON0g%3D HTTP/1.1" 200 79 test_01_template_usage (integration.component.test_usage.TestTemplateUsage): DEBUG: === Jobid: 83a2fedd-60ef-487a-a41d-8d59e4c7452f Started === test_01_template_usage (integration.component.test_usage.TestTemplateUsage): DEBUG: Payload: {'signature': 'kA2P6AoLsE8hVaJX3H4+dinfl8E=', 'apiKey': u'YuaraAK9l9g2KJCAw3APnrD2aNpVmhAesCvWFxlDvGCb0NcARH_sKQxfRM6WF-SCAxikI8awlxCrmw010lUFzg', 'command': 'queryAsyncJobResult', 'response': 'json', 'jobid': u'83a2fedd-60ef-487a-a41d-8d59e4c7452f'} test_01_template_usage (integration.component.test_usage.TestTemplateUsage): DEBUG: ========Sending GET Cmd : queryAsyncJobResult======= requests.packages.urllib3.connectionpool: INFO: Starting new HTTP connection (1): 10.220.135.69 requests.packages.urllib3.connectionpool: DEBUG: "GET /client/api?jobid=83a2fedd-60ef-487a-a41d-8d59e4c7452f&apiKey=YuaraAK9l9g2KJCAw3APnrD2aNpVmhAesCvWFxlDvGCb0NcARH_sKQxfRM6WF-SCAxikI8awlxCrmw010lUFzg&command=queryAsyncJobResult&response=json&signature=kA2P6AoLsE8hVaJX3H4%2Bdinfl8E%3D HTTP/1.1" 200 428 test_01_template_usage (integration.component.test_usage.TestTemplateUsage): DEBUG: Response : {jobprocstatus : 0, created : u'2014-08-24T16:23:40+0000', cmd : u'org.apache.cloudstack.api.command.user.template.DeleteTemplateCmd', userid : u'77df13d2-2b4d-11e4-89bd-1e5d0e053e75', jobstatus : 0, jobid : u'83a2fedd-60ef-487a-a41d-8d59e4c7452f', jobresultcode : 0, jobinstanceid : u'cba11332-8bd9-40a4-bb90-79a47ee170fd', jobinstancetype : u'Template', accountid : u'77df055e-2b4d-11e4-89bd-1e5d0e053e75'} test_01_template_usage (integration.component.test_usage.TestTemplateUsage): DEBUG: === JobId:83a2fedd-60ef-487a-a41d-8d59e4c7452f is Still Processing, Will TimeOut in:3595 ==== test_01_template_usage (integration.component.test_usage.TestTemplateUsage): DEBUG: Payload: {'signature': 'kA2P6AoLsE8hVaJX3H4+dinfl8E=', 'apiKey': u'YuaraAK9l9g2KJCAw3APnrD2aNpVmhAesCvWFxlDvGCb0NcARH_sKQxfRM6WF-SCAxikI8awlxCrmw010lUFzg', 'command': 'queryAsyncJobResult', 'response': 'json', 'jobid': u'83a2fedd-60ef-487a-a41d-8d59e4c7452f'} test_01_template_usage (integration.component.test_usage.TestTemplateUsage): DEBUG: ========Sending GET Cmd : queryAsyncJobResult======= requests.packages.urllib3.connectionpool: INFO: Starting new HTTP connection (1): 10.220.135.69 requests.packages.urllib3.connectionpool: DEBUG: "GET /client/api?jobid=83a2fedd-60ef-487a-a41d-8d59e4c7452f&apiKey=YuaraAK9l9g2KJCAw3APnrD2aNpVmhAesCvWFxlDvGCb0NcARH_sKQxfRM6WF-SCAxikI8awlxCrmw010lUFzg&command=queryAsyncJobResult&response=json&signature=kA2P6AoLsE8hVaJX3H4%2Bdinfl8E%3D HTTP/1.1" 200 482 test_01_template_usage (integration.component.test_usage.TestTemplateUsage): DEBUG: Response : {jobprocstatus : 0, created : u'2014-08-24T16:23:40+0000', jobresult : {success : True}, cmd : u'org.apache.cloudstack.api.command.user.template.DeleteTemplateCmd', userid : u'77df13d2-2b4d-11e4-89bd-1e5d0e053e75', jobstatus : 1, jobid : u'83a2fedd-60ef-487a-a41d-8d59e4c7452f', jobresultcode : 0, jobinstanceid : u'cba11332-8bd9-40a4-bb90-79a47ee170fd', jobresulttype : u'object', jobinstancetype : u'Template', accountid : u'77df055e-2b4d-11e4-89bd-1e5d0e053e75'} test_01_template_usage (integration.component.test_usage.TestTemplateUsage): DEBUG: ===Jobid:83a2fedd-60ef-487a-a41d-8d59e4c7452f ; StartTime:Sun Aug 24 16:23:40 2014 ; EndTime:Sun Aug 24 16:23:45 2014 ; TotalTime:-5=== test_01_template_usage (integration.component.test_usage.TestTemplateUsage): DEBUG: Response : {jobprocstatus : 0, created : u'2014-08-24T16:23:40+0000', jobresult : {success : True}, cmd : u'org.apache.cloudstack.api.command.user.template.DeleteTemplateCmd', userid : u'77df13d2-2b4d-11e4-89bd-1e5d0e053e75', jobstatus : 1, jobid : u'83a2fedd-60ef-487a-a41d-8d59e4c7452f', jobresultcode : 0, jobinstanceid : u'cba11332-8bd9-40a4-bb90-79a47ee170fd', jobresulttype : u'object', jobinstancetype : u'Template', accountid : u'77df055e-2b4d-11e4-89bd-1e5d0e053e75'} test_01_template_usage (integration.component.test_usage.TestTemplateUsage): DEBUG: Deleted template with ID: cba11332-8bd9-40a4-bb90-79a47ee170fd test_01_template_usage (integration.component.test_usage.TestTemplateUsage): DEBUG: select id from account where uuid = '0052a96a-8cee-4ca6-826a-3d27cafe2e48'; test_01_template_usage (integration.component.test_usage.TestTemplateUsage): DEBUG: select type from usage_event where account_id = '500'; test_01_template_usage (integration.component.test_usage.TestTemplateUsage): DEBUG: Query result: [(u'VOLUME.CREATE',), (u'VM.CREATE',), (u'NET.IPASSIGN',), (u'NETWORK.OFFERING.ASSIGN',), (u'VM.START',), (u'NET.IPASSIGN',), (u'NET.RULEADD',), (u'VM.STOP',), (u'NETWORK.OFFERING.REMOVE',)] test_01_template_usage (integration.component.test_usage.TestTemplateUsage): CRITICAL: FAILED: test_01_template_usage: ['Traceback (most recent call last):\n', ' File "/usr/lib/python2.7/unittest/case.py", line 332, in run\n testMethod()\n', ' File "/root/cloudstack/test/integration/component/test_usage.py", line 802, in test_01_template_usage\n "Check TEMPLATE.CREATE event in events table"\n', ' File "/usr/lib/python2.7/unittest/case.py", line 516, in assertEqual\n assertion_func(first, second, msg=msg)\n', ' File "/usr/lib/python2.7/unittest/case.py", line 509, in _baseAssertEqual\n raise self.failureException(msg)\n', 'AssertionError: Check TEMPLATE.CREATE event in events table\n'] --------------------- >> end captured logging << --------------------- {code} *Error Message* Check TEMPLATE.CREATE event in events table Logs available at http://xenrt.hq.xensource.com/control/queue.cgi?action=testlogs&id=804076&phase=Parallel&test=usage *Stacktrace* File "/usr/lib/python2.7/unittest/case.py", line 332, in run testMethod() File "/root/cloudstack/test/integration/component/test_usage.py", line 802, in test_01_template_usage "Check TEMPLATE.CREATE event in events table" File "/usr/lib/python2.7/unittest/case.py", line 516, in assertEqual assertion_func(first, second, msg=msg) File "/usr/lib/python2.7/unittest/case.py", line 509, in _baseAssertEqual raise self.failureException(msg) 'Check TEMPLATE.CREATE event in events table\n Logs available at http://xenrt.hq.xensource.com/control/queue.cgi?action=testlogs&id=804076&phase=Parallel&test=usage -- This message was sent by Atlassian JIRA (v6.2#6252)