Skip to content

Commit

Permalink
use vm.Stop above macOS 12
Browse files Browse the repository at this point in the history
  • Loading branch information
Code-Hex committed Oct 15, 2023
1 parent fa66ff1 commit ae6e217
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion virtualization_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -272,7 +272,12 @@ func TestRun(t *testing.T) {
// waitState(t, 5*time.Second, vm, vz.VirtualMachineStateStopping)
// waitState(t, 5*time.Second, vm, vz.VirtualMachineStateStopped)

sshSession.Run("poweroff")
if vz.Available(12) {
sshSession.Run("poweroff")
} else {
vm.Stop()
waitState(t, timeout, vm, vz.VirtualMachineStateStopping)
}

waitState(t, timeout, vm, vz.VirtualMachineStateStopped)

Expand Down

0 comments on commit ae6e217

Please sign in to comment.