mirror of
https://github.com/netbirdio/netbird.git
synced 2025-08-14 01:08:46 +02:00
[client, management] Add port forwarding (#3275)
Add initial support to ingress ports on the client code. - new types where added - new protocol messages and controller
This commit is contained in:
@ -2585,6 +2585,8 @@ func TestSqlStore_GetAccountPeers(t *testing.T) {
|
||||
tests := []struct {
|
||||
name string
|
||||
accountID string
|
||||
nameFilter string
|
||||
ipFilter string
|
||||
expectedCount int
|
||||
}{
|
||||
{
|
||||
@ -2602,11 +2604,29 @@ func TestSqlStore_GetAccountPeers(t *testing.T) {
|
||||
accountID: "",
|
||||
expectedCount: 0,
|
||||
},
|
||||
{
|
||||
name: "should filter peers by name",
|
||||
accountID: "bf1c8084-ba50-4ce7-9439-34653001fc3b",
|
||||
nameFilter: "expiredhost",
|
||||
expectedCount: 1,
|
||||
},
|
||||
{
|
||||
name: "should filter peers by partial name",
|
||||
accountID: "bf1c8084-ba50-4ce7-9439-34653001fc3b",
|
||||
nameFilter: "host",
|
||||
expectedCount: 3,
|
||||
},
|
||||
{
|
||||
name: "should filter peers by ip",
|
||||
accountID: "bf1c8084-ba50-4ce7-9439-34653001fc3b",
|
||||
ipFilter: "100.64.39.54",
|
||||
expectedCount: 1,
|
||||
},
|
||||
}
|
||||
|
||||
for _, tt := range tests {
|
||||
t.Run(tt.name, func(t *testing.T) {
|
||||
peers, err := store.GetAccountPeers(context.Background(), LockingStrengthShare, tt.accountID)
|
||||
peers, err := store.GetAccountPeers(context.Background(), LockingStrengthShare, tt.accountID, tt.nameFilter, tt.ipFilter)
|
||||
require.NoError(t, err)
|
||||
require.Len(t, peers, tt.expectedCount)
|
||||
})
|
||||
|
Reference in New Issue
Block a user