diff --git a/test/integration/functional_test.go b/test/integration/functional_test.go index 907b1ec93431..b9e8bdf786e7 100644 --- a/test/integration/functional_test.go +++ b/test/integration/functional_test.go @@ -138,6 +138,7 @@ func TestFunctional(t *testing.T) { {"RemoveImage", validateRemoveImage}, {"BuildImage", validateBuildImage}, {"ListImages", validateListImages}, + {"ExtraRuntimeDisabled", validateExtraRuntimeDisabled}, } for _, tc := range tests { tc := tc @@ -1663,6 +1664,29 @@ func validateCertSync(ctx context.Context, t *testing.T, profile string) { } } +// validateExtraRuntimeDisabled asserts that for a given runtime, the other runtimes disabled, for example for containerd runtime, docker and crio needs to be not running +func validateExtraRuntimeDisabled(ctx context.Context, t *testing.T, profile string) { + disableMap := map[string][]string{ + "docker": []string{"crio"}, + "containerd": []string{"docker", "crio"}, + "crio": []string{"docker", "containerd"}, + } + + expectDisable := disableMap[ContainerRuntime()] + for _, cr := range expectDisable { + // for example: minikube sudo systemctl is-active docker + rr, err := Run(t, exec.CommandContext(ctx, Target(), "-p", profile, "ssh", fmt.Sprintf("sudo systemctl is-active %s", cr))) + if err != nil { + t.Logf("output of %s: %v", rr.Output(), err) + } + got := rr.Stdout.String() + if !strings.Contains(got, "inactive") { + t.Errorf("For runtime %q: expected %q to be inactive but got %q ", ContainerRuntime(), cr, got) + } + + } +} + // validateUpdateContextCmd asserts basic "update-context" command functionality func validateUpdateContextCmd(ctx context.Context, t *testing.T, profile string) { defer PostMortemLogs(t, profile) diff --git a/test/integration/functional_test_pvc_test.go b/test/integration/functional_test_pvc_test.go index 744edadbae98..4144ee3518e8 100644 --- a/test/integration/functional_test_pvc_test.go +++ b/test/integration/functional_test_pvc_test.go @@ -37,7 +37,6 @@ import ( // validatePersistentVolumeClaim makes sure PVCs work properly func validatePersistentVolumeClaim(ctx context.Context, t *testing.T, profile string) { defer PostMortemLogs(t, profile) - ctx, cancel := context.WithTimeout(ctx, Minutes(10)) defer cancel()