Update run_cmd() method
authorDonghoon Shin <dhs.shin@samsung.com>
Wed, 21 Sep 2016 00:03:21 +0000 (09:03 +0900)
committerDonghoon Shin <dhs.shin@samsung.com>
Wed, 21 Sep 2016 00:03:27 +0000 (09:03 +0900)
Use string for command param instead of list

litmus/device/device.py
litmus/device/devicemock.py

index 9d9123af8d4b13d8cbbbecca00979de34a0648e2..62d2a026fa548e7f41fca34907904e844764dade 100644 (file)
@@ -236,14 +236,14 @@ class device(object):
 
         Example:
             >>> dut.on()
-            >>> dut.run_cmd(['ls','-alF','/','|','grep','usr'])
+            >>> dut.run_cmd('ls -alF / | grep usr')
             \'drwxr-xr-x  15 root root     4096 Apr 29  2016 usr/\\r\\n\'
 
         :returns str: stdout of sdb shell command
 
         """
         c = ['sdb', '-s', self.get_id(), 'shell']
-        c.extend(command)
+        c.extend(convert_single_item_to_list(command))
         logging.debug(c)
         result = check_output(c, timeout=timeout)
         return result
index f927c68f731182190005b065ffdc536ba82a6576..4403de0bd1dde886000fd742e608d883fb261c78 100644 (file)
@@ -75,7 +75,7 @@ class devicemock(device):
         self.refresh_sdb_server()
         if self._find_device_id() == self.get_id():
             self._sdb_root_on()
-            self.run_cmd(['reboot', '-f'])
+            self.run_cmd('reboot -f')
         time.sleep(60)
         self.refresh_sdb_server()
         self._sdb_root_on()
@@ -150,7 +150,7 @@ class devicemock(device):
             raise Exception('There\'s no file to flash.')
         try:
             self._sdb_root_on()
-            self.run_cmd(['reboot', '-f', 'download'], timeout=10)
+            self.run_cmd('reboot -f download', timeout=10)
             time.sleep(5)
             if flasher == 'lthor':
                 self.thor(filenames=filenames)