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

Function TestParsePsOutput_Windows

internal/bridge/modules_test.go:267–289  ·  view source on GitHub ↗

=================================================================== Parser unit tests — parsePsOutput ===================================================================

(t *testing.T)

Source from the content-addressed store, hash-verified

265// ===================================================================
266
267func TestParsePsOutput_Windows(t *testing.T) {
268 t.Parallel()
269 resp := parsePsOutput(windowsTasklistOutput, "Windows")
270
271 if len(resp.Processes) != 5 {
272 t.Fatalf("expected 5 processes, got %d", len(resp.Processes))
273 }
274
275 // Verify System process.
276 p := resp.Processes[1]
277 if p.Name != "System" || p.Pid != 4 {
278 t.Errorf("expected System PID=4, got name=%q pid=%d", p.Name, p.Pid)
279 }
280 if p.Owner != "Services" {
281 t.Errorf("expected owner=Services, got %q", p.Owner)
282 }
283
284 // Verify explorer.exe.
285 p = resp.Processes[4]
286 if p.Name != "explorer.exe" || p.Pid != 12456 {
287 t.Errorf("expected explorer.exe PID=12456, got name=%q pid=%d", p.Name, p.Pid)
288 }
289}
290
291func TestParsePsOutput_Linux(t *testing.T) {
292 t.Parallel()

Callers

nothing calls this directly

Calls 1

parsePsOutputFunction · 0.85

Tested by

no test coverage detected