diff --git a/test/e2e/feature/feature.go b/test/e2e/feature/feature.go index 5087e691db6..2322e51c58a 100644 --- a/test/e2e/feature/feature.go +++ b/test/e2e/feature/feature.go @@ -279,6 +279,11 @@ var ( // TODO: document the feature (owning SIG, when to use this feature for a test) KubeProxyDaemonSetMigration = framework.WithFeature(framework.ValidFeatures.Add("KubeProxyDaemonSetMigration")) + // Owner: sig-network + // Marks tests that require the kernel to have support for the nfacct subsystem. + // (Some distros don't include this in the kernel.) + KubeProxyNFAcct = framework.WithFeature(framework.ValidFeatures.Add("KubeProxyNFAcct")) + // TODO: document the feature (owning SIG, when to use this feature for a test) LabelSelector = framework.WithFeature(framework.ValidFeatures.Add("LabelSelector")) diff --git a/test/e2e/network/kube_proxy.go b/test/e2e/network/kube_proxy.go index 3e6573f1675..5f1239fcc09 100644 --- a/test/e2e/network/kube_proxy.go +++ b/test/e2e/network/kube_proxy.go @@ -34,6 +34,7 @@ import ( "k8s.io/apimachinery/pkg/util/wait" "k8s.io/kubernetes/pkg/cluster/ports" "k8s.io/kubernetes/pkg/proxy/apis/config" + "k8s.io/kubernetes/test/e2e/feature" "k8s.io/kubernetes/test/e2e/framework" e2emetrics "k8s.io/kubernetes/test/e2e/framework/metrics" e2enode "k8s.io/kubernetes/test/e2e/framework/node" @@ -253,12 +254,13 @@ var _ = common.SIGDescribe("KubeProxy", func() { framework.Failf("no valid conntrack entry for port %d on node %s: %v", testDaemonTCPPort, serverNodeInfo.nodeIP, err) } }) +}) + +var _ = common.SIGDescribe("KubeProxyNFAcct", feature.KubeProxyNFAcct, func() { + fr := framework.NewDefaultFramework("kube-proxy-nfacct") + fr.NamespacePodSecurityLevel = admissionapi.LevelPrivileged ginkgo.It("should update metric for tracking accepted packets destined for localhost nodeports", func(ctx context.Context) { - if framework.TestContext.ClusterIsIPv6() { - e2eskipper.Skipf("test requires IPv4 cluster") - } - cs := fr.ClientSet ns := fr.Namespace.Name @@ -285,7 +287,7 @@ var _ = common.SIGDescribe("KubeProxy", func() { // get proxyMode stdout, err := e2epodoutput.RunHostCmd(fr.Namespace.Name, hostExecPodName, fmt.Sprintf("curl --silent 127.0.0.1:%d/proxyMode", ports.ProxyStatusPort)) if err != nil { - e2eskipper.Skipf("kube-proxy is not running or could not determine kube-proxy mode (%v)", err) + framework.Failf("failed to get proxy mode: err: %v; stdout: %s", stdout, err) } proxyMode := strings.TrimSpace(stdout) @@ -354,7 +356,7 @@ var _ = common.SIGDescribe("KubeProxy", func() { } return true, nil }); err != nil { - e2eskipper.Skipf("skipping test as localhost nodeports are not acceesible in this environment") + framework.ExpectNoError(err, "failed to access nodeport service on localhost") } }