Skip to content

Commit

Permalink
test/s3: keep the buck name lenght under control
Browse files Browse the repository at this point in the history
The bucket_name variable length is 63 or below. If we add a prefix we
can generate an invalid bucket name.

In addition, the test has little value since it just ensures end-point
behaves as expected. The code coverage in the module itself remains
the same.

See: https://docs.aws.amazon.com/AmazonS3/latest/userguide/bucketnamingrules.html
  • Loading branch information
goneri committed Apr 26, 2021
1 parent 042b8be commit a78d78f
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 31 deletions.
30 changes: 0 additions & 30 deletions tests/integration/targets/aws_s3/tasks/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -442,36 +442,6 @@
that:
- result is changed

- name: test create a bucket with a dot in the name
aws_s3:
bucket: "{{ bucket_name + '.bucket' }}"
mode: create
register: result

- assert:
that:
- result is changed

- name: test delete a bucket with a dot in the name
aws_s3:
bucket: "{{ bucket_name + '.bucket' }}"
mode: delete
register: result

- assert:
that:
- result is changed

- name: test delete a nonexistent bucket
aws_s3:
bucket: "{{ bucket_name + '.bucket' }}"
mode: delete
register: result

- assert:
that:
- result is not changed

- name: make tempfile 4 GB for OSX
command:
_raw_params: "dd if=/dev/zero of={{ tmpdir.path }}/largefile bs=1m count=4096"
Expand Down
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
bucket_name: '{{ resource_prefix }}-{{ inventory_hostname | regex_replace("_","-") }}'
bucket_name: '{{ resource_prefix }}'

0 comments on commit a78d78f

Please sign in to comment.