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
9d9ee761
Commit
9d9ee761
authored
Mar 28, 2018
by
Lin Jen-Shin
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Use Service::Shellout.shell to spawn a command
parent
4e712f76
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
4 additions
and
7 deletions
+4
-7
qa/qa/runtime/key/base.rb
qa/qa/runtime/key/base.rb
+1
-6
qa/qa/service/shellout.rb
qa/qa/service/shellout.rb
+3
-1
No files found.
qa/qa/runtime/key/base.rb
View file @
9d9ee761
...
...
@@ -21,12 +21,7 @@ module QA
def
ssh_keygen
(
name
,
bits
,
path
)
cmd
=
%W[ssh-keygen -t
#{
name
}
-b
#{
bits
}
-f
#{
path
}
-N]
<<
''
IO
.
popen
([
*
cmd
,
err:
%i[child out]
])
do
|
io
|
out
=
io
.
read
io
.
close
raise
"ssh-keygen failed with output:
#{
out
}
"
unless
$?
.
success?
end
Service
::
Shellout
.
shell
(
cmd
)
end
def
populate_key_data
(
path
)
...
...
qa/qa/service/shellout.rb
View file @
9d9ee761
...
...
@@ -5,6 +5,8 @@ module QA
module
Shellout
CommandError
=
Class
.
new
(
StandardError
)
module_function
##
# TODO, make it possible to use generic QA framework classes
# as a library - gitlab-org/gitlab-qa#94
...
...
@@ -12,7 +14,7 @@ module QA
def
shell
(
command
)
puts
"Executing `
#{
command
}
`"
Open3
.
popen2e
(
command
)
do
|
_in
,
out
,
wait
|
Open3
.
popen2e
(
*
command
)
do
|
_in
,
out
,
wait
|
out
.
each
{
|
line
|
puts
line
}
if
wait
.
value
.
exited?
&&
wait
.
value
.
exitstatus
.
nonzero?
...
...
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