in integration test - validate the exit code

pull/11474/head
Ilya Zuyev 2021-05-20 16:23:44 -07:00
parent 13ee52fc99
commit 85242d0711
1 changed files with 5 additions and 0 deletions

View File

@ -29,6 +29,7 @@ import (
"time"
"k8s.io/minikube/pkg/kapi"
"k8s.io/minikube/pkg/minikube/reason"
"k8s.io/minikube/pkg/util/retry"
)
@ -213,6 +214,10 @@ func validateFalseCNI(ctx context.Context, t *testing.T, profile string) {
if err == nil {
t.Errorf("%s expected to fail", mkCmd)
}
if rr.ExitCode != reason.Usage.ExitCode {
t.Errorf("Expected %d exit code, got %d", reason.Usage.ExitCode, rr.ExitCode)
}
expectedMsg := fmt.Sprintf("The %q container runtime requires CNI", cr)
if !strings.Contains(rr.Output(), expectedMsg) {
t.Errorf("Expected %q line not found in output %s", expectedMsg, rr.Output())