跳到主要内容

Claude Cage · 面向 Claude 的隔离开发环境,支持桌面工作台、多账号、远程部署与移动端连接。上游 Lee-xeo/Claude-Cage 完整源码镜像,非灵栈原创;主许可 MIT,第三方组件遵循各自许可。来源:https://github.com/Lee-xeo/Claude-Cage 。手动同步,不附带 Release 安装包。

浏览文件

hyperv_instance_test.go

27 行 · 652 B历史下载
1package guestos
2
3import (
4 "os/exec"
5 "path/filepath"
6 "runtime"
7 "testing"
8)
9
10func TestHyperVReadOnlyQuery(t *testing.T) {
11 shell := "pwsh"
12 if runtime.GOOS == "windows" {
13 shell = "powershell.exe"
14 }
15 binary, err := exec.LookPath(shell)
16 if err != nil {
17 t.Skipf("%s is not installed", shell)
18 }
19 query, err := filepath.Abs("hyperv_instance.ps1")
20 if err != nil {
21 t.Fatal(err)
22 }
23 cmd := exec.CommandContext(t.Context(), binary, "-NoProfile", "-NonInteractive", "-File", filepath.Join("testdata", "hyperv_instance.ps1"), "-Query", query)
24 if output, err := cmd.CombinedOutput(); err != nil {
25 t.Fatalf("Hyper-V query: %v\n%s", err, output)
26 }
27}