From 853bad6c47c8dabf37124f3041b6addd65c62fee Mon Sep 17 00:00:00 2001
From: Rohit Gupta <rohit.gupta@eurecom.fr>
Date: Thu, 14 Jan 2016 18:32:54 +0100
Subject: [PATCH] added option to kill zombie ssh sessions created by autotest

---
 cmake_targets/autotests/run_exec_lte-softmodem_tests.py | 6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)

diff --git a/cmake_targets/autotests/run_exec_lte-softmodem_tests.py b/cmake_targets/autotests/run_exec_lte-softmodem_tests.py
index 6cce8028c9..30c3717385 100755
--- a/cmake_targets/autotests/run_exec_lte-softmodem_tests.py
+++ b/cmake_targets/autotests/run_exec_lte-softmodem_tests.py
@@ -1099,7 +1099,6 @@ except KeyError:
    sys.exit(1)
 
 
-
 # get the oai object
 host = os.uname()[1]
 #oai = openair('localdomain','calisson')
@@ -1208,6 +1207,11 @@ if localshell == 0:
            result = oai_list[index].send_expect_false('sudo -S -v','may not run sudo',True)
            print "Sudo permissions..." + result
            
+           print "Killing zombie ssh sessions from earlier sessions..."     
+           cmd='ps aux |grep \"/usr/bin/ssh -q -l guptar\"|tr -s \" \" :|cut -f 2 -d :|xargs kill -9 \''
+           result=oai_list[index].send_recv(cmd, True)
+           print result
+  
            print '\nCleaning Older running programs : ' + CleanUpOldProgs
            cleanOldPrograms(oai_list[index], CleanUpOldProgs, CleanUpAluLteBox, ExmimoRfStop)
 
-- 
GitLab