'Create subnet should not cause excess fixed IPs on router gw
If a router gateway port has the maximum of one IPv4 and one IPv6
fixed, create subnet should not add any more IP addresses to the port
(unless this is the subnet is a SLAAC/DHCPv6-stateless subnet in which
case the addresses are added automatically)'

def test_router_update_gateway_upon_subnet_create_max_ips_ipv6(self):

    with self.router() as r:
        with self.network() as n:
            with self.subnet(cidr='10.0.0.0/24', network=n) as s1:
                with self.subnet(ip_version=6, cidr='2001:db8::/64', network=n) as s2:
                    self._set_net_external(n['network']['id'])
                    self._add_external_gateway_to_router(r['router']['id'], n['network']['id'], ext_ips=[{'subnet_id': s1['subnet']['id']}, {'subnet_id': s2['subnet']['id']}], expected_code=exc.HTTPOk.code)
                    res1 = self._show('routers', r['router']['id'])
                    original_fips = res1['router']['external_gateway_info']['external_fixed_ips']
                    self._create_subnet(self.fmt, net_id=n['network']['id'], cidr='10.0.1.0/24')
                    res2 = self._show('routers', r['router']['id'])
                    self.assertEqual(original_fips, res2['router']['external_gateway_info']['external_fixed_ips'])
                    s3 = self.deserialize(self.fmt, self._create_subnet(self.fmt, net_id=n['network']['id'], ip_version=6, cidr='2001:db8:1::/64', ipv6_ra_mode=lib_constants.IPV6_SLAAC, ipv6_address_mode=lib_constants.IPV6_SLAAC))
                    res3 = self._show('routers', r['router']['id'])
                    fips = res3['router']['external_gateway_info']['external_fixed_ips']
                    fip_subnet_ids = [fip['subnet_id'] for fip in fips]
                    self.assertIn(s1['subnet']['id'], fip_subnet_ids)
                    self.assertIn(s2['subnet']['id'], fip_subnet_ids)
                    self.assertIn(s3['subnet']['id'], fip_subnet_ids)
                    self._remove_external_gateway_from_router(r['router']['id'], n['network']['id'])
