@@ -602,6 +602,7 @@ set -euo pipefail
|
602 | 602 | if [[ "$1" == "list" ]]; then |
603 | 603 | cat <<'JSON' |
604 | 604 | [ |
| 605 | + {"name": "Ubuntu 9007199254740993.04"}, |
605 | 606 | {"name": "Ubuntu 26.04"}, |
606 | 607 | {"name": "Ubuntu 25.10"}, |
607 | 608 | {"name": "Ubuntu 23.10"}, |
@@ -619,6 +620,7 @@ const isPrlctl = [process.argv0, process.execPath].some((value) =>
|
619 | 620 | if (isPrlctl) { |
620 | 621 | if (process.argv.some((arg) => arg.includes("list"))) { |
621 | 622 | console.log(JSON.stringify([ |
| 623 | + { name: "Ubuntu 9007199254740993.04" }, |
622 | 624 | { name: "Ubuntu 26.04" }, |
623 | 625 | { name: "Ubuntu 25.10" }, |
624 | 626 | { name: "Ubuntu 23.10" }, |
@@ -640,6 +642,49 @@ if (isPrlctl) {
|
640 | 642 | } |
641 | 643 | }); |
642 | 644 | |
| 645 | +it("skips unsafe Ubuntu version names in fallback resolver", () => { |
| 646 | +const tempDir = mkdtempSync(join(tmpdir(), "openclaw-parallels-vm-helper-")); |
| 647 | +writeFakePrlctl( |
| 648 | +tempDir, |
| 649 | +`#!/usr/bin/env bash |
| 650 | +set -euo pipefail |
| 651 | +if [[ "$1" == "list" ]]; then |
| 652 | + cat <<'JSON' |
| 653 | +[ |
| 654 | + {"name": "Ubuntu 9007199254740993.04"}, |
| 655 | + {"name": "Ubuntu 23.10"} |
| 656 | +] |
| 657 | +JSON |
| 658 | + exit 0 |
| 659 | +fi |
| 660 | +exit 1 |
| 661 | +`, |
| 662 | +`import { basename } from "node:path"; |
| 663 | +const isPrlctl = [process.argv0, process.execPath].some((value) => |
| 664 | + basename(value).toLowerCase() === "prlctl.exe", |
| 665 | +); |
| 666 | +if (isPrlctl) { |
| 667 | + if (process.argv.some((arg) => arg.includes("list"))) { |
| 668 | + console.log(JSON.stringify([ |
| 669 | + { name: "Ubuntu 9007199254740993.04" }, |
| 670 | + { name: "Ubuntu 23.10" }, |
| 671 | + ])); |
| 672 | + process.exit(0); |
| 673 | + } |
| 674 | + process.exit(1); |
| 675 | +} |
| 676 | +`, |
| 677 | +); |
| 678 | + |
| 679 | +try { |
| 680 | +const output = withEnv(fakePrlctlEnv(tempDir), () => resolveUbuntuVmName("Ubuntu missing")); |
| 681 | + |
| 682 | +expect(output).toBe("Ubuntu 23.10"); |
| 683 | +} finally { |
| 684 | +rmSync(tempDir, { force: true, recursive: true }); |
| 685 | +} |
| 686 | +}); |
| 687 | + |
643 | 688 | it("uses the only macOS VM when the default name is unavailable", () => { |
644 | 689 | const tempDir = mkdtempSync(join(tmpdir(), "openclaw-parallels-macos-vm-helper-")); |
645 | 690 | writeFakePrlctl( |
|