(t *testing.T)
| 680 | } |
| 681 | |
| 682 | func TestE2E_ShellModule_Whoami(t *testing.T) { |
| 683 | mgr := sessions.NewManager(10 * time.Minute) |
| 684 | origGlobal := swapGlobalManager(mgr) |
| 685 | defer swapGlobalManager(origGlobal) |
| 686 | |
| 687 | b, stream, sess := setupTestBridge(t, mgr, "codex_cli_rs/0.112.0 (Windows 10.0.26200; x86_64)", testClaudeTools) |
| 688 | |
| 689 | spite := &implantpb.Spite{ |
| 690 | Name: consts.ModuleWhoami, |
| 691 | Body: &implantpb.Spite_Request{Request: &implantpb.Request{}}, |
| 692 | } |
| 693 | |
| 694 | b.taskManager.StartSessionListener(sess.ID) |
| 695 | simulateToolResult(mgr, sess.ID, 40, "Exit code: 0\nOutput:\ncodemonkey\\john", 50*time.Millisecond) |
| 696 | dispatchWithTimeout(t, b, sess.ID, 40, spite, 3*time.Second) |
| 697 | |
| 698 | sent := stream.getSent() |
| 699 | if len(sent) == 0 { |
| 700 | t.Fatal("expected SpiteResponse") |
| 701 | } |
| 702 | |
| 703 | last := sent[len(sent)-1] |
| 704 | r := last.Spite.GetResponse() |
| 705 | if r == nil { |
| 706 | t.Fatal("expected Response body") |
| 707 | } |
| 708 | if !strings.Contains(r.Output, "codemonkey") { |
| 709 | t.Errorf("expected output containing 'codemonkey', got %q", r.Output) |
| 710 | } |
| 711 | } |
| 712 | |
| 713 | func TestE2E_ShellModule_Env(t *testing.T) { |
| 714 | mgr := sessions.NewManager(10 * time.Minute) |
nothing calls this directly
no test coverage detected