Commit graph

7 commits

Author SHA1 Message Date
Elliott Hughes
2b10111d25 Implement the ssh(1) escaping rules.
The first rule of ssh(1) escaping is that there is no escaping.

This doesn't undo any of my recent security fixes because they're all
calling escape_arg themselves.

This fixes "adb shell rm /data/dalvik-cache/arm/*".

Also remove do_cmd which caused concern during code review.

Bug: http://b/20564385
Change-Id: I4588fd949d51e2a50cff47ea171ed2d75f402d0d
2015-05-05 11:17:03 -07:00
Elliott Hughes
8e6edc0d89 Add a couple more adb shell regression tests.
Bug: http://b/15479704
Change-Id: Id3e7f0df101ad61db509df313c13210a8bd8b124
2015-04-21 16:25:54 -07:00
Elliott Hughes
0053bb3f1a Add a test for shell escaping.
Until I fixed this, we would fail this example:

  $ adb shell sh -c 'echo hello; echo world'
  hello
  /system/bin/sh:  echo world: not found

Bug: http://b/19734868
Change-Id: I11a437cd0c0362303028f23fbaa103611b75707e
2015-04-21 12:15:31 -07:00
Dan Albert
857d7db69d Make the root/unroot test more robust.
* Check the current adb user to choose the order of root/unroot.
* Re-root the device when finished.

Change-Id: I47a14b89e2c405bd63722e4d2043fcc629fb5e58
2015-03-09 10:45:50 -07:00
Dan Albert
b2e57b738f Make Python tests only check the current device.
In practice testing all connected devices is a pain, since it's
probably each device is running a different build. It would probably
make sense to just move this functionality up into a higher level test
runner (which could just live in main).

Also rename test_devices to test_shell, since it doesn't really test
`adb devices`.

Change-Id: Ie96d3e83b30acfac4e3bcbd9821690c0ad4d2f7e
2015-02-24 14:36:03 -08:00
Dan Pasanen
9885881d06 adb: add "adb unroot" to restart adb in non-root mode
Change-Id: Ice6b94a71a62648ac073d129914a07372411fb25
2015-02-18 12:37:11 -08:00
Riley Andrews
d83a9c55f4 Python unit test for adb.
Change-Id: I1b2b8004f47b708e6a1d6a4ad20816e7beb21a0f
2015-01-13 15:08:56 -08:00