mirror of
https://github.com/home-assistant/supervisor.git
synced 2025-11-09 10:59:43 +00:00
Verify the cgroup supported level (#3688)
* Verify the cgroup supported level * add tests
This commit is contained in:
@@ -5,6 +5,7 @@ from unittest.mock import patch
|
||||
from supervisor.const import CoreState
|
||||
from supervisor.coresys import CoreSys
|
||||
from supervisor.resolution.evaluations.docker_configuration import (
|
||||
EXPECTED_CGROUP_VERSION,
|
||||
EXPECTED_LOGGING,
|
||||
EXPECTED_STORAGE,
|
||||
EvaluateDockerConfiguration,
|
||||
@@ -20,18 +21,28 @@ async def test_evaluation(coresys: CoreSys):
|
||||
|
||||
coresys.docker.info.storage = "unsupported"
|
||||
coresys.docker.info.logging = EXPECTED_LOGGING
|
||||
coresys.docker.info.cgroup = EXPECTED_CGROUP_VERSION
|
||||
await docker_configuration()
|
||||
assert docker_configuration.reason in coresys.resolution.unsupported
|
||||
coresys.resolution.unsupported.clear()
|
||||
|
||||
coresys.docker.info.storage = EXPECTED_STORAGE
|
||||
coresys.docker.info.logging = "unsupported"
|
||||
coresys.docker.info.cgroup = EXPECTED_CGROUP_VERSION
|
||||
await docker_configuration()
|
||||
assert docker_configuration.reason in coresys.resolution.unsupported
|
||||
coresys.resolution.unsupported.clear()
|
||||
|
||||
coresys.docker.info.storage = EXPECTED_STORAGE
|
||||
coresys.docker.info.logging = EXPECTED_LOGGING
|
||||
coresys.docker.info.cgroup = "unsupported"
|
||||
await docker_configuration()
|
||||
assert docker_configuration.reason in coresys.resolution.unsupported
|
||||
coresys.resolution.unsupported.clear()
|
||||
|
||||
coresys.docker.info.storage = EXPECTED_STORAGE
|
||||
coresys.docker.info.logging = EXPECTED_LOGGING
|
||||
coresys.docker.info.cgroup = EXPECTED_CGROUP_VERSION
|
||||
await docker_configuration()
|
||||
assert docker_configuration.reason not in coresys.resolution.unsupported
|
||||
|
||||
|
||||
Reference in New Issue
Block a user