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
f82abfd9
Commit
f82abfd9
authored
3 years ago
by
Fabian Seidl
Browse files
Options
Downloads
Patches
Plain Diff
fixed problem with accessing nil stores
parent
7e7e7ee3
No related branches found
No related tags found
1 merge request
!287
Implement data persisting for user management
Pipeline
#99443
passed
3 years ago
Stage: build
Stage: test
Stage: analyze
Stage: integration-test
Changes
2
Pipelines
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
controller/northbound/server/auth_test.go
+1
-7
1 addition, 7 deletions
controller/northbound/server/auth_test.go
controller/northbound/server/pnd_test.go
+4
-0
4 additions, 0 deletions
controller/northbound/server/pnd_test.go
with
5 additions
and
7 deletions
controller/northbound/server/auth_test.go
+
1
−
7
View file @
f82abfd9
...
...
@@ -11,16 +11,12 @@ import (
)
func
Test_auth_Login
(
t
*
testing
.
T
)
{
type
fields
struct
{
UnimplementedAuthServiceServer
apb
.
UnimplementedAuthServiceServer
}
type
args
struct
{
ctx
context
.
Context
request
*
apb
.
LoginRequest
}
tests
:=
[]
struct
{
name
string
fields
fields
args
args
want
string
wantErr
bool
...
...
@@ -41,7 +37,7 @@ func Test_auth_Login(t *testing.T) {
for
_
,
tt
:=
range
tests
{
t
.
Run
(
tt
.
name
,
func
(
t
*
testing
.
T
)
{
r
:=
Auth
{
UnimplementedAuthServiceServer
:
tt
.
fields
.
UnimplementedAuthServiceServer
,
UnimplementedAuthServiceServer
:
apb
.
UnimplementedAuthServiceServer
{}
,
jwtManager
:
jwt
,
}
resp
,
err
:=
r
.
Login
(
tt
.
args
.
ctx
,
tt
.
args
.
request
)
...
...
@@ -63,7 +59,6 @@ func Test_auth_Login(t *testing.T) {
func
Test_auth_Logout
(
t
*
testing
.
T
)
{
type
fields
struct
{
UnimplementedAuthServiceServer
apb
.
UnimplementedAuthServiceServer
jwt
rbac
.
JWTManager
}
type
args
struct
{
ctx
context
.
Context
...
...
@@ -82,7 +77,6 @@ func Test_auth_Logout(t *testing.T) {
t
.
Run
(
tt
.
name
,
func
(
t
*
testing
.
T
)
{
r
:=
Auth
{
UnimplementedAuthServiceServer
:
tt
.
fields
.
UnimplementedAuthServiceServer
,
jwtManager
:
&
tt
.
fields
.
jwt
,
}
got
,
err
:=
r
.
Logout
(
tt
.
args
.
ctx
,
tt
.
args
.
request
)
if
(
err
!=
nil
)
!=
tt
.
wantErr
{
...
...
This diff is collapsed.
Click to expand it.
controller/northbound/server/pnd_test.go
+
4
−
0
View file @
f82abfd9
...
...
@@ -15,6 +15,7 @@ import (
"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/nucleus"
"code.fbi.h-da.de/danet/gosdn/controller/rbac"
"code.fbi.h-da.de/danet/yang-models/generated/openconfig"
"github.com/golang/protobuf/proto"
"github.com/google/go-cmp/cmp"
...
...
@@ -147,6 +148,9 @@ func TestMain(m *testing.M) {
log
.
Fatal
(
err
)
}
userc
=
rbac
.
NewUserStore
()
rolec
=
rbac
.
NewRoleStore
()
os
.
Exit
(
m
.
Run
())
}
...
...
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