Caching, selecting iterator over configs. Returns an iterator that will go over configs that match the provided predicate (a function that returns true or false depending if given config is ok for test at hand) while saving the results to the cache/verbose `
(predicate)
| 126 | hostname)) |
| 127 | |
| 128 | def conf_iterator(predicate): |
| 129 | """ |
| 130 | Caching, selecting iterator over configs. |
| 131 | |
| 132 | Returns an iterator that will go over configs that match the provided |
| 133 | predicate (a function that returns true or false depending if given |
| 134 | config is ok for test at hand) while saving the results to the |
| 135 | cache/verbose `results` log/dictionary |
| 136 | |
| 137 | The iterator returns False for every connection that succeeded |
| 138 | (meaning the server is NOT intolerant to config and True to mean |
| 139 | that server IS intolerant to config. |
| 140 | """ |
| 141 | scan_iter = (not simple_inspector(result_cache(name, conf)) |
| 142 | for name, conf in configs.items() |
| 143 | if predicate(conf)) |
| 144 | return itertools.chain(result_iterator(predicate), scan_iter) |
| 145 | |
| 146 | host_up = not all(conf_iterator(lambda conf: True)) |
| 147 |
no test coverage detected