Tests: isolation check moved to the pytest_sessionstart().

This change eliminates the need for some classes
to run Unit one more time before running tests.
This commit is contained in:
Andrei Zeliankou
2020-12-09 16:15:50 +00:00
parent 783cdc2a3d
commit 4c846ae693
10 changed files with 197 additions and 259 deletions

View File

@@ -2,30 +2,13 @@ import shutil
import pytest
from conftest import unit_run
from conftest import unit_stop
from unit.applications.lang.python import TestApplicationPython
from unit.feature.isolation import TestFeatureIsolation
from unit.option import option
class TestPythonIsolation(TestApplicationPython):
prerequisites = {'modules': {'python': 'any'}, 'features': ['isolation']}
@classmethod
def setup_class(cls, complete_check=True):
check = super().setup_class(complete_check=False)
unit = unit_run()
option.temp_dir = unit['temp_dir']
TestFeatureIsolation().check(option.available, unit['temp_dir'])
assert unit_stop() is None
shutil.rmtree(unit['temp_dir'])
return check if not complete_check else check()
def test_python_isolation_rootfs(self, is_su, temp_dir):
isolation_features = option.available['features']['isolation'].keys()