4 # Copyright 2005 by Bernhard Reutner-Fischer
5 # Licensed under GPLv2, see file LICENSE in this source tree.
11 # testing "test name" "options" "expected result" "file input" "stdin"
13 testing "pidof (exit with error)" \
14 "pidof veryunlikelyoccuringbinaryname ; echo \$?" "1\n" "" ""
15 testing "pidof (exit with success)" "pidof pidof > /dev/null; echo \$?" \
17 # We can get away with this because it says #!/bin/sh up top.
19 testing "pidof this" "pidof pidof.tests | grep -o -w $$" "$$\n" "" ""
21 test x"`cat /proc/1/comm`" = x"init" && {
22 optional FEATURE_PIDOF_SINGLE
23 testing "pidof -s" "pidof -s init" "1\n" "" ""
27 test x"`cat /proc/1/comm`" = x"init" && {
28 optional FEATURE_PIDOF_OMIT FEATURE_PIDOF_SINGLE
29 # This test fails now because process name matching logic has changed,
30 # but new logic is not "wrong" either... see find_pid_by_name.c comments
31 #testing "pidof -o %PPID" "pidof -o %PPID pidof.tests | grep -o -w $$" "" "" ""
32 testing "pidof -o %PPID NOP" "pidof -o %PPID -s init" "1\n" "" ""
36 optional FEATURE_PIDOF_OMIT
37 testing "pidof -o init" "pidof -o 1 init | grep -o -w 1" "" "" ""