Commit 01405c86 authored by Mitchell Hashimoto's avatar Mitchell Hashimoto

packer/rpc: Use the proper Server for tests

parent 5aec3f67
......@@ -23,17 +23,15 @@ func TestUiRPC(t *testing.T) {
// Create the UI to test
ui := new(testUi)
uiServer := &UiServer{ui}
// Start the RPC server
readyChan := make(chan int)
stopChan := make(chan int)
defer func() { stopChan <- 1 }()
go testRPCServer(":1234", "Ui", uiServer, readyChan, stopChan)
<-readyChan
server := NewServer()
server.RegisterUi(ui)
server.Start()
defer server.Stop()
// 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 {
panic(err)
}
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment