Skip to content

Commit

Permalink
Mac PM test: Require pre-installed rosetta
Browse files Browse the repository at this point in the history
Previously, the mac podman-machine tests installed rosetta before
executing any tests.  As a best-practice (and because the Macs in CI are
shared) tests should never permanently modify the system.  As of this
commit, the system setup script used for the CI Macs does the rosetta
installation.  Remove the test setup code that installed rosetta and
add a CI-level confirmation that it's been pre-installed.

Signed-off-by: Chris Evich <[email protected]>
  • Loading branch information
cevich committed May 23, 2024
1 parent e53b96c commit 74e8f98
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 8 deletions.
8 changes: 8 additions & 0 deletions contrib/cirrus/mac_setup.sh
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,14 @@

set -euo pipefail

# Confirm rosetta is installed/enabled and working
if ! arch -arch x86_64 /usr/bin/uname -m; then
# This likely means whatever script used to prepare this mac failed
# and/or did not execute `sudo softwareupdate --install-rosetta --agree-to-license`
echo "Rosetta doesn't appear to be installed, or is non-functional."
exit 1
fi

# The otherwise standard `/etc/ci_environment` file cannot be used in this
# context, because the system is shared for multiple tasks. Instead, persist
# env. vars required during /subsequent/ testing steps via a "magic" Cirrus-CI
Expand Down
8 changes: 0 additions & 8 deletions pkg/machine/e2e/machine_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@ import (
"fmt"
"io"
"os"
"os/exec"
"path/filepath"
"runtime"
"strings"
Expand Down Expand Up @@ -70,13 +69,6 @@ var _ = BeforeSuite(func() {
if pullError != nil {
Fail(fmt.Sprintf("failed to pull wsl disk: %q", pullError))
}
if testProvider.VMType() == define.AppleHvVirt {
cmd := exec.Command("softwareupdate", "--install-rosetta", "--agree-to-license")
err := cmd.Run()
if err != nil {
Fail(fmt.Sprintf("Command failed with error: %q", err))
}
}
})

var _ = SynchronizedAfterSuite(func() {}, func() {})
Expand Down

0 comments on commit 74e8f98

Please sign in to comment.