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

Add the existence check of /proc/net/nf_conntrack #69589

Merged
merged 1 commit into from
Nov 9, 2018
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
4 changes: 2 additions & 2 deletions test/e2e/framework/util.go
Original file line number Diff line number Diff line change
Expand Up @@ -3393,8 +3393,8 @@ func IssueSSHCommandWithResult(cmd, provider string, node *v1.Node) (*SSHResult,
LogSSHResult(result)

if result.Code != 0 || err != nil {
return nil, fmt.Errorf("failed running %q: %v (exit code %d)",
Copy link
Member

Choose a reason for hiding this comment

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

just add (exit code %d, stderr %v) would work.

Copy link
Member Author

Choose a reason for hiding this comment

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

Nice idea, thanks.
I will update this.

cmd, err, result.Code)
return nil, fmt.Errorf("failed running %q: %v (exit code %d, stderr %v)",
cmd, err, result.Code, result.Stderr)
}

return &result, nil
Expand Down
10 changes: 10 additions & 0 deletions test/e2e/network/kube_proxy.go
Original file line number Diff line number Diff line change
Expand Up @@ -77,6 +77,16 @@ var _ = SIGDescribe("Network", func() {

zero := int64(0)

// Some distributions (Ubuntu 16.04 etc.) don't support the proc file.
_, err := framework.IssueSSHCommandWithResult(
"ls /proc/net/nf_conntrack",
framework.TestContext.Provider,
clientNodeInfo.node)
if err != nil && strings.Contains(err.Error(), "No such file or directory") {
framework.Skipf("The node %s does not support /proc/net/nf_conntrack", clientNodeInfo.name)
Copy link
Member

Choose a reason for hiding this comment

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

Is there no other way to accomplish what this test is trying to do?

Copy link
Member Author

Choose a reason for hiding this comment

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

Yeah, that is ideal.
Unfortunately I cannot find the alternative way instead of skipping.

Copy link
Member

Choose a reason for hiding this comment

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

necro-ing a bit but ...
I'm pretty sure was not the correct way to do this, I definitely have conntrack and a working kind cluster on my machine but this file does not exist even on the host. (ubuntu 20.04)

it looks to me like you're expected to use conntrack -L instead of reading this file.

see e.g. netdata/netdata#161 (comment)

cc @aojea

Copy link
Member

Choose a reason for hiding this comment

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

interesting, thanks for the pointer, it also mentions

I see, yes. And to be sure, I just confirmed that accessing /proc/net/stat/* does not put any load on the system, while accessing /proc/net/nf_conntrack directly takes a very very long time (40 seconds on a firewall with 100,000 tracked connection).

that I'd say is the cause of the flakiness in the TCP_CLOSE_WAIT test

I'll submit a new PR to change this

Copy link
Member

Choose a reason for hiding this comment

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

}
framework.ExpectNoError(err)

clientPodSpec := &v1.Pod{
ObjectMeta: metav1.ObjectMeta{
Name: "e2e-net-client",
Expand Down