mirror of
https://github.com/containers/podman.git
synced 2025-06-22 09:58:10 +08:00
Enable machine e2e test for applehv
This PR allows you to run the pkg/machine/e2e tests for the applehv PROVIDER. This does not mean they pass, only that they can run. There also appears to be leftover gvproxy processes at the conclusion of a single test. This will need to be corrected. [NO NEW TESTS NEEDED] Signed-off-by: Brent Baude <bbaude@redhat.com>
This commit is contained in:
@ -11,6 +11,7 @@ import (
|
||||
"io/fs"
|
||||
"net"
|
||||
"os"
|
||||
"os/exec"
|
||||
"path/filepath"
|
||||
"strconv"
|
||||
"strings"
|
||||
@ -263,7 +264,7 @@ func (m *MacMachine) Init(opts machine.InitOptions) (bool, error) {
|
||||
return false, err
|
||||
}
|
||||
|
||||
// Until the disk resize can be fixed, we ignore it
|
||||
logrus.Debugf("resizing disk to %d GiB", opts.DiskSize)
|
||||
if err := m.resizeDisk(strongunits.GiB(opts.DiskSize)); err != nil {
|
||||
return false, err
|
||||
}
|
||||
@ -952,7 +953,16 @@ func (m *MacMachine) resizeDisk(newSize strongunits.GiB) error {
|
||||
// error has not merged
|
||||
return fmt.Errorf("invalid disk size %d: new disk must be larger than %dGB", newSize, m.DiskSize)
|
||||
}
|
||||
return os.Truncate(m.ImagePath.GetPath(), int64(newSize.ToBytes()))
|
||||
logrus.Debugf("resizing %s to %d bytes", m.ImagePath.GetPath(), newSize.ToBytes())
|
||||
// seems like os.truncate() is not very performant with really large files
|
||||
// so exec'ing out to the command truncate
|
||||
size := fmt.Sprintf("%dG", newSize)
|
||||
c := exec.Command("truncate", "-s", size, m.ImagePath.GetPath())
|
||||
if logrus.IsLevelEnabled(logrus.DebugLevel) {
|
||||
c.Stderr = os.Stderr
|
||||
c.Stdout = os.Stdout
|
||||
}
|
||||
return c.Run()
|
||||
}
|
||||
|
||||
// isFirstBoot returns a bool reflecting if the machine has been booted before
|
||||
|
@ -24,3 +24,16 @@ Note: Add `--focus-file "basic_test.go" ` to only run basic test
|
||||
1. `./test/tools/build/ginkgo.exe -vv --tags "remote exclude_graphdriver_btrfs btrfs_noversion exclude_graphdriver_devicemapper containers_image_openpgp remote" -timeout=90m --trace --no-color pkg/machine/e2e/. `
|
||||
|
||||
Note: Add `--focus-file "basic_test.go" ` to only run basic test
|
||||
|
||||
## MacOS
|
||||
|
||||
### Apple Hypervisor
|
||||
|
||||
1. `make podman-remote`
|
||||
1. `make .install.ginkgo`
|
||||
1. `export TMPDIR=/Users/<yourname>`
|
||||
1. `export CONTAINERS_MACHINE_PROVIDER="applehv"`
|
||||
1. `export MACHINE_IMAGE="https://fedorapeople.org/groups/podman/testing/applehv/arm64/fedora-coreos-38.20230925.dev.0-applehv.aarch64.raw.gz"`
|
||||
1. `./test/tools/build/ginkgo -vv --tags "remote exclude_graphdriver_btrfs btrfs_noversion exclude_graphdriver_devicemapper containers_image_openpgp remote" -timeout=90m --trace --no-color pkg/machine/e2e/.`
|
||||
|
||||
Note: Add `--focus-file "basic_test.go" ` to only run basic test
|
||||
|
3
pkg/machine/e2e/config_darwin_test.go
Normal file
3
pkg/machine/e2e/config_darwin_test.go
Normal file
@ -0,0 +1,3 @@
|
||||
package e2e_test
|
||||
|
||||
const podmanBinary = "../../../bin/darwin/podman"
|
@ -1,10 +1,3 @@
|
||||
package e2e_test
|
||||
|
||||
import "os/exec"
|
||||
|
||||
const podmanBinary = "../../../bin/podman-remote"
|
||||
|
||||
func pgrep(n string) (string, error) {
|
||||
out, err := exec.Command("pgrep", "gvproxy").Output()
|
||||
return string(out), err
|
||||
}
|
||||
|
@ -3,6 +3,8 @@
|
||||
package e2e_test
|
||||
|
||||
import (
|
||||
"os/exec"
|
||||
|
||||
"github.com/containers/podman/v4/pkg/machine"
|
||||
. "github.com/onsi/ginkgo/v2"
|
||||
)
|
||||
@ -20,3 +22,8 @@ func getDownloadLocation(p machine.VirtProvider) string {
|
||||
|
||||
return fcd.Location
|
||||
}
|
||||
|
||||
func pgrep(n string) (string, error) {
|
||||
out, err := exec.Command("pgrep", "gvproxy").Output()
|
||||
return string(out), err
|
||||
}
|
||||
|
Reference in New Issue
Block a user