• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1# Copyright (c) 2013 The Chromium OS Authors. All rights reserved.
2# Use of this source code is governed by a BSD-style license that can be
3# found in the LICENSE file.
4
5import glob
6import logging
7import os
8
9from autotest_lib.client.cros import chrome_binary_test
10
11
12class security_SandboxLinuxUnittests(chrome_binary_test.ChromeBinaryTest):
13    """Runs sandbox_linux_unittests."""
14
15    version = 1
16    BINARY = 'sandbox_linux_unittests'
17    CRASH_DIR = '/var/spool/crash'
18
19
20    def run_once(self):
21        self.run_chrome_test_binary(self.BINARY)
22        crash_pattern = os.path.join(self.CRASH_DIR, self.BINARY + '*')
23        for filename in glob.glob(crash_pattern):
24            try:
25                os.remove(filename)
26            except OSError as ose:
27                logging.warning('Could not remove crash dump: %s', ose)
28