mirror of
https://github.com/juanfont/headscale.git
synced 2024-11-29 18:33:05 +00:00
use variable for namespace
Signed-off-by: Kristoffer Dalby <kristoffer@tailscale.com>
This commit is contained in:
parent
13aa845c69
commit
aef77a113c
1 changed files with 5 additions and 3 deletions
|
@ -27,6 +27,8 @@ func TestHeadscale(t *testing.T) {
|
||||||
|
|
||||||
var err error
|
var err error
|
||||||
|
|
||||||
|
namespace := "test-space"
|
||||||
|
|
||||||
scenario, err := NewScenario()
|
scenario, err := NewScenario()
|
||||||
if err != nil {
|
if err != nil {
|
||||||
t.Errorf("failed to create scenario: %s", err)
|
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) {
|
t.Run("create-namespace", func(t *testing.T) {
|
||||||
err := scenario.CreateNamespace("test-space")
|
err := scenario.CreateNamespace(namespace)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
t.Errorf("failed to create namespace: %s", err)
|
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.Errorf("namespace is not in scenario")
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
|
|
||||||
t.Run("create-auth-key", func(t *testing.T) {
|
t.Run("create-auth-key", func(t *testing.T) {
|
||||||
_, err := scenario.CreatePreAuthKey("test-space")
|
_, err := scenario.CreatePreAuthKey(namespace)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
t.Errorf("failed to create preauthkey: %s", err)
|
t.Errorf("failed to create preauthkey: %s", err)
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue