summaryrefslogtreecommitdiffstats
path: root/adb/tests/test_adb.py
diff options
context:
space:
mode:
authorElliott Hughes <enh@google.com>2015-04-21 12:15:31 -0700
committerElliott Hughes <enh@google.com>2015-04-21 12:15:31 -0700
commit0053bb3f1a4647e6b2deea3d7cf0a1965a3d9bad (patch)
tree9f2f468cee665deb813f153049c63adfbfa7f3ce /adb/tests/test_adb.py
parent6a2d5a34e81b75ac61337d401aab16bf917b47b1 (diff)
downloadsystem_core-0053bb3f1a4647e6b2deea3d7cf0a1965a3d9bad.zip
system_core-0053bb3f1a4647e6b2deea3d7cf0a1965a3d9bad.tar.gz
system_core-0053bb3f1a4647e6b2deea3d7cf0a1965a3d9bad.tar.bz2
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
Diffstat (limited to 'adb/tests/test_adb.py')
-rwxr-xr-xadb/tests/test_adb.py8
1 files changed, 8 insertions, 0 deletions
diff --git a/adb/tests/test_adb.py b/adb/tests/test_adb.py
index f111b04..69dead2 100755
--- a/adb/tests/test_adb.py
+++ b/adb/tests/test_adb.py
@@ -267,6 +267,14 @@ class AdbBasic(unittest.TestCase):
adb.unroot()
adb.wait()
+ def test_argument_escaping(self):
+ """Make sure that argument escaping is somewhat sane."""
+ adb = AdbWrapper()
+
+ # http://b/19734868
+ result = adb.shell("sh -c 'echo hello; echo world'").splitlines()
+ self.assertEqual(["hello", "world"], result)
+
class AdbFile(unittest.TestCase):
SCRATCH_DIR = "/data/local/tmp"