e2e: define features and node features

The list is based on the -list-tests output.
This commit is contained in:
Patrick Ohly 2023-06-19 16:03:46 +02:00
parent f2d34426f8
commit 19ecf93ec3
5 changed files with 197 additions and 0 deletions

View File

@ -43,6 +43,10 @@ import (
e2etestingmanifests "k8s.io/kubernetes/test/e2e/testing-manifests"
testfixtures "k8s.io/kubernetes/test/fixtures"
// define and freeze constants
_ "k8s.io/kubernetes/test/e2e/feature"
_ "k8s.io/kubernetes/test/e2e/nodefeature"
// test sources
_ "k8s.io/kubernetes/test/e2e/apimachinery"
_ "k8s.io/kubernetes/test/e2e/apps"

132
test/e2e/feature/feature.go Normal file
View File

@ -0,0 +1,132 @@
/*
Copyright 2023 The Kubernetes Authors.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
*/
// Package feature contains pre-defined features used by test/e2e and/or
// test/e2e_node.
package feature
import (
"k8s.io/kubernetes/test/e2e/framework"
)
var (
APIServerIdentity = framework.WithFeature(framework.ValidFeatures.Add("APIServerIdentity"))
AppArmor = framework.WithFeature(framework.ValidFeatures.Add("AppArmor"))
BootstrapTokens = framework.WithFeature(framework.ValidFeatures.Add("BootstrapTokens"))
BoundServiceAccountTokenVolume = framework.WithFeature(framework.ValidFeatures.Add("BoundServiceAccountTokenVolume"))
CloudProvider = framework.WithFeature(framework.ValidFeatures.Add("CloudProvider"))
ClusterAutoscalerScalability1 = framework.WithFeature(framework.ValidFeatures.Add("ClusterAutoscalerScalability1"))
ClusterAutoscalerScalability2 = framework.WithFeature(framework.ValidFeatures.Add("ClusterAutoscalerScalability2"))
ClusterAutoscalerScalability3 = framework.WithFeature(framework.ValidFeatures.Add("ClusterAutoscalerScalability3"))
ClusterAutoscalerScalability4 = framework.WithFeature(framework.ValidFeatures.Add("ClusterAutoscalerScalability4"))
ClusterAutoscalerScalability5 = framework.WithFeature(framework.ValidFeatures.Add("ClusterAutoscalerScalability5"))
ClusterAutoscalerScalability6 = framework.WithFeature(framework.ValidFeatures.Add("ClusterAutoscalerScalability6"))
ClusterDowngrade = framework.WithFeature(framework.ValidFeatures.Add("ClusterDowngrade"))
ClusterSizeAutoscalingGpu = framework.WithFeature(framework.ValidFeatures.Add("ClusterSizeAutoscalingGpu"))
ClusterSizeAutoscalingScaleDown = framework.WithFeature(framework.ValidFeatures.Add("ClusterSizeAutoscalingScaleDown"))
ClusterSizeAutoscalingScaleUp = framework.WithFeature(framework.ValidFeatures.Add("ClusterSizeAutoscalingScaleUp"))
ClusterUpgrade = framework.WithFeature(framework.ValidFeatures.Add("ClusterUpgrade"))
ComprehensiveNamespaceDraining = framework.WithFeature(framework.ValidFeatures.Add("ComprehensiveNamespaceDraining"))
CPUManager = framework.WithFeature(framework.ValidFeatures.Add("CPUManager"))
CustomMetricsAutoscaling = framework.WithFeature(framework.ValidFeatures.Add("CustomMetricsAutoscaling"))
DeviceManager = framework.WithFeature(framework.ValidFeatures.Add("DeviceManager"))
DevicePluginProbe = framework.WithFeature(framework.ValidFeatures.Add("DevicePluginProbe"))
Downgrade = framework.WithFeature(framework.ValidFeatures.Add("Downgrade"))
DynamicResourceAllocation = framework.WithFeature(framework.ValidFeatures.Add("DynamicResourceAllocation"))
EphemeralStorage = framework.WithFeature(framework.ValidFeatures.Add("EphemeralStorage"))
Example = framework.WithFeature(framework.ValidFeatures.Add("Example"))
ExperimentalResourceUsageTracking = framework.WithFeature(framework.ValidFeatures.Add("ExperimentalResourceUsageTracking"))
Flexvolumes = framework.WithFeature(framework.ValidFeatures.Add("Flexvolumes"))
GKENodePool = framework.WithFeature(framework.ValidFeatures.Add("GKENodePool"))
GPUClusterDowngrade = framework.WithFeature(framework.ValidFeatures.Add("GPUClusterDowngrade"))
GPUClusterUpgrade = framework.WithFeature(framework.ValidFeatures.Add("GPUClusterUpgrade"))
GPUDevicePlugin = framework.WithFeature(framework.ValidFeatures.Add("GPUDevicePlugin"))
GPUMasterUpgrade = framework.WithFeature(framework.ValidFeatures.Add("GPUMasterUpgrade"))
GPUUpgrade = framework.WithFeature(framework.ValidFeatures.Add("GPUUpgrade"))
HAMaster = framework.WithFeature(framework.ValidFeatures.Add("HAMaster"))
HPA = framework.WithFeature(framework.ValidFeatures.Add("HPA"))
HugePages = framework.WithFeature(framework.ValidFeatures.Add("HugePages"))
Ingress = framework.WithFeature(framework.ValidFeatures.Add("Ingress"))
IngressScale = framework.WithFeature(framework.ValidFeatures.Add("IngressScale"))
InPlacePodVerticalScaling = framework.WithFeature(framework.ValidFeatures.Add("InPlacePodVerticalScaling"))
IPv6DualStack = framework.WithFeature(framework.ValidFeatures.Add("IPv6DualStack"))
Kind = framework.WithFeature(framework.ValidFeatures.Add("Kind"))
KubeletCredentialProviders = framework.WithFeature(framework.ValidFeatures.Add("KubeletCredentialProviders"))
KubeletSecurity = framework.WithFeature(framework.ValidFeatures.Add("KubeletSecurity"))
KubeProxyDaemonSetDowngrade = framework.WithFeature(framework.ValidFeatures.Add("KubeProxyDaemonSetDowngrade"))
KubeProxyDaemonSetUpgrade = framework.WithFeature(framework.ValidFeatures.Add("KubeProxyDaemonSetUpgrade"))
KubeProxyDaemonSetMigration = framework.WithFeature(framework.ValidFeatures.Add("KubeProxyDaemonSetMigration"))
LabelSelector = framework.WithFeature(framework.ValidFeatures.Add("LabelSelector"))
LocalStorageCapacityIsolation = framework.WithFeature(framework.ValidFeatures.Add("LocalStorageCapacityIsolation"))
LocalStorageCapacityIsolationQuota = framework.WithFeature(framework.ValidFeatures.Add("LocalStorageCapacityIsolationQuota"))
MasterUpgrade = framework.WithFeature(framework.ValidFeatures.Add("MasterUpgrade"))
MemoryManager = framework.WithFeature(framework.ValidFeatures.Add("MemoryManager"))
NEG = framework.WithFeature(framework.ValidFeatures.Add("NEG"))
NetworkingDNS = framework.WithFeature(framework.ValidFeatures.Add("Networking-DNS"))
NetworkingIPv4 = framework.WithFeature(framework.ValidFeatures.Add("Networking-IPv4"))
NetworkingIPv6 = framework.WithFeature(framework.ValidFeatures.Add("Networking-IPv6"))
NetworkingPerformance = framework.WithFeature(framework.ValidFeatures.Add("Networking-Performance"))
NetworkPolicy = framework.WithFeature(framework.ValidFeatures.Add("NetworkPolicy"))
NodeAuthenticator = framework.WithFeature(framework.ValidFeatures.Add("NodeAuthenticator"))
NodeAuthorizer = framework.WithFeature(framework.ValidFeatures.Add("NodeAuthorizer"))
NodeOutOfServiceVolumeDetach = framework.WithFeature(framework.ValidFeatures.Add("NodeOutOfServiceVolumeDetach"))
NoSNAT = framework.WithFeature(framework.ValidFeatures.Add("NoSNAT"))
PerformanceDNS = framework.WithFeature(framework.ValidFeatures.Add("PerformanceDNS"))
PodGarbageCollector = framework.WithFeature(framework.ValidFeatures.Add("PodGarbageCollector"))
PodPriority = framework.WithFeature(framework.ValidFeatures.Add("PodPriority"))
PodReadyToStartContainersCondition = framework.WithFeature(framework.ValidFeatures.Add("PodReadyToStartContainersCondition"))
PodResources = framework.WithFeature(framework.ValidFeatures.Add("PodResources"))
ProbeTerminationGracePeriod = framework.WithFeature(framework.ValidFeatures.Add("ProbeTerminationGracePeriod"))
Reboot = framework.WithFeature(framework.ValidFeatures.Add("Reboot"))
ReclaimPolicy = framework.WithFeature(framework.ValidFeatures.Add("ReclaimPolicy"))
RecoverVolumeExpansionFailure = framework.WithFeature(framework.ValidFeatures.Add("RecoverVolumeExpansionFailure"))
Recreate = framework.WithFeature(framework.ValidFeatures.Add("Recreate"))
RegularResourceUsageTracking = framework.WithFeature(framework.ValidFeatures.Add("RegularResourceUsageTracking"))
ScopeSelectors = framework.WithFeature(framework.ValidFeatures.Add("ScopeSelectors"))
SCTPConnectivity = framework.WithFeature(framework.ValidFeatures.Add("SCTPConnectivity"))
SeccompDefault = framework.WithFeature(framework.ValidFeatures.Add("SeccompDefault"))
SELinux = framework.WithFeature(framework.ValidFeatures.Add("SELinux"))
SELinuxMountReadWriteOncePod = framework.WithFeature(framework.ValidFeatures.Add("SELinuxMountReadWriteOncePod"))
StackdriverAcceleratorMonitoring = framework.WithFeature(framework.ValidFeatures.Add("StackdriverAcceleratorMonitoring"))
StackdriverCustomMetrics = framework.WithFeature(framework.ValidFeatures.Add("StackdriverCustomMetrics"))
StackdriverExternalMetrics = framework.WithFeature(framework.ValidFeatures.Add("StackdriverExternalMetrics"))
StackdriverMetadataAgent = framework.WithFeature(framework.ValidFeatures.Add("StackdriverMetadataAgent"))
StackdriverMonitoring = framework.WithFeature(framework.ValidFeatures.Add("StackdriverMonitoring"))
StandaloneMode = framework.WithFeature(framework.ValidFeatures.Add("StandaloneMode"))
StatefulSet = framework.WithFeature(framework.ValidFeatures.Add("StatefulSet"))
StatefulSetStartOrdinal = framework.WithFeature(framework.ValidFeatures.Add("StatefulSetStartOrdinal"))
StatefulUpgrade = framework.WithFeature(framework.ValidFeatures.Add("StatefulUpgrade"))
StorageProvider = framework.WithFeature(framework.ValidFeatures.Add("StorageProvider"))
StorageVersionAPI = framework.WithFeature(framework.ValidFeatures.Add("StorageVersionAPI"))
TopologyHints = framework.WithFeature(framework.ValidFeatures.Add("Topology Hints"))
UDP = framework.WithFeature(framework.ValidFeatures.Add("UDP"))
Upgrade = framework.WithFeature(framework.ValidFeatures.Add("Upgrade"))
UserNamespacesStatelessPodsSupport = framework.WithFeature(framework.ValidFeatures.Add("UserNamespacesStatelessPodsSupport"))
ValidatingAdmissionPolicy = framework.WithFeature(framework.ValidFeatures.Add("ValidatingAdmissionPolicy"))
Volumes = framework.WithFeature(framework.ValidFeatures.Add("Volumes"))
VolumeSnapshotDataSource = framework.WithFeature(framework.ValidFeatures.Add("VolumeSnapshotDataSource"))
VolumeSourceXFS = framework.WithFeature(framework.ValidFeatures.Add("VolumeSourceXFS"))
Vsphere = framework.WithFeature(framework.ValidFeatures.Add("vsphere"))
WatchList = framework.WithFeature(framework.ValidFeatures.Add("WatchList"))
Windows = framework.WithFeature(framework.ValidFeatures.Add("Windows"))
WindowsHostProcessContainers = framework.WithFeature(framework.ValidFeatures.Add("WindowsHostProcessContainers"))
WindowsHyperVContainers = framework.WithFeature(framework.ValidFeatures.Add("WindowsHyperVContainers"))
)
func init() {
// This prevents adding additional ad-hoc features in tests.
framework.ValidFeatures.Freeze()
}

View File

@ -0,0 +1,55 @@
/*
Copyright 2023 The Kubernetes Authors.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
*/
// Package feature contains pre-defined node features used by test/e2e and/or
// test/e2e_node.
package nodefeature
import (
"k8s.io/kubernetes/test/e2e/framework"
)
var (
AppArmor = framework.WithNodeFeature(framework.ValidNodeFeatures.Add("AppArmor"))
CheckpointContainer = framework.WithNodeFeature(framework.ValidNodeFeatures.Add("CheckpointContainer"))
CriticalPod = framework.WithNodeFeature(framework.ValidNodeFeatures.Add("CriticalPod"))
DeviceManager = framework.WithNodeFeature(framework.ValidNodeFeatures.Add("DeviceManager"))
DevicePluginProbe = framework.WithNodeFeature(framework.ValidNodeFeatures.Add("DevicePluginProbe"))
DownwardAPIHugePages = framework.WithNodeFeature(framework.ValidNodeFeatures.Add("DownwardAPIHugePages"))
DynamicResourceAllocation = framework.WithNodeFeature(framework.ValidNodeFeatures.Add("DynamicResourceAllocation"))
Eviction = framework.WithNodeFeature(framework.ValidNodeFeatures.Add("Eviction"))
FSGroup = framework.WithNodeFeature(framework.ValidNodeFeatures.Add("FSGroup"))
GarbageCollect = framework.WithNodeFeature(framework.ValidNodeFeatures.Add("GarbageCollect"))
GracefulNodeShutdown = framework.WithNodeFeature(framework.ValidNodeFeatures.Add("GracefulNodeShutdown"))
GracefulNodeShutdownBasedOnPodPriority = framework.WithNodeFeature(framework.ValidNodeFeatures.Add("GracefulNodeShutdownBasedOnPodPriority"))
HostAccess = framework.WithNodeFeature(framework.ValidNodeFeatures.Add("HostAccess"))
ImageID = framework.WithNodeFeature(framework.ValidNodeFeatures.Add(" ImageID"))
LSCIQuotaMonitoring = framework.WithNodeFeature(framework.ValidNodeFeatures.Add("LSCIQuotaMonitoring"))
NodeAllocatable = framework.WithNodeFeature(framework.ValidNodeFeatures.Add("NodeAllocatable"))
NodeProblemDetector = framework.WithNodeFeature(framework.ValidNodeFeatures.Add("NodeProblemDetector"))
OOMScoreAdj = framework.WithNodeFeature(framework.ValidNodeFeatures.Add("OOMScoreAdj"))
PodDisruptionConditions = framework.WithNodeFeature(framework.ValidNodeFeatures.Add("PodDisruptionConditions"))
PodResources = framework.WithNodeFeature(framework.ValidNodeFeatures.Add("PodResources"))
ResourceMetrics = framework.WithNodeFeature(framework.ValidNodeFeatures.Add("ResourceMetrics"))
RuntimeHandler = framework.WithNodeFeature(framework.ValidNodeFeatures.Add("RuntimeHandler"))
SystemNodeCriticalPod = framework.WithNodeFeature(framework.ValidNodeFeatures.Add("SystemNodeCriticalPod"))
TopologyManager = framework.WithNodeFeature(framework.ValidNodeFeatures.Add("TopologyManager"))
)
func init() {
// This prevents adding additional ad-hoc features in tests.
framework.ValidNodeFeatures.Freeze()
}

View File

@ -4,9 +4,11 @@ rules:
allowedPrefixes:
- k8s.io/kubernetes/test/e2e/common
- k8s.io/kubernetes/test/e2e/dra/test-driver/app
- k8s.io/kubernetes/test/e2e/feature
- k8s.io/kubernetes/test/e2e/framework
- k8s.io/kubernetes/test/e2e/storage/utils
- k8s.io/kubernetes/test/e2e/network/common
- k8s.io/kubernetes/test/e2e/nodefeature
- k8s.io/kubernetes/test/e2e/perftype
- k8s.io/kubernetes/test/e2e/testing-manifests
- k8s.io/kubernetes/test/e2e_node

View File

@ -53,6 +53,10 @@ import (
e2enodetestingmanifests "k8s.io/kubernetes/test/e2e_node/testing-manifests"
system "k8s.io/system-validators/validators"
// define and freeze constants
_ "k8s.io/kubernetes/test/e2e/feature"
_ "k8s.io/kubernetes/test/e2e/nodefeature"
// reconfigure framework
_ "k8s.io/kubernetes/test/e2e/framework/debug/init"
_ "k8s.io/kubernetes/test/e2e/framework/metrics/init"