Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(6)

Side by Side Diff: tests/abi_corpus/corpus_errors.py

Issue 9950041: Adding a startup regression test. (Closed) Base URL: svn://svn.chromium.org/native_client/trunk/src/native_client
Patch Set: rename reshuffle Created 8 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « buildbot/buildbot_standard.py ('k') | tests/abi_corpus/corpus_utils.py » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
(Empty)
1 #!/usr/bin/python
2 # Copyright (c) 2012 The Native Client Authors. All rights reserved.
3 # Use of this source code is governed by a BSD-style license that can be
4 # found in the LICENSE file.
5
6 """A list of known bad NEXEs and CRXs in the corpus."""
7
8 import corpus_utils
9
10
11 # Sha1s of known non-validating NEXEs in the corpus.
12 BAD_NEXES = set([
13 '1c2b051cb60367cf103128c9cd76769ffa1cf356',
14 ])
15
16
17 class CrxResult(object):
18 def __init__(self, id, custom=None, precidence=1):
19 self.id = id
20 self.custom = custom
21 self.precidence = precidence
22
23 def __str__(self):
24 return "corpus_errors.CrxResult('%s', custom='%s')" % (
25 self.id, self.custom)
26
27 def Matches(self, other):
28 return (self.id == other.id and
29 self.custom == other.custom and
30 self.precidence == other.precidence)
31
32 def Merge(self, other):
33 if other.precidence > self.precidence:
34 return other
35 else:
36 return self
37
38
39 # Common result types.
40 GOOD = CrxResult('GOOD', precidence=0)
41 MODULE_DIDNT_START = CrxResult('nacl module not started', precidence=2)
42 MODULE_CRASHED = CrxResult('nacl module crashed', precidence=3)
43 BAD_MANIFEST = CrxResult('BAD MANIFEST!', precidence=4)
44 COULD_NOT_LOAD = CrxResult('could not load', precidence=5)
45
46 # Mapping of sha1 to expected result for known bad CRXs.
47 BAD_CRXS = {
48 # Bad manifest
49 '0937b653af5553856532454ec340d0e0075bc0b4': BAD_MANIFEST,
50 '09ffe3793113fe564b71800a5844189c00bd8210': BAD_MANIFEST,
51 '14f389a8c406d60e0fc05a1ec0189a652a1f006e': BAD_MANIFEST,
52 '2f97cec9f13b0f774d1f49490f26f32213e4e0a5': BAD_MANIFEST,
53 '3d6832749c8c1346c65b30f4b191930dec5f04a3': BAD_MANIFEST,
54 '612a5aaa821b4b636168025f027e721c0f046e7c': BAD_MANIFEST,
55 '81a4a3de69dd4ad169b1d4a7268b44c78ea5ffa8': BAD_MANIFEST,
56 '8249dc3bafb983b82a588df97b2f92621a3556c1': BAD_MANIFEST,
57 '9afa2fc3dcfef799e6371013a245d083f1a66101': BAD_MANIFEST,
58 'a8aa42d699dbef3e1403e4fdc49325e89a91f653': BAD_MANIFEST,
59 'c6d40d4f3c8dccc710d8c09bfd074b2d20a504d2': BAD_MANIFEST,
60 'ced1fea90b71b0a8da08c1a1e6cb35975cc84f52': BAD_MANIFEST,
61 # No nacl module
62 '12e167d935a1f339a37b223b545d6f7ed7b474f7': MODULE_DIDNT_START,
63 '23eaab8e1ac0fad4f943c1e3c1664a392a316a34': MODULE_DIDNT_START,
64 '48ac71edfeac0c79d5e2b651e082abfa76da25f9': MODULE_DIDNT_START,
65 '57be161e5ff7011d2283e507a70f9005c448002b': MODULE_DIDNT_START,
66 '5b9f0f7f7401cb666015090908d97346f5b6bccb': MODULE_DIDNT_START,
67 '6f912a0c7d6d762c2df2ac42893328a2fb357c42': MODULE_DIDNT_START,
68 '76dd4cb33ebdeb26e80a5e1105e9c306ec17efc9': MODULE_DIDNT_START,
69 '78bbafcec8832252b0e694cc0c9387a68fac5299': MODULE_DIDNT_START,
70 '8f1dcad3539281ea66857f36059b8085d3dfc37e': MODULE_DIDNT_START,
71 'c188ce67e32c8a8ca9543875a35078b36f2b02a5': MODULE_DIDNT_START,
72 'cfd62adf6790eed0520da2deb2246fc02e70c57e': MODULE_DIDNT_START,
73 'd1f33ad38f9f6e78150d30c2103b5c77a9f0adcd': MODULE_DIDNT_START,
74 'd51802b12a503f7fdfbec60d96e27a5ffa09d002': MODULE_DIDNT_START,
75 # Nacl module crash
76 'ab0692192976dc6693212582364c6f23b6551d1a': MODULE_CRASHED,
77 'b458cd57c8b4e6c313b18f370fad59779f573afc': MODULE_CRASHED,
78 # Could not load extension.
79 '1f861c0d8c173b64df3e70cfa1a5cd710ba59430': COULD_NOT_LOAD,
80 '4beecff67651f13e013c12a5bf3661041ded323c': COULD_NOT_LOAD,
81 '8de65668cc7280ffb70ffd2fa5b2a22112156966': COULD_NOT_LOAD,
82 }
83
84
85 def NexeShouldValidate(path):
86 """Checks a blacklist to decide if a nexe should validate.
87
88 Args:
89 path: path to the nexe.
90 Returns:
91 Boolean indicating if the nexe should validate.
92 """
93 return corpus_utils.Sha1FromFilename(path) not in BAD_NEXES
94
95
96 def ExpectedCrxResult(path):
97 """Checks what the expected result for this app is.
98
99 Args:
100 path: path to the crx.
101 Returns:
102 Reg-ex that matches the expected status.
103 """
104 return BAD_CRXS.get(corpus_utils.Sha1FromFilename(path), GOOD)
OLDNEW
« no previous file with comments | « buildbot/buildbot_standard.py ('k') | tests/abi_corpus/corpus_utils.py » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698