testing without that horrible filtercode
Signed-off-by: Kristoffer Dalby <kristoffer@tailscale.com>
This commit is contained in:
parent
1700a747f6
commit
889d5a1b29
6 changed files with 510 additions and 345 deletions
|
@ -6,7 +6,6 @@ import (
|
|||
"reflect"
|
||||
"regexp"
|
||||
"strconv"
|
||||
"sync"
|
||||
"testing"
|
||||
"time"
|
||||
|
||||
|
@ -1041,16 +1040,12 @@ func Test_getFilteredByACLPeers(t *testing.T) {
|
|||
},
|
||||
},
|
||||
}
|
||||
var lock sync.RWMutex
|
||||
for _, tt := range tests {
|
||||
t.Run(tt.name, func(t *testing.T) {
|
||||
aclRulesMap := generateACLPeerCacheMap(tt.args.rules)
|
||||
|
||||
got := filterMachinesByACL(
|
||||
tt.args.machine,
|
||||
tt.args.machines,
|
||||
&lock,
|
||||
aclRulesMap,
|
||||
tt.args.rules,
|
||||
)
|
||||
if !reflect.DeepEqual(got, tt.want) {
|
||||
t.Errorf("filterMachinesByACL() = %v, want %v", got, tt.want)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue