diff options
Diffstat (limited to 'scripts')
-rwxr-xr-x | scripts/contrib/devtool-stress.py | 57 |
1 files changed, 35 insertions, 22 deletions
diff --git a/scripts/contrib/devtool-stress.py b/scripts/contrib/devtool-stress.py index ab77a2d1f6..5fff257f10 100755 --- a/scripts/contrib/devtool-stress.py +++ b/scripts/contrib/devtool-stress.py | |||
@@ -121,14 +121,18 @@ def stress_extract(args): | |||
121 | sys.stdout.write('Testing %s ' % (pn + ' ').ljust(40, '.')) | 121 | sys.stdout.write('Testing %s ' % (pn + ' ').ljust(40, '.')) |
122 | sys.stdout.flush() | 122 | sys.stdout.flush() |
123 | failed = False | 123 | failed = False |
124 | skipped = None | ||
124 | 125 | ||
125 | srctree = os.path.join(tmpdir, pn) | 126 | srctree = os.path.join(tmpdir, pn) |
126 | try: | 127 | try: |
127 | bb.process.run('devtool extract %s %s' % (pn, srctree)) | 128 | bb.process.run('devtool extract %s %s' % (pn, srctree)) |
128 | except bb.process.CmdError as exc: | 129 | except bb.process.ExecutionError as exc: |
129 | failed = True | 130 | if exc.exitcode == 4: |
130 | with open('stress_%s_extract.log' % pn, 'w') as f: | 131 | skipped = 'incompatible' |
131 | f.write(str(exc)) | 132 | else: |
133 | failed = True | ||
134 | with open('stress_%s_extract.log' % pn, 'w') as f: | ||
135 | f.write(str(exc)) | ||
132 | 136 | ||
133 | if os.path.exists(srctree): | 137 | if os.path.exists(srctree): |
134 | shutil.rmtree(srctree) | 138 | shutil.rmtree(srctree) |
@@ -136,6 +140,8 @@ def stress_extract(args): | |||
136 | if failed: | 140 | if failed: |
137 | print('failed') | 141 | print('failed') |
138 | failures += 1 | 142 | failures += 1 |
143 | elif skipped: | ||
144 | print('skipped (%s)' % skipped) | ||
139 | else: | 145 | else: |
140 | print('ok') | 146 | print('ok') |
141 | except KeyboardInterrupt: | 147 | except KeyboardInterrupt: |
@@ -162,29 +168,34 @@ def stress_modify(args): | |||
162 | sys.stdout.flush() | 168 | sys.stdout.flush() |
163 | failed = False | 169 | failed = False |
164 | reset = True | 170 | reset = True |
171 | skipped = None | ||
165 | 172 | ||
166 | srctree = os.path.join(tmpdir, pn) | 173 | srctree = os.path.join(tmpdir, pn) |
167 | try: | 174 | try: |
168 | bb.process.run('devtool modify -x %s %s' % (pn, srctree)) | 175 | bb.process.run('devtool modify -x %s %s' % (pn, srctree)) |
169 | except bb.process.CmdError as exc: | 176 | except bb.process.ExecutionError as exc: |
170 | with open('stress_%s_modify.log' % pn, 'w') as f: | 177 | if exc.exitcode == 4: |
171 | f.write(str(exc)) | 178 | skipped = 'incompatible' |
172 | failed = 'modify' | 179 | else: |
173 | reset = False | 180 | with open('stress_%s_modify.log' % pn, 'w') as f: |
174 | |||
175 | if not failed: | ||
176 | try: | ||
177 | bb.process.run('bitbake -c install %s' % pn) | ||
178 | except bb.process.CmdError as exc: | ||
179 | with open('stress_%s_install.log' % pn, 'w') as f: | ||
180 | f.write(str(exc)) | 181 | f.write(str(exc)) |
181 | failed = 'build' | 182 | failed = 'modify' |
182 | if reset: | 183 | reset = False |
183 | try: | 184 | |
184 | bb.process.run('devtool reset %s' % pn) | 185 | if not skipped: |
185 | except bb.process.CmdError as exc: | 186 | if not failed: |
186 | print('devtool reset failed: %s' % str(exc)) | 187 | try: |
187 | break | 188 | bb.process.run('bitbake -c install %s' % pn) |
189 | except bb.process.CmdError as exc: | ||
190 | with open('stress_%s_install.log' % pn, 'w') as f: | ||
191 | f.write(str(exc)) | ||
192 | failed = 'build' | ||
193 | if reset: | ||
194 | try: | ||
195 | bb.process.run('devtool reset %s' % pn) | ||
196 | except bb.process.CmdError as exc: | ||
197 | print('devtool reset failed: %s' % str(exc)) | ||
198 | break | ||
188 | 199 | ||
189 | if os.path.exists(srctree): | 200 | if os.path.exists(srctree): |
190 | shutil.rmtree(srctree) | 201 | shutil.rmtree(srctree) |
@@ -192,6 +203,8 @@ def stress_modify(args): | |||
192 | if failed: | 203 | if failed: |
193 | print('failed (%s)' % failed) | 204 | print('failed (%s)' % failed) |
194 | failures += 1 | 205 | failures += 1 |
206 | elif skipped: | ||
207 | print('skipped (%s)' % skipped) | ||
195 | else: | 208 | else: |
196 | print('ok') | 209 | print('ok') |
197 | except KeyboardInterrupt: | 210 | except KeyboardInterrupt: |