From 34e035858d305220d33005d0469c9121bfcdc5bc Mon Sep 17 00:00:00 2001 From: Vladimir Stoilov Date: Thu, 30 Mar 2023 16:06:17 +0200 Subject: [PATCH] Add binary path to integration test utiltool --- cmds/integrationtest/netstate.go | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/cmds/integrationtest/netstate.go b/cmds/integrationtest/netstate.go index ca90cbdc..e714e67e 100644 --- a/cmds/integrationtest/netstate.go +++ b/cmds/integrationtest/netstate.go @@ -9,6 +9,8 @@ import ( "github.com/safing/portmaster/network/packet" "github.com/safing/portmaster/network/socket" "github.com/safing/portmaster/network/state" + + processInfo "github.com/shirou/gopsutil/process" ) func init() { @@ -105,7 +107,16 @@ func checkAndPrintSocketInfoIfNew(c string, s socket.Info) { // Print result. if err == nil { - fmt.Printf("%s %d\n", c, s.GetPID()) + + pInfo, err := processInfo.NewProcess(int32(s.GetPID())) + + if err != nil { + fmt.Printf("%s %d no binary: %s\n", c, s.GetPID(), err) + } else { + exe, _ := pInfo.Exe() + fmt.Printf("%s %d %s\n", c, s.GetPID(), exe) + } + } else { fmt.Printf("%s %d (err: %s)\n", c, s.GetPID(), err) }