-
Notifications
You must be signed in to change notification settings - Fork 140
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
LOG-2172: fix ovn and oauthapi audit log collection #1438
Conversation
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: jcantrill The full list of commands accepted by this bot can be found here. The pull request process is described here
Needs approval from an approver in each of these files:
Approvers can indicate their approval by writing |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
are the application message formatting tests deleted by mistake? otherwise lgtm
It("should parse application log format correctly", func() { | ||
|
||
// Log message data | ||
message := "Functional test message" | ||
timestamp := "2020-11-04T18:13:59.061892+00:00" | ||
nanoTime, _ := time.Parse(time.RFC3339Nano, timestamp) | ||
|
||
// Template expected as output Log | ||
var outputLogTemplate = functional.NewApplicationLogTemplate() | ||
outputLogTemplate.Timestamp = nanoTime | ||
outputLogTemplate.Message = fmt.Sprintf("regex:^%s.*$", message) | ||
outputLogTemplate.Level = "*" | ||
|
||
// Write log line as input to fluentd | ||
applicationLogLine := functional.NewCRIOLogMessage(timestamp, message, false) | ||
Expect(framework.WriteMessagesToApplicationLog(applicationLogLine, 10)).To(BeNil()) | ||
|
||
// Read line from Log Forward output | ||
raw, err := framework.ReadRawApplicationLogsFrom(logging.OutputTypeFluentdForward) | ||
Expect(err).To(BeNil(), "Expected no errors reading the logs") | ||
|
||
// Parse log line | ||
var logs []types.ApplicationLog | ||
err = types.StrictlyParseLogs(utils.ToJsonLogs(raw), &logs) | ||
Expect(err).To(BeNil(), "Expected no errors parsing the logs") | ||
|
||
// Compare to expected template | ||
outputTestLog := logs[0] | ||
Expect(outputTestLog).To(FitLogFormatTemplate(outputLogTemplate)) | ||
}) | ||
|
||
It("should parse application log format correctly if log message contains 'stdout','stderr' (Bug 1889595)", func() { | ||
|
||
// Log message data | ||
message := "Functional test stdout stderr message " | ||
timestamp := "2020-11-04T18:13:59.061892+00:00" | ||
nanoTime, _ := time.Parse(time.RFC3339Nano, timestamp) | ||
|
||
// Template expected as output Log | ||
var outputLogTemplate = functional.NewApplicationLogTemplate() | ||
outputLogTemplate.Timestamp = nanoTime | ||
outputLogTemplate.Message = fmt.Sprintf("regex:^%s.*$", message) | ||
outputLogTemplate.Level = "*" | ||
|
||
// Write log line as input to fluentd | ||
applicationLogLine := fmt.Sprintf("%s stdout F %s $n", timestamp, message) | ||
Expect(framework.WriteMessagesToApplicationLog(applicationLogLine, 1)).To(BeNil()) | ||
// Read line from Log Forward output | ||
raw, err := framework.ReadRawApplicationLogsFrom(logging.OutputTypeFluentdForward) | ||
Expect(err).To(BeNil(), "Expected no errors reading the logs") | ||
// Parse log line | ||
var logs []types.ApplicationLog | ||
err = types.StrictlyParseLogs(utils.ToJsonLogs(raw), &logs) | ||
Expect(err).To(BeNil(), "Expected no errors parsing the logs") | ||
// Compare to expected template | ||
outputTestLog := logs[0] | ||
Expect(outputTestLog).To(FitLogFormatTemplate(outputLogTemplate)) | ||
}) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
why are these tests deleted?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
These tests were moved to the other file to further specialize the test
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
which file they are moved to? did you forgot to add the file?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
reverted changes to these specific tests
@jcantrill: all tests passed! Full PR test history. Your PR dashboard. Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository. I understand the commands that are listed here. |
/lgtm |
Description
This PR:
cc @vimalk78
Links
*https://issues.redhat.com/browse/LOG-2172