Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(115)

Issue 670463002: Revert of New run shell implementation for DeviceUtils (Closed)

Created:
6 years, 2 months ago by jochen (gone - plz use gerrit)
Modified:
6 years, 2 months ago
Reviewers:
perezju, jbudorick
CC:
chromium-reviews, klundberg+watch_chromium.org, yfriedman+watch_chromium.org
Base URL:
https://chromium.googlesource.com/chromium/src.git@master
Project:
chromium
Visibility:
Public.

Description

Revert of New run shell implementation for DeviceUtils (patchset #8 id:140001 of https://codereview.chromium.org/659533002/) Reason for revert: Appears to break telemetry_perf_unittests Original issue's description: > New run shell implementation for DeviceUtils > > The main differences are: > - it uses AdbWrapper.Shell to actually execute the command. > - when the cmd is supplied as a list of a command and its arguments, > the arguments are quoted to prevent them from being (mis)interpreted > by the shell. > - a new single_line option to check that the output produces contains a single line, and return the value of that line. > > BUG=267773 > > Committed: https://crrev.com/ab18bcca0cc1475cf381211e595e75c1146c9115 > Cr-Commit-Position: refs/heads/master@{#300237} TBR=jbudorick@chromium.org,perezju@chromium.org NOTREECHECKS=true NOTRY=true BUG=267773

Patch Set 1 #

Unified diffs Side-by-side diffs Delta from patch set Stats (+201 lines, -484 lines) Patch
M build/android/pylib/cmd_helper.py View 3 chunks +1 line, -48 lines 0 comments Download
D build/android/pylib/cmd_helper_test.py View 1 chunk +0 lines, -53 lines 0 comments Download
M build/android/pylib/device/adb_wrapper.py View 1 chunk +6 lines, -4 lines 0 comments Download
M build/android/pylib/device/adb_wrapper_test.py View 1 chunk +2 lines, -2 lines 0 comments Download
M build/android/pylib/device/device_errors.py View 1 chunk +1 line, -14 lines 0 comments Download
M build/android/pylib/device/device_utils.py View 13 chunks +63 lines, -115 lines 0 comments Download
M build/android/pylib/device/device_utils_test.py View 10 chunks +124 lines, -244 lines 0 comments Download
M build/android/pylib/instrumentation/test_runner.py View 1 chunk +2 lines, -2 lines 0 comments Download
M build/android/pylib/instrumentation/test_runner_test.py View 1 chunk +2 lines, -2 lines 0 comments Download

Messages

Total messages: 5 (2 generated)
jochen (gone - plz use gerrit)
Created Revert of New run shell implementation for DeviceUtils
6 years, 2 months ago (2014-10-20 13:20:44 UTC) #1
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/patch-status/670463002/1
6 years, 2 months ago (2014-10-20 13:21:09 UTC) #2
commit-bot: I haz the power
6 years, 2 months ago (2014-10-20 13:21:28 UTC) #4
Failed to apply patch for build/android/pylib/cmd_helper_test.py:
While running git rm build/android/pylib/cmd_helper_test.py;
  fatal: pathspec 'build/android/pylib/cmd_helper_test.py' did not match any
files

Patch:  D    build/android/pylib/cmd_helper_test.py
Index: build/android/pylib/cmd_helper_test.py
diff --git a/build/android/pylib/cmd_helper_test.py
b/build/android/pylib/cmd_helper_test.py
deleted file mode 100644
index
8b5680df02675b26c9241e2568de49a584dd2c43..0000000000000000000000000000000000000000
--- a/build/android/pylib/cmd_helper_test.py
+++ /dev/null
@@ -1,53 +0,0 @@
-# Copyright 2013 The Chromium Authors. All rights reserved.
-# Use of this source code is governed by a BSD-style license that can be
-# found in the LICENSE file.
-
-"""Tests for the cmd_helper module."""
-
-import unittest
-
-from pylib import cmd_helper
-
-# TODO(jbudorick) Make these tests run on the bots.
-
-
-class CmdHelperSingleQuoteTest(unittest.TestCase):
-
-  def testSingleQuote_basic(self):
-    self.assertEquals('hello',
-                      cmd_helper.SingleQuote('hello'))
-
-  def testSingleQuote_withSpaces(self):
-    self.assertEquals("'hello world'",
-                      cmd_helper.SingleQuote('hello world'))
-
-  def testSingleQuote_withUnsafeChars(self):
-    self.assertEquals("""'hello'"'"'; rm -rf /'""",
-                      cmd_helper.SingleQuote("hello'; rm -rf /"))
-
-  def testSingleQuote_dontExpand(self):
-    test_string = 'hello $TEST_VAR'
-    cmd = 'TEST_VAR=world; echo %s' % cmd_helper.SingleQuote(test_string)
-    self.assertEquals(test_string,
-                      cmd_helper.GetCmdOutput(cmd, shell=True).rstrip())
-
-
-class CmdHelperDoubleQuoteTest(unittest.TestCase):
-
-  def testDoubleQuote_basic(self):
-    self.assertEquals('hello',
-                      cmd_helper.DoubleQuote('hello'))
-
-  def testDoubleQuote_withSpaces(self):
-    self.assertEquals('"hello world"',
-                      cmd_helper.DoubleQuote('hello world'))
-
-  def testDoubleQuote_withUnsafeChars(self):
-    self.assertEquals('''"hello\\"; rm -rf /"''',
-                      cmd_helper.DoubleQuote('hello"; rm -rf /'))
-
-  def testSingleQuote_doExpand(self):
-    test_string = 'hello $TEST_VAR'
-    cmd = 'TEST_VAR=world; echo %s' % cmd_helper.DoubleQuote(test_string)
-    self.assertEquals('hello world',
-                      cmd_helper.GetCmdOutput(cmd, shell=True).rstrip())

Powered by Google App Engine
This is Rietveld 408576698