mirror of
https://github.com/netbirdio/netbird.git
synced 2024-11-22 16:13:31 +01:00
test: add setup key UUID format validation
This commit is contained in:
parent
1b056ab75a
commit
22fdb0a029
@ -1,6 +1,7 @@
|
||||
package server
|
||||
|
||||
import (
|
||||
"github.com/google/uuid"
|
||||
"testing"
|
||||
"time"
|
||||
)
|
||||
@ -91,4 +92,9 @@ func assertKey(t *testing.T, key *SetupKey, expectedName string, expectedRevoke
|
||||
if key.CreatedAt.Sub(expectedCreatedAt).Round(time.Hour) != 0 {
|
||||
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