<?xml version="1.0" encoding="utf-8"?><testsuites name="pytest tests"><testsuite name="pytest" errors="0" failures="5" skipped="0" tests="5" time="0.556" timestamp="2026-05-28T20:15:12.448883+00:00" hostname="maas-group-test-9485t-e2e-maas-openshift-pod"><testcase classname="test.e2e.tests.test_api_keys.TestAPIKeyCRUD" name="test_create_api_key" time="0.034"><failure message="AssertionError: Expected 200/201, got 503: no healthy upstream&#10;assert 503 in (200, 201)&#10; +  where 503 = &lt;Response [503]&gt;.status_code">self = &lt;test_api_keys.TestAPIKeyCRUD object at 0x7f43dc230ca0&gt;
api_keys_base_url = 'https://maas.apps.3032180c-dd51-4418-b26f-d5f2ff13b21f.prod.konfluxeaas.com/maas-api/v1/api-keys'
headers = {'Authorization': 'Bearer eyJhbGciOiJSUzI1NiIsImtpZCI6ImhhYnd6NkpWempLbnVWV0Qzd3pub1A5aW5JTjZ0UHVQRFliRWV0ZXFOMUUifQ.e...le3Gwf0bHcphPBZYHaFvuAccnpyoaEqqUEjSswbgcik6gxaYPSlXVuJaNZzxPdmXsZqj5pLEv4NZBds_Q', 'Content-Type': 'application/json'}

    def test_create_api_key(self, api_keys_base_url: str, headers: dict):
        """Test 1: Create API key - verify format and show-once pattern."""
        r = requests.post(
            api_keys_base_url,
            headers=headers,
            json={"name": "test-key-create"},
            timeout=30,
            verify=TLS_VERIFY,
        )
&gt;       assert r.status_code in (200, 201), f"Expected 200/201, got {r.status_code}: {r.text}"
E       AssertionError: Expected 200/201, got 503: no healthy upstream
E       assert 503 in (200, 201)
E        +  where 503 = &lt;Response [503]&gt;.status_code

test/e2e/tests/test_api_keys.py:93: AssertionError</failure></testcase><testcase classname="test.e2e.tests.test_api_keys.TestAPIKeyCRUD" name="test_list_api_keys" time="0.027"><failure message="assert 503 in (200, 201)&#10; +  where 503 = &lt;Response [503]&gt;.status_code">self = &lt;test_api_keys.TestAPIKeyCRUD object at 0x7f43dc225be0&gt;
api_keys_base_url = 'https://maas.apps.3032180c-dd51-4418-b26f-d5f2ff13b21f.prod.konfluxeaas.com/maas-api/v1/api-keys'
headers = {'Authorization': 'Bearer eyJhbGciOiJSUzI1NiIsImtpZCI6ImhhYnd6NkpWempLbnVWV0Qzd3pub1A5aW5JTjZ0UHVQRFliRWV0ZXFOMUUifQ.e...le3Gwf0bHcphPBZYHaFvuAccnpyoaEqqUEjSswbgcik6gxaYPSlXVuJaNZzxPdmXsZqj5pLEv4NZBds_Q', 'Content-Type': 'application/json'}

    def test_list_api_keys(self, api_keys_base_url: str, headers: dict):
        """Test 2: List own keys - verify basic functionality."""
        # Create two keys
        r1 = requests.post(api_keys_base_url, headers=headers, json={"name": "test-key-list-1"}, timeout=30, verify=TLS_VERIFY)
&gt;       assert r1.status_code in (200, 201)
E       assert 503 in (200, 201)
E        +  where 503 = &lt;Response [503]&gt;.status_code

test/e2e/tests/test_api_keys.py:114: AssertionError</failure></testcase><testcase classname="test.e2e.tests.test_api_keys.TestAPIKeyCRUD" name="test_revoke_api_key" time="0.025"><failure message="assert 503 in (200, 201)&#10; +  where 503 = &lt;Response [503]&gt;.status_code">self = &lt;test_api_keys.TestAPIKeyCRUD object at 0x7f43dc225f10&gt;
api_keys_base_url = 'https://maas.apps.3032180c-dd51-4418-b26f-d5f2ff13b21f.prod.konfluxeaas.com/maas-api/v1/api-keys'
headers = {'Authorization': 'Bearer eyJhbGciOiJSUzI1NiIsImtpZCI6ImhhYnd6NkpWempLbnVWV0Qzd3pub1A5aW5JTjZ0UHVQRFliRWV0ZXFOMUUifQ.e...le3Gwf0bHcphPBZYHaFvuAccnpyoaEqqUEjSswbgcik6gxaYPSlXVuJaNZzxPdmXsZqj5pLEv4NZBds_Q', 'Content-Type': 'application/json'}

    def test_revoke_api_key(self, api_keys_base_url: str, headers: dict):
        """Test 3: Revoke key - verify status change to 'revoked'."""
        # Create a key
        r_create = requests.post(api_keys_base_url, headers=headers, json={"name": "test-key-revoke"}, timeout=30, verify=TLS_VERIFY)
&gt;       assert r_create.status_code in (200, 201)
E       assert 503 in (200, 201)
E        +  where 503 = &lt;Response [503]&gt;.status_code

test/e2e/tests/test_api_keys.py:169: AssertionError</failure></testcase><testcase classname="test.e2e.tests.test_api_keys.TestAPIKeyAuthorization" name="test_admin_manage_other_users_keys" time="0.022"><failure message="assert 503 in (200, 201)&#10; +  where 503 = &lt;Response [503]&gt;.status_code">self = &lt;test_api_keys.TestAPIKeyAuthorization object at 0x7f43dc749490&gt;
api_keys_base_url = 'https://maas.apps.3032180c-dd51-4418-b26f-d5f2ff13b21f.prod.konfluxeaas.com/maas-api/v1/api-keys'
headers = {'Authorization': 'Bearer eyJhbGciOiJSUzI1NiIsImtpZCI6ImhhYnd6NkpWempLbnVWV0Qzd3pub1A5aW5JTjZ0UHVQRFliRWV0ZXFOMUUifQ.e...le3Gwf0bHcphPBZYHaFvuAccnpyoaEqqUEjSswbgcik6gxaYPSlXVuJaNZzxPdmXsZqj5pLEv4NZBds_Q', 'Content-Type': 'application/json'}
admin_headers = {'Authorization': 'Bearer eyJhbGciOiJSUzI1NiIsImtpZCI6ImhhYnd6NkpWempLbnVWV0Qzd3pub1A5aW5JTjZ0UHVQRFliRWV0ZXFOMUUifQ.e...zFlVbloZMlqzo5cYTqqLjH4pRrvDZi52aXhBlo7gXYK3W5ghZbjM0AUNEK_CSJX7rMRgEgKgqKDHwZLAw', 'Content-Type': 'application/json'}

    def test_admin_manage_other_users_keys(self, api_keys_base_url: str, headers: dict, admin_headers: dict):
        """Test 4: Admin can manage other user's keys - list and revoke."""
        if not admin_headers:
            pytest.skip("ADMIN_OC_TOKEN not set")
    
        # Create key as regular user
        r_create = requests.post(api_keys_base_url, headers=headers, json={"name": "regular-user-key"}, timeout=30, verify=TLS_VERIFY)
&gt;       assert r_create.status_code in (200, 201)
E       assert 503 in (200, 201)
E        +  where 503 = &lt;Response [503]&gt;.status_code

test/e2e/tests/test_api_keys.py:194: AssertionError</failure></testcase><testcase classname="test.e2e.tests.test_api_keys.TestAPIKeyAuthorization" name="test_non_admin_cannot_access_other_users_keys" time="0.023"><failure message="assert 503 in (200, 201)&#10; +  where 503 = &lt;Response [503]&gt;.status_code">self = &lt;test_api_keys.TestAPIKeyAuthorization object at 0x7f43dc749970&gt;
api_keys_base_url = 'https://maas.apps.3032180c-dd51-4418-b26f-d5f2ff13b21f.prod.konfluxeaas.com/maas-api/v1/api-keys'
headers = {'Authorization': 'Bearer eyJhbGciOiJSUzI1NiIsImtpZCI6ImhhYnd6NkpWempLbnVWV0Qzd3pub1A5aW5JTjZ0UHVQRFliRWV0ZXFOMUUifQ.e...le3Gwf0bHcphPBZYHaFvuAccnpyoaEqqUEjSswbgcik6gxaYPSlXVuJaNZzxPdmXsZqj5pLEv4NZBds_Q', 'Content-Type': 'application/json'}
admin_headers = {'Authorization': 'Bearer eyJhbGciOiJSUzI1NiIsImtpZCI6ImhhYnd6NkpWempLbnVWV0Qzd3pub1A5aW5JTjZ0UHVQRFliRWV0ZXFOMUUifQ.e...zFlVbloZMlqzo5cYTqqLjH4pRrvDZi52aXhBlo7gXYK3W5ghZbjM0AUNEK_CSJX7rMRgEgKgqKDHwZLAw', 'Content-Type': 'application/json'}

    def test_non_admin_cannot_access_other_users_keys(self, api_keys_base_url: str, headers: dict, admin_headers: dict):
        """Test 5: Non-admin cannot access other user's keys - verify denial.
    
        Note: API returns 404 instead of 403 for IDOR protection (prevents key enumeration).
        This is a security best practice - returning 403 would reveal the key exists.
        """
        if not admin_headers:
            pytest.skip("ADMIN_OC_TOKEN not set")
    
        # Admin creates a key
        r_admin = requests.post(api_keys_base_url, headers=admin_headers, json={"name": "admin-only-key"}, timeout=30, verify=TLS_VERIFY)
&gt;       assert r_admin.status_code in (200, 201)
E       assert 503 in (200, 201)
E        +  where 503 = &lt;Response [503]&gt;.status_code

test/e2e/tests/test_api_keys.py:239: AssertionError</failure></testcase></testsuite></testsuites>