Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
P
packer
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
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Kristopher Ruzic
packer
Commits
01405c86
Commit
01405c86
authored
May 04, 2013
by
Mitchell Hashimoto
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
packer/rpc: Use the proper Server for tests
parent
5aec3f67
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
5 additions
and
7 deletions
+5
-7
packer/rpc/ui_test.go
packer/rpc/ui_test.go
+5
-7
No files found.
packer/rpc/ui_test.go
View file @
01405c86
...
@@ -23,17 +23,15 @@ func TestUiRPC(t *testing.T) {
...
@@ -23,17 +23,15 @@ func TestUiRPC(t *testing.T) {
// Create the UI to test
// Create the UI to test
ui
:=
new
(
testUi
)
ui
:=
new
(
testUi
)
uiServer
:=
&
UiServer
{
ui
}
// Start the RPC server
// Start the RPC server
readyChan
:=
make
(
chan
int
)
server
:=
NewServer
()
stopChan
:=
make
(
chan
int
)
server
.
RegisterUi
(
ui
)
defer
func
()
{
stopChan
<-
1
}()
server
.
Start
()
go
testRPCServer
(
":1234"
,
"Ui"
,
uiServer
,
readyChan
,
stopChan
)
defer
server
.
Stop
()
<-
readyChan
// Create the client over RPC and run some methods to verify it works
// Create the client over RPC and run some methods to verify it works
client
,
err
:=
rpc
.
Dial
(
"tcp"
,
":1234"
)
client
,
err
:=
rpc
.
Dial
(
"tcp"
,
server
.
Address
()
)
if
err
!=
nil
{
if
err
!=
nil
{
panic
(
err
)
panic
(
err
)
}
}
...
...
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