From: Donghoon Shin Date: Wed, 21 Sep 2016 00:03:21 +0000 (+0900) Subject: Update run_cmd() method X-Git-Tag: 0.3.3~19 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=741dac898da80bc0bf38f86c2faa54b7b0cd020a;p=tools%2Flitmus.git Update run_cmd() method Use string for command param instead of list --- diff --git a/litmus/device/device.py b/litmus/device/device.py index 9d9123a..62d2a02 100644 --- a/litmus/device/device.py +++ b/litmus/device/device.py @@ -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 diff --git a/litmus/device/devicemock.py b/litmus/device/devicemock.py index f927c68..4403de0 100644 --- a/litmus/device/devicemock.py +++ b/litmus/device/devicemock.py @@ -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)