From b8e5e29fc158eb98362f824f12a48dcedeca8e40 Mon Sep 17 00:00:00 2001 From: Jason Yellick Date: Wed, 23 May 2018 15:58:10 -0400 Subject: [PATCH] FAB-10343 TestNewGRPCServerInvalidParameters fix 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 --- core/comm/server_test.go | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/core/comm/server_test.go b/core/comm/server_test.go index f95f82399..790b17616 100644 --- a/core/comm/server_test.go +++ b/core/comm/server_test.go @@ -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 {