replace static status definition by const
This commit is contained in:
@@ -8,6 +8,7 @@ import (
|
||||
"testing"
|
||||
|
||||
"mediarr/cluster"
|
||||
"mediarr/identity"
|
||||
)
|
||||
|
||||
func TestUpCreatesAndKeepsClusterIdentity(t *testing.T) {
|
||||
@@ -25,9 +26,9 @@ func TestUpCreatesAndKeepsClusterIdentity(t *testing.T) {
|
||||
t.Fatalf("Up : %v", err)
|
||||
}
|
||||
|
||||
identity := node.ClusterIdentity()
|
||||
if len(identity.PublicKey) != 32 {
|
||||
t.Fatalf("clé publique de %d octets, attendu 32", len(identity.PublicKey))
|
||||
clusterIdentity := node.ClusterIdentity()
|
||||
if len(clusterIdentity.PublicKey) != 32 {
|
||||
t.Fatalf("clé publique de %d octets, attendu 32", len(clusterIdentity.PublicKey))
|
||||
}
|
||||
|
||||
principal, err := node.db.Queries.GetClusterPrincipal(context.Background())
|
||||
@@ -40,10 +41,10 @@ func TestUpCreatesAndKeepsClusterIdentity(t *testing.T) {
|
||||
if principal.Name != "cluster" {
|
||||
t.Fatalf("name = %q, attendu cluster", principal.Name)
|
||||
}
|
||||
if principal.Status != "active" {
|
||||
if principal.Status != identity.StatusActive {
|
||||
t.Fatalf("status = %q, attendu active", principal.Status)
|
||||
}
|
||||
if !bytes.Equal(principal.PublicKey, identity.PublicKey) {
|
||||
if !bytes.Equal(principal.PublicKey, clusterIdentity.PublicKey) {
|
||||
t.Fatal("la clé publique en base ne correspond pas à la clé chargée")
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user