Skip to content
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

Merged
merged 1 commit into from
Apr 29, 2022

Conversation

jcantrill
Copy link
Contributor

Description

This PR:

  • fixes the path used by oauthapi audit logs
  • adds ovn audit logs to log collection

cc @vimalk78

Links

*https://issues.redhat.com/browse/LOG-2172

@openshift-ci
Copy link
Contributor

openshift-ci bot commented Apr 25, 2022

[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 /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@openshift-ci openshift-ci bot added the approved Indicates a PR has been approved by an approver from all required OWNERS files. label Apr 25, 2022
Copy link
Contributor

@vimalk78 vimalk78 left a 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

Comment on lines 130 to 187
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))
})
Copy link
Contributor

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?

Copy link
Contributor Author

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

Copy link
Contributor

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?

Copy link
Contributor Author

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

@openshift-ci
Copy link
Contributor

openshift-ci bot commented Apr 28, 2022

@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.

@vimalk78
Copy link
Contributor

/lgtm

@openshift-ci openshift-ci bot added the lgtm Indicates that a PR is ready to be merged. label Apr 29, 2022
@openshift-merge-robot openshift-merge-robot merged commit 39ffe70 into openshift:master Apr 29, 2022
@jcantrill jcantrill deleted the log2172 branch April 29, 2022 12:12
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
approved Indicates a PR has been approved by an approver from all required OWNERS files. lgtm Indicates that a PR is ready to be merged.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants