mirror of https://github.com/k3s-io/k3s
Fix bad check in node e2e tests for GPUs.
When no nvidia device was attached, the -ne check had a syntax error: sh: -ne: argument expected This resulted in 'Success' being echoed and the test passing incorrectly. This was found while debugging issue #47216pull/6/head
parent
8fc4e17847
commit
f7a563435f
|
@ -161,7 +161,7 @@ func makePod(gpus int64, name string) *v1.Pod {
|
|||
v1.ResourceNvidiaGPU: *resource.NewQuantity(gpus, resource.DecimalSI),
|
||||
},
|
||||
}
|
||||
gpuverificationCmd := fmt.Sprintf("if [[ %d -ne $(ls /dev/ | egrep '^nvidia[0-9]+$') ]]; then exit 1; fi; echo Success", gpus)
|
||||
gpuverificationCmd := fmt.Sprintf("if [[ %d -ne $(ls /dev/ | egrep '^nvidia[0-9]+$' | wc -l) ]]; then exit 1; else echo Success; fi", gpus)
|
||||
return &v1.Pod{
|
||||
ObjectMeta: metav1.ObjectMeta{
|
||||
Name: name,
|
||||
|
|
Loading…
Reference in New Issue