mirror of
https://github.com/intel/intel-device-plugins-for-kubernetes.git
synced 2025-06-03 03:59:37 +00:00
Merge pull request #845 from uniemimu/e2egpu
add device check to gpu e2e test and e2e-gpu makefile target
This commit is contained in:
commit
bc66bc4fb0
3
Makefile
3
Makefile
@ -141,6 +141,9 @@ e2e-qat:
|
||||
e2e-sgx:
|
||||
@$(GO) test -v ./test/e2e/... -ginkgo.v -ginkgo.progress -ginkgo.focus "SGX" -delete-namespace-on-failure=false
|
||||
|
||||
e2e-gpu:
|
||||
@$(GO) test -v ./test/e2e/... -ginkgo.v -ginkgo.progress -ginkgo.focus "GPU" -delete-namespace-on-failure=false
|
||||
|
||||
pre-pull:
|
||||
ifeq ($(TAG),devel)
|
||||
@$(BUILDER) pull golang:1.17-bullseye
|
||||
|
@ -17,6 +17,7 @@ package gpu
|
||||
import (
|
||||
"context"
|
||||
"path/filepath"
|
||||
"strings"
|
||||
"time"
|
||||
|
||||
"github.com/intel/intel-device-plugins-for-kubernetes/test/e2e/utils"
|
||||
@ -33,6 +34,7 @@ import (
|
||||
|
||||
const (
|
||||
kustomizationYaml = "deployments/gpu_plugin/kustomization.yaml"
|
||||
containerName = "testcontainer"
|
||||
)
|
||||
|
||||
func init() {
|
||||
@ -70,8 +72,8 @@ func describe() {
|
||||
Spec: v1.PodSpec{
|
||||
Containers: []v1.Container{
|
||||
{
|
||||
Args: []string{"-c", "echo hello world"},
|
||||
Name: "testcontainer",
|
||||
Args: []string{"-c", "ls /dev/dri"},
|
||||
Name: containerName,
|
||||
Image: imageutils.GetE2EImage(imageutils.BusyBox),
|
||||
Command: []string{"/bin/sh"},
|
||||
Resources: v1.ResourceRequirements{
|
||||
@ -88,5 +90,18 @@ func describe() {
|
||||
|
||||
ginkgo.By("waiting the pod to finnish successfully")
|
||||
f.PodClient().WaitForFinish(pod.ObjectMeta.Name, 60*time.Second)
|
||||
|
||||
ginkgo.By("checking log output")
|
||||
log, err := e2epod.GetPodLogs(f.ClientSet, f.Namespace.Name, pod.Name, containerName)
|
||||
|
||||
if err != nil {
|
||||
framework.Failf("unable to get log from pod: %v", err)
|
||||
}
|
||||
|
||||
if !strings.Contains(log, "card") || !strings.Contains(log, "renderD") {
|
||||
framework.Failf("device mounts not found from log")
|
||||
}
|
||||
|
||||
framework.Logf("found card and renderD from the log")
|
||||
})
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user