anchor.diff:                  {ok, #document{value = #file_meta{name = ?S3_SPACE_NAME}}}
           end),
   
  +    %% each invocation of new_user_ctx posix should return same posix ctx for posix storage type
       PosixCtx = ?assertMatch(#posix_user_ctx{uid = UID}, rpc:call(Worker, luma_proxy, new_user_ctx,
           [#helper_init{name = ?DIRECTIO_HELPER_NAME}, ?SESSION_ID, PosixSpaceUUID])),
       ?assertEqual(PosixCtx, rpc:call(Worker, luma_proxy, new_user_ctx,
           [#helper_init{name = ?DIRECTIO_HELPER_NAME}, ?SESSION_ID, PosixSpaceUUID])),
  +
  +    %% get_posix_user_ctx should return same ctx as new_user_ctx
       ?assertEqual(PosixCtx, rpc:call(Worker, luma_proxy, get_posix_user_ctx,
           [?DIRECTIO_HELPER_NAME, ?SESSION_ID, PosixSpaceUUID])),
  +    %% user ctx from LUMA server should be requested only once
       test_utils:mock_num_calls(Worker, http_client, get, 4, 1),
   
  +    %% for non posix storages get_posix_user_ctx should return posix ctx
  +
  +    %% get_posix_user_ctx should return same ctx on every invocation
       PosixCephCtx = ?assertMatch(#posix_user_ctx{uid = UID}, rpc:call(Worker, luma_proxy, get_posix_user_ctx,
           [?CEPH_HELPER_NAME, ?SESSION_ID, CephSpaceUUID])),
       ?assertEqual(PosixCephCtx, rpc:call(Worker, luma_proxy, get_posix_user_ctx,
           [?CEPH_HELPER_NAME, ?SESSION_ID, CephSpaceUUID])),
  -
  +    %% user ctx from LUMA server should be requested only once
  +    test_utils:mock_num_calls(Worker, http_client, get, 4, 2),
  +
  +    %% get_posix_user_ctx should return same ctx on every invocation
       PosixS3Ctx = ?assertMatch(#posix_user_ctx{uid = UID}, rpc:call(Worker, luma_proxy, get_posix_user_ctx,
           [?S3_HELPER_NAME, ?SESSION_ID, S3SpaceUUID])),
       ?assertEqual(PosixS3Ctx, rpc:call(Worker, luma_proxy, get_posix_user_ctx,
           [?S3_HELPER_NAME, ?SESSION_ID, S3SpaceUUID])),
   
  +    %% user ctx from LUMA server should be requested only once
  +    test_utils:mock_num_calls(Worker, http_client, get, 4, 3),
  +
  +    %% posix ctx for each storage type should differ on gid due to its generation from space name
       ?assertNotEqual(PosixCtx#posix_user_ctx.gid, PosixCephCtx#posix_user_ctx.gid),
       ?assertNotEqual(PosixCtx#posix_user_ctx.gid, PosixS3Ctx#posix_user_ctx.gid),
  -    ?assertNotEqual(PosixCephCtx#posix_user_ctx.gid, PosixS3Ctx#posix_user_ctx.gid),
  -
  -    test_utils:mock_num_calls(Worker, http_client, get, 4, 3).
  +    ?assertNotEqual(PosixCephCtx#posix_user_ctx.gid, PosixS3Ctx#posix_user_ctx.gid).
  +
   
   ceph_user_provider_test(Config) ->
       [Worker | _] = ?config(op_worker_nodes, Config),
  
positive.code:     AccessKey = <<"AccessKey">>,
      SecretKey = <<"SecretKey">>,
  
      test_utils:mock_new(Worker, amazonaws_iam),
      test_utils:mock_expect(Worker, amazonaws_iam, create_user, fun(_, _, _, _, _) -> ok end),
      test_utils:mock_expect(Worker, amazonaws_iam, create_access_key, fun(_, _, _, _, _) ->
  
negative.code:     UserName = <<"username">>,
      UserKey = <<"key">>,
  
      %% mock LUMA server response for ceph ctx
      test_utils:mock_new(Worker, http_client),
      test_utils:mock_expect(Worker, http_client, get, fun(_, _, _, _) -> {ok, 200, [],
          json_utils:encode([{<<"status">>, <<"success">>}, {<<"data">>,
              [{<<"user_name">>, UserName}, {<<"user_key">>, UserKey}]}])} end),
  
      %% each new_user_ctx invocation should return same ceph ctx for ceph storage type
      CephCtx = ?assertMatch(#ceph_user_ctx{user_name = UserName, user_key = UserKey},
          rpc:call(Worker, luma_proxy, new_user_ctx,
              [#helper_init{name = ?CEPH_HELPER_NAME}, ?SESSION_ID, SpaceUUID])),
      ?assertEqual(CephCtx, rpc:call(Worker, luma_proxy, new_user_ctx,
          [#helper_init{name = ?CEPH_HELPER_NAME}, ?SESSION_ID, SpaceUUID])),
  
      %% LUMA server should be requested for ctx only once
      test_utils:mock_num_calls(Worker, http_client, get, 4, 1).
  
  s3_user_provider_test(Config) ->
  