ec_traffic_filter: Fix rule ordering bug #208
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Description
Fixes a bug where multiple having a traffic filter with a few rules will
cause an infinite diff loop by changing the field from a List to a Set.
This consistently hashes the list using the same algorithm, which does
not happen when the field is of
schema.TypeList
.Also adds a custom set hashing function for the traffic rules set, using
the source and optional description if found as hashing keys.
Last, changes the assertions to use
TestCheckTypeSetElemNestedAttrs
inthe acceptance tests, asserting the rule values without the position.
Related Issues
Closes #203
How Has This Been Tested?
Unit and acceptance tested, also tried with an example locally.
Types of Changes