mirror of
				https://github.com/tailscale/tailscale.git
				synced 2025-11-04 10:11:18 +01:00 
			
		
		
		
	Fixes #13527 Change-Id: I05921969a84a303b60d1b3b9227aff9865662831 Signed-off-by: Brad Fitzpatrick <bradfitz@tailscale.com>
		
			
				
	
	
		
			28 lines
		
	
	
		
			666 B
		
	
	
	
		
			Go
		
	
	
	
	
	
			
		
		
	
	
			28 lines
		
	
	
		
			666 B
		
	
	
	
		
			Go
		
	
	
	
	
	
// Copyright (c) Tailscale Inc & AUTHORS
 | 
						|
// SPDX-License-Identifier: BSD-3-Clause
 | 
						|
 | 
						|
//go:build tailscale_go
 | 
						|
 | 
						|
package tailscaleroot
 | 
						|
 | 
						|
import (
 | 
						|
	"os"
 | 
						|
	"strings"
 | 
						|
	"testing"
 | 
						|
)
 | 
						|
 | 
						|
func TestToolchainMatches(t *testing.T) {
 | 
						|
	tsRev, ok := tailscaleToolchainRev()
 | 
						|
	if !ok {
 | 
						|
		t.Fatal("failed to read build info")
 | 
						|
	}
 | 
						|
	want := strings.TrimSpace(GoToolchainRev)
 | 
						|
	if tsRev != want {
 | 
						|
		if os.Getenv("TS_PERMIT_TOOLCHAIN_MISMATCH") == "1" {
 | 
						|
			t.Logf("tailscale.toolchain.rev = %q, want %q; but ignoring due to TS_PERMIT_TOOLCHAIN_MISMATCH=1", tsRev, want)
 | 
						|
			return
 | 
						|
		}
 | 
						|
		t.Errorf("tailscale.toolchain.rev = %q, want %q; permit with TS_PERMIT_TOOLCHAIN_MISMATCH=1", tsRev, want)
 | 
						|
	}
 | 
						|
}
 |