• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1# Copyright (c) 2018 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
5from autotest_lib.client.common_lib import utils
6
7AUTHOR = "puthik"
8NAME = "MemoryQual.moblab"
9ATTRIBUTES = "suite:memory_qual"
10TIME = "LENGTHY"
11TEST_CATEGORY = "Stress"
12TEST_CLASS = "suite"
13TEST_TYPE = "server"
14EXTENDED_TIMEOUT = 1209600  # 2 weeks
15PY_VERSION = 3
16
17DOC = """
18Sequence for qualification new memory part to AVL.
19"""
20
21HOUR_IN_SECS=60*60
22
23CLIENT_TESTS= [
24    ('platform_MemCheck', {}),
25    ('hardware_RamFio', {
26        'requirements': [('ram_suite', [])]}),
27    ('hardware_MemoryThroughput', {
28        'tag': 'memory_qual', 'test': 'bcopy', 'warmup': 100,
29        'num_iterations': 100, 'parallel': 2,
30        'sizes' : [ 1024, 2048, 4096, 8192,
31                    15360, 16384, 24576,
32                    30720, 32768, 33792,
33                    49152, 65536, 98304,
34                    130048, 131072, 256000,
35                    262144, 393216, 524288,
36                    1048576, 1468006, 1572864,
37                    1966080, 2097152, 2228224,
38                    2621440, 3072000, 3145728,
39                    3276800, 4194304, 8388608,
40                    16777216, 33554432, 67108864]}),
41    ('hardware_MemoryLatency', {
42        'sample_size_kb': [ int(2), int(192), int(1024)]}),
43    ('hardware_Memtester', {
44        'tag' : 'memory_qual', 'loop' : 100}),
45    ('hardware_SAT', {
46        'tag' : 'memory_qual', 'seconds' : 8 * HOUR_IN_SECS}),
47    ('power_MemorySuspend', {
48        'tag' : 'memory_qual', 'num_suspends' : 2}),
49]
50
51CLIENT_X86_TESTS= [
52    ('hardware_UnsafeMemory', {
53        'sec' : 5 * HOUR_IN_SECS}),
54]
55
56SERVER_TESTS= [
57    ('hardware_MemoryIntegrity', {
58        'tag' : 'idle', 'seconds' : HOUR_IN_SECS, 'suspend': False}),
59    ('hardware_MemoryIntegrity', {
60        'tag' : 'suspend', 'seconds' : HOUR_IN_SECS, 'suspend': True}),
61]
62
63def run_client_test(machine):
64    client = hosts.create_host(machine)
65    client_at = autotest.Autotest(client)
66    client_tests = (CLIENT_TESTS + CLIENT_X86_TESTS if client.get_arch() in
67        ('i386', 'i686', 'x86_64') else CLIENT_TESTS)
68    for test, argv in client_tests:
69        client.reboot()
70        client_at.run_test(test, timeout=EXTENDED_TIMEOUT, **argv)
71
72def run_server_test(machine):
73    client = hosts.create_host(machine)
74    for test, argv in SERVER_TESTS:
75        client.reboot()
76        job.run_test(test, client_ip=machine, timeout=EXTENDED_TIMEOUT, **argv)
77
78keyval = dict()
79try:
80    keyval['bug_id'] = bug_id
81    keyval['part_id'] = part_id
82except NameError:
83    # bug_id and/or part_id variables not defined
84    pass
85utils.write_keyval(job.resultdir, keyval)
86
87job.parallel_on_machines(run_client_test, machines)
88parallel_simple(run_server_test, machines)
89