Skip to content

Commit

Permalink
fixed registration with environments
Browse files Browse the repository at this point in the history
  • Loading branch information
jstavel committed Dec 6, 2024
1 parent 7487ee6 commit 76004fc
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 6 deletions.
8 changes: 5 additions & 3 deletions integration-tests/test_consumer.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,11 @@
import pytest
import contextlib
from pytest_client_tools.util import Version
import conftest
from utils import loop_until
from constants import RHSM, RHSM_CONSUMER
from dasbus.error import DBusError
from dasbus.typing import get_variant, Str
from funcy import first

import sh
import subprocess
Expand All @@ -22,8 +23,9 @@ def test_get_uuid(external_candlepin, subman, test_config, status_of_registratio
if status_of_registration == "registered":
subman.register(username=test_config.get("candlepin","username"),
password=test_config.get("candlepin","password"),
org=test_config.get("candlepin","org") or "")
conftest.loop_until(lambda: subman.is_registered)
org=test_config.get("candlepin","org") or "",
environments=first(test_config.get("candlepin","environment","names")))
loop_until(lambda: subman.is_registered)

if status_of_registration == "not_registered":
assert not subman.is_registered
Expand Down
9 changes: 6 additions & 3 deletions integration-tests/test_unregister.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,14 +2,15 @@
import pytest
import contextlib
from pytest_client_tools.util import Version
import conftest
from utils import loop_until
from constants import RHSM, RHSM_UNREGISTER

import sh
import subprocess
import json
import logging
from functools import partial
from funcy import first

log = logging.getLogger(__name__)

Expand All @@ -19,8 +20,10 @@ def test_unregister(external_candlepin, subman, test_config):
"""
candlepin_config = partial(test_config.get, "candlepin")
subman.register(username=candlepin_config("username"),
password=candlepin_config("password"))
conftest.loop_until(lambda: subman.is_registered)
password=candlepin_config("password"),
org=candlepin_config("org"),
environments=first(candlepin_config("environment","names")))
loop_until(lambda: subman.is_registered)
proxy=RHSM.get_proxy(RHSM_UNREGISTER, interface_name=RHSM_UNREGISTER)
# proxy = RHSM.get_proxy(RHSM.service_name,
# RHSM_UNREGISTER.object_path)
Expand Down

0 comments on commit 76004fc

Please sign in to comment.