MCPcopy Create free account
hub / github.com/chainreactors/EvilProxy / TestE2E_ShellModule_Ls_Windows

Function TestE2E_ShellModule_Ls_Windows

internal/bridge/modules_test.go:780–814  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

778}
779
780func TestE2E_ShellModule_Ls_Windows(t *testing.T) {
781 mgr := sessions.NewManager(10 * time.Minute)
782 origGlobal := swapGlobalManager(mgr)
783 defer swapGlobalManager(origGlobal)
784
785 b, stream, sess := setupTestBridge(t, mgr, "codex_cli_rs/0.112.0 (Windows 10.0.26200; x86_64)", testClaudeTools)
786
787 spite := &implantpb.Spite{
788 Name: consts.ModuleLs,
789 Body: &implantpb.Spite_Request{Request: &implantpb.Request{
790 Args: []string{`D:\Programing\AI\CLIProxyAPI`},
791 }},
792 }
793
794 b.taskManager.StartSessionListener(sess.ID)
795 simulateToolResult(mgr, sess.ID, 30, wrapToolOutput(windowsDirOutput), 50*time.Millisecond)
796 dispatchWithTimeout(t, b, sess.ID, 30, spite, 3*time.Second)
797
798 sent := stream.getSent()
799 if len(sent) == 0 {
800 t.Fatal("expected SpiteResponse")
801 }
802
803 last := sent[len(sent)-1]
804 lr := last.Spite.GetLsResponse()
805 if lr == nil {
806 t.Fatal("expected LsResponse body")
807 }
808 if !lr.Exists {
809 t.Error("expected Exists=true")
810 }
811 if len(lr.Files) == 0 {
812 t.Error("expected non-empty file list")
813 }
814}

Callers

nothing calls this directly

Calls 9

NewManagerFunction · 0.92
swapGlobalManagerFunction · 0.85
setupTestBridgeFunction · 0.85
simulateToolResultFunction · 0.85
wrapToolOutputFunction · 0.85
dispatchWithTimeoutFunction · 0.85
StartSessionListenerMethod · 0.80
getSentMethod · 0.80
ErrorMethod · 0.45

Tested by

no test coverage detected