• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1# Copyright 2017 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.server.cros.cfm import cfm_base_test
8
9
10class enterprise_CFM_RebootStress(cfm_base_test.CfmBaseTest):
11    """
12    Stress tests the CFM enrolled device by rebooting it multiple times using
13    Chrome runtime restart() API and ensuring the packaged app launches as
14    expected after every reboot.
15    """
16    version = 1
17
18
19    def run_once(self, reboot_cycles, is_meeting):
20        """
21        Runs the test.
22
23        @param reboot_cycles: The amount of times to reboot the DUT.
24        @is_meeting: True for Hangouts Meet, False for classic Hangouts.
25        """
26        logging.info("Performing in total %d reboot cycles...", reboot_cycles)
27        for cycle in range(reboot_cycles):
28            logging.info("Started reboot cycle %d.", cycle)
29            boot_id = self._host.get_boot_id()
30            self.cfm_facade.wait_for_telemetry_commands()
31            self.cfm_facade.reboot_device_with_chrome_api()
32            self._host.wait_for_restart(old_boot_id=boot_id)
33            self.cfm_facade.restart_chrome_for_cfm()
34
35