Skip to content

Commit

Permalink
x
Browse files Browse the repository at this point in the history
  • Loading branch information
ainghazal committed Jul 31, 2024
1 parent d07741a commit 74448c8
Showing 1 changed file with 9 additions and 2 deletions.
11 changes: 9 additions & 2 deletions internal/experiment/openvpn/targets_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -13,18 +13,25 @@ func Test_resolveTarget(t *testing.T) {
}

_, err := resolveTarget("google.com")

if err != nil {
if err.Error() == "connection_refused" {
// connection_refused is raised when running this test
// on the restricted network for coverage tests.
// so we bail out
return
}
t.Fatal("should be able to resolve the target")
}

_, err = resolveTarget("nothing.corp")
if err == nil {
t.Fatal("should be able to resolve the target")
t.Fatal("should not be able to resolve the target")
}

_, err = resolveTarget("asfasfasfasfasfafs.ooni.io")
if err == nil {
t.Fatal("should be able to resolve the target")
t.Fatal("should not be able to resolve the target")
}
}

Expand Down

0 comments on commit 74448c8

Please sign in to comment.