mirror of
https://github.com/k3s-io/kubernetes.git
synced 2025-07-23 03:41:45 +00:00
Merge pull request #52375 from jiayingz/deviceplugin-e2e
Automatic merge from submit-queue (batch tested with PRs 52316, 52289, 52375) Extends GPUDevicePlugin e2e test to exercise device plugin restarts. **What this PR does / why we need it**: This is part of issue #52189 but does not fix it. **Which issue this PR fixes** *(optional, in `fixes #<issue number>(, fixes #<issue_number>, ...)` format, will close that issue when PR gets merged)*: fixes # **Special notes for your reviewer**: **Release note**: ```release-note ```
This commit is contained in:
commit
991afb2436
@ -240,6 +240,26 @@ var _ = SIGDescribe("[Feature:GPU]", func() {
|
||||
var _ = SIGDescribe("[Feature:GPUDevicePlugin]", func() {
|
||||
f := framework.NewDefaultFramework("device-plugin-gpus")
|
||||
It("run Nvidia GPU Device Plugin tests on Container Optimized OS only", func() {
|
||||
// 1. Verifies GPU resource is successfully advertised on the nodes
|
||||
// and we can run pods using GPUs.
|
||||
By("Starting device plugin daemonset and running GPU pods")
|
||||
testNvidiaGPUsOnCOS(f)
|
||||
|
||||
// 2. Verifies that when the device plugin DaemonSet is removed, resource capacity drops to zero.
|
||||
By("Deleting device plugin daemonset")
|
||||
ds := dsFromManifest(dsYamlUrl)
|
||||
falseVar := false
|
||||
err := f.ClientSet.Extensions().DaemonSets(f.Namespace.Name).Delete(ds.Name, &metav1.DeleteOptions{OrphanDependents: &falseVar})
|
||||
framework.ExpectNoError(err, "failed to delete daemonset")
|
||||
framework.Logf("Successfully deleted device plugin daemonset. Wait for resource to be removed.")
|
||||
// Wait for Nvidia GPUs to be not available on nodes
|
||||
Eventually(func() bool {
|
||||
return !areGPUsAvailableOnAllSchedulableNodes(f)
|
||||
}, 5*time.Minute, time.Second).Should(BeTrue())
|
||||
|
||||
// 3. Restarts the device plugin DaemonSet. Verifies GPU resource is successfully advertised
|
||||
// on the nodes and we can run pods using GPUs.
|
||||
By("Restarting device plugin daemonset and running GPU pods")
|
||||
testNvidiaGPUsOnCOS(f)
|
||||
})
|
||||
})
|
||||
|
Loading…
Reference in New Issue
Block a user