Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
goSDN
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Iterations
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Test cases
Artifacts
Deploy
Releases
Package registry
Container registry
Model registry
Operate
Terraform modules
Analyze
Contributor analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
danet
goSDN
Commits
fb9cd08b
Commit
fb9cd08b
authored
2 years ago
by
Fabian Seidl
Browse files
Options
Downloads
Patches
Plain Diff
fix generated test stub after merging changes from develop
parent
9a6ea08c
No related branches found
No related tags found
3 merge requests
!376
Add additional example application hostname-checker
,
!343
Add basic application framework and example application to show interaction between events an NBI
,
!342
Resolve "Add an option to send gNMI Subscribe requests via SBI"
Pipeline
#110100
failed
2 years ago
Stage: build
Stage: test
Stage: analyze
Stage: integration-test
Changes
1
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
controller/nucleus/principalNetworkDomain_test.go
+38
-48
38 additions, 48 deletions
controller/nucleus/principalNetworkDomain_test.go
with
38 additions
and
48 deletions
controller/nucleus/principalNetworkDomain_test.go
+
38
−
48
View file @
fb9cd08b
...
@@ -7,11 +7,13 @@ import (
...
@@ -7,11 +7,13 @@ import (
"testing"
"testing"
"code.fbi.h-da.de/danet/gosdn/api/go/gosdn/csbi"
"code.fbi.h-da.de/danet/gosdn/api/go/gosdn/csbi"
cpb
"code.fbi.h-da.de/danet/gosdn/api/go/gosdn/csbi"
ppb
"code.fbi.h-da.de/danet/gosdn/api/go/gosdn/pnd"
ppb
"code.fbi.h-da.de/danet/gosdn/api/go/gosdn/pnd"
spb
"code.fbi.h-da.de/danet/gosdn/api/go/gosdn/southbound"
spb
"code.fbi.h-da.de/danet/gosdn/api/go/gosdn/southbound"
tpb
"code.fbi.h-da.de/danet/gosdn/api/go/gosdn/transport"
tpb
"code.fbi.h-da.de/danet/gosdn/api/go/gosdn/transport"
eventservice
"code.fbi.h-da.de/danet/gosdn/controller/eventService"
eventservice
"code.fbi.h-da.de/danet/gosdn/controller/eventService"
"code.fbi.h-da.de/danet/gosdn/controller/interfaces/device"
"code.fbi.h-da.de/danet/gosdn/controller/interfaces/device"
eventInterfaces
"code.fbi.h-da.de/danet/gosdn/controller/interfaces/event"
"code.fbi.h-da.de/danet/gosdn/controller/interfaces/networkdomain"
"code.fbi.h-da.de/danet/gosdn/controller/interfaces/networkdomain"
"code.fbi.h-da.de/danet/gosdn/controller/interfaces/southbound"
"code.fbi.h-da.de/danet/gosdn/controller/interfaces/southbound"
"code.fbi.h-da.de/danet/gosdn/controller/mocks"
"code.fbi.h-da.de/danet/gosdn/controller/mocks"
...
@@ -1208,70 +1210,58 @@ func Test_pndImplementation_saveGoStructsToFile(t *testing.T) {
...
@@ -1208,70 +1210,58 @@ func Test_pndImplementation_saveGoStructsToFile(t *testing.T) {
}
}
func
Test_pndImplementation_SubscribePath
(
t
*
testing
.
T
)
{
func
Test_pndImplementation_SubscribePath
(
t
*
testing
.
T
)
{
type
fields
struct
{
Name
string
Description
string
southboundService
southbound
.
Service
deviceService
device
.
Service
changes
*
store
.
ChangeStore
Id
uuid
.
UUID
csbiClient
cpb
.
CsbiServiceClient
callback
func
(
uuid
.
UUID
,
chan
device
.
Details
)
eventService
eventInterfaces
.
Service
}
type
args
struct
{
type
args
struct
{
uuid
uuid
.
UUID
uuid
uuid
.
UUID
subList
*
ppb
.
SubscriptionList
subList
*
ppb
.
SubscriptionList
rErr
error
}
}
tests
:=
[]
struct
{
tests
:=
[]
struct
{
name
string
name
string
fields
fields
args
args
args
args
wantErr
bool
wantErr
bool
}{
}{
//TODO(faseid): Implement proper test here!
//TODO(faseid): Implement proper test here!
// {
// {
//
name: "default",
//
name: "default",
//
args: args{
//
args: args{
//
uuid: did,
//
uuid: did,
//
subList: &ppb.SubscriptionList{
//
subList: &ppb.SubscriptionList{
//
Subscription: []*ppb.Subscription{
//
Subscription: []*ppb.Subscription{
//
{
//
{
//
Path: "",
//
Path: "",
//
StreamMode: ppb.StreamMode_STREAM_MODE_SAMPLE,
//
StreamMode: ppb.StreamMode_STREAM_MODE_SAMPLE,
//
SampleInterval: 1000000000, // 1 second
//
SampleInterval: 1000000000, // 1 second
//
},
//
},
//
},
//
},
//
Mode: ppb.SubscriptionMode_SUBSCRIPTION_MODE_STREAM,
//
Mode: ppb.SubscriptionMode_SUBSCRIPTION_MODE_STREAM,
//
},
//
},
//
},
//
},
// },
// },
}
}
for
_
,
tt
:=
range
tests
{
for
_
,
tt
:=
range
tests
{
t
.
Run
(
tt
.
name
,
func
(
t
*
testing
.
T
)
{
t
.
Run
(
tt
.
name
,
func
(
t
*
testing
.
T
)
{
sbiService
:=
NewGenericService
[
southbound
.
SouthboundInterface
]()
pnd
:=
&
pndImplementation
{
deviceService
:=
NewGenericService
[
device
.
Device
]()
Name
:
tt
.
fields
.
Name
,
Description
:
tt
.
fields
.
Description
,
pnd
:=
pndImplementation
{
southboundService
:
tt
.
fields
.
southboundService
,
Name
:
"default"
,
deviceService
:
tt
.
fields
.
deviceService
,
Description
:
"default test pnd"
,
changes
:
tt
.
fields
.
changes
,
southboundService
:
&
sbiService
,
Id
:
tt
.
fields
.
Id
,
deviceService
:
&
deviceService
,
csbiClient
:
tt
.
fields
.
csbiClient
,
changes
:
store
.
NewChangeStore
(),
callback
:
tt
.
fields
.
callback
,
Id
:
defaultPndID
,
eventService
:
tt
.
fields
.
eventService
,
}
sbi
,
err
:=
NewSBI
(
spb
.
Type_TYPE_OPENCONFIG
)
if
err
!=
nil
{
t
.
Error
(
"could not create sbi"
)
}
err
=
pnd
.
addSbi
(
sbi
)
if
err
!=
nil
{
t
.
Error
(
"could not add sbi"
)
}
transport
:=
mocks
.
Transport
{}
transport
.
On
(
"Subscribe"
,
mockContext
,
mock
.
Anything
)
.
Return
(
&
gpb
.
SubscribeResponse
{},
tt
.
args
.
rErr
)
deviceWithMockTransport
:=
&
CommonDevice
{
UUID
:
mdid
,
Model
:
&
openconfig
.
Device
{},
sbi
:
sbi
,
transport
:
&
transport
,
}
}
_
,
_
=
pnd
.
addDevice
(
deviceWithMockTransport
)
if
err
:=
pnd
.
SubscribePath
(
tt
.
args
.
uuid
,
tt
.
args
.
subList
);
(
err
!=
nil
)
!=
tt
.
wantErr
{
if
err
:=
pnd
.
SubscribePath
(
tt
.
args
.
uuid
,
tt
.
args
.
subList
);
(
err
!=
nil
)
!=
tt
.
wantErr
{
t
.
Errorf
(
"pndImplementation.SubscribePath() error = %v, wantErr %v"
,
err
,
tt
.
wantErr
)
t
.
Errorf
(
"pndImplementation.SubscribePath() error = %v, wantErr %v"
,
err
,
tt
.
wantErr
)
}
}
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment