diff --git a/tests/integration/targets/s3_lifecycle/tasks/main.yml b/tests/integration/targets/s3_lifecycle/tasks/main.yml index d9f169561af..947c356ef47 100644 --- a/tests/integration/targets/s3_lifecycle/tasks/main.yml +++ b/tests/integration/targets/s3_lifecycle/tasks/main.yml @@ -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