Skip to content

Commit b71c807

Browse files
authored
Merge pull request #21801 from nirs/iso-test
test: Fix guest_env_test.go
2 parents 9bee0ef + 3dc60e2 commit b71c807

File tree

1 file changed

+27
-10
lines changed

1 file changed

+27
-10
lines changed

test/integration/guest_env_test.go renamed to test/integration/iso_test.go

Lines changed: 27 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
//go:build iso
1+
//go:build integration
22

33
/*
44
Copyright 2016 The Kubernetes Authors All rights reserved.
@@ -22,35 +22,52 @@ import (
2222
"context"
2323
"fmt"
2424
"os/exec"
25-
"strings"
25+
"runtime"
2626
"testing"
2727

2828
"k8s.io/minikube/pkg/minikube/vmpath"
2929
)
3030

31-
// TestGuestEnvironment verifies files and packages installed inside minikube ISO/Base image
32-
func TestGuestEnvironment(t *testing.T) {
31+
// TestISOImage verifies files and packages installed inside minikube ISO/Base image
32+
func TestISOImage(t *testing.T) {
33+
if !VMDriver() {
34+
t.Skip("This test requires a VM driver")
35+
}
36+
3337
MaybeParallel(t)
3438

3539
profile := UniqueProfileName("guest")
3640
ctx, cancel := context.WithTimeout(context.Background(), Minutes(15))
3741
defer CleanupWithLogs(t, profile, cancel)
3842

3943
t.Run("Setup", func(t *testing.T) {
40-
args := append([]string{"start", "-p", profile, "--install-addons=false", "--memory=3072", "--wait=false", "--disable-metrics=true"}, StartArgs()...)
44+
args := append([]string{"start", "-p", profile, "--no-kubernetes"}, StartArgs()...)
4145
rr, err := Run(t, exec.CommandContext(ctx, Target(), args...))
4246
if err != nil {
4347
t.Errorf("failed to start minikube: args %q: %v", rr.Command(), err)
4448
}
45-
46-
if strings.Contains(rr.Stderr.String(), "kubelet.housekeeping-interval=5m") {
47-
t.Error("--disable-metrics=true is not working, housekeeping interval not increased")
48-
}
4949
})
5050

5151
// Run as a group so that our defer doesn't happen as tests are runnings
5252
t.Run("Binaries", func(t *testing.T) {
53-
for _, pkg := range []string{"git", "rsync", "curl", "wget", "socat", "iptables", "VBoxControl", "VBoxService", "crictl", "podman", "docker"} {
53+
binaries := []string{
54+
"crictl",
55+
"curl",
56+
"docker",
57+
"git",
58+
"iptables",
59+
"podman",
60+
"rsync",
61+
"socat",
62+
"wget",
63+
}
64+
65+
// virtualbox is not available in the arm64 iso.
66+
if runtime.GOARCH == "amd64" {
67+
binaries = append(binaries, "VBoxControl", "VBoxService")
68+
}
69+
70+
for _, pkg := range binaries {
5471
pkg := pkg
5572
t.Run(pkg, func(t *testing.T) {
5673
t.Parallel()

0 commit comments

Comments
 (0)