)]}'
{"ironic_tempest_plugin/tests/api/base.py":[{"author":{"_account_id":11655,"name":"Julia Kreger","email":"juliaashleykreger@gmail.com","username":"jkreger","status":"Flying to the moon with a Jetpack!"},"change_message_id":"6daec7cd2e54571f6a6a1784c61c2ba1f636ecf4","unresolved":true,"context_lines":[{"line_number":43,"context_line":"                  \u0027volume_target\u0027, \u0027chassis\u0027, \u0027deploy_template\u0027]"},{"line_number":44,"context_line":""},{"line_number":45,"context_line":""},{"line_number":46,"context_line":"def attempt_all_valid_credentials(for_policy, expected_empty_body\u003d[]):"},{"line_number":47,"context_line":"    \"\"\"Decorator to support policy testing.\"\"\""},{"line_number":48,"context_line":"    if not isinstance(for_policy, str):"},{"line_number":49,"context_line":"        raise TypeError(\u0027Credential testing decorator requires a policy value\u0027"},{"line_number":50,"context_line":"                        \u0027to be supplied for the decorator to log.\u0027)"},{"line_number":51,"context_line":""},{"line_number":52,"context_line":"    def decorator(f):"},{"line_number":53,"context_line":"        @functools.wraps(f)"},{"line_number":54,"context_line":"        def wrapper(cls, *args, **kwargs):"},{"line_number":55,"context_line":"            for credential in cls.credentials:"},{"line_number":56,"context_line":"                try:"},{"line_number":57,"context_line":"                    cls.credential \u003d credential"},{"line_number":58,"context_line":"                    cls.use_client \u003d getattr(cls, \u0027os_%s\u0027 % cls.credential)"},{"line_number":59,"context_line":"                    result \u003d f(*args, **kwargs)"},{"line_number":60,"context_line":"                except lib_exc.Forbidden:"},{"line_number":61,"context_line":"                    if credential in cls.valid_credentials:"},{"line_number":62,"context_line":"                        raise"},{"line_number":63,"context_line":"                if (credential not in cls.valid_credentials"},{"line_number":64,"context_line":"                        and credential not in expected_empty_body):"},{"line_number":65,"context_line":"                    raise exceptions.UnexpectedSuccess("},{"line_number":66,"context_line":"                        client\u003dcls.use_client.baremetal.BaremetalClient(),"},{"line_number":67,"context_line":"                        policy\u003dfor_policy)"},{"line_number":68,"context_line":"                # In the event of an empty body, we need to let"},{"line_number":69,"context_line":"                # the caller handle the result, since we don\u0027t"},{"line_number":70,"context_line":"                # know the lower level context."},{"line_number":71,"context_line":"            return result"},{"line_number":72,"context_line":"        return wrapper"},{"line_number":73,"context_line":"    return decorator"},{"line_number":74,"context_line":""},{"line_number":75,"context_line":""},{"line_number":76,"context_line":"def creates(resource):"},{"line_number":77,"context_line":"    \"\"\"Decorator that adds resources to the appropriate cleanup list.\"\"\""}],"source_content_type":"text/x-python","patch_set":18,"id":"0dd958fc_f6727030","line":74,"range":{"start_line":46,"start_character":0,"end_line":74,"end_character":0},"updated":"2022-02-04 17:32:52.000000000","message":"so this won\u0027t work, because accessing the class cannot be done in the decorator. Instead exploring ysing ddt and yaml to drive the tempest internal client tooling.","commit_id":"902693b2e83f14ceb4bba6dab06bce74ad35f219"}],"ironic_tempest_plugin/tests/api/test_nodes.py":[{"author":{"_account_id":4571,"name":"Steve Baker","email":"sbaker@redhat.com","username":"steve-stevebaker"},"change_message_id":"8011c2482b49be606bad04bd7632dc63f5eecec0","unresolved":true,"context_lines":[{"line_number":27,"context_line":"class TestNodeSystemAdminOnlyOperations(base.BaseBaremetalTest):"},{"line_number":28,"context_line":"    \"\"\"Tests for actions resticted to System Administrators.\"\"\""},{"line_number":29,"context_line":""},{"line_number":30,"context_line":"    valid_credentials \u003d [\u0027system_admin\u0027]"},{"line_number":31,"context_line":"    secure_rbac_test \u003d True"},{"line_number":32,"context_line":"    min_microversion \u003d \"1.71\""},{"line_number":33,"context_line":""}],"source_content_type":"text/x-python","patch_set":1,"id":"355ea102_6245b309","line":30,"updated":"2021-11-24 22:46:25.000000000","message":"I like this model, but I wondered how to efficiently write Forbidden tests for project scope where the resources are in *another* project. But you could always subclass a test class and have different valid_credentials etc. Very clean.","commit_id":"d08d514bf3c4c8a6b6d1374bab881a44b799c66b"},{"author":{"_account_id":11655,"name":"Julia Kreger","email":"juliaashleykreger@gmail.com","username":"jkreger","status":"Flying to the moon with a Jetpack!"},"change_message_id":"3295cae540ee14f94dae85457ad3bc391cbcbe51","unresolved":true,"context_lines":[{"line_number":27,"context_line":"class TestNodeSystemAdminOnlyOperations(base.BaseBaremetalTest):"},{"line_number":28,"context_line":"    \"\"\"Tests for actions resticted to System Administrators.\"\"\""},{"line_number":29,"context_line":""},{"line_number":30,"context_line":"    valid_credentials \u003d [\u0027system_admin\u0027]"},{"line_number":31,"context_line":"    secure_rbac_test \u003d True"},{"line_number":32,"context_line":"    min_microversion \u003d \"1.71\""},{"line_number":33,"context_line":""}],"source_content_type":"text/x-python","patch_set":1,"id":"d0348389_bf0c3188","line":30,"in_reply_to":"355ea102_6245b309","updated":"2021-11-25 00:52:55.000000000","message":"I\u0027m fairly sure, and I\u0027d have to go dig into the magic under the tempest hood,but I think it will set up alternative clients if you ask for it. So It hink we could likely end up with an alterative project client to create everything in. Those tests would definitely be more complex than these, but we\u0027re in just raw CD, of the CRUD territory.","commit_id":"d08d514bf3c4c8a6b6d1374bab881a44b799c66b"},{"author":{"_account_id":11655,"name":"Julia Kreger","email":"juliaashleykreger@gmail.com","username":"jkreger","status":"Flying to the moon with a Jetpack!"},"change_message_id":"6daec7cd2e54571f6a6a1784c61c2ba1f636ecf4","unresolved":true,"context_lines":[{"line_number":27,"context_line":"class TestNodeSystemAdminOnlyOperations(base.BaseBaremetalTest):"},{"line_number":28,"context_line":"    \"\"\"Tests for actions resticted to System Administrators.\"\"\""},{"line_number":29,"context_line":""},{"line_number":30,"context_line":"    valid_credentials \u003d [\u0027system_admin\u0027]"},{"line_number":31,"context_line":"    secure_rbac_test \u003d True"},{"line_number":32,"context_line":"    min_microversion \u003d \"1.71\""},{"line_number":33,"context_line":""}],"source_content_type":"text/x-python","patch_set":1,"id":"91ca0b59_c3b202fe","line":30,"in_reply_to":"d0348389_bf0c3188","updated":"2022-02-04 17:32:52.000000000","message":"So we would create a test where we define something like \u0027project_alt_admin\u0027 or \u0027project_alt_member\u0027, or even \u0027project_alt_reader\u0027 and tempest would do the right thing. We would then use those invoked clients. i.e. cls.os_project_alt_$ROLE.baremetal_client to do $other_thing. At least for cross-project. For these, I guess the alts could also just be on the list too.","commit_id":"d08d514bf3c4c8a6b6d1374bab881a44b799c66b"}]}
