mirror of
https://github.com/qdm12/gluetun.git
synced 2026-07-26 20:36:27 +02:00
chore(updater): move updater packages to pkg/updaters/<name>
This commit is contained in:
@@ -5,8 +5,8 @@ import (
|
||||
"testing"
|
||||
|
||||
"github.com/qdm12/gluetun/internal/configuration/settings"
|
||||
"github.com/qdm12/gluetun/internal/constants/vpn"
|
||||
"github.com/qdm12/gluetun/internal/models"
|
||||
"github.com/qdm12/gluetun/pkg/updaters/constants"
|
||||
"github.com/stretchr/testify/assert"
|
||||
)
|
||||
|
||||
@@ -58,56 +58,56 @@ func Test_pickConnection(t *testing.T) {
|
||||
},
|
||||
"openvpn_cycles": {
|
||||
connections: []models.Connection{
|
||||
{Type: vpn.OpenVPN, Port: 1, Hostname: "one"},
|
||||
{Type: vpn.OpenVPN, Port: 2, Hostname: "two"},
|
||||
{Type: constants.OpenVPN, Port: 1, Hostname: "one"},
|
||||
{Type: constants.OpenVPN, Port: 2, Hostname: "two"},
|
||||
},
|
||||
selection: settings.ServerSelection{VPN: vpn.OpenVPN},
|
||||
selection: settings.ServerSelection{VPN: constants.OpenVPN},
|
||||
connection1: models.Connection{
|
||||
Type: vpn.OpenVPN, Port: 1,
|
||||
Type: constants.OpenVPN, Port: 1,
|
||||
Hostname: "one",
|
||||
},
|
||||
connection2: models.Connection{
|
||||
Type: vpn.OpenVPN, Port: 2,
|
||||
Type: constants.OpenVPN, Port: 2,
|
||||
Hostname: "two",
|
||||
},
|
||||
},
|
||||
"openvpn_endpoint_ip_overrides_cycle_pick": {
|
||||
connections: []models.Connection{
|
||||
{Type: vpn.OpenVPN, Hostname: "one", IP: netip.AddrFrom4([4]byte{1, 1, 1, 1})},
|
||||
{Type: vpn.OpenVPN, Hostname: "two", IP: netip.AddrFrom4([4]byte{2, 2, 2, 2})},
|
||||
{Type: constants.OpenVPN, Hostname: "one", IP: netip.AddrFrom4([4]byte{1, 1, 1, 1})},
|
||||
{Type: constants.OpenVPN, Hostname: "two", IP: netip.AddrFrom4([4]byte{2, 2, 2, 2})},
|
||||
},
|
||||
selection: settings.ServerSelection{
|
||||
VPN: vpn.OpenVPN,
|
||||
VPN: constants.OpenVPN,
|
||||
OpenVPN: settings.OpenVPNSelection{
|
||||
EndpointIP: netip.AddrFrom4([4]byte{9, 9, 9, 9}),
|
||||
},
|
||||
},
|
||||
connection1: models.Connection{
|
||||
Type: vpn.OpenVPN, Hostname: "one",
|
||||
Type: constants.OpenVPN, Hostname: "one",
|
||||
IP: netip.AddrFrom4([4]byte{9, 9, 9, 9}),
|
||||
},
|
||||
connection2: models.Connection{
|
||||
Type: vpn.OpenVPN, Hostname: "two",
|
||||
Type: constants.OpenVPN, Hostname: "two",
|
||||
IP: netip.AddrFrom4([4]byte{9, 9, 9, 9}),
|
||||
},
|
||||
},
|
||||
"wireguard_endpoint_ip_picks_target": {
|
||||
connections: []models.Connection{
|
||||
{Type: vpn.Wireguard, Hostname: "one", IP: netip.AddrFrom4([4]byte{1, 1, 1, 1})},
|
||||
{Type: vpn.Wireguard, Hostname: "two", IP: netip.AddrFrom4([4]byte{2, 2, 2, 2})},
|
||||
{Type: constants.Wireguard, Hostname: "one", IP: netip.AddrFrom4([4]byte{1, 1, 1, 1})},
|
||||
{Type: constants.Wireguard, Hostname: "two", IP: netip.AddrFrom4([4]byte{2, 2, 2, 2})},
|
||||
},
|
||||
selection: settings.ServerSelection{
|
||||
VPN: vpn.Wireguard,
|
||||
VPN: constants.Wireguard,
|
||||
Wireguard: settings.WireguardSelection{
|
||||
EndpointIP: netip.AddrFrom4([4]byte{2, 2, 2, 2}),
|
||||
},
|
||||
},
|
||||
connection1: models.Connection{
|
||||
Type: vpn.Wireguard, Hostname: "two",
|
||||
Type: constants.Wireguard, Hostname: "two",
|
||||
IP: netip.AddrFrom4([4]byte{2, 2, 2, 2}),
|
||||
},
|
||||
connection2: models.Connection{
|
||||
Type: vpn.Wireguard, Hostname: "two",
|
||||
Type: constants.Wireguard, Hostname: "two",
|
||||
IP: netip.AddrFrom4([4]byte{2, 2, 2, 2}),
|
||||
},
|
||||
},
|
||||
|
||||
Reference in New Issue
Block a user