pkg/machine/e2e: run debug command only for macos

The commands only make sense on macos so do not clutter the logs on
linux/windows with the output.

Signed-off-by: Paul Holzinger <pholzing@redhat.com>
This commit is contained in:
Paul Holzinger 2024-07-09 13:14:42 +02:00
parent abf0350529
commit 336c45f68e
No known key found for this signature in database
GPG Key ID: EB145DD938A3CAF2
1 changed files with 4 additions and 1 deletions

View File

@ -6,6 +6,7 @@ import (
"os"
"os/exec"
"path/filepath"
"runtime"
"slices"
"strconv"
"strings"
@ -172,7 +173,9 @@ func (m *machineTestBuilder) runWithoutWait() (*machineSession, error) {
func (m *machineTestBuilder) run() (*machineSession, error) {
s, err := runWrapper(m.podmanBinary, m.cmd, m.timeout, true)
if m.isInit {
// debug for the slow init on macos
// The image file is not consistent, sometimes it is sparse sometimes not.
if m.isInit && runtime.GOOS == "darwin" {
c := exec.Command("du", "-ah", filepath.Join(os.Getenv("HOME"), ".local/share/containers/podman/machine/applehv"))
c.Stderr = os.Stderr
c.Stdout = os.Stdout