A google_storage_bucket_objects is used to test a Google BucketObject resource
describe google_storage_bucket_objects(bucket: 'bucket-with-object') do
its('object_names') { should include 'image1' }
its('count') { should be <= 10 }
end
describe google_storage_bucket_objects(bucket: 'bucket-name') do
its('count') { should be <= 100 }
end
describe google_storage_bucket_objects(bucket: 'bucket-name') do
its('object_buckets'){ should include 'my_expected_bucket' }
end
describe google_storage_bucket_objects(bucket: 'bucket-name') do
its('object_names'){ should include 'my_expected_object' }
end
describe google_storage_bucket_objects(bucket: 'bucket-name').where(object_created_time > Time.now - 60*60*24) do
it { should exist }
end
Properties that can be accessed from the google_storage_bucket_objects resource:
See the google_storage_bucket_object resource for more information.
object_bucketsgoogle_storage_bucket_object bucketobjectsgoogle_storage_bucket_object objectcontent_typesgoogle_storage_bucket_object content_typecrc32csgoogle_storage_bucket_object crc32cetagsgoogle_storage_bucket_object etaggenerationsgoogle_storage_bucket_object generationidsgoogle_storage_bucket_object idmd5_hashesgoogle_storage_bucket_object md5_hashmedia_linksgoogle_storage_bucket_object media_linkmetagenerationsgoogle_storage_bucket_object metagenerationobject_namesgoogle_storage_bucket_object namesizesgoogle_storage_bucket_object sizestorage_classesgoogle_storage_bucket_object storage_classobject_created_timesgoogle_storage_bucket_object time_createdtime_deletedsgoogle_storage_bucket_object time_deletedtime_storage_class_updatedsgoogle_storage_bucket_object time_storage_class_updatedtime_updatedsgoogle_storage_bucket_object time_updatedThis resource supports all of the above properties as filter criteria, which can be used with where as a block or a method.
Ensure the Google Cloud Storage is enabled for the current project.
© Chef Software, Inc.
Licensed under the Creative Commons Attribution 3.0 Unported License.
The Chef™ Mark and Chef Logo are either registered trademarks/service marks or trademarks/servicemarks of Chef, in the United States and other countries and are used with Chef Inc's permission.
We are not affiliated with, endorsed or sponsored by Chef Inc.
https://docs.chef.io/inspec/resources/google_storage_bucket_objects/