test: update testUpdateChannelPolicy to ensure Bob's link uses the proper policies

In this commit, we update the testUpdateChannelPolicy to exercise the
recent set of changes within the switch. If one applies this test to a
fresh branch (without those new changes) it should fail. This is due to
the fact that before, Bob would attempt to apply the constraints of the
incoming link (which we updated) instead of the outgoing link. With the
recent set of changes, the test now properly passes.
This commit is contained in:
Olaoluwa Osuntokun
2018-04-03 20:18:42 -07:00
parent ffabb17ce6
commit 3fa2e08665
4 changed files with 74 additions and 41 deletions

View File

@@ -393,10 +393,10 @@ func (s *Switch) UpdateForwardingPolicies(newPolicy ForwardingPolicy,
return spew.Sdump(newPolicy)
}))
s.indexMtx.RLock()
var linksToUpdate []ChannelLink
s.indexMtx.RLock()
// If no channels have been targeted, then we'll collect all inks to
// update their policies.
if len(targetChans) == 0 {