Skip to content

Commit

Permalink
Delete crash dumps and logs that persist from tests on cros VMs.
Browse files Browse the repository at this point in the history
The following two dirs can accumulate cruft over a VM's life time:
- /var/log/chrome/
- /var/spool/crash/

This clears them before each test. Should become unnecessary when
crbug.com/878526 is closed out.

Bug: 880878
Change-Id: I5414cb65016294938e9e68db495946bbb05cad48
Reviewed-on: https://chromium-review.googlesource.com/1208254
Reviewed-by: John Budorick <jbudorick@chromium.org>
Commit-Queue: Ben Pastene <bpastene@chromium.org>
Cr-Commit-Position: refs/heads/master@{#589007}
  • Loading branch information
bpastene authored and Commit Bot committed Sep 5, 2018
1 parent e5f63c3 commit dfc6b1d
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions build/chromeos/run_vm_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -168,6 +168,16 @@ def build_test_command(self):
# Build the shell script that will be used on the VM to invoke the test.
vm_test_script_contents = ['#!/bin/sh']

# Clear out directories that persist logs and crash dumps. These can
# accumulate over a VM's lifetime and consume disk space.
# TODO(crbug.com/878526): Remove this once cros_run_vm_test handles it.
vm_test_script_contents += [
# We run tests as chronos, but need to be root to rm the files. So pass
# in the public plaintext root password to sudo via stdin.
'echo "test0000" | sudo -S find /var/spool/crash/ -type f -delete',
'echo "test0000" | sudo -S find /var/log/chrome/ -type f -delete',
]

# /home is mounted with "noexec" in the VM, but some of our tools
# and tests use the home dir as a workspace (eg: vpython downloads
# python binaries to ~/.vpython-root). /tmp doesn't have this
Expand Down

0 comments on commit dfc6b1d

Please sign in to comment.