mirror of
https://github.com/k3s-io/kubernetes.git
synced 2026-07-21 17:15:35 +00:00
kube-proxy: conditionally skip e2e
Conditionally skip instead of failing when nfacct test when the required metric is not present. The only case when the metric will not be registered by kube-proxy is when nfacct subsystem is not supported on the node, we skip the test in that case. Signed-off-by: Daman Arora <aroradaman@gmail.com>
This commit is contained in:
@@ -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"))
|
||||
|
||||
|
||||
@@ -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")
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user