KVM test: Modify remote_login and remote_scp in kvm_utils to use kvm_subprocess
Also remove a reference to kvm_log that was left behind.
Signed-off-by: Michael Goldish <mgoldish@redhat.com>
git-svn-id: http://test.kernel.org/svn/autotest/trunk@3430 592f7852-d20e-0410-864c-8624ca9c26a4
diff --git a/client/tests/kvm/kvm_utils.py b/client/tests/kvm/kvm_utils.py
index b2b0d1a..fb587c5 100644
--- a/client/tests/kvm/kvm_utils.py
+++ b/client/tests/kvm/kvm_utils.py
@@ -2,6 +2,7 @@
import select, re, logging
from autotest_lib.client.bin import utils
from autotest_lib.client.common_lib import error
+import kvm_subprocess
"""
KVM test utility functions.
@@ -631,8 +632,9 @@
@return Return the kvm_spawn object on success and None on failure.
"""
- sub = kvm_spawn(command, linesep)
- sub.set_prompt(prompt)
+ sub = kvm_subprocess.kvm_shell_session(command,
+ linesep=linesep,
+ prompt=prompt)
password_prompt_count = 0
@@ -698,7 +700,7 @@
@return: True if the transfer succeeds and False on failure.
"""
- sub = kvm_spawn(command)
+ sub = kvm_subprocess.kvm_expect(command)
password_prompt_count = 0
_timeout = login_timeout
@@ -729,9 +731,10 @@
sub.close()
return False
else: # match == None
- logging.debug("Timeout or process terminated")
+ logging.debug("Timeout elapsed or process terminated")
+ status = sub.get_status()
sub.close()
- return sub.poll() == 0
+ return status == 0
def scp_to_remote(host, port, username, password, local_path, remote_path,