Skip to content

Commit

Permalink
add integration test
Browse files Browse the repository at this point in the history
  • Loading branch information
medyagh committed May 27, 2021
1 parent 631a661 commit e26750b
Show file tree
Hide file tree
Showing 2 changed files with 24 additions and 1 deletion.
24 changes: 24 additions & 0 deletions test/integration/functional_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -138,6 +138,7 @@ func TestFunctional(t *testing.T) {
{"RemoveImage", validateRemoveImage},
{"BuildImage", validateBuildImage},
{"ListImages", validateListImages},
{"ExtraRuntimeDisabled", validateExtraRuntimeDisabled},
}
for _, tc := range tests {
tc := tc
Expand Down Expand Up @@ -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)
Expand Down
1 change: 0 additions & 1 deletion test/integration/functional_test_pvc_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -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()

Expand Down

0 comments on commit e26750b

Please sign in to comment.