• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1# Copyright 2019 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"""Autotest for mimo-updater."""
5
6from autotest_lib.server import test
7from autotest_lib.client.common_lib import error
8
9class enterprise_CFM_MimoUpdater(test.test):
10    """
11    Tests that mimo-updater runs with a firmware version check
12    mimo-updater is also responsible for determining if a fw update is needed.
13    However, those parts are currently untestable.
14    """
15    version = 1
16
17    def run_once(self, host):
18        """Top level function that is called by autoserv."""
19        host.run("rm --force /var/log/messages")
20        host.reboot()
21        host.wait_up()
22        # grep's exit status is 0 if pattern matched, 1 ow.
23        # utils.grep() doesn't use extended regexp
24        cmd = 'grep -E "Firmware Version: 0x[0-9]+" /var/log/messages'
25        output = host.run(cmd, ignore_status=True)
26        if output.stderr:
27            raise error.TestFail(output.stderr)
28
29
30