summaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorSimeng He <simeng@tailscale.com>2021-05-18 16:06:05 -0400
committerSimeng He <simeng@tailscale.com>2021-05-18 16:06:05 -0400
commitd36c7a40b42830cc7530df90db28b40e422ca894 (patch)
treee43cd4921521c0b1a1daedd61815c0c5ece50b46
parent13b94cc4d7e10fda332c21702005554747aa35b5 (diff)
downloadtailscale-adding-address-ips-totestcontrolnode.tar.xz
tailscale-adding-address-ips-totestcontrolnode.zip
Added single node test to check Addresses and AllowedIPsadding-address-ips-totestcontrolnode
Signed-off-by: Simeng He <simeng@tailscale.com>
-rw-r--r--tstest/integration/integration_test.go31
1 files changed, 31 insertions, 0 deletions
diff --git a/tstest/integration/integration_test.go b/tstest/integration/integration_test.go
index 154e0120b..be6a85a6b 100644
--- a/tstest/integration/integration_test.go
+++ b/tstest/integration/integration_test.go
@@ -196,6 +196,37 @@ func TestTwoNodes(t *testing.T) {
d2.MustCleanShutdown(t)
}
+func TestNodeAddressIPFields(t *testing.T) {
+ t.Parallel()
+ bins := buildTestBinaries(t)
+
+ env := newTestEnv(t, bins)
+ defer env.Close()
+
+ n1 := newTestNode(t, env)
+ d1 := n1.StartDaemon(t)
+ defer d1.Kill()
+
+ n1.AwaitListening(t)
+ n1.MustUp()
+ n1.AwaitRunning(t)
+
+ testNodes := env.Control.AllNodes()
+
+ if len(testNodes) != 1 {
+ t.Errorf("Expected %d nodes, got %d", 1, len(testNodes))
+ }
+ node := testNodes[0]
+ if len(node.Addresses) == 0 {
+ t.Errorf("Empty Addresses field in node")
+ }
+ if len(node.AllowedIPs) == 0 {
+ t.Errorf("Empty AllowedIPs field in node")
+ }
+
+ d1.MustCleanShutdown(t)
+}
+
// testBinaries are the paths to a tailscaled and tailscale binary.
// These can be shared by multiple nodes.
type testBinaries struct {