-
Notifications
You must be signed in to change notification settings - Fork 313
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
tests: in _nltst_assert_route_list() accept arbitrary order
_nltst_assert_route_list() compares the content of the cache with a list of expected routes. The cache does not have a well defined order. Well, maybe the cache *should* have a well defined order, because when we use `ip route replace`, it will replace some route that has certain similar attributes, but is otherwise another route (as far as route identity and caching is concerned). But on netlink, we are only told that one route was replaced, but not which one. Some kernel developers think that in face of that, we just iterate the cache (in the same order as kernel exports the route), find the first similar route and know that was the one that is replaced. Does that work? Dunno, I never saw anybody implementing that successfully. NetworkManager throws it's hands in the air and request a new dump of all routes that it caches. Anyway. Unless somebody shows that the cache is always in a consistent and reproducible state, this unit test was wrong. Instead, permutate through all lists of routes, and try to find a one-to-one match with the expected routes.
- Loading branch information
Showing
2 changed files
with
104 additions
and
51 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters