mirror of
https://github.com/k3s-io/kubernetes.git
synced 2025-07-24 04:06:03 +00:00
Add the existence check of /proc/net/nf_conntrack
The existence of /proc/net/nf_conntrack depends on the Linux kernel config CONFIG_NF_CONNTRACK_PROCFS, and Ubuntu 16.04's one is disabled. So the e2e test "should set TCP CLOSE_WAIT timeout" fails on that. This adds the existence check of /proc/net/nf_conntrack for skipping the test if not existing. In addition, this makes IssueSSHCommandWithResult return Stderr in the error message if err is nil to check "No such file or directory" as nonexistence of /proc/net/nf_conntrack.
This commit is contained in:
parent
c8e5233971
commit
f3e59a5c15
@ -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)",
|
||||
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
|
||||
|
@ -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)
|
||||
}
|
||||
framework.ExpectNoError(err)
|
||||
|
||||
clientPodSpec := &v1.Pod{
|
||||
ObjectMeta: metav1.ObjectMeta{
|
||||
Name: "e2e-net-client",
|
||||
|
Loading…
Reference in New Issue
Block a user