def METHOD_NAME(ver_cmp_ret, old_ver, test_data):
    """
    Test for authorising hosts on cluster
    """
    exp_cmd = ["pcs"]
    if old_ver:
        exp_cmd.extend(["cluster", "auth"])
    else:
        exp_cmd.extend(["host", "auth"])
    exp_cmd.extend(["-u", test_data.username, "-p", test_data.password])
    if old_ver:
        exp_cmd.extend(test_data.extra_args)
    exp_cmd.extend([test_data.nodea, test_data.nodeb])
    mock_cmd = MagicMock()
    patch_salt = patch.dict(
        pcs.__salt__,
        {
            "cmd.run_all": mock_cmd,
            "pkg.version_cmp": MagicMock(return_value=ver_cmp_ret),
        },
    )
    with patch_salt:
        pcs.auth(
            test_data.nodes,
            pcsuser=test_data.username,
            pcspasswd=test_data.password,
            extra_args=test_data.extra_args,
        )
    assert mock_cmd.call_args_list[0][0][0] == exp_cmd