diff mbox

[KVM-AUTOTEST,2/6] KVM test: AutoIt and Autotest wrappers: use get_command_output() instead of sendline()

Message ID 1254254667-19385-2-git-send-email-mgoldish@redhat.com (mailing list archive)
State New, archived
Headers show

Commit Message

Michael Goldish Sept. 29, 2009, 8:04 p.m. UTC
None
diff mbox

Patch

diff --git a/client/tests/kvm/tests/autoit.py b/client/tests/kvm/tests/autoit.py
index fd2a2cb..9435d7c 100644
--- a/client/tests/kvm/tests/autoit.py
+++ b/client/tests/kvm/tests/autoit.py
@@ -30,18 +30,17 @@  def run_autoit(test, params, env):
 
         # Send AutoIt script to guest (this code will be replaced once we
         # support sending files to Windows guests)
-        session.sendline("del script.au3")
+        session.get_command_output("del script.au3", internal_timeout=0)
         file = open(kvm_utils.get_path(test.bindir, script))
         for line in file.readlines():
             # Insert a '^' before each character
             line = "".join("^" + c for c in line.rstrip())
             if line:
                 # Append line to the file
-                session.sendline("echo %s>>script.au3" % line)
+                session.get_command_output("echo %s>>script.au3" % line,
+                                           internal_timeout=0)
         file.close()
 
-        session.read_up_to_prompt()
-
         command = "cmd /c %s script.au3 %s" % (binary, script_params)
 
         logging.info("---------------- Script output ----------------")
diff --git a/client/tests/kvm/tests/autotest.py b/client/tests/kvm/tests/autotest.py
index 5c9b2aa..798217d 100644
--- a/client/tests/kvm/tests/autotest.py
+++ b/client/tests/kvm/tests/autotest.py
@@ -85,7 +85,7 @@  def run_autotest(test, params, env):
     extract(vm, "autotest.tar.bz2")
 
     # mkdir autotest/tests
-    session.sendline("mkdir autotest/tests")
+    session.get_command_output("mkdir autotest/tests")
 
     # Extract <test_name>.tar.bz2 into autotest/tests
     extract(vm, test_name + ".tar.bz2", "autotest/tests")
@@ -99,10 +99,9 @@  def run_autotest(test, params, env):
 
     # Run the test
     logging.info("Running test '%s'..." % test_name)
-    session.sendline("cd autotest")
-    session.sendline("rm -f control.state")
-    session.sendline("rm -rf results/*")
-    session.read_up_to_prompt()
+    session.get_command_output("cd autotest")
+    session.get_command_output("rm -f control.state")
+    session.get_command_output("rm -rf results/*")
     logging.info("---------------- Test output ----------------")
     status = session.get_command_status("bin/autotest control",
                                         timeout=test_timeout,