mirror of
https://github.com/safing/portmaster
synced 2025-09-16 09:49:39 +00:00
Fix location estimation on Windows
Also, switch to a better Portal Test IP.
This commit is contained in:
parent
633bb34288
commit
b9f011fa37
7 changed files with 206 additions and 64 deletions
|
@ -1,13 +1,29 @@
|
|||
// +build root
|
||||
|
||||
package netenv
|
||||
|
||||
import "testing"
|
||||
import (
|
||||
"flag"
|
||||
"testing"
|
||||
)
|
||||
|
||||
var (
|
||||
privileged bool
|
||||
)
|
||||
|
||||
func init() {
|
||||
flag.BoolVar(&privileged, "privileged", false, "run tests that require root/admin privileges")
|
||||
}
|
||||
|
||||
func TestGetApproximateInternetLocation(t *testing.T) {
|
||||
if testing.Short() {
|
||||
t.Skip()
|
||||
}
|
||||
if !privileged {
|
||||
t.Skip("skipping privileged test, active with -privileged argument")
|
||||
}
|
||||
|
||||
ip, err := GetApproximateInternetLocation()
|
||||
if err != nil {
|
||||
t.Errorf("GetApproximateInternetLocation failed: %s", err)
|
||||
t.Fatalf("GetApproximateInternetLocation failed: %s", err)
|
||||
}
|
||||
t.Logf("GetApproximateInternetLocation: %s", ip.String())
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue