Kernel KVM virtualization development
 help / color / mirror / Atom feed
From: Michael Goldish <mgoldish@redhat.com>
To: autotest@test.kernel.org, kvm@vger.kernel.org
Subject: [KVM-AUTOTEST PATCH 06/17] KVM test: rename VM.remote_login() to VM.login()
Date: Mon,  3 Jan 2011 20:27:07 +0200	[thread overview]
Message-ID: <1294079238-21239-6-git-send-email-mgoldish@redhat.com> (raw)
In-Reply-To: <1294079238-21239-1-git-send-email-mgoldish@redhat.com>

Keep remote_login() as an alias for backward compatibility.

Signed-off-by: Michael Goldish <mgoldish@redhat.com>
---
 client/tests/kvm/kvm_preprocessing.py |    2 +-
 client/tests/kvm/kvm_test_utils.py    |    2 +-
 client/tests/kvm/kvm_vm.py            |   21 ++++++++++++++-------
 client/tests/kvm/tests/boot_savevm.py |    2 +-
 client/tests/kvm/tests/timedrift.py   |    2 +-
 5 files changed, 18 insertions(+), 11 deletions(-)

diff --git a/client/tests/kvm/kvm_preprocessing.py b/client/tests/kvm/kvm_preprocessing.py
index 2997c8f..830ee99 100644
--- a/client/tests/kvm/kvm_preprocessing.py
+++ b/client/tests/kvm/kvm_preprocessing.py
@@ -341,7 +341,7 @@ def postprocess(test, params, env):
         for vm in env.get_all_vms():
             if vm.is_alive():
                 try:
-                    session = vm.remote_login()
+                    session = vm.login()
                     session.close()
                 except kvm_utils.LoginError:
                     vm.destroy(gracefully=False)
diff --git a/client/tests/kvm/kvm_test_utils.py b/client/tests/kvm/kvm_test_utils.py
index 539bb10..cad4bea 100644
--- a/client/tests/kvm/kvm_test_utils.py
+++ b/client/tests/kvm/kvm_test_utils.py
@@ -76,7 +76,7 @@ def wait_for_login(vm, nic_index=0, timeout=240, start=0, step=2, serial=None):
         time.sleep(start)
         while time.time() < end_time:
             try:
-                session = vm.remote_login(nic_index=nic_index)
+                session = vm.login(nic_index=nic_index)
                 break
             except kvm_utils.LoginError, e:
                 logging.debug(e)
diff --git a/client/tests/kvm/kvm_vm.py b/client/tests/kvm/kvm_vm.py
index 0bc8a8b..e310401 100755
--- a/client/tests/kvm/kvm_vm.py
+++ b/client/tests/kvm/kvm_vm.py
@@ -795,7 +795,7 @@ class VM:
                 # Try to destroy with shell command
                 logging.debug("Trying to shutdown VM with shell command...")
                 try:
-                    session = self.remote_login()
+                    session = self.login()
                 except kvm_utils.LoginError, e:
                     logging.debug(e)
                 else:
@@ -1059,7 +1059,7 @@ class VM:
         return shm * 4.0 / 1024
 
 
-    def remote_login(self, nic_index=0, timeout=10):
+    def login(self, nic_index=0, timeout=10):
         """
         Log into the guest via SSH/Telnet/Netcat.
         If timeout expires while waiting for output from the guest (e.g. a
@@ -1091,13 +1091,20 @@ class VM:
         return session
 
 
+    def remote_login(self, nic_index=0, timeout=10):
+        """
+        Alias for login() for backward compatibility.
+        """
+        return self.login(nic_index, timeout)
+
+
     def wait_for_login(self, nic_index=0, timeout=240, internal_timeout=10):
         """
         Make multiple attempts to log into the guest via SSH/Telnet/Netcat.
 
         @param nic_index: The index of the NIC to connect to.
         @param timeout: Time (seconds) to keep trying to log in.
-        @param internal_timeout: Timeout to pass to remote_login().
+        @param internal_timeout: Timeout to pass to login().
         @return: A ShellSession object.
         """
         logging.debug("Attempting to log into '%s' (timeout %ds)" % (self.name,
@@ -1105,12 +1112,12 @@ class VM:
         end_time = time.time() + timeout
         while time.time() < end_time:
             try:
-                return self.remote_login(nic_index, internal_timeout)
+                return self.login(nic_index, internal_timeout)
             except kvm_utils.LoginError, e:
                 logging.debug(e)
             time.sleep(2)
         # Timeout expired; try one more time but don't catch exceptions
-        return self.remote_login(nic_index, internal_timeout)
+        return self.login(nic_index, internal_timeout)
 
 
     def copy_files_to(self, local_path, remote_path, nic_index=0, timeout=600):
@@ -1253,7 +1260,7 @@ class VM:
         """
         Get the cpu count of the VM.
         """
-        session = self.remote_login()
+        session = self.login()
         try:
             return int(session.cmd(self.params.get("cpu_chk_cmd")))
         finally:
@@ -1267,7 +1274,7 @@ class VM:
         @param check_cmd: Command used to check memory. If not provided,
                 self.params.get("mem_chk_cmd") will be used.
         """
-        session = self.remote_login()
+        session = self.login()
         try:
             if not cmd:
                 cmd = self.params.get("mem_chk_cmd")
diff --git a/client/tests/kvm/tests/boot_savevm.py b/client/tests/kvm/tests/boot_savevm.py
index cf5e433..c805816 100644
--- a/client/tests/kvm/tests/boot_savevm.py
+++ b/client/tests/kvm/tests/boot_savevm.py
@@ -50,7 +50,7 @@ def run_boot_savevm(test, params, env):
         if (time.time() > login_expire):
             login_expire = time.time() + savevm_login_delay
             logging.info("Logging in after loadvm...")
-            session = vm.remote_login()
+            session = vm.login()
             logging.info("Logged in to guest!")
             break
 
diff --git a/client/tests/kvm/tests/timedrift.py b/client/tests/kvm/tests/timedrift.py
index 489cf9d..1dea364 100644
--- a/client/tests/kvm/tests/timedrift.py
+++ b/client/tests/kvm/tests/timedrift.py
@@ -87,7 +87,7 @@ def run_timedrift(test, params, env):
             # Open shell sessions with the guest
             logging.info("Starting load on guest...")
             for i in range(guest_load_instances):
-                load_session = vm.remote_login()
+                load_session = vm.login()
                 # Set output func to None to stop it from being called so we
                 # can change the callback function and the parameters it takes
                 # with no problems
-- 
1.7.3.4

  parent reply	other threads:[~2011-01-03 18:27 UTC|newest]

Thread overview: 17+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-01-03 18:27 [KVM-AUTOTEST PATCH 01/17] KVM test: introduce exception classes for _remote_login() and _remote_scp() Michael Goldish
2011-01-03 18:27 ` [KVM-AUTOTEST PATCH 02/17] KVM test: kvm_utils.py: reorder remote_login(), remote_scp(), copy_files_to(), etc Michael Goldish
2011-01-03 18:27 ` [KVM-AUTOTEST PATCH 03/17] KVM test: use the new LoginError and SCPError exceptions Michael Goldish
2011-01-03 18:27 ` [KVM-AUTOTEST PATCH 04/17] KVM test: add VM.wait_for_login() and kvm_utils.wait_for_login() Michael Goldish
2011-01-03 18:27 ` [KVM-AUTOTEST PATCH 05/17] KVM test: use the new wait_for_login() Michael Goldish
2011-01-03 18:27 ` Michael Goldish [this message]
2011-01-03 18:27 ` [KVM-AUTOTEST PATCH 07/17] KVM test: introduce VM exceptions Michael Goldish
2011-01-03 18:27 ` [KVM-AUTOTEST PATCH 08/17] KVM test: let kvm_vm.create_image() raise a CmdError if qemu-img fails Michael Goldish
2011-01-03 18:27 ` [KVM-AUTOTEST PATCH 09/17] KVM test: use the new VM exceptions Michael Goldish
2011-01-03 18:27 ` [KVM-AUTOTEST PATCH 10/17] KVM test: add VM.verify_alive() and Monitor.verify_responsive() Michael Goldish
2011-01-03 18:27 ` [KVM-AUTOTEST PATCH 11/17] KVM test: use VM.verify_alive() instead of kvm_test_utils.get_living_vm() Michael Goldish
2011-01-03 18:27 ` [KVM-AUTOTEST PATCH 12/17] KVM test: kvm_preprocessing.py: simplify handling of params['migration_mode'] Michael Goldish
2011-01-03 18:27 ` [KVM-AUTOTEST PATCH 13/17] KVM test: make migrate() a VM method Michael Goldish
2011-01-03 18:27 ` [KVM-AUTOTEST PATCH 14/17] KVM test: simplify migration_with_reboot and migration_with_file_transfer Michael Goldish
2011-01-03 18:27 ` [KVM-AUTOTEST PATCH 15/17] KVM test: use VM.migrate() instead of kvm_test_utils.migrate() Michael Goldish
2011-01-03 18:27 ` [KVM-AUTOTEST PATCH 16/17] KVM test: reorder kvm_utils.copy_files_from() path parameters Michael Goldish
2011-01-03 18:27 ` [KVM-AUTOTEST PATCH 17/17] KVM test: rename path parameters in kvm_vm.copy_files_*() Michael Goldish

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=1294079238-21239-6-git-send-email-mgoldish@redhat.com \
    --to=mgoldish@redhat.com \
    --cc=autotest@test.kernel.org \
    --cc=kvm@vger.kernel.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