mirror of
https://github.com/netbirdio/netbird.git
synced 2025-04-18 16:38:24 +02:00
test: add setup key UUID format validation
This commit is contained in:
parent
1b056ab75a
commit
22fdb0a029
@ -1,6 +1,7 @@
|
|||||||
package server
|
package server
|
||||||
|
|
||||||
import (
|
import (
|
||||||
|
"github.com/google/uuid"
|
||||||
"testing"
|
"testing"
|
||||||
"time"
|
"time"
|
||||||
)
|
)
|
||||||
@ -91,4 +92,9 @@ func assertKey(t *testing.T, key *SetupKey, expectedName string, expectedRevoke
|
|||||||
if key.CreatedAt.Sub(expectedCreatedAt).Round(time.Hour) != 0 {
|
if key.CreatedAt.Sub(expectedCreatedAt).Round(time.Hour) != 0 {
|
||||||
t.Errorf("expected setup key to have CreatedAt ~ %v, got %v", expectedCreatedAt, key.CreatedAt)
|
t.Errorf("expected setup key to have CreatedAt ~ %v, got %v", expectedCreatedAt, key.CreatedAt)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
_, err := uuid.Parse(key.Key)
|
||||||
|
if err != nil {
|
||||||
|
t.Errorf("expected key to be a valid UUID, got %v, %v", key.Key, err)
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user