summaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authorJeff Licquia <licquia@debian.org>2012-11-10 10:26:30 -0500
committerDidier Raboud <odyx@debian.org>2012-11-10 16:59:31 +0100
commit9ecfb4673edbf07290ac8739fe265ffb3e6d4eaf (patch)
tree943592d9ac9c6a0a9394ff50cee7f1081b86e485 /test
parent8759b26d1532c16be72672da46b103d9950f9ff4 (diff)
Sanity-check pidofproc parameters
Closes: #691422.
Diffstat (limited to 'test')
-rw-r--r--test/lsb-test.sh28
1 files changed, 28 insertions, 0 deletions
diff --git a/test/lsb-test.sh b/test/lsb-test.sh
index 1168a62..2db3457 100644
--- a/test/lsb-test.sh
+++ b/test/lsb-test.sh
@@ -8,3 +8,31 @@ log_success_msg "This should succeed"
log_failure_msg "This fails miserably"
echo "OK!"
+
+# Test pidofproc sanity checking.
+
+echo "Testing pidofproc command line checks"
+
+echo " Simple check, no options:"
+pidofproc nonexistent
+RETVAL=$?
+if [ $RETVAL -ne 3 ]; then
+ echo "Unexpected return value $RETVAL"
+fi
+
+echo " With -p option:"
+pidofproc -p /var/run/nonexist.pid nonexistent
+RETVAL=$?
+if [ $RETVAL -ne 3 ]; then
+ echo "Unexpected return value $RETVAL"
+fi
+
+echo " With -p option, but in wrong place:"
+pidofproc nonexistent -p /var/run/nonexist.pid
+RETVAL=$?
+if [ $RETVAL -ne 4 ]; then
+ echo "Unexpected return value $RETVAL"
+fi
+
+echo "OK!"
+