Skip to content

Commit

Permalink
tests: implement TestMiddleEnd_UpdateEncryptedVolume
Browse files Browse the repository at this point in the history
Signed-off-by: Boris Glimcher <[email protected]>
  • Loading branch information
glimchb committed Mar 23, 2023
1 parent 66ebdbe commit d36704d
Show file tree
Hide file tree
Showing 2 changed files with 226 additions and 74 deletions.
8 changes: 6 additions & 2 deletions pkg/middleend/middleend.go
Original file line number Diff line number Diff line change
Expand Up @@ -130,7 +130,9 @@ func (s *Server) UpdateEncryptedVolume(_ context.Context, in *pb.UpdateEncrypted
}
log.Printf("Received from SPDK: %v", result1)
if !result1 {
log.Printf("Could not delete: %v", in)
msg := fmt.Sprintf("Could not delete Crypto: %s", in.EncryptedVolume.EncryptedVolumeId.Value)
log.Print(msg)
return nil, status.Errorf(codes.InvalidArgument, msg)
}
// now delete a key
params0 := models.AccelCryptoKeyDestroyParams{
Expand All @@ -144,7 +146,9 @@ func (s *Server) UpdateEncryptedVolume(_ context.Context, in *pb.UpdateEncrypted
}
log.Printf("Received from SPDK: %v", result0)
if !result0 {
log.Printf("Could not destroy Crypto Key: %v", in)
msg := fmt.Sprintf("Could not destroy Crypto Key: %v", params0.KeyName)
log.Print(msg)
return nil, status.Errorf(codes.InvalidArgument, msg)
}
// now create a new key
r := regexp.MustCompile("ENCRYPTION_TYPE_([A-Z_]+)_")
Expand Down
Loading

0 comments on commit d36704d

Please sign in to comment.