test suite reviews and discussions
 help / color / mirror / Atom feed
From: Marvin Liu <yong.liu@intel.com>
To: dts@dpdk.org
Cc: Marvin Liu <yong.liu@intel.com>
Subject: [dts] [PATCH 1/7] framework: support close ssh session without logout
Date: Thu, 14 Jul 2016 21:17:27 +0800	[thread overview]
Message-ID: <1468502253-1276-2-git-send-email-yong.liu@intel.com> (raw)
In-Reply-To: <1468502253-1276-1-git-send-email-yong.liu@intel.com>

Session may not avaiable to logout like migration done.
Add paramter to close connection forcely without logout action.

Signed-off-by: Marvin Liu <yong.liu@intel.com>

diff --git a/framework/ssh_connection.py b/framework/ssh_connection.py
index 9f1aee1..edb8170 100644
--- a/framework/ssh_connection.py
+++ b/framework/ssh_connection.py
@@ -72,8 +72,8 @@ class SSHConnection(object):
         self.logger.debug(out)
         return out
 
-    def close(self):
-        self.session.close()
+    def close(self, force=False):
+        self.session.close(force)
         connection = {}
         connection[self.name] = self.session
         try:
diff --git a/framework/ssh_pexpect.py b/framework/ssh_pexpect.py
index f0348b6..1abf8a1 100644
--- a/framework/ssh_pexpect.py
+++ b/framework/ssh_pexpect.py
@@ -129,9 +129,12 @@ class SSHPexpect(object):
         output.replace("[PEXPECT]", "")
         return output
 
-    def close(self):
-        if self.isalive():
-            self.session.logout()
+    def close(self, force=False):
+        if force is True:
+            self.session.close()
+        else:
+            if self.isalive():
+                self.session.logout()
 
     def isalive(self):
         return self.session.isalive()
diff --git a/framework/virt_dut.py b/framework/virt_dut.py
index cc86827..0010e08 100644
--- a/framework/virt_dut.py
+++ b/framework/virt_dut.py
@@ -75,12 +75,12 @@ class VirtDut(DPDKdut):
     def init_log(self):
         self.logger.config_suite(self.host_dut.test_classname, 'virtdut')
 
-    def close(self):
+    def close(self, force=False):
         if self.session:
-            self.session.close()
+            self.session.close(force)
             self.session = None
         if self.alt_session:
-            self.alt_session.close()
+            self.alt_session.close(force)
             self.alt_session = None
         RemoveNicObj(self)
 
-- 
1.9.3

  reply	other threads:[~2016-07-14 13:18 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-07-14 13:17 [dts] [PATCH 0/7] support vhost live migration automation Marvin Liu
2016-07-14 13:17 ` Marvin Liu [this message]
2016-07-14 13:17 ` [dts] [PATCH 2/7] framework tester: fix typo issue Marvin Liu
2016-07-14 13:17 ` [dts] [PATCH 3/7] framework virt_base: add vm status concept Marvin Liu
2016-07-14 13:17 ` [dts] [PATCH 4/7] framework qemu_kvm: support migration and serial port Marvin Liu
2016-07-14 13:17 ` [dts] [PATCH 5/7] conf: add configuration file for vhost_user_live_migration suite Marvin Liu
2016-07-14 13:17 ` [dts] [PATCH 6/7] test_plans: add test plan " Marvin Liu
2016-07-14 13:17 ` [dts] [PATCH 7/7] tests: add " Marvin Liu

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1468502253-1276-2-git-send-email-yong.liu@intel.com \
    --to=yong.liu@intel.com \
    --cc=dts@dpdk.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).