diff --git a/satellite/overlay/placement.go b/satellite/overlay/placement.go index f0bc3f188..514171cd5 100644 --- a/satellite/overlay/placement.go +++ b/satellite/overlay/placement.go @@ -68,7 +68,7 @@ func (d *ConfigurablePlacementRule) AddLegacyStaticRules() { d.placements[storj.EU] = nodeselection.NodeFilters{nodeselection.NewCountryFilter(nodeselection.EuCountries)} d.placements[storj.US] = nodeselection.NodeFilters{nodeselection.NewCountryFilter(location.NewSet(location.UnitedStates))} d.placements[storj.DE] = nodeselection.NodeFilters{nodeselection.NewCountryFilter(location.NewSet(location.Germany))} - d.placements[storj.NR] = nodeselection.NodeFilters{nodeselection.NewCountryFilter(location.NewFullSet().Without(location.Russia, location.Belarus))} + d.placements[storj.NR] = nodeselection.NodeFilters{nodeselection.NewCountryFilter(location.NewFullSet().Without(location.Russia, location.Belarus, location.None))} } // AddPlacementRule registers a new placement. diff --git a/satellite/overlay/placement_test.go b/satellite/overlay/placement_test.go index edf5b5d26..7f459ed1e 100644 --- a/satellite/overlay/placement_test.go +++ b/satellite/overlay/placement_test.go @@ -113,4 +113,35 @@ func TestPlacementFromString(t *testing.T) { }) + t.Run("legacy geofencing rules", func(t *testing.T) { + p := NewPlacementRules() + p.AddLegacyStaticRules() + + t.Run("nr", func(t *testing.T) { + nr := p.placements[storj.NR] + require.True(t, nr.MatchInclude(&nodeselection.SelectedNode{ + CountryCode: location.UnitedKingdom, + })) + require.False(t, nr.MatchInclude(&nodeselection.SelectedNode{ + CountryCode: location.Russia, + })) + require.False(t, nr.MatchInclude(&nodeselection.SelectedNode{ + CountryCode: 0, + })) + }) + t.Run("us", func(t *testing.T) { + us := p.placements[storj.US] + require.True(t, us.MatchInclude(&nodeselection.SelectedNode{ + CountryCode: location.UnitedStates, + })) + require.False(t, us.MatchInclude(&nodeselection.SelectedNode{ + CountryCode: location.Germany, + })) + require.False(t, us.MatchInclude(&nodeselection.SelectedNode{ + CountryCode: 0, + })) + }) + + }) + }