anchor.diff:              #data_spec{bad_values = BadFileIdValues};
           #data_spec{bad_values = BadValues} ->
               DataSpec#data_spec{bad_values = BadFileIdValues ++ BadValues}
  -    end.
  -
  -
  -%% @private
  -create_setup_view_transfer_env(Type, SrcNode, DstNode, UserId, Config) ->
  -    fun() ->
  -        SessId1 = ?SESS_ID(UserId, SrcNode, Config),
  -        SessId2 = ?SESS_ID(UserId, DstNode, Config),
  -
  -        {ViewName, Xattr} = create_view(Type, SrcNode, DstNode),
  -        RootDirPath = filename:join(["/", ?SPACE_2]),
  -
  -        FilesToBeLeftAlone = lists:map(fun(_) ->
  -            create_file(SrcNode, SessId1, RootDirPath)
  -        end, lists:seq(1, 3)),
  -
  -        FilesToTransferNum = 3,
  -        FilesToTransfer = lists:map(fun(_) ->
  -            FileGuid = create_file(SrcNode, SessId1, RootDirPath),
  -            ?assertMatch(ok, lfm_proxy:set_xattr(SrcNode, SessId1, {guid, FileGuid}, Xattr)),
  -            FileGuid
  -        end, lists:seq(1, FilesToTransferNum)),
  -
  -        sync_files_between_nodes(Type, SrcNode, SessId1, DstNode, SessId2, FilesToTransfer),
  -
  -        ObjectIds = api_test_utils:guids_to_object_ids(FilesToTransfer),
  -        QueryViewParams = [{key, Xattr#xattr.value}],
  -
  -        ExpTransfer = case Type of
  -            replication ->
  -                ?assertViewQuery(ObjectIds, DstNode, ?SPACE_2, ViewName,  QueryViewParams),
  -
  -                #{
  -                    replication_status => completed,
  -                    eviction_status => skipped,
  -                    replicating_provider => transfers_test_utils:provider_id(DstNode),
  -                    evicting_provider => undefined,
  -                    files_to_process => 1 + FilesToTransferNum,
  -                    files_processed => 1 + FilesToTransferNum,
  -                    files_replicated => FilesToTransferNum,
  -                    bytes_replicated => FilesToTransferNum * ?BYTES_NUM,
  -                    files_evicted => 0
  -                };
  -            eviction ->
  -                ?assertViewQuery(ObjectIds, SrcNode, ?SPACE_2, ViewName,  QueryViewParams),
  -                timer:sleep(timer:seconds(5)),
  -
  -                #{
  -                    replication_status => skipped,
  -                    eviction_status => completed,
  -                    replicating_provider => undefined,
  -                    evicting_provider => transfers_test_utils:provider_id(SrcNode),
  -                    files_to_process => 1 + FilesToTransferNum,
  -                    files_processed => 1 + FilesToTransferNum,
  -                    files_replicated => 0,
  -                    bytes_replicated => 0,
  -                    files_evicted => FilesToTransferNum
  -                };
  -            migration ->
  -                ?assertViewQuery(ObjectIds, SrcNode, ?SPACE_2, ViewName,  QueryViewParams),
  -                ?assertViewQuery(ObjectIds, DstNode, ?SPACE_2, ViewName,  QueryViewParams),
  -
  -                #{
  -                    replication_status => completed,
  -                    eviction_status => completed,
  -                    replicating_provider => transfers_test_utils:provider_id(DstNode),
  -                    evicting_provider => transfers_test_utils:provider_id(SrcNode),
  -                    files_to_process => 2 * (1 + FilesToTransferNum),
  -                    files_processed => 2 * (1 + FilesToTransferNum),
  -                    files_replicated => FilesToTransferNum,
  -                    bytes_replicated => FilesToTransferNum * ?BYTES_NUM,
  -                    files_evicted => FilesToTransferNum
  -                }
  -        end,
  -
  -        #{
  -            view_name => ViewName,
  -            exp_transfer => ExpTransfer#{
  -                space_id => ?SPACE_2,
  -                file_uuid => fslogic_uuid:spaceid_to_space_dir_uuid(?SPACE_2),
  -                path => RootDirPath,
  -                failed_files => 0
  -            },
  -            files_to_transfer => FilesToTransfer,
  -            other_files => FilesToBeLeftAlone
  -        }
       end.
   
   
  
positive.code:     ])).
  
  
  create_setup_file_replication_env(SrcNode, DstNode, UserId, Config) ->
      fun() ->
          SessId1 = ?SESS_ID(UserId, SrcNode, Config),
          SessId2 = ?SESS_ID(UserId, DstNode, Config),
  
          FilesToBeLeftAlone = lists:map(fun(_) ->
              create_file(SrcNode, SessId1, filename:join(["/", ?SPACE_2]))
          end, lists:seq(1, 3)),
  
          RootFileType = api_test_utils:randomly_choose_file_type_for_test(false),
          RootFilePath = filename:join(["/", ?SPACE_2, ?RANDOM_FILE_NAME()]),
          {ok, RootFileGuid} = api_test_utils:create_file(
              RootFileType, SrcNode, SessId1, RootFilePath, 8#777
          ),
  
          BytesNum = 20,
          {Files, ExpTransfer} = case RootFileType of
              <<"file">> ->
                  fill_file_with_dummy_data(SrcNode, SessId1, RootFileGuid, BytesNum),
                  Guids = [RootFileGuid],
                  TransferStats = #{
                      files_to_process => 1,
                      files_processed => 1,
                      files_replicated => 1,
                      bytes_replicated => BytesNum
                  },
                  {Guids, TransferStats};
              <<"dir">> ->
                  SubFilesNum = 5,
                  SubFilesGuids = lists:map(fun(_) ->
                      FilePath = filename:join([RootFilePath, ?RANDOM_FILE_NAME()]),
                      {ok, FileGuid} = api_test_utils:create_file(
                          <<"file">>, SrcNode, SessId1, FilePath, 8#777
                      ),
                      fill_file_with_dummy_data(SrcNode, SessId1, FileGuid, BytesNum),
                      FileGuid
                  end, lists:seq(1, SubFilesNum)),
                  TransferStats = #{
                      files_to_process => SubFilesNum + 1,
                      files_processed => SubFilesNum + 1,
                      files_replicated => SubFilesNum,
                      bytes_replicated => SubFilesNum * BytesNum
  
                  },
                  {SubFilesGuids, TransferStats}
          end,
  
          lists:foreach(fun(Guid) ->
              api_test_utils:wait_for_file_sync(DstNode, SessId2, Guid)
          end, Files),
  
          {ok, RootFileObjectId} = file_id:guid_to_objectid(RootFileGuid),
          #{
              root_file_guid => RootFileGuid,
              root_file_cdmi_id => RootFileObjectId,
              root_file_type => RootFileType,
              root_file_path => RootFilePath,
              exp_transfer => ExpTransfer#{
                  space_id => ?SPACE_2,
                  file_uuid => file_id:guid_to_uuid(RootFileGuid),
                  path => RootFilePath,
                  replication_status => completed,
                  eviction_status => skipped,
                  replicating_provider => transfers_test_utils:provider_id(DstNode),
                  evicting_provider => undefined,
                  failed_files => 0,
                  files_evicted => 0
              },
              files_to_transfer => Files,
              other_files => FilesToBeLeftAlone,
              file_size => BytesNum
          }
      end.
  
  
negative.code: 
      fun
          (expected_failure, #api_test_ctx{env = #{files_to_transfer := FilesToTransfer, other_files := OtherFiles}}) ->
              assert_distribution(
                  Node, SessId, OtherFiles ++ FilesToTransfer,
                  [{SrcProvider, ?BYTES_NUM}, {DstProvider, ?BYTES_NUM}]
              ),
              true;
          (expected_success, #api_test_ctx{env = #{files_to_transfer := FilesToTransfer, other_files := OtherFiles}}) ->
              assert_distribution(
                  Node, SessId, OtherFiles,
                  [{SrcProvider, ?BYTES_NUM}, {DstProvider, ?BYTES_NUM}]
              ),
              assert_distribution(
                  Node, SessId, FilesToTransfer,
                  [{SrcProvider, 0}, {DstProvider, ?BYTES_NUM}]
  