Please sign in to comment.
sanitycheck harness: Correct ordered regex handling
The way sanitycheck did its ordered regexes is that it would test every regex against every line, and store the matching lines and their regexes in an OrderedDict and check that they happened in the right order. That's wrong, because it disallows matching against a line that previously appeared (and should have been ignored) in the input stream. The watchdog sample is the best illustration: the first boot will (by definition) contain all the output already, but the regex has to match against a line from the SECOND boot and not the same one it saw earlier. Do this the simple way: keep a counter of which regex we're trying to apply next and increment it on a match. This is faster too as we only need to check one pattern per line. Signed-off-by: Andy Ross <email@example.com>
- Loading branch information...