anchor.diff:  -compile(export_all).
   
   all() ->
  -	[auth,
  -	 echo,
  -	 ping,
  -	 select,
  -	 quit].
  +	[echo,ping,select,auth,quit].
   
  -init_per_suite(Config) ->
  +init_per_testcase(_TestCase, Config) ->
   	{ok,Client} = connect_erldis(10),
  -	NewConfig=[{client,Client}|Config],
  +	NewConfig = lists:keystore(client,1,Config,{client,Client}),
   	NewConfig.
   
   connect_erldis(0) -> {error,{socket_error,econnrefused}};
  
positive.code: 		{ok,Client} -> {ok,Client};
  		_ -> connect_erldis(Times - 1)
  	end.
  
  end_per_suite(Config) ->
  	Config.
  
  auth(Config) ->
  	{client,Client} = lists:keyfind(client, 1, Config),
  	Pwd = <<"hhedls56329">>,
  	
  	[ok] = erldis_client:scall(Client, [<<"config">>,<<"set">>,<<"requirepass">>, Pwd]),
  	{ok,NewClient} = connect_erldis(10), 
  	{error,<<"ERR operation not permitted">>} = erldis_client:sr_scall(NewClient, <<"ping">>),
  	
  	[{error,<<"ERR invalid password">>}] = erldis_client:scall(NewClient, [<<"auth">>, <<"bad_pass">>]),
  	{error,<<"ERR operation not permitted">>} = erldis_client:sr_scall(NewClient, <<"ping">>),
  	
  	[ok] = erldis_client:scall(NewClient, [<<"auth">>, Pwd]),
  	pong = erldis_client:sr_scall(NewClient, <<"ping">>).
  
  echo(Config) ->
  	{client,Client} = lists:keyfind(client, 1, Config),
  
negative.code: 	{error,<<"ERR invalid DB index">>} = erldis_client:sr_scall(Client, [<<"select">>, -1]),
  	ok = erldis_client:sr_scall(Client, [<<"select">>, a]).
  
  auth(Config) ->
  	{client,Client} = lists:keyfind(client, 1, Config),
  	Pwd = <<"hhedls56329">>,
  	
  	[ok] = erldis_client:scall(Client, [<<"config">>,<<"set">>,<<"requirepass">>, Pwd]),
  	{ok,NewClient} = connect_erldis(10), 
  	{error,<<"ERR operation not permitted">>} = erldis_client:sr_scall(NewClient, <<"ping">>),
  	
  	[{error,<<"ERR invalid password">>}] = erldis_client:scall(NewClient, [<<"auth">>, <<"bad_pass">>]),
  	{error,<<"ERR operation not permitted">>} = erldis_client:sr_scall(NewClient, <<"ping">>),
  	
  	[ok] = erldis_client:scall(NewClient, [<<"auth">>, Pwd]),
  	pong = erldis_client:sr_scall(NewClient, <<"ping">>).
  
  quit(Config) ->
  	{client,Client} = lists:keyfind(client, 1, Config),
  	shutdown = erldis_client:stop(Client).
  