Exemplo n.º 1
0
    def test_nic_secondaryip_add_remove(self):
        #TODO: SIMENH: add verification
        list_vms = VirtualMachine.list(self.apiclient,
                                       id=self.virtual_machine.id)
        vm = list_vms[0]
        nicid = vm.nic[0].id
        cmd = addIpToNicCmd()
        cmd.nicid = nicid
        response = self.apiclient.addIpToNic(cmd)
        self.debug('IP address acquired to nic is =%s' % response.ipaddress)

        #remove the ip from nic
        list_vms = VirtualMachine.list(self.apiclient,
                                       id=self.virtual_machine.id)
        vmid = self.virtual_machine.id
        cmd = listNicsCmd()
        cmd.virtualmachineid = vmid
        list_nics = self.apiclient.listNics(cmd)

        nic = list_nics[0]
        ipid = nic.secondaryip[0].id

        cmd = removeIpFromNicCmd()
        cmd.id = ipid
        response = self.apiclient.removeIpFromNic(cmd)
    def test_nic_secondaryip_add_remove(self):
        list_vms = VirtualMachine.list(self.apiclient, id=self.virtual_machine.id)
        vm = list_vms[0]
        nicid = vm.nic[0].id
        cmd = addIpToNicCmd()
        cmd.nicid = nicid
        response =  self.apiclient.addIpToNic(cmd)
        self.debug('IP address acquired to nic is =%s' % response.ipaddress)

        #remove the ip from nic
        list_vms = VirtualMachine.list(self.apiclient, id=self.virtual_machine.id)
        vmid = self.virtual_machine.id
        cmd = listNicsCmd()
        cmd.virtualmachineid = vmid
        list_nics =  self.apiclient.listNics(cmd)

        nic = list_nics[0]
        ipid = nic.secondaryip[0].id;

        cmd = removeIpFromNicCmd()
        cmd.id = ipid
        response =  self.apiclient.removeIpFromNic(cmd)