deploy_chrome: Support strip option for deploying Lacros
To use the strip binary in SDK, developers need to specify the
board.
Currently developers is using:
deploy_chrome.py --device=<> --build-dir=<> --lacros --nostrip
With board args, developers will use either:
deploy_chrome.py --device=<> --build-dir=<> --lacros --board=<>
or
deploy_chrome.py --device=<> --build-dir=<> --lacros --nostrip
TEST: Tested locally that the stripped binary can be deployed
to altas and can run the binary successfully.
BUG: 1342286
Change-Id: Ic4128df281be91fb2069946230402a4da14cd665
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/chromite/+/3764811
Commit-Queue: Sven Zheng <svenzheng@chromium.org>
Reviewed-by: Ben Pastene <bpastene@chromium.org>
Tested-by: Sven Zheng <svenzheng@chromium.org>
Reviewed-by: Erik Chen <erikchen@chromium.org>
Reviewed-by: Mike Frysinger <vapier@chromium.org>
diff --git a/scripts/deploy_chrome_unittest.py b/scripts/deploy_chrome_unittest.py
index d04a52d..cb9025a 100644
--- a/scripts/deploy_chrome_unittest.py
+++ b/scripts/deploy_chrome_unittest.py
@@ -85,18 +85,20 @@
def testLacros(self):
"""Test basic lacros invocation."""
- argv = ['--lacros', '--nostrip', '--build-dir', '/path/to/nowhere',
- '--device', 'monkey']
+ argv = ['--lacros', '--build-dir', '/path/to/nowhere',
+ '--device', 'monkey', '--board', 'atlas']
options = _ParseCommandLine(argv)
self.assertTrue(options.lacros)
self.assertEqual(options.target_dir, deploy_chrome.LACROS_DIR)
- def testLacrosRequiresNostrip(self):
- """Lacros requires --nostrip"""
- argv = ['--lacros', '--build-dir', '/path/to/nowhere', '--device',
- 'monkey']
- self.assertRaises2(SystemExit, _ParseCommandLine, argv,
- check_attrs={'code': 2})
+ def testLacrosNoStrip(self):
+ """Test lacros invocation with nostrip."""
+ argv = ['--lacros', '--nostrip', '--build-dir', '/path/to/nowhere',
+ '--device', 'monkey']
+ options = _ParseCommandLine(argv)
+ self.assertTrue(options.lacros)
+ self.assertFalse(options.dostrip)
+ self.assertEqual(options.target_dir, deploy_chrome.LACROS_DIR)
def assertParseError(self, argv):
with self.OutputCapturer():