Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
K
k3s
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Registry
Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Jacklull
k3s
Commits
6194bfb8
Commit
6194bfb8
authored
Sep 13, 2016
by
Johnny Bieren
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix audit_test regex for iso8601 timestamps
Signed-off-by:
Johnny Bieren
<
jbieren@redhat.com
>
parent
0d3799b8
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
2 additions
and
2 deletions
+2
-2
audit_test.go
pkg/apiserver/audit/audit_test.go
+2
-2
No files found.
pkg/apiserver/audit/audit_test.go
View file @
6194bfb8
...
@@ -95,14 +95,14 @@ func TestAudit(t *testing.T) {
...
@@ -95,14 +95,14 @@ func TestAudit(t *testing.T) {
if
len
(
line
)
!=
2
{
if
len
(
line
)
!=
2
{
t
.
Fatalf
(
"Unexpected amount of lines in audit log: %d"
,
len
(
line
))
t
.
Fatalf
(
"Unexpected amount of lines in audit log: %d"
,
len
(
line
))
}
}
match
,
err
:=
regexp
.
MatchString
(
`[\d\:\-\.\+]+ AUDIT: id="[\w-]+" ip="127.0.0.1" method="GET" user="admin" as="<self>" namespace="default" uri="/api/v1/namespaces/default/pods"`
,
line
[
0
])
match
,
err
:=
regexp
.
MatchString
(
`[\d\:\-\.\+
,T,Z
]+ AUDIT: id="[\w-]+" ip="127.0.0.1" method="GET" user="admin" as="<self>" namespace="default" uri="/api/v1/namespaces/default/pods"`
,
line
[
0
])
if
err
!=
nil
{
if
err
!=
nil
{
t
.
Errorf
(
"Unexpected error matching first line: %v"
,
err
)
t
.
Errorf
(
"Unexpected error matching first line: %v"
,
err
)
}
}
if
!
match
{
if
!
match
{
t
.
Errorf
(
"Unexpected first line of audit: %s"
,
line
[
0
])
t
.
Errorf
(
"Unexpected first line of audit: %s"
,
line
[
0
])
}
}
match
,
err
=
regexp
.
MatchString
(
`[\d\:\-\.\+]+ AUDIT: id="[\w-]+" response="200"`
,
line
[
1
])
match
,
err
=
regexp
.
MatchString
(
`[\d\:\-\.\+
,T,Z
]+ AUDIT: id="[\w-]+" response="200"`
,
line
[
1
])
if
err
!=
nil
{
if
err
!=
nil
{
t
.
Errorf
(
"Unexpected error matching second line: %v"
,
err
)
t
.
Errorf
(
"Unexpected error matching second line: %v"
,
err
)
}
}
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment