Skip to content

Commit ff1ce07

Browse files
committed
Merge pull request apache#728 from shwetaag/attach_iso
CLOUDSTACK-8756:Incorrect guest os mapping in CCP 4.2.1-6 for CentOS 5.9Check the bug 8756 for more details * pr/728: CLOUDSTACK-8756:Incorrect guest os mapping in CCP 4.2.1-6 for CentOS 5.9 Signed-off-by: Rajani Karuturi <rajani.karuturi@citrix.com>
2 parents adfa9c0 + bbdb478 commit ff1ce07

2 files changed

Lines changed: 75 additions & 1 deletion

File tree

‎test/integration/component/test_escalations_vmware.py‎

Lines changed: 66 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,12 +27,13 @@
2727
DiskOffering,
2828
Template,
2929
listConfigurations)
30-
from marvin.lib.common import (get_domain,
30+
from marvin.lib.common import (get_domain,list_isos,
3131
get_zone,
3232
get_template)
3333
from nose.plugins.attrib import attr
3434
from ast import literal_eval
3535
from marvin.codes import PASS
36+
from marvin.cloudstackException import CloudstackAPIException
3637

3738
class TestVMware(cloudstackTestCase):
3839

@@ -203,3 +204,67 @@ def test1_attach_volume_ide(self):
203204
self.fail("Failed to attach data disk to RHEL vm whose root disk type is IDE")
204205
return
205206

207+
@attr(tags=["advanced", "basic"], required_hardware="true")
208+
def test2_attach_ISO_in_CentOSVM(self):
209+
"""
210+
@desc:Incorrect guest os mapping in vmware for CentOS 5.9 and above
211+
Step1 :Register an CentOS 6.3 template
212+
Step2 :Launch a VM
213+
Step3: Try to attach VMware Tools ISO
214+
Step4: Verify VMware tools ISO attached correctly
215+
"""
216+
self.hypervisor = str(get_hypervisor_type(self.api_client)).lower()
217+
if self.hypervisor != "vmware":
218+
self.skipTest("This test can be run only on vmware")
219+
template = Template.register(
220+
self.userapiclient,
221+
self.services["CentOS6.3template"],
222+
zoneid=self.zone.id,
223+
account=self.account.name,
224+
domainid=self.account.domainid,
225+
hypervisor=self.hypervisor
226+
)
227+
self.debug(
228+
"Registered a template with format {} and id {}".format(
229+
self.services["CentOS6.3template"]["format"],template.id)
230+
)
231+
template.download(self.userapiclient)
232+
self.cleanup.append(template)
233+
vm = VirtualMachine.create(
234+
self.userapiclient,
235+
self.services["virtual_machine"],
236+
accountid=self.account.name,
237+
domainid=self.account.domainid,
238+
serviceofferingid=self.service_offering.id,
239+
templateid=template.id,
240+
zoneid=self.zone.id
241+
)
242+
self.cleanup.append(vm)
243+
response = VirtualMachine.list(self.userapiclient,id=vm.id)
244+
status = validateList(response)
245+
self.assertEqual(status[0],PASS,"list vm response returned invalid list")
246+
list_default_iso_response = list_isos(
247+
self.api_client,
248+
name="vmware-tools.iso",
249+
account="system",
250+
isready="true"
251+
)
252+
status = validateList(list_default_iso_response)
253+
self.assertEquals(
254+
PASS,
255+
status[0],
256+
"ISO list is empty")
257+
self.debug(
258+
"Registered a ISO with name {}".format(list_default_iso_response[0].name))
259+
try:
260+
vm.attach_iso(self.userapiclient,list_default_iso_response[0])
261+
except CloudstackAPIException as e:
262+
self.fail("Attached ISO failed : %s" % e)
263+
response = VirtualMachine.list(self.userapiclient, id=vm.id)
264+
status = validateList(response)
265+
self.assertEqual(status[0], PASS,"list vm response returned invalid list")
266+
attachedIsoName=response[0].isoname;
267+
self.assertEqual(attachedIsoName, "vmware-tools.iso", "vmware-tools.iso not attached")
268+
return
269+
270+

‎tools/marvin/marvin/config/test_data.py‎

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -775,6 +775,15 @@
775775
"ostype": "CentOS 5.6 (64-bit)"
776776

777777
},
778+
"CentOS6.3template": {
779+
"displaytext": "Centos",
780+
"name": "Centos",
781+
"passwordenabled": False,
782+
"ostype": "CentOS 6.3 (64-bit)",
783+
"url": "http://10.147.28.7/templates/centos63.ova",
784+
"format": "OVA",
785+
"ispublic": "true"
786+
},
778787
"template_2": {
779788
"displaytext": "Public Template",
780789
"name": "Public template",

0 commit comments

Comments
 (0)