#NEWLINE# def test_init_router_port_ext_gw_with_dual_stack( self ) : #NEWLINE# #INDENT# old_addrs = [ dict ( ip_version = 4 , scope = 'global' , dynamic = False , cidr = '172.16.77.240/24' ) , dict ( ip_version = 6 , scope = 'global' , dynamic = False , cidr = '2001:db8:a::123/64' ) ] #NEWLINE# self . ip_dev ( ) . addr . list = mock . Mock ( return_value = old_addrs ) #NEWLINE# self . ip_dev ( ) . route . list_onlink_routes . return_value = [ ] #NEWLINE# bc = BaseChild ( self . conf ) #NEWLINE# ns = '12345678-1234-5678-90ab-ba0987654321' #NEWLINE# new_cidrs = [ '192.168.1.2/24' , '2001:db8:a::124/64' ] #NEWLINE# bc . init_router_port ( 'tap0' , new_cidrs , namespace = ns , extra_subnets = [ { #NEWLINE# #INDENT# 'cidr' : '172.20.0.0/24' , #NEWLINE# #UNINDENT# } ] ) #NEWLINE# self . ip_dev . assert_has_calls ( [ mock . call ( 'tap0' , namespace = ns ) , mock . call ( ) . addr . list ( filters = [ 'permanent' ] ) , mock . call ( ) . addr . add ( '192.168.1.2/24' ) , mock . call ( ) . addr . add ( '2001:db8:a::124/64' ) , mock . call ( ) . addr . delete ( '172.16.77.240/24' ) , mock . call ( ) . addr . delete ( '2001:db8:a::123/64' ) , mock . call ( ) . route . list_onlink_routes ( constants . IP_VERSION_4 ) , mock . call ( ) . route . list_onlink_routes ( constants . IP_VERSION_6 ) , mock . call ( ) . route . add_onlink_route ( '172.20.0.0/24' ) ] , any_order = True )