-
Notifications
You must be signed in to change notification settings - Fork 5
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* test: Add test scenarios * fix put bucket acl cannot blank * fix blank array compacted * add delete object with metadata test * implement scenario test for lifecycle and notification
- Loading branch information
Showing
8 changed files
with
169 additions
and
7 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Submodule qingstor
updated
from c956b1 to 8c87b2
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,61 @@ | ||
# +------------------------------------------------------------------------- | ||
# | Copyright (C) 2016 Yunify, Inc. | ||
# +------------------------------------------------------------------------- | ||
# | Licensed under the Apache License, Version 2.0 (the "License"); | ||
# | you may not use this work except in compliance with the License. | ||
# | You may obtain a copy of the License in the LICENSE file, or at: | ||
# | | ||
# | http://www.apache.org/licenses/LICENSE-2.0 | ||
# | | ||
# | Unless required by applicable law or agreed to in writing, software | ||
# | distributed under the License is distributed on an "AS IS" BASIS, | ||
# | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
# | See the License for the specific language governing permissions and | ||
# | limitations under the License. | ||
# +------------------------------------------------------------------------- | ||
|
||
require 'json' | ||
|
||
require './qingstor-sdk' | ||
|
||
# ---------------------------------------------------------------------------- | ||
|
||
bucket = nil | ||
|
||
When(/^put bucket lifecycle:$/) do |lifecycle_string| | ||
bucket = @qs_service.bucket @test_config[:bucket_name], @test_config[:zone] | ||
raise if bucket.nil? | ||
|
||
lifecycle = JSON.parse lifecycle_string | ||
@put_bucket_lifecycle_output = bucket.put_lifecycle rule: lifecycle['rule'] | ||
end | ||
|
||
Then(/^put bucket lifecycle status code is (\d+)$/) do |status_code| | ||
raise unless @put_bucket_lifecycle_output[:status_code].to_s == status_code.to_s | ||
end | ||
|
||
# ---------------------------------------------------------------------------- | ||
|
||
When(/^get bucket lifecycle$/) do | ||
@get_bucket_lifecycle_output = bucket.get_lifecycle | ||
end | ||
|
||
Then(/^get bucket lifecycle status code is (\d+)$/) do |status_code| | ||
raise unless @get_bucket_lifecycle_output[:status_code].to_s == status_code.to_s | ||
end | ||
|
||
Then(/^get bucket lifecycle should have filter prefix "(.*)"$/) do |name| | ||
ok = false | ||
@get_bucket_lifecycle_output[:rule].each { |rule| ok = true if rule[:filter][:prefix] == name } | ||
raise unless ok | ||
end | ||
|
||
# ---------------------------------------------------------------------------- | ||
|
||
When(/^delete bucket lifecycle$/) do | ||
@delete_bucket_lifecycle_output = bucket.delete_lifecycle | ||
end | ||
|
||
Then(/^delete bucket lifecycle status code is (\d+)$/) do |status_code| | ||
raise unless @delete_bucket_lifecycle_output[:status_code].to_s == status_code.to_s | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,61 @@ | ||
# +------------------------------------------------------------------------- | ||
# | Copyright (C) 2016 Yunify, Inc. | ||
# +------------------------------------------------------------------------- | ||
# | Licensed under the Apache License, Version 2.0 (the "License"); | ||
# | you may not use this work except in compliance with the License. | ||
# | You may obtain a copy of the License in the LICENSE file, or at: | ||
# | | ||
# | http://www.apache.org/licenses/LICENSE-2.0 | ||
# | | ||
# | Unless required by applicable law or agreed to in writing, software | ||
# | distributed under the License is distributed on an "AS IS" BASIS, | ||
# | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
# | See the License for the specific language governing permissions and | ||
# | limitations under the License. | ||
# +------------------------------------------------------------------------- | ||
|
||
require 'json' | ||
|
||
require './qingstor-sdk' | ||
|
||
# ---------------------------------------------------------------------------- | ||
|
||
bucket = nil | ||
|
||
When(/^put bucket notification:$/) do |notification_string| | ||
bucket = @qs_service.bucket @test_config[:bucket_name], @test_config[:zone] | ||
raise if bucket.nil? | ||
|
||
notify = JSON.parse notification_string | ||
@put_bucket_notification_output = bucket.put_notification notifications: notify['notifications'] | ||
end | ||
|
||
Then(/^put bucket notification status code is (\d+)$/) do |status_code| | ||
raise unless @put_bucket_notification_output[:status_code].to_s == status_code.to_s | ||
end | ||
|
||
# ---------------------------------------------------------------------------- | ||
|
||
When(/^get bucket notification$/) do | ||
@get_bucket_notification_output = bucket.get_notification | ||
end | ||
|
||
Then(/^get bucket notification status code is (\d+)$/) do |status_code| | ||
raise unless @get_bucket_notification_output[:status_code].to_s == status_code.to_s | ||
end | ||
|
||
Then(/^get bucket notification should have cloudfunc "(.*)"$/) do |name| | ||
ok = false | ||
@get_bucket_notification_output[:notifications].each { |notify| ok = true if notify[:cloudfunc] == name } | ||
raise unless ok | ||
end | ||
|
||
# ---------------------------------------------------------------------------- | ||
|
||
When(/^delete bucket notification$/) do | ||
@delete_bucket_notification_output = bucket.delete_notification | ||
end | ||
|
||
Then(/^delete bucket notification status code is (\d+)$/) do |status_code| | ||
raise unless @delete_bucket_notification_output[:status_code].to_s == status_code.to_s | ||
end |
Submodule features
updated
from e06e81 to e96a4a
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters