mirror of
https://github.com/duke-git/lancet.git
synced 2026-02-11 00:02:28 +08:00
feat: add GetProcessInfo for system package
This commit is contained in:
@@ -4,6 +4,7 @@ import (
|
||||
"os/exec"
|
||||
"strings"
|
||||
"testing"
|
||||
"time"
|
||||
|
||||
"github.com/duke-git/lancet/v2/internal"
|
||||
)
|
||||
@@ -125,3 +126,19 @@ func TestStopProcess(t *testing.T) {
|
||||
err = StopProcess(pid)
|
||||
assert.IsNil(err)
|
||||
}
|
||||
|
||||
func TestGetProcessInfo(t *testing.T) {
|
||||
t.Parallel()
|
||||
|
||||
assert := internal.NewAssert(t, "TestGetProcessInfo")
|
||||
|
||||
pid, err := StartProcess("ls", "-a")
|
||||
assert.IsNil(err)
|
||||
|
||||
time.Sleep(1 * time.Second)
|
||||
|
||||
processInfo, err := GetProcessInfo(pid)
|
||||
assert.IsNil(err)
|
||||
|
||||
t.Log(processInfo)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user