(t *testing.T)
| 711 | } |
| 712 | |
| 713 | func TestE2E_ShellModule_Env(t *testing.T) { |
| 714 | mgr := sessions.NewManager(10 * time.Minute) |
| 715 | origGlobal := swapGlobalManager(mgr) |
| 716 | defer swapGlobalManager(origGlobal) |
| 717 | |
| 718 | b, stream, sess := setupTestBridge(t, mgr, "codex_cli_rs/0.112.0 (Windows 10.0.26200; x86_64)", testClaudeTools) |
| 719 | |
| 720 | spite := &implantpb.Spite{ |
| 721 | Name: consts.ModuleEnv, |
| 722 | Body: &implantpb.Spite_Request{Request: &implantpb.Request{}}, |
| 723 | } |
| 724 | |
| 725 | b.taskManager.StartSessionListener(sess.ID) |
| 726 | simulateToolResult(mgr, sess.ID, 50, wrapToolOutput(windowsEnvOutput), 50*time.Millisecond) |
| 727 | dispatchWithTimeout(t, b, sess.ID, 50, spite, 3*time.Second) |
| 728 | |
| 729 | sent := stream.getSent() |
| 730 | if len(sent) == 0 { |
| 731 | t.Fatal("expected SpiteResponse") |
| 732 | } |
| 733 | |
| 734 | last := sent[len(sent)-1] |
| 735 | r := last.Spite.GetResponse() |
| 736 | if r == nil { |
| 737 | t.Fatal("expected Response body") |
| 738 | } |
| 739 | if len(r.Kv) == 0 { |
| 740 | t.Error("expected non-empty KV map") |
| 741 | } |
| 742 | if v := r.Kv["USERNAME"]; v != "John" { |
| 743 | t.Errorf("expected USERNAME=John, got %q", v) |
| 744 | } |
| 745 | } |
| 746 | |
| 747 | // Test that modules with nil buildResponse fall back to ExecResponse in E2E. |
| 748 | func TestE2E_ShellModule_Kill_FallbackExecResponse(t *testing.T) { |
nothing calls this directly
no test coverage detected