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
0
Merge Requests
0
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
Boxiang Sun
gitlab-ce
Commits
ccceb266
Commit
ccceb266
authored
Jan 18, 2018
by
Lin Jen-Shin
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Generate ssh key on the fly for QA
parent
ba02e3a5
Changes
6
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
27 additions
and
13 deletions
+27
-13
qa/Gemfile
qa/Gemfile
+1
-0
qa/Gemfile.lock
qa/Gemfile.lock
+3
-1
qa/qa.rb
qa/qa.rb
+1
-0
qa/qa/runtime/rsa_key.rb
qa/qa/runtime/rsa_key.rb
+21
-0
qa/qa/runtime/user.rb
qa/qa/runtime/user.rb
+0
-11
qa/qa/specs/features/project/add_deploy_key_spec.rb
qa/qa/specs/features/project/add_deploy_key_spec.rb
+1
-1
No files found.
qa/Gemfile
View file @
ccceb266
...
...
@@ -6,3 +6,4 @@ gem 'capybara-screenshot', '~> 1.0.18'
gem
'rake'
,
'~> 12.3.0'
gem
'rspec'
,
'~> 3.7'
gem
'selenium-webdriver'
,
'~> 3.8.0'
gem
'net-ssh'
,
require:
false
qa/Gemfile.lock
View file @
ccceb266
...
...
@@ -24,6 +24,7 @@ GEM
method_source (0.9.0)
mini_mime (1.0.0)
mini_portile2 (2.3.0)
net-ssh (4.1.0)
nokogiri (1.8.1)
mini_portile2 (~> 2.3.0)
pry (0.11.3)
...
...
@@ -63,10 +64,11 @@ PLATFORMS
DEPENDENCIES
capybara (~> 2.16.1)
capybara-screenshot (~> 1.0.18)
net-ssh
pry-byebug (~> 3.5.1)
rake (~> 12.3.0)
rspec (~> 3.7)
selenium-webdriver (~> 3.8.0)
BUNDLED WITH
1.16.
0
1.16.
1
qa/qa.rb
View file @
ccceb266
...
...
@@ -11,6 +11,7 @@ module QA
autoload
:Scenario
,
'qa/runtime/scenario'
autoload
:Browser
,
'qa/runtime/browser'
autoload
:Env
,
'qa/runtime/env'
autoload
:RSAKey
,
'qa/runtime/rsa_key'
end
##
...
...
qa/qa/runtime/rsa_key.rb
0 → 100644
View file @
ccceb266
require
'net/ssh'
require
'forwardable'
module
QA
module
Runtime
class
RSAKey
extend
Forwardable
def
initialize
(
bits
=
4096
)
@key
=
OpenSSL
::
PKey
::
RSA
.
new
(
bits
)
end
attr_reader
:key
def_delegators
:@key
,
:fingerprint
def
public_key
@public_key
||=
"
#{
key
.
ssh_type
}
#{
[
key
.
to_blob
].
pack
(
'm0'
)
}
"
end
end
end
end
qa/qa/runtime/user.rb
View file @
ccceb266
...
...
@@ -10,17 +10,6 @@ module QA
def
password
ENV
[
'GITLAB_PASSWORD'
]
||
'5iveL!fe'
end
def
ssh_key
<<~
KEY
.
delete
(
"
\n
"
)
ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABAQDFf6RYK3qu/RKF/3ndJmL5xgMLp3O9
6x8lTay+QGZ0+9FnnAXMdUqBq/ZU6d/gyMB4IaW3nHzM1w049++yAB6UPCzMB8Uo27K5
/jyZCtj7Vm9PFNjF/8am1kp46c/SeYicQgQaSBdzIW3UDEa1Ef68qroOlvpi9PYZ/tA7
M0YP0K5PXX+E36zaIRnJVMPT3f2k+GnrxtjafZrwFdpOP/Fol5BQLBgcsyiU+LM1SuaC
rzd8c9vyaTA1CxrkxaZh+buAi0PmdDtaDrHd42gqZkXCKavyvgM5o2CkQ5LJHCgzpXy0
5qNFzmThBSkb+XtoxbyagBiGbVZtSVow6Xa7qewz= dummy@gitlab.com
KEY
end
end
end
end
qa/qa/specs/features/project/add_deploy_key_spec.rb
View file @
ccceb266
module
QA
feature
'deploy keys support'
,
:core
do
given
(
:deploy_key_title
)
{
'deploy key title'
}
given
(
:deploy_key_value
)
{
Runtime
::
User
.
ssh
_key
}
given
(
:deploy_key_value
)
{
Runtime
::
RSAKey
.
new
.
public
_key
}
scenario
'user adds a deploy key'
do
Runtime
::
Browser
.
visit
(
:gitlab
,
Page
::
Main
::
Login
)
...
...
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