Verify the cgroup supported level (#3688)

* Verify the cgroup supported level

* add tests
This commit is contained in:
Pascal Vizeli
2022-06-22 17:22:27 +02:00
committed by GitHub
parent b001aa882a
commit 1f69cf0fe6
3 changed files with 38 additions and 8 deletions

View File

@@ -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