Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

test_bucket_policy_elements_NotAction fails because correct expectations are not kept for effect=Allow #9968

Open
mashetty330 opened this issue Jun 20, 2024 · 2 comments · May be fixed by #10938
Assignees
Labels
MCG Multi Cloud Gateway / NooBaa related issues Squad/Red

Comments

@mashetty330
Copy link
Contributor

We expect the delete operation to fail at:

        if effect == "Allow":
            # Put Object is allowed
            logger.info("Writing index data to the bucket")
            assert s3_put_object(
                s3_obj=obc_obj,
                bucketname=obc_obj.bucket_name,
                object_key="index.html",
                data=index,
                content_type="text/html",
            ), "Failed to put object."

            # Delete bucket get access denied.
            logger.info(f"Deleting bucket {obc_obj.bucket_name}")
            try:
                s3_delete_bucket_website(s3_obj=obc_obj, bucketname=obc_obj.bucket_name)
                raise UnexpectedBehaviour(
                    "Failed: Bucket got deleted, expect to get AccessDenied."
                )

This expectation doesnt seem to be correct as per my understanding of the NotAction. NotAction parameters will exclude the action from the effect. So in this case, by default bucket can be deleted. By excluding DeleteBucket from the action list with effect=Allow doesnt make it to have deny affect!

This needs more analysis.

@mashetty330 mashetty330 added MCG Multi Cloud Gateway / NooBaa related issues Squad/Red labels Jun 20, 2024
@DanielOsypenko
Copy link
Contributor

reproduces with ROSA HCP https://ocs4-jenkins-csb-odf-qe.apps.ocp-c1.prod.psi.redhat.com/job/qe-deploy-ocs-cluster/41837/consoleText
Also, the test is marked tier1 and was running as a tier1. But in the spreadsheet, it is a tier4b test which is odd. Please pay attention when fixing it.
image
@udaysk23

@Shilpi-Das1
Copy link

The test case fails for IBM Power 4.17.0-124 build as well

            # Delete bucket get access denied.
            logger.info(f"Deleting bucket {obc_obj.bucket_name}")
            try:
                s3_delete_bucket_website(s3_obj=obc_obj, bucketname=obc_obj.bucket_name)
>               raise UnexpectedBehaviour(
                    "Failed: Bucket got deleted, expect to get AccessDenied."
                )
E               ocs_ci.ocs.exceptions.UnexpectedBehaviour: Failed: Bucket got deleted, expect to get AccessDenied.

tests/functional/object/mcg/test_bucket_policy.py:982: UnexpectedBehaviour

@udaysk23 udaysk23 self-assigned this Nov 21, 2024
@udaysk23 udaysk23 linked a pull request Nov 27, 2024 that will close this issue
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
MCG Multi Cloud Gateway / NooBaa related issues Squad/Red
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants