'Test router-interface-add for multiple ipv6 subnets on a network.
Verify that adding multiple ipv6 subnets from the same network
to a router places them all on the same router interface.'

def test_router_add_interface_multiple_ipv6_subnets_same_net(self):

    with self.router() as r:
        with self.network() as n:
            with self.subnet(network=n, cidr='fd00::1/64', ip_version=6) as s1:
                with self.subnet(network=n, cidr='fd01::1/64', ip_version=6) as s2:
                    body = self._router_interface_action('add', r['router']['id'], s1['subnet']['id'], None)
                    pid1 = body['port_id']
                    body = self._router_interface_action('add', r['router']['id'], s2['subnet']['id'], None)
                    pid2 = body['port_id']
                    self.assertEqual(pid1, pid2)
                    port = self._show('ports', pid1)
                    self.assertEqual(2, len(port['port']['fixed_ips']))
                    port_subnet_ids = [fip['subnet_id'] for fip in port['port']['fixed_ips']]
                    self.assertIn(s1['subnet']['id'], port_subnet_ids)
                    self.assertIn(s2['subnet']['id'], port_subnet_ids)
                    self._router_interface_action('remove', r['router']['id'], s1['subnet']['id'], None)
                    self._router_interface_action('remove', r['router']['id'], s2['subnet']['id'], None)
