Git Product home page Git Product logo

mobly's Introduction

Welcome to Mobly

Latest release Build Status

Mobly is a Python-based test framework that specializes in supporting test cases that require multiple devices, complex environments, or custom hardware setups.

Here are some example use cases:

  • P2P data transfer between two devices
  • Conference calls across three phones
  • Wearable device interacting with a phone
  • Internet-Of-Things devices interacting with each other
  • Testing RF characteristics of devices with special equipment
  • Testing LTE network by controlling phones, base stations, and eNBs

Mobly can support many different types of devices and equipment, and it's easy to plug your own device or custom equipment/service into Mobly.

Mobly comes with a set of libs to control common devices like Android devices.

While developed by Googlers, Mobly is not an official Google product.

Compatibility

Mobly requires python 3.11 or newer.

Mobly tests could run on the following platforms:

  • Ubuntu 14.04+
  • MacOS 10.6+
  • Windows 7+

System dependencies

  • adb (1.0.40+ recommended)
  • python3.11+

Installation

You can install the released package from pip

pip install mobly

or install from the source to use the bleeding edge:

git clone https://github.com/google/mobly.git
cd mobly
pip install -e .

You may need sudo for the above commands if your system has certain permission restrictions.

Tutorials

Mobly Snippet

The Mobly Snippet projects let users better control Android devices.

  • Mobly Snippet Lib: used for triggering custom device-side code from host-side Mobly tests. You could use existing Android libraries like UI Automator and Espresso.
  • Mobly Bundled Snippets: a set of Snippets to allow Mobly tests to control Android devices by exposing a simplified version of the public Android API suitable for testing.

mobly's People

Contributors

adorokhine avatar aidanholm avatar antofara avatar artorl avatar booneng avatar dthkao avatar eric100lin avatar jeffherman avatar jiangsichu avatar johnklee avatar k2fong avatar l-meng avatar maddychan avatar malvarezrohena avatar matty3 avatar mderu avatar mhaoli avatar nkprasad12 avatar pcman avatar puradox avatar sebkur avatar ssachinsunder avatar stroz avatar syaoranx avatar uael avatar winterfroststrom avatar xianyuanjia avatar xpconanfan avatar ygw11223 avatar yusufm avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

mobly's Issues

Snippet client is not py3 compatible.

Because of the byte string handling.
A couple examples:

  1. ad.load_snippet(name='spt', package='com.google.android.mobly.snippet.example1')
    WARNING:root:[AndroidDevice|84B7N15A28012457] a bytes-like object is required, not 'str'

  2. ad.stop_services()
    Traceback (most recent call last):
    File "", line 1, in
    File "/Users/angli/Developer/mobly/mobly/controllers/android_device.py", line 417, in stop_services
    self._terminate_jsonrpc_client(client)
    File "/Users/angli/Developer/mobly/mobly/controllers/android_device.py", line 576, in _terminate_jsonrpc_client
    client.stop_app()
    File "/Users/angli/Developer/mobly/mobly/controllers/android_device_lib/snippet_client.py", line 68, in stop_app
    if 'OK (0 tests)' not in out:
    TypeError: a bytes-like object is required, not 'str'

Flake in unit tests

Reported in #87
https://travis-ci.org/google/mobly/jobs/197104959

=================================== FAILURES ===================================
____________________ UtilsTest.test_start_standing_subproc _____________________
self = <tests.mobly.utils_test.UtilsTest testMethod=test_start_standing_subproc>
def test_start_standing_subproc(self):
with self.assertRaisesRegexp(utils.Error,
"Process .* has terminated"):
> utils.start_standing_subprocess("sleep 0", check_health_delay=0.1)
E AssertionError: Error not raised
tests/mobly/utils_test.py:32: AssertionErro

Redo generated tests (parameterized tests)

Today's generated test trigger function share the same code path as a regular test, which makes accounting, reporting, and logging difficult. It also makes it hard to support selecting specific generated test cases via --test_cases.

It is time to redesign and implement the parameterized test mechanism properly.

Refresh adb connection to a device at the end of AndroidDevice teardown.

Execute adb -s <serial> reconnect at the end of AndroidDevice controller object cleanup.

It has several benefits:

  1. Kills any lingering adb processes/cmds that the test may have started and does not clean up properly.
  2. Releases all forwarded adb ports.
  3. Recovers unresponsive devices in some cases. Some devices may stop responding to all adb commands due to adb calls made by tests, leaving the device in an unusable state. Refreshing adb connection fixes the problem.

Overall this seems to be a good approach since it can clears any baggage a test may have left with adb and makes the execution cleaner.
The command does not affect other devices connected to the same host.

Make test_run_summary reporting consistent.

In the Results array of the summary, the number of entries and whether there is an Extra error message currently differs depending on where the test failed.

  1. We should have a result for every test case requested (explicitly or implicitly)
  2. We should use extr error to surface the point of failure (e.g., setup_class, setup_test, abort, teardown_test, etc.)

AndroidDevice object doesn't clean up correctly in interactive mode

If the object is obtained by directly calling android_device.get_all_instances instead of android_device.create, the device object will try to stop SL4A even if SL4A is not started in the first place.

>>> from mobly.controllers import android_device
>>> ad = android_device.get_all_instances()[0]
>>> ad.stop_services()
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/usr/local/google/home/angli/Developer/mobly/mobly/controllers/android_device.py", line 417, in stop_services
    self._terminate_jsonrpc_client(client)
  File "/usr/local/google/home/angli/Developer/mobly/mobly/controllers/android_device.py", line 574, in _terminate_jsonrpc_client
    client.closeSl4aSession()
  File "/usr/local/google/home/angli/Developer/mobly/mobly/controllers/android_device_lib/jsonrpc_client_base.py", line 292, in rpc_call
    return self._rpc(name, *args)
  File "/usr/local/google/home/angli/Developer/mobly/mobly/controllers/android_device_lib/jsonrpc_client_base.py", line 281, in _rpc
    raise ProtocolError(ProtocolError.NO_RESPONSE_FROM_SERVER)
mobly.controllers.android_device_lib.jsonrpc_client_base.ProtocolError: No response from server.

ProtocolError

When running the sample test, it raises ProtocolError, and SL4A server is started

self._start_jsonrpc_client(self.sl4a, host_port, device_port)
File "/Library/Python/2.7/site-packages/mobly/controllers/android_device.py", line 598, in _start_jsonrpc_client
client.connect(port=host_port)
File "/Library/Python/2.7/site-packages/mobly/controllers/android_device_lib/jsonrpc_client_base.py", line 214, in connect
raise ProtocolError(ProtocolError.NO_RESPONSE_FROM_HANDSHAKE)
ProtocolError: No response from handshake.
[SampleTestBed] 01-03 18:45:57.005 ERROR No response from handshake.
[SampleTestBed] 01-03 18:45:57.005 INFO [Test Case] setup_class FAIL
[SampleTestBed] 01-03 18:45:57.006 INFO Summary for test run SampleTestBed@01-03-2017_18-45-52-772: Error 0, Executed 1, Failed 1, Passed 0, Requested 1, Skipped 0
frankbp:Downloads xielieping$ adb devices
List of devices attached
P4M0214A08001775 device

Move 'ed' under 'sl4a'

Move EventDispatcher handling into the sl4a client so consolidate sl4a client code.

After this, ed can be accessed via self.sl4a.ed as opposed to self.ed.

Clean up sleeps in code

In various places in the code there are hardcoded sleeps, eg the 10s sleep in monsoon.
Blind sleeps add flakiness and slow down test execution; we need to remove these.

Support custom logger prefix in AndroidDevice controller

Right now the logger prefix for Android device controller can not be changed.
Sometimes it is useful to be able to change the prefix to be more fitting for the context of the test.
E.g. Instead of [AndroidDevice|<serial>], [AndroidDevice|caller] could be more useful in a call test.

Create a Snippet covering basic Android operations

Operations like toggling Wi-Fi/BT, connecting to a Wi-Fi network etc.

This way users can have an easy example to start with, as opposed to having to deal with the shenanigans of SL4A.

To do so, we'll need to create a new repo to host the code for the snippet implementation first.

ad.is_rootable fails to identify the build properly if adb server isn't running already

There is an edge case where ad.is_rootable incorrectly returns 'True', in which case we issue adb root call, causing some NBU devices to stop responding to adb commands.

The edge case is: adb server is not running prior to starting the test.
In this situation, the following steps occur:

  1. Starting the test
  2. AndroidDevice controller obj issues adb call to determine build type
  3. adb server gets started, printing extra strings to stdout
  4. is_rootable tries to match the string 'user' to the stdout, which evaluates to 'False' due to the extra output.
  5. The user build device is deemed 'rootable'.

Sample output from such a case:

# Beginning of the test
$ adb -s <serial> shell getprop ro.build.type
# Results in the following stdout:
# * daemon not running. starting it now on port 5037 *
# * daemon started successfully *
# user^M

ad.adb.getprop is the first adb call made during the lifecycle of an AndroidDevice obj, so it's critical to handle this check correctly.
Other adb-based check may also fail if adb server somehow gets restarted and stdout is polluted. As a less urgent item, we should consider making checks based on adb's stdout more robust.

INFO: How to toggle network connections like WIFI

Is it possible to enable WIFI with out using adb command(adb shell settings get global wifi_on)?

I mean possibility for accessing internal API like wifiManager.setWifiEnabled(true) in Java, Considering fact that adb is not reliable on higher versions like API 24 real devices.

Would be more helpful if we have sample example how to handle network connections :)

Properly handle snippet in ad.reboot

Right now AndroidDevice.reboot does not restore any snippet.
It should reload the snippet loaded before reboot and make their aliases available.

ad.model fails on GiONEE devices.

Devices made by GiONEE does not have ro.build.product in their getprop outputs, causing ad.model to fail.
For these devices, we need to check ro.product.model for model info.

Let's also evaluate the feasibility of replacing ro.build.product with ro.product.model for good.

[monsoon] Clean up code

Current monsoon controller code is fairly old.
We need to improve the code with best practices of today and remove unused APIs like execute_sequence_and_measure.

Snippet client's _is_app_running() doesn't work properly, leading to race conditions

Slow loading snippets fail because _is_app_running() returns True even when nothing is on the other side of the socket.
This leads to race conditions between the snippet app really starting and the connection attempt.

>>> sock = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
>>> print self._port
8822
>>> result = sock.connect_ex(('127.0.0.1', self._port))
>>> print result
0
And yet...
$ nc 127.0.0.1 8822
$

ad.reboot does not work on non-root devices

Calling ad.reboot causes error:
[testbedB] 12-27 16:00:18.368 INFO [Test Case] test_hello
[testbedB] 12-27 16:00:18.392 ERROR Process 6561 has terminated. ret: 0, stderr: , stdout:
Traceback (most recent call last):
File "/Users/angli/Developer/mobly/mobly/base_test.py", line 307, in exec_one_testcase
self._setup_test(test_name)
File "/Users/angli/Developer/mobly/mobly/base_test.py", line 157, in _setup_test
self.setup_test()
File "/Users/angli/Desktop/SampleTest.py", line 31, in setup_test
self.ad.reboot()
File "/Users/angli/Developer/mobly/mobly/controllers/android_device.py", line 808, in reboot
self.stop_services()
File "/Users/angli/Developer/mobly/mobly/controllers/android_device.py", line 420, in stop_services
self.stop_adb_logcat()
File "/Users/angli/Developer/mobly/mobly/controllers/android_device.py", line 694, in stop_adb_logcat
utils.stop_standing_subprocess(self._adb_logcat_process)
File "/Users/angli/Developer/mobly/mobly/utils.py", line 353, in stop_standing_subprocess
_assert_subprocess_running(proc)
File "/Users/angli/Developer/mobly/mobly/utils.py", line 304, in _assert_subprocess_running
" stdout: %s" % (proc.pid, ret, err, out))
Error: Process 6561 has terminated. ret: 0, stderr: , stdout:

Make sl4a a service that needs to be explicitly requested

Right now people have to explicitly say they don't need sl4a in config file, which is odd since most users don't use sl4a.

Let's flip the assumption and make sl4a an optional service that people can request in setup if needed.

New summary output.

The current summary log has limited debug information and is in json.

We need to consider what other useful information we can include in the summary log.
Like information on the invocation status, and device monitoring info.

Also consider using a different format so it's possible to stream this file instead of only writing it out in the end.
This will make the summary log more crash proof and takes less memory.

sl4a_client attempts to close the same SL4A session twice

This causes a stacktrace to be printed every time the user exists sl4a_client.

^D
Traceback (most recent call last):
File "/usr/local/bin/sl4a_shell.py", line 8, in
execfile(file)
File "/Users/angli/Developer/mobly/tools/sl4a_shell.py", line 66, in
Sl4aShell().main(args.serial)
File "/Users/angli/Developer/mobly/mobly/controllers/android_device_lib/jsonrpc_shell_base.py", line 86, in main
self.start_console()
File "/Users/angli/Developer/mobly/mobly/controllers/android_device_lib/jsonrpc_shell_base.py", line 78, in start_console
self._ad.stop_services()
File "/Users/angli/Developer/mobly/mobly/controllers/android_device.py", line 415, in stop_services
self._terminate_sl4a()
File "/Users/angli/Developer/mobly/mobly/controllers/android_device.py", line 721, in _terminate_sl4a
self._terminate_jsonrpc_client(self.sl4a)
File "/Users/angli/Developer/mobly/mobly/controllers/android_device.py", line 574, in _terminate_jsonrpc_client
client.closeSl4aSession()
File "/Users/angli/Developer/mobly/mobly/controllers/android_device_lib/jsonrpc_client_base.py", line 277, in rpc_call
return self._rpc(name, *args)
File "/Users/angli/Developer/mobly/mobly/controllers/android_device_lib/jsonrpc_client_base.py", line 266, in _rpc
raise ProtocolError(ProtocolError.NO_RESPONSE_FROM_SERVER)
mobly.controllers.android_device_lib.jsonrpc_client_base.ProtocolError: No response from server.

Unit tests should not depend on other unit tests

There are some unit tests that depend on other tests, e.g. test_runner_test depends on android_device_test.

This makes it hard to integrate with bazel, where:

  • tests cannot depend on other tests
  • all dependencies are explicit, which does not play well with auto-discovery of tests.

Common functionality should be abstracted to util library in the test package (similar to mock_controller).

New config schema

The current config schema could not satisfy our needs any more.
E.g. Testbed config has controller info and params mixed together, which makes it hard to figure out what resources can be shared in a test bed.

We need to redefine the config so it can carry our feature roadmap.

Some preliminary requirements:

  1. Separate controller config and test params should be separate in testbed config.
  2. Able to differentiate inherent property of a controller (a phone has bt chip), and property that is assigned (a phone is the caller)
  3. Easy to mark whether a controller is sharable, and how sharable it is (can be used in X tests in parallel)
  4. Maybe a new format to make it more readable and easier to construct complex configuration.
  5. Consider exposing more information of the MH invocation to test cases.

Trace the eventdispatcher teardown steps

The event dispatcher teardown has some issues:

        if event_name == "EventDispatcherShutdown":
            self._sl4a.closeSl4aSession()

This throws an error, but the error is squashed because it's done inside a Future whose result is never checked.

self.poller.set_result("Done")

This is a private API for Executor implementations and should not be called externally.

 # The polling thread is guaranteed to finish after a max of 60 seconds,
 # so we don't wait here.
 self.executor.shutdown(wait=False)

Don't quite understand the comment here. Doesn't this mean the polling loop might still try to handle events after the server is torn down? And, couldn't this keep the python interpreter open for up to 60 seconds after the test ends?

    if self.sl4a:
        self.sl4a.closeSl4aSession()
        self.sl4a.close()
        self.sl4a = None
    if self.ed:
        self.ed.clean_up()
        self.ed = None

It's awkward and surprising that ed is torn down after its host sl4a session. Actually I'm surprised this works. Won't any sl4a commands clean_up tries to issue fail?

Mobly unit tests are flaky

Running the unit tests gives different results without code changes:

$ python setup.py test
running test
running egg_info
writing requirements to mobly.egg-info/requires.txt
writing mobly.egg-info/PKG-INFO
writing top-level names to mobly.egg-info/top_level.txt
writing dependency_links to mobly.egg-info/dependency_links.txt
reading manifest file 'mobly.egg-info/SOURCES.txt'
writing manifest file 'mobly.egg-info/SOURCES.txt'
running build_ext
==================================================================================================================== test session starts =====================================================================================================================
platform linux2 -- Python 2.7.6, pytest-3.0.5, py-1.4.31, pluggy-0.4.0
rootdir: /usr/local/google/home/adorokhine/work/mobly.git, inifile: 
collected 114 items 

tests/mobly_android_device_test.py ................
tests/mobly_asserts_test.py .
tests/mobly_base_class_test.py .....................................................
tests/mobly_logger_test.py .
tests/mobly_records_test.py ................
tests/mobly_sl4a_client_test.py ...........
tests/mobly_test_runner_test.py ...........
tests/mobly_utils_test.py ..F

========================================================================================================================== FAILURES ==========================================================================================================================
_______________________________________________________________________________________________________ MoblyUtilsTest.test_is_port_available_positive _______________________________________________________________________________________________________

self = <mobly_utils_test.MoblyUtilsTest testMethod=test_is_port_available_positive>

    def test_is_port_available_positive(self):
        # Unfortunately, we cannot do this test reliably for SOCK_STREAM
        # because the kernel allow this socket to linger about for some
        # small amount of time.  We're not using SO_REUSEADDR because we
        # are working around behavior on darwin where binding to localhost
        # on some port and then binding again to the wildcard address
        # with SO_REUSEADDR seems to be allowed.
        test_s = socket.socket(socket.AF_INET, socket.SOCK_DGRAM)
        test_s.bind(('localhost', 0))
        port = test_s.getsockname()[1]
        test_s.close()
>       self.assertTrue(utils.is_port_available(port))
E       AssertionError: None is not true

tests/mobly_utils_test.py:51: AssertionError
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! Interrupted: stopping after 1 failures !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
============================================================================================================ 1 failed, 111 passed in 0.48 seconds ============================================================================================================

Ran again:

$ python setup.py test
running test
running egg_info
writing requirements to mobly.egg-info/requires.txt
writing mobly.egg-info/PKG-INFO
writing top-level names to mobly.egg-info/top_level.txt
writing dependency_links to mobly.egg-info/dependency_links.txt
reading manifest file 'mobly.egg-info/SOURCES.txt'
writing manifest file 'mobly.egg-info/SOURCES.txt'
running build_ext
==================================================================================================================== test session starts =====================================================================================================================
platform linux2 -- Python 2.7.6, pytest-3.0.5, py-1.4.31, pluggy-0.4.0
rootdir: /usr/local/google/home/adorokhine/work/mobly.git, inifile: 
collected 114 items 

tests/mobly_android_device_test.py ................
tests/mobly_asserts_test.py .
tests/mobly_base_class_test.py .....................................................
tests/mobly_logger_test.py .
tests/mobly_records_test.py ................
tests/mobly_sl4a_client_test.py ...........
tests/mobly_test_runner_test.py ...........
tests/mobly_utils_test.py .....

================================================================================================================= 114 passed in 0.56 seconds =================================================================================================================

Create utils for executing Android Instrumentation tests

There have been multiple requests to run regular AndroidInstrumentation tests with mobly.
A sample use cases would be running tests on multiple devices and aggregate results across them.
Let's create utils to make such tasks easy.

FR: do device setup in parallel

For large testbeds, the time it takes to load snippets and sl4a is quite significant. Would be very nice to be able to easily do this setup in parallel.

I realize this code is part of the user test class, but perhaps we can make a utility method to perform some action for every device in parallel?

logpersist missing.

Seems like most devices don't have the logpersist service. Atleast not my Nexus 6P with latest Android 7.0.1. Any thoughts on how I can make this work?

$python hello.py -c config.json
[SampleTestBed] 12-11 13:27:46.351 INFO ==========> HelloWorldTest <==========
[SampleTestBed] 12-11 13:27:46.625 ERROR [AndroidDevice|DEVICE_ID_REDACTED] Failed to start adb logcat!
Traceback (most recent call last):
  File "build/bdist.macosx-10.11-x86_64/egg/mobly/controllers/android_device.py", line 384, in start_services
    self.start_adb_logcat()
  File "build/bdist.macosx-10.11-x86_64/egg/mobly/controllers/android_device.py", line 580, in start_adb_logcat
    self.adb.shell("logpersist.stop --clear")
  File "build/bdist.macosx-10.11-x86_64/egg/mobly/controllers/android_device_lib/adb.py", line 137, in adb_call
    return self._exec_adb_cmd(clean_name, arg_str)
  File "build/bdist.macosx-10.11-x86_64/egg/mobly/controllers/android_device_lib/adb.py", line 108, in _exec_adb_cmd
    return self._exec_cmd(' '.join((self.adb_str, name, arg_str)))
  File "build/bdist.macosx-10.11-x86_64/egg/mobly/controllers/android_device_lib/adb.py", line 105, in _exec_cmd
    raise AdbError(cmd=cmd, stdout=out, stderr=err, ret_code=ret)
AdbError: Error executing adb cmd 'adb -s DEVICE_ID_REDACTED shell logpersist.stop --clear'. ret: 127, stdout: , stderr: /system/bin/sh: logpersist.stop: not found

[SampleTestBed] 12-11 13:27:46.626 ERROR [AndroidDevice|DEVICE_ID_REDACTED] Failed to start some services, abort!
Traceback (most recent call last):
  File "build/bdist.macosx-10.11-x86_64/egg/mobly/controllers/android_device.py", line 129, in _start_services_on_ads
    ad.start_services(skip_sl4a=getattr(ad, KEY_SKIP_SL4A, False))
  File "build/bdist.macosx-10.11-x86_64/egg/mobly/controllers/android_device.py", line 384, in start_services
    self.start_adb_logcat()
  File "build/bdist.macosx-10.11-x86_64/egg/mobly/controllers/android_device.py", line 580, in start_adb_logcat
    self.adb.shell("logpersist.stop --clear")
  File "build/bdist.macosx-10.11-x86_64/egg/mobly/controllers/android_device_lib/adb.py", line 137, in adb_call
    return self._exec_adb_cmd(clean_name, arg_str)
  File "build/bdist.macosx-10.11-x86_64/egg/mobly/controllers/android_device_lib/adb.py", line 108, in _exec_adb_cmd
    return self._exec_cmd(' '.join((self.adb_str, name, arg_str)))
  File "build/bdist.macosx-10.11-x86_64/egg/mobly/controllers/android_device_lib/adb.py", line 105, in _exec_cmd
    raise AdbError(cmd=cmd, stdout=out, stderr=err, ret_code=ret)
AdbError: Error executing adb cmd 'adb -s DEVICE_ID_REDACTED shell logpersist.stop --clear'. ret: 127, stdout: , stderr: /system/bin/sh: logpersist.stop: not found

[SampleTestBed] 12-11 13:27:46.735 ERROR Failed to initialize objects for controller AndroidDevice, abort!
Traceback (most recent call last):
  File "build/bdist.macosx-10.11-x86_64/egg/mobly/test_runner.py", line 376, in register_controller
    objects = create(controller_config)
  File "build/bdist.macosx-10.11-x86_64/egg/mobly/controllers/android_device.py", line 82, in create
    _start_services_on_ads(ads)
  File "build/bdist.macosx-10.11-x86_64/egg/mobly/controllers/android_device.py", line 129, in _start_services_on_ads
    ad.start_services(skip_sl4a=getattr(ad, KEY_SKIP_SL4A, False))
  File "build/bdist.macosx-10.11-x86_64/egg/mobly/controllers/android_device.py", line 384, in start_services
    self.start_adb_logcat()
  File "build/bdist.macosx-10.11-x86_64/egg/mobly/controllers/android_device.py", line 580, in start_adb_logcat
    self.adb.shell("logpersist.stop --clear")
  File "build/bdist.macosx-10.11-x86_64/egg/mobly/controllers/android_device_lib/adb.py", line 137, in adb_call
    return self._exec_adb_cmd(clean_name, arg_str)
  File "build/bdist.macosx-10.11-x86_64/egg/mobly/controllers/android_device_lib/adb.py", line 108, in _exec_adb_cmd
    return self._exec_cmd(' '.join((self.adb_str, name, arg_str)))
  File "build/bdist.macosx-10.11-x86_64/egg/mobly/controllers/android_device_lib/adb.py", line 105, in _exec_cmd
    raise AdbError(cmd=cmd, stdout=out, stderr=err, ret_code=ret)
AdbError: Error executing adb cmd 'adb -s DEVICE_ID_REDACTED shell logpersist.stop --clear'. ret: 127, stdout: , stderr: /system/bin/sh: logpersist.stop: not found

[SampleTestBed] 12-11 13:27:46.736 ERROR Failed to setup HelloWorldTest.
Traceback (most recent call last):
  File "build/bdist.macosx-10.11-x86_64/egg/mobly/base_test.py", line 504, in run
    self._setup_class()
  File "build/bdist.macosx-10.11-x86_64/egg/mobly/base_test.py", line 128, in _setup_class
    self.setup_class()
  File "hello.py", line 11, in setup_class
    self.ads = self.register_controller(android_device)
  File "build/bdist.macosx-10.11-x86_64/egg/mobly/test_runner.py", line 376, in register_controller
    objects = create(controller_config)
  File "build/bdist.macosx-10.11-x86_64/egg/mobly/controllers/android_device.py", line 82, in create
    _start_services_on_ads(ads)
  File "build/bdist.macosx-10.11-x86_64/egg/mobly/controllers/android_device.py", line 129, in _start_services_on_ads
    ad.start_services(skip_sl4a=getattr(ad, KEY_SKIP_SL4A, False))
  File "build/bdist.macosx-10.11-x86_64/egg/mobly/controllers/android_device.py", line 384, in start_services
    self.start_adb_logcat()
  File "build/bdist.macosx-10.11-x86_64/egg/mobly/controllers/android_device.py", line 580, in start_adb_logcat
    self.adb.shell("logpersist.stop --clear")
  File "build/bdist.macosx-10.11-x86_64/egg/mobly/controllers/android_device_lib/adb.py", line 137, in adb_call
    return self._exec_adb_cmd(clean_name, arg_str)
  File "build/bdist.macosx-10.11-x86_64/egg/mobly/controllers/android_device_lib/adb.py", line 108, in _exec_adb_cmd
    return self._exec_cmd(' '.join((self.adb_str, name, arg_str)))
  File "build/bdist.macosx-10.11-x86_64/egg/mobly/controllers/android_device_lib/adb.py", line 105, in _exec_cmd
    raise AdbError(cmd=cmd, stdout=out, stderr=err, ret_code=ret)
AdbError: Error executing adb cmd 'adb -s DEVICE_ID_REDACTED shell logpersist.stop --clear'. ret: 127, stdout: , stderr: /system/bin/sh: logpersist.stop: not found

[SampleTestBed] 12-11 13:27:46.736 ERROR Error executing adb cmd 'adb -s DEVICE_ID_REDACTED shell logpersist.stop --clear'. ret: 127, stdout: , stderr: /system/bin/sh: logpersist.stop: not found

[SampleTestBed] 12-11 13:27:46.736 INFO [Test Case] setup_class FAIL
[SampleTestBed] 12-11 13:27:46.737 INFO Summary for test run SampleTestBed@12-11-2016_13-27-46-350: Error 0, Executed 1, Failed 1, Passed 0, Requested 1, Skipped 0

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.