Compare commits

...
3 Commits
Author SHA1 Message Date
Fedor Korotkov ae2d59e5c2 Revert "Do not magically set --no-graphics when --vnc is passed (#763)
* Revert "Do not magically set `--no-graphics` when `--vnc` is passed (#732)"

This reverts commit a48f4d4ec9.

* Mark `--graphics` as private
2024-03-19 08:28:27 +00:00
Evgeniy Baranov 7eac45702b Fix the --insecure flag issue by disabling ATS in Info.plist (#760) 2024-03-19 03:42:14 -04:00
Nikolay Edigaryev e06d89f95d integration-tests: test_run() with --no-graphics (#757) 2024-03-12 15:12:02 +04:00
3 changed files with 14 additions and 6 deletions
+5
View File
@@ -14,5 +14,10 @@
<array>
<string>AppIcon.png</string>
</array>
<key>NSAppTransportSecurity</key>
<dict>
<key>NSAllowsArbitraryLoads</key>
<true/>
</dict>
</dict>
</plist>
+5 -4
View File
@@ -33,7 +33,7 @@ struct Run: AsyncParsableCommand {
))
var serialPath: String?
@Flag(help: ArgumentHelp("Force open a UI window, even when VNC is enabled.", visibility: .hidden))
@Flag(help: ArgumentHelp("Force open a UI window, even when VNC is enabled.", visibility: .private))
var graphics: Bool = false
@Flag(help: "Disable audio pass-through to host.")
@@ -149,8 +149,8 @@ struct Run: AsyncParsableCommand {
throw ValidationError("--net-bridged, --net-softnet and --net-host are mutually exclusive")
}
if graphics {
print("--graphics is deprecated and will be removed in the future.\n")
if graphics && noGraphics {
throw ValidationError("--graphics and --no-graphics are mutually exclusive")
}
if (noGraphics || vnc || vncExperimental) && captureSystemKeys {
@@ -349,7 +349,8 @@ struct Run: AsyncParsableCommand {
}
sigusr1Src.activate()
if noGraphics {
let useVNCWithoutGraphics = (vnc || vncExperimental) && !graphics
if noGraphics || useVNCWithoutGraphics {
// enter the main even loop, without bringing up any UI,
// and just wait for the VM to exit.
NSApplication.shared.run()
+4 -2
View File
@@ -1,16 +1,18 @@
import uuid
import pytest
from paramiko.client import SSHClient, AutoAddPolicy
def test_run(tart):
@pytest.mark.parametrize("run_opts", [[], ["--no-graphics"]])
def test_run(tart, run_opts):
vm_name = f"integration-test-run-{uuid.uuid4()}"
# Instantiate a VM with admin:admin SSH access
tart.run(["clone", "ghcr.io/cirruslabs/macos-sonoma-base:latest", vm_name])
# Run the VM asynchronously
tart_run_process = tart.run_async(["run", vm_name])
tart_run_process = tart.run_async(["run", vm_name] + run_opts)
# Obtain the VM's IP
stdout, _ = tart.run(["ip", vm_name, "--wait", "120"])