summaryrefslogtreecommitdiffhomepage
path: root/control/controlknobs/controlknobs_test.go
diff options
context:
space:
mode:
authorBrad Fitzpatrick <bradfitz@tailscale.com>2023-09-01 19:28:00 -0700
committerBrad Fitzpatrick <brad@danga.com>2023-09-12 12:23:24 -0700
commit3af051ea27a37acd1ffc73583d5ad2b19c60edd1 (patch)
treedc7adf2c6a58b9f85d6921a66a5a279d1b78583f /control/controlknobs/controlknobs_test.go
parentc0ade132e6e8712c899ef03303ef135f5c238636 (diff)
downloadtailscale-3af051ea27a37acd1ffc73583d5ad2b19c60edd1.tar.xz
tailscale-3af051ea27a37acd1ffc73583d5ad2b19c60edd1.zip
control/controlclient, types/netmap: start plumbing delta netmap updates
Currently only the top four most popular changes: endpoints, DERP home, online, and LastSeen. Updates #1909 Change-Id: I03152da176b2b95232b56acabfb55dcdfaa16b79 Signed-off-by: Brad Fitzpatrick <bradfitz@tailscale.com>
Diffstat (limited to 'control/controlknobs/controlknobs_test.go')
-rw-r--r--control/controlknobs/controlknobs_test.go21
1 files changed, 21 insertions, 0 deletions
diff --git a/control/controlknobs/controlknobs_test.go b/control/controlknobs/controlknobs_test.go
new file mode 100644
index 000000000..266a4708d
--- /dev/null
+++ b/control/controlknobs/controlknobs_test.go
@@ -0,0 +1,21 @@
+// Copyright (c) Tailscale Inc & AUTHORS
+// SPDX-License-Identifier: BSD-3-Clause
+
+package controlknobs
+
+import (
+ "reflect"
+ "testing"
+)
+
+func TestAsDebugJSON(t *testing.T) {
+ var nilPtr *Knobs
+ if got := nilPtr.AsDebugJSON(); got != nil {
+ t.Errorf("AsDebugJSON(nil) = %v; want nil", got)
+ }
+ k := new(Knobs)
+ got := k.AsDebugJSON()
+ if want := reflect.TypeOf(Knobs{}).NumField(); len(got) != want {
+ t.Errorf("AsDebugJSON map has %d fields; want %v", len(got), want)
+ }
+}