Skip to content

Commit

Permalink
added verification for cert returned in Register response
Browse files Browse the repository at this point in the history
  • Loading branch information
jstavel committed Dec 13, 2024
1 parent be24f5c commit 75e897a
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion integration-tests/test_register.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@

import os
import pytest
import json
from conftest import RHSMPrivateBus
from constants import RHSM, RHSM_REGISTER_SERVER, RHSM_REGISTER
from dasbus.error import DBusError
Expand Down Expand Up @@ -47,14 +48,20 @@ def test_register(any_candlepin, subman, test_config):
with RHSMPrivateBus(proxy) as private_bus:
private_proxy = private_bus.get_proxy(RHSM.service_name, RHSM_REGISTER.object_path)
locale = os.environ.get("LANG", "")
private_proxy.Register(
response = private_proxy.Register(
"",
test_config.get("candlepin", "username"),
test_config.get("candlepin", "password"),
{},
{},
locale,
)
response_data = json.loads(response)
assert "idCert" in response_data, "A response contains of consumer certificate"
assert frozenset(["key", "cert", "updated", "created", "id", "serial"]).issubset(
frozenset(response_data["idCert"].keys())
)

assert subman.is_registered


Expand Down

0 comments on commit 75e897a

Please sign in to comment.