function log compare
- log_compare "$TESTDIR" <count> <pattern> <type>
It scans the test log looking for occurrences of the pattern, and counting the number of times it occurs.
It also does a comparison of the parsed test log output (filtered using the pattern) with saved, parsed test log output. If these don't match, then log_compare is supposed to fail with an error message.
The result of the last log_compare function determines the success or failure of the entire test.
Arguments to log_compare are:
- $1 should be "$TESTDIR"
- $2 should be the count of how many times to expect the pattern in the test log
- $3 should be the regular expression pattern to search for in the test log
- $4 should be one of 'p' or 'n'. 'p' is for positive results and 'n' is for negative results.
Environment variables used by log_compare are: