From 418f63cd0ffeb0e7c6b696cbc1176ffed0747ffd Mon Sep 17 00:00:00 2001 From: Manuel Kieweg <manuel.kieweg@h-da.de> Date: Fri, 14 May 2021 14:16:32 +0200 Subject: [PATCH] mvp --- cmd/addDevice.go | 6 --- northbound/client/client.go | 1 - northbound/server/server.go | 41 --------------------- test/integration/cmdIntegration_test.go | 3 +- test/integration/nucleusIntegration_test.go | 17 +++++---- 5 files changed, 11 insertions(+), 57 deletions(-) delete mode 100644 northbound/client/client.go delete mode 100644 northbound/server/server.go diff --git a/cmd/addDevice.go b/cmd/addDevice.go index 53e088001..8b905f44a 100644 --- a/cmd/addDevice.go +++ b/cmd/addDevice.go @@ -36,8 +36,6 @@ import ( "github.com/spf13/cobra" ) -var deviceName string - // addDeviceCmd represents the addDevice command var addDeviceCmd = &cobra.Command{ Use: "add-device", @@ -64,9 +62,5 @@ var deviceName string func init() { cliCmd.AddCommand(addDeviceCmd) -<<<<<<< HEAD addDeviceCmd.Flags().StringVar(&deviceName, "name", "", "add a device name (optional)") -======= - addDeviceCmd.PersistentFlags().StringVarP(&deviceName, "device-name", "n", "", "Human readable device name.") ->>>>>>> 8e2fe42b (Let user set a name for a device or autogenerate it) } diff --git a/northbound/client/client.go b/northbound/client/client.go deleted file mode 100644 index da13c8ef3..000000000 --- a/northbound/client/client.go +++ /dev/null @@ -1 +0,0 @@ -package client diff --git a/northbound/server/server.go b/northbound/server/server.go deleted file mode 100644 index 592504b0a..000000000 --- a/northbound/server/server.go +++ /dev/null @@ -1,41 +0,0 @@ -package server - -import ( - pb "code.fbi.h-da.de/cocsn/api/proto/gosdn" - "code.fbi.h-da.de/cocsn/gosdn/nucleus" - "context" - "sync" -) - -var pndLock sync.RWMutex -var sbiLock sync.RWMutex -var pndc *nucleus.PndStore -var sbic *nucleus.SbiStore - -type gosdnServer struct { - pb.UnimplementedGosdnServer -} - -func (s gosdnServer) Get(ctx context.Context, request *pb.GetRequest) (*pb.GetResponse, error) { - panic("implement me") -} - -func (s gosdnServer) Set(ctx context.Context, request *pb.SetRequest) (*pb.SetResponse, error) { - panic("implement me") -} - -func NewNBI(pnds *nucleus.PndStore, sbis *nucleus.SbiStore) *NorthboundInterface { - pndc = pnds - sbic = sbis - pndLock = sync.RWMutex{} - sbiLock = sync.RWMutex{} - return &NorthboundInterface{ - Pnd: &pndServer{}, - Controller: &gosdnServer{}, - } -} - -type NorthboundInterface struct { - Pnd *pndServer - Controller *gosdnServer -} diff --git a/test/integration/cmdIntegration_test.go b/test/integration/cmdIntegration_test.go index 315d0d3e7..b91547203 100644 --- a/test/integration/cmdIntegration_test.go +++ b/test/integration/cmdIntegration_test.go @@ -1,10 +1,11 @@ package integration import ( - tpb "code.fbi.h-da.de/cocsn/api/go/gosdn/transport" "os" "testing" + tpb "code.fbi.h-da.de/cocsn/api/go/gosdn/transport" + "code.fbi.h-da.de/cocsn/gosdn/cli" "code.fbi.h-da.de/cocsn/gosdn/nucleus/util/proto" guuid "github.com/google/uuid" diff --git a/test/integration/nucleusIntegration_test.go b/test/integration/nucleusIntegration_test.go index b9136c0b2..4a5a29eeb 100644 --- a/test/integration/nucleusIntegration_test.go +++ b/test/integration/nucleusIntegration_test.go @@ -1,14 +1,15 @@ 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" "testing" "time" + 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/nucleus" "code.fbi.h-da.de/cocsn/gosdn/nucleus/types" @@ -171,10 +172,10 @@ func TestGnmi_SubscribeIntegration(t *testing.T) { name: "default", fields: fields{ opt: &tpb.TransportOption{ - Address: "", - Username: "", - Password: "", - Tls: false, + Address: "", + Username: "", + Password: "", + Tls: false, TransportOption: &tpb.TransportOption_GnmiTransportOption{ GnmiTransportOption: &tpb.GnmiTransportOption{ Compression: "", @@ -225,7 +226,7 @@ func TestGnmi_SubscribeIntegration(t *testing.T) { name: "destination unreachable", fields: fields{ opt: &tpb.TransportOption{ - Address: "203.0.113.10:6030", + Address: "203.0.113.10:6030", }, }, args: args{ @@ -302,7 +303,7 @@ func TestGnmi_CapabilitiesIntegration(t *testing.T) { { name: "destination unreachable", fields: fields{opt: &tpb.TransportOption{ - Address: "203.0.113.10:6030", + Address: "203.0.113.10:6030", }, }, args: args{ctx: context.Background()}, -- GitLab