diff --git a/gnmi_server/server_test.go b/gnmi_server/server_test.go index 5b21e049..13b70342 100644 --- a/gnmi_server/server_test.go +++ b/gnmi_server/server_test.go @@ -23,7 +23,7 @@ import ( "reflect" "testing" "time" - "runtime + "runtime" "crypto/x509" "crypto/x509/pkix" @@ -4245,29 +4245,28 @@ func (x *MockSetPackageServer) Recv() (*gnoi_system_pb.SetPackageRequest, error) func TestGnoiAuthorization(t *testing.T) { s := createServer(t, 8081) go runServer(t, s) - systemSrv := &SystemServer{Server: s} mockAuthenticate := gomonkey.ApplyFunc(s.Authenticate, func(ctx context.Context, req *spb_jwt.AuthenticateRequest) (*spb_jwt.AuthenticateResponse, error) { return nil, nil }) defer mockAuthenticate.Reset() - err := systemSrv.Ping(new(gnoi_system_pb.PingRequest), new(MockPingServer)) + err := s.Ping(new(gnoi_system_pb.PingRequest), new(MockPingServer)) if err == nil { t.Errorf("Ping should failed, because not implement.") } - systemSrv.Traceroute(new(gnoi_system_pb.TracerouteRequest), new(MockTracerouteServer)) + s.Traceroute(new(gnoi_system_pb.TracerouteRequest), new(MockTracerouteServer)) if err == nil { t.Errorf("Traceroute should failed, because not implement.") } - systemSrv.SetPackage(new(MockSetPackageServer)) + s.SetPackage(new(MockSetPackageServer)) if err == nil { t.Errorf("SetPackage should failed, because not implement.") } ctx := context.Background() - systemSrv.SwitchControlProcessor(ctx, new(gnoi_system_pb.SwitchControlProcessorRequest)) + s.SwitchControlProcessor(ctx, new(gnoi_system_pb.SwitchControlProcessorRequest)) if err == nil { t.Errorf("SwitchControlProcessor should failed, because not implement.") }