Skip to content

Commit

Permalink
test(storage): add object to encryption test to reduce rate limit iss…
Browse files Browse the repository at this point in the history
…ues (#8938)
  • Loading branch information
BrennaEpp authored and bhshkh committed Nov 3, 2023
1 parent b4af3bd commit 5520a0b
Showing 1 changed file with 7 additions and 3 deletions.
10 changes: 7 additions & 3 deletions storage/integration_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -2538,9 +2538,13 @@ func TestIntegration_Encryption(t *testing.T) {

checkRead("first object", obj, key, contents)

// We create 2 objects here and we can interleave operations to get around
// the rate limit for object mutation operations (create, update, and delete).
obj2 := client.Bucket(bucket).Object("customer-encryption-2")
obj4 := client.Bucket(bucket).Object("customer-encryption-4")

// Copying an object without the key should fail.
if _, err := obj2.CopierFrom(obj).Run(ctx); err == nil {
if _, err := obj4.CopierFrom(obj).Run(ctx); err == nil {
t.Fatal("want error, got nil")
}
// Copying an object with the key should succeed.
Expand Down Expand Up @@ -2589,11 +2593,11 @@ func TestIntegration_Encryption(t *testing.T) {

// You can't compose one or more unencrypted source objects into an
// encrypted destination object.
_, err := obj2.CopierFrom(obj2.Key(key)).Run(ctx) // unencrypt obj2
_, err := obj4.CopierFrom(obj2.Key(key)).Run(ctx) // unencrypt obj2
if err != nil {
t.Fatal(err)
}
if _, err := obj3.Key(key).ComposerFrom(obj2).Run(ctx); err == nil {
if _, err := obj3.Key(key).ComposerFrom(obj4).Run(ctx); err == nil {
t.Fatal("got nil, want error")
}
})
Expand Down

0 comments on commit 5520a0b

Please sign in to comment.