From fac258757a63bdc43c7f3b68fbccf5f00c2036a5 Mon Sep 17 00:00:00 2001
From: Philip Withnall <philip.withnall@collabora.co.uk>
Date: Thu, 10 Sep 2015 21:35:24 +0100
Subject: [PATCH] traffic-control: Ignore failure to kill tcdemo processes

When cleaning up, ignore failure to kill tcdemo processes, caused by
them already exiting or being killed earlier on. This fixes all test
cases after the first one in the traffic-control-tcdemo unit test
running.

Bug: https://bugs.apertis.org/show_bug.cgi?id=328
Differential Revision: https://phabricator.apertis.org/D430
Signed-off-by: Philip Withnall <philip.withnall@collabora.co.uk>
Reviewed-by: Sjoerd Simons <sjoerd.simons@collabora.com>
---
 traffic-control/manual/init-setup.sh | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/traffic-control/manual/init-setup.sh b/traffic-control/manual/init-setup.sh
index cbbdcf0..d8547d2 100644
--- a/traffic-control/manual/init-setup.sh
+++ b/traffic-control/manual/init-setup.sh
@@ -20,15 +20,15 @@ _kill_procs() {
     for proc in "${ROOT_PROC_KILL_LIST[@]}"; do
         if ps -p $proc >/dev/null; then
             # Let sudo a chance to kill its child
-            sudo kill -SIGINT $proc
+            sudo kill -SIGINT $proc || true
             sleep 0.2
-            sudo kill -SIGKILL $proc
+            sudo kill -SIGKILL $proc || true
         fi
     done
     for proc in "${PROC_KILL_LIST[@]}"; do
         if ps -p $proc >/dev/null; then
             # Only killing wget here. No need for sudo.
-            kill $proc
+            kill $proc || true
         fi
     done
 }
-- 
GitLab