mirror of
				https://github.com/tailscale/tailscale.git
				synced 2025-10-31 00:01:40 +01:00 
			
		
		
		
	This makes deployment easier in hetrogenous environments. Updates ENG-4274 Signed-off-by: James Tucker <james@tailscale.com>
		
			
				
	
	
		
			26 lines
		
	
	
		
			471 B
		
	
	
	
		
			Go
		
	
	
	
	
	
			
		
		
	
	
			26 lines
		
	
	
		
			471 B
		
	
	
	
		
			Go
		
	
	
	
	
	
| // Copyright (c) Tailscale Inc & AUTHORS
 | |
| // SPDX-License-Identifier: BSD-3-Clause
 | |
| 
 | |
| package netutil
 | |
| 
 | |
| import (
 | |
| 	"testing"
 | |
| )
 | |
| 
 | |
| func TestDefaultInterfacePortable(t *testing.T) {
 | |
| 	ifName, addr, err := DefaultInterfacePortable()
 | |
| 	if err != nil {
 | |
| 		t.Fatal(err)
 | |
| 	}
 | |
| 
 | |
| 	t.Logf("Default interface: %s", ifName)
 | |
| 	t.Logf("Default address: %s", addr)
 | |
| 
 | |
| 	if ifName == "" {
 | |
| 		t.Fatal("Default interface name is empty")
 | |
| 	}
 | |
| 	if !addr.IsValid() {
 | |
| 		t.Fatal("Default address is invalid")
 | |
| 	}
 | |
| }
 |