Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
G
goatherd
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Container Registry
Model registry
Operate
Environments
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
arw
goatherd
Commits
8ff88f52
Commit
8ff88f52
authored
7 years ago
by
Lukas Braun
Browse files
Options
Downloads
Patches
Plain Diff
goatherd_test: Check if userlocks entry exists before (un-)locked
parent
2708e349
No related branches found
Branches containing commit
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
goatherd_test.go
+9
-5
9 additions, 5 deletions
goatherd_test.go
with
9 additions
and
5 deletions
goatherd_test.go
+
9
−
5
View file @
8ff88f52
...
@@ -278,8 +278,8 @@ func handleConnT(t *testing.T) {
...
@@ -278,8 +278,8 @@ func handleConnT(t *testing.T) {
if
answer
!=
""
{
if
answer
!=
""
{
t
.
Error
(
"answer:"
,
answer
)
t
.
Error
(
"answer:"
,
answer
)
}
}
if
faildelay
.
userlocks
[
"dummy user"
]
!=
nil
{
if
_
,
ok
:=
faildelay
.
userlocks
[
"dummy user"
]
;
ok
{
t
.
Error
(
"userlock created for dummy user"
)
t
.
Error
(
"userlock
entry
created for dummy user"
)
}
}
})
})
...
@@ -296,8 +296,10 @@ func handleConnT(t *testing.T) {
...
@@ -296,8 +296,10 @@ func handleConnT(t *testing.T) {
if
answer
!=
"FAIL"
{
if
answer
!=
"FAIL"
{
t
.
Error
(
"answer:"
,
answer
)
t
.
Error
(
"answer:"
,
answer
)
}
}
if
faildelay
.
userlocks
[
username
]
==
nil
{
if
ul
,
ok
:=
faildelay
.
userlocks
[
username
];
!
ok
{
t
.
Error
(
"userlock not in map"
)
t
.
Error
(
"no entry in userlocks"
)
}
else
if
ul
!=
delay
{
t
.
Error
(
"entry in userlocks is not the returned lock"
)
}
}
})
})
...
@@ -311,7 +313,9 @@ func handleConnT(t *testing.T) {
...
@@ -311,7 +313,9 @@ func handleConnT(t *testing.T) {
if
delay
!=
nil
{
if
delay
!=
nil
{
t
.
Fail
()
t
.
Fail
()
}
}
if
*
faildelay
.
userlocks
[
username
]
!=
unlocked
{
if
ul
,
ok
:=
faildelay
.
userlocks
[
username
];
!
ok
{
t
.
Error
(
"no entry in userlocks"
)
}
else
if
*
ul
!=
unlocked
{
t
.
Error
(
"userlock not unlocked"
)
t
.
Error
(
"userlock not unlocked"
)
}
}
if
answer
!=
"OK"
{
if
answer
!=
"OK"
{
...
...
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