Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Bugfix/copy object bugs #1200

Merged
merged 6 commits into from
Jul 30, 2015
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Add riak_test cases for non-existent source key in PUT Copy
  • Loading branch information
shino committed Jul 30, 2015
commit d92f5b228794115c93a034163ec7b5697246da26
11 changes: 11 additions & 0 deletions riak_test/tests/put_copy_test.erl
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,7 @@ confirm() ->
ok = verify_others_copy(UserConfig, UserConfig2),
ok = verify_multipart_copy(UserConfig),
ok = verify_security(UserConfig, UserConfig2, UserConfig3),
ok = verify_source_not_found(UserConfig),

?assertEqual([{delete_marker, false}, {version_id, "null"}],
erlcloud_s3:delete_object(?BUCKET, ?KEY, UserConfig)),
Expand Down Expand Up @@ -237,3 +238,13 @@ verify_security(Alice, Bob, Charlie) ->
?assertEqual("403", Status),

ok.

verify_source_not_found(UserConfig) ->
NonExistingKey = "non-existent-source",
{'EXIT', {{aws_error, {http_error, 404, _, ErrorXml}}, _Stack}} =
(catch erlcloud_s3:copy_object(?BUCKET2, ?KEY2,
?BUCKET, NonExistingKey, UserConfig)),
lager:debug("ErrorXml: ~s", [ErrorXml]),
?assert(string:str(ErrorXml,
"<Resource>/" ++ ?BUCKET ++
"/" ++ NonExistingKey ++ "</Resource>") > 0).