From aef77a113ccca4734ef371cfd0996cbd61ef85c9 Mon Sep 17 00:00:00 2001 From: Kristoffer Dalby Date: Fri, 14 Oct 2022 12:38:34 +0200 Subject: [PATCH] use variable for namespace Signed-off-by: Kristoffer Dalby --- integration/scenario_test.go | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/integration/scenario_test.go b/integration/scenario_test.go index 9e97bc31..ff6f3e85 100644 --- a/integration/scenario_test.go +++ b/integration/scenario_test.go @@ -27,6 +27,8 @@ func TestHeadscale(t *testing.T) { var err error + namespace := "test-space" + scenario, err := NewScenario() if err != nil { t.Errorf("failed to create scenario: %s", err) @@ -46,18 +48,18 @@ func TestHeadscale(t *testing.T) { }) t.Run("create-namespace", func(t *testing.T) { - err := scenario.CreateNamespace("test-space") + err := scenario.CreateNamespace(namespace) if err != nil { t.Errorf("failed to create namespace: %s", err) } - if _, ok := scenario.namespaces["test-space"]; !ok { + if _, ok := scenario.namespaces[namespace]; !ok { t.Errorf("namespace is not in scenario") } }) t.Run("create-auth-key", func(t *testing.T) { - _, err := scenario.CreatePreAuthKey("test-space") + _, err := scenario.CreatePreAuthKey(namespace) if err != nil { t.Errorf("failed to create preauthkey: %s", err) }