summaryrefslogtreecommitdiff
path: root/spec/gitlab_keys_spec.rb
diff options
context:
space:
mode:
authorRobert Speicher <robert@gitlab.com>2016-08-10 19:14:33 +0000
committerRobert Speicher <robert@gitlab.com>2016-08-10 19:14:33 +0000
commit1e3d15a71ed49a932c6539d1e783b5948f31192e (patch)
treee2b6d99a4a2c8c052f7bde59f061f46b1eda3413 /spec/gitlab_keys_spec.rb
parent0b73855f1b83818683f5a1de83090bb043a51616 (diff)
parent6e4ada2e9e215256dffffc20ec14960c1bbf17e9 (diff)
downloadgitlab-shell-1e3d15a71ed49a932c6539d1e783b5948f31192e.tar.gz
Merge branch 'permissions-create-keys' into 'master'
Update the keys permission check to open the file in write mode. That way the file is created if it does not exist. This will help simplify the check being running from omnibus. Currently we create the authorized_keys, file in omnibus. We want to instead have omnibus call check-permissions as the git user, to get around nfs root_squash issues with the authorized_keys file. See merge request !83
Diffstat (limited to 'spec/gitlab_keys_spec.rb')
-rw-r--r--spec/gitlab_keys_spec.rb7
1 files changed, 7 insertions, 0 deletions
diff --git a/spec/gitlab_keys_spec.rb b/spec/gitlab_keys_spec.rb
index adff6b4..d944278 100644
--- a/spec/gitlab_keys_spec.rb
+++ b/spec/gitlab_keys_spec.rb
@@ -183,6 +183,13 @@ describe GitlabKeys do
gitlab_keys.should_receive(:open_auth_file).and_raise("imaginary error")
expect(gitlab_keys.exec).to eq(false)
end
+
+ it 'creates the keys file if it does not exist' do
+ create_authorized_keys_fixture
+ FileUtils.rm(tmp_authorized_keys_path)
+ expect(gitlab_keys.exec).to eq(true)
+ expect(File.exist?(tmp_authorized_keys_path)).to eq(true)
+ end
end
describe :exec do