testing without that horrible filtercode

Signed-off-by: Kristoffer Dalby <kristoffer@tailscale.com>
This commit is contained in:
Kristoffer Dalby 2023-04-26 17:27:51 +02:00 committed by Juan Font
parent 1700a747f6
commit 889d5a1b29
6 changed files with 510 additions and 345 deletions

View file

@ -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)