'Test update of port with additional IP.'

def test_update_port_add_additional_ip(self):

    with self.subnet() as subnet:
        with self.port(subnet=subnet) as port:
            data = {'port': {'admin_state_up': False, 'fixed_ips': [{'subnet_id': subnet['subnet']['id']}, {'subnet_id': subnet['subnet']['id']}]}}
            req = self.new_update_request('ports', data, port['port']['id'])
            res = self.deserialize(self.fmt, req.get_response(self.api))
            self.assertEqual(data['port']['admin_state_up'], res['port']['admin_state_up'])
            ips = res['port']['fixed_ips']
            self.assertEqual(2, len(ips))
            self.assertNotEqual(ips[0]['ip_address'], ips[1]['ip_address'])
            network_ip_net = netaddr.IPNetwork(subnet['subnet']['cidr'])
            self.assertIn(ips[0]['ip_address'], network_ip_net)
            self.assertIn(ips[1]['ip_address'], network_ip_net)
