def run_once(self):
        user_id, password = utils.get_signin_credentials(
            os.path.join(os.path.dirname(os.path.realpath(__file__)),
                         'credentials.txt'))
        if not (user_id and password):
            logging.warn('No credentials found - exiting test.')
            return

        with chrome.Chrome(auto_login=False) as cr:
            cr.browser.oobe.NavigateGaiaLogin(
                user_id,
                password,
                enterprise_enroll=True,
                for_user_triggered_enrollment=True)
            time.sleep(STABILIZATION_DURATION)
            self.verify_enrollment(user_id)
            start_time = time.time()
            perf_keyval = {}
            perf_file = open(_PERF_RESULT_FILE, 'w')
            writer = csv.writer(perf_file)
            writer.writerow(['cpu', 'memory', 'timestamp'])
            while (time.time() - start_time) < TOTAL_TEST_DURATION:
                perf_keyval['cpu_usage'] = self.test_cpu_usage()
                perf_keyval['memory_usage'] = self.used_mem()
                writer.writerow([
                    perf_keyval['cpu_usage'], perf_keyval['memory_usage'],
                    time.strftime('%Y/%m/%d %H:%M:%S')
                ])
                self.write_perf_keyval(perf_keyval)
                time.sleep(10)
            perf_file.close()
Beispiel #2
0
    def run_once(self):
        user_id, password = utils.get_signin_credentials(
            os.path.join(os.path.dirname(os.path.realpath(__file__)),
                         'credentials.txt'))
        if not (user_id and password):
            logging.warn('No credentials found - exiting test.')
            return

        with chrome.Chrome(auto_login=False,
                           disable_gaia_services=False) as cr:
            enrollment.RemoraEnrollment(cr.browser, user_id, password)
            self.cfm_facade = cfm_facade_native.CFMFacadeNative(cr, 'hotrod')
            self.cfm_facade.check_hangout_extension_context()
    def run_once(self, kiosk_app_attributes=None):
        if kiosk_app_attributes:
            self.APP_NAME, self.EXT_ID, self.EXT_PAGE = \
                    kiosk_app_attributes.rstrip().split(':')
        user_id, password = utils.get_signin_credentials(
            os.path.join(os.path.dirname(os.path.realpath(__file__)),
                         'credentials.' + self.APP_NAME))
        if not (user_id and password):
            logging.warn('No credentials found - exiting test.')
            return

        with chrome.Chrome(auto_login=False,
                           disable_gaia_services=False) as cr:
            enrollment.EnterpriseEnrollment(cr.browser, user_id, password)
            self._CheckKioskExtensionContexts(cr.browser)
    def run_once(self, kiosk_app_attributes=None):
        if kiosk_app_attributes:
            self.APP_NAME, self.EXT_ID, self.EXT_PAGE = \
                    kiosk_app_attributes.rstrip().split(':')
        user_id, password = utils.get_signin_credentials(
            os.path.join(os.path.dirname(os.path.realpath(__file__)),
                         'credentials.' + self.APP_NAME))
        if not (user_id and password):
            logging.warn('No credentials found - exiting test.')
            return

        with chrome.Chrome(auto_login=False,
                           disable_gaia_services=False) as cr:
            enrollment.EnterpriseEnrollment(cr.browser, user_id, password)
        # This way of checking a kiosk extension doesn't work.
        #self._CheckKioskExtensionContexts(cr.browser)
        time.sleep(15)
        running_apps = utils2.system_output(
            'cat /var/log/messages | grep kiosk')
        if KIOSK_MODE not in running_apps:
            raise error.TestFail(
                'DUT did not enter kiosk mode. and it should have.')
Beispiel #5
0
    def run_once(self):
        user_id, password = utils.get_signin_credentials(
            os.path.join(os.path.dirname(os.path.realpath(__file__)),
                         'credentials.txt'))
        if not (user_id and password):
            logging.warn('No credentials found - exiting test.')
            return

        with chrome.Chrome(auto_login=False) as cr:
            enrollment.RemoraEnrollment(cr.browser, user_id, password)
            # Timeout to allow for the device to stablize and go back to the
            # login screen before proceeding.
            time.sleep(TIMEOUT)

        # This is a workaround fix for crbug.com/495847. A more permanent fix
        # should be to get the hotrod app to auto launch after enrollment.
        with chrome.Chrome(clear_enterprise_policy=False,
                           dont_override_profile=True,
                           disable_gaia_services=False,
                           disable_default_apps=False,
                           auto_login=False) as cr:
            self._CheckHangoutsExtensionContexts(cr.browser)
Beispiel #6
0
    def run_once(self, kiosk_app_attributes=None):
        if kiosk_app_attributes:
            self.APP_NAME, self.EXT_ID, self.EXT_PAGE = \
                    kiosk_app_attributes.rstrip().split(':')
        user_id, password = utils.get_signin_credentials(
            os.path.join(os.path.dirname(os.path.realpath(__file__)),
                         'credentials.' + self.APP_NAME))
        if not (user_id and password):
            logging.warn('No credentials found - exiting test.')
            return

        with chrome.Chrome(auto_login=False,
                           disable_gaia_services=False) as cr:
            enrollment.EnterpriseEnrollment(cr.browser, user_id, password)
            time.sleep(TIMEOUT)

        # This is a workaround fix for crbug.com/495847. A more permanent fix
        # should be to get the kiosk app to auto launch after enrollment.
        cr = chrome.Chrome(clear_enterprise_policy=False,
                           dont_override_profile=True,
                           disable_gaia_services=False,
                           disable_default_apps=False,
                           auto_login=False)
        self._CheckKioskExtensionContexts(cr.browser)