Chandan Purushothama created CLOUDSTACK-7434:
------------------------------------------------

             Summary: [Automation] Fix the script "test_custom_hostname.py" - 
Internal name comparision appears to be wrong
                 Key: CLOUDSTACK-7434
                 URL: https://issues.apache.org/jira/browse/CLOUDSTACK-7434
             Project: CloudStack
          Issue Type: Test
      Security Level: Public (Anyone can view this level - this is the default.)
          Components: Automation, Test
    Affects Versions: 4.5.0
            Reporter: Chandan Purushothama
            Priority: Critical
             Fix For: 4.5.0


============================
Error Log from the client results info:
============================

requests.packages.urllib3.connectionpool: INFO: Starting new HTTP connection 
(1): 10.220.135.69
requests.packages.urllib3.connectionpool: DEBUG: "GET 
/client/api?apiKey=YuaraAK9l9g2KJCAw3APnrD2aNpVmhAesCvWFxlDvGCb0NcARH_sKQxfRM6WF-SCAxikI8awlxCrmw010lUFzg&response=json&command=listVirtualMachines&signature=J07ySQE7LwJA%2FYsOK4ouiEPsM7Y%3D&id=6548a12c-b999-495b-83bc-b928dcee99eb&listall=True
 HTTP/1.1" 200 1645
test_01_user_provided_hostname 
(integration.component.test_custom_hostname.TestInstanceNameFlagTrue): DEBUG: 
Response : [{domain : u'ROOT', domainid : 
u'56ab18f0-2b4d-11e4-89bd-1e5d0e053e75', haenable : False, templatename : 
u'CentOS 5.6(64-bit) no GUI (XenServer)', securitygroup : [], zoneid : 
u'eb811e7d-59d4-4c72-a965-80d9e30572d1', cpunumber : 1, ostypeid : 142, 
passwordenabled : False, instancename : u'i-220-406-VM', id : 
u'6548a12c-b999-495b-83bc-b928dcee99eb', hostname : u'cl09-B-02', displayvm : 
True, state : u'Running', guestosid : u'56bf8060-2b4d-11e4-89bd-1e5d0e053e75', 
details : {hypervisortoolsversion : u'xenserver56'}, memory : 128, 
serviceofferingid : u'27fc8179-da86-419e-99dd-f438e7b91c63', zonename : 
u'XenRT-Zone-0', isdynamicallyscalable : True, displayname : u'TestVM', tags : 
[], nic : [{networkid : u'435fb179-7868-48bd-bfb7-0efa86ee93ef', macaddress : 
u'02:00:56:8b:00:01', isolationuri : u'vlan://3074', type : u'Isolated', 
broadcasturi : u'vlan://3074', traffictype : u'Guest', netmask : 
u'255.255.255.0', ipaddress : u'192.168.200.171', id : 
u'95c36dd9-31e7-4be1-899b-20d5a36bf322', networkname : 
u'test-TestInstanceNameFlagTrue-test_01_custom_hostname_instancename_false-AWTN42-network',
 gateway : u'192.168.200.1', isdefault : True}], cpuspeed : 100, templateid : 
u'56af8f20-2b4d-11e4-89bd-1e5d0e053e75', affinitygroup : [], account : 
u'test-TestInstanceNameFlagTrue-test_01_custom_hostname_instancename_false-AWTN42',
 hostid : u'1065d9b2-260a-4642-bffe-b2523db3d798', name : 
u'VM-6548a12c-b999-495b-83bc-b928dcee99eb', created : 
u'2014-08-24T09:17:35+0000', hypervisor : u'XenServer', rootdevicetype : 
u'ROOT', rootdeviceid : 0, serviceofferingname : u'Tiny Instance', 
templatedisplaytext : u'CentOS 5.6(64-bit) no GUI (XenServer)'}]
test_01_user_provided_hostname 
(integration.component.test_custom_hostname.TestInstanceNameFlagTrue): DEBUG: 
vm.displayname: TestVM, original: TestVM
test_01_user_provided_hostname 
(integration.component.test_custom_hostname.TestInstanceNameFlagTrue): DEBUG: 
select id from account where uuid = 'd7313bc7-14ce-4df1-8949-f70c542e98a4';
test_01_user_provided_hostname 
(integration.component.test_custom_hostname.TestInstanceNameFlagTrue): DEBUG: 
select id from vm_instance where uuid = '6548a12c-b999-495b-83bc-b928dcee99eb';
test_01_user_provided_hostname 
(integration.component.test_custom_hostname.TestInstanceNameFlagTrue): DEBUG: 
Query result: 406
test_01_user_provided_hostname 
(integration.component.test_custom_hostname.TestInstanceNameFlagTrue): DEBUG: 
Internal name: i-220-406-TestVM
test_01_user_provided_hostname 
(integration.component.test_custom_hostname.TestInstanceNameFlagTrue): 
CRITICAL: FAILED: test_01_user_provided_hostname: ['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_custom_hostname.py", line 
289, in test_01_user_provided_hostname\n    "VM internal name should match with 
that of the format"\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 927, in assertMultiLineEqual\n    
self.fail(self._formatMessage(msg, standardMsg))\n', '  File 
"/usr/lib/python2.7/unittest/case.py", line 413, in fail\n    raise 
self.failureException(msg)\n', 'AssertionError: VM internal name should match 
with that of the format\n']
--------------------- >> end captured logging << ---------------------

======================================================================
FAIL: @Desc: Test whether cloudstack allows duplicate vm instance names in the 
diff networks
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/root/cloudstack/test/integration/component/test_custom_hostname.py", 
line 332, in test_vm_instance_name_duplicate_different_accounts
    self.cleanup.append(vm2)
AssertionError: Exception not raised
-------------------- >> begin captured stdout << ---------------------
=== TestName: test_vm_instance_name_duplicate_different_accounts | Status : 
FAILED ===

In the code mentioned below. I am not sure why internal name ends with the 
display name. 

{code}
        #internal Name = i-<user ID>-<VM ID>-Display name
        internal_name = "i-" + str(account_id) + "-" + str(vmid) + "-" + 
vm.displayname
        self.debug("Internal name: %s" % internal_name)
        self.assertEqual(
                        vm.instancename,
                        internal_name,
                        "VM internal name should match with that of the format"
                        )
        return
{code}

AFAIK, it ends with "instance.name" value specified in the global 
configurations. *Note:* After setting instance.name, the value doesnt get used 
until the management server is restarted.



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

Reply via email to