BigW Consortium Gitlab
Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
G
gitlab-ce
Project
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
Registry
Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Commits
Issue Boards
Open sidebar
Forest Godfrey
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
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
4 additions
and
7 deletions
+4
-7
base.rb
qa/qa/runtime/key/base.rb
+1
-6
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
...
@@ -21,12 +21,7 @@ module QA
def
ssh_keygen
(
name
,
bits
,
path
)
def
ssh_keygen
(
name
,
bits
,
path
)
cmd
=
%W[ssh-keygen -t
#{
name
}
-b
#{
bits
}
-f
#{
path
}
-N]
<<
''
cmd
=
%W[ssh-keygen -t
#{
name
}
-b
#{
bits
}
-f
#{
path
}
-N]
<<
''
IO
.
popen
([
*
cmd
,
err:
%i[child out]
])
do
|
io
|
Service
::
Shellout
.
shell
(
cmd
)
out
=
io
.
read
io
.
close
raise
"ssh-keygen failed with output:
#{
out
}
"
unless
$?
.
success?
end
end
end
def
populate_key_data
(
path
)
def
populate_key_data
(
path
)
...
...
qa/qa/service/shellout.rb
View file @
9d9ee761
...
@@ -5,6 +5,8 @@ module QA
...
@@ -5,6 +5,8 @@ module QA
module
Shellout
module
Shellout
CommandError
=
Class
.
new
(
StandardError
)
CommandError
=
Class
.
new
(
StandardError
)
module_function
##
##
# TODO, make it possible to use generic QA framework classes
# TODO, make it possible to use generic QA framework classes
# as a library - gitlab-org/gitlab-qa#94
# as a library - gitlab-org/gitlab-qa#94
...
@@ -12,7 +14,7 @@ module QA
...
@@ -12,7 +14,7 @@ module QA
def
shell
(
command
)
def
shell
(
command
)
puts
"Executing `
#{
command
}
`"
puts
"Executing `
#{
command
}
`"
Open3
.
popen2e
(
command
)
do
|
_in
,
out
,
wait
|
Open3
.
popen2e
(
*
command
)
do
|
_in
,
out
,
wait
|
out
.
each
{
|
line
|
puts
line
}
out
.
each
{
|
line
|
puts
line
}
if
wait
.
value
.
exited?
&&
wait
.
value
.
exitstatus
.
nonzero?
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