Skip to content

Commit

Permalink
Updated the integration test case for s3_lifecycle to validate minimu…
Browse files Browse the repository at this point in the history
…m and maximum object size settings
  • Loading branch information
JavidMinadathAlimohi committed Dec 17, 2024
1 parent ff9bc13 commit 194019a
Showing 1 changed file with 89 additions and 0 deletions.
89 changes: 89 additions & 0 deletions tests/integration/targets/s3_lifecycle/tasks/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -694,6 +694,95 @@
that:
- output is changed

# Check create and delete lifecycle policy with minimum and maximum object size (with prefix)
- name: Create rule with minimum and maximum object size
s3_lifecycle:
name: "{{ bucket_name }}"
rule_id: minimum-object-size-prefix
prefix: /something/
minimum_object_size: 100
maximum_object_size: 1000
state: present
status: enabled
expiration_days: 30
register: output
- assert:
that:
- output is changed

- name: Create rule with minimum object size (idempotency)
s3_lifecycle:
name: "{{ bucket_name }}"
rule_id: minimum-object-size-prefix
prefix: /something/
minimum_object_size: 100
maximum_object_size: 1000
state: present
status: enabled
expiration_days: 30
register: output
- assert:
that:
- output is not changed

- name: Delete rule with minimum and maximum object size
s3_lifecycle:
name: "{{ bucket_name }}"
rule_id: minimum-object-size-prefix
prefix: /something/
minimum_object_size: 100
maximum_object_size: 1000
state: absent
status: enabled
expiration_days: 30
register: output
- assert:
that:
- output is changed

# Check create and delete lifecycle policy with minimum and maximum object size (no prefix)
- name: Create rule with minimum and maximum object size
s3_lifecycle:
name: "{{ bucket_name }}"
rule_id: minimum-object-size-noprefix
minimum_object_size: 100
maximum_object_size: 1000
state: present
status: enabled
expiration_days: 30
register: output
- assert:
that:
- output is changed

- name: Create rule with minimum object size (idempotency)
s3_lifecycle:
name: "{{ bucket_name }}"
rule_id: minimum-object-size-noprefix
minimum_object_size: 100
maximum_object_size: 1000
state: present
status: enabled
expiration_days: 30
register: output
- assert:
that:
- output is not changed

- name: Delete rule with minimum and maximum object size
s3_lifecycle:
name: "{{ bucket_name }}"
rule_id: minimum-object-size-noprefix
minimum_object_size: 100
maximum_object_size: 1000
state: absent
status: enabled
expiration_days: 30
register: output
- assert:
that:
- output is changed

# ============================================================
always:
- name: Ensure all buckets are deleted
Expand Down

0 comments on commit 194019a

Please sign in to comment.