Chandan Purushothama created CLOUDSTACK-7367:
------------------------------------------------

             Summary: [Automation] Fix the script "test_add_remove_network.py" 
- Listing VM after VM's deletion doesnt show VM in the list
                 Key: CLOUDSTACK-7367
                 URL: https://issues.apache.org/jira/browse/CLOUDSTACK-7367
             Project: CloudStack
          Issue Type: Bug
      Security Level: Public (Anyone can view this level - this is the default.)
          Components: Automation, Test
    Affects Versions: 4.5.0
            Reporter: Chandan Purushothama
             Fix For: 4.5.0




*Test Client Error Stack Trace:*

{
---------------------------------------------------------------------------------------------------
FAIL: update default nic of vm when vm is state is not Running or Stopped
---------------------------------------------------------------------------------------------------
Traceback (most recent call last):
  File "/home/chandan/test_add_remove_network.py", line 1777, in 
test_23_update_nic_incorrect_vm_state
    vm_list_validation_result[2])
AssertionError: vm list validation failed due to INVALID INPUT
-------------------- >> begin captured stdout << ---------------------
=== TestName: test_23_update_nic_incorrect_vm_state | Status : FAILED ===
}

*Root Cause Analysis:*

*From the results log of Marvin Run, Observe the highlighted line in the log:*

{
test_23_update_nic_incorrect_vm_state 
(test_add_remove_network.TestFailureScenariosUpdateVirtualMachineNIC): DEBUG: 
========Sending GET Cmd : queryAsyncJobResult=======
requests.packages.urllib3.connectionpool: INFO: Starting new HTTP connection 
(1): 10.223.130.79
requests.packages.urllib3.connectionpool: DEBUG: "GET 
/client/api?jobid=2dabf6ab-e871-48ea-a6c8-ef1862dc4f5d&apiKey=ZI83p8k86jxdFO75d5mjeU5qvLiMvSK2tUnhcSfQc2TDbIJWI4MuvF1w0SkSZ3RB-pykb4VhQaLUVhq6apOqog&command=queryAsyncJobResult&response=json&signature=FK3sso3aJJvft%2BLJUoqXGRwohAk%3D
 HTTP/1.1" 200 536
test_23_update_nic_incorrect_vm_state 
(test_add_remove_network.TestFailureScenariosUpdateVirtualMachineNIC): DEBUG: 
Response : {jobprocstatus : 0, created : u'2014-08-12T19:01:14-0700', jobresult 
: {affinitygroup : [], nic : [], securitygroup : [], tags : []}, cmd : 
u'org.apache.cloudstack.api.command.admin.vm.DestroyVMCmdByAdmin', userid : 
u'89a9018a-12a8-11e4-b75e-06098c000757', jobstatus : 1, jobid : 
u'2dabf6ab-e871-48ea-a6c8-ef1862dc4f5d', jobresultcode : 0, jobinstanceid : 
u'e6953bc0-14b0-4b01-8e10-9174964f4892', jobresulttype : u'object', 
jobinstancetype : u'VirtualMachine', accountid : 
u'89a8f4e2-12a8-11e4-b75e-06098c000757'}
test_23_update_nic_incorrect_vm_state 
(test_add_remove_network.TestFailureScenariosUpdateVirtualMachineNIC): DEBUG: 
===Jobid:2dabf6ab-e871-48ea-a6c8-ef1862dc4f5d ; StartTime:Tue Aug 12 18:40:12 
2014 ; EndTime:Tue Aug 12 18:41:08 2014 ; TotalTime:-55===
test_23_update_nic_incorrect_vm_state 
(test_add_remove_network.TestFailureScenariosUpdateVirtualMachineNIC): DEBUG: 
Response : {jobprocstatus : 0, created : u'2014-08-12T19:01:14-0700', jobresult 
: {affinitygroup : [], nic : [], securitygroup : [], tags : []}, cmd : 
u'org.apache.cloudstack.api.command.admin.vm.DestroyVMCmdByAdmin', userid : 
u'89a9018a-12a8-11e4-b75e-06098c000757', jobstatus : 1, jobid : 
u'2dabf6ab-e871-48ea-a6c8-ef1862dc4f5d', jobresultcode : 0, jobinstanceid : 
u'e6953bc0-14b0-4b01-8e10-9174964f4892', jobresulttype : u'object', 
jobinstancetype : u'VirtualMachine', accountid : 
u'89a8f4e2-12a8-11e4-b75e-06098c000757'}
test_23_update_nic_incorrect_vm_state 
(test_add_remove_network.TestFailureScenariosUpdateVirtualMachineNIC): DEBUG: 
Payload: {'apiKey': 
u'ZI83p8k86jxdFO75d5mjeU5qvLiMvSK2tUnhcSfQc2TDbIJWI4MuvF1w0SkSZ3RB-pykb4VhQaLUVhq6apOqog',
 'id': u'e6953bc0-14b0-4b01-8e10-9174964f4892', 'response': 'json', 'command': 
'listVirtualMachines', 'signature': 'hBKJs25V40Y/ocF51bJ4MvRvEik='}
test_23_update_nic_incorrect_vm_state 
(test_add_remove_network.TestFailureScenariosUpdateVirtualMachineNIC): DEBUG: 
========Sending GET Cmd : listVirtualMachines=======
requests.packages.urllib3.connectionpool: INFO: Starting new HTTP connection 
(1): 10.223.130.79
requests.packages.urllib3.connectionpool: DEBUG: "GET 
/client/api?signature=hBKJs25V40Y%2FocF51bJ4MvRvEik%3D&apiKey=ZI83p8k86jxdFO75d5mjeU5qvLiMvSK2tUnhcSfQc2TDbIJWI4MuvF1w0SkSZ3RB-pykb4VhQaLUVhq6apOqog&command=listVirtualMachines&id=e6953bc0-14b0-4b01-8e10-9174964f4892&response=json
 HTTP/1.1" 200 39
test_23_update_nic_incorrect_vm_state 
*(test_add_remove_network.TestFailureScenariosUpdateVirtualMachineNIC): DEBUG: 
Response : None*
test_23_update_nic_incorrect_vm_state 
(test_add_remove_network.TestFailureScenariosUpdateVirtualMachineNIC): 
CRITICAL: FAILED: test_23_update_nic_incorrect_vm_state: ['Traceback (most 
recent call last):\n', '  File "/usr/lib64/python2.7/unittest/case.py", line 
318, in run\n    testMethod()\n', '  File 
"/home/chandan/test_add_remove_network.py", line 1777, in 
test_23_update_nic_incorrect_vm_state\n    vm_list_validation_result[2])\n', '  
File "/usr/lib64/python2.7/unittest/case.py", line 494, in assertEqual\n    
assertion_func(first, second, msg=msg)\n', '  File 
"/usr/lib64/python2.7/unittest/case.py", line 487, in _baseAssertEqual\n    
raise self.failureException(msg)\n', 'AssertionError: vm list validation failed 
due to INVALID INPUT\n']
--------------------- >> end captured logging << ---------------------
}

*From the test_add_remove_network.py script, Observe the highlighted code 
sections:*

{
    def test_23_update_nic_incorrect_vm_state(self):
        """update default nic of vm when vm is state is not Running or 
Stopped"""
.
.
.
        self.debug("Destroying VM %s" % virtual_machine.id)
        *virtual_machine.delete(self.apiclient)*
        vm_list = list_virtual_machines(self.apiclient, id=virtual_machine.id)
        vm_list_validation_result = validateList(vm_list)

        *self.assertEqual(vm_list_validation_result[0], PASS, "vm list 
validation failed due to %s" %
                         vm_list_validation_result[2])*
}




--
This message was sent by Atlassian JIRA
(v6.2#6252)

Reply via email to