Skip to content

Commit ea78cb6

Browse files
authored
Fix test helper follow up (#281)
1 parent b95b84b commit ea78cb6

File tree

2 files changed

+21
-23
lines changed

2 files changed

+21
-23
lines changed

tests/test_helper/README.md

Lines changed: 21 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ To use this script, you must have AWS credentials with permission to create and
44

55
To create the S3 buckets and objects that tests will use:
66

7-
``` sh
7+
```sh
88
pip3 install boto3
99
export CRT_S3_TEST_BUCKET_NAME=<bucket_name>
1010
python3 test_helper.py init
@@ -14,7 +14,7 @@ cd aws-c-s3/build/tests && ctest
1414

1515
To clean up the S3 buckets created
1616

17-
``` sh
17+
```sh
1818
export CRT_S3_TEST_BUCKET_NAME=<bucket_name>
1919
python3 test_helper.py clean
2020
```
@@ -23,34 +23,35 @@ python3 test_helper.py clean
2323

2424
### `init` action
2525

26-
- Create `<BUCKET_NAME>` in us-west-2.
27-
- Add the lifecyle to automatic clean up the `upload/` after one day
28-
- Upload files:
29-
- `pre-existing-10MB-aes256-c` [SSE-C](https://docs.aws.amazon.com/AmazonS3/latest/userguide/ServerSideEncryptionCustomerKeys.html#sse-c-highlights) encrypted fille
30-
- `pre-existing-10MB-aes256` [SSE-S3](https://docs.aws.amazon.com/AmazonS3/latest/userguide/specifying-s3-encryption.html) encrypted fille
31-
- `pre-existing-10MB-kms` [SSE-KMS](https://docs.aws.amazon.com/AmazonS3/latest/userguide/UsingKMSEncryption.html) encrypted fille
32-
- `pre-existing-10MB`
33-
- `pre-existing-1MB`
34-
- `pre-existing-empty`
35-
- Create `<BUCKET_NAME>-public` in us-west-2
36-
- Upload files:
37-
- `pre-existing-1MB` 1MB file with public read access.
26+
* Create `<BUCKET_NAME>` in us-west-2.
27+
* Add the lifecyle to automatic clean up the `upload/` after one day
28+
* Upload files:
29+
+ `pre-existing-10MB-aes256-c` [SSE-C](https://docs.aws.amazon.com/AmazonS3/latest/userguide/ServerSideEncryptionCustomerKeys.html#sse-c-highlights) encrypted fille
30+
+ `pre-existing-10MB-aes256` [SSE-S3](https://docs.aws.amazon.com/AmazonS3/latest/userguide/specifying-s3-encryption.html) encrypted fille
31+
+ `pre-existing-10MB-kms` [SSE-KMS](https://docs.aws.amazon.com/AmazonS3/latest/userguide/UsingKMSEncryption.html) encrypted fille
32+
+ `pre-existing-10MB`
33+
+ `pre-existing-1MB`
34+
+ `pre-existing-empty`
35+
* Create `<BUCKET_NAME>-public` in us-west-2
36+
* Upload files:
37+
+ `pre-existing-1MB` 1MB file with public read access.
3838

3939
### `clean` action
4040

41-
- Delete the `<BUCKET_NAME>` and `<BUCKET_NAME>-public` and every object inside them
41+
* Delete the `<BUCKET_NAME>` and `<BUCKET_NAME>-public` and every object inside them
4242

4343
## BUCKET_NAME
4444

4545
You can specify the bucket name to be created either by passing argument to the script or by setting an environment variable, the `bucket_name` passed in takes precedence. If neither of these options is chosen, the `init` action will create a random bucket name. In this case, you will need to set the `CRT_S3_TEST_BUCKET_NAME` environment variable to the printed-out bucket name before running the test.
4646

4747
## Notes
4848

49-
- The MRAP tests are not included in this script, and it's disabled by default. To run those tests, you will need to create a MRAP access point with the buckets have `pre-existing-1MB` in it. Then update `g_test_mrap_endpoint` to the uri of the MRAP endpoint and build with `-DENABLE_MRAP_TESTS=true`.
50-
- To run tests in tests/s3_mock_server_tests.c, initialize the mock S3 server first from [here](./../mock_s3_server/). And build your cmake project with `-ENABLE_MOCK_SERVER_TESTS=true`
51-
- Note: If you are not at the aws-common-runtime AWS team account, you must set environment variable `CRT_S3_TEST_BUCKET_NAME` to the bucket created before running the test.
49+
* The MRAP tests are not included in this script, and it's disabled by default. To run those tests, you will need to create a MRAP access point with the buckets have `pre-existing-1MB` in it. Then update `g_test_mrap_endpoint` to the uri of the MRAP endpoint and build with `-DENABLE_MRAP_TESTS=true`.
50+
* To run tests in tests/s3_mock_server_tests.c, initialize the mock S3 server first from [here](./../mock_s3_server/). And build your cmake project with `-ENABLE_MOCK_SERVER_TESTS=true`
51+
* Note: If you are not at the aws-common-runtime AWS team account, you must set environment variable `CRT_S3_TEST_BUCKET_NAME` to the bucket created before running the test.
52+
* When you see error with "Check your account level S3 settings, public access may be blocked.", Check https://docs.aws.amazon.com/AmazonS3/latest/userguide/configuring-block-public-access-account.html to set `BlockPublicAcls` to false, which enables public read of the object with `public-read` ACL in the bucket.
5253

5354
## TODO
5455

55-
- Automatic the mrap creation
56-
- Instead of hard-coded path and region, make it configurable and pick up from tests.
56+
* Automatic the mrap creation
57+
* Instead of hard-coded path and region, make it configurable and pick up from tests.

tests/test_helper/test_helper.py

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -140,9 +140,6 @@ def create_bucket_with_public_object():
140140
Bucket=PUBLIC_BUCKET_NAME,
141141
PublicAccessBlockConfiguration={
142142
'BlockPublicAcls': False,
143-
'IgnorePublicAcls': False,
144-
'BlockPublicPolicy': False,
145-
'RestrictPublicBuckets': False
146143
}
147144
)
148145
print(f"Bucket {PUBLIC_BUCKET_NAME} created", file=sys.stderr)

0 commit comments

Comments
 (0)