add integration test

pull/11516/head
Medya Gh 2021-05-26 17:58:52 -07:00
parent 631a661e47
commit e26750b646
2 changed files with 24 additions and 1 deletions

View File

@ -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)

View File

@ -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()