Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 0053bb3f authored by Elliott Hughes's avatar Elliott Hughes
Browse files

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
parent 6a2d5a34
Loading
Loading
Loading
Loading
+8 −0
Original line number Diff line number Diff line
@@ -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"