From 6ca2b91cf4bfb96c7c55d9f9cee8126d81a07e5f Mon Sep 17 00:00:00 2001 From: Donghoon Shin Date: Tue, 1 Nov 2016 09:44:36 +0900 Subject: [PATCH] Change usb busid detection routine 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 | 2 +- litmus/device/device.py | 4 ++-- litmus/device/devicestandalone.py | 2 +- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/litmus/core/manager.py b/litmus/core/manager.py index b0b27a4..1de68aa 100644 --- a/litmus/core/manager.py +++ b/litmus/core/manager.py @@ -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): diff --git a/litmus/device/device.py b/litmus/device/device.py index 2908898..3a62151 100644 --- a/litmus/device/device.py +++ b/litmus/device/device.py @@ -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: diff --git a/litmus/device/devicestandalone.py b/litmus/device/devicestandalone.py index a720896..4b0d61e 100644 --- a/litmus/device/devicestandalone.py +++ b/litmus/device/devicestandalone.py @@ -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) -- 2.34.1