跳到主要内容

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

浏览文件

main_windows_test.go

30 行 · 893 B历史下载
1package main
2
3import (
4 "os"
5 "path/filepath"
6 "testing"
7
8 "github.com/sylvinus/agent-vm/internal/cage"
9)
10
11func TestWindowsEntryDropsOpenSSHAncestorDescriptors(t *testing.T) {
12 names := []string{"OPENSSH_STDIO_MODE", "c28fc6f98a2c44abbbd89d6a3037d0d9_POSIX_FD_STATE"}
13 for _, name := range names {
14 t.Setenv(name, "ancestor-state")
15 }
16 // A missing isolated config reaches runtime initialization, then returns
17 // before any proxy connection, VM work or access to the user's profile.
18 t.Setenv(cage.ConfigEnv, filepath.Join(t.TempDir(), "missing.json"))
19 previous := os.Args
20 os.Args = []string{"cage", "check"}
21 t.Cleanup(func() { os.Args = previous })
22 if code := run(); code != 1 {
23 t.Fatalf("missing configuration returned %d", code)
24 }
25 for _, name := range names {
26 if _, exists := os.LookupEnv(name); exists {
27 t.Errorf("%s survived Windows runtime initialization", name)
28 }
29 }
30}