From b0a4ee4dfeefa87a245b7a4fc95e60d2a67270ad Mon Sep 17 00:00:00 2001 From: Kristoffer Dalby Date: Fri, 14 Oct 2022 12:18:28 +0200 Subject: [PATCH] test login with one node Signed-off-by: Kristoffer Dalby --- integration/scenario_test.go | 19 ++++++++++++++++--- 1 file changed, 16 insertions(+), 3 deletions(-) diff --git a/integration/scenario_test.go b/integration/scenario_test.go index 8811b2f8..c13784b9 100644 --- a/integration/scenario_test.go +++ b/integration/scenario_test.go @@ -21,6 +21,7 @@ func IntegrationSkip(t *testing.T) { func TestHeadscale(t *testing.T) { IntegrationSkip(t) + var err error scenario, err := NewScenario() @@ -106,6 +107,8 @@ func TestTailscaleNodesJoiningHeadcale(t *testing.T) { namespace := "join-node-test" + count := 1 + scenario, err := NewScenario() if err != nil { t.Errorf("failed to create scenario: %s", err) @@ -137,13 +140,13 @@ func TestTailscaleNodesJoiningHeadcale(t *testing.T) { }) t.Run("create-tailscale", func(t *testing.T) { - err := scenario.CreateTailscaleNodesInNamespace(namespace, "1.32.0", 2) + err := scenario.CreateTailscaleNodesInNamespace(namespace, "1.30.2", count) if err != nil { t.Errorf("failed to add tailscale nodes: %s", err) } - if clients := len(scenario.namespaces[namespace].Clients); clients != 2 { - t.Errorf("wrong number of tailscale clients: %d != %d", clients, 2) + if clients := len(scenario.namespaces[namespace].Clients); clients != count { + t.Errorf("wrong number of tailscale clients: %d != %d", clients, count) } }) @@ -157,7 +160,17 @@ func TestTailscaleNodesJoiningHeadcale(t *testing.T) { if err != nil { t.Errorf("failed to login: %s", err) } + }) + t.Run("get-ips", func(t *testing.T) { + ips, err := scenario.GetIPs(namespace) + if err != nil { + t.Errorf("failed to get tailscale ips: %s", err) + } + + if len(ips) != count*2 { + t.Errorf("got the wrong amount of tailscale ips, %d != %d", len(ips), count*2) + } }) err = scenario.Shutdown()