diff options
author | Brent Baude <bbaude@redhat.com> | 2022-06-30 14:08:05 -0500 |
---|---|---|
committer | Brent Baude <bbaude@redhat.com> | 2022-07-08 08:22:49 -0500 |
commit | 76d887c7702321894c28a7479e696ef45f36143c (patch) | |
tree | b025322469b3fa44df2f45f46cbc6c0763b59f3f /pkg/machine/e2e/config.go | |
parent | 6087fb2116aaeae995e8423872ffe637e8be128f (diff) | |
download | podman-76d887c7702321894c28a7479e696ef45f36143c.tar.gz podman-76d887c7702321894c28a7479e696ef45f36143c.tar.bz2 podman-76d887c7702321894c28a7479e696ef45f36143c.zip |
Fix machine tests
Catch up with regressions that have occurred since the tests were
originally written.
Signed-off-by: Brent Baude <bbaude@redhat.com>
Diffstat (limited to 'pkg/machine/e2e/config.go')
-rw-r--r-- | pkg/machine/e2e/config.go | 13 |
1 files changed, 4 insertions, 9 deletions
diff --git a/pkg/machine/e2e/config.go b/pkg/machine/e2e/config.go index 248a2f0ad..b3fe74b0c 100644 --- a/pkg/machine/e2e/config.go +++ b/pkg/machine/e2e/config.go @@ -3,7 +3,6 @@ package e2e import ( "encoding/json" "fmt" - "math/rand" "os" "os/exec" "path/filepath" @@ -13,6 +12,7 @@ import ( "github.com/containers/podman/v4/pkg/machine" "github.com/containers/podman/v4/pkg/machine/qemu" "github.com/containers/podman/v4/pkg/util" + "github.com/containers/storage/pkg/stringid" . "github.com/onsi/ginkgo" //nolint:golint,stylecheck . "github.com/onsi/gomega" "github.com/onsi/gomega/gexec" @@ -136,14 +136,14 @@ func (m *machineTestBuilder) setTimeout(timeout time.Duration) *machineTestBuild // toQemuInspectInfo is only for inspecting qemu machines. Other providers will need // to make their own. -func (mb *machineTestBuilder) toQemuInspectInfo() ([]qemuMachineInspectInfo, int, error) { +func (mb *machineTestBuilder) toQemuInspectInfo() ([]machine.InspectInfo, int, error) { args := []string{"machine", "inspect"} args = append(args, mb.names...) session, err := runWrapper(mb.podmanBinary, args, defaultTimeout, true) if err != nil { return nil, -1, err } - mii := []qemuMachineInspectInfo{} + mii := []machine.InspectInfo{} err = json.Unmarshal(session.Bytes(), &mii) return mii, session.ExitCode(), err } @@ -179,10 +179,5 @@ func (m *machineTestBuilder) init() {} // randomString returns a string of given length composed of random characters func randomString(n int) string { - var randomLetters = []rune("abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ") - b := make([]rune, n) - for i := range b { - b[i] = randomLetters[rand.Intn(len(randomLetters))] - } - return string(b) + return stringid.GenerateRandomID()[0:12] } |