Change usb busid detection routine
authorDonghoon Shin <dhs.shin@samsung.com>
Tue, 1 Nov 2016 00:44:36 +0000 (09:44 +0900)
committerDonghoon Shin <dhs.shin@samsung.com>
Tue, 1 Nov 2016 00:44:36 +0000 (09:44 +0900)
Before: cat /var/log/kern.log
After: dmesg

Docker environment and arm host environment does not allow to access /var/log/kern.log

Change-Id: Ib2e000f02a9e7c3ef2636e71169a9e11ed978cf4

litmus/core/manager.py
litmus/device/device.py
litmus/device/devicestandalone.py

index b0b27a4..1de68aa 100644 (file)
@@ -160,7 +160,7 @@ Lightweight test manager for tizen automated testing
         logging.debug('==============Acquire an available DUT==============')
 
         candidate = [dev for dev in self._all_devices
-                      if dev['devicename'] == devicename]
+                     if dev['devicename'] == devicename]
 
         if candidate:
             for times in range(0, max_retry_times):
index 2908898..3a62151 100644 (file)
@@ -479,7 +479,7 @@ class device(object):
         """docstring for find_usb_busid"""
         pattern = 'usb (.*):.*idVendor={0}, idProduct={1}'.format(self._vid,
                                                                   self._pid)
-        kernlog = 'cat /var/log/kern.log | grep usb | tail -n 20'
+        kernlog = 'dmesg | grep usb | tail -n 20'
         outs = check_output(kernlog, shell=True, timeout=10)
         result = find_all_pattern(pattern=pattern, data=outs)
         if result:
@@ -505,7 +505,7 @@ class device(object):
         """docstring for _find_usb_bus_and_device_address"""
         pattern = 'usb (.*):.*idVendor={0}, idProduct={1}'.format(self._vid,
                                                                   self._pid)
-        kernlog = 'cat /var/log/kern.log | grep usb | tail -n 20'
+        kernlog = 'dmesg | grep usb | tail -n 20'
         outs = check_output(kernlog, shell=True, timeout=10)
         result = find_all_pattern(pattern=pattern, data=outs)
         if result:
index a720896..4b0d61e 100644 (file)
@@ -139,7 +139,7 @@ class devicestandalone(device):
                 self._heimdall(filenames=filenames,
                                busaddr=busaddr,
                                devaddr=devaddr,
-                              partition_bin_mappings=partition_bin_mappings)
+                               partition_bin_mappings=partition_bin_mappings)
         except (Exception, KeyboardInterrupt) as e:
             self._release_global_lock()
             logging.debug(e)