Greg Kroah-Hartman | b244131 | 2017-11-01 15:07:57 +0100 | [diff] [blame] | 1 | # SPDX-License-Identifier: GPL-2.0 |
Jiri Olsa | 52502bf | 2012-10-31 15:52:47 +0100 | [diff] [blame] | 2 | |
Tony Jones | 35ea7e4 | 2019-01-23 16:52:29 -0800 | [diff] [blame] | 3 | from __future__ import print_function |
| 4 | |
Jiri Olsa | 52502bf | 2012-10-31 15:52:47 +0100 | [diff] [blame] | 5 | import os |
| 6 | import sys |
| 7 | import glob |
| 8 | import optparse |
| 9 | import tempfile |
| 10 | import logging |
| 11 | import shutil |
Tony Jones | 35ea7e4 | 2019-01-23 16:52:29 -0800 | [diff] [blame] | 12 | |
| 13 | try: |
| 14 | import configparser |
| 15 | except ImportError: |
| 16 | import ConfigParser as configparser |
Jiri Olsa | 52502bf | 2012-10-31 15:52:47 +0100 | [diff] [blame] | 17 | |
Jiri Olsa | dde622a | 2017-07-03 16:50:20 +0200 | [diff] [blame] | 18 | def data_equal(a, b): |
Jiri Olsa | 04c31bc | 2017-07-03 16:50:19 +0200 | [diff] [blame] | 19 | # Allow multiple values in assignment separated by '|' |
| 20 | a_list = a.split('|') |
| 21 | b_list = b.split('|') |
| 22 | |
| 23 | for a_item in a_list: |
| 24 | for b_item in b_list: |
| 25 | if (a_item == b_item): |
| 26 | return True |
| 27 | elif (a_item == '*') or (b_item == '*'): |
| 28 | return True |
| 29 | |
| 30 | return False |
| 31 | |
Jiri Olsa | 52502bf | 2012-10-31 15:52:47 +0100 | [diff] [blame] | 32 | class Fail(Exception): |
| 33 | def __init__(self, test, msg): |
| 34 | self.msg = msg |
| 35 | self.test = test |
| 36 | def getMsg(self): |
| 37 | return '\'%s\' - %s' % (self.test.path, self.msg) |
| 38 | |
Thomas Richter | 19508c0 | 2017-06-22 09:36:25 +0200 | [diff] [blame] | 39 | class Notest(Exception): |
| 40 | def __init__(self, test, arch): |
| 41 | self.arch = arch |
| 42 | self.test = test |
| 43 | def getMsg(self): |
| 44 | return '[%s] \'%s\'' % (self.arch, self.test.path) |
| 45 | |
Jiri Olsa | 52502bf | 2012-10-31 15:52:47 +0100 | [diff] [blame] | 46 | class Unsup(Exception): |
| 47 | def __init__(self, test): |
| 48 | self.test = test |
| 49 | def getMsg(self): |
| 50 | return '\'%s\'' % self.test.path |
| 51 | |
| 52 | class Event(dict): |
| 53 | terms = [ |
Jiri Olsa | c21d003 | 2013-02-25 10:52:50 +0100 | [diff] [blame] | 54 | 'cpu', |
Jiri Olsa | 52502bf | 2012-10-31 15:52:47 +0100 | [diff] [blame] | 55 | 'flags', |
| 56 | 'type', |
| 57 | 'size', |
| 58 | 'config', |
| 59 | 'sample_period', |
| 60 | 'sample_type', |
| 61 | 'read_format', |
| 62 | 'disabled', |
| 63 | 'inherit', |
| 64 | 'pinned', |
| 65 | 'exclusive', |
| 66 | 'exclude_user', |
| 67 | 'exclude_kernel', |
| 68 | 'exclude_hv', |
| 69 | 'exclude_idle', |
| 70 | 'mmap', |
| 71 | 'comm', |
| 72 | 'freq', |
| 73 | 'inherit_stat', |
| 74 | 'enable_on_exec', |
| 75 | 'task', |
Jiri Olsa | 45e4089 | 2012-11-05 16:49:38 +0100 | [diff] [blame] | 76 | 'watermark', |
Jiri Olsa | 52502bf | 2012-10-31 15:52:47 +0100 | [diff] [blame] | 77 | 'precise_ip', |
| 78 | 'mmap_data', |
| 79 | 'sample_id_all', |
| 80 | 'exclude_host', |
| 81 | 'exclude_guest', |
| 82 | 'exclude_callchain_kernel', |
| 83 | 'exclude_callchain_user', |
| 84 | 'wakeup_events', |
| 85 | 'bp_type', |
| 86 | 'config1', |
| 87 | 'config2', |
| 88 | 'branch_sample_type', |
| 89 | 'sample_regs_user', |
| 90 | 'sample_stack_user', |
| 91 | ] |
| 92 | |
| 93 | def add(self, data): |
| 94 | for key, val in data: |
| 95 | log.debug(" %s = %s" % (key, val)) |
| 96 | self[key] = val |
| 97 | |
| 98 | def __init__(self, name, data, base): |
Arnaldo Carvalho de Melo | ce90e38 | 2012-12-18 14:14:24 -0300 | [diff] [blame] | 99 | log.debug(" Event %s" % name); |
Jiri Olsa | 52502bf | 2012-10-31 15:52:47 +0100 | [diff] [blame] | 100 | self.name = name; |
| 101 | self.group = '' |
| 102 | self.add(base) |
| 103 | self.add(data) |
| 104 | |
Jiri Olsa | 52502bf | 2012-10-31 15:52:47 +0100 | [diff] [blame] | 105 | def equal(self, other): |
| 106 | for t in Event.terms: |
| 107 | log.debug(" [%s] %s %s" % (t, self[t], other[t])); |
Tony Jones | 35ea7e4 | 2019-01-23 16:52:29 -0800 | [diff] [blame] | 108 | if t not in self or t not in other: |
Jiri Olsa | 52502bf | 2012-10-31 15:52:47 +0100 | [diff] [blame] | 109 | return False |
Jiri Olsa | dde622a | 2017-07-03 16:50:20 +0200 | [diff] [blame] | 110 | if not data_equal(self[t], other[t]): |
Jiri Olsa | 52502bf | 2012-10-31 15:52:47 +0100 | [diff] [blame] | 111 | return False |
| 112 | return True |
| 113 | |
Jiri Olsa | 1f41873 | 2017-07-03 16:50:29 +0200 | [diff] [blame] | 114 | def optional(self): |
Tony Jones | 35ea7e4 | 2019-01-23 16:52:29 -0800 | [diff] [blame] | 115 | if 'optional' in self and self['optional'] == '1': |
Jiri Olsa | 1f41873 | 2017-07-03 16:50:29 +0200 | [diff] [blame] | 116 | return True |
| 117 | return False |
| 118 | |
Arnaldo Carvalho de Melo | ce90e38 | 2012-12-18 14:14:24 -0300 | [diff] [blame] | 119 | def diff(self, other): |
| 120 | for t in Event.terms: |
Tony Jones | 35ea7e4 | 2019-01-23 16:52:29 -0800 | [diff] [blame] | 121 | if t not in self or t not in other: |
Arnaldo Carvalho de Melo | ce90e38 | 2012-12-18 14:14:24 -0300 | [diff] [blame] | 122 | continue |
Jiri Olsa | dde622a | 2017-07-03 16:50:20 +0200 | [diff] [blame] | 123 | if not data_equal(self[t], other[t]): |
Adrian Hunter | 741dad8 | 2018-11-22 16:04:56 +0200 | [diff] [blame] | 124 | log.warning("expected %s=%s, got %s" % (t, self[t], other[t])) |
Arnaldo Carvalho de Melo | ce90e38 | 2012-12-18 14:14:24 -0300 | [diff] [blame] | 125 | |
Jiri Olsa | 8dfec40 | 2012-11-05 16:49:39 +0100 | [diff] [blame] | 126 | # Test file description needs to have following sections: |
| 127 | # [config] |
| 128 | # - just single instance in file |
| 129 | # - needs to specify: |
| 130 | # 'command' - perf command name |
| 131 | # 'args' - special command arguments |
| 132 | # 'ret' - expected command return value (0 by default) |
Thomas Richter | 19508c0 | 2017-06-22 09:36:25 +0200 | [diff] [blame] | 133 | # 'arch' - architecture specific test (optional) |
| 134 | # comma separated list, ! at the beginning |
| 135 | # negates it. |
Jiri Olsa | 8dfec40 | 2012-11-05 16:49:39 +0100 | [diff] [blame] | 136 | # |
| 137 | # [eventX:base] |
| 138 | # - one or multiple instances in file |
| 139 | # - expected values assignments |
Jiri Olsa | 52502bf | 2012-10-31 15:52:47 +0100 | [diff] [blame] | 140 | class Test(object): |
| 141 | def __init__(self, path, options): |
Tony Jones | 35ea7e4 | 2019-01-23 16:52:29 -0800 | [diff] [blame] | 142 | parser = configparser.SafeConfigParser() |
Jiri Olsa | 52502bf | 2012-10-31 15:52:47 +0100 | [diff] [blame] | 143 | parser.read(path) |
| 144 | |
Jiri Olsa | 097c875 | 2013-02-25 10:52:49 +0100 | [diff] [blame] | 145 | log.warning("running '%s'" % path) |
Jiri Olsa | 52502bf | 2012-10-31 15:52:47 +0100 | [diff] [blame] | 146 | |
| 147 | self.path = path |
| 148 | self.test_dir = options.test_dir |
| 149 | self.perf = options.perf |
| 150 | self.command = parser.get('config', 'command') |
| 151 | self.args = parser.get('config', 'args') |
| 152 | |
| 153 | try: |
| 154 | self.ret = parser.get('config', 'ret') |
| 155 | except: |
| 156 | self.ret = 0 |
| 157 | |
Thomas Richter | 19508c0 | 2017-06-22 09:36:25 +0200 | [diff] [blame] | 158 | try: |
| 159 | self.arch = parser.get('config', 'arch') |
| 160 | log.warning("test limitation '%s'" % self.arch) |
| 161 | except: |
| 162 | self.arch = '' |
| 163 | |
Jiri Olsa | 52502bf | 2012-10-31 15:52:47 +0100 | [diff] [blame] | 164 | self.expect = {} |
| 165 | self.result = {} |
Arnaldo Carvalho de Melo | ce90e38 | 2012-12-18 14:14:24 -0300 | [diff] [blame] | 166 | log.debug(" loading expected events"); |
Jiri Olsa | 52502bf | 2012-10-31 15:52:47 +0100 | [diff] [blame] | 167 | self.load_events(path, self.expect) |
| 168 | |
| 169 | def is_event(self, name): |
| 170 | if name.find("event") == -1: |
| 171 | return False |
| 172 | else: |
| 173 | return True |
| 174 | |
Thomas Richter | 19508c0 | 2017-06-22 09:36:25 +0200 | [diff] [blame] | 175 | def skip_test(self, myarch): |
| 176 | # If architecture not set always run test |
| 177 | if self.arch == '': |
| 178 | # log.warning("test for arch %s is ok" % myarch) |
| 179 | return False |
| 180 | |
| 181 | # Allow multiple values in assignment separated by ',' |
| 182 | arch_list = self.arch.split(',') |
| 183 | |
| 184 | # Handle negated list such as !s390x,ppc |
| 185 | if arch_list[0][0] == '!': |
| 186 | arch_list[0] = arch_list[0][1:] |
| 187 | log.warning("excluded architecture list %s" % arch_list) |
| 188 | for arch_item in arch_list: |
| 189 | # log.warning("test for %s arch is %s" % (arch_item, myarch)) |
| 190 | if arch_item == myarch: |
| 191 | return True |
| 192 | return False |
| 193 | |
| 194 | for arch_item in arch_list: |
| 195 | # log.warning("test for architecture '%s' current '%s'" % (arch_item, myarch)) |
| 196 | if arch_item == myarch: |
| 197 | return False |
| 198 | return True |
| 199 | |
Jiri Olsa | 52502bf | 2012-10-31 15:52:47 +0100 | [diff] [blame] | 200 | def load_events(self, path, events): |
Tony Jones | 35ea7e4 | 2019-01-23 16:52:29 -0800 | [diff] [blame] | 201 | parser_event = configparser.SafeConfigParser() |
Jiri Olsa | 52502bf | 2012-10-31 15:52:47 +0100 | [diff] [blame] | 202 | parser_event.read(path) |
| 203 | |
Jiri Olsa | 8dfec40 | 2012-11-05 16:49:39 +0100 | [diff] [blame] | 204 | # The event record section header contains 'event' word, |
| 205 | # optionaly followed by ':' allowing to load 'parent |
| 206 | # event' first as a base |
Jiri Olsa | 52502bf | 2012-10-31 15:52:47 +0100 | [diff] [blame] | 207 | for section in filter(self.is_event, parser_event.sections()): |
| 208 | |
| 209 | parser_items = parser_event.items(section); |
| 210 | base_items = {} |
| 211 | |
Jiri Olsa | 8dfec40 | 2012-11-05 16:49:39 +0100 | [diff] [blame] | 212 | # Read parent event if there's any |
Jiri Olsa | 52502bf | 2012-10-31 15:52:47 +0100 | [diff] [blame] | 213 | if (':' in section): |
| 214 | base = section[section.index(':') + 1:] |
Tony Jones | 35ea7e4 | 2019-01-23 16:52:29 -0800 | [diff] [blame] | 215 | parser_base = configparser.SafeConfigParser() |
Jiri Olsa | 52502bf | 2012-10-31 15:52:47 +0100 | [diff] [blame] | 216 | parser_base.read(self.test_dir + '/' + base) |
| 217 | base_items = parser_base.items('event') |
| 218 | |
| 219 | e = Event(section, parser_items, base_items) |
| 220 | events[section] = e |
| 221 | |
| 222 | def run_cmd(self, tempdir): |
Thomas Richter | 19508c0 | 2017-06-22 09:36:25 +0200 | [diff] [blame] | 223 | junk1, junk2, junk3, junk4, myarch = (os.uname()) |
| 224 | |
| 225 | if self.skip_test(myarch): |
| 226 | raise Notest(self, myarch) |
| 227 | |
Jiri Olsa | 52502bf | 2012-10-31 15:52:47 +0100 | [diff] [blame] | 228 | cmd = "PERF_TEST_ATTR=%s %s %s -o %s/perf.data %s" % (tempdir, |
| 229 | self.perf, self.command, tempdir, self.args) |
| 230 | ret = os.WEXITSTATUS(os.system(cmd)) |
| 231 | |
Jiri Olsa | 04c31bc | 2017-07-03 16:50:19 +0200 | [diff] [blame] | 232 | log.info(" '%s' ret '%s', expected '%s'" % (cmd, str(ret), str(self.ret))) |
Jiri Olsa | 52502bf | 2012-10-31 15:52:47 +0100 | [diff] [blame] | 233 | |
Jiri Olsa | dde622a | 2017-07-03 16:50:20 +0200 | [diff] [blame] | 234 | if not data_equal(str(ret), str(self.ret)): |
Jiri Olsa | 52502bf | 2012-10-31 15:52:47 +0100 | [diff] [blame] | 235 | raise Unsup(self) |
| 236 | |
| 237 | def compare(self, expect, result): |
| 238 | match = {} |
| 239 | |
Arnaldo Carvalho de Melo | ce90e38 | 2012-12-18 14:14:24 -0300 | [diff] [blame] | 240 | log.debug(" compare"); |
Jiri Olsa | 52502bf | 2012-10-31 15:52:47 +0100 | [diff] [blame] | 241 | |
| 242 | # For each expected event find all matching |
| 243 | # events in result. Fail if there's not any. |
| 244 | for exp_name, exp_event in expect.items(): |
| 245 | exp_list = [] |
Thomas Richter | 3440fe2 | 2017-09-13 10:12:08 +0200 | [diff] [blame] | 246 | res_event = {} |
Jiri Olsa | 52502bf | 2012-10-31 15:52:47 +0100 | [diff] [blame] | 247 | log.debug(" matching [%s]" % exp_name) |
| 248 | for res_name, res_event in result.items(): |
| 249 | log.debug(" to [%s]" % res_name) |
| 250 | if (exp_event.equal(res_event)): |
| 251 | exp_list.append(res_name) |
| 252 | log.debug(" ->OK") |
| 253 | else: |
| 254 | log.debug(" ->FAIL"); |
| 255 | |
Arnaldo Carvalho de Melo | ce90e38 | 2012-12-18 14:14:24 -0300 | [diff] [blame] | 256 | log.debug(" match: [%s] matches %s" % (exp_name, str(exp_list))) |
Jiri Olsa | 52502bf | 2012-10-31 15:52:47 +0100 | [diff] [blame] | 257 | |
| 258 | # we did not any matching event - fail |
Jiri Olsa | 1f41873 | 2017-07-03 16:50:29 +0200 | [diff] [blame] | 259 | if not exp_list: |
| 260 | if exp_event.optional(): |
| 261 | log.debug(" %s does not match, but is optional" % exp_name) |
| 262 | else: |
Thomas Richter | 3440fe2 | 2017-09-13 10:12:08 +0200 | [diff] [blame] | 263 | if not res_event: |
| 264 | log.debug(" res_event is empty"); |
| 265 | else: |
| 266 | exp_event.diff(res_event) |
Jiri Olsa | 1f41873 | 2017-07-03 16:50:29 +0200 | [diff] [blame] | 267 | raise Fail(self, 'match failure'); |
Jiri Olsa | 52502bf | 2012-10-31 15:52:47 +0100 | [diff] [blame] | 268 | |
| 269 | match[exp_name] = exp_list |
| 270 | |
| 271 | # For each defined group in the expected events |
| 272 | # check we match the same group in the result. |
| 273 | for exp_name, exp_event in expect.items(): |
| 274 | group = exp_event.group |
| 275 | |
| 276 | if (group == ''): |
| 277 | continue |
| 278 | |
Jiri Olsa | 52502bf | 2012-10-31 15:52:47 +0100 | [diff] [blame] | 279 | for res_name in match[exp_name]: |
| 280 | res_group = result[res_name].group |
| 281 | if res_group not in match[group]: |
| 282 | raise Fail(self, 'group failure') |
| 283 | |
Arnaldo Carvalho de Melo | ce90e38 | 2012-12-18 14:14:24 -0300 | [diff] [blame] | 284 | log.debug(" group: [%s] matches group leader %s" % |
Jiri Olsa | 52502bf | 2012-10-31 15:52:47 +0100 | [diff] [blame] | 285 | (exp_name, str(match[group]))) |
| 286 | |
Arnaldo Carvalho de Melo | ce90e38 | 2012-12-18 14:14:24 -0300 | [diff] [blame] | 287 | log.debug(" matched") |
Jiri Olsa | 52502bf | 2012-10-31 15:52:47 +0100 | [diff] [blame] | 288 | |
| 289 | def resolve_groups(self, events): |
| 290 | for name, event in events.items(): |
| 291 | group_fd = event['group_fd']; |
| 292 | if group_fd == '-1': |
| 293 | continue; |
| 294 | |
| 295 | for iname, ievent in events.items(): |
| 296 | if (ievent['fd'] == group_fd): |
| 297 | event.group = iname |
| 298 | log.debug('[%s] has group leader [%s]' % (name, iname)) |
| 299 | break; |
| 300 | |
| 301 | def run(self): |
| 302 | tempdir = tempfile.mkdtemp(); |
| 303 | |
Jiri Olsa | d4fcf0a | 2012-11-08 17:01:01 +0100 | [diff] [blame] | 304 | try: |
| 305 | # run the test script |
| 306 | self.run_cmd(tempdir); |
Jiri Olsa | 52502bf | 2012-10-31 15:52:47 +0100 | [diff] [blame] | 307 | |
Jiri Olsa | d4fcf0a | 2012-11-08 17:01:01 +0100 | [diff] [blame] | 308 | # load events expectation for the test |
Arnaldo Carvalho de Melo | ce90e38 | 2012-12-18 14:14:24 -0300 | [diff] [blame] | 309 | log.debug(" loading result events"); |
Jiri Olsa | d4fcf0a | 2012-11-08 17:01:01 +0100 | [diff] [blame] | 310 | for f in glob.glob(tempdir + '/event*'): |
| 311 | self.load_events(f, self.result); |
Jiri Olsa | 52502bf | 2012-10-31 15:52:47 +0100 | [diff] [blame] | 312 | |
Jiri Olsa | d4fcf0a | 2012-11-08 17:01:01 +0100 | [diff] [blame] | 313 | # resolve group_fd to event names |
| 314 | self.resolve_groups(self.expect); |
| 315 | self.resolve_groups(self.result); |
Jiri Olsa | 52502bf | 2012-10-31 15:52:47 +0100 | [diff] [blame] | 316 | |
Jiri Olsa | d4fcf0a | 2012-11-08 17:01:01 +0100 | [diff] [blame] | 317 | # do the expectation - results matching - both ways |
| 318 | self.compare(self.expect, self.result) |
| 319 | self.compare(self.result, self.expect) |
Jiri Olsa | 52502bf | 2012-10-31 15:52:47 +0100 | [diff] [blame] | 320 | |
Jiri Olsa | d4fcf0a | 2012-11-08 17:01:01 +0100 | [diff] [blame] | 321 | finally: |
| 322 | # cleanup |
| 323 | shutil.rmtree(tempdir) |
Jiri Olsa | 52502bf | 2012-10-31 15:52:47 +0100 | [diff] [blame] | 324 | |
| 325 | |
| 326 | def run_tests(options): |
| 327 | for f in glob.glob(options.test_dir + '/' + options.test): |
| 328 | try: |
| 329 | Test(f, options).run() |
Tony Jones | 35ea7e4 | 2019-01-23 16:52:29 -0800 | [diff] [blame] | 330 | except Unsup as obj: |
Jiri Olsa | 52502bf | 2012-10-31 15:52:47 +0100 | [diff] [blame] | 331 | log.warning("unsupp %s" % obj.getMsg()) |
Tony Jones | 35ea7e4 | 2019-01-23 16:52:29 -0800 | [diff] [blame] | 332 | except Notest as obj: |
Thomas Richter | 19508c0 | 2017-06-22 09:36:25 +0200 | [diff] [blame] | 333 | log.warning("skipped %s" % obj.getMsg()) |
Jiri Olsa | 52502bf | 2012-10-31 15:52:47 +0100 | [diff] [blame] | 334 | |
| 335 | def setup_log(verbose): |
| 336 | global log |
| 337 | level = logging.CRITICAL |
| 338 | |
| 339 | if verbose == 1: |
| 340 | level = logging.WARNING |
| 341 | if verbose == 2: |
| 342 | level = logging.INFO |
| 343 | if verbose >= 3: |
| 344 | level = logging.DEBUG |
| 345 | |
| 346 | log = logging.getLogger('test') |
| 347 | log.setLevel(level) |
| 348 | ch = logging.StreamHandler() |
| 349 | ch.setLevel(level) |
| 350 | formatter = logging.Formatter('%(message)s') |
| 351 | ch.setFormatter(formatter) |
| 352 | log.addHandler(ch) |
| 353 | |
| 354 | USAGE = '''%s [OPTIONS] |
| 355 | -d dir # tests dir |
| 356 | -p path # perf binary |
| 357 | -t test # single test |
| 358 | -v # verbose level |
| 359 | ''' % sys.argv[0] |
| 360 | |
| 361 | def main(): |
| 362 | parser = optparse.OptionParser(usage=USAGE) |
| 363 | |
| 364 | parser.add_option("-t", "--test", |
| 365 | action="store", type="string", dest="test") |
| 366 | parser.add_option("-d", "--test-dir", |
| 367 | action="store", type="string", dest="test_dir") |
| 368 | parser.add_option("-p", "--perf", |
| 369 | action="store", type="string", dest="perf") |
| 370 | parser.add_option("-v", "--verbose", |
Tony Jones | 35ea7e4 | 2019-01-23 16:52:29 -0800 | [diff] [blame] | 371 | default=0, action="count", dest="verbose") |
Jiri Olsa | 52502bf | 2012-10-31 15:52:47 +0100 | [diff] [blame] | 372 | |
| 373 | options, args = parser.parse_args() |
| 374 | if args: |
| 375 | parser.error('FAILED wrong arguments %s' % ' '.join(args)) |
| 376 | return -1 |
| 377 | |
| 378 | setup_log(options.verbose) |
| 379 | |
| 380 | if not options.test_dir: |
Tony Jones | 35ea7e4 | 2019-01-23 16:52:29 -0800 | [diff] [blame] | 381 | print('FAILED no -d option specified') |
Jiri Olsa | 52502bf | 2012-10-31 15:52:47 +0100 | [diff] [blame] | 382 | sys.exit(-1) |
| 383 | |
| 384 | if not options.test: |
| 385 | options.test = 'test*' |
| 386 | |
| 387 | try: |
| 388 | run_tests(options) |
| 389 | |
Tony Jones | 35ea7e4 | 2019-01-23 16:52:29 -0800 | [diff] [blame] | 390 | except Fail as obj: |
| 391 | print("FAILED %s" % obj.getMsg()) |
Jiri Olsa | 52502bf | 2012-10-31 15:52:47 +0100 | [diff] [blame] | 392 | sys.exit(-1) |
| 393 | |
| 394 | sys.exit(0) |
| 395 | |
| 396 | if __name__ == '__main__': |
| 397 | main() |