• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1# -*- mode: python; coding: utf-8 -*-
2#
3# Copyright (c) 2013 The Chromium OS Authors. All rights reserved.
4# Use of this source code is governed by a BSD-style license that can be
5# found in the LICENSE file.
6
7TEST_LIST_NAME = 'Dozing Basic'
8
9options.auto_run_on_start = False
10
11# -- CUSTOMIZABLE SETTINGS -------------------------------------------
12# The number of suspend/resume tests you want during run-in.
13_RUNIN_RESUME_ITERATIONS = 1
14
15# The duration of stress test + repeated suspend/resume during run-in.
16_RUNIN_DOZING_SAT_DURATION_SECS = int(24 * 60 * 60)
17
18# The interval of logging events in seconds during run-in.
19_RUNIN_LOG_INTERVAL_SECS = 10
20
21_TEST_ARGS = {'cycles': _RUNIN_RESUME_ITERATIONS,
22              'suspend_delay_min_secs': 28,
23              'suspend_delay_max_secs': 30,
24              'resume_early_margin_secs': 1,
25              'suspend_worst_case_secs': 120}
26
27_NATIVE_TEST_LABEL = u'睡眠/唤醒 (%s次)' % _RUNIN_RESUME_ITERATIONS
28
29_ENGLISH_TEST_LABEL = 'Suspend/Resume (%s %s)' % (
30                         _RUNIN_RESUME_ITERATIONS,
31                         'time' if _RUNIN_RESUME_ITERATIONS == 1 else 'times')
32
33_TEST_NAME = 'suspend_resume'
34
35def Barrier(id_suffix):
36  return OperatorTest(
37      id='Barrier_' + str(id_suffix),
38      label_zh=u'检查关卡' + str(id_suffix),
39      pytest_name='summary',
40      never_fails=True,
41      disable_abort=True,
42      dargs={'disable_input_on_fail':True})
43
44# Tests in the test_list will be run in the order below, unless the
45# operator interrupts the flow.
46
47TEST_LIST = [
48TestGroup(
49    id='RunIn',
50    subtests=[
51    FactoryTest(
52        id='DozingBasic',
53        label_zh=u'Label',
54        subtests=[
55
56            FactoryTest(
57                label_en=_ENGLISH_TEST_LABEL,
58                label_zh=_NATIVE_TEST_LABEL,
59                pytest_name=_TEST_NAME,
60                backgroundable=True,
61                dargs=_TEST_ARGS),
62    ]),
63]),  # End of RUNIN test group.
64
65TestGroup(
66    id='RunIn2',
67    subtests=[
68
69    FactoryTest(
70        id='DozingBasic2',
71        label_zh=u'Label2',
72        subtests=[
73
74            FactoryTest(
75                label_en=_ENGLISH_TEST_LABEL,
76                label_zh=_NATIVE_TEST_LABEL,
77                pytest_name=_TEST_NAME,
78                backgroundable=False,
79                dargs=_TEST_ARGS),
80    ]),
81    FactoryTest(
82        id='DozingBasic3',
83        label_zh=u'Label3',
84        subtests=[
85
86            FactoryTest(
87                label_en=_ENGLISH_TEST_LABEL,
88                label_zh=_NATIVE_TEST_LABEL,
89                pytest_name=_TEST_NAME,
90                backgroundable=False,
91                dargs=_TEST_ARGS),
92    ]),
93    Barrier('RUNIN'),
94]),  # End of RUNIN2 test group.
95
96]
97
98