Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
G
gitlab-ce
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
1
Merge Requests
1
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
nexedi
gitlab-ce
Commits
20049ba0
Commit
20049ba0
authored
Sep 05, 2019
by
Michael Kozono
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add test for LFS push over SSH on secondary
parent
3b9238b7
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
39 additions
and
1 deletion
+39
-1
ee/spec/requests/api/internal/base_spec.rb
ee/spec/requests/api/internal/base_spec.rb
+39
-1
No files found.
ee/spec/requests/api/internal_spec.rb
→
ee/spec/requests/api/internal
/base
_spec.rb
View file @
20049ba0
# frozen_string_literal: true
# frozen_string_literal: true
require
'spec_helper'
require
'spec_helper'
describe
API
::
Internal
do
describe
API
::
Internal
::
Base
do
include
EE
::
GeoHelpers
describe
"POST /internal/allowed"
do
describe
"POST /internal/allowed"
do
set
(
:user
)
{
create
(
:user
)
}
set
(
:user
)
{
create
(
:user
)
}
set
(
:key
)
{
create
(
:key
,
user:
user
)
}
set
(
:key
)
{
create
(
:key
,
user:
user
)
}
...
@@ -144,4 +146,40 @@ describe API::Internal do
...
@@ -144,4 +146,40 @@ describe API::Internal do
end
end
end
end
end
end
describe
"POST /internal/lfs_authenticate"
do
let
(
:user
)
{
create
(
:user
)
}
let
(
:project
)
{
create
(
:project
,
:repository
)
}
let
(
:secret_token
)
{
Gitlab
::
Shell
.
secret_token
}
context
'for a secondary node'
do
let!
(
:primary
)
{
create
(
:geo_node
,
:primary
)
}
let!
(
:secondary
)
{
create
(
:geo_node
)
}
before
do
stub_current_geo_node
(
secondary
)
project
.
add_developer
(
user
)
end
it
'returns the repository_http_path at the primary node'
do
expect
(
Project
).
to
receive
(
:find_by_full_path
).
and_return
(
project
)
lfs_auth_user
(
user
.
id
,
project
)
expect
(
response
).
to
have_gitlab_http_status
(
200
)
expect
(
json_response
[
'repository_http_path'
]).
to
eq
(
geo_primary_http_url_to_repo
(
project
))
end
end
def
lfs_auth_user
(
user_id
,
project
)
post
(
api
(
"/internal/lfs_authenticate"
),
params:
{
user_id:
user_id
,
secret_token:
secret_token
,
project:
project
.
full_path
}
)
end
end
end
end
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment