You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
48 lines
1.7 KiB
48 lines
1.7 KiB
# Copyright 2016 The Chromium OS Authors. All rights reserved.
|
|
# Use of this source code is governed by a BSD-style license that can be
|
|
# found in the LICENSE file.
|
|
|
|
import logging
|
|
import os
|
|
import time
|
|
|
|
from autotest_lib.client.bin import test, utils
|
|
from autotest_lib.client.common_lib import error
|
|
from autotest_lib.client.common_lib.cros import chrome
|
|
from autotest_lib.client.common_lib.cros import enrollment
|
|
from autotest_lib.client.common_lib.cros import kiosk_utils
|
|
from autotest_lib.client.common_lib import utils as utils2
|
|
|
|
KIOSK_MODE = 'Starting kiosk mode...'
|
|
|
|
|
|
class enterprise_KioskEnrollment(test.test):
|
|
"""Enroll the device in enterprise."""
|
|
version = 1
|
|
|
|
APP_NAME = 'chromesign'
|
|
EXT_ID = 'odjaaghiehpobimgdjjfofmablbaleem'
|
|
EXT_PAGE = 'viewer.html'
|
|
|
|
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(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.')
|