#
# Test that there are less than N unexpected ATF test failures.
# Example:
#
#   bracket run-external-test current atf_fail_lt 10
#

from __future__ import print_function

from bracket import *

def op(n_str):
    n = int(n_str)
    def f(ts):
        return get_cached_status(ts, 'failed_tests') < n
    return TestOp(f, [test_completed_op], name = 'atf_fail_lt_' + n_str)
