summaryrefslogtreecommitdiff
path: root/pkg/pid/pid_test.go
diff options
context:
space:
mode:
authorkali kaneko (leap communications) <kali@leap.se>2020-06-12 19:05:59 +0200
committerkali kaneko (leap communications) <kali@leap.se>2020-06-12 20:03:03 +0200
commit1038fa83b820bbdaa9bcf37118cf23b0e48a86c5 (patch)
treed403cffa091932c1c46ea17fd15da588c1e5a7a2 /pkg/pid/pid_test.go
parent971c28f6563de35b1d66401d6919f86787af0611 (diff)
[refactor] reorganize modules
bitmaskd: so long and thanks for all the fish! Signed-off-by: kali kaneko (leap communications) <kali@leap.se>
Diffstat (limited to 'pkg/pid/pid_test.go')
-rw-r--r--pkg/pid/pid_test.go21
1 files changed, 21 insertions, 0 deletions
diff --git a/pkg/pid/pid_test.go b/pkg/pid/pid_test.go
new file mode 100644
index 0000000..dbc76f3
--- /dev/null
+++ b/pkg/pid/pid_test.go
@@ -0,0 +1,21 @@
+package pid
+
+import (
+ "syscall"
+ "testing"
+)
+
+const (
+ invalidPid = 345678
+)
+
+func TestPidRunning(t *testing.T) {
+ pid := syscall.Getpid()
+ if !pidRunning(pid) {
+ t.Errorf("pid %v is not running", pid)
+ }
+
+ if pidRunning(invalidPid) {
+ t.Errorf("pid %v is running", invalidPid)
+ }
+}