moto icon indicating copy to clipboard operation
moto copied to clipboard

Initial work for split out of s3control

Open SimonToftegaard opened this issue 4 years ago • 4 comments

As discussed in #4707 here is the initial separate implementation of s3control

SimonToftegaard avatar Dec 22 '21 18:12 SimonToftegaard

Thanks @SimonToftegaard

bblommers avatar Dec 22 '21 20:12 bblommers

Seems like the unit tests in server mode do not get intercepted correctly by the mock_s3control, not sure how to fix this.

SimonToftegaard avatar Dec 23 '21 08:12 SimonToftegaard

One potential cause could be that the request is picked up by the S3-module, instead of S3control, because the regex for the S3-urls will still catch requests to s3control-urls. That's just a hunch though, I'd have look a little deeper into it to verify whether that's the case

bblommers avatar Dec 23 '21 10:12 bblommers

OK, found the issue - ServerMode tests will always fail for S3Control.
From the original tests:

# All tests for s3-control cannot be run under the server without a modification of the
# hosts file on your system. This is due to the fact that the URL to the host is in the form of:
# ACCOUNT_ID.s3-control.amazonaws.com <-- That Account ID part is the problem. If you want to
# make use of the moto server, update your hosts file for `THE_ACCOUNT_ID_FOR_MOTO.localhost`
# and this will work fine.

#4745 contains a clean implementation of this change, without any changes to the logic or tests. We will merge that one first, to ensure we're not breaking anything else. After that we can have a look at extending the logic to allow other account ID's.

bblommers avatar Jan 08 '22 21:01 bblommers