From 85242d0711b46585edd6c73da2bb89bc1a0ae7e4 Mon Sep 17 00:00:00 2001 From: Ilya Zuyev Date: Thu, 20 May 2021 16:23:44 -0700 Subject: [PATCH] in integration test - validate the exit code --- test/integration/net_test.go | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/test/integration/net_test.go b/test/integration/net_test.go index fca3cd935e..7d9a00652a 100644 --- a/test/integration/net_test.go +++ b/test/integration/net_test.go @@ -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())