From 127e5f5304ef4f33e4af1478a952cbfd00156a7f Mon Sep 17 00:00:00 2001 From: Ben Pastene Date: Mon, 1 Apr 2019 23:35:09 +0000 Subject: [PATCH] Add interactive_ui_tests' SplitViewResize on the FYI cros VM test bot. And remove a couple old suites from the fyi bot. Bug: 946685 Change-Id: I621e6482c39b9af47173db644a5a1866741fa7eb Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1548054 Reviewed-by: John Budorick Commit-Queue: Ben Pastene Cr-Original-Commit-Position: refs/heads/master@{#646560} Cr-Mirrored-From: https://chromium.googlesource.com/chromium/src Cr-Mirrored-Commit: 39af4ef6f76f173ae2d057e08493c85e913024b0 --- chromeos/test_runner.py | 26 +++++++++++++++++++++++--- 1 file changed, 23 insertions(+), 3 deletions(-) diff --git a/chromeos/test_runner.py b/chromeos/test_runner.py index 63d249435..d72b0a4dd 100755 --- a/chromeos/test_runner.py +++ b/chromeos/test_runner.py @@ -136,7 +136,7 @@ class RemoteTest(object): fd, tmp_path = tempfile.mkstemp(suffix='.sh', dir=self._path_to_outdir) os.fchmod(fd, 0755) with os.fdopen(fd, 'wb') as f: - f.write('\n'.join(script_contents)) + f.write('\n'.join(script_contents) + '\n') return tmp_path def run_test(self): @@ -359,6 +359,28 @@ class GTestTest(RemoteTest): device_result_file) if self._additional_args: test_invocation += ' %s' % ' '.join(self._additional_args) + + if self._test_exe == 'interactive_ui_tests': + # interactive_ui_tests needs some special setup. See crbug.com/946685#c4 + # TODO(bpastene): Put all this behind a flag if more suites need it. + device_test_script_contents += [ + 'export CR_SOURCE_ROOT=/tmp', + 'stop ui', + ] + # The UI service on the device owns the chronos user session, so shutting + # it down as chronos kills the entire execution of the test. So we'll have + # to run as root up until the test invocation. + test_invocation = 'su chronos -c -- "%s"' % test_invocation + # And we'll need to chown everything since cros_run_test's "--as-chronos" + # option normally does that for us. + device_test_script_contents.append('chown -R chronos: ../..') + else: + self._test_cmd += [ + # Some tests fail as root, so run as the less privileged user + # 'chronos'. + '--as-chronos', + ] + device_test_script_contents.append(test_invocation) self._on_device_script = self.write_test_script_to_disk( @@ -382,8 +404,6 @@ class GTestTest(RemoteTest): self._test_cmd.extend(['--files', f]) self._test_cmd += [ - # Some tests fail as root, so run as the less privileged user 'chronos'. - '--as-chronos', '--', './' + os.path.relpath(self._on_device_script, self._path_to_outdir) ]