# insert to master insert_tuples(master, id, id + ID_STEP) # select from replica select_tuples(replica, id, id + ID_STEP, master.get_param("lsn")) id += ID_STEP # insert to master insert_tuples(master, id, id + ID_STEP) # select from replica select_tuples(replica, id, id + ID_STEP, master.get_param("lsn")) id += ID_STEP print "swap servers" # reconfigure replica to master replica.reconfigure("replication/cfg/replica_to_master.cfg", silent = False) # reconfigure master to replica master.reconfigure("replication/cfg/master_to_replica.cfg", silent = False) # insert to replica insert_tuples(replica, id, id + ID_STEP) # select from master select_tuples(master, id, id + ID_STEP, replica.get_param("lsn")) id += ID_STEP # insert to replica insert_tuples(replica, id, id + ID_STEP) # select from master select_tuples(master, id, id + ID_STEP, replica.get_param("lsn")) id += ID_STEP
replica_memcached("get 6\r\n") print """# flush all k-v on master and try to get them from replica""" master_memcached("flush_all\r\n", silent=True) wait_for_empty_space(replica) replica_memcached("get 10\r\n") print """# check that expiration is working properly on replica""" master_memcached("set 1 0 1 %d\r\n%s\r\n" % (len(sonet[0]), sonet[0]), silent=True) lsn = wait() replica_memcached("get 1\r\n") replica.wait_lsn(lsn + 1) replica_memcached("get 1\r\n") print """# check that expiration is working properly, when replica becomes master""" master_memcached("set 1 0 1 %d\r\n%s\r\n" % (len(sonet[0]), sonet[0]), silent=True) lsn = wait() replica.reconfigure("replication/cfg/replica_to_master.cfg") replica_memcached("get 1\r\n") replica.wait_lsn(lsn + 1) replica_memcached("get 1\r\n") # restore default suite config replica.stop() replica.cleanup(True) master.stop() master.deploy(self.suite_ini["config"]) # vim: syntax=python