[jira] [Assigned] (CLOUDSTACK-7127) Fix test_regions.py script - addregion failed, Region with id: 1 already exists

2014-07-24 Thread Gaurav Aradhye (JIRA)

 [ 
https://issues.apache.org/jira/browse/CLOUDSTACK-7127?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Gaurav Aradhye reassigned CLOUDSTACK-7127:
--

Assignee: Gaurav Aradhye  (was: Ashutosk Kelkar)

> Fix test_regions.py script -  addregion failed, Region with id: 1 already 
> exists
> 
>
> Key: CLOUDSTACK-7127
> URL: https://issues.apache.org/jira/browse/CLOUDSTACK-7127
> Project: CloudStack
>  Issue Type: Test
>  Security Level: Public(Anyone can view this level - this is the 
> default.) 
>  Components: Management Server
>Affects Versions: 4.5.0
>Reporter: Chandan Purushothama
>Assignee: Gaurav Aradhye
>Priority: Critical
> Fix For: 4.5.0
>
>
> ===
> Code Snippet from test_regions.py:
> ===
>def setUp(self):
> pseudo_random_int = choice(xrange(1, 200)) <-- BUG: Region with ID=1 
> already exists on the CloudStack Setup. In case if 1 is chosen the testsuite 
> fails to execute.
> self.services["region"]["regionid"] = pseudo_random_int
> self.services["region"]["regionname"] = "region" + 
> str(pseudo_random_int)
> self.services["region"]["regionendpoint"] = "http://region"; + 
> str(pseudo_random_int) + ":8080/client"
> self.region = Region.create(self.api_client,
> self.services["region"]
> )
> Secondly, setup method code should be placed in try and catch blocks
> =
> Test Error:
> =
> Error Message:
> Execute cmd: addregion failed, due to: errorCode: 431, errorText:Region with 
> id: 1 already exists
>  >> begin captured stdout << -
> === TestName: test_createRegionWithExistingRegionName | Status : EXCEPTION ===
> - >> end captured stdout << --
>  >> begin captured logging << 
> test_createRegionWithExistingRegionName 
> (integration.component.test_regions.TestRegions): DEBUG: STARTED 
> : TC: test_createRegionWithExistingRegionName :::
> test_createRegionWithExistingRegionName 
> (integration.component.test_regions.TestRegions): DEBUG: Payload: 
> {'endpoint': 'http://region1:8080/client', 'name': 'region1', 'id': 1, 
> 'apiKey': 
> u'Ra1mlXzCZU0K1l4MKDWdRbQDU67PCQuRnKYv3hyc-Q8hSvCSFjB32UtifLbS6oYpMeKaf0BCuUidMw0LqZeCMA',
>  'command': 'addRegion', 'signature': 'jZQivyHVubuotqAzSjRPxUJmAn4=', 
> 'response': 'json'}
> test_createRegionWithExistingRegionName 
> (integration.component.test_regions.TestRegions): DEBUG: Sending GET 
> Cmd : addRegion===
> requests.packages.urllib3.connectionpool: INFO: Starting new HTTP connection 
> (1): 10.220.135.73
> requests.packages.urllib3.connectionpool: DEBUG: "GET 
> /client/api?endpoint=http%3A%2F%2Fregion1%3A8080%2Fclient&name=region1&id=1&apiKey=Ra1mlXzCZU0K1l4MKDWdRbQDU67PCQuRnKYv3hyc-Q8hSvCSFjB32UtifLbS6oYpMeKaf0BCuUidMw0LqZeCMA&command=addRegion&signature=jZQivyHVubuotqAzSjRPxUJmAn4%3D&response=json
>  HTTP/1.1" 431 123
> test_createRegionWithExistingRegionName 
> (integration.component.test_regions.TestRegions): ERROR: 
> Exception:['Traceback (most recent call last):\n', '  File 
> "/local/jenkins/workspace/xenrt-reg-basic-xs/work.64/env/local/lib/python2.7/site-packages/marvin/cloudstackConnection.py",
>  line 308, in __parseAndGetResponse\nresponse_cls)\n', '  File 
> "/local/jenkins/workspace/xenrt-reg-basic-xs/work.64/env/local/lib/python2.7/site-packages/marvin/jsonHelper.py",
>  line 150, in getResultObj\nraise 
> cloudstackException.CloudstackAPIException(respname, errMsg)\n', 
> 'CloudstackAPIException: Execute cmd: addregion failed, due to: errorCode: 
> 431, errorText:Region with id: 1 already exists\n']
> Traceback (most recent call last):
>   File 
> "/local/jenkins/workspace/xenrt-reg-basic-xs/work.64/env/local/lib/python2.7/site-packages/marvin/cloudstackConnection.py",
>  line 308, in __parseAndGetResponse
> response_cls)
>   File 
> "/local/jenkins/workspace/xenrt-reg-basic-xs/work.64/env/local/lib/python2.7/site-packages/marvin/jsonHelper.py",
>  line 150, in getResultObj
> raise cloudstackException.CloudstackAPIException(respname, errMsg)
> CloudstackAPIException: Execute cmd: addregion failed, due to: errorCode: 
> 431, errorText:Region with id: 1 already exists
> test_createRegionWithExistingRegionName 
> (integration.component.test_regions.TestRegions): ERROR: marvinRequest : 
> CmdName:  
> Exception: ['Traceback (most recent call last):\n', '  File 
> "/local/jenkins/workspace/xenrt-reg-basic-xs/work.64/env/local/lib/python2.7/site-packages/marvin/cloudstackConnection.py",
>  line 375, in marvinRequest\nraise self.__lastError\n', 
> 'CloudstackAPIException: Execute cmd: ad

[jira] [Assigned] (CLOUDSTACK-7127) Fix test_regions.py script - addregion failed, Region with id: 1 already exists

2014-07-22 Thread Ashutosk Kelkar (JIRA)

 [ 
https://issues.apache.org/jira/browse/CLOUDSTACK-7127?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Ashutosk Kelkar reassigned CLOUDSTACK-7127:
---

Assignee: Ashutosk Kelkar

> Fix test_regions.py script -  addregion failed, Region with id: 1 already 
> exists
> 
>
> Key: CLOUDSTACK-7127
> URL: https://issues.apache.org/jira/browse/CLOUDSTACK-7127
> Project: CloudStack
>  Issue Type: Test
>  Security Level: Public(Anyone can view this level - this is the 
> default.) 
>  Components: Management Server
>Affects Versions: 4.5.0
>Reporter: Chandan Purushothama
>Assignee: Ashutosk Kelkar
>Priority: Critical
> Fix For: 4.5.0
>
>
> ===
> Code Snippet from test_regions.py:
> ===
>def setUp(self):
> pseudo_random_int = choice(xrange(1, 200)) <-- BUG: Region with ID=1 
> already exists on the CloudStack Setup. In case if 1 is chosen the testsuite 
> fails to execute.
> self.services["region"]["regionid"] = pseudo_random_int
> self.services["region"]["regionname"] = "region" + 
> str(pseudo_random_int)
> self.services["region"]["regionendpoint"] = "http://region"; + 
> str(pseudo_random_int) + ":8080/client"
> self.region = Region.create(self.api_client,
> self.services["region"]
> )
> Secondly, setup method code should be placed in try and catch blocks
> =
> Test Error:
> =
> Error Message:
> Execute cmd: addregion failed, due to: errorCode: 431, errorText:Region with 
> id: 1 already exists
>  >> begin captured stdout << -
> === TestName: test_createRegionWithExistingRegionName | Status : EXCEPTION ===
> - >> end captured stdout << --
>  >> begin captured logging << 
> test_createRegionWithExistingRegionName 
> (integration.component.test_regions.TestRegions): DEBUG: STARTED 
> : TC: test_createRegionWithExistingRegionName :::
> test_createRegionWithExistingRegionName 
> (integration.component.test_regions.TestRegions): DEBUG: Payload: 
> {'endpoint': 'http://region1:8080/client', 'name': 'region1', 'id': 1, 
> 'apiKey': 
> u'Ra1mlXzCZU0K1l4MKDWdRbQDU67PCQuRnKYv3hyc-Q8hSvCSFjB32UtifLbS6oYpMeKaf0BCuUidMw0LqZeCMA',
>  'command': 'addRegion', 'signature': 'jZQivyHVubuotqAzSjRPxUJmAn4=', 
> 'response': 'json'}
> test_createRegionWithExistingRegionName 
> (integration.component.test_regions.TestRegions): DEBUG: Sending GET 
> Cmd : addRegion===
> requests.packages.urllib3.connectionpool: INFO: Starting new HTTP connection 
> (1): 10.220.135.73
> requests.packages.urllib3.connectionpool: DEBUG: "GET 
> /client/api?endpoint=http%3A%2F%2Fregion1%3A8080%2Fclient&name=region1&id=1&apiKey=Ra1mlXzCZU0K1l4MKDWdRbQDU67PCQuRnKYv3hyc-Q8hSvCSFjB32UtifLbS6oYpMeKaf0BCuUidMw0LqZeCMA&command=addRegion&signature=jZQivyHVubuotqAzSjRPxUJmAn4%3D&response=json
>  HTTP/1.1" 431 123
> test_createRegionWithExistingRegionName 
> (integration.component.test_regions.TestRegions): ERROR: 
> Exception:['Traceback (most recent call last):\n', '  File 
> "/local/jenkins/workspace/xenrt-reg-basic-xs/work.64/env/local/lib/python2.7/site-packages/marvin/cloudstackConnection.py",
>  line 308, in __parseAndGetResponse\nresponse_cls)\n', '  File 
> "/local/jenkins/workspace/xenrt-reg-basic-xs/work.64/env/local/lib/python2.7/site-packages/marvin/jsonHelper.py",
>  line 150, in getResultObj\nraise 
> cloudstackException.CloudstackAPIException(respname, errMsg)\n', 
> 'CloudstackAPIException: Execute cmd: addregion failed, due to: errorCode: 
> 431, errorText:Region with id: 1 already exists\n']
> Traceback (most recent call last):
>   File 
> "/local/jenkins/workspace/xenrt-reg-basic-xs/work.64/env/local/lib/python2.7/site-packages/marvin/cloudstackConnection.py",
>  line 308, in __parseAndGetResponse
> response_cls)
>   File 
> "/local/jenkins/workspace/xenrt-reg-basic-xs/work.64/env/local/lib/python2.7/site-packages/marvin/jsonHelper.py",
>  line 150, in getResultObj
> raise cloudstackException.CloudstackAPIException(respname, errMsg)
> CloudstackAPIException: Execute cmd: addregion failed, due to: errorCode: 
> 431, errorText:Region with id: 1 already exists
> test_createRegionWithExistingRegionName 
> (integration.component.test_regions.TestRegions): ERROR: marvinRequest : 
> CmdName:  
> Exception: ['Traceback (most recent call last):\n', '  File 
> "/local/jenkins/workspace/xenrt-reg-basic-xs/work.64/env/local/lib/python2.7/site-packages/marvin/cloudstackConnection.py",
>  line 375, in marvinRequest\nraise self.__lastError\n', 
> 'CloudstackAPIException: Execute cmd: addregion failed, due