#NEWLINE# def test_redis_repl( self ) : #NEWLINE# #INDENT# master_instance = { #NEWLINE# #INDENT# 'host' : 'localhost' , #NEWLINE# 'port' : NOAUTH_PORT , #NEWLINE# #UNINDENT# } #NEWLINE# slave_instance = { #NEWLINE# #INDENT# 'host' : 'localhost' , #NEWLINE# 'port' : AUTH_PORT , #NEWLINE# 'password' : 'sd-is-devops-best-friend' , #NEWLINE# #UNINDENT# } #NEWLINE# repl_metrics = [ 'redis.replication.delay' , 'redis.replication.backlog_histlen' , 'redis.replication.delay' , 'redis.replication.master_repl_offset' ] #NEWLINE# master_db = redis . Redis ( port = NOAUTH_PORT , db = 14 ) #NEWLINE# slave_db = redis . Redis ( port = AUTH_PORT , password = slave_instance [ 'password' ] , db = 14 ) #NEWLINE# master_db . flushdb ( ) #NEWLINE# master_db . set ( 'replicated:test' , 'true' ) #NEWLINE# self . assertEquals ( slave_db . get ( 'replicated:test' ) , 'true' ) #NEWLINE# r = load_check ( 'redisdb' , { #NEWLINE# #INDENT# #NEWLINE# #UNINDENT# } , { #NEWLINE# #INDENT# #NEWLINE# #UNINDENT# } ) #NEWLINE# r . check ( master_instance ) #NEWLINE# metrics = self . _sort_metrics ( r . get_metrics ( ) ) #NEWLINE# keys = [ m [ 0 ] for m in metrics ] #NEWLINE# assert [ ( x in x ) for x in repl_metrics ]