Test fixes

This commit is contained in:
freddygv 2022-08-08 08:31:47 -06:00
parent 01b0cbcbd7
commit 67aa7ed15c
2 changed files with 5 additions and 7 deletions

View File

@ -485,9 +485,9 @@ func TestFSM_SnapshotRestore_OSS(t *testing.T) {
}, },
SecretsRequest: &pbpeering.SecretsWriteRequest{ SecretsRequest: &pbpeering.SecretsWriteRequest{
PeerID: "1fabcd52-1d46-49b0-b1d8-71559aee47f5", PeerID: "1fabcd52-1d46-49b0-b1d8-71559aee47f5",
Request: &pbpeering.SecretsWriteRequest_PromotePending{ Request: &pbpeering.SecretsWriteRequest_GenerateToken{
PromotePending: &pbpeering.SecretsWriteRequest_PromotePendingRequest{ GenerateToken: &pbpeering.SecretsWriteRequest_GenerateTokenRequest{
ActiveStreamSecret: "baaeea83-8419-4aa8-ac89-14e7246a3d2f", EstablishmentSecret: "baaeea83-8419-4aa8-ac89-14e7246a3d2f",
}, },
}, },
}, },
@ -503,7 +503,6 @@ func TestFSM_SnapshotRestore_OSS(t *testing.T) {
// Issue two more secrets writes so that there are three secrets associated with the peering: // Issue two more secrets writes so that there are three secrets associated with the peering:
// - Establishment: "389bbcdf-1c31-47d6-ae96-f2a3f4c45f84" // - Establishment: "389bbcdf-1c31-47d6-ae96-f2a3f4c45f84"
// - Pending: "0b7812d4-32d9-4e54-b1b3-4d97084982a0" // - Pending: "0b7812d4-32d9-4e54-b1b3-4d97084982a0"
// - Active: "baaeea83-8419-4aa8-ac89-14e7246a3d2f"
require.NoError(t, fsm.state.PeeringSecretsWrite(34, &pbpeering.SecretsWriteRequest{ require.NoError(t, fsm.state.PeeringSecretsWrite(34, &pbpeering.SecretsWriteRequest{
PeerID: "1fabcd52-1d46-49b0-b1d8-71559aee47f5", PeerID: "1fabcd52-1d46-49b0-b1d8-71559aee47f5",
Request: &pbpeering.SecretsWriteRequest_ExchangeSecret{ Request: &pbpeering.SecretsWriteRequest_ExchangeSecret{
@ -837,12 +836,11 @@ func TestFSM_SnapshotRestore_OSS(t *testing.T) {
}, },
Stream: &pbpeering.PeeringSecrets_Stream{ Stream: &pbpeering.PeeringSecrets_Stream{
PendingSecretID: "0b7812d4-32d9-4e54-b1b3-4d97084982a0", PendingSecretID: "0b7812d4-32d9-4e54-b1b3-4d97084982a0",
ActiveSecretID: "baaeea83-8419-4aa8-ac89-14e7246a3d2f",
}, },
} }
prototest.AssertDeepEqual(t, expectSecrets, secretsRestored) prototest.AssertDeepEqual(t, expectSecrets, secretsRestored)
uuids := []string{"389bbcdf-1c31-47d6-ae96-f2a3f4c45f84", "0b7812d4-32d9-4e54-b1b3-4d97084982a0", "baaeea83-8419-4aa8-ac89-14e7246a3d2f"} uuids := []string{"389bbcdf-1c31-47d6-ae96-f2a3f4c45f84", "0b7812d4-32d9-4e54-b1b3-4d97084982a0"}
for _, id := range uuids { for _, id := range uuids {
free, err := fsm2.state.ValidateProposedPeeringSecretUUID(id) free, err := fsm2.state.ValidateProposedPeeringSecretUUID(id)
require.NoError(t, err) require.NoError(t, err)