Evidence
@@ -3760,19 +3183,19 @@
+ HostLocalEnvironmentRefresh, REMOTE_LINUX_VM_INCUS_GUEST_REQUEST_PATH,
+ REMOTE_LINUX_VM_INCUS_WORKSPACE_DEPS_MOUNT_PATH, REMOTE_MICROVM_VIRTIOFS_SOCKETS,
+ RemoteLinuxVmContext, attach_remote_linux_vm_execution,
+ build_sync_directory_finalize_command, ... incus, microvm, ...
@@ -4030,21 +3452,75 @@
+ fn remote_linux_incus_launch_uses_incus_exec_runner() {
+ let command = incus::build_launch_command(
+ &sample_remote_context(RemoteLinuxVmBackend::Incus),
+ REMOTE_LINUX_VM_INCUS_GUEST_REQUEST_PATH,
+ );
+ assert!(command.contains("sudo incus"));
+ assert!(command.contains("'/artifacts/guest-request.json'"));
+ assert!(!command.contains("PIKACI_INCUS_GUEST_COMMAND"));
+ assert!(!command.contains("PIKACI_INCUS_TIMEOUT_SECS"));
+ assert!(!command.contains("PIKACI_INCUS_RUN_AS_ROOT"));
@@ -4030,21 +3452,75 @@
+ fn remote_linux_incus_guest_request_captures_command_timeout_and_user() {
+ let request = incus::build_guest_request(&sample_shell_job("actionlint"));
+ assert_eq!(request.schema_version, 1);
+ assert_eq!(request.command, "bash --noprofile --norc -lc 'actionlint'");
+ assert_eq!(request.timeout_secs, 120);
+ assert!(!request.run_as_root);
@@ -4030,21 +3452,75 @@
+ fn remote_linux_incus_image_record_selection_uses_matching_alias() {
+ let fingerprint = incus::select_image_fingerprint_from_json(...
+ assert_eq!(fingerprint, "right");
@@ -4030,21 +3452,75 @@
+ fn remote_linux_incus_image_record_selection_rejects_missing_alias() {
+ let err = incus::select_image_fingerprint_from_json(...
+ assert!(err.to_string().contains("returned no matching alias record"));
Four test changes validate the refactored code:
-
remote_linux_incus_launch_uses_incus_exec_runner — Updated to call incus::build_launch_command with the request path. Now asserts the path /artifacts/guest-request.json is present and that the old environment variables (PIKACI_INCUS_GUEST_COMMAND, etc.) are absent.
-
remote_linux_incus_guest_request_captures_command_timeout_and_user (new) — Verifies IncusGuestRequest serialization for both normal and root jobs, checking schema_version, command, timeout_secs, and run_as_root.
-
remote_linux_incus_image_record_selection_uses_matching_alias (new) — Feeds a two-element JSON array into select_image_fingerprint_from_json and confirms the record with the matching alias is selected.
-
remote_linux_incus_image_record_selection_rejects_missing_alias (new) — Confirms that an array with no matching alias produces a clear error message.
The existing remote_linux_microvm_launch_starts_virtiofsd_and_waits_for_sockets test is updated to call microvm::build_launch_command and the remote_linux_incus_read_only_disk_device_uses_virtiofs_bus test now calls incus::build_device_add_args.