diff options
author | Stan Hu <stanhu@gmail.com> | 2018-01-10 13:03:31 -0800 |
---|---|---|
committer | Nick Thomas <nick@gitlab.com> | 2018-01-12 14:36:45 +0000 |
commit | 9ac02447386495c54236e8e8ba702a54931a4e61 (patch) | |
tree | 2f9123523a76d78bbff0594522f077ef4ea015ac /spec/gitlab_shell_spec.rb | |
parent | 58ceab7279066faaaa15e16afb842fee4b7eff49 (diff) | |
download | gitlab-shell-9ac02447386495c54236e8e8ba702a54931a4e61.tar.gz |
Remove special case treatment of Geo nodes for SSH
We removed SSH support in https://gitlab.com/gitlab-org/gitlab-ee/merge_requests/3553,
so we no longer need the ability to show all refs for Geo nodes.
Closes #115
Diffstat (limited to 'spec/gitlab_shell_spec.rb')
-rw-r--r-- | spec/gitlab_shell_spec.rb | 42 |
1 files changed, 3 insertions, 39 deletions
diff --git a/spec/gitlab_shell_spec.rb b/spec/gitlab_shell_spec.rb index e4873c4..a71e2d0 100644 --- a/spec/gitlab_shell_spec.rb +++ b/spec/gitlab_shell_spec.rb @@ -25,8 +25,7 @@ describe GitlabShell do gl_repository: gl_repository, gl_username: gl_username, repository_path: repo_path, - gitaly: { 'repository' => { 'relative_path' => repo_name, 'storage_name' => 'default'} , 'address' => 'unix:gitaly.socket' }, - geo_node: false + gitaly: { 'repository' => { 'relative_path' => repo_name, 'storage_name' => 'default'} , 'address' => 'unix:gitaly.socket' } ) } @@ -39,8 +38,7 @@ describe GitlabShell do gl_repository: gl_repository, gl_username: gl_username, repository_path: repo_path, - gitaly: nil, - geo_node: nil)) + gitaly: nil)) api.stub(two_factor_recovery_codes: { 'success' => true, 'recovery_codes' => ['f67c514de60c4953', '41278385fc00c1e0'] @@ -182,25 +180,6 @@ describe GitlabShell do it_behaves_like 'upload-pack', 'git upload-pack' end - context 'gitaly-upload-pack with GeoNode' do - let(:ssh_cmd) { "git-upload-pack gitlab-ci.git" } - let(:gitaly_check_access_with_geo) { GitAccessStatus.new( - true, - 'ok', - gl_repository: gl_repository, - gl_username: gl_username, - repository_path: repo_path, - gitaly: { 'repository' => { 'relative_path' => repo_name, 'storage_name' => 'default'} , 'address' => 'unix:gitaly.socket' }, - geo_node: true) } - let(:gitaly_message_with_all_refs) { JSON.dump({ 'repository' => { 'relative_path' => repo_name, 'storage_name' => 'default' }, 'gl_repository' => gl_repository , 'gl_id' => key_id, 'gl_username' => gl_username, 'git_config_options' => [GitlabShell::GIT_CONFIG_SHOW_ALL_REFS]}) } - before { api.stub(check_access: gitaly_check_access_with_geo) } - after { subject.exec(ssh_cmd) } - - it "should execute the command with unhiding refs" do - subject.should_receive(:exec_cmd).with(File.join(ROOT_PATH, "bin/gitaly-upload-pack"), 'unix:gitaly.socket', gitaly_message_with_all_refs) - end - end - context 'gitaly-upload-pack' do let(:ssh_cmd) { "git-upload-pack gitlab-ci.git" } before { @@ -376,8 +355,7 @@ describe GitlabShell do gl_repository: nil, gl_username: nil, repository_path: nil, - gitaly: nil, - geo_node: nil)) + gitaly: nil)) message = "gitlab-shell: Access denied for git command <git-upload-pack gitlab-ci.git> " message << "by user with key #{key_id}." $logger.should_receive(:warn).with(message) @@ -439,20 +417,6 @@ describe GitlabShell do shell.send :exec_cmd, [1, 2] end - context "when show_all_refs is enabled" do - before { shell.show_all_refs = true } - - it 'sets local git parameters' do - expected_hash = hash_including( - 'GIT_CONFIG_PARAMETERS' => "'transfer.hideRefs=!refs'" - ) - - Kernel.should_receive(:exec).with(expected_hash, [1, 2], exec_options).once - - shell.send :exec_cmd, [1, 2] - end - end - context "when specifying a git_tracing log file" do let(:git_trace_log_file) { '/tmp/git_trace_performance.log' } |