mirror of
				https://github.com/tailscale/tailscale.git
				synced 2025-10-31 08:11:32 +01:00 
			
		
		
		
	Updates #4984 Signed-off-by: Andrew Dunham <andrew@du.nham.ca> Change-Id: Ib229eb40af36a80e6b0fd1dd0cabb07f0d50a7d1
		
			
				
	
	
		
			30 lines
		
	
	
		
			720 B
		
	
	
	
		
			Go
		
	
	
	
	
	
			
		
		
	
	
			30 lines
		
	
	
		
			720 B
		
	
	
	
		
			Go
		
	
	
	
	
	
| // Copyright (c) Tailscale Inc & AUTHORS
 | |
| // SPDX-License-Identifier: BSD-3-Clause
 | |
| 
 | |
| package cloudenv
 | |
| 
 | |
| import (
 | |
| 	"flag"
 | |
| 	"net/netip"
 | |
| 	"testing"
 | |
| )
 | |
| 
 | |
| var extNetwork = flag.Bool("use-external-network", false, "use the external network in tests")
 | |
| 
 | |
| // Informational only since we can run tests in a variety of places.
 | |
| func TestGetCloud(t *testing.T) {
 | |
| 	if !*extNetwork {
 | |
| 		t.Skip("skipping test without --use-external-network")
 | |
| 	}
 | |
| 
 | |
| 	cloud := getCloud()
 | |
| 	t.Logf("Cloud: %q", cloud)
 | |
| 	t.Logf("Cloud.HasInternalTLD: %v", cloud.HasInternalTLD())
 | |
| 	t.Logf("Cloud.ResolverIP: %q", cloud.ResolverIP())
 | |
| }
 | |
| 
 | |
| func TestGetDigitalOceanResolver(t *testing.T) {
 | |
| 	addr := netip.MustParseAddr(getDigitalOceanResolver())
 | |
| 	t.Logf("got: %v", addr)
 | |
| }
 |