def resource_setup_container(cls):
     cls.brdc = ctn_base.Bridge(name='br-docker-4byte-asn',
                                subnet='192.168.10.0/24',
                                start_ip='192.168.10.128',
                                end_ip='192.168.10.254',
                                self_ip=True,
                                fixed_ip=cls.public_gw + '/24',
                                br_type=base.BRIDGE_TYPE)
     cls.bridges.append(cls.brdc)
     # This is dummy container object for a dr service.
     # This keeps data which passes to a quagga container.
     cls.dr = ctn_base.BGPContainer(name='dummy-dr-4byte-asn',
                                    asn=int(cls.L_AS.asn),
                                    router_id=cls.L_AS.router_id)
     cls.dr.set_addr_info(bridge='br-docker-4byte-asn', ipv4=cls.public_gw)
     # quagga container
     cls.dockerimg = ctn_base.DockerImage()
     cls.q_img = cls.dockerimg.create_quagga(check_exist=True)
     cls.images.append(cls.q_img)
     for i in range(cls.RAS_MAX):
         qg = quagga.QuaggaBGPContainer(name='q-4byte-asn-' + str(i + 1),
                                        asn=int(cls.ras_l[i].asn),
                                        router_id=cls.ras_l[i].router_id,
                                        ctn_image_name=cls.q_img)
         cls.containers.append(qg)
         cls.r_ass.append(qg)
         qg.add_route(cls.ras_l[i].adv_net)
         qg.run(wait=True)
         cls.r_as_ip.append(cls.brdc.addif(qg))
         qg.add_peer(cls.dr, bridge=cls.brdc.name,
                     peer_info={'passive': True})
     cls.tnet_gen = cls.get_subnet(start='10.10.1.0', end='10.10.255.0',
                                   step=256)
 def resource_setup_container(cls):
     cls.brdc = ctn_base.Bridge(name='br-docker-ipv6',
                                subnet='2001:db8:a000::/64',
                                start_ip='2001:db8:a000::8000',
                                end_ip='2001:db8:a000::fffe',
                                self_ip=True,
                                fixed_ip=cls.public_gw + '/64',
                                br_type=base.BRIDGE_TYPE)
     cls.bridges.append(cls.brdc)
     # This is dummy container object for a dr service.
     # This keeps data which passes to a quagga container.
     cls.dr = ctn_base.BGPContainer(name='dr',
                                    asn=int(cls.L_AS.asn),
                                    router_id=cls.L_AS.router_id)
     cls.dr.set_addr_info(bridge='br-docker-ipv6', ipv6=cls.public_gw)
     # quagga container
     cls.dockerimg = ctn_base.DockerImage()
     cls.q_img = cls.dockerimg.create_quagga(check_exist=True)
     cls.images.append(cls.q_img)
     for i in range(cls.RAS_MAX):
         qg = quagga.QuaggaBGPContainer(name='q' + str(i + 1),
                                        asn=int(cls.ras_l[i].asn),
                                        router_id=cls.ras_l[i].router_id,
                                        ctn_image_name=cls.q_img)
         cls.containers.append(qg)
         cls.r_ass.append(qg)
         qg.add_route(cls.ras_l[i].adv_net, route_info={'rf': 'ipv6'})
         qg.run(wait=True)
         cls.r_as_ip.append(cls.brdc.addif(qg))
         qg.add_peer(cls.dr,
                     bridge=cls.brdc.name,
                     v6=True,
                     peer_info={'passive': True})
     cls.tnet_gen = cls.get_subnet(start='2001:db8:8000:1::',
                                   end='2001:db8:8000:ffff::',
                                   step=65536 * 65536 * 65536 * 65536)