Maint: change default ping address to github.com to test DNS
This commit is contained in:
@@ -125,7 +125,7 @@ ENV VPNSP=pia \
|
|||||||
LOG_LEVEL=info \
|
LOG_LEVEL=info \
|
||||||
# Health
|
# Health
|
||||||
HEALTH_SERVER_ADDRESS=127.0.0.1:9999 \
|
HEALTH_SERVER_ADDRESS=127.0.0.1:9999 \
|
||||||
HEALTH_ADDRESS_TO_PING=1.1.1.1 \
|
HEALTH_ADDRESS_TO_PING=github.com \
|
||||||
HEALTH_OPENVPN_DURATION_INITIAL=6s \
|
HEALTH_OPENVPN_DURATION_INITIAL=6s \
|
||||||
HEALTH_OPENVPN_DURATION_ADDITION=5s \
|
HEALTH_OPENVPN_DURATION_ADDITION=5s \
|
||||||
# DNS over TLS
|
# DNS over TLS
|
||||||
|
|||||||
@@ -52,7 +52,7 @@ func (settings *Health) read(r reader) (err error) {
|
|||||||
return fmt.Errorf("environment variable HEALTH_SERVER_ADDRESS: %w", err)
|
return fmt.Errorf("environment variable HEALTH_SERVER_ADDRESS: %w", err)
|
||||||
}
|
}
|
||||||
|
|
||||||
settings.AddressToPing, err = r.env.Get("HEALTH_ADDRESS_TO_PING", params.Default("1.1.1.1"))
|
settings.AddressToPing, err = r.env.Get("HEALTH_ADDRESS_TO_PING", params.Default("github.com"))
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return fmt.Errorf("environment variable HEALTH_ADDRESS_TO_PING: %w", err)
|
return fmt.Errorf("environment variable HEALTH_ADDRESS_TO_PING: %w", err)
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -49,7 +49,7 @@ func Test_Health_lines(t *testing.T) {
|
|||||||
"filled settings": {
|
"filled settings": {
|
||||||
settings: Health{
|
settings: Health{
|
||||||
ServerAddress: "address:9999",
|
ServerAddress: "address:9999",
|
||||||
AddressToPing: "1.1.1.1",
|
AddressToPing: "github.com",
|
||||||
VPN: HealthyWait{
|
VPN: HealthyWait{
|
||||||
Initial: time.Second,
|
Initial: time.Second,
|
||||||
Addition: time.Minute,
|
Addition: time.Minute,
|
||||||
@@ -58,7 +58,7 @@ func Test_Health_lines(t *testing.T) {
|
|||||||
lines: []string{
|
lines: []string{
|
||||||
"|--Health:",
|
"|--Health:",
|
||||||
" |--Server address: address:9999",
|
" |--Server address: address:9999",
|
||||||
" |--Address to ping: 1.1.1.1",
|
" |--Address to ping: github.com",
|
||||||
" |--VPN:",
|
" |--VPN:",
|
||||||
" |--Initial duration: 1s",
|
" |--Initial duration: 1s",
|
||||||
" |--Addition duration: 1m0s",
|
" |--Addition duration: 1m0s",
|
||||||
|
|||||||
@@ -19,8 +19,8 @@ func Test_healthCheck_ping(t *testing.T) {
|
|||||||
address string
|
address string
|
||||||
err error
|
err error
|
||||||
}{
|
}{
|
||||||
"1.1.1.1": {
|
"github.com": {
|
||||||
address: "1.1.1.1",
|
address: "github.com",
|
||||||
},
|
},
|
||||||
"99.99.99.99": {
|
"99.99.99.99": {
|
||||||
address: "99.99.99.99",
|
address: "99.99.99.99",
|
||||||
|
|||||||
@@ -70,7 +70,7 @@ func Test_healthCheck(t *testing.T) {
|
|||||||
t.Run("canceled real pinger", func(t *testing.T) {
|
t.Run("canceled real pinger", func(t *testing.T) {
|
||||||
t.Parallel()
|
t.Parallel()
|
||||||
|
|
||||||
pinger := newPinger("1.1.1.1")
|
pinger := newPinger("github.com")
|
||||||
|
|
||||||
canceledCtx, cancel := context.WithCancel(context.Background())
|
canceledCtx, cancel := context.WithCancel(context.Background())
|
||||||
cancel()
|
cancel()
|
||||||
|
|||||||
Reference in New Issue
Block a user