Skip to content
Snippets Groups Projects
Commit 418f63cd authored by Manuel Kieweg's avatar Manuel Kieweg
Browse files

mvp

parent 312fe18b
No related branches found
No related tags found
1 merge request!155Northbound Interface
This commit is part of merge request !155. Comments created here will be created in the context of that merge request.
......@@ -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)
}
package client
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
}
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"
......
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()},
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment