liyujie
2025-08-28 d9927380ed7c8366f762049be9f3fee225860833
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
#!/usr/bin/python
 
# Copyright (C) 2009 The Android Open Source Project
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
#       http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
 
"""Module for generating CTS test descriptions and test plans."""
 
import glob
import os
import re
import shutil
import string
import subprocess
import sys
import xml.dom.minidom as dom
from cts import tools
from multiprocessing import Pool
 
def GetSubDirectories(root):
  """Return all directories under the given root directory."""
  return [x for x in os.listdir(root) if os.path.isdir(os.path.join(root, x))]
 
def ReadFileLines(filePath):
  """Reads a file and returns its contents as a line list."""
  f = open(filePath, 'r');
  lines = [line.strip() for line in f.readlines()]
  f.close()
  return lines
 
def ReadDeqpTestList(testRoot, file):
  """Reads a file, converts test names from deqp to CTS format, and returns
  its contents as a line list.
  """
  REPO_ROOT = os.path.join(testRoot, "../../..")
  f = open(os.path.join(REPO_ROOT, "external/deqp/android/cts", file), 'r');
  lines = [string.join(line.strip().rsplit('.',1),'#') for line in f.readlines()]
  f.close()
  return lines
 
def GetMakeFileVars(makefile_path):
  """Extracts variable definitions from the given make file.
 
  Args:
    makefile_path: Path to the make file.
 
  Returns:
    A dictionary mapping variable names to their assigned value.
  """
  result = {}
  pattern = re.compile(r'^\s*([^:#=\s]+)\s*:=\s*(.*?[^\\])$', re.MULTILINE + re.DOTALL)
  stream = open(makefile_path, 'r')
  content = stream.read()
  for match in pattern.finditer(content):
    result[match.group(1)] = match.group(2)
  stream.close()
  return result
 
 
class CtsBuilder(object):
  """Main class for generating test descriptions and test plans."""
 
  def __init__(self, argv):
    """Initialize the CtsBuilder from command line arguments."""
    if len(argv) != 6:
      print 'Usage: %s <testRoot> <ctsOutputDir> <tempDir> <androidRootDir> <docletPath>' % argv[0]
      print ''
      print 'testRoot:       Directory under which to search for CTS tests.'
      print 'ctsOutputDir:   Directory in which the CTS repository should be created.'
      print 'tempDir:        Directory to use for storing temporary files.'
      print 'androidRootDir: Root directory of the Android source tree.'
      print 'docletPath:     Class path where the DescriptionGenerator doclet can be found.'
      sys.exit(1)
    self.test_root = sys.argv[1]
    self.out_dir = sys.argv[2]
    self.temp_dir = sys.argv[3]
    self.android_root = sys.argv[4]
    self.doclet_path = sys.argv[5]
 
    self.test_repository = os.path.join(self.out_dir, 'repository/testcases')
    self.plan_repository = os.path.join(self.out_dir, 'repository/plans')
    self.definedplans_repository = os.path.join(self.android_root, 'cts/tests/plans')
 
  def GenerateTestDescriptions(self):
    """Generate test descriptions for all packages."""
    pool = Pool(processes=2)
 
    # generate test descriptions for android tests
    results = []
    pool.close()
    pool.join()
    return sum(map(lambda result: result.get(), results))
 
  def __WritePlan(self, plan, plan_name):
    print 'Generating test plan %s' % plan_name
    plan.Write(os.path.join(self.plan_repository, plan_name + '.xml'))
 
  def GenerateTestPlans(self):
    """Generate default test plans."""
    # TODO: Instead of hard-coding the plans here, use a configuration file,
    # such as test_defs.xml
    packages = []
    descriptions = sorted(glob.glob(os.path.join(self.test_repository, '*.xml')))
    for description in descriptions:
      doc = tools.XmlFile(description)
      packages.append(doc.GetAttr('TestPackage', 'appPackageName'))
    # sort the list to give the same sequence based on name
    packages.sort()
 
    plan = tools.TestPlan(packages)
    plan.Exclude('android\.car')
    plan.Exclude('android\.performance.*')
    self.__WritePlan(plan, 'CTS')
    self.__WritePlan(plan, 'CTS-TF')
 
    plan = tools.TestPlan(packages)
    plan.Exclude('android\.car')
    plan.Exclude('android\.performance.*')
    plan.Exclude('android\.media\.cts\.StreamingMediaPlayerTest.*')
    # Test plan to not include media streaming tests
    self.__WritePlan(plan, 'CTS-No-Media-Stream')
 
    plan = tools.TestPlan(packages)
    plan.Exclude('android\.car')
    plan.Exclude('android\.performance.*')
    self.__WritePlan(plan, 'SDK')
 
    plan.Exclude(r'android\.signature')
    plan.Exclude(r'android\.core.*')
    self.__WritePlan(plan, 'Android')
 
    plan = tools.TestPlan(packages)
    plan.Include(r'android\.core\.tests.*')
    plan.Exclude(r'android\.core\.tests\.libcore\.package\.harmony*')
    self.__WritePlan(plan, 'Java')
 
    # TODO: remove this once the tests are fixed and merged into Java plan above.
    plan = tools.TestPlan(packages)
    plan.Include(r'android\.core\.tests\.libcore\.package\.harmony*')
    self.__WritePlan(plan, 'Harmony')
 
    plan = tools.TestPlan(packages)
    plan.Include(r'android\.core\.vm-tests-tf')
    self.__WritePlan(plan, 'VM-TF')
 
    plan = tools.TestPlan(packages)
    plan.Include(r'android\.tests\.appsecurity')
    self.__WritePlan(plan, 'AppSecurity')
 
    # hard-coded white list for PDK plan
    plan.Exclude('.*')
    plan.Include('android\.aadb')
    plan.Include('android\.bluetooth')
    plan.Include('android\.graphics.*')
    plan.Include('android\.hardware')
    plan.Include('android\.media')
    plan.Exclude('android\.mediastress')
    plan.Include('android\.net')
    plan.Include('android\.opengl.*')
    plan.Include('android\.renderscript')
    plan.Include('android\.telephony')
    plan.Include('android\.nativemedia.*')
    plan.Include('com\.android\.cts\..*')#TODO(stuartscott): Should PDK have all these?
    plan.Exclude('android\.car')
    self.__WritePlan(plan, 'PDK')
 
    temporarily_known_failure_tests = BuildCtsTemporarilyKnownFailureList();
    flaky_tests = BuildCtsFlakyTestList()
    releasekey_tests = BuildListForReleaseBuildTest()
 
    # CTS Stable plan
    plan = tools.TestPlan(packages)
    plan.Exclude('android\.car')
    plan.Exclude(r'android\.browser')
    for package, test_list in flaky_tests.iteritems():
      plan.ExcludeTests(package, test_list)
    for package, test_list in releasekey_tests.iteritems():
      plan.ExcludeTests(package, test_list)
    self.__WritePlan(plan, 'CTS-stable')
 
    # CTS Flaky plan - list of tests known to be flaky in lab environment
    plan = tools.TestPlan(packages)
    plan.Exclude('.*')
    plan.Include(r'android\.browser')
    for package, test_list in flaky_tests.iteritems():
      plan.Include(package+'$')
      plan.IncludeTests(package, test_list)
    self.__WritePlan(plan, 'CTS-flaky')
 
    small_tests = BuildAospSmallSizeTestList()
    medium_tests = BuildAospMediumSizeTestList()
    new_test_packages = BuildCtsVettedNewPackagesList()
 
    # CTS - sub plan for public, small size tests
    plan = tools.TestPlan(packages)
    plan.Exclude('.*')
    for package, test_list in small_tests.iteritems():
      plan.Include(package+'$')
    plan.Exclude(r'android\.browser')
    for package, test_list in flaky_tests.iteritems():
      plan.ExcludeTests(package, test_list)
    for package, test_list in releasekey_tests.iteritems():
      plan.ExcludeTests(package, test_list)
    self.__WritePlan(plan, 'CTS-kitkat-small')
    self.__WritePlan(plan, 'CTS-public-small')
 
    # CTS - sub plan for public, medium size tests
    plan = tools.TestPlan(packages)
    plan.Exclude('.*')
    for package, test_list in medium_tests.iteritems():
      plan.Include(package+'$')
    plan.Exclude(r'android\.browser')
    for package, test_list in flaky_tests.iteritems():
      plan.ExcludeTests(package, test_list)
    for package, test_list in releasekey_tests.iteritems():
      plan.ExcludeTests(package, test_list)
    self.__WritePlan(plan, 'CTS-kitkat-medium')
    self.__WritePlan(plan, 'CTS-public-medium')
 
    # CTS - sub plan for hardware tests which is public, large
    plan = tools.TestPlan(packages)
    plan.Exclude('.*')
    plan.Include(r'android\.hardware$')
    plan.Exclude(r'android\.browser')
    for package, test_list in flaky_tests.iteritems():
      plan.ExcludeTests(package, test_list)
    for package, test_list in releasekey_tests.iteritems():
      plan.ExcludeTests(package, test_list)
    self.__WritePlan(plan, 'CTS-hardware')
 
    # CTS - sub plan for camera tests which is public, large
    plan = tools.TestPlan(packages)
    plan.Exclude('.*')
    plan.Include(r'android\.camera$')
    misc_camera_tests = BuildCtsMiscCameraList()
    for package, test_list in misc_camera_tests.iteritems():
      plan.Include(package+'$')
      plan.IncludeTests(package, test_list)
    for package, test_list in flaky_tests.iteritems():
      plan.ExcludeTests(package, test_list)
    for package, test_list in releasekey_tests.iteritems():
      plan.ExcludeTests(package, test_list)
    self.__WritePlan(plan, 'CTS-camera')
 
    # CTS - sub plan for media tests which is public, large
    plan = tools.TestPlan(packages)
    plan.Exclude('.*')
    plan.Include(r'android\.media$')
    plan.Include(r'android\.view$')
    plan.Exclude(r'android\.browser')
    for package, test_list in flaky_tests.iteritems():
      plan.ExcludeTests(package, test_list)
    for package, test_list in releasekey_tests.iteritems():
      plan.ExcludeTests(package, test_list)
    self.__WritePlan(plan, 'CTS-media')
 
    # CTS - sub plan for mediastress tests which is public, large
    plan = tools.TestPlan(packages)
    plan.Exclude('.*')
    plan.Include(r'android\.mediastress$')
    plan.Exclude(r'android\.browser')
    for package, test_list in flaky_tests.iteritems():
      plan.ExcludeTests(package, test_list)
    for package, test_list in releasekey_tests.iteritems():
      plan.ExcludeTests(package, test_list)
    self.__WritePlan(plan, 'CTS-mediastress')
 
    # CTS - sub plan for new tests that is vetted for L launch
    plan = tools.TestPlan(packages)
    plan.Exclude('.*')
    for package, test_list in new_test_packages.iteritems():
      plan.Include(package+'$')
    plan.Exclude(r'android\.browser')
    for package, test_list in flaky_tests.iteritems():
      plan.ExcludeTests(package, test_list)
    for package, test_list in releasekey_tests.iteritems():
      plan.ExcludeTests(package, test_list)
    self.__WritePlan(plan, 'CTS-l-tests')
 
    # CTS - sub plan for tests in drawelement packages
    plan = tools.TestPlan(packages)
    plan.Exclude('.*')
    plan.Include(r'com\.drawelements\.')
    plan.IncludeTests('com.drawelements.deqp.egl', ReadDeqpTestList(self.test_root, 'mnc/egl-master.txt'))
    plan.IncludeTests('com.drawelements.deqp.gles2', ReadDeqpTestList(self.test_root, 'mnc/gles2-master.txt'))
    plan.IncludeTests('com.drawelements.deqp.gles3', ReadDeqpTestList(self.test_root, 'mnc/gles3-master.txt'))
    plan.IncludeTests('com.drawelements.deqp.gles31', ReadDeqpTestList(self.test_root, 'mnc/gles31-master.txt'))
    self.__WritePlan(plan, 'CTS-DEQP')
 
    plan = tools.TestPlan(packages)
    plan.Exclude('.*')
    plan.Include(r'com\.drawelements\.')
    plan.ExcludeTests('com.drawelements.deqp.egl', ReadDeqpTestList(self.test_root, 'mnc/egl-master.txt'))
    plan.ExcludeTests('com.drawelements.deqp.gles2', ReadDeqpTestList(self.test_root, 'mnc/gles2-master.txt'))
    plan.ExcludeTests('com.drawelements.deqp.gles3', ReadDeqpTestList(self.test_root, 'mnc/gles3-master.txt'))
    plan.ExcludeTests('com.drawelements.deqp.gles31', ReadDeqpTestList(self.test_root, 'mnc/gles31-master.txt'))
    self.__WritePlan(plan, 'CTS-DEQP-for-next-rel')
 
    # CTS - sub plan for new test packages added for staging
    plan = tools.TestPlan(packages)
    for package, test_list in small_tests.iteritems():
      plan.Exclude(package+'$')
    for package, test_list in medium_tests.iteritems():
      plan.Exclude(package+'$')
    for package, tests_list in new_test_packages.iteritems():
      plan.Exclude(package+'$')
    plan.Exclude(r'com\.drawelements\.')
    plan.Exclude(r'android\.hardware$')
    plan.Exclude(r'android\.media$')
    plan.Exclude(r'android\.view$')
    plan.Exclude(r'android\.mediastress$')
    plan.Exclude(r'android\.browser')
    plan.Exclude('android\.car')
    for package, test_list in flaky_tests.iteritems():
      plan.ExcludeTests(package, test_list)
    for package, test_list in releasekey_tests.iteritems():
      plan.ExcludeTests(package, test_list)
    self.__WritePlan(plan, 'CTS-m-tests')
 
 
    # CTS - sub plan for new test packages added for staging
    plan = tools.TestPlan(packages)
    plan.Exclude('.*')
    for package, test_list in temporarily_known_failure_tests.iteritems():
      plan.Include(package+'$')
      plan.IncludeTests(package, test_list)
    self.__WritePlan(plan, 'CTS-staging')
 
    plan = tools.TestPlan(packages)
    plan.Exclude('.*')
    self.__WritePlan(plan, 'CTS-webview')
 
    # CTS - sub plan for Security
    plan = tools.TestPlan(packages)
    plan.Exclude('.*')
    plan.Include(r'android\.security$')
    plan.Include('android\.host\.jdwpsecurity$')
    plan.Include('android\.host\.abioverride$')
    self.__WritePlan(plan, 'Security')
 
def BuildAospMediumSizeTestList():
  """ Construct a defaultdic that lists package names of medium tests
      already published to aosp. """
  return {
      'android.app' : [],
      'android.core.tests.libcore.package.libcore' : [],
      'android.core.tests.libcore.package.org' : [],
      'android.core.vm-tests-tf' : [],
      'android.dpi' : [],
      'android.host.security' : [],
      'android.net' : [],
      'android.os' : [],
      'android.permission2' : [],
      'android.security' : [],
      'android.telephony' : [],
      'android.webkit' : [],
      'android.widget' : [],
      'android.browser' : []}
 
def BuildAospSmallSizeTestList():
  """ Construct a default dict that lists packages names of small tests
      already published to aosp. """
  return {
      'android.aadb' : [],
      'android.acceleration' : [],
      'android.accessibility' : [],
      'android.accessibilityservice' : [],
      'android.accounts' : [],
      'android.admin' : [],
      'android.animation' : [],
      'android.appsecurity' : [],
      'android.bionic' : [],
      'android.bluetooth' : [],
      'android.calendarcommon' : [],
      'android.content' : [],
      'android.core.tests.libcore.package.com' : [],
      'android.core.tests.libcore.package.conscrypt' : [],
      'android.core.tests.libcore.package.dalvik' : [],
      'android.core.tests.libcore.package.sun' : [],
      'android.core.tests.libcore.package.tests' : [],
      'android.database' : [],
      'android.dram' : [],
      'android.dreams' : [],
      'android.drm' : [],
      'android.effect' : [],
      'android.filesystem' : [],
      'android.gesture' : [],
      'android.graphics' : [],
      'android.graphics2' : [],
      'android.jni' : [],
      'android.keystore' : [],
      'android.location' : [],
      'android.nativemedia.sl' : [],
      'android.nativemedia.xa' : [],
      'android.ndef' : [],
      'android.opengl' : [],
      'android.openglperf' : [],
      'android.permission' : [],
      'android.preference' : [],
      'android.preference2' : [],
      'android.provider' : [],
      'android.renderscript' : [],
      'android.rscpp' : [],
      'android.rsg' : [],
      'android.sax' : [],
      'android.server' : [],
      'android.signature' : [],
      'android.simplecpu' : [],
      'android.simpleperf' : [],
      'android.speech' : [],
      'android.text' : [],
      'android.textureview' : [],
      'android.theme' : [],
      'android.usb' : [],
      'android.util' : [],
      'android.video' : [],
      'com.android.cts.jank' : [],
      'com.android.cts.jank2' : [],
      'com.android.cts.opengl' : [],
      'com.android.cts.ui' : [],
      'com.android.cts.uihost' : [],
      'zzz.android.monkey' : []}
 
def BuildCtsVettedNewPackagesList():
  """ Construct a defaultdict that maps package names that is vetted for L. """
  return {
      'android.JobScheduler' : [],
      'android.core.tests.libcore.package.harmony_annotation' : [],
      'android.core.tests.libcore.package.harmony_beans' : [],
      'android.core.tests.libcore.package.harmony_java_io' : [],
      'android.core.tests.libcore.package.harmony_java_lang' : [],
      'android.core.tests.libcore.package.harmony_java_math' : [],
      'android.core.tests.libcore.package.harmony_java_net' : [],
      'android.core.tests.libcore.package.harmony_java_nio' : [],
      'android.core.tests.libcore.package.harmony_java_util' : [],
      'android.core.tests.libcore.package.harmony_java_text' : [],
      'android.core.tests.libcore.package.harmony_javax_security' : [],
      'android.core.tests.libcore.package.harmony_logging' : [],
      'android.core.tests.libcore.package.harmony_prefs' : [],
      'android.core.tests.libcore.package.harmony_sql' : [],
      'android.core.tests.libcore.package.jsr166' : [],
      'android.core.tests.libcore.package.okhttp' : [],
      'android.display' : [],
      'android.host.theme' : [],
      'android.jdwp' : [],
      'android.location2' : [],
      'android.print' : [],
      'android.renderscriptlegacy' : [],
      'android.signature' : [],
      'android.tv' : [],
      'android.uiautomation' : [],
      'android.uirendering' : []}
 
def BuildListForReleaseBuildTest():
  """ Construct a defaultdict that maps package name to a list of tests
      that are expected to pass only when running against a user/release-key build. """
  return {
      'android.app' : [
          'android.app.cts.ActivityManagerTest#testIsRunningInTestHarness',],
      'android.dpi' : [
          'android.dpi.cts.DefaultManifestAttributesSdkTest#testPackageHasExpectedSdkVersion',],
      'android.host.security' : [
          'android.cts.security.SELinuxHostTest#testAllEnforcing',
          'android.cts.security.SELinuxHostTest#testSuDomain',],
      'android.os' : [
          'android.os.cts.BuildVersionTest#testReleaseVersion',
          'android.os.cts.BuildTest#testIsSecureUserBuild',],
      'android.security' : [
          'android.security.cts.BannedFilesTest#testNoSu',
          'android.security.cts.BannedFilesTest#testNoSuInPath',
          'android.security.cts.PackageSignatureTest#testPackageSignatures',
          'android.security.cts.SELinuxDomainTest#testSuDomain',],
      '' : []}
 
def BuildCtsFlakyTestList():
  """ Construct a defaultdict that maps package name to a list of tests
      that flaky during dev cycle and cause other subsequent tests to fail. """
  return {
      'android.camera' : [
          'android.hardware.cts.CameraTest#testVideoSnapshot',
          'android.hardware.cts.CameraGLTest#testCameraToSurfaceTextureMetadata',
          'android.hardware.cts.CameraGLTest#testSetPreviewTextureBothCallbacks',
          'android.hardware.cts.CameraGLTest#testSetPreviewTexturePreviewCallback',],
      'android.media' : [
          'android.media.cts.DecoderTest#testCodecResetsH264WithSurface',
          'android.media.cts.StreamingMediaPlayerTest#testHLS',],
      'android.net' : [
          'android.net.cts.ConnectivityManagerTest#testStartUsingNetworkFeature_enableHipri',
          'android.net.cts.DnsTest#testDnsWorks',
          'android.net.cts.SSLCertificateSocketFactoryTest#testCreateSocket',
          'android.net.cts.SSLCertificateSocketFactoryTest#test_createSocket_bind',
          'android.net.cts.SSLCertificateSocketFactoryTest#test_createSocket_simple',
          'android.net.cts.SSLCertificateSocketFactoryTest#test_createSocket_wrapping',
          'android.net.cts.TrafficStatsTest#testTrafficStatsForLocalhost',
          'android.net.wifi.cts.NsdManagerTest#testAndroidTestCaseSetupProperly',],
      'android.security' : [
          'android.security.cts.ListeningPortsTest#testNoRemotelyAccessibleListeningUdp6Ports',
          'android.security.cts.ListeningPortsTest#testNoRemotelyAccessibleListeningUdpPorts',],
      'android.webkit' : [
          'android.webkit.cts.WebViewClientTest#testOnUnhandledKeyEvent',],
      'com.android.cts.filesystemperf' : [
          'com.android.cts.filesystemperf.RandomRWTest#testRandomRead',
          'com.android.cts.filesystemperf.RandomRWTest#testRandomUpdate',],
      '' : []}
 
def BuildCtsTemporarilyKnownFailureList():
  """ Construct a defaultdict that maps package name to a list of tests
      that are known failures during dev cycle but expected to be fixed before launch """
  return {
      'android.alarmclock' : [
          'android.alarmclock.cts.DismissAlarmTest#testAll',
          'android.alarmclock.cts.SetAlarmTest#testAll',
          'android.alarmclock.cts.SnoozeAlarmTest#testAll',
      ],
      'android.dumpsys' : [
          'android.dumpsys.cts.DumpsysHostTest#testBatterystatsOutput',
          'android.dumpsys.cts.DumpsysHostTest#testGfxinfoFramestats',
      ],
      'android.telecom' : [
          'android.telecom.cts.ExtendedInCallServiceTest#testAddNewOutgoingCallAndThenDisconnect',
          'android.telecom.cts.RemoteConferenceTest#testRemoteConferenceCallbacks_ConferenceableConnections',
      ],
      'android.transition' : [
          'android.transition.cts.ChangeScrollTest#testChangeScroll',
      ],
      'android.voicesettings' : [
          'android.voicesettings.cts.ZenModeTest#testAll',
      ],
      'android.systemui.cts' : [
          'android.systemui.cts.LightStatusBarTests#testLightStatusBarIcons',
      ],
      'com.android.cts.app.os' : [
          'com.android.cts.app.os.OsHostTests#testNonExportedActivities',
      ],
      'com.android.cts.devicepolicy' : [
          'com.android.cts.devicepolicy.MixedDeviceOwnerTest#testPackageInstallUserRestrictions',
          'com.android.cts.devicepolicy.MixedProfileOwnerTest#testPackageInstallUserRestrictions',
      ],
      '' : []}
 
def BuildCtsMiscCameraList():
  """ Construct a defaultdict that maps package name to a list of tests
      that are relevant to camera but does not reside in camera test package """
  return {
      'android.app' : [
          'android.app.cts.SystemFeaturesTest#testCameraFeatures',
      ],
      'android.permission' : [
          'android.permission.cts.CameraPermissionTest',
          'android.permission.cts.Camera2PermissionTest',
      ],
      '' : []}
 
def LogGenerateDescription(name):
  print 'Generating test description for package %s' % name
 
if __name__ == '__main__':
  builder = CtsBuilder(sys.argv)
  result = builder.GenerateTestDescriptions()
  if result != 0:
    sys.exit(result)
  builder.GenerateTestPlans()