Skip to content

Commit

Permalink
[Enhance tests][Buckets scenarios] Test that it is possible to list a…
Browse files Browse the repository at this point in the history
…ll buckets
  • Loading branch information
chushenmeshile authored and xiaozhu36 committed Jun 19, 2020
1 parent ead2722 commit b0009fe
Showing 1 changed file with 30 additions and 0 deletions.
30 changes: 30 additions & 0 deletions spec/fog/integration_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -493,6 +493,36 @@
@conn.delete_bucket bucket_name
end

it 'Should possible to list all buckets' do
b1=rand(36**16).to_s(36)
b2=rand(36**16).to_s(36)
b3=rand(36**16).to_s(36)
b4=rand(36**16).to_s(36)
b5=rand(36**16).to_s(36)
b6=rand(36**16).to_s(36)
@conn.put_bucket('bucket-test'+b1)
@conn.put_bucket('bucket-test2'+b2)
@conn.put_bucket('file-test'+b3)
@conn.put_bucket('file-test2'+b4)
@conn.put_bucket('directory-test'+b5)
@conn.put_bucket('directory-test2'+b6)
buckets=@conn.list_buckets['Bucket']
expect(buckets.length).to be >= 6
buckets=(@conn.list_buckets :prefix=>"bucket")['Bucket']
expect(buckets.length).to be >=2
buckets=(@conn.list_buckets :marker=>"file-t")['Bucket']
expect(buckets.length).to be >=4
buckets=(@conn.list_buckets :maxKeys=>"6")['Bucket']
expect(buckets.length).to be(6)
#delete created bucket
@conn.delete_bucket('bucket-test'+b1)
@conn.delete_bucket('bucket-test2'+b2)
@conn.delete_bucket('file-test'+b3)
@conn.delete_bucket('file-test2'+b4)
@conn.delete_bucket('directory-test'+b5)
@conn.delete_bucket('directory-test2'+b6)
end

# Test region is selected according to provider configuration
# check default region is used if no region provided explicitly
# There is need to set a env variable to support setting oss default bucket
Expand Down

0 comments on commit b0009fe

Please sign in to comment.