#NEWLINE# def test_add_device_ipv6_new_format( self ) : #NEWLINE# #INDENT# self . create_sample_ring ( ) #NEWLINE# argv = [ '' , self . tmpfile , 'add' , '--region' , '2' , '--zone' , '3' , '--ip' , '[3001:0000:1234:0000:0000:C1C0:ABCD:0876]' , '--port' , '6200' , '--replication-ip' , '[3::10]' , '--replication-port' , '7000' , '--device' , 'sda3' , '--meta' , 'some meta data' , '--weight' , '3.14159265359' ] #NEWLINE# self . assertSystemExit ( EXIT_SUCCESS , ringbuilder . main , argv ) #NEWLINE# ring = RingBuilder . load ( self . tmpfile ) #NEWLINE# dev = ring . devs [ ( - 1 ) ] #NEWLINE# self . assertEqual ( dev [ 'region' ] , 2 ) #NEWLINE# self . assertEqual ( dev [ 'zone' ] , 3 ) #NEWLINE# self . assertEqual ( dev [ 'ip' ] , '3001:0:1234::c1c0:abcd:876' ) #NEWLINE# self . assertEqual ( dev [ 'port' ] , 6200 ) #NEWLINE# self . assertEqual ( dev [ 'device' ] , 'sda3' ) #NEWLINE# self . assertEqual ( dev [ 'weight' ] , 3.14159265359 ) #NEWLINE# self . assertEqual ( dev [ 'replication_ip' ] , '3::10' ) #NEWLINE# self . assertEqual ( dev [ 'replication_port' ] , 7000 ) #NEWLINE# self . assertEqual ( dev [ 'meta' ] , 'some meta data' ) #NEWLINE# ring . rebalance ( ) #NEWLINE# self . assertTrue ( ring . validate ( ) )