Skip to content

[Docker Log Driver] Add pipereader tests and fix copyBuffer bug#14799

Merged
fearful-symmetry merged 3 commits intoelastic:feature/dockerbeatfrom
fearful-symmetry:testing
Nov 27, 2019
Merged

[Docker Log Driver] Add pipereader tests and fix copyBuffer bug#14799
fearful-symmetry merged 3 commits intoelastic:feature/dockerbeatfrom
fearful-symmetry:testing

Conversation

@fearful-symmetry
Copy link
Copy Markdown
Contributor

We finally have tests for the log driver! Well, some. It would be nice to add more.

This also fixes a bug with how we handle buffers. It turns out that CopyBuffer won't actually check to see if it has a nil dst.

@fearful-symmetry fearful-symmetry added the Team:Integrations Label for the Integrations team label Nov 26, 2019
@fearful-symmetry fearful-symmetry requested review from a team November 26, 2019 18:40
@fearful-symmetry fearful-symmetry self-assigned this Nov 26, 2019

sizeBytes := make([]byte, 4)
binary.BigEndian.PutUint32(sizeBytes, uint32(len(rawBytes)))
rawBytes = append(sizeBytes, rawBytes...)
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can we use the Writer from the protobuf io package instead of creating our own byte string?

"github.com/docker/docker/api/types/plugins/logdriver"
)

func TestPipeReader(t *testing.T) {
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

we are planning more tests? Also some fuzzing?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

yep!

@fearful-symmetry fearful-symmetry merged commit 919aa2f into elastic:feature/dockerbeat Nov 27, 2019
leweafan pushed a commit to leweafan/beats that referenced this pull request Apr 28, 2023
…tic#14799)

* add test and fix copy bug

* remove debug lines

* add header
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Team:Integrations Label for the Integrations team

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants