Skip to content

Commit

Permalink
FAB-10343 TestNewGRPCServerInvalidParameters fix
Browse files Browse the repository at this point in the history
The TestNewGRPCServerInvalidParameters test relies on one of three
particular error strings being returned by the platform to test.  On
some Linux platforms, the error returned is actually none of these
three.  So, this test adds yet another alternative error to this test.

Change-Id: Id6b21daf0943e247456f649998383dadbe140c0e
Signed-off-by: Jason Yellick <[email protected]>
  • Loading branch information
Jason Yellick committed May 23, 2018
1 parent 342fa4b commit b8e5e29
Showing 1 changed file with 7 additions and 3 deletions.
10 changes: 7 additions & 3 deletions core/comm/server_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -358,10 +358,14 @@ func TestNewGRPCServerInvalidParameters(t *testing.T) {
_, err = comm.NewGRPCServer("localhost:1BBB", comm.ServerConfig{
SecOpts: &comm.SecureOptions{UseTLS: false}})
//check for possible errors based on platform and Go release
msgs := [3]string{"listen tcp: lookup tcp/1BBB: nodename nor servname provided, or not known",
"listen tcp: unknown port tcp/1BBB", "listen tcp: address tcp/1BBB: unknown port"}
msgs := []string{
"listen tcp: lookup tcp/1BBB: nodename nor servname provided, or not known",
"listen tcp: unknown port tcp/1BBB",
"listen tcp: address tcp/1BBB: unknown port",
"listen tcp: lookup tcp/1BBB: Servname not supported for ai_socktype",
}

if assert.Error(t, err, fmt.Sprintf("[%s], [%s] or [%s] expected", msgs[0], msgs[1], msgs[2])) {
if assert.Error(t, err, fmt.Sprintf("[%s], [%s] [%s] or [%s] expected", msgs[0], msgs[1], msgs[2], msgs[3])) {
assert.Contains(t, msgs, err.Error())
}
if err != nil {
Expand Down

0 comments on commit b8e5e29

Please sign in to comment.