anchor.diff:  -define(EQ, ==).
   
   all() -> [
  -  tester_ring_8].
  +  tester_ring_8,
  +  tester_with_data].
   
   suite() -> [ {timetrap, {seconds, 60}} ].
   
  
positive.code: 
  -ifdef(PRBR_MNESIA).
  init_per_testcase(_TestCase, Config) ->
        {priv_dir, PrivDir} = lists:keyfind(priv_dir, 1, Config),
        unittest_helper:make_ring(8, [{config, [{log_path, PrivDir},
                                      {leases, true}]}]),
        unittest_helper:check_ring_size_fully_joined(8),
        Config.
  -else.
  init_per_testcase(_TestCase, _Config) -> {skip, "db_mnesia not set -> skipping test SUITE"}.
  -endif.
  
  end_per_testcase(_TestCase, Config) ->
    unittest_helper:stop_ring(),
    Config.
  
  rw_suite_runs(N) ->
  
negative.code: tester_ring_8(Config) ->
    {priv_dir, PrivDir} = lists:keyfind(priv_dir, 1, Config),
    unittest_helper:stop_ring(),
    ct:pal("ring stopped -> sleeping. Waiting for leases to expire"),
    timer:sleep(11000),
    unittest_helper:make_ring_recover( [{config, [{log_path, PrivDir},
                                        {leases, true},
                                        {start_type, recover}]}]),
    util:wait_for(fun admin:check_leases/0, 10000),
    true.
  
  %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
  % test with_data/1 write data to KV DBs and ensure data integrity after recovery
  %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
  tester_with_data(Config) ->
    % writting data to KV
    [kv_on_cseq:write(integer_to_list(X),X)||X<-lists:seq(1,100)],
    {priv_dir, PrivDir} = lists:keyfind(priv_dir, 1, Config),
    unittest_helper:stop_ring(),
    ct:pal("ring stopped -> sleeping. Waiting for leases to expire"),
    timer:sleep(11000),
    unittest_helper:make_ring_recover( [{config, [{log_path, PrivDir},
      {leases, true},
      {start_type, recover}]}]),
    util:wait_for(fun admin:check_leases/0, 10000),
    % ring restored -> checking KV data integrity
    [{ok, X} = kv_on_cseq:read(integer_to_list(X))||X<-lists:seq(1,100)],
    true.
  
  