Beispiel #1
0
 def test_get_virtual_machine_instance_status(self):
     d = Deployment()
     vm_name = 'dghu34'
     self.assertIsNone(self.service.get_virtual_machine_instance_status(d, vm_name))
     r = RoleInstance()
     r.instance_name = vm_name
     r.instance_status = AVMStatus.READY_ROLE
     d.role_instance_list = [r]
     self.assertEqual(self.service.get_virtual_machine_instance_status(d, vm_name), AVMStatus.READY_ROLE)
 def test_get_virtual_machine_instance_status(self):
     d = Deployment()
     vm_name = 'dghu34'
     self.assertIsNone(self.service.get_virtual_machine_instance_status(d, vm_name))
     r = RoleInstance()
     r.instance_name = vm_name
     r.instance_status = AVMStatus.READY_ROLE
     d.role_instance_list = [r]
     self.assertEqual(self.service.get_virtual_machine_instance_status(d, vm_name), AVMStatus.READY_ROLE)
Beispiel #3
0
 def test_get_virtual_machine_private_ip(self):
     cs_name = 'dsfd'
     dm_name = 'fdh4'
     vm_name = 'fgr5'
     self.service.get_deployment_by_name = Mock()
     d = Deployment()
     self.service.get_deployment_by_name.return_value = d
     self.assertIsNone(self.service.get_virtual_machine_private_ip(cs_name, dm_name, vm_name))
     r = RoleInstance()
     r.role_name = vm_name
     r.ip_address = '125.125.125.125'
     d.role_instance_list = [r]
     self.assertEqual(self.service.get_virtual_machine_private_ip(cs_name, dm_name, vm_name), r.ip_address)
 def test_get_virtual_machine_private_ip(self):
     cs_name = 'dsfd'
     dm_name = 'fdh4'
     vm_name = 'fgr5'
     self.service.get_deployment_by_name = Mock()
     d = Deployment()
     self.service.get_deployment_by_name.return_value = d
     self.assertIsNone(self.service.get_virtual_machine_private_ip(cs_name, dm_name, vm_name))
     r = RoleInstance()
     r.role_name = vm_name
     r.ip_address = '125.125.125.125'
     d.role_instance_list = [r]
     self.assertEqual(self.service.get_virtual_machine_private_ip(cs_name, dm_name, vm_name), r.ip_address)
Beispiel #5
0
 def test_get_virtual_machine_public_ip(self):
     cs_name = 'ds65'
     dm_name = 'fdhj'
     vm_name = 'sd43'
     self.service.get_deployment_by_name = Mock()
     d = Deployment()
     self.service.get_deployment_by_name.return_value = d
     self.assertIsNone(self.service.get_virtual_machine_public_ip(cs_name, dm_name, vm_name))
     r = RoleInstance()
     r.role_name = vm_name
     ep = InstanceEndpoint()
     ep.vip = '125.125.125.125'
     r.instance_endpoints.instance_endpoints = [ep]
     d.role_instance_list = [r]
     self.assertEqual(self.service.get_virtual_machine_public_ip(cs_name, dm_name, vm_name), ep.vip)
 def test_get_virtual_machine_public_ip(self):
     cs_name = 'ds65'
     dm_name = 'fdhj'
     vm_name = 'sd43'
     self.service.get_deployment_by_name = Mock()
     d = Deployment()
     self.service.get_deployment_by_name.return_value = d
     self.assertIsNone(self.service.get_virtual_machine_public_ip(cs_name, dm_name, vm_name))
     r = RoleInstance()
     r.role_name = vm_name
     ep = InstanceEndpoint()
     ep.vip = '125.125.125.125'
     r.instance_endpoints.instance_endpoints = [ep]
     d.role_instance_list = [r]
     self.assertEqual(self.service.get_virtual_machine_public_ip(cs_name, dm_name, vm_name), ep.vip)
 def test_get_virtual_machine_public_endpoint(self):
     cs_name = "ds4"
     dm_name = "dh3"
     vm_name = "fd4"
     ep_name = "fj4"
     self.service.get_deployment_by_name = Mock()
     d = Deployment()
     self.service.get_deployment_by_name.return_value = d
     self.assertIsNone(self.service.get_virtual_machine_public_endpoint(cs_name, dm_name, vm_name, ep_name))
     r = RoleInstance()
     r.role_name = vm_name
     ep = InstanceEndpoint()
     ep.name = ep_name
     ep.public_port = "10086"
     r.instance_endpoints = [ep]
     d.role_instance_list = [r]
     self.assertEqual(
         self.service.get_virtual_machine_public_endpoint(cs_name, dm_name, vm_name, ep_name), ep.public_port
     )
 def test_get_virtual_machine_public_endpoint(self):
     cs_name = 'ds4'
     dm_name = 'dh3'
     vm_name = 'fd4'
     ep_name = 'fj4'
     self.service.get_deployment_by_name = Mock()
     d = Deployment()
     self.service.get_deployment_by_name.return_value = d
     self.assertIsNone(self.service.get_virtual_machine_public_endpoint(cs_name, dm_name, vm_name, ep_name))
     r = RoleInstance()
     r.role_name = vm_name
     ep = InstanceEndpoint()
     ep.name = ep_name
     ep.public_port = '10086'
     r.instance_endpoints = [ep]
     d.role_instance_list = [r]
     self.assertEqual(
         self.service.get_virtual_machine_public_endpoint(cs_name, dm_name, vm_name, ep_name),
         ep.public_port
     )