Home | History | Annotate | Download | only in enterprise_CFM_RebootStress
      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 
      5 import logging
      6 
      7 from autotest_lib.server.cros.cfm import cfm_base_test
      8 
      9 
     10 class 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             if is_meeting:
     31                 self.cfm_facade.wait_for_meetings_landing_page()
     32             else:
     33                 self.cfm_facade.wait_for_hangouts_telemetry_commands()
     34             self.cfm_facade.reboot_device_with_chrome_api()
     35             self._host.wait_for_restart(old_boot_id=boot_id)
     36             self.cfm_facade.restart_chrome_for_cfm()
     37 
     38