mirror of
https://github.com/netbirdio/netbird.git
synced 2026-08-10 12:05:39 -04:00
fix linter comments
This commit is contained in:
@@ -12,15 +12,15 @@ import (
|
||||
func TestGetDomains(t *testing.T) {
|
||||
ctx := context.TODO()
|
||||
|
||||
_, err := pgstore.Pool.Query(ctx,
|
||||
_, err := pgstore.Pool.Exec(ctx,
|
||||
`insert into domains (id, account_id, domain, target_cluster)
|
||||
VALUES('domain-1','account-1','test-1.com','target-1.cluster.local')`)
|
||||
assert.NoError(t, err)
|
||||
_, err = pgstore.Pool.Query(ctx,
|
||||
_, err = pgstore.Pool.Exec(ctx,
|
||||
`insert into domains (id, account_id, domain, target_cluster)
|
||||
VALUES('domain-2','account-1','test-2.com','target-2.cluster.local')`)
|
||||
assert.NoError(t, err)
|
||||
_, err = pgstore.Pool.Query(ctx,
|
||||
_, err = pgstore.Pool.Exec(ctx,
|
||||
`insert into domains (id, account_id, domain, target_cluster)
|
||||
VALUES('domain-3','account-1',null,null)`)
|
||||
assert.NoError(t, err)
|
||||
|
||||
@@ -48,7 +48,7 @@ func TestGetGroupsWithoutExpectedFields(t *testing.T) {
|
||||
|
||||
acctId := xid.New().String()
|
||||
|
||||
_, err = s.Pool.Query(ctx,
|
||||
_, err = s.Pool.Exec(ctx,
|
||||
"insert into accounts (id) VALUES($1)", acctId)
|
||||
assert.NoError(t, err)
|
||||
|
||||
|
||||
@@ -13,15 +13,15 @@ import (
|
||||
func TestGetNameServerGroups(t *testing.T) {
|
||||
ctx := context.TODO()
|
||||
|
||||
_, err := pgstore.Pool.Query(ctx,
|
||||
_, err := pgstore.Pool.Exec(ctx,
|
||||
`insert into name_server_groups (id, public_id, name, description, name_servers, groups, domains, enabled, search_domains_enabled, "primary", account_id)
|
||||
VALUES('nsgroup-1','nsgroup-1-public','nsgroup-1','nsgroup-1','[{"IP":"192.168.31.2","NSType":1,"Port":53}]','["group-one-resource-id"]','["test-1.com"]',TRUE,FALSE,TRUE,'account-1')`)
|
||||
assert.NoError(t, err)
|
||||
_, err = pgstore.Pool.Query(ctx,
|
||||
_, err = pgstore.Pool.Exec(ctx,
|
||||
`insert into name_server_groups (id, public_id, name, description, name_servers, groups, domains, enabled, search_domains_enabled,"primary",account_id)
|
||||
VALUES('nsgroup-2','nsgroup-2-public','nsgroup-2','nsgroup-2','[{"IP":"192.168.32.3","NSType":1,"Port":53}]','["group-one-resource-id","group-no-resources-id"]','["test-1.com","test-2.com"]',TRUE,FALSE,TRUE,'account-1')`)
|
||||
assert.NoError(t, err)
|
||||
_, err = pgstore.Pool.Query(ctx,
|
||||
_, err = pgstore.Pool.Exec(ctx,
|
||||
`insert into name_server_groups (id, public_id, name, description, name_servers, groups, domains, enabled, search_domains_enabled,"primary",account_id)
|
||||
VALUES('nsgroup-3','nsgroup-3-public',null,null,null,null,null,TRUE,FALSE,FALSE,'account-1')`)
|
||||
assert.NoError(t, err)
|
||||
|
||||
@@ -16,15 +16,18 @@ func TestGetNetworkResources(t *testing.T) {
|
||||
s, err := networkmap_pgsql.NewPostgresqlStore(ctx, dsn)
|
||||
assert.NoError(t, err)
|
||||
|
||||
_, err = s.Pool.Query(ctx,
|
||||
_, err = s.Pool.Exec(ctx,
|
||||
`insert into network_resources (id, account_id, network_id, public_id, name, description, type, domain, prefix, enabled)
|
||||
VALUES('net-resource-1','account-1','network-1','net-resource-public-1','network-resource-1','network-resource-1','subnet','','"10.0.0.0/16"',TRUE)`)
|
||||
_, err = s.Pool.Query(ctx,
|
||||
assert.NoError(t, err)
|
||||
_, err = s.Pool.Exec(ctx,
|
||||
`insert into network_resources (id, account_id, network_id, public_id, name, description, type, domain, prefix, enabled)
|
||||
VALUES('net-resource-2','account-1','network-2','net-resource-public-2','network-resource-2','network-resource-2','domain','test.com','',TRUE)`)
|
||||
_, err = s.Pool.Query(ctx,
|
||||
assert.NoError(t, err)
|
||||
_, err = s.Pool.Exec(ctx,
|
||||
`insert into network_resources (id, account_id, network_id, public_id, name, description, type, domain, prefix, enabled)
|
||||
VALUES('net-resource-3','account-1','network-3','net-resource-public-3','network-resource-3','network-resource-3','host','','"10.0.0.1/32"',TRUE)`)
|
||||
assert.NoError(t, err)
|
||||
|
||||
resources, err := s.GetNetworkResources(ctx, "account-1")
|
||||
assert.NoError(t, err)
|
||||
|
||||
@@ -15,12 +15,14 @@ func TestGetNetworkRouters(t *testing.T) {
|
||||
s, err := networkmap_pgsql.NewPostgresqlStore(ctx, dsn)
|
||||
assert.NoError(t, err)
|
||||
|
||||
_, err = s.Pool.Query(ctx,
|
||||
_, err = s.Pool.Exec(ctx,
|
||||
`insert into network_routers (id, account_id, public_id, peer, network_id, masquerade, metric, enabled, peer_groups)
|
||||
VALUES('test-nr-id-1','account-1','public-id-1','peer-id-1','network-id-1',TRUE,999,TRUE,'["group-one-resource-id"]')`)
|
||||
_, err = s.Pool.Query(ctx,
|
||||
assert.NoError(t, err)
|
||||
_, err = s.Pool.Exec(ctx,
|
||||
`insert into network_routers (id, account_id, public_id, peer, network_id, masquerade, metric, enabled, peer_groups)
|
||||
VALUES('test-nr-id-2','account-1','public-id-2','','network-id-2',TRUE,333,TRUE,'["group-two-resources-id","group-no-resources-id"]')`)
|
||||
assert.NoError(t, err)
|
||||
|
||||
routers, err := s.GetNetworkRouters(ctx, "account-1")
|
||||
assert.NoError(t, err)
|
||||
|
||||
@@ -11,10 +11,10 @@ import (
|
||||
func TestGetNetworks(t *testing.T) {
|
||||
ctx := context.TODO()
|
||||
|
||||
_, err := pgstore.Pool.Query(ctx,
|
||||
_, err := pgstore.Pool.Exec(ctx,
|
||||
`insert into networks (id, account_id, public_id) VALUES('network-1','account-1','network-1-public')`)
|
||||
assert.NoError(t, err)
|
||||
_, err = pgstore.Pool.Query(ctx,
|
||||
_, err = pgstore.Pool.Exec(ctx,
|
||||
`insert into networks (id, account_id, public_id) VALUES('network-2','account-1','network-2-public')`)
|
||||
assert.NoError(t, err)
|
||||
|
||||
|
||||
@@ -13,7 +13,7 @@ import (
|
||||
func TestGetPostureChecks(t *testing.T) {
|
||||
ctx := context.TODO()
|
||||
|
||||
_, err := pgstore.Pool.Query(ctx,
|
||||
_, err := pgstore.Pool.Exec(ctx,
|
||||
`insert into posture_checks (id, account_id, public_id, checks)
|
||||
VALUES('posturecheck-1','account-1','posturecheck-1-public',
|
||||
'{"NBVersionCheck":{"MinVersion":"0.25.0"},
|
||||
@@ -22,7 +22,7 @@ func TestGetPostureChecks(t *testing.T) {
|
||||
"PeerNetworkRangeCheck":{"Action":"deny","Ranges":["192.168.0.1/24"]}}')`)
|
||||
assert.NoError(t, err)
|
||||
|
||||
_, err = pgstore.Pool.Query(ctx,
|
||||
_, err = pgstore.Pool.Exec(ctx,
|
||||
`insert into posture_checks (id, account_id, public_id, checks)
|
||||
VALUES('posturecheck-2','account-1','posturecheck-2-public',
|
||||
'{"NBVersionCheck":{"MinVersion":"0.25.0"},
|
||||
@@ -30,7 +30,7 @@ func TestGetPostureChecks(t *testing.T) {
|
||||
"GeoLocationCheck":{"Locations":[{"CountryCode":"US","CityName":"Harker Heights"}],"Action":"allow"},
|
||||
"PeerNetworkRangeCheck":{"Action":"allow","Ranges":["0.0.0.0/0"]}}')`)
|
||||
assert.NoError(t, err)
|
||||
_, err = pgstore.Pool.Query(ctx,
|
||||
_, err = pgstore.Pool.Exec(ctx,
|
||||
`insert into posture_checks (id, account_id, public_id, checks)
|
||||
VALUES('posturecheck-3','account-1','posturecheck-3-public', null)`)
|
||||
assert.NoError(t, err)
|
||||
|
||||
@@ -14,7 +14,7 @@ import (
|
||||
func TestGetRoutes(t *testing.T) {
|
||||
ctx := context.TODO()
|
||||
|
||||
_, err := pgstore.Pool.Query(ctx,
|
||||
_, err := pgstore.Pool.Exec(ctx,
|
||||
`insert into routes (id, account_id, public_id, network, domains, keep_route, net_id, description,
|
||||
peer, peer_groups, network_type, masquerade, metric, enabled,
|
||||
groups, access_control_groups, skip_auto_apply)
|
||||
@@ -22,7 +22,7 @@ func TestGetRoutes(t *testing.T) {
|
||||
'peer-id-1','["group-one-resource-id"]',1,true,9999,true,
|
||||
'["group-one-resource-id"]','["group-one-resource-id"]',false)`)
|
||||
assert.NoError(t, err)
|
||||
_, err = pgstore.Pool.Query(ctx,
|
||||
_, err = pgstore.Pool.Exec(ctx,
|
||||
`insert into routes (id, account_id, public_id, network, domains, keep_route, net_id, description,
|
||||
peer, peer_groups, network_type, masquerade, metric, enabled,
|
||||
groups, access_control_groups, skip_auto_apply)
|
||||
@@ -30,7 +30,7 @@ func TestGetRoutes(t *testing.T) {
|
||||
'peer-id-2','["group-two-resources-id"]',1,true,9999,true,
|
||||
'["group-two-resources-id"]','["group-two-resources-id"]',false)`)
|
||||
assert.NoError(t, err)
|
||||
_, err = pgstore.Pool.Query(ctx,
|
||||
_, err = pgstore.Pool.Exec(ctx,
|
||||
`insert into routes (id, account_id, public_id, network, domains, keep_route, net_id, description,
|
||||
peer, peer_groups, network_type, masquerade, metric, enabled,
|
||||
groups, access_control_groups, skip_auto_apply)
|
||||
|
||||
Reference in New Issue
Block a user