1# Copyright (c) 2010 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 logging
6
7from autotest_lib.client.bin import test, utils
8from autotest_lib.client.common_lib import error
9
10class security_RootfsOwners(test.test):
11    version = 1
12
13    def run_once(self):
14        """
15        This is a regression test for 7989.
16        Do a find on the system for rootfs files owned by chronos
17        or chronos-access. Test fails if there is any.
18        """
19        cmd = 'find / -xdev -user chronos -o -user chronos-access -print'
20        cmd_output = utils.system_output(cmd, ignore_status=True)
21
22        if (cmd_output != '') :
23            logging.error(cmd_output)
24            raise error.TestFail('Rootfs should not contain any files owned by chronos')
25