diff mbox

[2/4] KVM test: kvm_subprocess: rename get_command_status_output() and friends

Message ID 1290880591-9580-2-git-send-email-lmr@redhat.com (mailing list archive)
State New, archived
Headers show

Commit Message

Lucas Meneghel Rodrigues Nov. 27, 2010, 5:56 p.m. UTC
None
diff mbox

Patch

diff --git a/client/tests/kvm/kvm_subprocess.py b/client/tests/kvm/kvm_subprocess.py
index c92910c..c8caab2 100755
--- a/client/tests/kvm/kvm_subprocess.py
+++ b/client/tests/kvm/kvm_subprocess.py
@@ -1103,7 +1103,7 @@  class kvm_shell_session(kvm_expect):
         @param prompt: Regular expression describing the shell's prompt line.
         @param status_test_command: Command to be used for getting the last
                 exit status of commands run inside the shell (used by
-                get_command_status_output() and friends).
+                cmd_status_output() and friends).
         """
         # Init the superclass
         kvm_expect.__init__(self, command, id, auto_close, echo, linesep,
@@ -1193,8 +1193,8 @@  class kvm_shell_session(kvm_expect):
         return o
 
 
-    def get_command_output(self, cmd, timeout=30.0, internal_timeout=None,
-                           print_func=None):
+    def cmd_output(self, cmd, timeout=30.0, internal_timeout=None,
+                   print_func=None):
         """
         Send a command and return its output.
 
@@ -1237,8 +1237,8 @@  class kvm_shell_session(kvm_expect):
         return remove_last_nonempty_line(remove_command_echo(o, cmd))
 
 
-    def get_command_status_output(self, cmd, timeout=30.0,
-                                  internal_timeout=None, print_func=None):
+    def cmd_status_output(self, cmd, timeout=30.0, internal_timeout=None,
+                          print_func=None):
         """
         Send a command and return its exit status and output.
 
@@ -1257,11 +1257,10 @@  class kvm_shell_session(kvm_expect):
         @raise ShellStatusError: Raised if the exit status cannot be obtained
         @raise ShellError: Raised if an unknown error occurs
         """
-        o = self.get_command_output(cmd, timeout, internal_timeout, print_func)
+        o = self.cmd_output(cmd, timeout, internal_timeout, print_func)
         try:
             # Send the 'echo $?' (or equivalent) command to get the exit status
-            s = self.get_command_output(self.status_test_command, 10,
-                                        internal_timeout)
+            s = self.cmd_output(self.status_test_command, 10, internal_timeout)
         except ShellError:
             raise ShellStatusError(cmd, o)
 
@@ -1273,8 +1272,8 @@  class kvm_shell_session(kvm_expect):
             raise ShellStatusError(cmd, o)
 
 
-    def get_command_status(self, cmd, timeout=30.0, internal_timeout=None,
-                           print_func=None):
+    def cmd_status(self, cmd, timeout=30.0, internal_timeout=None,
+                   print_func=None):
         """
         Send a command and return its exit status.
 
@@ -1292,8 +1291,8 @@  class kvm_shell_session(kvm_expect):
         @raise ShellStatusError: Raised if the exit status cannot be obtained
         @raise ShellError: Raised if an unknown error occurs
         """
-        s, o = self.get_command_status_output(cmd, timeout, internal_timeout,
-                                              print_func)
+        s, o = self.cmd_status_output(cmd, timeout, internal_timeout,
+                                      print_func)
         return s
 
 
@@ -1319,8 +1318,8 @@  class kvm_shell_session(kvm_expect):
         @raise ShellError: Raised if an unknown error occurs
         @raise ShellCmdError: Raised if the exit status is nonzero
         """
-        s, o = self.get_command_status_output(cmd, timeout, internal_timeout,
-                                              print_func)
+        s, o = self.cmd_status_output(cmd, timeout, internal_timeout,
+                                      print_func)
         if s != 0:
             raise ShellCmdError(cmd, s, o)
         return o
diff --git a/client/tests/kvm/kvm_test_utils.py b/client/tests/kvm/kvm_test_utils.py
index c526d8e..2269cd7 100644
--- a/client/tests/kvm/kvm_test_utils.py
+++ b/client/tests/kvm/kvm_test_utils.py
@@ -264,7 +264,7 @@  def stop_windows_service(session, service, timeout=120):
     """
     end_time = time.time() + timeout
     while time.time() < end_time:
-        o = session.get_command_output("sc stop %s" % service, timeout=60)
+        o = session.cmd_output("sc stop %s" % service, timeout=60)
         # FAILED 1060 means the service isn't installed.
         # FAILED 1062 means the service hasn't been started.
         if re.search(r"\bFAILED (1060|1062)\b", o, re.I):
@@ -286,7 +286,7 @@  def start_windows_service(session, service, timeout=120):
     """
     end_time = time.time() + timeout
     while time.time() < end_time:
-        o = session.get_command_output("sc start %s" % service, timeout=60)
+        o = session.cmd_output("sc start %s" % service, timeout=60)
         # FAILED 1060 means the service isn't installed.
         if re.search(r"\bFAILED 1060\b", o, re.I):
             raise error.TestError("Could not start service '%s' "
@@ -318,7 +318,7 @@  def get_time(session, time_command, time_filter_re, time_format):
     """
     if len(re.findall("ntpdate|w32tm", time_command)) == 0:
         host_time = time.time()
-        s = session.get_command_output(time_command)
+        s = session.cmd_output(time_command)
 
         try:
             s = re.findall(time_filter_re, s)[0]
@@ -410,7 +410,7 @@  def run_autotest(vm, session, control_path, timeout, outputdir):
         copy = False
         local_hash = utils.hash_file(local_path)
         basename = os.path.basename(local_path)
-        output = session.get_command_output("md5sum %s" % remote_path)
+        output = session.cmd_output("md5sum %s" % remote_path)
         if "such file" in output:
             remote_hash = "0"
         elif output:
@@ -463,7 +463,7 @@  def run_autotest(vm, session, control_path, timeout, outputdir):
         Get the status of the tests that were executed on the host and close
         the session where autotest was being executed.
         """
-        output = session.get_command_output("cat results/*/status")
+        output = session.cmd_output("cat results/*/status")
         try:
             results = scan_results.parse_results(output)
             # Report test results
@@ -521,8 +521,8 @@  def run_autotest(vm, session, control_path, timeout, outputdir):
     try:
         try:
             logging.info("---------------- Test output ----------------")
-            session.get_command_output("bin/autotest control", timeout=timeout,
-                                       print_func=logging.info)
+            session.cmd_output("bin/autotest control", timeout=timeout,
+                               print_func=logging.info)
         finally:
             logging.info("------------- End of test output ------------")
     except kvm_subprocess.ShellTimeoutError:
@@ -647,8 +647,8 @@  def raw_ping(command, timeout, session, output_func):
         return status, output
     else:
         try:
-            output = session.get_command_output(command, timeout=timeout,
-                                                print_func=output_func)
+            output = session.cmd_output(command, timeout=timeout,
+                                        print_func=output_func)
         except kvm_subprocess.ShellTimeoutError:
             # Send ctrl+c (SIGINT) through ssh session
             session.send("\003")
@@ -730,7 +730,7 @@  def get_linux_ifname(session, mac_address):
     @mac_address: the macaddress of nic
     """
 
-    output = session.get_command_output("ifconfig -a")
+    output = session.cmd_output("ifconfig -a")
 
     try:
         ethname = re.findall("(\w+)\s+Link.*%s" % mac_address, output,
diff --git a/client/tests/kvm/tests/clock_getres.py b/client/tests/kvm/tests/clock_getres.py
index edda355..f85bb26 100644
--- a/client/tests/kvm/tests/clock_getres.py
+++ b/client/tests/kvm/tests/clock_getres.py
@@ -36,4 +36,4 @@  def run_clock_getres(test, params, env):
     session.cmd(os.path.join(base_dir, t_name))
     logging.info("PASS: Guest reported appropriate clock resolution")
     logging.info("guest's dmesg:")
-    session.get_command_output("dmesg")
+    session.cmd_output("dmesg")
diff --git a/client/tests/kvm/tests/ethtool.py b/client/tests/kvm/tests/ethtool.py
index 9c4da9d..8951fcb 100644
--- a/client/tests/kvm/tests/ethtool.py
+++ b/client/tests/kvm/tests/ethtool.py
@@ -78,7 +78,7 @@  def run_ethtool(test, params, env):
         logging.info("Compare md5sum of the files on guest and host")
         host_result = utils.hash_file(name, method="md5")
         try:
-            o = session.get_command_output("md5sum %s" % name)
+            o = session.cmd_output("md5sum %s" % name)
             guest_result = re.findall("\w+", o)[0]
         except IndexError:
             logging.error("Could not get file md5sum in guest")
@@ -96,13 +96,13 @@  def run_ethtool(test, params, env):
         @param src: Source host of transfer file
         @return: Tuple (status, error msg/tcpdump result)
         """
-        session2.get_command_output("rm -rf %s" % filename)
+        session2.cmd_output("rm -rf %s" % filename)
         dd_cmd = ("dd if=/dev/urandom of=%s bs=1M count=%s" %
                   (filename, params.get("filesize")))
         logging.info("Creat file in source host, cmd: %s" % dd_cmd)
         tcpdump_cmd = "tcpdump -lep -s 0 tcp -vv port ssh"
         if src == "guest":
-            session.get_command_output(dd_cmd, timeout=360)
+            session.cmd_output(dd_cmd, timeout=360)
             tcpdump_cmd += " and src %s" % guest_ip
             copy_files_fun = vm.copy_files_from
         else:
@@ -119,8 +119,8 @@  def run_ethtool(test, params, env):
             tcpdump_cmd += " and not port %s" % i
         logging.debug("Listen by command: %s" % tcpdump_cmd)
         session2.sendline(tcpdump_cmd)
-        if not kvm_utils.wait_for(lambda: session.get_command_status(
-                                           "pgrep tcpdump") == 0, 30):
+        if not kvm_utils.wait_for(
+                           lambda:session.cmd_status("pgrep tcpdump") == 0, 30):
             return (False, "Tcpdump process wasn't launched")
 
         logging.info("Start to transfer file")
diff --git a/client/tests/kvm/tests/guest_s4.py b/client/tests/kvm/tests/guest_s4.py
index 1c69ce0..0280f71 100644
--- a/client/tests/kvm/tests/guest_s4.py
+++ b/client/tests/kvm/tests/guest_s4.py
@@ -65,6 +65,6 @@  def run_guest_s4(test, params, env):
     session2.cmd(check_s4_cmd)
 
     logging.info("VM resumed successfuly after suspend to disk")
-    session2.get_command_output(params.get("kill_test_s4_cmd"))
+    session2.cmd_output(params.get("kill_test_s4_cmd"))
     session.close()
     session2.close()
diff --git a/client/tests/kvm/tests/guest_test.py b/client/tests/kvm/tests/guest_test.py
index e15c7b0..b9786b5 100644
--- a/client/tests/kvm/tests/guest_test.py
+++ b/client/tests/kvm/tests/guest_test.py
@@ -58,8 +58,7 @@  def run_guest_test(test, params, env):
             session.cmd(rsc_cmd, timeout=test_timeout)
             logging.info("Download resource finished.")
         else:
-            session.get_command_output("del %s" % dst_rsc_path,
-                                       internal_timeout=0)
+            session.cmd_output("del %s" % dst_rsc_path, internal_timeout=0)
             script_path = kvm_utils.get_path(test.bindir, script)
             vm.copy_files_to(script_path, dst_rsc_path, timeout=60)
 
diff --git a/client/tests/kvm/tests/iofuzz.py b/client/tests/kvm/tests/iofuzz.py
index 77f4761..e77540e 100644
--- a/client/tests/kvm/tests/iofuzz.py
+++ b/client/tests/kvm/tests/iofuzz.py
@@ -98,7 +98,7 @@  def run_iofuzz(test, params, env):
         r = random.SystemRandom()
 
         logging.info("Enumerate guest devices through /proc/ioports")
-        ioports = session.get_command_output("cat /proc/ioports")
+        ioports = session.cmd_output("cat /proc/ioports")
         logging.debug(ioports)
         devices = re.findall("(\w+)-(\w+)\ : (.*)", ioports)
 
diff --git a/client/tests/kvm/tests/ioquit.py b/client/tests/kvm/tests/ioquit.py
index 132637d..25d3ac9 100644
--- a/client/tests/kvm/tests/ioquit.py
+++ b/client/tests/kvm/tests/ioquit.py
@@ -20,7 +20,7 @@  def run_ioquit(test, params, env):
     try:
         bg_cmd = params.get("background_cmd")
         logging.info("Add IO workload for guest OS.")
-        session.get_command_output(bg_cmd, timeout=60)
+        session.cmd_output(bg_cmd, timeout=60)
         check_cmd = params.get("check_cmd")
         session2.cmd(check_cmd, timeout=60)
 
diff --git a/client/tests/kvm/tests/iozone_windows.py b/client/tests/kvm/tests/iozone_windows.py
index a96fdfc..febf898 100644
--- a/client/tests/kvm/tests/iozone_windows.py
+++ b/client/tests/kvm/tests/iozone_windows.py
@@ -28,8 +28,8 @@  def run_iozone_windows(test, params, env):
     c = params.get("iozone_cmd")
     t = int(params.get("iozone_timeout"))
     logging.info("Running IOzone command on guest, timeout %ss", t)
-    results = session.get_command_output(command=c, timeout=t,
-                                         print_func=logging.debug)
+    results = session.cmd_output(command=c, timeout=t,
+                                 print_func=logging.debug)
     utils.open_write_close(results_path, results)
 
     # Postprocess the results using the IOzone postprocessing module
diff --git a/client/tests/kvm/tests/kdump.py b/client/tests/kvm/tests/kdump.py
index 006882c..ccc4307 100644
--- a/client/tests/kvm/tests/kdump.py
+++ b/client/tests/kvm/tests/kdump.py
@@ -34,7 +34,7 @@  def run_kdump(test, params, env):
         @param vcpu: vcpu which is used to trigger a crash
         """
         session = kvm_test_utils.wait_for_login(vm, 0, timeout, 0, 2)
-        session.get_command_output("rm -rf /var/crash/*")
+        session.cmd_output("rm -rf /var/crash/*")
 
         logging.info("Triggering crash on vcpu %d ...", vcpu)
         crash_cmd = "taskset -c %d echo c > /proc/sysrq-trigger" % vcpu
@@ -51,7 +51,7 @@  def run_kdump(test, params, env):
         session.cmd("ls -R /var/crash | grep vmcore")
         logging.info("Found vmcore.")
 
-        session.get_command_output("rm -rf /var/crash/*")
+        session.cmd_output("rm -rf /var/crash/*")
 
     try:
         logging.info("Checking the existence of crash kernel...")
@@ -59,7 +59,7 @@  def run_kdump(test, params, env):
             session.cmd(crash_kernel_prob_cmd)
         except:
             logging.info("Crash kernel is not loaded. Trying to load it")
-            session.get_command_status_output(kernel_param_cmd)
+            session.cmd(kernel_param_cmd)
             session = kvm_test_utils.reboot(vm, session, timeout=timeout)
 
         logging.info("Enabling kdump service...")
diff --git a/client/tests/kvm/tests/ksm_overcommit.py b/client/tests/kvm/tests/ksm_overcommit.py
index dbd05dc..f60929e 100644
--- a/client/tests/kvm/tests/ksm_overcommit.py
+++ b/client/tests/kvm/tests/ksm_overcommit.py
@@ -230,7 +230,7 @@  def run_ksm_overcommit(test, params, env):
                            (mem / 200 * 50 * perf_ratio))
         logging.debug(kvm_test_utils.get_memory_info([lvms[last_vm]]))
 
-        lsessions[i].get_command_output("die()", 20)
+        lsessions[i].cmd_output("die()", 20)
         lvms[last_vm].destroy(gracefully = False)
         logging.info("Phase 3b: PASS")
 
@@ -356,7 +356,7 @@  def run_ksm_overcommit(test, params, env):
 
         logging.debug("Cleaning up...")
         for i in range(0, max_alloc):
-            lsessions[i].get_command_output("die()", 20)
+            lsessions[i].cmd_output("die()", 20)
         session.close()
         vm.destroy(gracefully = False)
 
diff --git a/client/tests/kvm/tests/linux_s3.py b/client/tests/kvm/tests/linux_s3.py
index 1bbd19c..8a0f5eb 100644
--- a/client/tests/kvm/tests/linux_s3.py
+++ b/client/tests/kvm/tests/linux_s3.py
@@ -21,7 +21,7 @@  def run_linux_s3(test, params, env):
     logging.info("Waiting for a while for X to start")
     time.sleep(10)
 
-    src_tty = session.get_command_output("fgconsole").strip()
+    src_tty = session.cmd_output("fgconsole").strip()
     logging.info("Current virtual terminal is %s" % src_tty)
     if src_tty not in map(str, range(1,10)):
         raise error.TestFail("Got a strange current vt (%s)" % src_tty)
diff --git a/client/tests/kvm/tests/migration.py b/client/tests/kvm/tests/migration.py
index 513b500..e883838 100644
--- a/client/tests/kvm/tests/migration.py
+++ b/client/tests/kvm/tests/migration.py
@@ -29,7 +29,7 @@  def run_migration(test, params, env):
 
     # Get the output of migration_test_command
     test_command = params.get("migration_test_command")
-    reference_output = session.get_command_output(test_command)
+    reference_output = session.cmd_output(test_command)
 
     # Start some process in the background (and leave the session open)
     background_command = params.get("migration_bg_command", "")
@@ -60,7 +60,7 @@  def run_migration(test, params, env):
         session2.cmd(check_command, timeout=30)
 
         # Get the output of migration_test_command
-        output = session2.get_command_output(test_command)
+        output = session2.cmd_output(test_command)
 
         # Compare output to reference output
         if output != reference_output:
@@ -77,8 +77,7 @@  def run_migration(test, params, env):
     finally:
         # Kill the background process
         if session2 and session2.is_alive():
-            session2.get_command_output(params.get("migration_bg_kill_command",
-                                                   ""))
+            session2.cmd_output(params.get("migration_bg_kill_command", ""))
 
     session2.close()
     session.close()
diff --git a/client/tests/kvm/tests/multicast.py b/client/tests/kvm/tests/multicast.py
index 4a1b4f5..2a12b4f 100644
--- a/client/tests/kvm/tests/multicast.py
+++ b/client/tests/kvm/tests/multicast.py
@@ -56,8 +56,8 @@  def run_multicast(test, params, env):
     mcast_path = os.path.join(test.bindir, "scripts/join_mcast.py")
     if not vm.copy_files_to(mcast_path, "/tmp"):
         raise error.TestError("Fail to copy %s to guest" % mcast_path)
-    output = session.get_command_output("python /tmp/join_mcast.py %d %s %d" %
-                                        (mgroup_count, prefix, suffix))
+    output = session.cmd_output("python /tmp/join_mcast.py %d %s %d" %
+                                (mgroup_count, prefix, suffix))
 
     # if success to join multicast, the process will be paused, and return PID.
     try:
@@ -86,6 +86,6 @@  def run_multicast(test, params, env):
                                      (s, o))
 
     finally:
-        logging.debug(session.get_command_output("ipmaddr show"))
-        session.get_command_output("kill -s SIGCONT %s" % pid)
+        logging.debug(session.cmd_output("ipmaddr show"))
+        session.cmd_output("kill -s SIGCONT %s" % pid)
         session.close()
diff --git a/client/tests/kvm/tests/netperf.py b/client/tests/kvm/tests/netperf.py
index 64ff4c6..7e39f6a 100644
--- a/client/tests/kvm/tests/netperf.py
+++ b/client/tests/kvm/tests/netperf.py
@@ -26,7 +26,7 @@  def run_netperf(test, params, env):
     result_file = os.path.join(test.resultsdir, "output_%s" % test.iteration)
 
     firewall_flush = "iptables -F"
-    session.get_command_output(firewall_flush)
+    session.cmd_output(firewall_flush)
 
     for i in params.get("netperf_files").split():
         if not vm.copy_files_to(os.path.join(netperf_dir, i), "/tmp"):
@@ -65,5 +65,5 @@  def run_netperf(test, params, env):
                                  ", ".join(list_fail))
 
     finally:
-        session.get_command_output("killall netserver")
+        session.cmd_output("killall netserver")
         session.close()
diff --git a/client/tests/kvm/tests/nic_promisc.py b/client/tests/kvm/tests/nic_promisc.py
index e6354e2..f4bf1e4 100644
--- a/client/tests/kvm/tests/nic_promisc.py
+++ b/client/tests/kvm/tests/nic_promisc.py
@@ -50,7 +50,7 @@  def run_nic_promisc(test, params, env):
                                "ip link set %s promisc off; sleep 0.01" %
                                (ethname, ethname))
             while True:
-                self.session.get_command_output(set_promisc_cmd)
+                self.session.cmd_output(set_promisc_cmd)
                 if self.termination_event.isSet():
                     break
 
@@ -95,14 +95,14 @@  def run_nic_promisc(test, params, env):
             logging.info("Clean temporary files")
             cmd = "rm -f %s" % filename
             utils.run(cmd)
-            session.get_command_output(cmd)
+            session.cmd_output(cmd)
 
     finally:
         logging.info("Stopping the promisc thread")
         termination_event.set()
         promisc_thread.join(10)
         logging.info("Restore the %s to the nonpromisc mode", ethname)
-        session.get_command_output("ip link set %s promisc off" % ethname)
+        session.cmd_output("ip link set %s promisc off" % ethname)
         session.close()
 
     if success_counter != 2 * len(file_size):
diff --git a/client/tests/kvm/tests/nicdriver_unload.py b/client/tests/kvm/tests/nicdriver_unload.py
index c918c73..a515d67 100644
--- a/client/tests/kvm/tests/nicdriver_unload.py
+++ b/client/tests/kvm/tests/nicdriver_unload.py
@@ -71,7 +71,7 @@  def run_nicdriver_unload(test, params, env):
             try:
                 session_serial.cmd(unload_load_cmd, timeout=120)
             except:
-                session.get_command_output("rm -rf /tmp/Thread-*")
+                session.cmd_output("rm -rf /tmp/Thread-*")
                 raise
             pid, s = os.waitpid(pid, os.WNOHANG)
             status = os.WEXITSTATUS(s)
@@ -103,5 +103,5 @@  def run_nicdriver_unload(test, params, env):
             raise error.TestFail("Test nic function after load/unload fail")
 
     finally:
-        session.get_command_output("rm -rf /tmp/Thread-*")
+        session.cmd_output("rm -rf /tmp/Thread-*")
         session.close()
diff --git a/client/tests/kvm/tests/pci_hotplug.py b/client/tests/kvm/tests/pci_hotplug.py
index 1b38927..3f07bda 100644
--- a/client/tests/kvm/tests/pci_hotplug.py
+++ b/client/tests/kvm/tests/pci_hotplug.py
@@ -32,7 +32,7 @@  def run_pci_hotplug(test, params, env):
     info_pci_ref = vm.monitor.info("pci")
 
     # Get output of command as reference
-    reference = session.get_command_output(params.get("reference_cmd"))
+    reference = session.cmd_output(params.get("reference_cmd"))
 
     tested_model = params.get("pci_model")
     test_type = params.get("pci_type")
@@ -130,7 +130,7 @@  def run_pci_hotplug(test, params, env):
 
         # Define a helper function to compare the output
         def new_shown():
-            o = session.get_command_output(params.get("reference_cmd"))
+            o = session.cmd_output(params.get("reference_cmd"))
             return o != reference
 
         secs = int(params.get("wait_secs_for_hook_up"))
@@ -141,7 +141,7 @@  def run_pci_hotplug(test, params, env):
 
         # Define a helper function to catch PCI device string
         def find_pci():
-            o = session.get_command_output(params.get("find_pci_cmd"))
+            o = session.cmd_output(params.get("find_pci_cmd"))
             return params.get("match_string") in o
 
         if not kvm_utils.wait_for(find_pci, 30, 3, 3):
diff --git a/client/tests/kvm/tests/physical_resources_check.py b/client/tests/kvm/tests/physical_resources_check.py
index 682c7b2..0630ac8 100644
--- a/client/tests/kvm/tests/physical_resources_check.py
+++ b/client/tests/kvm/tests/physical_resources_check.py
@@ -135,7 +135,7 @@  def run_physical_resources_check(test, params, env):
     def verify_device(expect, name, verify_cmd):
         f_fail = 0
         if verify_cmd:
-            actual = session.get_command_output(verify_cmd)
+            actual = session.cmd_output(verify_cmd)
             if not string.upper(expect) in actual:
                 f_fail += 1
                 logging.error("%s mismatch:")
diff --git a/client/tests/kvm/tests/timedrift.py b/client/tests/kvm/tests/timedrift.py
index a6d3076..e5aa316 100644
--- a/client/tests/kvm/tests/timedrift.py
+++ b/client/tests/kvm/tests/timedrift.py
@@ -146,7 +146,7 @@  def run_timedrift(test, params, env):
             restore_cpu_affinity(prev_affinity)
             # Stop the guest load
             if guest_load_stop_command:
-                session.get_command_output(guest_load_stop_command)
+                session.cmd_output(guest_load_stop_command)
             # Close all load shell sessions
             for load_session in guest_load_sessions:
                 load_session.close()
diff --git a/client/tests/kvm/tests/vlan.py b/client/tests/kvm/tests/vlan.py
index a18ac90..69a136b 100644
--- a/client/tests/kvm/tests/vlan.py
+++ b/client/tests/kvm/tests/vlan.py
@@ -48,8 +48,7 @@  def run_vlan(test, params, env):
     def rem_vlan(session, id, iface="eth0"):
         rem_vlan_cmd = "if [[ -e /proc/net/vlan/%s ]];then vconfig rem %s;fi"
         iface = "%s.%s" % (iface, id)
-        s = session.get_command_status(rem_vlan_cmd % (iface, iface))
-        return s
+        return session.cmd_status(rem_vlan_cmd % (iface, iface))
 
     def nc_transfer(src, dst):
         nc_port = kvm_utils.find_free_port(1025, 5334, vm_ip[dst])
@@ -69,7 +68,7 @@  def run_vlan(test, params, env):
             raise error.TestFail ("Fail to receive file"
                                     " from vm%s to vm%s" % (src+1, dst+1))
         #check MD5 message digest of receive file in dst
-        output = session[dst].get_command_output("md5sum receive").strip()
+        output = session[dst].cmd_output("md5sum receive").strip()
         digest_receive = re.findall(r'(\w+)', output)[0]
         if digest_receive == digest_origin[src]:
             logging.info("file succeed received in vm %s" % vlan_ip[dst])
@@ -77,7 +76,7 @@  def run_vlan(test, params, env):
             logging.info("digest_origin is  %s" % digest_origin[src])
             logging.info("digest_receive is %s" % digest_receive)
             raise error.TestFail("File transfered differ from origin")
-        session[dst].get_command_output("rm -f receive")
+        session[dst].cmd_output("rm -f receive")
 
     for i in range(2):
         session.append(kvm_test_utils.wait_for_login(vm[i],
@@ -99,7 +98,7 @@  def run_vlan(test, params, env):
         digest_origin.append(re.findall(r'(\w+)', output)[0])
 
         #stop firewall in vm
-        session[i].get_command_output("/etc/init.d/iptables stop")
+        session[i].cmd_output("/etc/init.d/iptables stop")
 
         #load 8021q module for vconfig
         session[i].cmd("modprobe 8021q")
diff --git a/client/tests/kvm/tests/whql_client_install.py b/client/tests/kvm/tests/whql_client_install.py
index e9c5bdd..8e63d10 100644
--- a/client/tests/kvm/tests/whql_client_install.py
+++ b/client/tests/kvm/tests/whql_client_install.py
@@ -54,14 +54,14 @@  def run_whql_client_install(test, params, env):
 
     # Get server and client information
     cmd = "echo %computername%"
-    server_name = server_session.get_command_output(cmd).strip()
-    client_name = session.get_command_output(cmd).strip()
+    server_name = server_session.cmd_output(cmd).strip()
+    client_name = session.cmd_output(cmd).strip()
     cmd = "wmic computersystem get domain"
-    server_workgroup = server_session.get_command_output(cmd).strip()
+    server_workgroup = server_session.cmd_output(cmd).strip()
     server_workgroup = server_workgroup.splitlines()[-1]
     regkey = r"HKLM\SYSTEM\CurrentControlSet\Services\Tcpip\Parameters"
     cmd = "reg query %s /v Domain" % regkey
-    o = server_session.get_command_output(cmd).strip().splitlines()[-1]
+    o = server_session.cmd_output(cmd).strip().splitlines()[-1]
     try:
         server_dns_suffix = o.split(None, 2)[2]
     except IndexError:
diff --git a/client/tests/kvm/tests/whql_submission.py b/client/tests/kvm/tests/whql_submission.py
index 3930954..b1b7f25 100644
--- a/client/tests/kvm/tests/whql_submission.py
+++ b/client/tests/kvm/tests/whql_submission.py
@@ -54,8 +54,8 @@  def run_whql_submission(test, params, env):
 
     # Get the computer names of the server and client
     cmd = "echo %computername%"
-    server_name = server_session.get_command_output(cmd).strip()
-    client_name = session.get_command_output(cmd).strip()
+    server_name = server_session.cmd_output(cmd).strip()
+    client_name = session.cmd_output(cmd).strip()
     session.close()
 
     # Run the automation program on the server