diff --git a/cli/subscribe.go b/cli/subscribe.go index 5b3df54873ab56c0a7f16757daca943219e4cee1..3be7882a56e7ace64c334502f7c43e08d61455c4 100644 --- a/cli/subscribe.go +++ b/cli/subscribe.go @@ -21,7 +21,7 @@ import ( func Subscribe(address, username, password, deviceName string, sample, heartbeat int64, args ...string) error { sbi := &nucleus.OpenConfig{} tOpts := &tpb.TransportOption{ - Addr: address, + Address: address, Username: username, Password: password, Tls: false, diff --git a/controller.go b/controller.go index 0f5b4085ff4c49fdad703419cdcb262e57ad227b..cc648ed38b27c56f104f243f2c83fa0573ac92ce 100644 --- a/controller.go +++ b/controller.go @@ -1,6 +1,7 @@ package gosdn import ( + spb "code.fbi.h-da.de/cocsn/api/go/gosdn/southbound" "context" "net" "net/http" diff --git a/northbound/server/pnd.go b/northbound/server/pnd.go index 00bd6e0b44817f827fb76aa3d4a24ff50acd58ef..23f8e55247d667c1fdf2808a54cf65086782483d 100644 --- a/northbound/server/pnd.go +++ b/northbound/server/pnd.go @@ -288,7 +288,11 @@ func handleSetSbi(pnd nucleus.PrincipalNetworkDomain, req []*ppb.SetSbi) (*ppb.S } func handleSetChange(pnd nucleus.PrincipalNetworkDomain, req []*ppb.SetChange) (*ppb.SetResponse, error) { +<<<<<<< HEAD for _, r := range req { +======= + for _,r := range req { +>>>>>>> 4a937a94 (nbi implementation done) cuid, err := uuid.Parse(r.Cuid) if err != nil { return nil, err @@ -316,7 +320,11 @@ func handleSetChange(pnd nucleus.PrincipalNetworkDomain, req []*ppb.SetChange) ( } func handleChangeRequest(pnd nucleus.PrincipalNetworkDomain, req []*ppb.ChangeRequest) (*ppb.SetResponse, error) { +<<<<<<< HEAD for _, r := range req { +======= + for _,r := range req { +>>>>>>> 4a937a94 (nbi implementation done) did, err := uuid.Parse(r.Id) if err != nil { return nil, err diff --git a/nucleus/change.go b/nucleus/change.go index 231f217046e7a46253287c4e66729c0682b69313..baadc1afcbe03a923d9fe44111854773a3120098 100644 --- a/nucleus/change.go +++ b/nucleus/change.go @@ -1,6 +1,7 @@ package nucleus import ( + ppb "code.fbi.h-da.de/cocsn/api/go/gosdn/pnd" "errors" "os" "sync" diff --git a/nucleus/gnmi_transport.go b/nucleus/gnmi_transport.go index 1834ce7e13e9acd6e5bf2ea7871b960f01bf3d98..c293bc3eb23e96e124a61afa4c33b56e0a1e81fd 100644 --- a/nucleus/gnmi_transport.go +++ b/nucleus/gnmi_transport.go @@ -1,6 +1,7 @@ package nucleus import ( + ppb "code.fbi.h-da.de/cocsn/api/go/gosdn/pnd" "context" "reflect" diff --git a/nucleus/gnmi_transport_test.go b/nucleus/gnmi_transport_test.go index 2809e20967645351ce55ac30361dfc9965edb2ef..6e61ffe3abc317ee8f6fb01e96b2208783d90626 100644 --- a/nucleus/gnmi_transport_test.go +++ b/nucleus/gnmi_transport_test.go @@ -1,7 +1,6 @@ package nucleus import ( - tpb "code.fbi.h-da.de/cocsn/api/go/gosdn/transport" "context" "errors" "reflect" @@ -10,6 +9,9 @@ import ( spb "code.fbi.h-da.de/cocsn/api/go/gosdn/southbound" tpb "code.fbi.h-da.de/cocsn/api/go/gosdn/transport" + spb "code.fbi.h-da.de/cocsn/api/go/gosdn/southbound" + tpb "code.fbi.h-da.de/cocsn/api/go/gosdn/transport" + "code.fbi.h-da.de/cocsn/gosdn/forks/goarista/gnmi" "code.fbi.h-da.de/cocsn/gosdn/mocks" "code.fbi.h-da.de/cocsn/yang-models/generated/openconfig" @@ -483,8 +485,6 @@ func TestNewGnmiTransport(t *testing.T) { Compression: "brotli", }, }}}, -<<<<<<< HEAD -======= want: nil, wantErr: true, }, @@ -495,7 +495,7 @@ func TestNewGnmiTransport(t *testing.T) { TransportOption: &tpb.TransportOption_GnmiTransportOption{ GnmiTransportOption: &tpb.GnmiTransportOption{ GrpcDialOptions: map[string]string{ - "cert-file":"invalid", + "cert-file": "invalid", }, }, }}}, @@ -503,17 +503,16 @@ func TestNewGnmiTransport(t *testing.T) { wantErr: true, }, { - name: "certificate error no ca file", - args: args{ + name: "certificate error no ca file", + args: args{ opts: &tpb.TransportOption{ TransportOption: &tpb.TransportOption_GnmiTransportOption{ GnmiTransportOption: &tpb.GnmiTransportOption{ GrpcDialOptions: map[string]string{ - "ca-file":"invalid", + "ca-file": "invalid", }, }, }}}, ->>>>>>> 55fb68b4 (moved transport options to proto) want: nil, wantErr: true, }, @@ -523,11 +522,8 @@ func TestNewGnmiTransport(t *testing.T) { if tt.name == "default" { startGnmiTarget <- gnmiConfig.Addr } -<<<<<<< HEAD + got, err := NewGnmiTransport(tt.args.opts, NewSBI(spb.Type_OPENCONFIG)) -======= - got, err := NewGnmiTransport(tt.args.opts, &OpenConfig{}) ->>>>>>> 55fb68b4 (moved transport options to proto) if (err != nil) != tt.wantErr { t.Errorf("NewGnmiTransport() error = %v, wantErr %v", err, tt.wantErr) return diff --git a/nucleus/transport.go b/nucleus/transport.go index 62de98b5ecff9f7c0351ca82c9bd9856565a8734..dded3c4b299dcf9e9046b52e9c18c5f52dfe737e 100644 --- a/nucleus/transport.go +++ b/nucleus/transport.go @@ -1,16 +1,10 @@ package nucleus import ( -<<<<<<< HEAD "context" tpb "code.fbi.h-da.de/cocsn/api/go/gosdn/transport" "code.fbi.h-da.de/cocsn/gosdn/nucleus/errors" -======= - tpb "code.fbi.h-da.de/cocsn/api/go/gosdn/transport" - "code.fbi.h-da.de/cocsn/gosdn/nucleus/errors" - "context" ->>>>>>> 55fb68b4 (moved transport options to proto) "github.com/openconfig/ygot/ytypes" ) @@ -28,15 +22,12 @@ type Transport interface { // NewTransport receives TransportOptions and returns an appropriate Transport // implementation func NewTransport(opts *tpb.TransportOption, sbi SouthboundInterface) (Transport, error) { -<<<<<<< HEAD if opts == nil { return nil, &errors.ErrInvalidParameters{ Func: NewTransport, Param: "'opt' cannot be 'nil'", } } -======= ->>>>>>> 55fb68b4 (moved transport options to proto) switch o := opts.TransportOption.(type) { case *tpb.TransportOption_GnmiTransportOption: return NewGnmiTransport(opts, sbi) diff --git a/test/integration/cmdIntegration_test.go b/test/integration/cmdIntegration_test.go index b91547203d7098d66689cfe13eed1d8bb7d11992..e81b3c9875b65211eafdca367c4af52586e0cbab 100644 --- a/test/integration/cmdIntegration_test.go +++ b/test/integration/cmdIntegration_test.go @@ -1,6 +1,7 @@ package integration import ( + tpb "code.fbi.h-da.de/cocsn/api/go/gosdn/transport" "os" "testing" diff --git a/test/integration/nucleusIntegration_test.go b/test/integration/nucleusIntegration_test.go index 4a5a29eebeb8d7acb0c0fdf7310314b83000694a..294c6546e4f08e2befe4d5478036e09263e10798 100644 --- a/test/integration/nucleusIntegration_test.go +++ b/test/integration/nucleusIntegration_test.go @@ -1,6 +1,8 @@ package integration import ( + spb "code.fbi.h-da.de/cocsn/api/go/gosdn/southbound" + tpb "code.fbi.h-da.de/cocsn/api/go/gosdn/transport" "context" "reflect" "sort" @@ -226,7 +228,11 @@ func TestGnmi_SubscribeIntegration(t *testing.T) { name: "destination unreachable", fields: fields{ opt: &tpb.TransportOption{ +<<<<<<< HEAD Address: "203.0.113.10:6030", +======= + Address: "203.0.113.10:6030", +>>>>>>> 4a937a94 (nbi implementation done) }, }, args: args{ @@ -303,7 +309,11 @@ func TestGnmi_CapabilitiesIntegration(t *testing.T) { { name: "destination unreachable", fields: fields{opt: &tpb.TransportOption{ +<<<<<<< HEAD Address: "203.0.113.10:6030", +======= + Address: "203.0.113.10:6030", +>>>>>>> 4a937a94 (nbi implementation done) }, }, args: args{ctx: context.Background()},