Added functional tests for replicaset