mirror of
https://salsa.debian.org/freeipa-team/freeipa.git
synced 2024-12-22 23:23:30 -06:00
Add missing fedora_container platform members
The fedora_container platform was missing User and Group members. Add test case to verify that all known platforms define correct module API. Fixes: https://pagure.io/freeipa/issue/8519 Signed-off-by: Christian Heimes <cheimes@redhat.com> Reviewed-By: Alexander Bokovoy <abokovoy@redhat.com>
This commit is contained in:
parent
9f0ec27e9f
commit
1684b0f2c3
@ -3,7 +3,10 @@
|
||||
#
|
||||
"""Fedora container constants
|
||||
"""
|
||||
from ipaplatform.fedora.constants import FedoraConstantsNamespace
|
||||
from ipaplatform.fedora.constants import FedoraConstantsNamespace, User, Group
|
||||
|
||||
|
||||
__all__ = ("constants", "User", "Group")
|
||||
|
||||
|
||||
class FedoraContainerConstantsNamespace(FedoraConstantsNamespace):
|
||||
|
41
ipatests/test_ipaplatform/test_platforms.py
Normal file
41
ipatests/test_ipaplatform/test_platforms.py
Normal file
@ -0,0 +1,41 @@
|
||||
#
|
||||
# Copyright (C) 2020 FreeIPA Contributors see COPYING for license
|
||||
#
|
||||
"""Test import and basic properties of platforms
|
||||
"""
|
||||
from importlib import import_module
|
||||
|
||||
import pytest
|
||||
|
||||
from ipaplatform.base.constants import BaseConstantsNamespace, User, Group
|
||||
from ipaplatform.base.paths import BasePathNamespace
|
||||
from ipaplatform.base.services import KnownServices
|
||||
from ipaplatform.base.tasks import BaseTaskNamespace
|
||||
|
||||
PLATFORMS = [
|
||||
"debian",
|
||||
"fedora",
|
||||
"fedora_container",
|
||||
"rhel",
|
||||
"rhel_container",
|
||||
"suse",
|
||||
]
|
||||
|
||||
|
||||
@pytest.mark.parametrize("name", PLATFORMS)
|
||||
def test_import_platform(name):
|
||||
constants = import_module(f"ipaplatform.{name}.constants")
|
||||
assert isinstance(constants.constants, BaseConstantsNamespace)
|
||||
assert issubclass(constants.User, User)
|
||||
assert issubclass(constants.Group, Group)
|
||||
|
||||
paths = import_module(f"ipaplatform.{name}.paths")
|
||||
assert isinstance(paths.paths, BasePathNamespace)
|
||||
|
||||
services = import_module(f"ipaplatform.{name}.services")
|
||||
assert isinstance(services.knownservices, KnownServices)
|
||||
assert isinstance(services.timedate_services, list)
|
||||
assert callable(services.service)
|
||||
|
||||
tasks = import_module(f"ipaplatform.{name}.tasks")
|
||||
assert isinstance(tasks.tasks, BaseTaskNamespace)
|
Loading…
Reference in New Issue
Block a user