Refactor Route IDs (#1891)

This commit is contained in:
Viktor Liu
2024-05-06 14:47:49 +02:00
committed by GitHub
parent 6a4935139d
commit 4e7c17756c
25 changed files with 320 additions and 292 deletions

View File

@@ -2,8 +2,6 @@ package server
import (
"fmt"
nbdns "github.com/netbirdio/netbird/dns"
nbgroup "github.com/netbirdio/netbird/management/server/group"
"math/rand"
"net"
"net/netip"
@@ -12,6 +10,9 @@ import (
"testing"
"time"
nbdns "github.com/netbirdio/netbird/dns"
nbgroup "github.com/netbirdio/netbird/management/server/group"
"github.com/google/uuid"
"github.com/stretchr/testify/assert"
"github.com/stretchr/testify/require"
@@ -75,9 +76,9 @@ func TestSqlite_SaveAccount_Large(t *testing.T) {
}
account.Users[user.Id] = user
route := &route2.Route{
ID: fmt.Sprintf("network-id-%d", n),
ID: route2.ID(fmt.Sprintf("network-id-%d", n)),
Description: "base route",
NetID: fmt.Sprintf("network-id-%d", n),
NetID: route2.NetID(fmt.Sprintf("network-id-%d", n)),
Network: netip.MustParsePrefix(netIP.String() + "/24"),
NetworkType: route2.IPv4Network,
Metric: 9999,